What It Means When a Large Model Completes a Machine-Formalized Proof of a Mathematical Theorem
Recent discussion misread a machine-formalization effort as an AI proof of Fermat's Last Theorem. The actual work translated an existing human proof into Lean 4 so a small kernel could check every step. This article explains formal verification, the scale of the generated code, the debate over proof form versus correctness, and what the episode implies for AI-generated code and serious reasoning tasks.
First, Clarify the Facts: This Is Not “AI Proved Fermat’s Last Theorem”
A recent claim that “a large model completed a formal proof of Fermat’s Last Theorem” spread widely in technical circles. Many discussions interpreted it as artificial intelligence having solved a famous problem in mathematical history. That reading is seriously mistaken and needs a factual correction.
Fermat’s Last Theorem was proved by mathematician Andrew Wiles in 1995. The core argument was later organized and refined by other scholars, and for three decades the mathematical community has had little substantive doubt about its correctness. What actually happened in this case was different: an existing human proof, already written in papers, was translated line by line into the proof assistant language Lean 4, allowing a computer kernel to mechanically check every inference step and confirm that the entire chain of reasoning rests strictly on underlying axioms, with no gaps or hidden assumptions.
In other words, the event produced no new mathematical conclusion. Its significance lies at the engineering and methodological level: whether an AI system can completely “transcribe” a highly complex modern mathematical proof into a machine-verifiable form. These are two very different achievements, and confusing them leads to misjudgments about AI capabilities.
What Formal Verification Is: Turning a Proof into Compilable Code
To understand the technical weight of this work, it helps to understand the basic principle of formal verification.
Proofs in traditional mathematical papers are written for humans. Authors can rely heavily on phrases such as “obviously,” “easily proved,” or “by standard techniques,” because readers are trained experts who can fill in the intermediate steps themselves. A formal proof must meet machine requirements: every deduction must invoke an explicit axiom or already proved theorem, types must match strictly, and no “default understanding” is allowed.
A software engineering analogy is useful. A human paper is like an architecture design document: it describes the approach and key decisions. A formal proof is like complete source code that compiles and passes all tests. The proof assistant’s kernel acts like a compiler plus type checker. Only when the entire chain of reasoning passes kernel validation is the theorem considered “machine-verified.”
The value of this mechanism is that it shifts trust from “believing expert judgment” to “trusting a validation kernel of a few thousand lines that can be audited repeatedly.” As long as the kernel itself is trustworthy, theorems confirmed through it have an extremely high level of correctness assurance.
Scale: How a 129-Page Paper Expanded into Tens of Millions of Lines
The scale data from this formalization effort is instructive:
- The generated Lean code totaled about 13.4 million lines (about 10.5 million after removing auto-generated boilerplate code).
- The final theorem depended on about 29,000 propositions.
- There were about 530,000 local supporting lemmas.
- The total number of files exceeded 60,000.
- The volume was about five times that of a mainstream mathematical formalization library, and compilation time was nearly 20 times longer.
For comparison, Wiles’s original paper was only 129 pages. Going from 129 pages to 13.4 million lines represents an expansion of several orders of magnitude. This is not AI “padding” the work; it is an inherent property of formalization. Every intermediate step that human experts take for granted, every “standard conclusion,” and every implicit type conversion and boundary-condition handling must be explicitly expanded into the smallest machine-checkable reasoning units.
This phenomenon reveals an important fact: human mathematical writing is a highly compressed form of information, and its compression rate depends on background knowledge shared by reader and author. Machines do not have that shared context, so everything must be expanded. Understanding this is a basic requirement for evaluating news about “AI doing mathematics.”
The Core Debate: Beyond Correctness, a Dispute over Form
The biggest controversy was not whether the proof was correct, but what the proof “looks like.” A scholar who previously led a comparable human formalization project stated explicitly that the difference between the two projects was not correctness but form.
The human team’s formalization project aimed to produce code written for people to read. It emphasized modular design, clear abstraction layers, standardized naming, and complete docstrings. The goal was to deposit the work into a public mathematics library so later researchers could consult, reuse, modify, and build new theory on top of it. The machine-generated proof was completely different: it passed kernel validation and its conclusion was credible, but almost no one could read millions of lines of code. Its internal structure did not meet public library inclusion rules—files were too long, documentation was missing, and naming was arbitrary. Under mechanical inclusion rules, it would basically be rejected in full.
This raises a deeper question about the value of proof: the value of a mathematical proof is not only the binary judgment that “the conclusion holds.” A proof is a vehicle for human understanding of mathematics and scaffolding for later research. A building must not only pass inspection; later engineers must also be able to understand the structural drawings before adding new floors. A machine proof confirms that the building has not collapsed, but no one can read the load-bearing logic of a beam from inside it.
Lessons for Developers: The Divide Between Trustworthy and Usable AI-Generated Code
This controversy has a direct mirror meaning for software engineering. Today’s intelligent programming tools can already generate “runnable” code at scale, but there is a huge gap between “passes tests” and “can enter a production codebase”:
Correctness is not maintainability. Code that passes verification may completely lack modular structure and cannot be taken over and maintained by a team. In engineering practice, human standards such as code review, architectural consistency, and documentation completeness are just as important as the machine standard of compilation.
Verification cost shifts rather than disappears. An AI-generated formal proof is backed by the kernel and does not require humans to verify correctness. But any need to modify, reuse, or extend it throws the cost of understanding back to humans. An asset that no one understands has a reuse value approaching zero.
Automatic generation and human curation should divide the work. The ideal model may be this: AI handles brute-force expansion and fills in mechanical steps, while humans design abstractions, define module boundaries, and write interface documentation. Machines do the “labor,” and humans act as “architects.”
Conclusion: Where AI Stands in Serious Reasoning Tasks
The real milestone of this event is that it demonstrated a large language model can handle a formalization engineering task on the million-line scale with highly strict semantics. That would have been unimaginable a few years ago. It suggests that the cost curve of formal verification may fall sharply, and high-value scenarios such as critical infrastructure software, cryptographic protocols, and compiler correctness may in the future gain machine-level correctness assurance at lower cost.
At the same time, the boundary must be clearly recognized: this time AI retraced a path that humans had already opened; it did not open a new path. The mathematical community’s expectation for formalization has always been twofold—machine recognition plus human reusability. The former has been achieved; the latter still has a long road ahead. For technical practitioners, rather than marveling that “AI proved a theorem,” it is more useful to think about how to unify the goals of “machine-verifiable” and “human-maintainable” in engineering practice. That is the real question this event leaves us with.
