A prime number is a positive integer greater than 1 whose only divisors are 1 and itself.
Theorem (Fundamental Theorem of Arithmetic).
For every n∈N+ with n>1, n has a unique prime factorization.
That is, we can write
n=p1p2⋯pk,
where k≥1, each pi is prime, and
p1≤p2≤⋯≤pk.
The proof relies on Euclid's Lemma.
Euclid's Lemma.
If p is prime and p∣ab, then p∣a or p∣b.
Corollary.
If p∣q1q2⋯qℓ, then p∣qi for some i∈[ℓ].
Proof of Euclid's Lemma.
Suppose p is prime and p∤a.
Then gcd(a,p)=1, so a has a multiplicative inverse modulo p, denoted a−1∈Fp, with
a−1a≡1(modp).
If p∣ab, then ab≡0(modp). Multiplying both sides by a−1 gives
b≡a−1ab≡0(modp),
so p∣b.
A symmetric argument holds if p∤b. ∎
Proof of the Theorem.
Suppose n has two prime factorizations:
n=p1p2⋯pk=q1q2⋯qℓ.
Then p1∣q1q2⋯qℓ.
By the corollary to Euclid’s Lemma, p1∣qi for some i.
Since both p1 and qi are primes, we must have p1=qi.
Canceling this common factor from both sides and applying induction to the remaining product yields that the two factorizations must agree up to order.
Thus, prime factorization is unique. ∎
Corollary.
Let
n=p1d1p2d2⋯pkdk,m=q1f1q2f2⋯qℓfℓ,
where all pi and qj are distinct primes.
If n∣m, then for each i∈[k], there exists some j∈[ℓ] such that
pi=qj,di≤fj.
Proof.
Since n∣m, every prime factor of n must also divide m.
Applying Euclid’s Lemma repeatedly and canceling common prime factors shows that the exponent of each pi in n cannot exceed its exponent in m.
This establishes the result. ∎