[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.[/step]