[proofplan]
We first translate closed subsets of $X$ into ideals of the [quotient ring](/page/Quotient%20Ring) $k[X]$ by using the quotient map from the ambient [polynomial ring](/page/Polynomial%20Ring). The affine Nullstellensatz dictionary gives the radical ideal correspondence, and irreducibility is then detected by primality through the coordinate ring. The maximal ideal, regular function, and dimension assertions are the standard affine dictionary statements: points are maximal ideals, global [regular functions are coordinate ring elements](/theorems/9419), and for irreducible affine varieties the topological dimension agrees with the transcendence degree of the function field.
[/proofplan]
[step:Pass from ambient equations to equations in the coordinate ring]
Let
\begin{align*}
S:=k[x_1,\dots,x_n]
\end{align*}
and let
\begin{align*}
\pi:S\to k[X]
\end{align*}
be the quotient homomorphism with kernel $I(X)$. For an ideal $J\trianglelefteq S$, write
\begin{align*}
V(J):=\{a\in \mathbb A_k^n: h(a)=0 \text{ for every } h\in J\}
\end{align*}
for its affine zero set in $\mathbb A_k^n$. For a closed algebraic subset $Y\subseteq X$, define
\begin{align*}
I_X(Y):=\{\bar f\in k[X]: f(y)=0 \text{ for every } y\in Y\},
\end{align*}
where $\bar f:=\pi(f)$ denotes the class of $f\in S$. This is well-defined because two representatives of the same class differ by an element of $I(X)$, hence agree as functions on $X$.
For an ideal $\mathfrak a\trianglelefteq k[X]$, define
\begin{align*}
V_X(\mathfrak a):=\{x\in X: g(x)=0 \text{ for every } g\in \mathfrak a\}.
\end{align*}
If $J:=\pi^{-1}(\mathfrak a)\trianglelefteq S$, then $I(X)\subseteq J$ and
\begin{align*}
V_X(\mathfrak a)=X\cap V(J).
\end{align*}
Thus $V_X(\mathfrak a)$ is closed in $X$. Conversely, every closed algebraic subset $Y\subseteq X$ is of the form $Y=X\cap V(J)$ for some ideal $J\trianglelefteq S$, and then $Y=V_X(\pi(J))$.
[guided]
The point of this step is to make precise how equations on $X$ are the same as equations in the quotient ring $k[X]$. Let
\begin{align*}
S:=k[x_1,\dots,x_n]
\end{align*}
and let
\begin{align*}
\pi:S\to k[X]
\end{align*}
be the quotient map. Its kernel is $I(X)$ by the definition of the coordinate ring. For an ideal $J\trianglelefteq S$, write
\begin{align*}
V(J):=\{a\in \mathbb A_k^n: h(a)=0 \text{ for every } h\in J\}
\end{align*}
for its affine zero set in $\mathbb A_k^n$.
If $Y\subseteq X$ is closed, we define its vanishing ideal inside the coordinate ring by
\begin{align*}
I_X(Y):=\{\bar f\in k[X]: f(y)=0 \text{ for every } y\in Y\}.
\end{align*}
This definition uses a representative $f\in S$ of the class $\bar f$. We must check that the definition does not depend on the representative. If $\bar f=\bar g$ in $k[X]$, then $f-g\in I(X)$, so $f(x)=g(x)$ for every $x\in X$. Since $Y\subseteq X$, this gives $f(y)=g(y)$ for every $y\in Y$. Hence the condition of vanishing on $Y$ is well-defined for classes in $k[X]$.
Now let $\mathfrak a\trianglelefteq k[X]$ be an ideal. We define its zero set inside $X$ by
\begin{align*}
V_X(\mathfrak a):=\{x\in X: g(x)=0 \text{ for every } g\in \mathfrak a\}.
\end{align*}
Let
\begin{align*}
J:=\pi^{-1}(\mathfrak a)\trianglelefteq S.
\end{align*}
Because $\ker\pi=I(X)$, we have $I(X)\subseteq J$. A point $x\in X$ lies in $V_X(\mathfrak a)$ exactly when every class in $\mathfrak a$ vanishes at $x$, which is exactly when every polynomial in $J$ vanishes at $x$. Therefore
\begin{align*}
V_X(\mathfrak a)=X\cap V(J).
\end{align*}
This proves that $V_X(\mathfrak a)$ is closed in the [subspace topology](/page/Subspace%20Topology) on $X$.
Conversely, if $Y\subseteq X$ is closed algebraic, then $Y=X\cap V(J)$ for some ideal $J\trianglelefteq S$. Replacing $J$ by $J+I(X)$ if necessary, we may assume $I(X)\subseteq J$. Then $\pi(J)$ is an ideal of $k[X]$, and the same evaluation argument gives
\begin{align*}
Y=V_X(\pi(J)).
\end{align*}
Thus the zero sets in $X$ are exactly the zero sets of ideals of $k[X]$.
[/guided]
[/step]
[step:Apply the Nullstellensatz to identify closed subsets with radical ideals]
We claim that for every closed algebraic subset $Y\subseteq X$,
\begin{align*}
V_X(I_X(Y))=Y
\end{align*}
and for every ideal $\mathfrak a\trianglelefteq k[X]$,
\begin{align*}
I_X(V_X(\mathfrak a))=\sqrt{\mathfrak a}
\end{align*}
Indeed, write $Y=X\cap V(J)$ with $J\trianglelefteq S$ and $I(X)\subseteq J$. Since $X$ is an affine algebraic set, $I(X)$ is radical by the affine [closed set](/page/Closed%20Set) and radical ideal correspondence [citetheorem:9414] applied to $X\subseteq \mathbb A_k^n$. The same theorem, applied in $\mathbb A_k^n$ to the closed set $Y=V(J)$ after replacing $J$ by $J+I(X)$, gives
\begin{align*}
I(Y)=\sqrt{J}
\end{align*}
using that $k$ is algebraically closed. The quotient map $\pi:S\to k[X]$ identifies ideals of $k[X]$ with ideals of $S$ containing $I(X)$ by $\mathfrak b\mapsto \pi^{-1}(\mathfrak b)$ and $J\mapsto J/I(X)$. Since $I(X)\subseteq J$, this gives
\begin{align*}
I_X(Y)=I(Y)/I(X)=\sqrt{J}/I(X)
\end{align*}
The radical quotient identity gives
\begin{align*}
\sqrt{J}/I(X)=\sqrt{J/I(X)}
\end{align*}
because, for $f+I(X)\in S/I(X)$, the class $f+I(X)$ is nilpotent modulo $J/I(X)$ if and only if $f^m\in J$ for some $m\ge 1$, equivalently $f\in \sqrt J$. Hence $I_X(Y)=\sqrt{J/I(X)}$. Applying $V_X$ gives $V_X(I_X(Y))=Y$ because $Y$ is already the closed zero set in $X$ defined by $J/I(X)$.
For the arbitrary-ideal identity, let $\mathfrak a\trianglelefteq k[X]$ and set
\begin{align*}
J:=\pi^{-1}(\mathfrak a)\trianglelefteq S
\end{align*}
Then $I(X)\subseteq J$, $J/I(X)=\mathfrak a$, and the previous step gives
\begin{align*}
V_X(\mathfrak a)=X\cap V(J)
\end{align*}
Apply the ambient affine closed set and radical ideal correspondence [citetheorem:9414] to the closed subset $V(J)\subseteq \mathbb A_k^n$, and then pass through the quotient by $I(X)$. This yields
\begin{align*}
I_X(V_X(\mathfrak a))=\sqrt{J}/I(X)=\sqrt{J/I(X)}=\sqrt{\mathfrak a}
\end{align*}
Therefore $Y\mapsto I_X(Y)$ and $\mathfrak a\mapsto V_X(\mathfrak a)$ are mutually inverse after restricting ideals to radical ideals. The correspondence is inclusion-reversing because if $Y_1\subseteq Y_2\subseteq X$, then every function vanishing on $Y_2$ vanishes on $Y_1$, so
\begin{align*}
I_X(Y_2)\subseteq I_X(Y_1)
\end{align*}
and if $\mathfrak a\subseteq \mathfrak b$, then every point annihilating all elements of $\mathfrak b$ annihilates all elements of $\mathfrak a$, so
\begin{align*}
V_X(\mathfrak b)\subseteq V_X(\mathfrak a)
\end{align*}
[guided]
The purpose of this step is to prove the relative Nullstellensatz on $X$ by reducing it to the ambient Nullstellensatz in $\mathbb A_k^n$. Let $Y\subseteq X$ be closed. Then $Y=X\cap V(J)$ for some ideal $J\trianglelefteq S$, and after replacing $J$ by $J+I(X)$ we have $I(X)\subseteq J$ and $Y=V(J)$ as a subset of $\mathbb A_k^n$. Since $k$ is algebraically closed, the affine closed set and radical ideal correspondence [citetheorem:9414] gives
\begin{align*}
I(Y)=\sqrt J
\end{align*}
The vanishing ideal inside $k[X]=S/I(X)$ is obtained by quotienting by $I(X)$, so
\begin{align*}
I_X(Y)=I(Y)/I(X)=\sqrt J/I(X)
\end{align*}
This quotient is exactly $\sqrt{J/I(X)}$: a class $f+I(X)$ lies in $\sqrt{J/I(X)}$ precisely when $(f+I(X))^m\in J/I(X)$ for some $m\ge 1$, which is equivalent to $f^m\in J$, hence to $f\in \sqrt J$. Therefore $I_X(Y)=\sqrt{J/I(X)}$, and applying $V_X$ returns the original closed set $Y$.
Now start with an arbitrary ideal $\mathfrak a\trianglelefteq k[X]$. Its inverse image $J:=\pi^{-1}(\mathfrak a)$ is an ideal of $S$ containing $I(X)$, and $J/I(X)=\mathfrak a$. The zero set defined by $\mathfrak a$ inside $X$ is the same subset as $X\cap V(J)$. Applying the ambient Nullstellensatz to $V(J)\subseteq \mathbb A_k^n$ gives the ambient vanishing ideal $\sqrt J$, and passing to $S/I(X)$ gives
\begin{align*}
I_X(V_X(\mathfrak a))=\sqrt J/I(X)=\sqrt{J/I(X)}=\sqrt{\mathfrak a}
\end{align*}
Thus closed algebraic subsets of $X$ and radical ideals of $k[X]$ are mutually inverse under $Y\mapsto I_X(Y)$ and $\mathfrak a\mapsto V_X(\mathfrak a)$. The maps reverse inclusions because more points impose fewer equations, while more equations leave fewer points.
[/guided]
[/step]
[step:Detect irreducible closed subsets by prime ideals]
Let $Y\subseteq X$ be a closed algebraic subset. The coordinate ring of $Y$ is
\begin{align*}
k[Y]\cong k[X]/I_X(Y).
\end{align*}
By the irreducibility and domain criterion [citetheorem:9418], applied to the affine algebraic set $Y$, the set $Y$ is irreducible if and only if $k[Y]$ is an [integral domain](/page/Integral%20Domain). The quotient $k[X]/I_X(Y)$ is an integral domain if and only if $I_X(Y)$ is a prime ideal of $k[X]$. Hence irreducible closed subvarieties $Y\subseteq X$ correspond exactly to prime ideals of $k[X]$.
The inclusion reversal is the one already proved: larger subvarieties have smaller vanishing ideals, and larger prime ideals define smaller irreducible closed subsets.
[/step]
[step:Identify points with maximal ideals]
For each point $p\in X$, define
\begin{align*}
\mathfrak m_{p,X}:=\{f\in k[X]: f(p)=0\}.
\end{align*}
Let $\operatorname{MaxSpec}(k[X])$ denote the set of maximal ideals of the ring $k[X]$. The [points as maximal ideals](/theorems/2871) theorem [citetheorem:9417], applied to the affine algebraic set $X$ over the [algebraically closed field](/page/Algebraically%20Closed%20Field) $k$, states precisely that the map
\begin{align*}
X\to \operatorname{MaxSpec}(k[X]),\qquad p\mapsto \mathfrak m_{p,X}
\end{align*}
is a bijection. Thus points of $X$ correspond exactly to maximal ideals of $k[X]$.
[/step]
[step:Identify global regular functions with coordinate ring elements]
Let $\mathcal O(X)$ denote the $k$-algebra of regular functions $X\to k$. By the theorem that regular functions on an affine variety are coordinate ring elements [citetheorem:9419], applied to $X\subseteq \mathbb A_k^n$, the natural homomorphism
\begin{align*}
k[x_1,\dots,x_n]/I(X)\to \mathcal O(X)
\end{align*}
sending the class $\bar F$ of a polynomial $F\in k[x_1,\dots,x_n]$ to the function
\begin{align*}
X\to k,\qquad p\mapsto F(p)
\end{align*}
is an isomorphism of $k$-algebras. Since the source is $k[X]$ by definition, the $k$-algebra of regular functions on $X$ is naturally isomorphic to $k[X]$.
[/step]
[step:Compute the dimension from the function field when $X$ is irreducible]
Assume now that $X$ is irreducible. By the irreducibility and domain criterion [citetheorem:9418], applied to the affine algebraic set $X$, the coordinate ring $k[X]$ is an integral domain. Therefore its fraction field is defined, and we set
\begin{align*}
k(X):=\operatorname{Frac}(k[X])
\end{align*}
The ring $k[X]$ is a finitely generated $k$-algebra because it is a quotient of $k[x_1,\dots,x_n]$. By Noether normalization for finitely generated $k$-domains, there exist algebraically independent elements $y_1,\dots,y_d\in k[X]$ such that $k[X]$ is finite as a module over the polynomial subring
\begin{align*}
k[y_1,\dots,y_d]\subseteq k[X]
\end{align*}
Since $y_1,\dots,y_d$ are algebraically independent, the fraction field of $k[y_1,\dots,y_d]$ is $k(y_1,\dots,y_d)$ and has transcendence degree $d$ over $k$. Since $k[X]$ is finite over $k[y_1,\dots,y_d]$, the [field extension](/page/Field%20Extension)
\begin{align*}
k(y_1,\dots,y_d)\subseteq \operatorname{Frac}(k[X])
\end{align*}
is algebraic, so
\begin{align*}
d=\operatorname{trdeg}_k \operatorname{Frac}(k[X])
\end{align*}
The [dimension theorem](/theorems/915) for affine varieties [citetheorem:9438] applies because $X$ is irreducible, $k[X]$ is its coordinate ring, and the displayed polynomial subring is a Noether-normalizing subring over which $k[X]$ is finite. Hence
\begin{align*}
\dim X=d
\end{align*}
Combining the two equalities yields
\begin{align*}
\dim X=\operatorname{trdeg}_k k(X)
\end{align*}
This proves all parts of the affine coordinate ring dictionary.
[guided]
The last assertion needs the irreducibility hypothesis because the function field is defined as the fraction field of a domain. Since $X$ is irreducible, the irreducibility and domain criterion [citetheorem:9418] says that $k[X]$ is an integral domain. We may therefore define
\begin{align*}
k(X):=\operatorname{Frac}(k[X])
\end{align*}
Now use that $k[X]$ is finitely generated over $k$: it is the quotient of the polynomial ring $k[x_1,\dots,x_n]$ by $I(X)$. Noether normalization for finitely generated $k$-domains gives algebraically independent elements $y_1,\dots,y_d\in k[X]$ such that $k[X]$ is finite as a module over the polynomial subring
\begin{align*}
k[y_1,\dots,y_d]\subseteq k[X]
\end{align*}
The algebraic independence means that $k[y_1,\dots,y_d]$ is a polynomial ring in $d$ variables over $k$, so its fraction field is $k(y_1,\dots,y_d)$ and has transcendence degree $d$ over $k$. Finiteness of $k[X]$ over $k[y_1,\dots,y_d]$ implies that every element of $\operatorname{Frac}(k[X])$ is algebraic over $k(y_1,\dots,y_d)$, hence
\begin{align*}
\operatorname{trdeg}_k k(X)=d
\end{align*}
The dimension theorem for affine varieties [citetheorem:9438] is applicable exactly in this setup: $X$ is irreducible, $k[X]$ is its coordinate ring, and $k[X]$ is finite over the Noether-normalizing polynomial subring $k[y_1,\dots,y_d]$. Therefore
\begin{align*}
\dim X=d
\end{align*}
Combining these two identities gives
\begin{align*}
\dim X=\operatorname{trdeg}_k k(X)
\end{align*}
[/guided]
[/step]