Unique factorization domain (source code)

= Unique factorization domain
{wiki}

A <unique factorization domain> is an <integral domain> in which every nonzero nonunit factors into finitely many <irreducible elements>, uniquely up to reordering and multiplying individual factors by <units>. Existence and uniqueness are both required. The <integers> and the <polynomial ring> $k[X]$ over a <field> are examples.

In a <unique factorization domain>, every <irreducible element> is a <prime element>. Comparing <prime factorizations> therefore justifies cancellation of common factors and the usual exponent rules for a <greatest common divisor>. The <integral domain> $\mathbb Z[\sqrt{-5}]$ fails uniqueness, as $6=2\cdot3=(1+\sqrt{-5})(1-\sqrt{-5})$ gives inequivalent factorizations into <irreducible elements>.