Claude Completes First Formal Proof of Fermat's Last Theorem: A Record-Breaking 13 Million Lines of Lean Code

Claude delivers the first machine-formal proof of Fermat's Last Theorem: 13M+ lines of Lean code and 29,000 subsidiary theorems.
Anthropic's Claude has completed the first formal proof of Fermat's Last Theorem — translating the landmark result, proven by Wiles in 1995, into a form that the Lean proof assistant can mechanically verify step by step. The effort spans over 13 million lines of code, making it the largest Lean proof ever, and along the way formalized more than 29,000 subsidiary theorems, filling major gaps in Mathlib across algebraic number theory and beyond. Built on three centuries of mathematics and hundreds of open-source contributors, the full proof is publicly available on GitHub with reproducible results. Anthropic believes AI-assisted formal verification could help ease the growing peer-review burden in mathematics.
Verifying whether a major mathematical proof is correct can take years. Translating mathematical reasoning into a form that computer proof assistants like Lean can verify — a process known as "formalization" — is emerging as a new solution to this challenge. Recently, Anthropic's Claude completed the first formal proof of Fermat's Last Theorem, sparking widespread attention in both the mathematics and AI communities.
A Project Once Thought to Take Years
Fermat's Last Theorem is one of the most celebrated theorems in mathematical history. Proposed by Fermat in the 17th century, it wasn't fully proven until 1995, when British mathematician Sir Andrew Wiles delivered a complete proof — more than 350 years after the original conjecture.
However, a human proof being complete doesn't mean it's machine-verifiable. Translating Wiles's proof into a form that Lean can verify step by step is an enormously complex undertaking — one that most experts previously believed would take many years. Claude's work represents a major leap forward on this "multi-year project," producing what is now the largest Lean proof in history.
13 Million Lines of Code and 29,000 Supporting Theorems
According to information published by Anthropic, the formal proof spans more than 13 million lines of code, providing a solid foundation for machine verification. But the significance of that number goes far beyond simply "proving Fermat's Last Theorem."
What's even more remarkable is that, in order to support the main proof, this work also incidentally proved more than 29,000 necessary subsidiary theorems, covering multiple branches of mathematics that had never previously been formalized. In other words, this isn't just a rubber stamp on a famous theorem — it's a systematic effort to strengthen the foundational infrastructure of core mathematical knowledge.
The complexity of mathematical proofs means they often rely on a large number of prerequisite results, which previously existed only in paper proofs and lacked machine-verifiable forms. Formalizing nearly thirty thousand theorems in one effort effectively fills a vast number of missing pieces in the Lean ecosystem and the Mathlib mathematics library.
Built on Three Centuries of Work and Hundreds of Contributors
Anthropic was careful to emphasize that this achievement didn't emerge from nothing — it is built on three centuries of accumulated mathematical work, as well as the contributions of hundreds of Lean and Mathlib community members.
This points to an easily overlooked fact: AI's role in mathematical formalization is one that stands on the shoulders of existing human knowledge and open-source toolchains. Lean as a proof assistant and Mathlib as its mathematics library are themselves products of global collaboration. Claude's contribution lies in stitching together, translating, and submitting these scattered reasoning fragments for machine verification at a speed and scale far beyond what was previously possible.
Can AI-Assisted Verification Ease the Burden on Math Reviewers?
This work points to a question with very real-world implications: at a time when mathematical paper output is growing at an unprecedented rate, the burden on peer reviewers is becoming increasingly heavy. Reviewers must spend enormous amounts of time checking proofs step by step, and errors sometimes go undetected for years.
Anthropic is optimistic about AI-assisted mathematical proof verification, believing it has the potential to relieve the burden on mathematical peer review. If machines can provide reliable correctness checks on formalized proofs, human experts could focus more of their energy on creative thinking and structural judgment, rather than mechanical line-by-line inspection.
Of course, this comes with a prerequisite: translating paper proofs into formal proofs remains a high-barrier task in itself. Whether AI can continue to lower the cost and improve the reliability of this step will determine how far this vision can go.
A Test of AI's Capability Boundaries
From the perspective of AI capability assessment, formalizing Fermat's Last Theorem is an excellent "hard benchmark." Unlike natural language tasks where scoring is subjective, Lean's verification result is binary: it either passes or it doesn't. This means the correctness of this achievement has a clear, reproducible standard.
Anthropic has made the complete proof publicly available on GitHub and described the entire process in its Science Blog — anyone can examine it. This kind of verifiable, reproducible transparency is precisely what makes mathematical formalization work uniquely valuable compared to many AI "capability claims."
Conclusion
Claude's completion of the formal proof of Fermat's Last Theorem marks a significant milestone for AI in the domain of rigorous mathematical reasoning. It is both a record in scale (the largest Lean proof in history) and a methodological exploration — using AI to accelerate the mechanization and verification of human mathematical knowledge. In an era of explosive growth in proof output, this kind of work may gradually transform the way mathematical verification is done, making "checking whether a proof is correct" something that no longer takes years.
Related articles

Trump Downplays AI Extinction Risk: 'Whoever Wins AI Wins' Sparks Controversy
Trump downplays AI extinction risks with 'Whoever wins AI wins,' sparking fierce debate over whether AI safety is an urgent reality or a future hypothetical.

David Sacks on AI Regulation: Frontier Models Don't Need Mandatory Legislative Constraints
David Sacks argues OpenAI and Anthropic can self-regulate frontier model development without external legislation. A look at the logic, controversy, and governance dilemmas involved.

Obama Calls on Democrats to Develop a Clear Plan for AI Safety Regulation
Obama urges Democrats to make AI a core agenda item and develop a clear plan addressing economic disruption and safety risks. A look at the AI governance challenge.