Here's the problem I'm working on: Let *k* be an algebraically-closed field, and let $X \subseteq \mathbb{A}^2$ be a closed, irreducible set. Show that either:

- $X = Z(0)$, i.e. $X = \mathbb{A}^2$
- $X = Z(f)$ for some irreducible $f \in k[x,y]$
- $X = Z(x-a,y-b)$, i.e. $X$ is a single point

Deduce dim$(\mathbb{A}^2) = 2$. (Hint: Show that the common zero locus of two polynomials $f,g ∈ k[x,y]$ without common factor is finite.)

Here's what I have so far: we know every irreducible closed subset of $\mathbb{A}^2$ corresponds to a prime ideal in $k[x,y]$. This makes the first couple cases simple: If $X$ corresponds to the zero ideal $(0)$, we get case 1. If $X$ corresponds to a principal prime ideal we get case 2, because $k[x,y]$ is a UFD and in a UFD every non-zero element $f$ is irreducible iff $(f)$ is a prime ideal. The issue I'm having is I don't know how to show case 3. By Hilbert's Nullstellensatz we know single points in $\mathbb{A}^2$ correspond to maximal ideals in $k[x,y]$, so it would suffice to show that any non-principal prime ideal in $k[x,y]$ must be maximal. I don't know how to prove the hint, or quite how to use it. I know any set of $n$ points in $\mathbb{A}^2$ will correspond to an intersection of $n$ maximal ideals in $k[x,y]$. But again I don't know what to do with this.

Once I have the three cases done I believe I know how to show $\mathbb{A}^2$ has dimension 2. Thanks in advance.