AI/TLDR

Anthropic · 2026-09-04 · major

Claude formalizes Fermat's Last Theorem — 13M lines of Lean in 11 days

Anthropic says Claude produced the first end-to-end, computer-checked proof of Fermat's Last Theorem, writing 13 million lines of Lean in 11 days. The full proof is on GitHub under Apache-2.0.

Anthropic research post on Claude's machine-checked Lean proof of Fermat's Last Theorem

The first complete machine-checked proof of Fermat's Last Theorem, written largely on its own by Claude agents over 11 days.

Key specs

Time to complete11 days
Size vs mathlib5x larger

Quick facts

MakerAnthropic
Model usedInternal research model, comparable to Claude Fable 5.1
Proof size13 million lines of Lean 4
Theorems proved29,500 intermediate theorems
Compute usedAbout 6 billion output tokens
LicenseApache-2.0
Checked byLean, using its three standard axioms

What is it?

Fermat's Last Theorem now has a proof a computer can check line by line. Anthropic ran dozens of Claude agents that wrote 13 million lines of Lean, a language in which every step is verified by machine, and proved 29,500 intermediate theorems along the way. Lean checked the finished proof, which uses just Lean's three standard axioms, and a comparator confirmed the final statement matches Mathlib's own wording of the theorem.

How does it work?

The agents coordinated through Prove2Me, an open platform designed by Tianyi Peng and collaborators at Columbia University. Prove2Me stores theorem statements as a directed acyclic graph, so each agent can see what to prove next; it keeps statements and proofs in separate files, and holds a plain-language description of every theorem so agents find and reuse earlier work instead of redoing it. Earlier runs without it fell apart — the agents lost track of the project's state and stopped collaborating. Human mathematical input was limited to occasional one-line priority hints from Peng.

Why does it matter?

Formal proof has been a slow, hand-built craft: the community blueprint covering just the first phase of Fermat's Last Theorem runs to 86 pages. Anthropic's run shows machine-checked mathematics can be produced at a scale humans would not attempt by hand, which Anthropic argues may become the practical way for mathematicians to keep up as more results start coming from AI. Kevin Buzzard of Imperial College London, who leads the community effort to formalize the theorem, reviewed the result.

Who is it for?

mathematicians and formal-methods researchers

Frequently asked questions

Is the Fermat's Last Theorem proof open source?
Yes. Anthropic published the complete Lean 4 proof at github.com/anthropics/fermats-last-theorem under the Apache-2.0 license, with a PROOF-PATH.md walkthrough and an offline HTML browser covering every theorem page and dependency graph. Anyone can re-run Lean over the repository and confirm the result independently rather than taking Anthropic's word for it.
Did Claude discover a new proof of Fermat's Last Theorem?
No. Claude formalized an existing proof rather than finding a new one. The agents followed a simplified version of Andrew Wiles's proof written up by Darmon, Diamond and Taylor, and adapted pieces from the Imperial College London FLT project and the flt-regular project. What is new is the complete, machine-checked version of that argument.
How much compute did the Fermat's Last Theorem formalization take?
The Fermat's Last Theorem project consumed about six billion output tokens over 11 days from a general-purpose internal research model that Anthropic describes as roughly comparable to Claude Fable 5.1. Anthropic did not publish a dollar cost. Roughly 7% of the non-boilerplate lines in the final proof came from attempts that failed along the way.
How does the proof compare to Mathlib?
At 13 million lines, Claude's Fermat's Last Theorem proof is over five times the size of Mathlib, the community library of formal mathematics it builds on. Anthropic says the gap is partly a matter of style: Mathlib is concise and heavily reviewed, while this proof is, in Anthropic's own words, likely much longer than it needs to be.
Do you need special access to do this kind of formalization?
Not for smaller targets. Alongside the Fermat's Last Theorem run, Anthropic describes a parallel experiment using three personal Claude Max plans to formalize applications of the Hardy-Littlewood Circle Method. That group finished a formalization of Vinogradov's Three Primes Theorem in three days, on consumer-tier subscriptions.

Try it

git clone https://github.com/anthropics/fermats-last-theorem

Sources · 4 outlets

Tags

  • anthropic
  • claude
  • lean
  • formal-verification
  • theorem-proving
  • mathematics
  • multi-agent
  • agents
  • mathlib
  • prove2me
  • open-source

← All releases · Learn AI