Exercise 1.9 in Hartshorne - is my initial attempt a good start? Hartshorne's Chapter 1, exercise 1.9 asks us to show that irred. components of $Z(\mathfrak a)$ have dimension $\geq n-r$ if $\mathfrak a$ is an ideal generated by $r$ elements. I think I've reduced this to a problem in commutative algebra, but I'm not sure how to tackle it.
My start: for a variety $Y\subset\mathbb A^n$ we have $$\dim Y = n-\operatorname{height}I(Y),$$ thus we need to show that $\operatorname{height}I(Y)\leq r$ if $Y$ is an irred. component of $Z(\mathfrak a)$. I tried to argue by contradiction, supposing we had a chain $$\mathfrak p_0\subset\mathfrak p_1\subset\dots\subset\mathfrak p_{r+1}=I(Y),$$ but I'm not sure how to bring $\mathfrak a$ into play here as we have $I(Y)\supset\mathfrak a$, not the other way around. How would I approach this?
 A: I want to point out that Hartshorne has given you all of the commutative algebra you really need. Let's say $\mathfrak{a}$ can be generated by $f_1, \dots, f_r$. We'll induct on $r$. The only observation is that any irreducible component $Y$ of $Z(\mathfrak{a})$ is contained in an irreducible component $Y'$ of $Z(f_1, \dots, f_{r-1})$, and in fact $Y$ is an irreducible component of $Y' \cap Z(f_r)$.
If you want to finish this off, you would have to justify a few things from the last paragraph and then use (Ex. 1.8) and the theorem (1.8Ab).
A: Let our variety be $Y$ and $Y=Y_1 \cup \cdots \cup Y_s$ its decomposition into irreducible components. Then the vanishing ideals satisfy
$I_Y = I_{Y_1} \cap \cdots \cap I_{Y_s}$. Note that $I_{Y_1},\dots,I_{Y_s}$ are the minimal primes that contain $I_Y$. Since by hypothesis $I_Y$ is generated by $r$, it follows by Krull's Generalized Hauptidealsatz (e.g. Matsumura, Commutative Ring Theory, Theorem 13.5) that the height of each of $I_{Y_i}$ is at most $r$. But since $\dim Y_i = n - \operatorname{height} (I_{Y_i})$, this implies that $\dim Y_i \ge n -r$.
A: This is an immediate consequence of Krull's dimension theorem which can be found here, on page 22.
Krull's Dimension Theorem:
If $\mathfrak{a}$ is an ideal generated by $r$ elements, then $\text{ht}( \mathfrak{p})\leq r$ for every minimal prime $\mathfrak{p}$ of $\mathfrak{a}$. 
Since irreducible components of a variety correspond to minimal prime ideals, we have $\dim (k[x_1,...,x_n]/\mathfrak{p})= \dim (k[x_1,...,x_n])  -\text{ht}(\mathfrak{p})$ and the theorem follows since the dimension of the variety is equivalent to the dimension of the coordinate ring of that variety.
