# Dimension of affine variety mod $p$ can only increase

Let $$X$$ be an affine variety defined by polynomials over $$\mathbb{Z}$$. Reducing the polynomials modulo $$p$$, we obtain a variety $$X_p$$ defined over the finite field $$\mathbb{F}_p$$.

Is it true that the dimension of $$X_p$$ is larger or equal to the dimension of $$X$$?

Note: It seems likely to me that the dimension stays the same for all but finitely many primes $$p$$, and this answers says that it is the case for projective varieties. My question is different: I'm asking about affine varieties, I'm asking about all primes, and I'm only asking for an inequality.

EDIT: To make the second part of the question explicit:

In addition, is it also true that $$\dim X_p=\dim X$$ for all but finitely many primes $$p$$?

• I assume "dimension of $X$" means "dimension of $X$ as a variety over $\mathbf Q$" or something equivalent. In that case the answer to the first question is no: If $X$ is the subvariety of $\mathbf A^1$ defined by $2x=1$ then its dimension is 0, but its reduction mod 2 has dimension $-\infty$. – Lazzaro Campeotti Nov 21 '19 at 13:35
• @LazzaroCampeotti: Yes, you are right. Do you know if "dimension cannot decrease" is true for projective varieties, as implied without proof by the answer to the question I linked to? – Sean Nov 21 '19 at 13:48
• Dear Sean, for sure it is true in the projective case. There is a great discussion at this MO question: mathoverflow.net/questions/193/… – Lazzaro Campeotti Nov 21 '19 at 13:51

Let $$f:X\rightarrow S$$ be a morphism of finite type where $$S$$ is an irreducible scheme (with generic point $$\eta$$). If $$n=\mathrm{dim}X_\eta$$ then there exists a nonempty open $$U\subseteq S$$ such that for all $$s\in U$$ one has $$\mathrm{dim} X_s=n$$.
Hence, whenever you have a variety $$X$$ over $$\mathbf{Z}$$ (which means a $$\mathrm{Spec}(\mathbf{Z})$$-scheme of finite type), the dimension of $$X\otimes_\mathbf{Z} \mathbf{F}_p$$ (the fiber over $$(p)$$) is equal to that of $$X\otimes_\mathbf{Z}\mathbf{Q}$$ (the fiber over the generic point of $$\mathrm{Spec}(\mathbf{Z})$$) for all but finitely many primes $$p$$.
Finally, your question amounts to knowing if $$\mathrm{dim}X\leq\mathrm{dim}(X\otimes_\mathbf{Z}\mathbf{Q})$$, but this is not always true: consider $$X=\mathrm{Spec}(\mathbf{Z}\left[ X\right] /(2))=\mathrm{Spec}(\mathbf{F}_2\left[ X\right] )$$ so that $$\mathrm{dim}(X)=1$$ while $$\mathrm{dim}(X\otimes_\mathbf{Z}\mathbf{Q})=-\infty$$.