[proofplan]
The proof translates chains of irreducible closed subsets of $X$ into chains of prime ideals in the coordinate ring $k[X]$. The closed-set/ideal dictionary gives an inclusion-reversing correspondence between closed subsets of $X$ and radical ideals of $k[X]$, while irreducibility corresponds exactly to primality. Thus a strictly decreasing chain of irreducible closed subsets gives a strictly increasing chain of prime ideals of the same length, and conversely. Taking suprema over all finite chains gives the Krull dimension of $k[X]$, which is $\dim X$ by definition.
[/proofplan]
[step:Identify irreducible closed subsets with prime ideals of $k[X]$]
Set $A:=k[X]$. Since $X$ is nonempty, $A$ is not the zero ring and there is at least one irreducible closed subset of $X$: for any point $x\in X$, the singleton $\{x\}$ is closed and irreducible in the subspace Zariski topology. Thus the collection of chains indexed by integers $r\geq 0$ is nonempty.
For a closed subset $Y\subset X$, define its ideal in $A$ by
\begin{align*} I_X(Y):=\{f\in A:f(y)=0\text{ for every }y\in Y\}. \end{align*}
For an ideal $\mathfrak a\trianglelefteq A$, define its vanishing locus inside $X$ by
\begin{align*} V_X(\mathfrak a):=\{x\in X:f(x)=0\text{ for every }f\in\mathfrak a\}. \end{align*}
The hypotheses of the affine closed-set/ideal correspondence in [citetheorem:9455] apply because $k$ is algebraically closed and $X\subset \mathbb A_k^n$ is an affine algebraic set with coordinate ring $A=k[X]$. Hence the assignments $Y\mapsto I_X(Y)$ and $\mathfrak a\mapsto V_X(\mathfrak a)$ give mutually inverse inclusion-reversing correspondences between closed subsets of $X$ and radical ideals of $A$.
We now restrict this correspondence to irreducible closed subsets and prime ideals. If $Y\subset X$ is irreducible and closed, then $Y$ is a closed affine algebraic subset of $\mathbb A_k^n$, and its coordinate ring is
\begin{align*}
k[Y]\cong A/I_X(Y).
\end{align*}
By [citetheorem:9418], the affine algebraic set $Y$ is irreducible if and only if $k[Y]$ is an [integral domain](/page/Integral%20Domain). Hence $A/I_X(Y)$ is an integral domain, so $I_X(Y)$ is a prime ideal of $A$.
Conversely, let $\mathfrak p\trianglelefteq A$ be a prime ideal, and set $Y:=V_X(\mathfrak p)$. Since $\mathfrak p$ is prime, it is radical, so [citetheorem:9455] gives
\begin{align*} I_X(Y)=I_X(V_X(\mathfrak p))=\mathfrak p. \end{align*}
Therefore
\begin{align*} k[Y]\cong A/I_X(Y)=A/\mathfrak p. \end{align*}
Because $\mathfrak p$ is prime, $A/\mathfrak p$ is an integral domain. Applying [citetheorem:9418] again, $Y$ is irreducible. Thus irreducible closed subsets of $X$ correspond exactly to prime ideals of $A$.
[guided]
The goal of this step is to replace geometry by commutative algebra without losing information about chains. We write $A:=k[X]$ for the coordinate ring. For a closed subset $Y\subset X$, define
\begin{align*} I_X(Y):=\{f\in A:f(y)=0\text{ for every }y\in Y\}. \end{align*}
This is the ideal of regular functions on $X$ that vanish on $Y$. In the opposite direction, for an ideal $\mathfrak a\trianglelefteq A$, define
\begin{align*} V_X(\mathfrak a):=\{x\in X:f(x)=0\text{ for every }f\in\mathfrak a\}. \end{align*}
The hypotheses of the affine dictionary [citetheorem:9455] are satisfied: $k$ is algebraically closed, $X\subset \mathbb A_k^n$ is an affine algebraic set, and $A=k[X]$ is its coordinate ring. Therefore these two constructions give an inclusion-reversing correspondence between closed subsets of $X$ and radical ideals of $A$. The phrase inclusion-reversing matters: a larger [closed set](/page/Closed%20Set) imposes fewer vanishing conditions, hence gives a smaller ideal.
We must now identify which radical ideals correspond to irreducible closed subsets. Let $Y\subset X$ be closed and irreducible. Because $Y$ is closed in the affine algebraic set $X\subset \mathbb A_k^n$, it is itself an affine algebraic set. Its coordinate ring is obtained by restricting regular functions on $X$ to $Y$, so
\begin{align*} k[Y]\cong A/I_X(Y). \end{align*}
By [citetheorem:9418], an affine algebraic set is irreducible exactly when its coordinate ring is an integral domain. Since $Y$ is irreducible, $k[Y]$ is an integral domain. Therefore $A/I_X(Y)$ is an integral domain, which is precisely the condition that $I_X(Y)$ be a prime ideal.
Conversely, suppose $\mathfrak p\trianglelefteq A$ is prime. Define $Y:=V_X(\mathfrak p)$. A prime ideal is radical, so the closed-set/ideal correspondence [citetheorem:9455] gives
\begin{align*} I_X(Y)=I_X(V_X(\mathfrak p))=\mathfrak p. \end{align*}
Thus
\begin{align*} k[Y]\cong A/I_X(Y)=A/\mathfrak p. \end{align*}
Since $\mathfrak p$ is prime, the quotient $A/\mathfrak p$ is an integral domain. Applying [citetheorem:9418] again, $Y$ is irreducible. Hence the geometric objects in the theorem, namely irreducible closed subsets of $X$, are exactly the same data as prime ideals of $k[X]$, with inclusions reversed.
[/guided]
[/step]
[step:Convert chains of irreducible closed subsets into chains of prime ideals]
Let $r\geq 0$ be an integer, and suppose there is a strictly decreasing chain of irreducible closed subsets
\begin{align*}
X_0 \supsetneq X_1 \supsetneq \cdots \supsetneq X_r
\end{align*}
inside $X$. Applying the correspondence from the previous step gives prime ideals
\begin{align*}
\mathfrak p_i:=I_X(X_i)\trianglelefteq A
\end{align*}
for each $i\in\{0,\dots,r\}$.
Because the correspondence is inclusion-reversing, $X_i\supset X_{i+1}$ implies
\begin{align*} \mathfrak p_i=I_X(X_i)\subset I_X(X_{i+1})=\mathfrak p_{i+1}. \end{align*}
The inclusion is strict: if $\mathfrak p_i=\mathfrak p_{i+1}$, then applying $V_X$ and using the closed-set/ideal correspondence would give $X_i=X_{i+1}$, contradicting the strictness of the original chain. Hence
\begin{align*} \mathfrak p_0\subsetneq \mathfrak p_1\subsetneq \cdots \subsetneq \mathfrak p_r \end{align*}
is a strictly increasing chain of prime ideals in $A$.
[/step]
[step:Convert chains of prime ideals back into chains of irreducible closed subsets]
Conversely, let
\begin{align*}
\mathfrak p_0\subsetneq \mathfrak p_1\subsetneq \cdots \subsetneq \mathfrak p_r
\end{align*}
be a strictly increasing chain of prime ideals in $A$. For each $i\in\{0,\dots,r\}$, define
\begin{align*}
Y_i:=V_X(\mathfrak p_i).
\end{align*}
By the first step, each $Y_i$ is an irreducible closed subset of $X$.
Since the correspondence is inclusion-reversing, $\mathfrak p_i\subset \mathfrak p_{i+1}$ implies
\begin{align*} Y_i=V_X(\mathfrak p_i)\supset V_X(\mathfrak p_{i+1})=Y_{i+1}. \end{align*}
The inclusion is strict: if $Y_i=Y_{i+1}$, then applying $I_X$ would give $\mathfrak p_i=\mathfrak p_{i+1}$ because prime ideals are radical and the correspondence is inverse on radical ideals. This contradicts the strictness of the prime ideal chain. Therefore
\begin{align*} Y_0\supsetneq Y_1\supsetneq \cdots \supsetneq Y_r \end{align*}
is a strictly decreasing chain of irreducible closed subsets of $X$.
[/step]
[step:Take suprema and identify the result with $\dim X$]
The previous two steps show that, for every integer $r\geq 0$, there exists a strictly decreasing chain of irreducible closed subsets of $X$ of length $r$ if and only if there exists a strictly increasing chain of prime ideals in $A=k[X]$ of length $r$.
By definition, the Krull dimension of $A$ is the supremum of all integers $r\geq 0$ for which there exists a chain of prime ideals
\begin{align*} \mathfrak p_0\subsetneq \mathfrak p_1\subsetneq \cdots \subsetneq \mathfrak p_r. \end{align*}
Since $\dim X:=\dim A$, this supremum is exactly $\dim X$. Therefore $\dim X$ is the supremum of all integers $r\geq 0$ for which there exists a strictly decreasing chain
\begin{align*} X_0\supsetneq X_1\supsetneq \cdots \supsetneq X_r \end{align*}
of irreducible closed subsets of $X$.
[/step]