Let $X$ be an embedding in to a smooth variety P such that $\dim(P) \geq \dim(X) +2$. Now, consider the closure of $X$, $\bar{X}$ and let $I$ be its ideal sheaf. Now, let $\eta_{X}$ be the generic point $\bar{X}$. Then, since $\bar{X}$ has codimension greater than 2, the $I_{\eta_X}$ is not principal. Why is this statemen true?
If not a proof, I would prefer an explicit example of the above result.
Consider the curve $C$
$x^2−y^3=0$ in $\mathbb A^3(K)$. Let $I$ be the ideal sheaf associated to the closed embedding $i$ of $C$ in $\mathbb A^3(K)$. Note, that it satisfies the hypothesis of the above result. Now the the generic point of $C$ is the ideal $(x^2−y^3,z)$. Now, I want to compute the stalk of $I$ at $p=(x^2−y^3,z)$.
I have following exact sequence $$0 \rightarrow I_p \rightarrow \mathcal{O}_{\mathbb A^3(K),p } \rightarrow i_{*} \mathcal{O}_{\mathbb A^3(K),p } \rightarrow 0$$
Now, how can I compute $i_{*}\mathcal{O}_{\mathbb A^2(K),p }$ and show $I_p$ is not a principal ideal?
Note: the above statement is in the page 18, Corollary22 proof of notes here
The claim follows from Krull's Hauptidealsatz.
Intuitively, the idea is that a single equation can cut out only an irreducible component (which for the smooth variety $P$ can only be $P$ itself, which is just cut out by the equation $0 = 0$), or a locus of codimension $1$. But your $\overline{X}$ is of codimension at least $2$.