Lemma 28.10.3. Let $X$ be a scheme. Let $Y \subset X$ be an irreducible closed subset. Let $\xi \in Y$ be the generic point. Then

$\text{codim}(Y, X) = \dim (\mathcal{O}_{X, \xi })$

where the codimension is as defined in Topology, Definition 5.11.1.

Proof. By Topology, Lemma 5.11.2 we may replace $X$ by an affine open neighbourhood of $\xi$. In this case the result follows easily from Algebra, Lemma 10.26.3. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).