# Prime factorization is unique

Prime factorization is unique is, in the context of the integers, part of the fundamental theorem of arithmetic. But the claim can also be proven more generally in the context of abstract algebra.

## Proof

### Integers

Let $\displaystyle{ a }$ be an integer and $\displaystyle{ a=\left(-1\right)^k\cdot p_1\cdot\text{ . . . }\cdot p_r = \left(-1\right)^l\cdot q_1\cdot\text{ . . . }\cdot q_s }$ two prime factorizations of $\displaystyle{ a }$ where $\displaystyle{ k\text{, } l }$ are either $\displaystyle{ 0 }$ or $\displaystyle{ 1 }$. The prime factor $\displaystyle{ p_1 }$ on the left divides the product $\displaystyle{ \left(-1\right)^l\cdot q_1\cdot\text{ . . . }\cdot q_s }$ on the right, so according to Euclid's lemma (If a prime divides a product it divides one of the factors) $\displaystyle{ p_1 }$ divides one of the factors $\displaystyle{ q_i }$ (no prime divides $\displaystyle{ \pm 1 }$). So $\displaystyle{ p_1 = q_i }$ . If we change the order of the $\displaystyle{ q_1\text{, . . . , }q_s }$ we can assume $\displaystyle{ p_1 = q_1 }$ and after dividing by $\displaystyle{ p_1 }$ on both sides we get $\displaystyle{ \left(-1\right)^{k}\cdot p_2\cdot\text{ . . . }\cdot p_r = \left(-1\right)^{l}\cdot q_2\cdot\text{ . . . }\cdot q_s }$.

By repeating this procedure we can see that $\displaystyle{ r=s }$, $\displaystyle{ k=l }$ and that, after reordering, $\displaystyle{ p_1= q_1\text{, . . . , }p_r= q_r }$.

### Integral domains

The same proof as above also works generaly for an integral domain with a few tweaks. But the uniqueness here refers only to uniqueness except for multiplication with a unit, because in the general case prime elements are just defined by the property If a prime divides a product it divides one of the factors. In the case of the integers for example the units are $\displaystyle{ 1 }$ and $\displaystyle{ -1 }$, so $\displaystyle{ 6=2\cdot 3 = (-2)\cdot (-3) }$ is still considered a unique prime factorization even though $\displaystyle{ -2, -3 }$ would also be prime elements according to this more general definition. (For integers this relative uniqueness is turned into real uniqueness by requiring prime numbers to be positive). Even though there is generally no division operation available in an integral domain one can still "divide" both sides of an equation in the sense that

$\displaystyle{ ax=ay\Rightarrow ax-ay=0\Rightarrow a(x-y)=0\Rightarrow x=y }$ if $\displaystyle{ a\neq 0 }$, since there can be no zero-divisors in an integral domain apart from $\displaystyle{ 0 }$ itself.
 Statement of the claim Prime factorization is unique Level of certainty Proven Nature Theoretical Counterclaim Dependent on Dependency of