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

Vibe Coding Full-Stack in Practice: AI Programming from Beginner to Enterprise Deployment
From Cursor to Claude Code, this Bilibili AI programming course uses four progressive projects to cover full-stack development, open-source secondary development, and team collaboration. The article analyzes the shock to frontend roles, the efficiency shift from 50 people to 5, and the methodology required for enterprise-grade projects.

David Blaine's Global Quest for Real Magic: From South Africa to Japan and India
David Blaine travels to South Africa, Japan, and India in his Do Not Attempt special, documenting Spinning drivers, black mamba rescuers, iaijutsu masters, and ascetics—exploring the boundary between magic and real human极限 challenges.

Is a Touchscreen MacBook Coming? Vergecast Reveals Apple Executive's Response
Vergecast podcast reveals a conversation between a reporter and Apple executive John Ternus about a touchscreen MacBook and Apple Pencil support. Ternus says iPad is the best device for a stylus, while the reporter bets MacBook will eventually support Apple Pencil.