Fundamental theorem of arithmetic --- uniqueness
ProvedFundamentalTheoremOfArithmetic.fta_uniquenessThis is the uniqueness half of the Fundamental Theorem of Arithmetic (Apostol, Introduction to Analytic Number Theory, 1976, Theorem 1.10): any two multisets of primes with the same product are equal.
The conclusion is equality of multisets: the same primes occur in and , with exactly the same multiplicities, regardless of the order in which they are listed. Combined with the existence milestone, this yields the mission's goal theorem, that every nonzero has exactly one such multiset.
This lemma is what makes "the" prime factorization of an integer a well-defined object, rather than merely one possible representation among several.
Formalization Note. The standard proof combines strong induction on with Euclid's lemma ( for prime ), used to show that a prime occurring in one multiset must also occur in the other before both are reduced by cancellation.
import Mathlib
namespace FundamentalTheoremOfArithmetic
theorem fta_uniqueness (n : ℕ) (hn : n ≠ 0) (l₁ l₂ : Multiset ℕ)
(h1 : ∀ p ∈ l₁, p.Prime) (h2 : l₁.prod = n)
(h3 : ∀ p ∈ l₂, p.Prime) (h4 : l₂.prod = n) :
l₁ = l₂ := by sorry
end FundamentalTheoremOfArithmeticRead-back
What the Lean code literally says, in plain math · claude-sonnet-5
This theorem, fta_uniqueness, is stated inside the namespace FundamentalTheoremOfArithmetic, under import Mathlib.
Statement. For every natural number , every hypothesis , and every pair of multisets (finite unordered lists of natural numbers with multiplicity, drawn from ), if
then the conclusion is
i.e. and are equal as multisets --- the same primes occur, with exactly the same multiplicities, in both.
Details and edge cases made explicit by the statement.
- ranges over all of , but the hypothesis excludes from consideration; the statement asserts nothing about multisets whose product is .
- and are each an arbitrary
Multiset ℕ--- a multiset is unordered and can contain repeated elements, so this in particular covers the case where a prime occurs with multiplicity greater than one. - and require every element of (resp. ) to satisfy
Nat.Prime, Mathlib's standard primality predicate on (an element is prime iff and its only divisors are and ); nothing is asserted about elements outside the multiset, and there is no bound on the size (cardinality) of or . Multiset.prodis taken with respect to the commutative monoid ; by the stated convention, if (or ) is the empty multiset, its product is defined to be . Since forces , and the empty multiset's product is , an empty multiset is only consistent with (or ) when ; for any satisfying the hypotheses, and must be nonempty. No hypothesis explicitly forbids or from being empty in general --- this is only excluded indirectly via together with when .- The conclusion is multiset equality: it asserts equality of multiplicities for every natural number, not merely that the two multisets have the same underlying set of primes, and not merely that they have the same product or the same length.
- The proof of the theorem is replaced by
sorry, meaning the statement is asserted but not actually proved in this code.
Confirmed by the mission captain (proposal self-audit).