Mathlib-integrated formalization of the modern FLT proof with reusable Galois-representation infrastructure
On this page16 sections
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.
- 1Wiles proved FLT using deep number theory
- 2Computer checking needs all that theory in Lean
- 3Build modular forms and Galois tools in Mathlib
- 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 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 theorem, which identifies a deformation ring of Galois representations with a Hecke algebra acting on modular forms.
What has to be built. The deliverable is reusable definitions and theorems for:
- modular forms of level and weight 2,
- Hecke algebras (operators that act on modular forms and encode arithmetic),
- -adic Galois representations and their deformation rings,
- the Taylor–Wiles–Kisin patching method (a technique to prove 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 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)
- 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)
- Fermat's Last Theorem - WikipediaThe theorem and its history.
- Wiles's proof of Fermat's Last Theorem - WikipediaA summary of how the proof goes.
- Lean community home pageWhere Mathlib and the formalization projects live.
- Lean 4 and Mathlib (research entry)What the formalization is built on.
Path to understanding
foundations → problemThe research entries this problem rests on, in the order to read them. Each links to its explainer.
- Start with
- Step 2
- Step 3
- Step 4
- Elliptic curvesTheory · host
- 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 proofA 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
Almost all effort is formalization engineering: API design, refactoring, upstreaming and review.
Connected problems
No connected problems.
Progress
- Sep 4, 202613M-line certificate appearssource
Does not replace the integrated library; gives a reference proof to port from.
- Dec 11, 2024Buzzard progress reportsource
Describes the reduction to automorphic input and what remains.
- Oct 1, 2024Project startssource
EPSRC-funded Imperial FLT project begins (month approximate).