technology leadership
Claude Agents Formalized Fermat's Last Theorem in 11 Days: What It Means for AI and Mathematics
In 1637, Pierre de Fermat wrote a conjecture in the margin of a book that would take humanity 358 years to prove. In September 2026, dozens of Claude agents formalized that proof in 11 days.
Anthropic published the research on September 5, 2026. The results are staggering: 13 million lines of Lean code, 30,300 intermediate theorems proved (29,500 used in the final proof), and approximately 6 billion output tokens from an internal research model comparable to Claude Fable 5.1.
Kevin Buzzard, the Imperial College London mathematician who holds a £1 million five-year EPSRC grant to formalize the same theorem, compiled the code himself and wrote on his blog: “Anthropic has beaten me to it.”
But the most important lesson from this achievement isn’t about mathematics. It’s about AI agent orchestration — and why the infrastructure that coordinates agents matters more than the model itself.
The Achievement: 13 Million Lines in 11 Days
What Was Formalized
Fermat’s Last Theorem states that no three positive integers a, b, and c satisfy the equation a^n + b^n = c^n for any integer value of n greater than 2. Andrew Wiles proved it in 1995 using sophisticated tools from algebraic geometry. The proof runs hundreds of pages and relies on deep mathematical machinery.
Anthropic’s agents formalized this proof in Lean, a proof assistant that computer-checks every step. The formalisation follows the 1995 exposition of the Wiles argument by Darmon, Diamond, and Taylor. It uses only Lean’s three standard axioms and was matched by a comparator against the corresponding statement in Mathlib, the community’s mathematics library.
The Scale
- 13.4 million lines of Lean code — more than 5 times the size of Mathlib
- 30,300 intermediate theorems proved — 29,500 used in the final proof
- 6 billion output tokens from an internal research model
- 11 days from start to computer-checked proof
- Takes nearly 20 times as long to compile as Mathlib on a 96-core machine
The Verification
Buzzard didn’t just take Anthropic’s word for it. He compiled the code himself and ran the standard checking tool over it. He also checked for exploitation — because Lean has had soundness bugs found recently, he wanted to ensure the AI hadn’t cheated. He asked an agent to flag every line that wasn’t a definition or a proof, inspected the roughly 100 lines that came back, and found they defined a convenience tactic. He reports that OpenAI’s models have reviewed Lean’s codebase and found no soundness issues in the version used. His conclusion: a hack finishing the job is extremely unlikely.
The Failure: Why the First Attempt Didn’t Work
Here’s the detail that matters most for anyone building AI agent systems: the first attempt failed.
Anthropic’s agents made early progress on the formalisation but then lost track of the project’s state and ceased collaborating. The agents simply couldn’t maintain coherent coordination over a complex, long-horizon task.
Those failed runs still contributed approximately 7% of the non-boilerplate lines in the final proof — so the work wasn’t wasted. But the agents couldn’t finish the job.
The Fix: Prove2Me — Orchestration, Not Models
The fix for the failed attempt was not a better model. It was Prove2Me, an open platform built by Anthropic researcher Tianyi Peng with collaborators at Columbia University.
What Prove2Me Does
- Maintains a graph of theorem statements — agents can see the structure of what they’re proving
- Splits statements and proofs into separate files — speeds compilation and allows parallel work
- Keeps a plain-language description of each statement — agents always know what they’re trying to prove
Why It Worked
With Prove2Me providing shared context and structured task decomposition, the same Claude models — using a multi-agent harness built on Claude Code — finished the formalisation in under a fortnight.
Same models. Better orchestration. Success.
This is the single most important lesson from the Fermat formalisation for anyone building AI agent systems: the orchestration layer matters more than the model.
What Kevin Buzzard Said
Buzzard’s verdict splits in two:
On Mathematics
He puts the odds that Wiles’s proof is correct at 99.9%, notes most of the number theory community sits at 100%, and wrote that the formalisation “just faithfully follows the early literature on the proof and adds nothing”. The AI didn’t discover new mathematics — it formalized existing mathematics.
On AI Capability
He is emphatic in the other direction: “if an AI swarm can formalise thousands of pages of literature end to end in eleven days, formalisation of modern research will start happening on the fly.” He also noted that he was given £1 million over five years for his project, and wondered whether Anthropic spent more in its eleven days.
On Mathlib
The 13 million lines cannot enter Mathlib as things stand. Buzzard, a Mathlib maintainer, says the library will not currently accept AI-generated submissions, and reviewers are reluctant to review AI-generated code because most AI-generated submissions are poor quality. The repository already has approximately 3,000 open pull requests, more than 600 of them active in the review queue.
His grant still commits him to submitting foundational number theory to Mathlib — suggesting human-led formalisation will continue alongside AI-led efforts, at least for now.
The Orchestration Lesson for Business
The Fermat formalisation is a mathematics story, but the lesson applies to every organization building AI agent systems.
The Bottleneck Is Coordination, Not Capability
When the first attempt failed, Anthropic didn’t need a smarter model. They needed better infrastructure for coordinating multiple agents on a complex, long-horizon task. Prove2Me provided:
- Shared context — agents could see the structure of the entire project
- Task decomposition — statements and proofs split into separate files for parallel work
- Plain-language descriptions — agents always understood what they were proving
If your AI agents are failing on complex tasks, the problem is probably not the model. It’s the orchestration layer.
What Good Orchestration Looks Like
Based on the Prove2Me approach, good multi-agent orchestration includes:
- Shared state management — all agents can see the current state of the project
- Structured task decomposition — complex tasks broken into independent, parallelizable units
- Plain-language context — agents understand what they’re working on, not just the syntax
- Failure recovery — when an agent fails, the system can recover without losing all progress
- Compilation/validation — outputs are checked for correctness before being committed
The Investment Priority
If you’re deciding where to invest in AI agent systems, the Fermat formalisation suggests the priority order is:
- Orchestration infrastructure — shared context, task decomposition, failure recovery
- Evaluation and validation — checking agent outputs for correctness
- Model selection — choosing the right model for each task
Most organizations invest in the reverse order — model first, evaluation second, orchestration third. The Fermat formalisation shows why that’s wrong.
The AI Agent Automation Consulting service helps organizations design multi-agent orchestration frameworks: shared state management, task decomposition, failure recovery, and evaluation pipelines — the infrastructure that makes agent systems work.
What This Means for Mathematics
On-the-Fly Formalisation
Buzzard’s prediction — that formalisation of modern research will start happening on the fly — could change how mathematics is done. Instead of publishing a paper and hoping the proof is correct, mathematicians could formalize their proofs as they write them, with AI agents handling the tedious work of translating human arguments into machine-checkable code.
The Human-AI Division of Labor
The Fermat formalisation shows a clear division of labor:
- Humans create the mathematics — the insight, the strategy, the new ideas
- AI agents formalize the mathematics — translating human arguments into machine-checkable Lean code
This is the same pattern we see in other fields: AI handles the mechanical, time-consuming work; humans handle the creative, insight-driven work. The mathematician who embraces AI formalisation will spend less time on tedious verification and more time on new discoveries.
The Mathlib Question
The fact that AI-generated code can’t enter Mathlib yet is a temporary bottleneck. As AI-generated formalisation quality improves and review processes adapt, this will change. Organizations that build expertise in AI-assisted formalisation now will be positioned to contribute when the gates open.
What This Means for Business Leaders
1. Invest in Orchestration Before Models
The Fermat formalisation proves that orchestration infrastructure matters more than model capability. Before you invest in the latest, most expensive model, invest in the infrastructure that will make your agents productive: shared context, task decomposition, failure recovery, and evaluation.
2. Multi-Agent Systems Can Handle Complex, Long-Horizon Tasks
11 days. 13 million lines. 30,300 theorems. This is proof that multi-agent AI systems can handle complex, long-horizon tasks that would take a human team months or years. If AI agents can formalize Fermat’s Last Theorem, what complex tasks in your organization could benefit from multi-agent orchestration?
3. Failed Attempts Still Contribute Value
The first attempt failed but still contributed 7% of the final code. This is a feature of well-designed multi-agent systems — even failed runs produce useful artifacts. Design your systems to capture value from partial successes.
4. The Human-AI Division of Labor Is Clear
AI handles the mechanical work; humans handle the creative work. This pattern applies beyond mathematics — to software engineering, data analysis, research, and any field where complex, structured tasks can be decomposed. The AI Strategy for Business consultation helps organizations identify where this division of labor creates the most value.
5. Build Evaluation Into Your Agent Systems
Buzzard didn’t just trust the AI’s output — he compiled it, checked it, and looked for exploitation. Your AI agent systems need the same level of evaluation: automated checking of outputs, human review of edge cases, and continuous monitoring for errors. The Executive AI Workshop includes sessions on AI evaluation and governance for leadership teams.
The Bottom Line
Claude agents formalized Fermat’s Last Theorem in 11 days. 13 million lines of Lean code. 30,300 theorems. 6 billion tokens. A mathematician with a £1 million grant says Anthropic beat him to it.
But the real story isn’t the mathematics. It’s the orchestration lesson. The first attempt failed because agents couldn’t coordinate. The fix wasn’t a better model — it was Prove2Me, an orchestration platform that provided shared context, structured task decomposition, and plain-language descriptions.
Same models. Better orchestration. Success.
For every organization building AI agent systems, this is the lesson: invest in the orchestration layer before you invest in the model. A well-orchestrated team of mediocre models will outperform a poorly-orchestrated team of great models. The infrastructure that coordinates your agents is the infrastructure that determines whether they succeed.
Fermat’s Last Theorem took 358 years to prove. AI formalized it in 11 days. The next breakthrough in your field might be closer than you think — if your orchestration is ready for it.
Quick answers
How did Claude agents formalize Fermat's Last Theorem?
Anthropic used dozens of Claude agents in a multi-agent harness built on Claude Code to formalize Fermat's Last Theorem in 11 days. The agents produced 13 million lines of Lean code and proved 30,300 intermediate theorems (29,500 used in the final proof). The formalisation follows the 1995 exposition of the Wiles argument by Darmon, Diamond and Taylor, uses only Lean's three standard axioms, and was matched against Mathlib. The run consumed approximately 6 billion output tokens from an internal research model comparable to Claude Fable 5.1.
What is Prove2Me and why was it necessary?
Prove2Me is an open platform built by Anthropic researcher Tianyi Peng with collaborators at Columbia University. It maintains a graph of theorem statements, splits statements and proofs into separate files to speed compilation, and keeps a plain-language description of each statement. The first formalisation attempt failed because agents made early progress but lost track of the project's state and ceased collaborating. The fix was not a better model — it was Prove2Me's orchestration infrastructure that kept agents coordinated.
What did Kevin Buzzard say about the formalisation?
Kevin Buzzard of Imperial College London, who holds a £1M five-year EPSRC grant to formalize the same theorem, compiled Anthropic's code himself and wrote 'Anthropic has beaten me to it' on his blog. He measured the repository at 13.4 million lines (5x the size of Mathlib) and said it takes nearly 20 times as long to compile on a 96-core machine. On mathematics: 'it adds nothing' — the proof faithfully follows existing literature. On AI capability: if an AI swarm can formalise thousands of pages in eleven days, formalisation of modern research will start happening on the fly.
Can the AI-generated proof enter Mathlib?
No. Kevin Buzzard, a Mathlib maintainer, says the library will not currently accept AI-generated submissions, and reviewers are reluctant to review AI-generated code because most AI-generated submissions are poor quality. The repository already has approximately 3,000 open pull requests, more than 600 of them active in the review queue. However, Buzzard's grant still commits him to submitting foundational number theory to Mathlib, suggesting human-led formalisation will continue alongside AI-led efforts.
Related consultation
AI Strategy for Business
Identify high-ROI AI use cases for your business and build a practical, phased adoption roadmap — no hype, just outcomes.
AI Agent & Automation Consulting
Design and deploy AI agents and automation workflows that remove operational bottlenecks — measured in hours saved, not demos.
Executive AI Workshop
A hands-on workshop to help leadership teams understand and act on AI opportunities — practical, not theoretical.
Read next
technology leadership
'How Many Canaries Have We Killed?': Wall Street Debates Whether the AI Bubble Warnings Are Real This Time
18 October 2026
technology leadership
DeepSeek's New Open-Weights Model Beat Claude Opus 5 on Coding — Under an MIT License
17 October 2026
technology leadership
Anthropic Gave METR Employee-Level Access With a No-Veto Publication Right — While Posting $16.8B Quarter
16 October 2026
Get insights like this in your inbox
Join readers getting practical frameworks on digital transformation, AI strategy, and technology leadership. Pick the track that fits you.