Claude closed Fermat in 11 days: 13.4 million lines of Lean and zero 'it's obvious'
On September 4, Anthropic announced the first complete computer-checked proof of Fermat's Last Theorem. Claude spent 11 days — almost without human help — translating Andrew Wiles's proof into the Lean language: 13.4 million lines of code, roughly 30,000 intermediate theorems, and not a single "it's obvious from here" anywhere. A project mathematicians had budgeted in years — the blueprint for just the first phase, written by Kevin Buzzard of Imperial College London, runs to 86 pages — was finished in under two weeks.
Let's be clear about what did not happen: there is no new proof. The model didn't find its own route to the theorem. It did something arguably harder — it took a human-written proof, full of phrases like "this trivially follows," and rewrote it so that a compiler verifies every single step. Mathematicians have been 99.9% sure of Wiles's argument since 1995. Now the confidence is complete: Lean replayed the entire chain of reasoning from Lean's three standard axioms.
What exactly the computer checked
Numbers work better than adjectives here.
- 13.4 million lines of Lean — more than five times the size of Mathlib, the flagship formal-math library of this ecosystem.
- About 30,000 intermediate theorems were proved; roughly 29,500 of them are used in the final argument.
- Compiling the repository on a 96-core machine takes about 20 times longer than compiling Mathlib. Buzzard got a server with 500 GB of RAM for the verification.
- The whole thing rests on Lean's three standard axioms — no "simplifying assumptions."
Kevin Buzzard — the mathematician who has been running the community's FLT formalization project since 2024 — downloaded the repository, built it, and ran a comparator: the final theorem statement matches the reference one in Mathlib, and every check passes. His verdict: "an extraordinary autoformalization achievement."

One margin note, three and a half centuries of work
Around 1637, Pierre de Fermat scribbled in the margin of Diophantus's Arithmetica a claim: for n greater than two, the equation aⁿ + bⁿ = cⁿ has no solutions in positive integers. Below it, the line that became a legend: "I have discovered a truly marvelous proof of this, which this margin is too narrow to contain." Generations of mathematicians, from Euler to Kummer, chipped away at pieces of it. In 1908 a prize of 100,000 gold marks was announced for a proof — and 621 wrong submissions arrived in the first year alone.
In June 1993 Andrew Wiles presented his proof in a series of lectures in Cambridge. Two months later a referee's question exposed a gap in one of the constructions. Wiles spent a year patching it, first alone and then with his former student Richard Taylor, came close to giving up, and finally published the 129-page paper in 1995. One "engineering" question remained: could a computer be made to confirm all of it?
Not a new proof, but a new capability
The formalization follows the 1995 Darmon–Diamond–Taylor exposition of the Wiles–Taylor argument, going through the Langlands–Tunnell theorem and Ribet's level-lowering. The idea of formalizing Wiles dates back to the 2000s, when the Dutch computer scientist Jan Bergstra proposed it, but until recently it looked like a career's worth of work for an entire field. Some cases — the fourth power, regular primes — had already been ported to Lean. With the new repository, Wiedijk's list of 100 formalization challenges, the twenty-year-old benchmark of this area, is fully closed.
Buzzard is honest about the math itself: formally, the work tells us nothing new — he already believed Wiles. The value lies elsewhere. Verifying a fresh mathematics paper today takes months or years; if a machine can formalize a proof on the fly, review shrinks, and hidden assumptions of the "known to experts" variety start surfacing. For a discipline built on the honesty of its conclusions, that is a serious shift.
What those 11 days looked like from inside
The work was led by Tianyi Peng, an Anthropic researcher who previously built a group of AI-formalization tools at Columbia University. He says he never planned to reach the finish line at first — he just wanted to see how far Claude could push Buzzard's project. It pushed all the way.
Many agents worked in parallel: some filled in mathematical definitions, others attacked intermediate lemmas, others climbed up the tree of theorems, and still others reassembled the pieces into a single argument. The first days went sideways — agents lost track of the project's overall state, and only about seven percent of early attempts survived into the final code. The turning point came when the team moved to a platform called Prove2Me: the proof lives there as a graph of theorem nodes, so at any moment you can see what is proved, what is waiting for prerequisites, and what to attack next. Statements are separated from proofs, compilation is accelerated, and every theorem carries a text description for search. The scale: around six billion output tokens, with human input limited to high-level hints like "this direction has priority."
Where to look
The repository is on GitHub — you can run the verification yourself if you can find a 96-core machine and some patience. Primary sources: Anthropic's write-up and Buzzard's post on the Xena Project blog.
And if a story about 13 million lines makes you curious how modern models handle smaller tasks — algorithms, code, calculations — try the Code and Chat sections on NeuralSpace, or hook the models up to your own projects through the API.