For nearly four centuries, Fermat’s Last Theorem stood as one of mathematics’ most famous unsolved problems, then one of its hardest to fully verify. Andrew Wiles proved it in 1994 after seven years of secretive work, and mathematicians have spent the three decades since trying to translate that proof into a form a computer can check line by line. Anthropic says an AI system just finished the job in eleven days.
The company disclosed on September 4 that its Claude models, working largely on their own inside a research system called Prove2Me, produced the first complete, machine verified proof of Fermat’s Last Theorem written in the Lean programming language. The scale of the result is what makes it remarkable. The final proof runs to roughly 13 million lines of Lean code, more than five times the size of Mathlib, the community library of formalized mathematics that the proof builds on.
Quick facts
- 13 million lines of Lean code generated, over five times the size of Mathlib
- 30,300 theorems proved in total, 29,500 of them used in the final proof
- Roughly 6 billion output tokens consumed across the run
- The project took a little under two weeks of largely autonomous work
- Verified using only Lean’s three standard axioms, no shortcuts
What Prove2Me actually did
Prove2Me is not a single chatbot session. It is a coordination system that keeps a directed acyclic graph of every theorem statement needed to build toward the final result, then assigns teams of Claude agents to fill in the gaps one branch at a time. Each agent writes Lean code, Lean itself checks whether the proof step is valid, and the system moves on to the next unproved node in the graph. It is closer to a distributed research team than a single model answering a prompt.
According to Anthropic, the model doing the heavy lifting was a general purpose internal research system roughly comparable to Claude Opus 5 in capability, not a specialized math model built for this one task. Human involvement was limited to occasional strategic nudges. Anthropic mathematician Tianyi Liu is said to have offered guidance such as flagging that a particular algebraic structure was high priority, or pushing the agents to finish an earlier theorem from Barry Mazur before moving on. The mathematical grunt work, the actual writing and checking of proof steps, was left almost entirely to the agents.
Why mathematicians are paying attention
Formal verification is a different discipline from proving a theorem in the traditional sense. Wiles convinced other number theorists his 1994 argument was correct through peer review and years of scrutiny. A Lean formalization goes further: it converts every step into a form that a proof checker can confirm mechanically, with no room for a hidden gap or an unstated assumption. That is a much higher bar, and it is also why a human-led effort to formalize the same theorem, running at Imperial College London since 2024, still is not finished.
That project is led by Kevin Buzzard, the mathematician behind the Xena Project, who reviewed Anthropic’s work and gave it his blessing. He confirmed the proof holds “with no assumptions other than the axioms of mathematics.” Rather than treating the result as a reason to stop, Buzzard says his team still has real work ahead, including merging useful pieces into Mathlib and building a document that lets other mathematicians actually explore what the machine produced.
“Autoformalization of algebra, harmonic analysis, geometry and number theory has emerged. AI autoformalization artefacts are now robust enough to be built upon; the proof is multi layered.”Kevin Buzzard, Xena Project, Imperial College London
Fermat’s Last Theorem also happens to be the final entry on Freek Wiedijk’s list of 100 landmark theorems that the formalization community has used as a benchmark for twenty years. Closing that list out is as much a symbolic milestone as a technical one.
The numbers, in context
| Metric | This proof | For comparison |
|---|---|---|
| Lines of Lean code | ~13,000,000 | Mathlib is roughly 2,300,000 lines |
| Theorems proved | 30,300 total | 29,500 used in the final proof |
| Time to complete | ~11 days | Wiles’ original proof took 7 years |
| Output tokens used | ~6 billion | Generated by agents built on a model class near Claude Opus 5 |
What this does not mean
It is worth being precise about what happened here. Claude did not discover a new mathematical idea the way Wiles did. The mathematics itself, the strategy of using modularity and elliptic curves to prove Fermat’s claim, was settled thirty years ago. What the agents did was translate an enormous, technically brutal argument into a form a machine can verify beyond doubt, a task that is more like a massive, exacting engineering project than a creative leap. That distinction matters, because it is also what makes the result trustworthy rather than merely impressive. Every one of those 13 million lines either compiles under Lean’s kernel or the proof fails outright, there is no partial credit and no bluffing.
It also does not mean AI is about to replace mathematicians. Anthropic itself frames the achievement as evidence that autoformalization, the process of converting existing human proofs into checkable code, has crossed a threshold of reliability. Coming up with the next Wiles-level insight, the kind of conceptual breakthrough that opens up an entirely new proof strategy, remains a separate and much harder problem than checking one that already exists.

Formal proofs like this one are written and checked as code, not prose. Photo via Pexels.
Why it matters beyond one theorem
The bigger story is what this proves about the method, not the theorem. If a general purpose model, coordinated by a system like Prove2Me, can formalize a proof this large without a team of specialists hand holding every step, the same approach could plausibly be pointed at other unresolved formalization backlogs across geometry, harmonic analysis, and number theory. That is a meaningfully different claim than saying AI can solve open problems, and it lines up with a broader pattern this year of AI systems being used to accelerate rigorous, checkable work rather than replace human judgment outright, a pattern also visible in how quickly frontier labs have been racing to push their models past new capability thresholds in other technical domains.
For now, the proof sits as a very large, very thoroughly checked artifact that the formal mathematics community is only beginning to dig through. Buzzard has promised pull requests into Mathlib and a readable guide to what the machine actually built. That work, ironically, may take longer than the eleven days it took Claude to write the proof in the first place.
Sources and further reading
- Anthropic: Formalizing Fermat's Last Theorem
- Forbes: Claude formalized Fermat's Last Theorem in 11 days
- The Next Web: Claude formalised Fermat's Last Theorem in Lean
About this article: GeekBlog covers U.S. technology news, AI, phones, smartwatches and gaming. Every story is written and checked under our Editorial Policy. Spotted a mistake or have a story tip? Contact our editors.

