The 358-Year Chase Ends: AI's 13-Million-Line Solution to Fermat's Last Theorem
For centuries, mathematicians grappled with a tantalizing puzzle scribbled in the margin of a 17th-century book. Pierre de Fermat's infamous claim—that no three...
Snehasis Ghosh
For centuries, mathematicians grappled with a tantalizing puzzle scribbled in the margin of a 17th-century book. Pierre de Fermat's infamous claim—that no three positive integers can satisfy aⁿ + bⁿ = cⁿ for any integer value of n greater than 2—came with a frustrating addendum: a "truly marvelous proof" that the margin was too small to contain. Now, after 358 years of human ingenuity, Anthropic's Claude AI has delivered the definitive, machine-checkable answer, writing what is now the longest mathematical proof ever constructed.
The Unsolvable Legacy of Fermat
Fermat's Last Theorem (FLT) became a legendary quest, only to be finally conquered by British mathematician Andrew Wiles in 1995. Wiles's 129-page proof was a monumental achievement, integrating advanced mathematical concepts that didn't even exist in Fermat's time. Yet, even Wiles's initial presentation had a critical gap, requiring another year of painstaking work to correct. This highlights a persistent challenge in high-level mathematics: proofs, even from brilliant minds, are complex and prone to human error, making verification a long, arduous process.
This is where "formalization" comes in. It's the process of translating a proof into a language so precise and literal that a computer can verify every single logical step, leaving no room for ambiguity or human oversight. Prior to Claude's breakthrough, a human-led project at Imperial College London, spearheaded by mathematician Kevin Buzzard, had been diligently working since 2024 to formalize Wiles's proof in Lean, a computer proof language. Their extensive blueprint alone ran to 86 pages, and the project was funded through 2029, a testament to the immense human effort required.
Claude's Unprecedented Feat
Enter Anthropic's Claude AI. In an astonishing display of autonomous problem-solving, Claude tackled FLT in just 11 days. Working largely on its own, dozens of Claude agents collaborated in parallel, defining concepts, proving small results, and stacking them into larger theorems. The key to this rapid progress was a tool called Prove2Me, developed by Tianyi Peng's team at Columbia University (who initiated the experiment). Prove2Me provided a live, shared to-do list for the agents, preventing duplication of effort and streamlining collaboration.
The result? A staggering 13 million lines of Lean code, verifying Wiles's proof with "no assumptions other than the axioms of mathematics," as confirmed by Kevin Buzzard himself. This makes Claude's output over five times the size of Mathlib, the principal community library of formalized mathematics, setting a new record for the largest Lean proof ever written. The AI proved over 30,000 supporting theorems and consumed billions of tokens from a research model comparable to Claude Fable 5.1.
Implications for the Future of Math
This achievement isn't just a fascinating anecdote; it's a paradigm shift for mathematics.
- Accelerated Verification: What would take human experts years, Claude accomplished in days. This drastically reduces the time needed to formally verify complex mathematical theories.
- Error Elimination: Computer-checked proofs are deterministic and immune to human mistakes, providing an unparalleled level of certainty. This can help "root out errors in the current mathematical corpus," as Buzzard noted.
- Autoformalization: Claude's success is a major step towards automatically formalizing vast swathes of modern mathematical literature, making complex research more accessible and verifiable.
- Lightened Burden: AI can significantly lighten the load for human referees and researchers, freeing them to focus on discovery rather than manual verification.
While Claude didn't discover new math—it formalized an existing proof—the implications are profound. The entire 13-million-line proof is publicly available on GitHub, allowing anyone to scrutinize its logic. This breakthrough suggests a future where AI not only assists mathematicians in exploring new frontiers but also acts as an unwavering arbiter of truth, ensuring the foundational integrity of mathematical knowledge. The age of machine-verified mathematics has truly arrived.