Artificial intelligence just made history in mathematics — and in a way few expected to happen this soon.
AI agents from Anthropic completed the mathematical formalization of Fermat’s Last Theorem in just 11 days.
You read that right.
A problem that went unanswered for centuries, and whose human proof took mathematician Andrew Wiles seven years of near-secret work to construct in the 1990s, now has a machine-verified formal proof — with no assumptions beyond the axioms of mathematics themselves. The formalization confirms that the proof found by humans in the 1990s is correct.
And the numbers are staggering:
- 13 million lines of code written in the Lean language
- 29,500 intermediate theorems developed along the way as necessary stepping stones to complete the work
- The largest Lean proof ever created in history, five times larger than everything that previously existed in the Mathlib repository
What Anthropic delivered is not just an impressive technical achievement. It is a genuine turning point for the future of mathematics and scientific research. 🔑
But to understand the magnitude of this accomplishment, it helps to go back in time a bit and understand why this particular theorem is so special.
What is Fermat’s Last Theorem and why does it matter so much
Fermat’s Last Theorem is one of those stories that sounds like it came straight out of a movie. In the 17th century, French mathematician Pierre de Fermat posed the puzzle and scribbled in the margin of a book he was reading that he had discovered a proof for the claim. The famous detail? He said the margin was too small to contain the demonstration. And that kicked off one of the greatest mysteries in the history of mathematics, which remained open for centuries.
The theorem, despite being easy to state, was extremely difficult to prove. It asserts that there are no integers a, b, and c that satisfy the equation aⁿ + bⁿ = cⁿ, where n is an integer greater than 2. Simple to write, nearly impossible to demonstrate.
For centuries, the greatest mathematicians in the world tried to prove Fermat’s claim and failed. It was only in 1995 that British mathematician Andrew Wiles published a complete mathematical proof. Wiles had worked on the problem for seven years in secret before announcing his breakthrough in 1993. Mathematical proofs typically involve long logical arguments that build on one another. If a single step contains an error, the whole thing can collapse. And that is exactly what happened with Wiles: a flaw was found in his proof, and he and his collaborator Richard Taylor spent about a year fixing it.
It is precisely this kind of fragility that mathematical formalization solves. It takes the proof out of the realm of pen and paper and places it in a framework — computer code — that allows machines to work methodically through the logic, exposing any flaw. Today there are already about 2 million lines of formalized mathematics stored in a central repository called Mathlib. This is where Anthropic’s achievement enters the picture with full force. 💡
How Anthropic’s artificial intelligence did this in 11 days
Anthropic used artificial intelligence agents based on its Claude model to carry out the formalization process. According to the company, Claude worked continuously and autonomously for 11 days to write the proof. Instead of a single model answering questions, the approach used multiple AI agents working in coordination, with different tasks assigned to each one — like tackling smaller pieces of the theorem, breaking the problem into manageable parts.
Not everything went perfectly smoothly, though. Human experts occasionally issued high-level instructions to keep the work on track. At various points, the agents lost track of the project’s state and stopped collaborating effectively. Interestingly, Anthropic said the breakthrough only came after the company started using a tool designed for mathematical collaboration between humans, called Prove2Me, which helped the different agents keep track of their work and decide on next tasks.
The language chosen for this work was Lean, a computer-assisted proof system that works like a kind of compiler for mathematics — if the logic has any error, it simply does not accept it. To get a sense of scale: the Mathlib repository was built over years by hundreds of mathematicians and programmers collaborating together. The proof generated by Anthropic’s agents is five times larger than everything that was in that repository before, with 13 million lines of code and 29,500 intermediate theorems. All of this in less than two weeks. 🤖
What experts had to say about the achievement
Earlier this year, a conference bringing together AI specialists, computer scientists, and mathematicians was held in London by Kevin Buzzard of Imperial College London. Before Anthropic’s announcement, Buzzard had been leading a five-year project to formalize the 100-plus-page proof by Wiles and Taylor in the Lean language, specifically so it could be formally verified and serve as a foundation for new research.
Buzzard had said at the time that when the project started he was confident it would succeed, but that recent advances in AI had convinced him the work would be completed much faster than he had thought possible. Anthropic’s announcement ended up surpassing that effort and closing the question entirely.
In a statement published by Anthropic, Buzzard said the company’s proof leaves no assumptions beyond the axioms of mathematics. In short: the problem is settled. He also pointed out that throughout the process, it was possible to observe the autoformalization of algebra, harmonic analysis, geometry, and number theory, and that the AI autoformalization artifacts are now robust enough to be used as a foundation for new work, since the proof is multilayered. According to Buzzard, if automatic formalization of Fermat’s Last Theorem is possible now, then we have taken a major step toward the automatic formalization of all modern mathematical literature.
What changes from here for mathematics and science
Anthropic’s achievement is not just a technical record. It opens a door the scientific community has been trying to open for decades: the possibility of having mathematical proofs verified by machine in a systematic and scalable way. The implications are enormous. Errors in complex proofs exist and are more common than most people realize — Wiles’ own proof had a flaw that took a year to fix. A system capable of formalizing and verifying proofs automatically could drastically reduce that kind of problem.
Beyond that, the ability to generate and verify formal mathematics at machine speed opens the door to exploring problems that are currently considered out of reach because of the sheer volume of work they would require. There are famous conjectures in mathematics — like the Riemann Hypothesis and other Millennium Prize Problems — that could become more viable targets for artificial intelligence-based approaches in the coming years. Not that AI will solve everything automatically, but it can dramatically accelerate the work of human mathematicians, leaving them to focus on the parts that still require high-level intuition and creativity.
For the broader scientific community, the impact goes beyond pure mathematics. Theoretical physics, cryptography, computer science, and even computational biology depend on rigorous mathematical foundations. Having tools capable of formalizing and verifying those foundations at the speed Anthropic demonstrated could change the pace of scientific progress in a meaningful way. 🚀
Why mathematical formalization is so difficult — and so important
For people outside the field, it might seem strange that a proof already accepted by the mathematical community needs to be formalized. After all, if the experts have already validated it, what is the problem? The answer lies in the difference between convincing other mathematicians and proving something in an absolutely irrefutable way. Traditional proofs are written in natural language mixed with mathematical notation, and they rely on the reader filling in gaps with their own knowledge and intuition. An experienced mathematician reads an argument and understands what is being said, even if several intermediate steps are not explicitly written out.
In mathematical formalization, that is not allowed. Every step needs to be justified by axioms or by theorems that have already been proven. It is like the difference between describing an algorithm in plain English and writing the code that actually runs on a machine — the computer does not tolerate ambiguity. This level of rigor is extremely valuable because it guarantees the proof is actually correct, not just convincing. And the work of transforming an intuitive proof into a formal one often reveals subtleties and dependencies that were not obvious in the original version.
The challenge is that this process is incredibly slow when done by humans. Formalization projects for important theorems have taken years of collective effort from entire communities of mathematicians and computer scientists. The fact that artificial intelligence agents managed to do this in 11 days with a theorem as complex as Fermat’s Last Theorem suggests we are entering a new era for this field — and that the pace will keep accelerating as models become more capable and coordination techniques between agents evolve. This is the kind of breakthrough that will be studied and referenced for a long time. ✨
