AI Formal Proof Controversy: Engineering Lessons from Redundant Code

    This article examines a controversy surrounding an AI-assisted formal proof of the Riemann Hypothesis and the generalized Riemann Hypothesis, where the author released machine-checkable proof code instead of a natural-language paper. It explains why formal proofs are easy for machines to verify but hard for humans to review, identifies code redundancy as a maintainability problem rather than a style issue, and outlines a reproducibility framework and practical engineering checklist for validating, governing, and reusing large-scale proof assets. Readers will learn how to move from "it compiles" to deliverable, auditable, and maintainable AI-generated knowledge artifacts.

    1. What Happened: A Proof with Code but No Paper

    On November 20, 2026, a mathematician working at an AI company published a statement on a personal website claiming to have completed formal proofs of the Riemann Hypothesis and the generalized Riemann Hypothesis with the help of an intelligent model. The project started on October 6 and took about 41 days. The final step of the core proof was completed on November 15, and the result was extended to the generalized case on November 16.

    Unlike a traditional mathematical result, the author did not submit a natural-language paper. Instead, the code collection was released directly: roughly 175,000 source files, about 17.37 million lines of code, packaged into 14 archives. A claim that “translating it into human-readable text would exceed 250,000 pages” quickly spread online. In a long social media post, the author clarified that the number was a joke: the main theorem intentionally described the total order of real numbers in a cumbersome way as a humor signal, but the outside world took it as fact.

    On verification, several number theorists completed a local build 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 almost no room for hidden assumptions. The author also acknowledged that the code contains substantial redundancy and quality issues. This contrast—logically sound but engineering-rough—is the technical thread of this article.

    It should be emphasized that this article does not evaluate any specific model or product. It abstracts the event into a general engineering problem: when AI is deeply involved in knowledge production, how should the resulting giant codebases and proof assets be verified, governed, and reused.

    2. Why Formal Proofs Are Machine-Verifiable but Hard for Humans to Read

    The core value of a formal proof is to translate a mathematical argument into a formal system that a kernel can check step by step. Take a proof assistant based on dependent type theory as an example: its trusted boundary usually sits on a very small consistency kernel. As long as the kernel implementation is sound and the axiom assumptions are explicitly listed, the machine can mechanically verify every inference step. This is why “only three of the most basic axioms were used” is seen as a strong signal—it means the conclusion did not quietly introduce a strong assumption equivalent to the proposition.

    Machine verifiability, however, does not automatically bring human understandability. Proof code is highly structured terms and tactic sequences, lacking narrative motivation, lemma layering, and intuitive explanation. When the scale grows to tens of millions of lines, reading cost increases superlinearly: readers must not only understand local steps but also reconstruct the global dependency graph. A typical mismatch emerges—low verification cost, high review cost.

    Schematically, a “reviewable” proof skeleton usually looks like this:

    1. theorem riemann_hypothesis :
    2. ∀ ρ, zeta_zero ρ → non_trivial ρ → real_part ρ = 1/2 := by
    3. -- reduce to a finite-dimensional linear algebra lemma
    4. reduce_to_critical_strip_density
    5. -- call the audited core lemma; inlining is forbidden
    6. exact critical_strip_density_main

    The key point is that the main theorem only performs reduction and composition, while the heavy work is delegated to separately audited lemmas. If all intermediate steps are inlined into the main theorem, the result is code that “compiles but cannot be reviewed.”

    3. The Technical Root of the Controversy: Redundancy Is a Maintainability Problem, Not a Style Issue

    The author acknowledged substantial redundancy in the code, which is quite typical in AI-assisted generation scenarios. Redundancy mainly comes from four sources:

    • Repeated inlining: the same lemma is inlined repeatedly in different contexts instead of being abstracted into a reusable theorem;
    • Proof term bloat: intermediate terms left by automation tactics are not cleaned up, forming proof trees that “pass but are bloated”;
    • Naming and directory drift: multiple similar lemmas coexist without a single authoritative version;
    • Generative gap-filling: when facing a gap, the model tends to stack tentative steps rather than restructure the proof path.

    The cost of redundancy is not just more files. It directly raises compile time, memory usage, and continuous integration cost; more seriously, it undermines maintainability—when an upstream definition changes, hundreds or thousands of inlined copies must be updated in sync, sharply increasing regression risk. For reviewers, redundancy also creates “noise cover,” drowning out the assumptions and reduction paths that truly deserve attention.

    Therefore, redundancy governance should be treated as a first-class engineering goal, not after-the-fact cleanup. Practical measures include: establishing a single authoritative source for lemmas, setting threshold alerts for inlining, tracking proof term size trends in the pipeline, clustering duplicate structures, and enforcing abstraction.

    4. A Reproducibility Framework: From “It Compiles” to “Deliverable”

    A trustworthy formal result delivery should cover at least five layers:

    1. Reproducible environment: pin toolchain versions, lock dependencies, and use containerized builds to avoid “it compiles on my machine.”
    2. Replayable build: a one-click script performs fetch, verification, compilation, and report generation, with artifacts carrying hash fingerprints.
    3. Minimal dependencies: explicitly list axioms and external theorem dependencies, and generate a dependency manifest for third-party checking.
    4. Evidence chain retention: preserve build logs, kernel versions, input hashes, and verification results to form a traceable evidence chain.
    5. Review-friendly: provide a navigation map and layered explanation from the main theorem to core lemmas to lower the reading barrier.

    Schematic pipeline configuration (neutral pseudocode):

    1. pipeline:
    2. - stage: fetch
    3. verify_checksums: true
    4. - stage: build
    5. container: pinned_image
    6. cache: proof_artifacts
    7. - stage: audit
    8. list_axioms: true
    9. fail_on_new_axiom: true
    10. - stage: report
    11. artifacts: [build.log, axiom_list.txt, result.json]

    The point of this framework is to turn “author claims” into “facts that third parties can independently verify.” When the environment, dependencies, and evidence chain are in place, verification no longer relies on trust but on replay.

    5. An Engineering Practices Checklist for Developers

    • Layering first: the main theorem only composes; core difficulties are pushed down to independently auditable lemmas; control the size of single files and single theorems.
    • Redundancy budget: set budgets and alert thresholds for proof term size, file count, and duplication rate; block merges when over budget.
    • Automated cleanup: periodically run unused-lemma detection, duplicate-structure clustering, and proof term simplification, producing reviewable cleanup patches.
    • Assumption whitelist: put allowed axioms on a whitelist; any new assumption requires explicit review.
    • Auto-generated review views: generate visual navigation from the dependency graph, marking key reduction nodes and high-risk areas.
    • Change impact analysis: when upstream definitions change, automatically list affected lemmas to avoid missed synchronized updates.
    • Archiving and fingerprints: generate artifact hashes and verification reports for each release to support long-term reproduction and citation.

    6. Enterprise Adoption: Bringing Proof Assets into R&D Governance

    For enterprises, such giant formal assets should not sit outside the R&D system but should be brought into unified engineering governance. General cloud capabilities that can be used include: object storage to archive source packages and verification reports; a container platform to host reproducible build environments; a pipeline service to orchestrate fetch, build, audit, and reporting; logging and monitoring with alerts to track compile duration, peak memory, and redundancy rate trends; and a message queue to decouple long-running tasks and support parallel verification by multiple people.

    The approach Baidu AI Cloud can offer in such scenarios is general-purpose: containerized builds ensure environment consistency, pipelines make audits a mandatory gate, monitoring metrics drive redundancy governance, and object storage plus logging services accumulate the evidence chain. The focus is not on any single capability but on making “reproducible, auditable, maintainable” the default path.

    7. Conclusion: Logical Correctness Is Only the Starting Point

    The most important lesson from this controversy is that machine-verifiable logical correctness is only the starting point of high-quality delivery, not the endpoint. When AI pushes the scale of knowledge production to tens of millions of lines, the real bottleneck shifts from “can it be proved” to “can it be reviewed, reproduced, and maintained.” For developers and enterprises, the earlier they establish layered design, redundancy budgets, reproducible pipelines, and evidence chain mechanisms, the more they can turn AI-driven productivity into sustainable engineering assets.