Claude proves Fermat’s Last Theorem in Lean, shifting from model hallucination to decisive mathematical verification
Listen to this article
Read by Anchor
Pierre de Fermat’s brief note in the margin of Diophantus’s *Arithmetica* in 1637, in which he claimed to possess a marvelous proof that the page margin could not contain, remained a puzzle that stumped mathematicians for more than three and a half centuries. When the British Sir Andrew Wiles unraveled the “Fermat’s Last Theorem” in 1995, verifying his human proof, which spanned 129 pages, required months of joint examination and scrutiny to close gaps and confirm its completeness. Today, artificial intelligence offers a completely different standard for scientific trust, not by simulating proofs in an error-prone constructive style, but by providing a definitive automated verification that leaves no room for speculation.
Anthropic Labs announced the success of a multi-agent system that employs a research model equivalent to “Claude V1.1” in achieving the first fully computer-verified proof of Fermat’s Last Theorem using the mathematical programming language Lean. The achievement came after 11 days of the model’s self-run, exceeding academic expectations that had estimated the project would require years of arduous human effort, since Dutch computer scientist Jan Bergstra proposed the idea of strict computational proof in 2005, and through the community project launched by Professor Kevin Buzard at Imperial College London in 2024 to draft the initial outline of the theorem’s sections.
Hierarchical construction of 13 million lines of code
The fundamental difficulty in automated formal mathematics lies in abstracting every inferential step from the first principles. Human proofs usually leap over dozens of logical steps, relying on the reader’s intuition and accumulated mathematical knowledge, whereas proof assistants such as Lean reject any step unless it is backed by a unambiguous formal proof. Closing the Fermat proof requires writing more than 13 million lines of code in Lean, a size that exceeds the entire reference mathematics library for the language (Mathlib) by a factor of five. Over the course of the work, the model was formulated and verified the correctness of 29,500 intermediate subtheorems in algebra, harmonic analysis, geometry and number theory, following the simplification path of the Weil proof devised by researchers Darmon, Diamond and Taylor.
Professor Kevin Bozard, after his detailed review of the outputs, affirmed that this achievement proves Fermat’s Last Theorem by relying only on basic mathematical axioms and without any unproven assumptions, noting that the experiment confirms the maturity of automated proof tools and their ability to build multi-layered frameworks that the scientific community can rely on and build upon directly.
The Coordination Platform and Solving the Memory Dilemma
This success did not come all at once, as the early attempts faced setbacks because the agents were fragmented and lost track of the project's overall state. The decisive breakthrough was achieved when researcher Tianyi Beng from Columbia University and his team led the development of an open platform called Prove2Me, documented in a research paper on the arXiv platform. The platform provided a directed acyclic graph (DAG) to organize theorems and their logical pathways, allowing the Claude agents to make independent decisions about the next theorem to prove, and to separate theory texts from their proofs to reduce memory consumption and speed up computational verification, with the process consuming roughly six billion output tokens.
What does decisive verification of the regional tech sector mean?
This development shifts the focus of AI research from addressing “hallucination” in generative models to leveraging “definitive visual verification” capabilities. The shift carries direct strategic implications for universities and research centers in the region, notably King Abdullah University of Science and Technology (KAUST) and Mohammed bin Zayed University for Artificial Intelligence, where mathematical computing tools become a core resource for scrutinizing scientific theories and reviewing the rapidly accelerating global research output.
On the operational and industrial front in the Gulf, programmatic mathematical verification constitutes a highly sensitive safety cornerstone for teams handling complex software engineering, sovereign systems, cybersecurity and smart contracts in financial markets and logistics services. In these ecosystems, probabilistic guesses and AI models that rely on cross-text generation are insufficient; instead, there is a need for computer-generated proofs that demonstrate code is free of vulnerabilities with 100 percent certainty before deployment in critical environments.