Skip to content
DAH

Mathlib-integrated formalization of the modern FLT proof with reusable Galois-representation infrastructure

In progressTo verify: Lean proofPosed by Imperial College FLT project (Buzzard), 2024
AI-reviewed
On this page16 sections
Difficulty
38/100Hard
How far from a resolution. P vs NP = 100
Application value
29/100Indirect
Realistic practical impact if resolved. P vs NP = 100
Leverage
36/100Local
How much other knowledge hinges on it. P vs NP = 100

Large but known engineering, now helped by agentic tools: 38, above low-precision training (13) and below the research-grade formal-verification problems around 48, because integration with Mathlib's design and review is harder than producing a certificate. Application value 29, just below RH (30), reflects reusable Langlands-programme infrastructure for formalization. Leverage 36: the library would gate further formalized arithmetic geometry but nothing mathematical depends on it.

The problem

Teach a computer to check the whole modern proof of Fermat's Last Theorem, as reusable pieces of a shared library.

  1. 1Wiles proved FLT using deep number theory
  2. 2Computer checking needs all that theory in Lean
  3. 3Build modular forms and Galois tools in Mathlib
  4. 4Result: trusted proof and reusable library

Goal. Formalize the modern proof of Fermat's Last Theorem (FLT) as a Lean 4 library merged into Mathlib. The proof strategy is: a hypothetical solution to ap+bp=cpa^p+b^p=c^p gives an elliptic curve (the Frey curve) with strange properties; the modularity lifting theorems of Wiles and Taylor–Wiles show such a curve would be modular; and Ribet's level-lowering theorem shows no such modular curve exists. The formalization project (led by Kevin Buzzard at Imperial College London, with an EPSRC grant and a public blueprint) is aimed at the heart of this: the R=TR=T theorem, which identifies a deformation ring RR of Galois representations with a Hecke algebra TT acting on modular forms.

What has to be built. The deliverable is reusable definitions and theorems for:

  • modular forms of level NN and weight 2,
  • Hecke algebras (operators that act on modular forms and encode arithmetic),
  • pp-adic Galois representations and their deformation rings,
  • the Taylor–Wiles–Kisin patching method (a technique to prove R=TR=T by combining many auxiliary primes),
  • automorphic forms on definite quaternion algebras.

The criteria for success are strict. Every node of the blueprint is proved with no sorry (Lean's placeholder for an unproved step), each definition fits Mathlib's existing conventions, and the library builds in a time and size comparable to a large Mathlib area.

Why reusable infrastructure matters. Buzzard stresses that the aim is the general theorems, not just FLT: for example, a formal modularity lifting theorem would help with other results in the Langlands programme. A report in December 2024, two months in, described building a modern R=TR=T argument based on work of Diamond, Fujiwara, Kisin, Taylor and Scholze, noting that some ingredients, such as crystalline cohomology and divided powers, were still missing from Mathlib.

The machine certificate. On 4 September 2026 Anthropic announced an agentic formalization of FLT, a certificate of about 13 million lines following the Darmon–Diamond–Taylor route. It compiles about twenty times slower than Mathlib and is not integrated into it. Buzzard checked its final statement and judged that it tells us essentially nothing new mathematically. It does not achieve the stated deliverable of a maintainable, merged library with reusable infrastructure.

Status. In progress. The real difficulty is not the logic but the sheer amount of background: the project has to formalize the infrastructure of arithmetic geometry that humans take for granted.

Go deeper

The full technical text.

Formalize the modern proof of Fermat's Last Theorem (modularity lifting via the Taylor–Wiles–Kisin patching method, as in the Imperial blueprint) as a Lean 4 library merged into Mathlib. The deliverable is reusable definitions and theorems for modular forms of level N and weight 2, Hecke algebras, p-adic Galois representations and deformation rings, Hida/Taylor–Wiles patching, and automorphic forms on definite quaternion algebras. Every blueprint node is proved without sorry, each definition is compatible with Mathlib's existing API, and the library builds in time and size comparable to a large Mathlib subtree.

Words on this page (11)
Words on this page
Fermat's Last Theorem
Two positive whole numbers raised to the same power greater than 2 never add up to a third number raised to that power.
Lean and Mathlib
A proof assistant and its shared library of already-checked mathematics.
formalization
Rewriting a mathematical statement and proof in a precise form a computer can check.
modular form
A highly symmetric complex function; elliptic curves over the rationals correspond to special ones.
Galois representation
A way of describing the symmetries of number systems using matrices.
Hecke algebra
A collection of operators acting on modular forms that records arithmetic information.
modularity lifting
A method showing that if a curve looks modular modulo a prime, then it is actually modular.
Taylor-Wiles patching
A technique for proving that two rings are equal by combining information from many auxiliary primes.
elliptic curve
The set of solutions of a smooth cubic equation, whose points can be added together.
blueprint
A public outline that splits a formalization project into numbered pieces so many people can work on it.
Frey curve
The elliptic curve built from a hypothetical solution of a^p + b^p = c^p; it would be too strange to be modular.
New to this? Read first (4)
New to this? Read first

Path to understanding

foundations → problem

The research entries this problem rests on, in the order to read them. Each links to its explainer.

  1. Start with
  2. Step 2
  3. Step 3
  4. Step 4
  5. Then
    • Mathlib-integrated formalization of the modern FLT proof with reusable Galois-representation infrastructureThe problem

State of the art

In progress. The Imperial project started in October 2024 with an EPSRC grant and a public blueprint. Buzzard's December 2024 report, two months in, describes formalizing a modern R = T (modularity lifting) argument building on Diamond, Fujiwara, Kisin, Taylor and Scholze, with ingredients such as crystalline cohomology and divided powers still missing from Mathlib, and stresses that the aim is the general theorems rather than FLT alone. On 4 September 2026 Anthropic's agentic formalization produced a 13-million-line certificate of FLT following the Darmon–Diamond–Taylor route; it compiles about twenty times slower than Mathlib and is not integrated with it. Buzzard checked its final statement with Comparator and judged that it tells us essentially nothing new mathematically. The integrated formalization of the modern proof, including reusable automorphic infrastructure, remains to be done and is not covered by the certificate.

Realistic applications

Reusable formal infrastructure for the Langlands program (Galois representations, Hecke algebras, deformation rings) so that further arithmetic theorems can be formalized without rebuilding it. Also a test bed for scaling Mathlib development.

What counts as solved

The Imperial blueprint is fully formalized with no sorry, merged into Mathlib or an agreed library compatible with it, the theorem FermatLastTheorem derived from the integrated library, and the library compiles within a stated budget (for example at most 3 times Mathlib's build time).

How it gets verified

To verify: Lean proof

A formal proof checked by Lean 4 / Mathlib.

Goal: the theorem FermatLastTheorem (Mathlib defines FermatLastTheoremFor and has the cases n = 3 and n = 4) derived from the Imperial College FLT project at github.com/ImperialCollegeLondon/FLT, merged into Mathlib or a compatible library. Done means no sorry, the library builds within the stated budget (for example 3 times Mathlib's build time), and CI is green on a pinned Lean and Mathlib version.

Claims

Where the work is

Theory
10%
New mathematical or conceptual ideas
Engineering
80%
Building instruments, chips, systems, software, formal proofs
Compute
10%
Raw computation, search, simulation
Empirical
0%
Observation, experiment, data collection

Almost all effort is formalization engineering: API design, refactoring, upstreaming and review.

Connected problems

No connected problems.

Progress

  1. Sep 4, 2026
    13M-line certificate appears

    Does not replace the integrated library; gives a reference proof to port from.

    source
  2. Dec 11, 2024
    Buzzard progress report

    Describes the reduction to automorphic input and what remains.

    source
  3. Oct 1, 2024
    Project starts

    EPSRC-funded Imperial FLT project begins (month approximate).

    source