Kummer's theorem: Fermat's Last Theorem for regular primes
Provedflt_regularLet be a natural number carrying an instance of Fact p.Prime, so that is prime. Two hypotheses are imposed. First, hreg: is coprime, in the sense of Nat.Coprime, to Fintype.card (ClassGroup (𝓞 (CyclotomicField p ℚ))), the order of the ideal class group of the ring of integers of the -th cyclotomic field — that is, , which for prime amounts to , the regularity of . Here CyclotomicField p ℚ is Mathlib's -th cyclotomic extension of and the finiteness of the class group is supplied by the ambient number-field instances. Second, hodd: , so is an odd prime. The conclusion is FermatLastTheoremFor p, Mathlib's predicate asserting that for all natural numbers with , and one has ; equivalently (and this is the form used in the proof) there is no triple of nonzero integers with . Thus: for every odd prime not dividing the class number of , the Fermat equation of exponent has no solution in nonzero integers. No assumption of coprimality of , and no restriction on the divisibility of by , is made.
This is Kummer's theorem on Fermat's Last Theorem for regular primes, in the usual formulation except that regularity is expressed as coprimality of with the full class number rather than with the relative class number , and the excluded exponent is stated as the hypothesis . Within the present development it serves to settle the exponents , and outright: fermatLastTheoremSeven, fermatLastTheoremEleven and fermatLastTheoremThirteen each combine it with a proof that the ring of integers of the corresponding cyclotomic field is principal, so that the class number is and the coprimality hypothesis is automatic. Those three exponents, together with , are exactly the ones at which the Eisenstein-ideal argument for irreducibility of the mod representation of a Frey curve is unavailable, and for which the relevant statement is instead made vacuous.
import Mathlib set_option maxHeartbeats 4000000 set_option synthInstance.maxHeartbeats 400000 set_option backward.isDefEq.respectTransparency.types false open scoped NumberField
theorem flt_regular {p : ℕ} [Fact p.Prime] (hreg : p.Coprime (Fintype.card (ClassGroup (𝓞 (CyclotomicField p ℚ))))) (hodd : p ≠ 2) : FermatLastTheoremFor p := by sorry