Proof
Existence of a factorization. Let D be a PID and a be a nonzero element in D that is not a unit. If a is irreducible, then we are done. If not, then there exists a factorization a=a1b1, where neither a1 nor b1 is a unit. Hence, ⟨a⟩⊂⟨a1⟩. By Lemma 18.11, we know that ⟨a⟩=⟨a1⟩; otherwise, a and a1 would be associates and b1 would be a unit, which would contradict our assumption. Now suppose that a1=a2b2, where neither a2 nor b2 is a unit. By the same argument as before, ⟨a1⟩⊂⟨a2⟩. We can continue with this construction to obtain an ascending chain of ideals
⟨a⟩⊂⟨a1⟩⊂⟨a2⟩⊂⋯.
By Lemma 18.14, there exists a positive integer N such that ⟨an⟩=⟨aN⟩ for all n≥N. Consequently, aN must be irreducible. We have now shown that a is the product of two elements, one of which must be irreducible.
Now suppose that a=c1p1, where p1 is irreducible. If c1 is not a unit, we can repeat the preceding argument to conclude that ⟨a⟩⊂⟨c1⟩. Either c1 is irreducible or c1=c2p2, where p2 is irreducible and c2 is not a unit. Continuing in this manner, we obtain another chain of ideals
⟨a⟩⊂⟨c1⟩⊂⟨c2⟩⊂⋯.
This chain must satisfy the ascending chain condition; therefore,
a=p1p2⋯pr
for irreducible elements p1,…,pr.
Uniqueness of the factorization. To show uniqueness, let
a=p1p2⋯pr=q1q2⋯qs,
where each pi and each qi is irreducible. Without loss of generality, we can assume that r<s. Since p1 divides q1q2⋯qs, by Corollary 18.13 it must divide some qi. By rearranging the qi's, we can assume that p1∣q1; hence, q1=u1p1 for some unit u1 in D. Therefore,
a=p1p2⋯pr=u1p1q2⋯qs
or
p2⋯pr=u1q2⋯qs.
Continuing in this manner, we can arrange the qi's such that p2=q2,p3=q3,…,pr=qr, to obtain
u1u2⋯urqr+1⋯qs=1.
In this case qr+1⋯qs is a unit, which contradicts the fact that qr+1,…,qs are irreducibles. Therefore, r=s and the factorization of a is unique.