# How to compute the dimension of $V(f,g)$ in $\mathbb Z[x_1,...,x_n]$

Consider the ring $$R = \mathbb Z[x_1,...,x_n]$$ and let $$\text{Spec}(R) = \{q \subset R : q \text{ a prime ideal}\}$$ be the set of prime ideals of $$R$$. For $$I \subset R$$ an ideal, define $$V(I) = \{q \in \text{Spec}(R) : I \subset q\}$$ to be the set of prime ideals containing $$I$$. The $$V(I)$$'s are the closed sets of $$\text{Spec}(R)$$ in the Zariski topology.

For $$f, g \in R \setminus \{0\}$$ prime elements, I'm asked to compute $$\dim V(I)$$, where $$I = (f,g)$$ and the dimension is defined as here and is linked to here in the sense that $$\dim V(I) = \dim (R/\text{rad}(I))$$.

If $$R$$ were a finitely generated $$K$$-algebra for a field $$K$$, it would be easier. So I've tried to consider the quotient $$\mathbb Z/p[x_1,...,x_n]$$ for a prime $$p$$ in $$\mathbb Z$$.

However, I am not sure on whether $$(f)$$ and $$(g)$$ would still be prime in this quotient, but maybe I can choose $$p$$ so it is always the case. Even if they are, $$I$$ is not necessarily prime so this is also a problem.

So I wanted to quotient first by $$(f)$$ and then by $$(g)$$ to have the quotient by $$(f,g)$$ but again, we don't know if $$(\bar{g})$$ is prime in $$\mathbb Z/p[x_1,...,x_n]/(f)$$...

Has anyone got an idea ?

For problems like this its very helpful to think geometrically (ignoring the fact that we don't have varieties), and then use the necessary theorems to justify our geometric intuition.

We want to think to think of $$V(f)$$ as an irreducible subspace of $$\text{Spec}(R)$$, and if this $$f$$ were a (nice) function on a manifold, we would expect its zeroset to be codimension one. Then $$V(f,g)$$ is the zeroset of the function $$g$$ restricted to the vanishing set of $$f$$, so this function could be either zero, or invertible on $$V(f)$$, or restrict to a function with zeroes as expected, resulting in a codimension $$2$$ space inside $$\text{Spec}(R)$$.

So now lets make these three cases precise. The tool for dealing with expected codimension is Krull's principal ideal theorem, which since $$f$$ is a prime element implies that $$V(f)$$ is codimension $$1$$ in $$\text{Spec}(R)$$, and since $$R$$ is caternary (aka, codimension is complementary to dimension), this implies $$V(f)$$ has dimension $$n$$, since $$R$$ has dimension $$n+1$$.

Now, if $$g=f$$, then $$g$$ restricts to zero on $$V(f)$$, equivalently, is in the ideal generated by $$f$$, and this gives our first case, where $$V(f,g)$$ is dimension $$n$$.

The second case is when $$g$$ doesn't vanish on $$V(f)$$, which is to say $$g$$ is a unit in $$R/(f)$$. In this case, our vanishing set is empty, which agrees with the fact that $$R/(f,g)$$ is the zero ring since $$g$$ is a unit in $$R/(f)$$.

The last case is when the expected thing happens, we get a nonzero element of the domain $$R/(f)$$, though now $$g$$ might not be a prime element in this ring, it could have vanishing set with multiple components, for instance: $$f=2$$ $$g=2+x^2-y^2$$

Now we use the principal ideal theorem again, this time in full, which tells us that the irreducible components of $$V(f,g)$$ inside $$V(f)$$ will all be codimension $$1$$, so since the catenary property passes to quotients, we see that in this case $$V(f,g)$$ will be codimension $$2$$ in $$\text{Spec}(R)$$, and will have all irreducible components of dimension $$n-1$$.

This exhausts the three cases, and all of these can occur, for an example of the second case, we can take: $$f=x$$ $$g=x+1$$ Geometrically, this is taking our two codimension one subsets to be translates of each other, so of course they won't intersect.