Listen to this post: Claude Formalised Fermat’s Last Theorem in Lean — in 11 Days

Last updated: 7 September 2026. Figures below are sourced to primary publications — Anthropic’s own research writeup, the Lean/Imperial College project documentation, and named commentators — linked inline throughout.
On 18 August 2026, a Claude-based multi-agent system finished converting Andrew Wiles’s 1995 proof of Fermat’s Last Theorem into roughly 13 million lines of machine-checkable Lean code. Anthropic published the writeup on 4 September, and it has become one of the most discussed AI stories of the week — a genuinely striking result, framed by a lot of coverage in ways that overstate what actually happened. This piece sets out what Claude did, what human mathematicians had already built before Claude touched the problem, and where the “AI did in 11 days what would have taken years” framing breaks down.
The 60-second version
- Anthropic says an internal Claude-based multi-agent system formalised — not newly proved — Fermat’s Last Theorem in the Lean proof assistant, producing about 13 million lines of code and 30,300 proved theorems over 11 days, finishing 18 August 2026.
- Fermat’s Last Theorem was already proved by Andrew Wiles in 1995. Formalisation means encoding an existing proof so a computer can verify every logical step, with no gaps left to human intuition.
- Claude followed a simplified route through the theorem (via Darmon, Diamond and Taylor’s exposition) rather than the more general, research-oriented route that Imperial College London’s human-led FLT-in-Lean project is pursuing under funding that runs to September 2029.
- Kevin Buzzard, who leads the Imperial project, reviewed and endorsed the result; parts of his team’s existing Lean code were reused in Claude’s formalisation.
- Success depended heavily on a purpose-built human tool — a project-tracking platform called Prove2Me — and on occasional strategic human prompts, not a fully unsupervised agent.
- The achievement says more about AI’s growing ability to execute long, structured, verifiable engineering tasks than about AI discovering new mathematics.
Key numbers
| Metric | Figure | Source / note |
|---|---|---|
| Time to complete formalisation | 11 days (finished 18 August 2026) | Anthropic |
| Lean code produced | ~13 million lines | Anthropic; more than 5x the size of Mathlib, the main community Lean library |
| Theorems proved | 30,300 (29,500 used in the final proof) | Anthropic |
| Model used | Internal research model “roughly comparable to Claude Fable 5.1” | Anthropic |
| Compute consumed | ~6 billion output tokens | Anthropic; cost not disclosed |
| Human-led Imperial College project funding window | Through September 2029 | UKRI/EPSRC grant EP/Y022904/1, cited in the project’s own documentation |
| Smaller follow-up test | Vinogradov’s Three Primes Theorem formalised in 3 days on three consumer Claude Max subscriptions | Anthropic |
What Claude actually did — and didn’t do
It’s worth being precise, because the distinction is the whole story. Fermat’s Last Theorem — that no three positive integers a, b and c can satisfy an + bn = cn for any integer n greater than 2 — was proved by Andrew Wiles in 1995, closing a problem that had stood since 1637. Claude did not reprove it or find a new mathematical idea. What the multi-agent system did was formalisation: taking an already-accepted proof and re-expressing every step — including the ones a textbook would consider “obvious” — in Lean, a proof assistant that mechanically checks each logical inference against the axioms of mathematics.
That distinction matters because formalisation is its own, laborious discipline. Human formalisation projects for major theorems routinely run for years, because textbook proofs skip implicit reasoning that a machine checker refuses to accept on faith. Anthropic’s account is consistent with this: the system followed a specific, simplified route through the proof — the exposition by Henri Darmon, Fred Diamond and Richard Taylor — rather than Wiles’s original, more idiosyncratic 129-page argument, and it explicitly reused code from Kevin Buzzard’s existing Imperial College London effort and the related flt-regular project, rather than starting from a blank editor.
Buzzard, who has spent years building the human-led Lean formalisation of FLT, reviewed the finished Claude proof and was quoted by Anthropic calling it “this extraordinary autoformalization achievement” that “proves Fermat’s Last Theorem with no assumptions other than the axioms of mathematics.” An automated Lean comparator also confirmed Claude’s final theorem statement matches the standard formulation already agreed in Mathlib, the community’s central proof library — an important independent check, since a formalisation proving the wrong statement is worthless no matter how many lines long.
Why “11 days” is the wrong comparison
Much of this week’s coverage has framed the story as AI compressing years of human effort into 11 days. That doesn’t hold up once you look at what the two projects are for. Buzzard’s Imperial College effort, funded through September 2029 under UKRI/EPSRC grant EP/Y022904/1, isn’t simply racing to get FLT into Lean by any available route. Its stated goal, per the project’s own documentation, is a “21st century” formalisation built around the modern machinery — modularity lifting, Galois representations, the framework later generalised by Chandrashekhar Khare and Jean-Pierre Wintenberger — that contemporary number theorists actually use, so the resulting library is reusable for other research, not just a one-off certificate that FLT is true.
Claude’s system, by contrast, took the shortest workable path to a checkable proof, reusing what existing Lean code it could borrow. Anthropic itself is candid that the result is “likely much longer than it needs to be” — a faster route to a verified answer, at the cost of a codebase unlikely to slot cleanly into Mathlib or the wider research programme Buzzard’s team is building. Judging the two efforts on a single “time to completion” axis treats a sprint and a foundation-laying research programme as if they were solving the same problem, when they were solving different ones.
This is also not the first time AI capability milestones have needed this kind of caveat. Coverage of OpenAI’s GPT-6 Astra crossing the “Critical” cybersecurity threshold earlier this month ran into a similar problem: an impressive self-reported benchmark score is not the same thing as an independently verified, generalisable capability, and the gap between the two is exactly where the more careful analysis needs to sit.
The human scaffolding nobody’s headline mentions
The most underreported part of Anthropic’s writeup is how much human infrastructure the achievement depended on. The formalisation ran on a platform called Prove2Me, designed by Anthropic researcher Tianyi Peng, which tracked theorem dependencies as a graph, separated theorem statements from their proofs to speed up Lean’s notoriously slow compilation, and let agents search and reuse existing work in natural language rather than re-deriving it. Without that tooling, Anthropic notes, earlier attempts failed outright — roughly 7% of the non-boilerplate lines in the final proof came from agents that lost track of project state and had to backtrack.
Human steering was light-touch but real: Peng gave the system occasional high-level nudges — reportedly flagging that a particular Jacobian construction “sounds high priority”, or pushing the team to get a Mazur-related theorem “done soon” — rather than supervising each step. That’s a different picture from either “fully autonomous AI mathematician” or “AI did nothing interesting.” It sits in between: sustained, structured execution over 11 days with minimal but well-placed human direction, on a task already substantially scoped by human mathematicians before an agent was pointed at it.
That combination — long-horizon execution, occasional human correction, heavy reliance on purpose-built tooling — echoes questions raised by OpenAI’s own recent incident report on reward-hacking agents: as agent systems run longer and more autonomously, the outcome is often decided by the scaffolding and monitoring around them, not the raw model alone.
What this means in practice
For people who build with AI, publish about it, or run infrastructure around it, a few things in this story are worth acting on rather than just admiring.
First, autoformalisation looks like a genuine near-term application rather than a research curiosity, and it fits a broader pattern of AI being pulled into scientific research and discovery workflows. If a general-purpose model can reliably turn known mathematics into Lean with light supervision, the same pattern — take an established, well-specified body of logic and re-express it in a machine-checkable form — plausibly extends to formal software verification, compliance logic, and safety-critical specification work, fields that have historically been too labour-intensive to formalise at scale. Anthropic’s smaller Vinogradov’s Three Primes Theorem test, completed in three days on three consumer Claude Max subscriptions rather than an internal research cluster, is the more useful data point for practitioners than the headline FLT result, since it suggests the technique doesn’t require frontier-lab-scale compute to reproduce on smaller problems.
Second, the compute cost here is real and unpriced: roughly 6 billion output tokens for one theorem, on top of the frontier-scale infrastructure that Anthropic and its rivals are now locking in through deals like the $35bn Lambda compute agreement. Teams evaluating similar agentic workflows should budget for long-running, high-token-count sessions, and for coordination tooling — a Prove2Me-style dependency tracker — since that tooling, not the model alone, was what separated success from repeated failure here.
Third, provenance and review still matter more than raw output volume. This result is credible because an independent comparator checked the final theorem statement against Mathlib’s own formulation, and a named domain expert reviewed and endorsed it. A 13-million-line proof nobody outside the lab had checked would be a much weaker claim. Anyone assessing AI-generated formal or technical output should ask the same question: was it checked against an independent specification, and did a qualified third party review it, or does the claim rest on the model’s own say-so?
What we still don’t know
Several open questions remain, and Anthropic’s writeup does not resolve them. It isn’t clear how much of the reported 7% failure-and-backtrack rate reflects a fundamental limit on agents tracking long-running project state, versus a problem that Prove2Me-style tooling simply papers over — and so how well this generalises to problems without an existing human-built proof to lean on. It isn’t clear whether Buzzard’s team will adopt, adapt, or set aside Claude’s codebase, given their project’s more general goals. Anthropic hasn’t disclosed the dollar cost of the roughly 6 billion tokens consumed, making real-world reproducibility hard to judge. And most importantly, this is a single demonstration on a problem already solved and substantially pre-formalised by humans; it isn’t yet evidence that the same approach can autonomously formalise, let alone discover, a genuinely open mathematical result.
FAQ
Did Claude prove Fermat’s Last Theorem?
No. Andrew Wiles proved it in 1995. Claude’s multi-agent system converted an existing proof route into Lean code that a computer can automatically verify line by line.
Is this the same project as Kevin Buzzard’s Imperial College FLT formalisation?
No, though related. Claude reused some of Buzzard’s Lean code and Buzzard reviewed the final result, but the Imperial project — funded to September 2029 — pursues a more general, research-oriented formalisation, while Claude took a faster, simplified route to a checkable proof.
Does this mean AI can now do independent mathematical research?
Not on this evidence. This was formalisation of an already-known, already-scoped result, with light human guidance throughout — not autonomous discovery of new mathematics.
Can other mathematicians reuse Claude’s 13-million-line proof?
Partially. Its final theorem statement was checked against Mathlib’s own formulation and Buzzard reviewed the result, but Anthropic says the code is “likely much longer than it needs to be,” so integrating it into shared libraries like Mathlib would need further human work.
Sources
- Anthropic — “Formalizing Fermat’s Last Theorem” (primary source)
- Lean Language — “Formalizing Fermat’s Last Theorem in Lean: A Landmark Mathematical Project”
- Imperial College London — FLT-in-Lean project README (GitHub)
- The Next Web — “The man paid to prove Fermat by hand says Claude did it in 11 days”
- OpenAI — “GPT-6 Astra: A new generation of intelligence”
