Fermat's Last Theorem
Provedflt.fermat_last_theoremThe theorem asserts: for every natural number with , and for all natural numbers with , and , one has . Every quantity occurring is a natural number; the arithmetic is the arithmetic of , so the equation is the unsigned one and no rearrangement with signs is involved. The three positivity hypotheses are stated separately, one for each of , , ; they exclude exactly the degenerate identities and (and, with , the impossible ). The hypothesis restricts the exponent: nothing is claimed for ; indeed for the conclusion fails, since and . The conclusion is a negation of an equality of natural numbers, quantified over all admissible simultaneously; it is the elementary, fully unfolded form of Fermat's assertion, using no project-specific notion and only Mathlib's natural numbers and their power operation.
This is Fermat's Last Theorem in its elementary spelling, the statement proved by Wiles, with Taylor–Wiles, completing the chain through Frey, Serre and Ribet. Mathlib's own formulation is the predicate FermatLastTheorem, namely , nonzero natural numbers, ; that version phrases the nondegeneracy as rather than , and the two formulations are interderivable in one step each way. Being the top-level assertion, it is not used as an input anywhere else in the development.
import Mathlib.NumberTheory.FLT.Basic set_option maxHeartbeats 4000000 set_option synthInstance.maxHeartbeats 400000 set_option backward.isDefEq.respectTransparency.types false
theorem flt.fermat_last_theorem (n : ℕ) (hn : 3 ≤ n) (a b c : ℕ) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) : a ^ n + b ^ n ≠ c ^ n := by sorry