-----
Let $k$ be a [[field]], and let $A$ be [[Noetherian ring|Noetherian]] [[integral domain|integral]] $k$-[[algebra]]. (The $k$-algebra assumption is not strictly necessary, but fits with the ambient discussion.) Recall that $\text{Cl }X$ denotes the [[divisor (of zeros and poles)|class group]] of a [[scheme]] $X$.
> [!proposition] Proposition. ([[class group quantifies failure of unique factorization in a ring]])
> The [[ring]] $A$ is a [[UFD]] if and only if the [[affine scheme|affine]] [[scheme]] $\text{Spec }A$ is [[normal scheme|normal]] with $\text{Cl}(\text{Spec } A)=(0)$.
^proposition
> [!proof]- Proof. ([[class group quantifies failure of unique factorization in a ring]])
> Recall that $\text{Spec }A$ is [[normal scheme|normal]] iff $A$ is [[integral closure|integrally closed]] (in its [[field of fractions]]). Together with the following commutative algebra facts:
> - [[UFD iff height-1 primes are principal]]
> - [[every UFD is integrally closed]]
> it is enough to show the following: if $A$ is [[integral closure|integrally closed]], then
> $(\text{every height-1 prime ideal of A is principal}) \iff \text{Cl}(\text{Spec }A)=(0).$
>
> $\implies$. Recall the [[correspondence between height-1 primes and prime divisors in affine schemes]]: a [[prime divisor in a scheme|prime divisor]] $Y \subset X$ corresponds to a [[height of a prime ideal|height]]-$1$ [[prime ideal]] $\mathfrak{p} \subset A$, via $Y=V(\mathfrak{p})$. By assumption, $\mathfrak{p}=\langle f \rangle$ for some $f \in A$. What is the [[divisor (of zeros and poles)]] $(f)$?
>
> Well, $\nu_{Y}(f)=1$, because $f$ is a [[characterization of DVRs|uniformizer]] (generates $\mathfrak{p}A_{\mathfrak{p}}$). And for any other [[prime divisor in a scheme|prime divisor]] $Y'$ and associated height-1 prime ideal $\langle f' \rangle$, $\nu_{Y'}(f)=0$ because $f \notin \langle f' \rangle$ (as $f$ is [[irreducible element of an integral domain|irreducible]] [[characterization of UFDs|as a]] [[prime element of an integral domain|prime element]] of $A$). So $(f)= 1 \cdot Y.$
> Thus, every element $L \in \text{Div }X$ can be written as a $\mathbb{Z}$-linear combination of principals: $L= \sum_{Y \subset \text{Spec }A \text{ prime}} L_{Y} \ Y=\sum_{Y \subset \text{Spec } A \text{ prime}} L_{Y} \ (f_{Y})$ and his hence principal since principals form a [[subgroup]]. So the [[divisor (of zeros and poles)|class group]] $\text{Cl}(\text{Spec }A)$ is zero.
>
> $\impliedby$. Suppose $\text{Cl }X=0$, let $\mathfrak{p}$ be a [[height of a prime ideal|height]]-$1$ [[prime ideal]] of $A$. WTS $\mathfrak{p}$ is a [[principal ideal]]. $\text{Cl }X=0$ means every Weil Divisor $D \in \text{Div}(X)$ equals some [[divisor (of zeros and poles)]], i.e., $D$ is principal. With $Y$ denoting the [[prime divisor in a scheme|prime divisor]] in $\text{Spec }A$ [[correspondence between height-1 primes and prime divisors in affine schemes|corresponding]] to $\mathfrak{p}$, $Y=V(\mathfrak{p})$, we in particular have $Y=(f)$ for some $f \in K(X)^{*}$. Note $K(X)=\text{Frac }A=A_{(0)}$. Note also that from $(f)=\sum_{Y' \subset X \text{ p.d.}} \nu_{Y'}(f)=1 \cdot Y$ we can deduce $\nu_{Y}(f)=1$. This means $f$ is in the [[DVR]] $A_{\mathfrak{p}}$ (indeed, $1 \geq 0$) and [[every DVR is a Noetherian local domain of dimension 1|in fact generates]] the [[maximal ideal]] $\mathfrak{p}A_{\mathfrak{p}} \subset A_{\mathfrak{p}}$. Moreover, if $\mathfrak{p}' \subset A$ is any other ht-1 [[prime ideal]] and $Y'=V(\mathfrak{p'})$ its corresponding prime divisor, then $\nu_{Y'}(f)=0$ (again because $(f)$ is uniquely represented as the linear combination $1 \cdot Y$) which tells us that $f \in A_{\mathfrak{p'}}^{*}$. So $f$ is in all the [[localization|localizations]] of $A$ at height-1 primes, hence by [[Algebraic Hartog's Lemma]] we have $f \in A$. So we've got an element $f \in A \text{ s.t. } \left\langle \frac{f}{1} \right\rangle =\mathfrak{p}A_{\mathfrak{p}}.$
> This happens iff $\langle f \rangle=\mathfrak{p}$ in $A$ (e.g. by considering the [[bijection]] in [[extension and contraction under localization]]). Hence $\mathfrak{p}$ is a [[principal ideal]] of $A$. (I feel like this finishes the proof)
-----
####
----
#### References
> [!backlink]
> ```dataview
> TABLE rows.file.link as "Further Reading"
> FROM [[]]
> FLATTEN file.tags as Tag
> WHERE Tag = "#definition" OR Tag = "#theorem" OR Tag = "#MOC" OR Tag = "#proposition" OR Tag = "#axiom"
> GROUP BY Tag
> ```
> [!frontlink]
> ```dataview
> TABLE rows.file.link as "Further Reading"
> FROM outgoing([[]])
> FLATTEN file.tags as Tag
> WHERE Tag = "#definition" OR Tag = "#theorem" OR Tag = "#MOC" OR Tag = "#proposition" OR Tag = "#axiom"
> GROUP BY Tag
> ```