Consider the integers. You learned early on that every integer greater than $1$ can be broken into prime factors, and that this decomposition is essentially unique: $12 = 2^2 \cdot 3$, not $12 = 2 \cdot 6$ in any fundamentally different sense. This is so familiar it feels like a fact about numbers themselves rather than a structural property worth isolating. But when we pass to more general [rings](/page/Ring), the story changes — sometimes dramatically.
Take the ring $\mathbb{Z}[\sqrt{-5}] = \{a + b\sqrt{-5} : a, b \in \mathbb{Z}\}$. Inside this ring, we have the factorisation
\begin{align*}
6 &= 2 \cdot 3 = (1 + \sqrt{-5})(1 - \sqrt{-5}).
\end{align*}
One can verify that $2$, $3$, $1 + \sqrt{-5}$, and $1 - \sqrt{-5}$ are all irreducible in $\mathbb{Z}[\sqrt{-5}]$ — none of them factor further — yet $6$ has two genuinely different factorisations into irreducibles. The elegant arithmetic of $\mathbb{Z}$ has broken down. Understanding precisely what property of $\mathbb{Z}$ fails in $\mathbb{Z}[\sqrt{-5}]$ — and when it holds in more general rings — is the central question of this chapter.
[example: Failure of Unique Factorisation in Z[sqrt(-5)]]
We verify that $2$, $3$, $1 + \sqrt{-5}$, and $1 - \sqrt{-5}$ are all irreducible in $R = \mathbb{Z}[\sqrt{-5}]$.
The key tool is the **norm map**
\begin{align*}
N: \mathbb{Z}[\sqrt{-5}] &\to \mathbb{Z}_{\geq 0} \\
a + b\sqrt{-5} &\mapsto a^2 + 5b^2.
\end{align*}
This satisfies $N(\alpha\beta) = N(\alpha)N(\beta)$ for all $\alpha, \beta \in R$. Indeed,
\begin{align*}
N((a + b\sqrt{-5})(c + d\sqrt{-5})) &= N((ac - 5bd) + (ad + bc)\sqrt{-5}) \\
&= (ac - 5bd)^2 + 5(ad + bc)^2 \\
&= a^2c^2 - 10abcd + 25b^2d^2 + 5a^2d^2 + 10abcd + 5b^2c^2 \\
&= (a^2 + 5b^2)(c^2 + 5d^2) = N(\alpha)N(\beta).
\end{align*}
The units of $R$ are exactly the elements of norm $1$: if $\alpha\beta = 1$ then $N(\alpha)N(\beta) = 1$, so $N(\alpha) = 1$ (since both are non-negative integers). The only elements with $N(\alpha) = a^2 + 5b^2 = 1$ are $\alpha = \pm 1$.
Now we check irreducibility.
$N(2) = 4$. If $2 = \alpha\beta$ then $N(\alpha)N(\beta) = 4$, so the norms are $(1,4)$, $(2,2)$, or $(4,1)$. Could $N(\alpha) = 2$? That would require $a^2 + 5b^2 = 2$, which has no integer solutions (since $b \neq 0$ forces $5b^2 \geq 5 > 2$, and $b = 0$ gives $a^2 = 2$, impossible). So the only factorisation of $2$ has one factor with norm $1$, hence a unit. Thus $2$ is irreducible.
$N(3) = 9$. If $3 = \alpha\beta$ then $N(\alpha)N(\beta) = 9$. The only possibility for a non-unit factor is $N(\alpha) = 3$, requiring $a^2 + 5b^2 = 3$. Again $b \neq 0$ forces $5b^2 \geq 5 > 3$, and $b = 0$ gives $a^2 = 3$, impossible. So $3$ is irreducible.
$N(1 + \sqrt{-5}) = 1 + 5 = 6$. If $1 + \sqrt{-5} = \alpha\beta$ then $N(\alpha)N(\beta) = 6$, so we need $N(\alpha) \in \{2, 3\}$. But as shown above, neither $2$ nor $3$ is a norm in $R$. So $1 + \sqrt{-5}$ is irreducible. By the same argument, so is $1 - \sqrt{-5}$.
Finally, these four elements are genuinely different up to units: the only units are $\pm 1$, and $\pm 2 \neq \pm 3$, $\pm 2 \neq \pm(1 \pm \sqrt{-5})$, and $\pm 3 \neq \pm(1\pm \sqrt{-5})$. The two factorisations $6 = 2 \cdot 3 = (1+\sqrt{-5})(1-\sqrt{-5})$ are genuinely distinct.
[/example]
The failure in $\mathbb{Z}[\sqrt{-5}]$ is not accidental. It reflects a deep structural deficiency: the irreducibles there are not prime in the ring-theoretic sense. A **Unique Factorisation Domain** is precisely a [ring](/page/Ring) where these two notions — irreducible and prime — coincide, and where unique factorisation is guaranteed as a consequence.
## Irreducibles and Primes
The $\mathbb{Z}[\sqrt{-5}]$ example forces us to distinguish two notions that coincide in $\mathbb{Z}$ but diverge in more general rings. An element can fail to factor further (irreducible) yet still fail to have the divisibility power we associate with primes in ordinary arithmetic. Making this distinction precise is the first step toward understanding when unique factorisation holds.
[definition: Irreducible Element]
Let $R$ be an [integral domain](/page/Integral%20Domain). A non-zero non-unit element $a \in R$ is called **irreducible** if whenever $a = bc$ for $b, c \in R$, at least one of $b$ or $c$ is a unit.
[/definition]
[definition: Prime Element]
Let $R$ be an [integral domain](/page/Integral%20Domain). A non-zero non-unit element $p \in R$ is called **prime** if whenever $p \mid bc$ for $b, c \in R$, then $p \mid b$ or $p \mid c$.
[/definition]
[remark: Prime Implies Irreducible]
In any integral domain, every prime element is irreducible. To see this, suppose $p$ is prime and $p = ab$. Then $p \mid ab$, so $p \mid a$ or $p \mid b$. Say $p \mid a$, so $a = pc$ for some $c \in R$. Then $p = ab = pcb$, and since $R$ has no zero divisors, $1 = cb$. So $b$ is a unit. The converse fails in general: as the example above shows, the irreducible element $2 \in \mathbb{Z}[\sqrt{-5}]$ is not prime, since $2 \mid 6 = (1+\sqrt{-5})(1-\sqrt{-5})$ but $2 \nmid (1 + \sqrt{-5})$ and $2 \nmid (1 - \sqrt{-5})$.
[/remark]
## Definition
With irreducibles and primes distinguished, we can now state what it means for a ring to have the arithmetic structure of $\mathbb{Z}$: every element factors, and the factorisation is unique up to the two unavoidable ambiguities of ordering and units.
With these pieces in place, we can give the central definition.
[definition: Unique Factorisation Domain]
An [integral domain](/page/Integral%20Domain) $R$ is called a **unique factorisation domain** (UFD) if:
1. Every non-zero non-unit element $a \in R$ can be written as a finite product of irreducibles:
\begin{align*}
a &= p_1 p_2 \cdots p_n
\end{align*}
for irreducible elements $p_1, \ldots, p_n \in R$.
2. This factorisation is unique up to order and units: if $a = p_1 \cdots p_n = q_1 \cdots q_m$ are two factorisations into irreducibles, then $n = m$ and after reordering, each $p_i$ is an associate of $q_i$ (meaning $p_i = u_i q_i$ for some unit $u_i \in R^\times$).
[/definition]
[explanation: Why Uniqueness Up to Units and Order]
The two qualifications in the uniqueness statement are both essential and cannot be omitted.
**Up to order** is necessary because multiplication is commutative: $6 = 2 \cdot 3 = 3 \cdot 2$ should not count as two different factorisations.
**Up to units** is necessary because multiplying a factor by a unit and its inverse by that unit's inverse gives a formally different but arithmetically identical factorisation. In $\mathbb{Z}$, for instance, $6 = 2 \cdot 3 = (-2) \cdot (-3)$. If we required literal equality rather than associate equality, even $\mathbb{Z}$ would fail to be a UFD. Two elements $a, b \in R$ are called **associates** if $a = ub$ for some unit $u \in R^\times$, equivalently if $(a) = (b)$ as principal ideals.
The moral is: factorisation into irreducibles lives in the monoid $R \setminus \{0\}$ modulo the equivalence relation of being associates, and uniqueness is a statement in this quotient monoid.
[/explanation]
[example: Z is a UFD]
The integers $\mathbb{Z}$ form a UFD. While this is the motivating example, the proof already reveals the structural backbone that underpins the general theory.
Existence of factorisation into primes follows by strong induction: if $n > 1$, either $n$ is prime (and we are done) or $n = ab$ with $1 < a, b < n$, and we apply induction to both factors.
Uniqueness is the Fundamental Theorem of Arithmetic. The key step is that in $\mathbb{Z}$, every irreducible is prime: if $p$ is an irreducible integer and $p \mid ab$, then either $p \mid a$ (and we are done) or $\gcd(p, a) = 1$. By [Bézout's theorem](/page/Bezout%27s%20Theorem), there exist $s, t \in \mathbb{Z}$ with $sp + ta = 1$. Multiplying by $b$: $spb + tab = b$. Since $p \mid ab$, both terms on the left are divisible by $p$, so $p \mid b$. This argument uses the Euclidean algorithm, and it is precisely this algorithmic structure that makes $\mathbb{Z}$ special.
What makes $\mathbb{Z}$ non-trivial as an example is the following: the primes $2, 3, 5, 7, \ldots$ are not just irreducible elements but generators of the height-one prime ideals $(2), (3), (5), (7), \ldots$, and every nonzero non-unit ideal in $\mathbb{Z}$ factors uniquely as a product of these: $(n) = (p_1)^{e_1} \cdots (p_k)^{e_k}$. In $\mathbb{Z}[\sqrt{-5}]$, the analogous statement for element ideals fails — but Dedekind showed that it is restored for ideals in any ring of integers, at the cost of introducing non-principal ideals.
[/example]
The example reveals a general pattern: a sufficient route to unique factorisation runs through having a Euclidean algorithm, which produces a principal ideal domain, which in turn implies a UFD. We will follow this hierarchy carefully.
## The Hierarchy: Euclidean, PID, UFD
<!-- illustration-needed: the hierarchy Euclidean domains ⊂ PIDs ⊂ UFDs ⊂ integral domains — show three nested ovals with a representative example in each region: Z[i] in Euclidean, Z[sqrt(-5)] class group = Z/2Z in integral domain but not UFD, and Z[x] in UFD but not PID -->
There is a chain of increasingly general classes of domains:
\begin{align*}
\text{Euclidean domains} \implies \text{PIDs} \implies \text{UFDs}.
\end{align*}
Neither implication reverses in general. Understanding this chain is essential for knowing which rings have unique factorisation and why.
The first step in the chain is the most concrete.
What makes $\mathbb{Z}$ and $k[x]$ (polynomials over a field) amenable to explicit computation is the existence of a division algorithm: given $a$ and $b \neq 0$, we can always write $a = qb + r$ where the "size" of $r$ is strictly smaller than the "size" of $b$. This size function is axiomatised as a Euclidean function.
[definition: Euclidean Domain]
An [integral domain](/page/Integral%20Domain) $R$ is a **Euclidean domain** if there exists a function $\phi: R \setminus \{0\} \to \mathbb{Z}_{\geq 0}$ such that for all $a \in R$ and $b \in R \setminus \{0\}$, there exist $q, r \in R$ with
\begin{align*}
a &= qb + r
\end{align*}
where either $r = 0$ or $\phi(r) < \phi(b)$. The function $\phi$ is called a **Euclidean function** or **Euclidean norm** on $R$.
[/definition]
[example: Key Euclidean Domains]
The two most important Euclidean domains are:
**The integers $\mathbb{Z}$:** The Euclidean function is $\phi(n) = |n|$. For any $a \in \mathbb{Z}$ and $b \neq 0$, we perform integer division: $a = qb + r$ with $0 \leq r < |b|$.
**Polynomial rings $k[x]$ over a field $k$:** The Euclidean function is $\phi(f) = \deg(f)$. For any $f, g \in k[x]$ with $g \neq 0$, polynomial long division gives $f = qg + r$ with $\deg(r) < \deg(g)$ (or $r = 0$). The fact that $k$ is a field is crucial: we need to divide leading coefficients at each step of the long division algorithm.
The Gaussian integers $\mathbb{Z}[i] = \{a + bi : a, b \in \mathbb{Z}\}$ also form a Euclidean domain, with $\phi(a + bi) = a^2 + b^2$ (the norm). For any $\alpha, \beta \in \mathbb{Z}[i]$ with $\beta \neq 0$, we compute $\alpha/\beta \in \mathbb{Q}(i)$ and round to the nearest Gaussian integer $q$. The remainder $r = \alpha - q\beta$ then satisfies $N(r) < N(\beta)$ because rounding moves us within distance $1/\sqrt{2}$ of $\alpha/\beta$, so $N(r/\beta) = N(\alpha/\beta - q) \leq 1/2 < 1$.
[/example]
Every Euclidean domain is a principal ideal domain. The proof uses the Euclidean function to find a generator.
[quotetheorem:855]
The idea: given an ideal $I \trianglelefteq R$ in a Euclidean domain, take a non-zero element $d \in I$ of minimal $\phi$-value. For any $a \in I$, write $a = qd + r$. Then $r = a - qd \in I$, and if $r \neq 0$ then $\phi(r) < \phi(d)$, contradicting minimality. So $r = 0$, meaning $d \mid a$, and $I = (d)$.
The second step in the chain — that every PID is a UFD — requires more work, and it is here that the distinction between irreducibles and primes becomes crucial.
[quotetheorem:867]
The proof has two parts: existence and uniqueness of factorisation.
For existence, one shows that in a PID there are no infinite ascending chains of principal ideals $(a_1) \subsetneq (a_2) \subsetneq (a_3) \subsetneq \cdots$ — this is the **ascending chain condition** (ACC) on principal ideals, and it holds in PIDs because any union of a chain of ideals is itself an ideal, hence principal, hence generated by some element of the chain. Given ACC, if a non-unit $a$ cannot be written as a finite product of irreducibles, then $a = a_1 b_1$ with neither factor irreducible, then $a_1 = a_2 b_2$ with $a_2$ non-irreducible, and so on, producing $(a) \subsetneq (a_1) \subsetneq (a_2) \subsetneq \cdots$, a contradiction.
For uniqueness, the key is showing that in a PID, every irreducible is prime. In a PID, for any two elements $a, b$, the ideal $(a, b) = (d)$ for some $d = \gcd(a, b)$, and the Bézout-type identity $d = sa + tb$ holds. If $p$ is irreducible and $p \mid ab$, then either $p \mid a$ or $(p, a) = (1)$ (since the only divisors of $p$ are units and associates of $p$). In the latter case, $1 = sp + ta$, so $b = spb + tab$, and since $p \mid ab$ we get $p \mid b$.
[remark: The Converse Fails]
Not every UFD is a PID. The polynomial ring $\mathbb{Z}[x]$ is a UFD (as we will discuss) but not a PID: the ideal $(2, x) = \{2f + xg : f, g \in \mathbb{Z}[x]\}$ is not principal. If $(2, x) = (h)$, then $h \mid 2$ so $h = \pm 1$ or $h = \pm 2$. But $h \mid x$ and $x$ is irreducible of degree $1$, so $h$ is a unit or $h = \pm x$. The only consistent choice is $h = \pm 1$, but then $(h) = \mathbb{Z}[x]$ and $1 \in (2, x)$ would imply $2f(0) = 1$ for some $f \in \mathbb{Z}[x]$, which is impossible. So $(2, x)$ is not principal.
[/remark]
## Primes and Irreducibles in UFDs
The algebraic heart of unique factorisation is the equivalence between being prime and being irreducible. We saw that primes are always irreducible; the UFD condition is precisely what forces the reverse.
[quotetheorem:3243]
The proof is clean and illustrates how the UFD property is used. Suppose $p$ is irreducible and $p \mid ab$, so $ab = pc$ for some $c \in R$. Write $a = p_1 \cdots p_r$, $b = q_1 \cdots q_s$, and $c = r_1 \cdots r_t$ as products of irreducibles. Then
\begin{align*}
p_1 \cdots p_r \cdot q_1 \cdots q_s &= p \cdot r_1 \cdots r_t.
\end{align*}
By unique factorisation, $p$ must be an associate of one of the $p_i$ or $q_j$. If $p$ is an associate of some $p_i$, then $p \mid p_i \mid a$, so $p \mid a$. If $p$ is an associate of some $q_j$, then $p \mid b$.
This equivalence has a striking converse: an integral domain in which every irreducible is prime and every element factors into irreducibles (in some form) is already a UFD.
[quotetheorem:3244]
This characterisation is often the most practical way to verify that a ring is a UFD, especially when the ascending chain condition is established by other means.
[example: Gaussian Integers as a UFD]
The Gaussian integers $\mathbb{Z}[i]$ form a UFD. Since $\mathbb{Z}[i]$ is a Euclidean domain (as verified above), it is a PID and hence a UFD.
The Gaussian primes are those Gaussian integers that are irreducible. The norm $N(a + bi) = a^2 + b^2$ is multiplicative, so if $\alpha = \beta\gamma$ and $N(\alpha)$ is a rational prime, then one of $N(\beta)$ or $N(\gamma)$ must be $1$, making it a unit. This leads to the classification:
- If $p$ is a rational prime with $p \equiv 3 \pmod{4}$, then $p$ remains prime in $\mathbb{Z}[i]$ (since $-1$ is not a quadratic residue mod $p$, the equation $a^2 + b^2 = p$ has no integer solutions).
- If $p$ is a rational prime with $p \equiv 1 \pmod{4}$, then $p$ splits: $p = \pi \bar{\pi}$ where $\pi, \bar{\pi}$ are non-associate Gaussian primes. For example, $5 = (2 + i)(2 - i)$.
- The prime $2$ ramifies: $2 = -i(1 + i)^2$.
[/example]
## Polynomial Rings over UFDs
One of the most important and far-reaching results about UFDs is that unique factorisation is preserved when we adjoin a polynomial indeterminate. This is Gauss's theorem, and it gives us a machine for producing new UFDs from old ones.
The key step is Gauss's lemma, but to understand why it is needed, we must first appreciate the difficulty. Factoring in $F[x]$ (where $F$ is a field) is well-understood: $F[x]$ is a Euclidean domain with a complete theory given by polynomial long division and the ascending chain condition. But $R[x]$ is more subtle — a polynomial can fail to be irreducible in $R[x]$ for two essentially different reasons: either it factors within $R$ itself (as a product of ring elements times a polynomial), or it factors as a product of two polynomials of positive degree. To handle both, we need to separate out the scalar content of a polynomial from its purely polynomial part. This is what the content function does.
To see why the separation is necessary, consider $f(x) = 2x \in \mathbb{Z}[x]$. Over $\mathbb{Q}$, the scalar $2$ is a unit, so $2x$ is already a perfectly good irreducible polynomial. But over $\mathbb{Z}$, the factorisation $2x = 2 \cdot x$ is meaningful: $2$ is a non-unit irreducible of $\mathbb{Z}$ and $x$ is an irreducible of $\mathbb{Z}[x]$. If we treat $2x$ as a single object without isolating the content $2$, we cannot apply the irreducibility theory from $\mathbb{Q}[x]$ directly to $\mathbb{Z}[x]$. The content function strips off this scalar part, leaving a primitive polynomial whose irreducibility over $\mathbb{Z}$ is equivalent to its irreducibility over $\mathbb{Q}$.
[definition: Primitive Polynomial]
Let $R$ be a UFD and $f = a_n x^n + \cdots + a_1 x + a_0 \in R[x]$ a non-zero polynomial. The **content function** is the map
\begin{align*}
\operatorname{cont}: R[x] \setminus \{0\} &\to R / R^\times \\
f &\mapsto \gcd(a_0, a_1, \ldots, a_n),
\end{align*}
where $R^\times$ denotes the units of $R$ and the gcd is taken up to units. The polynomial $f$ is **primitive** if $\operatorname{cont}(f)$ is a unit in $R$.
[/definition]
Every polynomial $f \in R[x]$ can be written as $f = \operatorname{cont}(f) \cdot f_0$ where $f_0$ is primitive, and this decomposition is unique up to units.
[quotetheorem:858]
The proof of Gauss's lemma is a beautiful application of prime elements. Suppose $fg$ is not primitive, so some irreducible $p \in R$ divides all coefficients of $fg$. Consider the quotient map $R \to R/(p)$. Since $p$ is prime in $R$, the ideal $(p)$ is prime, so $R/(p)$ is an [integral domain](/page/Integral%20Domain). Let $\bar{f}, \bar{g}$ denote the images of $f, g$ in $(R/(p))[x]$. Then $\bar{f}\bar{g} = \overline{fg} = 0$ in $(R/(p))[x]$. Since $R/(p)$ is an integral domain, $(R/(p))[x]$ has no zero divisors, so $\bar{f} = 0$ or $\bar{g} = 0$. This means $p$ divides all coefficients of $f$ or all coefficients of $g$, contradicting primitivity.
[quotetheorem:3245]
[explanation: Strategy of Proof]
The proof proceeds in two stages.
**Stage 1: Existence of factorisation.** Let $f \in R[x]$ be a non-zero non-unit. Write $f = c \cdot f_0$ where $c = \operatorname{cont}(f) \in R$ and $f_0$ is primitive. Factor $c$ into irreducibles in $R$ (using that $R$ is a UFD). For $f_0$, consider it as an element of $F[x]$, where $F = \operatorname{Frac}(R)$ is the fraction field of $R$. Since $F[x]$ is a Euclidean domain (hence a UFD), $f_0 = g_1 \cdots g_k$ factors into irreducibles in $F[x]$. Each $g_i \in F[x]$ can be written as $g_i = (r_i/s_i) h_i$ where $r_i, s_i \in R$ and $h_i \in R[x]$ is primitive (clear the denominators of the coefficients and extract the content). By Gauss's lemma, the product $h_1 \cdots h_k$ is primitive in $R[x]$, and $f_0 = \frac{r_1 \cdots r_k}{s_1 \cdots s_k} h_1 \cdots h_k$. Since $f_0$ is primitive and $h_1 \cdots h_k$ is primitive, the scalar factor $r_1 \cdots r_k / s_1 \cdots s_k$ must be a unit in $R$. Thus $f_0 = u \cdot h_1 \cdots h_k$ in $R[x]$ for a unit $u$. Each $h_i$ is primitive in $R[x]$ and irreducible in $F[x]$; one checks that a primitive polynomial irreducible over $F$ is irreducible over $R$ (any nontrivial $R[x]$-factorisation $h_i = ab$ with both $a, b$ of positive degree would persist in $F[x]$, and a factorisation with one factor constant would mean a non-unit of $R$ divides all coefficients of $h_i$, contradicting primitivity).
**Stage 2: Uniqueness.** Suppose $f = p_1 \cdots p_r = q_1 \cdots q_s$ in $R[x]$. One first handles the content: $\operatorname{cont}(p_1 \cdots p_r) = \prod \operatorname{cont}(p_i)$ by Gauss's lemma, and similarly for the $q_j$ side. The content parts must agree by unique factorisation in $R$. For the primitive parts, one reduces to $F[x]$ and uses unique factorisation there to match the remaining factors.
[/explanation]
By applying Gauss's theorem repeatedly, we get:
[quotetheorem:3246]
In particular, $\mathbb{Z}[x_1, \ldots, x_n]$ is a UFD, as is $k[x_1, \ldots, x_n]$ for any field $k$. This is a substantial result: the polynomial rings most commonly encountered in algebraic geometry and number theory all have unique factorisation.
[example: Irreducibility in Z[x]]
We verify that $f(x) = x^2 + 1$ is irreducible in $\mathbb{Z}[x]$. As a degree-$2$ polynomial, it would factor in $\mathbb{Z}[x]$ only as a product of two linear factors $f = (x - a)(x - b)$ with $a, b \in \mathbb{Z}$ (since a factorisation into a degree-$0$ and degree-$2$ factor would make the degree-$0$ factor a unit, as it must divide the leading coefficient $1$). But $f(a) = a^2 + 1 \geq 1 > 0$ for all $a \in \mathbb{Z}$, so $f$ has no integer roots, hence no linear factors. Thus $f$ is irreducible in $\mathbb{Z}[x]$.
However, in $\mathbb{Z}[i][x]$, we have $x^2 + 1 = (x - i)(x + i)$, illustrating that irreducibility depends on the ambient ring.
[/example]
## Unique Factorisation and Ideals
In a general ring, an element $a$ can be irreducible without generating a prime ideal. The UFD condition closes this gap, and the resulting interplay between elements and ideals reveals why unique factorisation is so powerful.
In a UFD $R$, every non-zero prime ideal contains a prime element. This is because if $\mathfrak{p}$ is a prime ideal and $a \in \mathfrak{p}$ is any non-zero non-unit, then $a = p_1 \cdots p_n$ and since $\mathfrak{p}$ is prime, some $p_i \in \mathfrak{p}$.
[quotetheorem:3247]
[explanation: Sketch of Proof]
For the forward direction: if $\mathfrak{p}$ has height one, pick any nonzero $a \in \mathfrak{p}$. Write $a = p_1 \cdots p_n$ in the UFD; since $\mathfrak{p}$ is prime, some $p_i \in \mathfrak{p}$, so $(p_i) \subset \mathfrak{p}$. Now $(p_i)$ is itself a prime ideal (since $p_i$ is prime), and it is nonzero. By the height-one assumption, there is no prime strictly between $(0)$ and $\mathfrak{p}$, so $(p_i) = \mathfrak{p}$.
For the reverse direction: if $\mathfrak{p} = (p)$ with $p$ prime, suppose there were a prime $\mathfrak{q}$ with $(0) \subsetneq \mathfrak{q} \subsetneq (p)$. Pick nonzero $b \in \mathfrak{q}$ and factor it; some irreducible factor $q$ lies in $\mathfrak{q}$, so $q \in (p)$, meaning $p \mid q$. Since $p$ and $q$ are both irreducible, $p$ and $q$ are associates, so $(q) = (p)$. But then $\mathfrak{q} \supset (q) = (p) = \mathfrak{p}$, contradicting $\mathfrak{q} \subsetneq \mathfrak{p}$.
[/explanation]
This theorem has a clean consequence: in a UFD, the principal prime ideals are exactly the height-one primes, and every non-zero non-unit generates an ideal that factors (as a product of ideals) into a product of height-one primes. This is the shadow of unique factorisation at the level of ideals.
The ideal-theoretic perspective connects UFDs to algebraic geometry. A Noetherian domain $R$ is a UFD if and only if every height-one prime ideal is principal, which in geometric language says that every codimension-one subvariety of $\operatorname{Spec}(R)$ is a hypersurface — cut out by a single equation. More precisely, a normal Noetherian domain is a UFD if and only if its [divisor class group](/page/Divisor%20Class%20Group) $\operatorname{Cl}(R)$ is trivial. For the coordinate ring of a smooth affine variety, $\operatorname{Cl}(R)$ measures the obstruction to every Weil divisor being principal, and its vanishing is equivalent to the variety being factorial. This is why polynomial rings and local rings of smooth points over a field are always UFDs — their divisor class groups vanish by Hilbert's theorem on regular local rings.
[explanation: Why This Fails in Non-UFDs]
In $\mathbb{Z}[\sqrt{-5}]$, the element $2$ is irreducible but not prime. The ideal $(2)$ is not prime: $(1 + \sqrt{-5})(1 - \sqrt{-5}) = 6 = 2 \cdot 3 \in (2)$, but $1 \pm \sqrt{-5} \notin (2)$. The ideal $(2)$ does, however, have a factorisation into prime ideals: $(2) = \mathfrak{p}^2$ where $\mathfrak{p} = (2, 1 + \sqrt{-5})$. This is the beginning of Dedekind's theory of ideal factorisation — in rings of algebraic integers, unique factorisation of ideals (not elements) always holds, compensating for the failure of unique factorisation of elements. The precise measure of this failure is the [ideal class group](/page/Ideal%20Class%20Group) $\operatorname{Cl}(K)$: the ring $\mathcal{O}_K$ is a UFD if and only if $\operatorname{Cl}(K) = 0$.
[/explanation]
## Failure of Unique Factorisation
Having established the theory in the affirmative direction, it is instructive to examine exactly how and when unique factorisation fails, and what the failure looks like concretely.
We have already seen $\mathbb{Z}[\sqrt{-5}]$. A second family of examples comes from non-Noetherian domains.
[example: An Integral Domain That Is Not a UFD — Missing Factorisation]
Let $R$ be the ring of algebraic integers — elements of $\overline{\mathbb{Q}}$ that satisfy monic polynomials with integer coefficients. This is an integral domain. Consider $2 \in R$. Then
\begin{align*}
2 &= (\sqrt{2})^2 = (\sqrt[4]{2})^4 = (\sqrt[8]{2})^8 = \cdots
\end{align*}
Each factorisation refines the previous one, and the process never terminates. In particular, $2$ cannot be written as a finite product of irreducibles at all — any purported irreducible factor could itself be further factored by taking square roots. So the existence condition for UFDs fails. This is not a PID (or even Noetherian), which is why the standard machine for producing UFDs breaks down.
[/example]
What characterises UFDs among integral domains is not just uniqueness but the coherent interplay between existence and uniqueness. The following theorem gives a useful sufficient condition.
[quotetheorem:3248]
The ACCP guarantees existence of factorisation into irreducibles (by the same descending argument as in the PID case), while the prime-implies-irreducible condition gives uniqueness.
[example: A UFD That Is Not Noetherian]
Let $R = \mathbb{Z}[x_1, x_2, x_3, \ldots]$ be the polynomial ring in countably many variables over $\mathbb{Z}$. This is not Noetherian: the ideal $(x_1, x_2, x_3, \ldots)$ is not finitely generated. However, $R$ is a UFD. To see this, note that each non-zero polynomial involves only finitely many variables, say $f \in \mathbb{Z}[x_1, \ldots, x_n]$ for some $n$. By Gauss's theorem applied finitely many times, $\mathbb{Z}[x_1, \ldots, x_n]$ is a UFD, so $f$ has a factorisation into irreducibles there, and those irreducibles remain irreducible in the larger ring (adding more variables cannot split an irreducible polynomial in fewer variables). Uniqueness of this factorisation follows similarly by reducing to a finite subring.
[/example]
## References
Dummit, D. S. and Foote, R. M., *Abstract Algebra* (2004), Chapter 8–9.
Lang, S., *Algebra* (2002), Chapter II.
Atiyah, M. F. and MacDonald, I. G., *Introduction to Commutative Algebra* (1969), Chapter 1.
Samuel, P., *Unique Factorization* (1968), American Mathematical Monthly.
Zariski, O. and Samuel, P., *Commutative Algebra, Vol. I* (1958), Chapter IV.