Fermat's Last Theorem Machine Verification Complete: A Milestone Breakthrough in AI Formalization

Anthropic achieves breakthrough by completing AI-powered formalization of Fermat's Last Theorem in Lean
Anthropic has achieved a milestone in AI-assisted mathematics by completing the formal verification of Fermat's Last Theorem in Lean. This breakthrough converts Andrew Wiles's 129-page proof into machine-verifiable code, demonstrating AI's potential in abstract mathematical reasoning and significantly accelerating formalization timelines.
A Milestone in AI-Powered Mathematical Formalization
Fermat's Last Theorem, a centuries-old mathematical puzzle that perplexed mathematicians for 358 years, has reached a new historic moment. Following Andrew Wiles's proof in 1995, the complete formalization and verification of that proof has now been announced. According to recent disclosures from the Xena Project lead, Anthropic has achieved a major breakthrough in AI-assisted mathematical formalization by completing this monumental task.

Fermat's Last Theorem states something remarkably simple: for any integer n greater than 2, the equation x^n + y^n = z^n has no positive integer solutions. Pierre de Fermat wrote this conjecture in 1637 in the margin of his copy of Arithmetica, claiming he had discovered a "marvelous proof" but that the margin was too small to contain it. For the next 358 years, countless mathematicians attempted to prove this seemingly simple proposition. Andrew Wiles's proof was finally published in 1995, with its core strategy being to prove a special case of the Taniyama-Shimura conjecture (now called the modularity theorem)—specifically, that every semistable elliptic curve is modular. This proof pathway was established by Kenneth Ribet in 1986, building on work by Gerhard Frey, and is known as the Frey-Ribet theorem, which demonstrated that the Taniyama-Shimura conjecture implies Fermat's Last Theorem. Wiles's proof paper spans 129 pages and draws upon vast depths of 20th-century algebraic number theory, algebraic geometry, and representation theory.
Formalization of a proof means translating a mathematical proof into a rigorous logical form that computers can verify. This process requires not only deep mathematical expertise but also proficiency with proof assistant tools like Lean. Lean is an interactive theorem prover and functional programming language developed by Leonardo de Moura at Microsoft Research, with Lean 4 being the currently widely used version. It is based on Dependent Type Theory, which allows mathematical propositions to be expressed as types and proofs as terms of those types, enabling machine verification of mathematical reasoning. Lean's type system is powerful enough to encode mathematical objects ranging from basic set theory to advanced algebraic geometry. Given that the original proof of Fermat's Last Theorem involves sophisticated modern mathematical theories such as elliptic curves, modular forms, and Galois representations, the difficulty of formalization is considerable.
From Manual to AI: A Paradigm Shift in Formalization
The Xena Project has long been dedicated to formalizing Fermat's Last Theorem, a long-term collaborative effort between mathematicians and computer scientists. The project was initiated by Kevin Buzzard, a mathematics professor at Imperial College London, with the core goal of formalizing undergraduate and research-level mathematics in the Lean proof assistant. Buzzard has long questioned the mathematical community's reliance on informal proofs—pointing out that many published mathematical papers contain subtle logical gaps that are often overlooked during peer review. The Xena Project is not just a technical endeavor but a movement to transform mathematical culture, building a reliable body of formalized mathematical knowledge by systematically re-expressing and verifying classical mathematical theorems in Lean. Formalizing Fermat's Last Theorem was one of Xena's most ambitious goals, originally expected to take years or even longer to complete.
However, Anthropic's involvement has completely changed the game. Leveraging the deep learning capabilities of large language models, AI can understand complex mathematical reasoning structures, automatically generate Lean code, and complete formal verification. From a technical perspective, AI-assisted formal proof involves multiple layers: first is autoformalization—the translation from natural language mathematics to formal language, where large language models must understand informal mathematical arguments and convert them into Lean code; second is tactic generation, where at each step of a Lean proof, the AI must select appropriate proof tactics to advance the proof goal. This is fundamentally different from traditional automated theorem proving (ATP)—ATP systems like E prover or Vampire work based on predetermined search algorithms, while large language models can use the "mathematical intuition" acquired from training on large-scale mathematical corpora to guide search direction. In recent years, systems like DeepMind's AlphaProof and Meta's HyperTree Proof Search have demonstrated the potential of deep learning in theorem proving, and Anthropic's breakthrough likely combines Claude's powerful reasoning capabilities with specialized optimization for Lean code.
The significance of this breakthrough extends far beyond completing the formalization of a particular theorem. More profoundly, it demonstrates AI's practical application potential in highly abstract mathematical domains. Traditionally, formal proofs require experts to spend years writing and debugging code line by line, while AI participation dramatically compresses this timeline, making formalization of more classical mathematical results practically feasible.
Technical Challenges and Community Response
In Hacker News discussions (receiving 396 upvotes and 256 comments), the mathematics and computer science community responded enthusiastically. Core concerns among practitioners include:
- Completeness of verification: Does the AI-generated formalized proof cover all key steps of Wiles's original proof?
- Dependencies: How much pre-established mathematical library support (such as Mathlib) is needed in the formalization process? Mathlib is the most important mathematical formalization library in the Lean ecosystem, collaboratively maintained by the community, currently containing over 170,000 theorems and definitions covering numerous mathematical branches including analysis, algebra, topology, and number theory. Formalization of Fermat's Last Theorem heavily relies on existing modules in Mathlib such as elliptic curve theory and Galois representation theory—no formalization work starts from scratch but builds upon this massive knowledge base.
- Reproducibility: Can other research teams independently verify and reproduce this achievement?
- Commercial impact: What are the implications of Anthropic, as a commercial company, being deeply involved in academic formalization projects?
Notably, the Xena Project lead candidly acknowledged in a blog post that "Anthropic beat us to it." This frank statement reflects both the open spirit of academia and reveals how AI is profoundly reshaping the competitive landscape of mathematical research.
Profound Implications for Mathematical Research
The successful formalization of Fermat's Last Theorem marks mathematics formally entering a new era. Formal verification not only effectively prevents logical errors in proofs but, more importantly, establishes a machine-readable mathematical knowledge base, laying a solid foundation for future AI-assisted theorem discovery and automated proof.
From the Four Color Theorem to Fermat's Last Theorem, computer-assisted proof has evolved from simple enumeration verification to deep participation in complex reasoning. The Four Color Theorem was proved in 1976 by Appel and Haken using computers—the first major mathematical proof to rely on computers—but its method was essentially exhaustive enumeration, with computers verifying the reducibility of 1,936 unavoidable configurations. The mathematical community was widely skeptical, questioning whether such "non-humanly-verifiable" proofs constituted genuine mathematical proofs. In 2005, Georges Gonthier completed formalization of the Four Color Theorem using the Coq proof assistant, completely eliminating doubts about the reliability of computer enumeration. Subsequently, work such as the formalization of the Kepler conjecture (Flyspeck project, completed 2014) gradually advanced. But these achievements are incomparable in complexity to the formalization of Fermat's Last Theorem—the proof of Fermat's Last Theorem involves mathematical mechanisms far more complex than combinatorial enumeration or geometric optimization, requiring formalization of the vast theoretical framework of modern algebraic number theory. Today's AI is no longer just a tool executing predetermined algorithms but an intelligent assistant capable of understanding mathematical language and generating complex logical reasoning. This portends potentially more mathematical breakthroughs led or assisted by AI in the future.
For mathematical education and research, the popularization of formal proof will bring dual impacts: on one hand, it requires mathematicians to have stronger formalization thinking and tool usage skills; on the other hand, it significantly lowers the barrier to verifying complex proofs, allowing more researchers to continue deep exploration on the solid foundation of predecessors' achievements.
Looking Ahead: The Symbiotic Future of AI and Mathematics
Anthropic's success in formalizing Fermat's Last Theorem is just the beginning. As large language models continue to improve in logical reasoning capabilities, we have reason to expect more classical mathematical results to be formalized one by one, and even to anticipate the day when AI independently discovers new theorems.
However, this also raises thought-provoking questions: when AI can handle mathematical work of such high difficulty, how will the role of human mathematicians evolve? The answer perhaps lies in the fact that the essence of mathematics is not merely proving theorems but in posing profound questions and constructing new conceptual frameworks. And these creative endeavors still require uniquely human intuition and insight. The best relationship between AI and human mathematicians should be collaborative and complementary, not mutually replacive.
Related articles

GPT-6 Astra Code Review in Practice: Balancing Efficiency Gains, Data Privacy, and Cost
An in-depth analysis of GPT-6 Astra's real-world code review performance, examining efficiency gains, data privacy risks, and Token costs to build a decision framework for engineering teams.

Declarative Attention: Letting LLMs Control Their Own Attention, Boosting Long-Context Inference Efficiency by 52%
Declarative Attention (DA) lets LLMs autonomously declare attention regions during inference via global, focus, and local modes, reducing attention tokens by 52% in zero-shot evaluation.

Meta Executive Exposed for Torrent Piracy: The AI Training Data Legality Debate Intensifies
A Meta executive's torrent piracy exposure reignites debate over AI training data legality. Analysis of fair use defenses, data compliance trends, and copyright challenges facing tech giants.