# AI Achieves Historic Milestone: First Fully Computer-Verified Proof of Fermat’s Last Theorem Completed in Just 11 Days
A team of researchers has demonstrated that artificial intelligence can accomplish something the mathematical community has struggled with for decades: producing a fully formalized, computer-checked proof of one of the most famous problems in the history of mathematics. In a remarkable feat, the AI system generated 13 million lines of code and proved more than 30,000 supporting theorems to deliver a machine-verifiable confirmation of Fermat’s Last Theorem — a problem that remained unsolved for 358 years.
## A Margin Note That Haunted Mathematics for Centuries
The story begins in 1637, when French mathematician Pierre de Fermat scribbled a seemingly simple claim into the margin of his copy of Diophantus’ *Arithmetica*. He stated that no three positive whole numbers can satisfy the equation x^n + y^n = z^n when n is greater than 2. Beside the note, he famously wrote that he possessed a “truly marvelous proof” — but that the margin was simply too narrow to contain it.
Fermat died shortly thereafter, leaving behind one of the most tantalizing puzzles ever posed. For the next three and a half centuries, generations of mathematicians attempted to reconstruct or rediscover what Fermat might have had. The problem resisted every approach, drawing the attention of some of the greatest minds in the field and attracting hundreds of incorrect submissions to prize competitions along the way.
## The Real Breakthrough and Its Complications
The actual proof didn’t emerge until 1995, when British mathematician Andrew Wiles published a corrected version of his work after spending nearly a year fixing a critical gap that reviewers discovered in his original 1993 announcement. Wiles, working with former student Richard Taylor, delivered a 129-page proof that relied on mathematical frameworks that didn’t exist during Fermat’s lifetime — leading many experts to suspect that Fermat himself never had a valid proof at all.
Even after Wiles’ published work, the mathematical community faced a persistent challenge: verifying the proof was an enormous undertaking. The chain of logical dependencies stretched across hundreds of pages of dense argumentation, with a single hidden error capable of undermining the entire structure. This problem only intensified as proofs grew longer and more complex, and as AI-generated mathematical arguments began entering the literature faster than human reviewers could process them.
## A Race Between Humans and Machines
Meanwhile, at Imperial College London, mathematician Kevin Buzzard launched a project in 2024 with a specific goal: translating Wiles’ proof into Lean, a formal language designed so that computers can check every logical step independently. The undertaking required an army of volunteer mathematicians and produced documentation spanning 86 pages, with funding secured through 2029. The project was still far from complete.
Then everything changed in a remarkably short timeframe. An AI system took on the same task and finished it in just 11 days — mostly operating autonomously with minimal human intervention beyond occasional directional guidance.
## How the AI System Worked
The project was led by Tianyi Peng, a researcher at Columbia University who builds AI tools for mathematical formalization. Dozens of AI agents worked simultaneously, tackling different components of the proof in parallel. Each agent was responsible for writing formal definitions, proving smaller intermediate results, and combining those results into larger, more complex arguments.
The process wasn’t without setbacks. Early attempts struggled with coordination problems — the agents frequently lost track of which results had already been established and duplicated each other’s work. These failed attempts accounted for roughly 7% of the final codebase, serving as valuable learning data for the system.
A key breakthrough came with a coordination tool called Prove2Me, also developed by Peng’s team. This tool gave every agent access to a shared, live to-do list that tracked which smaller proofs still needed to be completed. It eliminated redundant work, organized files for efficient checking, and maintained plain-English documentation for each result so that agents could reference and build upon each other’s work rather than starting from scratch every time.
By the end, the system had consumed billions of tokens of computation and produced a proof that is more than five times the size of Mathlib, the most extensive shared library currently used for formalized mathematics. To put the scale into perspective: a typical novel contains around 80,000 words, and the AI’s proof is the equivalent of 160 novels written entirely in pure logical argument.
## What This Means for the Future of Mathematics
The achievement has been independently reviewed and validated by Buzzard himself, who confirmed that the proof holds up using nothing but the most fundamental axioms of mathematics. This is significant because it doesn’t represent the AI discovering new mathematical truths — Wiles proved the theorem decades ago. Rather, the AI produced something arguably just as valuable: a machine-readable, fully verifiable receipt that any computer can check, line by line, with absolute certainty.
This distinction matters enormously in a field where the stakes of undetected errors can be enormous. History offers cautionary examples: a computer-assisted proof of the Kepler conjecture required four years of review before experts could only commit to being “99% certain,” and Grigori Perelman’s landmark proof of the Poincaré conjecture took years to be fully absorbed and verified by the community.
With AI-generated mathematical arguments now appearing in research at an accelerating pace, the ability to produce proofs that computers can instantly and definitively verify represents a potentially transformative development. It addresses a growing bottleneck in the field where the pace of proof production is beginning to outstrip the capacity of human reviewers to validate results.
The complete 13-million-line proof has been made publicly available on a shared code repository, free for any mathematician or researcher with the interest and patience to examine it in detail.
## Frequently Asked Questions
**What is Fermat’s Last Theorem?**
Fermat’s Last Theorem states that there are no three positive whole numbers x, y, and z that can satisfy the equation x^n + y^n = z^n when n is any number greater than 2. For example, if n equals 2, solutions exist (like 3² + 4² = 5²), but for any exponent above 2, no such combination of whole numbers works.
**Why did it take so long to prove?**
The theorem remained open for 358 years because the mathematical tools needed to prove it didn’t exist for most of that period. Fermat likely didn’t have a valid proof at all. Andrew Wiles finally proved it in 1995 by drawing on highly advanced areas of modern mathematics that were only developed in the decades leading up to his work.
**What does “formalized proof” mean?**
A formalized proof is a mathematical argument translated into a rigid, ultra-literal language that a computer program can read and verify step by step. Unlike traditional proofs, which rely on human judgment to fill in gaps and accept reasonable leaps of logic, a formalized proof leaves no room for interpretation. Every single logical step must be explicitly justified.
**What is Lean?**
Lean is a programming language and proof assistant specifically designed for mathematics. It allows mathematicians to write proofs in a format that a computer can read and check for correctness. Lean has become a popular tool in the formalization community because it is open-source and has a growing library of previously verified mathematical results.
**Did the AI discover new math?**
No. The AI did not discover new mathematical theorems or create new mathematics. Andrew Wiles had already proved Fermat’s Last Theorem in 1995. What the AI accomplished was translating that existing proof into a form that a computer can independently verify, ensuring that every logical step is correct with near-total certainty.
**How long is the AI-generated proof?**
The proof consists of 13 million lines of code. That is more than five times the size of Mathlib, the largest existing shared library of formalized mathematics. If compared to written text, the logical content is equivalent to approximately 160 full-length novels.
**Can anyone check the proof themselves?**
Yes. The entire proof has been made publicly available on an open code repository. Any mathematician or computer scientist with access to the Lean proof assistant and sufficient computational resources can download and verify it independently.
**What role did human mathematicians play?**
Human involvement was minimal during the final execution. The AI agents mostly worked autonomously, with researchers providing occasional guidance such as prioritizing certain theorems. However, the project was made possible by years of prior human work — including Wiles’ original proof, the development of the Lean system, and the creation of the Prove2Me coordination tool. Kevin Buzzard also personally reviewed and validated the final result.
**Why is machine verification important?**
Traditional mathematical proofs can contain subtle errors that go undetected for years or even decades. Machine verification eliminates this risk by having a computer check every single logical step against the axioms of mathematics. As proofs grow longer and more complex — and as AI begins contributing proofs at scale — the ability to automatically verify correctness becomes increasingly essential.
**What happens next?**
The success of this project opens the door to formalizing many other long-standing mathematical results. Researchers are now exploring how AI-assisted formalization can be scaled to tackle even more complex theorems, potentially transforming how the mathematical community builds and shares trusted knowledge.
## Conclusion
The completion of the first fully computer-checked proof of Fermat’s Last Theorem marks a turning point in the relationship between artificial intelligence and pure mathematics. While the theorem itself was settled over three decades ago, the way we now verify mathematical truth is undergoing a fundamental shift. AI systems have demonstrated that they can produce rigorous, machine-checkable proofs at a scale and speed that far exceeds what human teams can achieve alone. This doesn’t replace mathematicians — it augments their ability to ensure the integrity of an ever-growing body of mathematical knowledge. As proofs become longer, more collaborative, and increasingly generated with the assistance of AI, the capacity for computer verification will move from a luxury to a necessity. The 358-year journey of Fermat’s Last Theorem may have ended with Wiles, but it has opened an entirely new chapter in how mathematics is practiced and trusted.
Thank you for reading



