Lemma 31.15.7. Let $X$ be a Noetherian scheme. Let $D \subset X$ be an integral closed subscheme. Assume that

1. $D$ has codimension $1$ in $X$, and

2. $\mathcal{O}_{X, x}$ is a UFD for all $x \in D$.

Then $D$ is an effective Cartier divisor.

Proof. Let $x \in D$ and set $A = \mathcal{O}_{X, x}$. Let $\mathfrak p \subset A$ correspond to the generic point of $D$. Then $A_\mathfrak p$ has dimension $1$ by assumption (1). Thus $\mathfrak p$ is a prime ideal of height $1$. Since $A$ is a UFD this implies that $\mathfrak p = (f)$ for some $f \in A$. Of course $f$ is a nonzerodivisor and we conclude by Lemma 31.15.2. $\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).