Fundamental theorem of arithmetic
ProvedFundamentalTheoremOfArithmetic.fundamental_theorem_of_arithmeticThe Fundamental Theorem of Arithmetic states that every nonzero natural number has exactly one factorization into primes, once factorizations that differ only in the order of their factors are identified.
A factorization is represented as a multiset of natural numbers — an unordered collection tracking multiplicity — all of whose elements are prime, whose product (with the empty product equal to ) recovers . The theorem asserts both that such an exists and that it is the only one: any other multiset of primes with product must equal .
For the unique witness is the empty multiset; every has a nonempty multiset of prime factors. This single result underlies essentially all of elementary number theory: it makes , , and multiplicative arithmetic functions well defined in terms of "the" prime factorization of an integer.
Formalization Note. Uniqueness is stated up to reordering by using Multiset rather than List, so no separate permutation argument is needed in the statement itself. This goal decomposes into the mission's two milestones: existence and uniqueness.
import Mathlib
namespace FundamentalTheoremOfArithmetic
theorem fundamental_theorem_of_arithmetic (n : ℕ) (hn : n ≠ 0) :
∃! l : Multiset ℕ, (∀ p ∈ l, p.Prime) ∧ l.prod = n := by sorry
end FundamentalTheoremOfArithmeticRead-back
What the Lean code literally says, in plain math · claude-sonnet-5
For the natural number (with hypothesis ), the theorem asserts the existence of a unique multiset of natural numbers such that (a) every element of (i.e. every with , counted without regard to multiplicity duplication semantics of multisets) satisfies Nat.Prime --- Mathlib's standard primality predicate on , true exactly for with no divisors other than and --- and (b) the product of the elements of , taken with multiplicity, under the natural-number multiplication commutative monoid, equals ; and moreover this is unique in the sense that any other multiset of natural numbers satisfying both conditions (a) and (b) (with ) must equal as a multiset. Concretely, "exists unique" here unfolds to:
Here denotes the product over the multiset (with repetition), where by convention the product of the empty multiset is ; so if were empty, the second conjunct would force . The multiset is a priori an arbitrary finite multiset of natural numbers (no a priori bound on its cardinality or on the size of its elements), constrained only by primality of every member and by the product condition; note that since but is permitted (with , the empty multiset, being the unique witness in that case, since has no prime factors and any nonempty multiset of primes has product ), the hypothesis does not rule out this degenerate case, only (for which no such could exist, since no multiset of natural numbers --- being a product of nonnegative integers each , or the empty product --- can have product ). The theorem is stated for a single fixed with the single hypothesis , and there are no other explicit or implicit arguments, and no typeclass assumptions beyond those already built into the ambient Multiset, Nat, and their multiplication/primality structure from Mathlib.
Confirmed by the mission captain (proposal self-audit).