Fundamental Theorem of Arithmetic
Statement
Every integer can be written as a product of prime numbersInfinitude of PrimesEuclid's classic proof that there are infinitely many prime numbersRead more →:
and this representation is unique up to the order of the factors.
Proof Outline
Existence (by strong induction)
- Base case: is prime, so it is its own factorization.
- Inductive step: If , either is prime (done) or with . By the inductive hypothesis, both and have prime factorizations, so does too.
Uniqueness (by contradiction)
Suppose are two prime factorizations. Since and is prime, Euclid's lemma gives for some . Since is also prime, . Cancel and repeat by induction.
Connections
The existence part relies on the Infinitude of PrimesInfinitude of PrimesEuclid's classic proof that there are infinitely many prime numbersRead more →. This theorem is in turn a prerequisite for Fermat's Little TheoremFermat's Little TheoremFor prime p, a^p is congruent to a mod pRead more → and many results in modular arithmetic.
Lean4 Proof
/-- Existence: every nonzero natural number equals the product of its
prime factors raised to their multiplicities. The
`Nat.factorization` finsupp records each multiplicity, and Mathlib
proves the product reconstructs the original number. -/
theorem fta_existence (n : ℕ) (hn : n ≠ 0) :
n.factorization.prod (fun p k => p ^ k) = n :=
Nat.factorization_prod_pow_eq_self hn
/-- Uniqueness: two natural numbers with the same prime factorization
are equal. Since `Nat.factorization` is a function, equal
factorizations force equal nonzero numbers. -/
theorem fta_uniqueness {m n : ℕ} (hm : m ≠ 0) (hn : n ≠ 0)
(h : m.factorization = n.factorization) : m = n :=
Nat.eq_of_factorization_eq hm hn (fun p => by rw [h])Referenced by
- Modular ExponentiationCryptography
- CRT for RingsRing Theory
- Infinitude of PrimesNumber Theory
- Pythagorean TriplesNumber Theory
- Lagrange's Four-Square TheoremNumber Theory
- Fermat's Little TheoremNumber Theory
- Multiplicative FunctionsNumber Theory
- Chinese Remainder TheoremNumber Theory
- Sum of Two SquaresNumber Theory
- Euclidean AlgorithmNumber Theory
- Carmichael NumbersNumber Theory
- Möbius InversionNumber Theory
- Euler's Totient FunctionNumber Theory
- Products and CoproductsCategory Theory
- Limits and ColimitsCategory Theory
- Jordan-Hölder TheoremGroup Theory
- Simple GroupsGroup Theory