[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.[/step]