[proofplan]
The forward direction follows from the definition of a UFD (which gives condition (1) directly) together with the fact that [irreducible elements are prime in UFDs](/theorems/3243) (which gives condition (2)). The backward direction requires proving that conditions (1) and (2) together imply uniqueness of factorisation. The key insight is that primality of irreducibles is the precise algebraic mechanism that forces uniqueness: given two factorisations of the same element, we apply the definition of primality inductively to show that the irreducible factors in one factorisation must match those in the other up to reordering and associates.
[/proofplan]
[step:Prove the forward direction: a UFD satisfies both conditions]
Suppose $R$ is a [unique factorisation domain](/page/Unique%20Factorisation%20Domain). Condition (1) is immediate from the definition of a UFD: every nonzero non-unit element admits a factorisation into irreducibles. Condition (2) holds by the theorem [Irreducibles are Prime in UFDs](/theorems/3243), which establishes that in any UFD, every irreducible element is prime.
[guided]
Suppose $R$ is a [unique factorisation domain](/page/Unique%20Factorisation%20Domain). We must verify both conditions.
For condition (1): the definition of a UFD requires that every nonzero non-unit element of $R$ can be written as a finite product of irreducible elements. This is precisely condition (1), so it holds by definition.
For condition (2): we must show that every irreducible element of $R$ is prime. This is not immediate from the definition -- it requires a proof that uses the uniqueness clause of the UFD definition. The result is established in [Irreducibles are Prime in UFDs](/theorems/3243).
The key idea of that theorem is as follows: suppose $p$ is irreducible and $p \mid ab$. Write $ab = pc$ for some $c \in R$, and factor each of $a$, $b$, and $c$ into irreducibles. Then $pc$ gives one factorisation of $ab$ into irreducibles (using the factorisations of $p$ and $c$), while the product of the factorisations of $a$ and $b$ gives another. By the uniqueness clause of the UFD definition, these factorisations agree up to reordering and associates. In particular, $p$ must appear as an associate of one of the irreducible factors of $a$ or $b$, which forces $p \mid a$ or $p \mid b$. Thus $p$ is prime.
Why is this decomposition into conditions (1) and (2) useful? Because the two conditions have very different characters. Condition (1) is a chain condition (every ascending chain of principal ideals stabilises, which is equivalent to every nonzero non-unit having a finite factorisation into irreducibles), while condition (2) is a local divisibility property that can often be checked element-by-element. The backward direction will show that these two conditions together are sufficient to recover the full uniqueness clause.
[/guided]
[/step]
[step:Set up the backward direction: assume conditions (1) and (2) and prove uniqueness of factorisation]
Suppose $R$ is an integral domain satisfying conditions (1) and (2). Condition (1) gives existence of factorisations into irreducibles. To show $R$ is a UFD, it remains to prove uniqueness: if
\begin{align*}
u \, p_1 p_2 \cdots p_m = v \, q_1 q_2 \cdots q_n
\end{align*}
where $u, v \in R^\times$ are units and $p_1, \ldots, p_m, q_1, \ldots, q_n$ are irreducible elements, then $m = n$ and, after reindexing, each $p_i$ is an associate of $q_i$.
We proceed by induction on $m$.
[guided]
We have existence of factorisations from condition (1). The substance of the backward direction is proving uniqueness: any two factorisations of the same element into irreducibles agree up to reordering and associates. This is exactly what the primality condition (2) buys us -- the proof proceeds by an induction in which primality is applied at each step to peel off one irreducible factor from both sides.
Suppose we have two factorisations of some nonzero non-unit element $a \in R$:
\begin{align*}
a = u \, p_1 p_2 \cdots p_m = v \, q_1 q_2 \cdots q_n,
\end{align*}
where $u, v \in R^\times$ are units and all $p_i$, $q_j$ are irreducible. We must show $m = n$ and that the factors agree up to associates and reordering. We induct on $m$.
[/guided]
[/step]
[step:Base case: $m = 0$ implies $n = 0$]
If $m = 0$, then $a = u$ is a unit. Since $a = v \, q_1 \cdots q_n$ and $a$ is a unit, the product $v \, q_1 \cdots q_n$ is a unit. In an integral domain, a product is a unit if and only if each factor is a unit (since $R$ has no zero divisors and units are closed under multiplication with the inverse being the product of inverses in reverse order). But each $q_j$ is irreducible, hence not a unit by definition. Therefore $n = 0$, and $a = u = v$, so the factorisations agree.
[guided]
The base case handles the situation $m = 0$, meaning the left-hand side has no irreducible factors: $a = u$, a unit. We must show that the right-hand side also has no irreducible factors, i.e., $n = 0$.
Suppose for contradiction that $n \ge 1$. Then $a = v \, q_1 \cdots q_n$, so $q_1 \cdots q_n = v^{-1} u$. Since $v$ and $u$ are both units, $v^{-1} u$ is a unit (the units $R^\times$ form a group under multiplication). Now the product $q_1 \cdots q_n$ equals a unit.
We claim each $q_j$ must then be a unit. The key fact is: in an integral domain, if a product $xy$ is a unit, then both $x$ and $y$ are units. To see this, suppose $xy \cdot z = 1_R$. Then $x \cdot (yz) = 1_R$, so $x$ is a unit with inverse $yz$. Similarly, $y \cdot (xz) = (xy) \cdot z = 1_R$, so $y$ is a unit. (Note that this argument uses commutativity of multiplication, or more precisely associativity and the integral domain property -- no zero divisors are needed to ensure the inverse is unique.) Applying this fact iteratively to the product $q_1 (q_2 \cdots q_n) = v^{-1}u$, we conclude that $q_1$ is a unit, and then $q_2 \cdots q_n$ is a unit, so $q_2$ is a unit, and so on. Every $q_j$ must be a unit.
But each $q_j$ is irreducible, and by definition an [irreducible element](/page/Irreducible%20Element) is a non-unit. This is a contradiction, so the assumption $n \ge 1$ fails.
Therefore $n = 0$, and both factorisations are simply units: $a = u = v$, so the factorisations agree.
[/guided]
[/step]
[step:Inductive step: use primality of $p_1$ to match it with some $q_j$]
Assume the result holds for all factorisations with fewer than $m$ irreducible factors on the left, and suppose $m \ge 1$. From
\begin{align*}
u \, p_1 p_2 \cdots p_m = v \, q_1 q_2 \cdots q_n,
\end{align*}
the irreducible element $p_1$ divides the right-hand side: $p_1 \mid v \, q_1 q_2 \cdots q_n$. Since $p_1$ is irreducible, condition (2) guarantees that $p_1$ is [prime](/page/Prime%20Element). We apply the definition of primality repeatedly.
[claim:$p_1$ divides some $q_j$]
Since $p_1$ is prime and $p_1 \mid v \, q_1 \cdots q_n$, we show $p_1 \mid q_j$ for some $j \in \{1, \ldots, n\}$. Write the right-hand side as $p_1 \mid (v q_1)(q_2 \cdots q_n)$. By primality, either $p_1 \mid v q_1$ or $p_1 \mid q_2 \cdots q_n$. In the first case, $p_1 \mid v q_1$; writing this as $p_1 \mid v \cdot q_1$ and applying primality again, either $p_1 \mid v$ or $p_1 \mid q_1$. But $v$ is a unit, and a prime element cannot divide a unit (since $p_1$ is not a unit and $p_1 \mid v$ would give $v = p_1 w$, forcing $1_R = p_1 (w v^{-1})$, contradicting $p_1 \notin R^\times$). Therefore $p_1 \mid q_1$ in this case. In the second case, we iterate the same argument on $q_2 \cdots q_n$ and eventually find $p_1 \mid q_j$ for some $j$.
[/claim]
[proof]
We proceed by induction on $n$. If $n = 1$, then $p_1 \mid v q_1$. Since $p_1$ is prime, either $p_1 \mid v$ or $p_1 \mid q_1$. Since $v$ is a unit and $p_1$ is not a unit (being irreducible), $p_1 \nmid v$: if $p_1 \mid v$ then $v = p_1 w$ for some $w$, so $1_R = v \cdot v^{-1} = p_1 (w v^{-1})$, making $p_1$ a unit, a contradiction. Thus $p_1 \mid q_1$.
If $n \ge 2$, write $v \, q_1 \cdots q_n = (v \, q_1 \cdots q_{n-1}) \cdot q_n$. Since $p_1$ is prime and $p_1 \mid (v \, q_1 \cdots q_{n-1}) \cdot q_n$, either $p_1 \mid q_n$ (and we are done with $j = n$) or $p_1 \mid v \, q_1 \cdots q_{n-1}$. In the latter case, the inductive hypothesis (on $n$) gives $p_1 \mid q_j$ for some $j \in \{1, \ldots, n-1\}$.
[/proof]
After reindexing, we may assume $j = 1$, so $p_1 \mid q_1$. Since $q_1$ is irreducible and $p_1$ is not a unit, the only factorisation $q_1 = p_1 \cdot \epsilon$ with $\epsilon \in R$ requires $\epsilon \in R^\times$ (by irreducibility of $q_1$). Thus $q_1 = \epsilon \, p_1$ for some unit $\epsilon \in R^\times$, meaning $p_1$ and $q_1$ are associates.
[guided]
This is the heart of the argument. The primality of $p_1$ is what lets us locate it among the factors on the right-hand side. Here is the reasoning in detail.
We assume the inductive hypothesis: for any element with two factorisations into irreducibles where the left-hand side has fewer than $m$ irreducible factors, the factorisations agree up to reordering and associates. Now suppose $m \ge 1$ and we have the equation
\begin{align*}
u \, p_1 p_2 \cdots p_m = v \, q_1 q_2 \cdots q_n.
\end{align*}
The irreducible element $p_1$ divides the right-hand side: $p_1 \mid v \, q_1 \cdots q_n$. Since $p_1$ is irreducible, condition (2) guarantees that $p_1$ is [prime](/page/Prime%20Element). The definition of primality says: for any $a, b \in R$, if $p_1 \mid ab$ then $p_1 \mid a$ or $p_1 \mid b$. We use this to "search" through the factors $q_1, \ldots, q_n$ one by one.
Write $v \, q_1 \cdots q_n = (v \, q_1 \cdots q_{n-1}) \cdot q_n$. Primality gives $p_1 \mid q_n$ or $p_1 \mid v \, q_1 \cdots q_{n-1}$. If $p_1 \mid q_n$, we stop. Otherwise, repeat with $v \, q_1 \cdots q_{n-1}$, splitting it as $(v \, q_1 \cdots q_{n-2}) \cdot q_{n-1}$ and applying primality again. After at most $n$ applications, we either find some $q_j$ divisible by $p_1$, or we are left with $p_1 \mid v$.
But $p_1 \mid v$ is impossible: $v$ is a unit, and if $v = p_1 w$ for some $w \in R$, then $1_R = v^{-1} v = v^{-1} p_1 w = p_1 (v^{-1} w)$, which makes $p_1$ a unit, contradicting the fact that irreducible elements are non-units. Therefore we must have $p_1 \mid q_j$ for some $j \in \{1, \ldots, n\}$.
After reindexing, assume $j = 1$, so $p_1 \mid q_1$. Write $q_1 = p_1 \cdot \epsilon$ for some $\epsilon \in R$. Since $q_1$ is irreducible, $q_1$ cannot be written as a product of two non-units. The factorisation $q_1 = p_1 \cdot \epsilon$ forces one of $p_1, \epsilon$ to be a unit. Since $p_1$ is irreducible (hence not a unit), $\epsilon$ must be a unit. Therefore $q_1 = \epsilon \, p_1$ with $\epsilon \in R^\times$, meaning $p_1$ and $q_1$ are associates.
Note the logical structure: primality let us descend from $p_1 \mid q_1 \cdots q_n$ to $p_1 \mid q_j$ for a specific $j$, and then irreducibility of $q_j$ upgraded the divisibility $p_1 \mid q_j$ to the association $q_j \sim p_1$. Both properties -- primality and irreducibility -- are essential.
Why couldn't we carry out this argument without condition (2)? If $p_1$ were merely irreducible but not prime, the step "$p_1 \mid ab$ implies $p_1 \mid a$ or $p_1 \mid b$" would fail. The divisibility $p_1 \mid q_1 \cdots q_n$ would not let us pin $p_1$ to any single factor. This is exactly the failure mode in integral domains that are not UFDs -- for instance, in $\mathbb{Z}[\sqrt{-5}]$, the element $2$ is irreducible but not prime, and $2 \mid (1 + \sqrt{-5})(1 - \sqrt{-5})$ without dividing either factor.
[/guided]
[/step]
[step:Cancel $p_1$ and apply the inductive hypothesis to conclude $m = n$]
Since $q_1 = \epsilon \, p_1$ with $\epsilon \in R^\times$, substitute into the original equation:
\begin{align*}
u \, p_1 \, p_2 \cdots p_m = v \, (\epsilon \, p_1) \, q_2 \cdots q_n = (v \epsilon) \, p_1 \, q_2 \cdots q_n.
\end{align*}
Since $R$ is an integral domain and $p_1 \neq 0_R$ (irreducible elements are nonzero), we cancel $p_1$ from both sides:
\begin{align*}
u \, p_2 \cdots p_m = (v \epsilon) \, q_2 \cdots q_n.
\end{align*}
This is an equality of two factorisations into irreducibles with $m - 1$ irreducible factors on the left and $n - 1$ on the right. By the inductive hypothesis, $m - 1 = n - 1$ (so $m = n$) and, after reindexing, each $p_i$ is an associate of $q_i$ for $i = 2, \ldots, m$.
Together with $p_1$ being an associate of $q_1$, this gives: $m = n$ and each $p_i$ is an associate of $q_i$ (after reindexing). The factorisation is therefore unique up to reordering and associates, completing the proof that $R$ is a UFD.
[guided]
We have established that $q_1 = \epsilon \, p_1$ for some unit $\epsilon \in R^\times$. We now substitute this back into the original equation:
\begin{align*}
u \, p_1 \, p_2 \cdots p_m = v \, (\epsilon \, p_1) \, q_2 \cdots q_n = (v \epsilon) \, p_1 \, q_2 \cdots q_n.
\end{align*}
We want to cancel $p_1$ from both sides. Cancellation is valid in an integral domain: if $p_1 \cdot x = p_1 \cdot y$ with $p_1 \neq 0_R$, then $p_1(x - y) = 0_R$, and since $R$ has no zero divisors and $p_1 \neq 0_R$, we conclude $x - y = 0_R$, i.e., $x = y$. Since irreducible elements are nonzero (they are non-units in a domain with at least two elements), $p_1 \neq 0_R$, and cancellation gives:
\begin{align*}
u \, p_2 \cdots p_m = (v\epsilon) \, q_2 \cdots q_n.
\end{align*}
The left-hand side now has $m - 1$ irreducible factors, and the right-hand side has $n - 1$ irreducible factors. The coefficient $v\epsilon$ is a unit (since $v$ and $\epsilon$ are both units, and units are closed under multiplication). The inductive hypothesis applies to this equation (since we are inducting on $m$, and $m - 1 < m$), giving $m - 1 = n - 1$ and, after reindexing, $p_i$ is an associate of $q_i$ for each $i \in \{2, \ldots, m\}$.
Combining with the result from the previous step ($p_1$ and $q_1$ are associates) and the equality $m - 1 = n - 1$ (i.e., $m = n$), we have: the two factorisations have the same number of irreducible factors, and after reindexing, each $p_i$ is an associate of $q_i$. This completes the inductive step.
Taking stock: the base case ($m = 0$ forces $n = 0$) and the inductive step together establish by induction on $m$ that any two factorisations of a nonzero non-unit into irreducibles must agree up to reordering and associates. This is the uniqueness clause in the definition of a UFD. Together with condition (1), which provides existence of factorisations, we conclude that $R$ is a UFD.
[/guided]
[/step]