[proofplan]
A unique factorisation domain requires two properties: (1) every nonzero non-unit admits a factorisation into irreducibles, and (2) this factorisation is unique up to reordering and associates. We prove existence and uniqueness separately. For existence, we show that ACCP prevents infinite descent: if some nonzero non-unit could not be written as a finite product of irreducibles, we could construct a strictly ascending chain of principal ideals, contradicting ACCP. For uniqueness, we use the hypothesis that every irreducible is prime and induct on the number of irreducible factors, applying the definition of primality at each stage to peel off one factor at a time.
[/proofplan]
[step:Show that every nonzero non-unit admits a factorisation into irreducibles using ACCP]
Let $a \in R$ be a nonzero non-unit. Suppose for contradiction that $a$ cannot be written as a finite product of irreducibles. In particular, $a$ is not itself irreducible, so there exist non-units $a_1, b_1 \in R$ with $a = a_1 b_1$. At least one of $a_1, b_1$ cannot be written as a finite product of irreducibles (otherwise $a = a_1 b_1$ would itself be such a product). WLOG, $a_1$ cannot be written as a product of irreducibles.
Since $a = a_1 b_1$ with $b_1$ a non-unit, we have $(a) \subsetneq (a_1)$: the inclusion $(a) \subset (a_1)$ holds because $a = a_1 b_1 \in (a_1)$, and it is strict because if $(a) = (a_1)$ then $a_1 = ua$ for some $u \in R$, giving $a = ua b_1$, hence $1_R = u b_1$ (cancelling $a \neq 0$ in the integral domain $R$), contradicting that $b_1$ is a non-unit.
Repeating the argument: $a_1$ is a nonzero non-unit that cannot be factored into irreducibles, so $a_1 = a_2 b_2$ with $a_2, b_2$ non-units, $a_2$ not factorable into irreducibles, and $(a_1) \subsetneq (a_2)$ by the same reasoning. Continuing inductively, we obtain a strictly ascending chain of principal ideals
\begin{align*}
(a) \subsetneq (a_1) \subsetneq (a_2) \subsetneq \cdots,
\end{align*}
which contradicts the ascending chain condition on principal ideals. Therefore every nonzero non-unit of $R$ admits a factorisation into irreducibles.
[guided]
Why does ACCP give existence of factorisations? The idea is a proof by contradiction using infinite descent. Suppose some nonzero non-unit $a$ cannot be expressed as a product of irreducibles. Then $a$ is not irreducible (an irreducible element is, by itself, a product of one irreducible), so $a = a_1 b_1$ where $a_1$ and $b_1$ are both non-units. If both $a_1$ and $b_1$ could be factored into irreducibles, then so could $a = a_1 b_1$, contradicting our assumption. So at least one of them -- say $a_1$ -- also fails to be a product of irreducibles.
We claim $(a) \subsetneq (a_1)$. The containment $(a) \subset (a_1)$ is immediate: $a = a_1 b_1 \in (a_1)$. For strictness, suppose $(a) = (a_1)$. Then $a_1 \in (a)$, so $a_1 = ua$ for some $u \in R$. Substituting: $a = a_1 b_1 = ua b_1$. Since $a \neq 0$ and $R$ is an [integral domain](/page/Integral%20Domain), we may cancel $a$ to get $1_R = u b_1$. But this means $b_1$ is a unit, contradicting our choice of $b_1$ as a non-unit. So the inclusion is strict.
Now we iterate. Since $a_1$ is a nonzero non-unit that cannot be factored into irreducibles, we write $a_1 = a_2 b_2$ with $a_2, b_2$ non-units and $a_2$ not factorable into irreducibles. The same argument gives $(a_1) \subsetneq (a_2)$. Continuing, we build a strictly ascending chain
\begin{align*}
(a) \subsetneq (a_1) \subsetneq (a_2) \subsetneq \cdots
\end{align*}
of principal ideals. This directly contradicts the [ascending chain condition on principal ideals](/page/Ascending%20Chain%20Condition%20on%20Principal%20Ideals), which asserts that every ascending chain of principal ideals in $R$ eventually stabilises. The contradiction shows that our assumption was wrong: every nonzero non-unit of $R$ can be written as a finite product of irreducibles.
Note that we have used only the ACCP hypothesis here; the primality of irreducibles plays no role in the existence argument. That hypothesis will be consumed in the uniqueness step.
[/guided]
[/step]
[step:Establish uniqueness of factorisation by induction using primality of irreducibles]
Suppose a nonzero non-unit $a \in R$ has two factorisations into irreducibles:
\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 $p_1, \ldots, p_m, q_1, \ldots, q_n$ are irreducible elements of $R$. We prove by induction on $m$ that $m = n$ and, after reindexing, each $p_i$ is an associate of $q_i$.
**Base case ($m = 1$).** Then $a = u p_1 = v q_1 \cdots q_n$. The element $p_1$ is irreducible, hence prime by hypothesis. Since $p_1 \mid v q_1 \cdots q_n$ and $p_1$ is not a unit, we claim $p_1 \mid q_j$ for some $j$. To see this, note that if $p_1 \nmid v$ (which holds since $v$ is a unit and $p_1$ is not), then by primality $p_1 \mid q_1 \cdots q_n$. Applying primality iteratively: $p_1 \mid q_1 \cdots q_n$ implies $p_1 \mid q_1$ or $p_1 \mid q_2 \cdots q_n$, and continuing, $p_1 \mid q_j$ for some $j \in \{1, \ldots, n\}$. After reindexing, $p_1 \mid q_1$. Since $q_1$ is irreducible and $p_1$ is not a unit, the only way $p_1 \mid q_1$ can hold is if $q_1 = \epsilon p_1$ for some unit $\epsilon \in R^\times$, i.e., $p_1$ and $q_1$ are associates. Substituting: $u p_1 = v \epsilon p_1 q_2 \cdots q_n$. Cancelling $p_1 \neq 0$ gives $u = v \epsilon q_2 \cdots q_n$. Since $u$ is a unit, the product $v \epsilon q_2 \cdots q_n$ is a unit. But each $q_i$ is irreducible (hence a non-unit), and a product of non-units in an integral domain cannot be a unit. Therefore $n = 1$, and $u = v\epsilon$.
**Inductive step.** Assume the result holds for all factorisations with fewer than $m$ irreducible factors, and consider $u p_1 \cdots p_m = v q_1 \cdots q_n$ with $m \ge 2$. The irreducible $p_1$ is prime by hypothesis. Since $p_1 \mid v q_1 \cdots q_n$ and $p_1$ is a non-unit (so $p_1 \nmid v$, as $v$ is a unit), primality gives $p_1 \mid q_1 \cdots q_n$. By iterating the primality condition as in the base case, $p_1 \mid q_j$ for some $j$. After reindexing, $p_1 \mid q_1$, so $q_1 = \epsilon p_1$ for some $\epsilon \in R^\times$ (since $q_1$ is irreducible and $p_1$ is a non-unit). Substituting and cancelling $p_1$:
\begin{align*}
u \, p_2 \cdots p_m = v \epsilon \, q_2 \cdots q_n.
\end{align*}
This is a pair of factorisations with $m - 1$ irreducible factors on the left. By the inductive hypothesis, $m - 1 = n - 1$ (so $m = n$) and, after reindexing $q_2, \ldots, q_n$, each $p_i$ is an associate of $q_i$ for $i = 2, \ldots, m$.
Combined with $p_1$ being an associate of $q_1$, the factorisation is unique up to reordering and associates.
[guided]
The uniqueness argument is where the hypothesis "every irreducible is prime" is essential. The standard proof follows the pattern used in showing that $\mathbb{Z}$ has unique factorisation, but it works in any integral domain where irreducibles are prime.
Suppose $a$ has two factorisations:
\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$ and all $p_i, q_j$ are irreducible. We induct on $m$.
**Base case ($m = 1$).** We have $u p_1 = v q_1 \cdots q_n$. The element $p_1$ is prime by hypothesis. Since $p_1 \mid vq_1 \cdots q_n$ and $v$ is a unit (so $p_1 \nmid v$ because $p_1$ is a non-unit), the definition of primality gives $p_1 \mid q_1 \cdots q_n$. What does primality say concretely? It says: for $p_1 \mid q_1 \cdots q_n$, either $p_1 \mid q_1$ or $p_1 \mid q_2 \cdots q_n$. If $p_1 \nmid q_1$, then $p_1 \mid q_2 \cdots q_n$, and we repeat. After at most $n$ applications, we find $p_1 \mid q_j$ for some $j$.
Reindex so that $j = 1$. Then $q_1 = \epsilon p_1$ for some $\epsilon \in R^\times$. Why must $\epsilon$ be a unit? Because $q_1$ is irreducible: $q_1 = \epsilon \cdot p_1$ is a factorisation of $q_1$, and since $q_1$ is irreducible and $p_1$ is not a unit, $\epsilon$ must be a unit. So $p_1$ and $q_1$ are associates.
Now substitute $q_1 = \epsilon p_1$ and cancel $p_1$:
\begin{align*}
u = v \epsilon \, q_2 \cdots q_n.
\end{align*}
The LHS is a unit. If $n \ge 2$, then the RHS contains the irreducible (hence non-unit) factor $q_2$. In an integral domain, a product containing a non-unit factor is itself a non-unit (if $q_2 c = 1$ then $q_2$ would be a unit). This is a contradiction, so $n = 1$.
**Inductive step ($m \ge 2$).** By the same primality argument, $p_1 \mid q_j$ for some $j$; reindex so $q_1 = \epsilon p_1$ with $\epsilon \in R^\times$. Substitute and cancel:
\begin{align*}
u \, p_2 \cdots p_m = v\epsilon \, q_2 \cdots q_n.
\end{align*}
The LHS has $m - 1$ irreducible factors. By the inductive hypothesis applied to this equation (with $m - 1 < m$), we conclude $m - 1 = n - 1$ and, after reindexing, $p_i$ is an associate of $q_i$ for $i = 2, \ldots, m$. Combined with $p_1$ being an associate of $q_1$, we have $m = n$ and a complete matching.
What would go wrong without the primality hypothesis? If irreducibles were not prime, we could not conclude from $p_1 \mid q_1 \cdots q_n$ that $p_1$ divides one of the $q_j$. This is exactly the phenomenon that occurs in rings like $\mathbb{Z}[\sqrt{-5}]$, where $2$ is irreducible but not prime: $2 \mid (1 + \sqrt{-5})(1 - \sqrt{-5}) = 6$ yet $2 \nmid (1 + \sqrt{-5})$ and $2 \nmid (1 - \sqrt{-5})$. The failure of primality is the root cause of non-unique factorisation.
[/guided]
[/step]
[step:Combine existence and uniqueness to conclude $R$ is a UFD]
By the first step, every nonzero non-unit of $R$ can be written as a product of irreducibles (existence). By the second step, this factorisation is unique up to reordering and multiplication by units (uniqueness). These are precisely the two defining properties of a [unique factorisation domain](/page/Unique%20Factorisation%20Domain). Therefore $R$ is a UFD.
[/step]