Fermat Project Recasts a Monumental Proof as Lean Code
By Reviuws AI Editor · Published
Fermat’s Last Theorem fits in a margin, but its proof sprawls across some of the deepest territory in modern number theory. Translating that achievement into Lean is therefore not merely an exercise in checking a famous result. It is an attempt to rebuild generations of mathematical knowledge as explicit, testable and reusable infrastructure.

A proof is not a single object
The theorem states that no three positive integers satisfy xⁿ + yⁿ = zⁿ for an integer exponent greater than two. Andrew Wiles, with a crucial correction completed with Richard Taylor, proved it in the 1990s by connecting elliptic curves and modular forms. That compact summary conceals an enormous stack of definitions, lemmas and imported theories.
In a research update from Anthropic, the company describes work on formalizing the mathematics in Lean with assistance from AI systems. The important distinction is that an AI-generated suggestion is not accepted because it sounds plausible. Lean’s kernel checks whether each term satisfies the underlying rules.
That makes the undertaking closer to migrating a critical software system than transcribing a paper. Informal mathematical prose routinely omits routine steps, relies on conventions and assumes readers can reconstruct local arguments. A proof assistant requires those gaps to be filled. Every object needs a type; every condition must be available at the point where it is used.
The dependency graph is the real artifact
A machine-checked version of a theorem is often discussed as if it were a digital certificate attached to an existing proof. That understates what formalization produces. The result is a graph of dependencies whose nodes can be inspected, tested and reused independently.
This graph can reveal where a celebrated argument relies on a stronger lemma than its prose suggests, where two communities use slightly different definitions, or where an apparently elementary step depends on substantial background machinery. Such discoveries do not necessarily indicate errors. More often, they expose assumptions that expert readers silently supply.
The work also forces decisions about interfaces. Should a theorem be stated in maximum generality, or in the narrow form needed by the next result? Which abstractions belong in Lean’s shared mathematics library, Mathlib? Which implementation details should remain hidden so that downstream proofs do not break after a refactor? These are software architecture questions applied to mathematical knowledge.

Verification still needs maintenance
Formal proofs are sometimes described as permanent because a small trusted kernel can check them. But the surrounding code is not maintenance-free. Libraries evolve, names change, abstractions improve and old tactics may stop working. A large formalization can accumulate technical debt just as a production codebase can.
That is why the Fermat effort matters beyond its ceremonial value. If engineered well, its intermediate results could survive changes through stable interfaces, automated tests and continuous checking. Later mathematicians could import those components instead of reconstructing them from journal articles. A difficult theorem would become a maintained dependency rather than an isolated monument.
There is also a social consequence. Traditional credit tends to collect around the final theorem, while formalization makes the supporting work unusually visible. Definitions, compatibility lemmas and library improvements can be traced as concrete contributions. That could broaden what institutions recognize as valuable mathematical labor, although academic incentives may take time to catch up.
A harder benchmark for mathematical AI
For AI developers, the challenge is not simply producing a clever proof of a contest problem. A serious formalization demands repository-scale work: finding relevant lemmas, respecting local conventions, diagnosing compiler errors and preserving compatibility with thousands of existing declarations.
This favors systems that combine language generation with search, retrieval, code execution and iterative feedback. The verifier provides a rare advantage: outputs can receive an exact correctness signal. Yet passing the kernel is only a minimum standard. An unreadable proof that depends on brittle internals may be valid while still being poor engineering.
The competitive question for AI systems may therefore shift from who solves the most standalone exercises to who can contribute dependable patches to a living formal library. Training data will matter, but so will tool use, context management and the ability to navigate long dependency chains. Open systems may benefit from transparent experiments around Mathlib, while proprietary systems may compete through stronger orchestration and larger compute budgets.
This work should not be mistaken for evidence that mathematicians are close to automation. Humans still choose definitions, decide which route through the literature is viable and judge whether a formal statement captures the intended mathematics. AI can reduce the cost of routine translation and search. The architecture of the proof remains an intellectual task.
What to watch next
The clearest milestone will be how much of the required mathematical foundation lands in reusable public libraries, rather than remaining bespoke project code. Adoption by other formalization efforts would be stronger evidence of impact than a single final check mark.
Also watch the maintenance record: whether upgrades break major sections, how quickly failures are repaired and whether contributors outside the original team can extend the work. The lasting achievement will not be a machine saying that Fermat was right. It will be a mathematical codebase that others can safely build upon.