Fermat's Last Theorem in Lean 4

2. The Frey package and the four-way contradiction

A Frey package (Definitions/Def_FLTPrelim_FreyPackage.lean, adapted from the Imperial College London FLT project) is a structure bundling nonzero integers , a prime , the equation , and the normalisation , , . The same file defines the Frey curve over ℚ,

an integral model of (FreyPackage.freyCurve), and the same equation read over ℤ (FreyPackage.freyCurveInt).

theorem Wiles_Frey (P : FreyPackage) :
    ¬ GaloisRepIsIrreducible (K := AlgebraicClosure ℚ) ℚ P.freyCurve P.p := fun hirr =>
  let ⟨f, hf⟩ := level_lowering_to_two P (frey_isModular P) hirr
  hf (ModularForm.S2_Gamma0_2_eq_zero f)

theorem solution (P : FreyPackage) : False :=
  FreyPackage.Wiles_Frey P (FreyPackage.Mazur_Frey P)

So the contradiction rests on exactly four theorems — FreyPackage.Mazur_Frey (§3), FreyPackage.frey_isModular (§4), FreyPackage.level_lowering_to_two (§5) and ModularForm.S2_Gamma0_2_eq_zero (§6).

§1 From the elementary statement to a prime exponent p ≥ 5 · §3 Irreducibility of the mod-p representation of the Frey curve

How the theorems of this step depend on each other

Green cards are the landmarks named in this section; dashed white cards are landmarks of neighbouring steps they connect to. Premises above conclusions; an arrow may pass through unnamed intermediate theorems. Click a card for its page.

L n0 Fermat's Last Theorem for prime exponents p ≥ 5 FreyPackage.fermatLastTheoremFor_of_five_le n1 No Frey package exists FreyPackage.no_frey_package n1->n0 n2 Frey package from a counterexample of exponent p ≥ 5 FreyPackage.of_counterexample n2->n0 n3 Irreducibility of the mod-p torsion module of the Frey curve FreyPackage.Mazur_Frey n3->n1 n4 Modularity of the Frey curve FreyPackage.frey_isModular n4->n1 n5 Level lowering to Γ₀(2) for the Frey curve FreyPackage.level_lowering_to_two n5->n1 n6 Vanishing of weight-2 cusp forms of level 2 ModularForm.S2_Gamma0_2_eq_zero n11 Level lowering for the Frey curve down to Γ₀(2) FreyPackage.level_lowering_to_two_of_conduct… n6->n11 n7 Irreducibility of E_P[p] when a ≡ 3 (mod 8) FreyPackage.Mazur_Frey_of_a_mod_eight n7->n3 n8 No Galois-stable cofixed line at p=11 FreyPackage.frey_no_cofixed_eleven n8->n3 n9 Mazur at p≥ 17: no cofixed line FreyPackage.frey_no_cofixed_large n9->n3 n10 No Galois-stable cofixed line for p∈{5,7,13} FreyPackage.frey_no_cofixed_small n10->n3 n11->n5 n12 Conductor-level modularity of the Frey curve's mod-p representation FreyPackage.modularRepOfConductorLevel n12->n5 n13 Modularity of semistable integral Weierstrass models WeierstrassCurve.modularity_of_semistableModel n13->n4

Theorems named in this section (5; statement as in the tree, numbers from the import graph)

Frey package from a counterexample of exponent FreyPackage.of_counterexample
theorem FreyPackage.of_counterexample (a b c : ℤ) (ha : a ≠ 0) (hb : b ≠ 0) (hc : c ≠ 0) (p : ℕ) (pp : p.Prime) (hp5 : 5 ≤ p) (H : a ^ p + b ^ p = c ^ p) : Nonempty FreyPackage
0 theorems below · cites 0 · cited by 1 · depth 3 · proof 61 lines, 1 helpers
Irreducibility of the mod- torsion module of the Frey curve FreyPackage.Mazur_Frey
open WeierstrassCurve WeierstrassCurve.Affine WeierstrassCurve.Affine.Point
open CuspForm ModularFormClass UpperHalfPlane
theorem FreyPackage.Mazur_Frey (P : FreyPackage) : GaloisRepIsIrreducible (K := AlgebraicClosure ℚ) ℚ P.freyCurve P.p
5,435 theorems below · cites 5 · cited by 1 · depth 4 · proof 24 lines, 2 helpers
Modularity of the Frey curve FreyPackage.frey_isModular
open WeierstrassCurve WeierstrassCurve.Affine WeierstrassCurve.Affine.Point
open CuspForm ModularFormClass UpperHalfPlane
theorem FreyPackage.frey_isModular (P : FreyPackage) : P.freyCurve.IsModular
27,797 theorems below · cites 1 · cited by 1 · depth 4 · proof 122 lines, 11 helpers
Level lowering to for the Frey curve FreyPackage.level_lowering_to_two
open WeierstrassCurve WeierstrassCurve.Affine WeierstrassCurve.Affine.Point
open CuspForm ModularFormClass UpperHalfPlane
theorem FreyPackage.level_lowering_to_two (P : FreyPackage) (hmod : P.freyCurve.IsModular) (hirr : GaloisRepIsIrreducible (K := AlgebraicClosure ℚ) ℚ P.freyCurve P.p) : ∃ f : CuspForm (CongruenceSubgroup.Gamma0 2) 2, f ≠ 0
27,851 theorems below · cites 2 · cited by 1 · depth 4 · proof 10 lines, 0 helpers
Vanishing of weight- cusp forms of level ModularForm.S2_Gamma0_2_eq_zero
open WeierstrassCurve WeierstrassCurve.Affine WeierstrassCurve.Affine.Point
open CuspForm ModularFormClass UpperHalfPlane
theorem ModularForm.S2_Gamma0_2_eq_zero (f : CuspForm (CongruenceSubgroup.Gamma0 2) 2) : f = 0
0 theorems below · cites 0 · cited by 2 · depth 4 · proof 168 lines, 16 helpers

Definition modules named here

2 theorems of the tree are first reached through this step, in the sense that the first landmark met on a shortest citation path up to fermat_last_theorem is one named in this section. That is a reading aid, not a classification: the infrastructure below modularity and level lowering is largely shared.

§1 From the elementary statement to a prime exponent p ≥ 5 · §3 Irreducibility of the mod-p representation of the Frey curve