In an integral domain , the decomposition of a nonzero noninvertible element as a product of prime (or irreducible)
factors

(1)

is unique if every other decomposition of the same type has the same number of factors

(2)

and its factors can be rearranged in such a way that for all indices , and differ by an invertible factor.

The prime factorization of an element, if it exists, is always unique, but this does not apply, in general, to irreducible factorizations: in the ring ,

(3)

are two different irreducible factorizations, none of which is prime. 2 is not a prime element in ,
since it does not divide either of the factors of the middle expression. In fact