Dimension of Affine Algebraic Set is Dimension of Affine Coordinate Ring

Theorem
Let $k$ be a field.

Let $Y \subseteq k^n$ be an affine algebraic set.

Let $\map A Y$ be the affine coordinate ring.

Then:
 * $\map \dim Y = \map \dim {\map A Y}$

where:
 * $\map \dim Y$ is the Krull dimension of $Y$ with respect to Zariski topology
 * $\map \dim {\map A Y}$ is the Krull dimension of $\map A Y$