Solution (source code)

= Solution

First, every nonzero nonunit in a <principal ideal domain> factors into <irreducible elements>. Otherwise repeatedly choose a proper nonunit factor $a_{j+1}$ of $a_j$; then the principal ideals
$$
(a_1)\subsetneq(a_2)\subsetneq\cdots
$$
form a strictly increasing chain, contradicting the <ascending chain condition>, since every principal ideal domain is a <Noetherian ring>.

Next every irreducible $p$ is a <prime element>. If $p\mid ab$ but $p\nmid a$, then $\gcd(p,a)=1$. The <Bezout identity> gives $up+va=1$, so multiplying by $b$ shows $p\mid b$. Thus irreducibles are prime.

Existence of an irreducible factorization and primality give uniqueness: an irreducible on one side divides the product on the other, hence is associate to one factor; cancel and continue. \b[Therefore every principal ideal domain is a <unique factorization domain>.]