irreducible of a UFD is prime

Proof. Let p be an arbitrary irreducible element of D. Thus p is a non-unit. If
a⁢b∈(p)∖{0}, then a⁢b=c⁢p with
c∈D. We write a,b,c as products of irreducibles:

a=p1⁢⋯⁢pl,b=q1⁢⋯⁢qm,c=r1⁢⋯⁢rn

Here, one of those first two products may me empty, i.e. it may be a unit. We have

p1⁢⋯⁢pl⁢q1⁢⋯⁢qm=r1⁢⋯⁢rn⁢p.

(1)

Due to the uniqueness of prime factorization, every factor rk is an associate of certain of the l+m irreducibles on the left hand side of (1). Accordingly, p has to be an associate of one of the pi’s or qj’s. It means that either a∈(p) or b∈(p). Thus, (p) is a prime ideal of D, and its generator must be a prime element.