Formal Proof of the Riemann Hypothesis Using AI: Why 17.5 Million Lines of Code Sparked a Redundancy Debate
This article examines a controversial AI-generated formal proof of the Riemann Hypothesis and the generalized Riemann Hypothesis, released with over 17.5 million lines of machine-verifiable code. It explains why kernel verification alone does not guarantee a valid mathematical result, breaks down the sources of massive code redundancy in automated proof generation, and outlines engineering practices such as dependency minimization, layered builds, and automated audits for managing large-scale proof projects.
1. Background: How a “Joke Number” Ignited the Debate
On November 20, 2026, a mathematician working at an AI company published a statement on a personal page claiming that, using intelligent coding and reasoning models, they had completed formal proofs of the Riemann Hypothesis and the generalized Riemann Hypothesis. The machine-verifiable proof code was released alongside the claim. The project started on October 6 of the same year and took about 41 days. The final step of the core theorem was completed on November 15, and the result was extended to the generalized case the next day.
Unlike traditional mathematical work, the author did not submit a natural-language paper. Instead, they directly released a formal proof project containing more than 175,000 source files and about 17.37 million lines of code, compressed into 14 packages. A subsequent claim that “translating it into human-readable text would exceed 250,000 pages” was clarified by the author as a joke: they had deliberately described the total order relation of real numbers in a cumbersome way in the main theorem, intending to leave a humorous clue, but the outside world widely spread it as fact.
During verification, several number theorists compiled the project locally on the day the statement was released and confirmed that the proof passed the underlying logic checks, relying only on three of the most basic standard axioms, leaving minimal room for cheating. The author also acknowledged that the code contains substantial redundancy and quality issues. Previously, the team had reported that an intelligent model raised the lower bound on the proportion of non-trivial zeros on the critical line from 41.6% to 67.2%.
2. Why “Compilation Passed” Does Not Mean “The Paper Is Finished”
The core value of a formal proof is that every step is checked item by item by the kernel, and the proof cannot pass if any single step fails. This means credibility comes from the logic kernel rather than the author’s reputation. It also explains why “invoking only three basic axioms” is regarded as strong evidence: fewer dependencies mean fewer implicit assumptions.
From an engineering perspective, however, there is a caveat: a successful compilation only proves that “the proposition and the code are consistent”; it does not prove that “the proposition expressed by the code is the Riemann Hypothesis.” Definition drift during formalization and substituted theorem statements are real risks. Therefore, a credible evaluation should include at least three layers:
- Kernel check: no logical gaps;
- Statement audit: the target theorem is aligned word for word with the accepted mathematical formulation;
- Dependency audit: the list of axioms and external lemmas is minimized and reproducible.
3. Where the Redundancy in 17.37 Million Lines Comes From
The redundancy is not accidental but an inevitable byproduct of automated generation and machine-readability-first design:
- Type and structure expansion: abstract structures are repeatedly instantiated so the kernel can accept them without ambiguity;
- Proof strategy fallback: exhaustive branches left after search failures are fully retained;
- Intermediate lemma inflation: fine-grained splitting produces many “seemingly obvious” small conclusions;
- Duplicate packaging: multiple entry points and multiple versions coexist in the same repository.
Schematically, the redundancy often looks like this:
lemma step_00417 : P x := by-- Many intermediate states generated by automated tacticssimp only [defs...]cases h with| inl => exact trivial_branch_00417| inr => exact trivial_branch_00418
4. Governance Methods for Large-Scale Proof Engineering
If such projects are treated as software engineering, the following practices can be applied:
- Dependency minimization: regularly generate lists of axioms and external references and compare differences;
- Deduplication and compression: merge equivalent conclusions by lemma fingerprint and remove dead code;
- Layered builds: separate core, supporting, and experimental layers, with independently packaged artifacts;
- Reproducible pipelines: pin toolchain versions and cache intermediate artifacts to shorten recompilation on the scale of 41 days;
- Quality gates: turn “statement audits” and “dependency audits” into automated checks rather than manual spot checks.
From an engineering standpoint, object storage can be used to keep multi-version artifacts, container platforms can pin the toolchain, and logging services with monitoring alerts can track failure rates and duration fluctuations of long-running tasks, giving a long-cycle derivation sustainable iteration capability.
5. Takeaways for Technical Teams
The real issue in this controversy is not the “250,000 pages” but the trust boundary of AI-generated content: machine-verifiable proofs bring certainty, while the generation process brings redundancy, and the two need engineering means to be reconciled. For enterprises, the reusable conclusion is to integrate generative capabilities into strict verification stages and control risk with minimal dependencies, layered builds, and automated audits. In cloud environments such as Baidu AI Cloud, running long-cycle tasks on general computing, storage, and observability capabilities is a practical path to turning a “surprise” into a deliverable result.
