metir
metir
Docs
Download on App StoreGet it on Google PlayLoginSign Up
Back to Blog
Anthropic
Claude
AI and Mathematics
Lean
Formal Verification

Claude Formalized Fermat's Last Theorem in Lean: What It Means

Anthropic says Claude produced the first complete machine-checked Lean proof of Fermat's Last Theorem in 11 days. Here is what that actually demonstrates, and what it does not.

Metir AI TeamSeptember 6, 202610 min read
Claude Formalized Fermat's Last Theorem in Lean: What It Means

On September 5, 2026, Anthropic published a result that is easy to over-read and easy to under-read at the same time: a team of Claude agents produced the first complete, machine-checked formal proof of Fermat's Last Theorem in the Lean proof assistant, working largely autonomously for 11 days. The claim is narrow and precise, and both the narrowness and the precision matter. This is not a new theorem, and it is not a mathematician being replaced. It is a demonstration that a large body of already-understood mathematics can be translated into a form a computer can verify from end to end, faster and at a larger scale than a human team has managed before.

Anthropic logoAnthropic
Anthropic published the Fermat's Last Theorem formalization on September 5, 2026.

Fermat's Last Theorem is the statement that no three positive integers a, b, and c can satisfy the equation a to the power n, plus b to the power n, equals c to the power n, for any whole number n greater than two. Pierre de Fermat scrawled the claim in a margin around 1637. It resisted proof for more than three centuries until Andrew Wiles, with a crucial contribution from Richard Taylor, completed a proof in 1994. What happened this September is a different kind of event: not proving the theorem, which was already settled, but formalizing it so that software can confirm the proof is correct without a human having to trust the paper.

11 daysLargely autonomous work
~6BOutput tokens consumed
13MLines of Lean generated
30,300Theorems proved along the way
5xLarger than Mathlib, Lean's standard library
3Standard Lean axioms used

Formalization is not the same as proving

The distinction the whole story turns on is between a proof and a formalization. A conventional mathematical proof is a written argument that other mathematicians read and check, a social process that is powerful but fallible. Errors in published proofs are not rare, and they can survive review for years. A formal proof is written in a language like Lean, where every logical step is spelled out in full and a piece of software called a proof assistant mechanically verifies that each step follows from the last. If anything is missing or hand-waved, it simply does not compile.

Formalizing an already-proved theorem is therefore valuable in a specific way: it converts human confidence into machine-checkable certainty. The catch has always been cost. Formalizing serious mathematics by hand is slow, painstaking work, which is why only a fraction of the modern mathematical corpus has ever been formalized. Kevin Buzzard of Imperial College London has led a multi-year, human-driven effort to formalize the Wiles proof of Fermat's Last Theorem precisely because doing it by hand is such a large undertaking. Anthropic's result is interesting because it attacks that cost, not because it discovered anything new about the theorem.

Where trust actually sits in a machine-checked proof

Lean removes the need to trust the 13 million lines of generated code. It does not remove every human judgement. Two of them remain, marked in amber.

Claude generates ~13 million lines of Lean
No one needs to read or trust this output on its own. It is an input to a checker, not the final word.
↓
The Lean kernel verifies every step
Lean mechanically confirms each inference follows from the last. A gap or a hand-wave simply fails to compile.
↓
Only Lean's three standard axioms are used
The proof does not smuggle in an extra assumption that would quietly make the theorem easier. This is machine-verifiable too.
↓
Human judgement 1: is the statement the right one?
A proof of the wrong statement checks out fine. Here a comparator confirmed the proved statement matches Mathlib's accepted formal statement of Fermat's Last Theorem.
↓
Human judgement 2: do you trust Lean and Mathlib themselves?
Confidence ultimately rests on the correctness of the proof assistant and its standard library, which the mathematics community has scrutinised for years.

The shift is real but bounded: the burden moves from checking a proof to checking that the formal statement says what a mathematician meant.

How a swarm of agents did it

The scale figures are the part worth slowing down on. Anthropic reports that the effort consumed roughly six billion output tokens from an internal research model it describes as roughly comparable to Claude Fable 5.1, and produced about 13 million lines of Lean, proving around 30,300 theorems along the way, of which roughly 29,500 were used in the final proof. The result is more than five times the size of Mathlib, Lean's community-built standard library of formalized mathematics. Anthropic is candid that the proof is probably much longer than it needs to be, and that failed early attempts still account for about seven percent of the non-boilerplate lines.

None of that would have been tractable as a single long model call. The work ran on a Claude Code based multi-agent harness on top of a platform called Prove2Me, built by Tianyi Peng and collaborators at Columbia University. Prove2Me's central idea is to represent the target as a directed acyclic graph of theorem statements, so that a large proof becomes many smaller lemmas with explicit dependencies. Agents claim tractable nodes whose prerequisites are already proved, work only on those, and publish their results back to the graph for other agents to build on.

How a swarm of agents proved one theorem

Prove2Me turns a single enormous proof into a graph of smaller lemmas. Many agents work the graph at once, so no one agent has to hold the whole proof in its head.

1
Break the proof into a graph
Prove2Me represents the target as a directed acyclic graph of theorem statements. A statement can be attempted once the statements it depends on are proved.
↓
2
Agents claim tractable nodes
A harness of Claude agents each picks a node whose dependencies are already met, works only on that lemma, and does not need to understand the entire proof.
↓
3
Publish and reuse
A proved lemma is published back to the graph so other agents can build on it. Failed attempts still contributed roughly 7 percent of the non-boilerplate lines.
↓
4
Lean checks everything
The Lean proof assistant mechanically verifies each step. The finished proof relies on only Lean's three standard axioms.
↓
5
Confirm the statement is the right one
A separate comparator checks that the theorem the agents proved matches Mathlib's own formal statement of Fermat's Last Theorem, not a weaker look-alike.

Prove2Me was built by Tianyi Peng and collaborators at Columbia University. The workflow, not a single model call, is what made an 11-day proof possible.

That architecture is the actual lesson for anyone outside pure mathematics. The headline is a single model formalizing a famous theorem, but the mechanism is orchestration: decomposing a problem too big for one context window into a shared graph of subtasks, running many agents against it in parallel, and letting a verifier, in this case Lean itself, act as the ground truth that keeps the swarm honest. The same shape, many agents coordinating over a shared task structure with an external check on correctness, is showing up across serious agentic work far removed from proof assistants.

Portrait of the mathematician Sir Andrew Wiles
Sir Andrew Wiles, who completed the first proof of Fermat's Last Theorem in 1994. The 2026 result did not re-prove the theorem; it formalized a proof so that software could verify it. Photo by C. J. Mozzochi, Princeton N.J., via Wikimedia Commons, CC BY 3.0.

The skepticism is the interesting part

Buzzard, who has spent years thinking about exactly this, called the work an extraordinary autoformalization achievement and said it proves Fermat's Last Theorem with no assumptions other than the axioms of mathematics. He also framed the wider implication carefully: if automatic formalization of a result this large is possible now, it is a meaningful step toward formalizing the modern mathematical literature, which could help root out errors in the existing corpus and lighten the load on human referees.

The caution he pairs with that is the load-bearing detail. A proof assistant guarantees that the code proves the statement it is handed. It does not guarantee that the statement is the one the mathematician meant. A formally verified proof of a subtly wrong statement checks out perfectly and tells you nothing. This is why Anthropic's use of a comparator to confirm that the proved statement matches Mathlib's own accepted formal statement of Fermat's Last Theorem, and its emphasis on using only Lean's three standard axioms, are not footnotes. They are the difference between a result and a look-alike.

“

Lean can confirm that the code proves the statement. Whether the statement is the right one is still a human judgement.

On the limits of machine-checked proofs

There is a second, quieter demonstration in the same announcement that arguably says more about where this is heading. Anthropic reports that three personal Claude Max plans, ordinary paid subscriptions rather than a bespoke research cluster, were used to formalize Vinogradov's Three Primes Theorem via Prove2Me in three days. The Fermat result shows the ceiling; the Vinogradov result shows the floor dropping. Autoformalization that a couple of subscriptions can run over a long weekend is a different economic proposition from a headline stunt.

What this does and does not change

For mathematicians, the realistic near-term effect is not that theorems get proved by machines. It is that verification and formalization, historically a bottleneck, may become cheap enough to apply routinely. That could catch errors in published work, make results more reliable to build on, and reduce some of the unpaid labor of refereeing. Buzzard himself notes that autoformalization artifacts are now robust enough to be built upon, which is a statement about tooling and infrastructure, not about creativity.

A 17th-century engraved portrait of Pierre de Fermat
A 17th-century engraving of Pierre de Fermat, who stated the conjecture around 1637. Engraving by Francois de Poilly, via Wikimedia Commons, public domain.

For everyone else, the transferable insight is about how the work was organized rather than what it proved. The result came from many agents decomposing a problem, coordinating over a shared structure, and being held to account by an external verifier, running on a general-purpose model rather than a narrow theorem-proving system. Teams building their own agentic workflows tend to converge on the same requirements: a way to split work across many model calls, a way to check outputs against something objective rather than trusting them, and the freedom to run that orchestration on whatever model is best suited to each step. Platforms like Metir that keep agent workflows model-agnostic reflect the same principle Anthropic's harness relied on here, that the orchestration and the verification, not any single model, are what make hard multi-step work tractable.

The honest summary is that this is a real milestone with a precise scope. It is strong evidence that formalizing large, known mathematics at scale is now feasible and getting cheaper, and it is not evidence that machines are inventing mathematics or that human judgement has been designed out of the loop. Both of those readings are available in the coverage; only the first is supported by what Anthropic actually reported.

Sources:

  • Formalizing Fermat's Last Theorem | Anthropic
  • Formalizing Fermat's Last Theorem in Lean (technical report, PDF) | Anthropic
  • Claude formalized Fermat's Last Theorem in 11 days | AI Weekly
  • AI could radically change how math proofs are verified | Science News
  • Claude Formalizes Fermat's Last Theorem: 11 Days of Autonomous Work | DataStudios
  • Fermat's Last Theorem | Wikipedia

Image credits

Hero image: a 17th-century engraved portrait of Pierre de Fermat by Francois de Poilly, via Wikimedia Commons, in the public domain. In-body photograph: Sir Andrew Wiles, photographed by C. J. Mozzochi, Princeton N.J., via Wikimedia Commons, licensed under CC BY 3.0. Neither image depicts the 2026 formalization work; both illustrate the people historically associated with the theorem, as stated in their captions.

Ready to experience AI that adapts to you?

metir brings together the world's best AI models in one seamless experience. Start for free today.

Get Started Free
metir

Agentic Operating System for Professionals buried in meetings, emails and docs.

© 2026 metir. All rights reserved.

Product

  • Features
  • Pricing
  • Research
  • Docs
  • Blog
  • Enterprise

Company

  • Docs
  • Support
  • Careers

Legal

  • Terms of Service
  • Privacy Policy

Personalisation is powerful. Privacy is non-negotiable.

Status: All systems operational