[Math] How to prove every integer’s prime factorization is unique up to the ordering of its prime factors

elementary-number-theoryprime factorizationprime numbers

Help! Can you please see if there are any errors in this proof by contradiction that I wrote? Assume that there exists a positive integer n with a prime factorization that is not unique up to the ordering of its prime factors. This means there must at least two different prime factorizations for n.

Let $n = p_1 \cdot p_2 \cdots p_m = q_1 \cdot q_2 \cdots q_k$, where each $p_i$ and $q_j$ are positive prime numbers and each $p_i \neq q_j.$ Without loss of generality, assume that $p_1 \leq p_i$ and that $p_1 < q_j.$ Since $p_1$ is a factor of $n$, $p_1 \mid n.$ However, since $p_i \neq q_j$ implies $p_1 \neq q_j,$ it must be that $p_1 \not\mid q_1 \cdot q_2 \cdots q_k,$ otherwise this would contradict that each $q_j$ is prime and has only itself and $1$ as positive factors. By substituting $q_1 \cdot q_2 \cdots q_k$ for $n,$ $p_1 \not\mid n.$

$p_1 \mid n$ and $p_1 \not\mid n$ is a contradiction, which means the original assumption was false. It must follow that every positive integer's prime factorization is unique up to the ordering of its prime factors.

Best Answer

There is one (rather large) assumption that you make without justification: namely, that $p_i\ne q_j$ for all $i,j.$ It actually is okay to assume that, but it needs justification. In particular, we should assume that $n$ is the least positive integer without a unique factorization. We know that $n$ is composite, and can't have any common primes in its two factorizations, for if so, division by those primes would yield a smaller positive integer with nonunique factorization.

More simply, we could assume by way of contradiction (and without justification) that some $p_i$ is not equal to any of the $q_j$s, or that some $q_j$ is not equal to any of the $p_i$s. Without loss of generality, we can assume that $p_1$ is not equal to any of the $q_j$s. Since $p_1\mid n=q_1\cdots q_k,$ then since $p_1$ is prime, we have that $p_1\mid q_j$ for some $j,$ but this would imply that $p_1=q_j,$ a contradiction.

This uses the fact that the prime integers are precisely those integers $p$ such that if $p\mid a\cdot b$ for some integers $a,b,$ then $p\mid a$ or $p\mid b.$ If you don't know (haven't proved) this fact, then your approach works just fine, with justification.