Anthropic said Thursday that Claude produced the first end-to-end, computer-checked proof of Fermat’s Last Theorem, working largely autonomously over 11 days in the Lean programming language.
The proof, which follows a simplified version of Andrew Wiles’s landmark 1995 argument, spans 13 million lines of Lean code and verifies 29,500 intermediate theorems. Anthropic released the full proof on GitHub along with a detailed written walkthrough of the mathematical steps involved in the formalization process.
Kevin Buzzard, a mathematician at Imperial College London who has spent years working on formalizing the theorem in Lean, reviewed the result. He called it “an extraordinary autoformalization achievement” that proves the theorem “with no assumptions other than the axioms of mathematics.”
What the proof does
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. Pierre de Fermat proposed the conjecture in 1637, scribbling in the margin of his copy of Diophantus’s Arithmetica that he had a proof too large to fit. It remained unproven for 358 years.
Wiles published his proof in 1995 after seven years of secret work. His argument ran 129 pages and took months of peer review to verify. The proof connects elliptic curves and modular forms through a chain of reasoning that spans several areas of modern mathematics, including Galois representations and Hecke algebras.
Claude’s formalization converts that argument into machine-readable code that a computer can check for correctness. The Lean proof assistant confirmed every logical step, leaving no gaps or hand-waving. Each of the 29,500 intermediate theorems had to be stated precisely enough for a machine to verify it, with no room for the kind of informal reasoning that human mathematicians routinely rely on in their daily work.
Anthropic said dozens of Claude agents collaborated on the project. They defined mathematical concepts, proved intermediate statements, and built up to the final theorem in a process that mirrors how human mathematicians work but at a much larger scale and speed.
The project consumed roughly six billion output tokens, making it one of the most token-intensive proofs ever attempted. Anthropic described it as the largest formal proof ever constructed in Lean, dwarfing previous attempts by orders of magnitude.
Three independent verification passes
The proof went through three separate checks. First, the standard Lean kernel verified the entire proof. Second, a fresh build using Lean 4.33.1 and Mathlib v4.33.0 confirmed the result from scratch. Third, an independent nanoda kernel implementation written in Rust caught a bug specific to the reference kernel that the other two checks missed.
This three-layer verification is unusual for formal proofs. Most Lean projects rely on a single kernel check. Anthropic added the redundant passes to catch any tool-specific errors, given the scale of the project and the attention it would receive from the mathematical community worldwide.
Buzzard noted that formalizing Fermat’s Last Theorem had been a goal of the Lean community since 2024, when he kicked off a multi-year effort to complete the formalization. Claude’s work built on those community foundations but produced the first complete, self-contained proof that runs and verifies cleanly from start to finish.
A team at Anthropic also ran a smaller side experiment using three personal Claude Max plans to formalize applications of the Hardy-Littlewood Circle Method, a technique central to analytic number theory. That experiment showed the approach generalizes beyond the specific structure of Wiles’s proof to other areas of mathematics as well.
What it means for math and software
The practical significance goes beyond the theorem itself. Formal verification tools like Lean are increasingly used to check the correctness of software, from operating systems to cryptographic protocols. But writing formal proofs is slow and tedious, which has limited adoption in both mathematics and software engineering broadly.
If AI models can produce formal proofs at this scale, it could accelerate the verification of mathematical results and make formal methods more accessible to software engineers who currently rely on testing rather than proof. Anthropic suggested the approach could be applied to other unsolved or partially formalized problems in mathematics.
There are important limits worth noting. The proof follows a path that Wiles already established. It does not discover new mathematics or solve an open problem. What it does demonstrate is that AI can handle the mechanical translation of informal proofs into formal code, a task that has traditionally required years of specialized human expertise and deep mathematical knowledge.
The result also feeds into a broader trend in AI research. OpenAI’s Astra model recently claimed ten informal proofs formalized in Lean certificates, though those claims drew scrutiny for their methodology. Anthropic’s approach differs by producing a complete, verified proof rather than a collection of individual results.
Mathematicians on social media offered mixed reactions. Some called it a milestone for AI-assisted mathematics. Others pointed out that formalizing a known proof, however impressive at scale, is fundamentally different from discovering new mathematical truths. The distinction matters for those hoping AI will eventually crack open unsolved conjectures.
The announcement comes at a busy time for Anthropic. Reuters reported this week that the company will begin marketing its IPO in mid-October at the earliest, with the prospectus filing targeted for late September. Claude’s mathematical achievement could serve as a high-profile demonstration of the model’s capabilities ahead of the public listing.

discussion