Formal Verification with AI: Code Redundancy and Verification Logic

    This article examines a recent controversy around an AI-assisted formal proof of a long-standing number theory problem. Instead of a natural-language paper, the author released a machine-checkable proof project with roughly 175,000 source files and 17.37 million lines of code, compressed into 14 packages. The discussion centers on code redundancy, a misread joke about the proof exceeding 250,000 pages, and why axiom dependencies matter. It also explains why passing machine verification does not guarantee readable or maintainable mathematical writing, and offers practical engineering guidance for managing large-scale formal proof projects: layered architecture, minimal axioms, reproducible builds, redundancy control, dual-track review, and standardized release notes.

    1. What Happened: Why an AI-Assisted Formal Proof Sparked Debate

    Recently, a mathematician working at an AI company published a statement on a personal page saying that, with the help of intelligent coding and reasoning models, they had completed a formal proof of a long-standing number theory problem. The statement said the project took about 41 days from start to finish of the core steps, after which the result was extended to a stronger generalized version.

    Unlike a typical math release, the author did not submit a natural-language paper. Instead, they directly published a very large formal proof project: about 175,000 source files and about 17.37 million lines of code, compressed into 14 packages for download.

    Debate followed. On one side, people questioned whether machine verification is truly airtight. On the other, a claim that “transcribing the proof into human-readable text would exceed 250,000 pages” spread widely. The author later clarified that the page-count claim was a joke, based on a deliberately cumbersome description of the total order relation on real numbers in the main theorem. They assumed readers would recognize the humor, but it was taken as fact.

    More importantly, the author acknowledged that the code contains substantial redundancy and quality issues. This highlights what makes formal proof distinctive: a machine cares only about whether the logic is closed, not naturally about whether the expression is concise or the structure elegant.

    2. Why “Machine Verification Passed” Does Not Mean “Mathematical Writing Is Acceptable”

    The core advantage of a formal proof is that every inference step can be checked by the kernel. The conclusion does not depend on the author’s reputation but on the consistency of the underlying logic and axiom system. On the day the statement was released, several external researchers completed local builds and confirmed that the proof used only a very small set of basic standard axioms, greatly reducing the room for “hidden extra assumptions.”

    From an engineering perspective, however, a formal proof is also an “executable specification.” It can naturally suffer from the following problems:

    1. Redundancy bloat: The same lemma is repeatedly unfolded and reproved, with little abstraction or reuse.
    2. Poor readability: To pass checking, the author may choose “dumb but stable” writing, such as over-expanding the total order relation.
    3. Hard maintenance: Once upstream definitions or library versions change, massive numbers of files can trigger cascading build failures.
    4. High review cost: Even if the machine proof is correct, human reviewers still need to understand the proof strategy, key lemmas, and conceptual mapping.

    A more reasonable evaluation framework is therefore dual-track: machine guarantees logical correctness, while human review and standards govern mathematical expression and engineering maintainability.

    3. Technical Breakdown of the Controversy: Redundancy, the Joke, and “Verifiability”

    1. Why Code Redundancy Is Almost Unavoidable

    In interactive proof environments, many “obvious” inferences require explicitly constructing intermediate objects, type conversions, and boundary handling. When generating proofs, AI tends toward “exhaustive unfolding” to improve pass rates, which causes size explosion. Redundancy itself does not break correctness, but it significantly raises the barrier to reproduction.

    2. Why “250,000 Pages” Was Misread

    When communication is stripped of context, technical humor gets treated as a metric. For engineering teams, this points to a real problem: formal proof releases need an accompanying “reading guide,” otherwise outsiders will evaluate the work with the wrong measure.

    3. Why Axiom Dependencies Are a Key Metric

    The trustworthiness of a formal proof depends not only on “whether it compiles” but also on “which axioms/assumptions it depends on.” Relying on only a very small set of basic axioms means the applicability boundary of the conclusion is clearer and the proof is easier to cross-examine across different proof assistant ecosystems.

    4. A Practical Guide for Developers: Managing Large-Scale Formal Proof Projects

    If you want to introduce formal verification in a real project (for example, protocol conformance, compiler correctness, or key algorithm invariants), you can refer to the following engineering practices:

    1. Layered architecture: Split the proof into a “definition layer—lemma layer—strategy layer—composition layer,” where each layer depends only on the layer below, avoiding cross-layer coupling.
    2. Minimal axiom principle: Track the axiom dependency list in continuous integration; any new assumption must be reviewed.
    3. Reproducible builds: Pin toolchain versions, dependency library versions, and build flags, and output auditable build logs.
    4. Redundancy governance: Periodically scan for “unused lemmas/duplicate proofs” and abstract high-frequency patterns into reusable templates.
    5. Dual-track review: The machine checks logical closure; humans review proof strategy, concept definitions, and readability.
    6. Standardized release notes: Include “how to read this proof,” a “key lemma map,” and a “list of dependent axioms” to avoid distortion in communication.

    Illustrative continuous integration check logic (pseudocode):

    1. on commit:
    2. build(proof_project, toolchain=fixed)
    3. axioms = collect_axioms(proof_project)
    4. assert axioms ⊆ ALLOWED_BASIC_AXIOMS
    5. report = analyze_redundancy(proof_project)
    6. publish(report + reading_guide)

    5. Conclusion: Formal Proof in the AI Era Needs Both “Correctness” and “Maintainability”

    The essence of this controversy is not “whether AI can do math,” but “when machine proofs enter public view, how we establish matching quality standards and communication norms.” For developers, the most valuable takeaway is to govern formal verification as serious software engineering: minimal assumptions, reproducible builds, controlled redundancy, and readable documentation. Only then can formal proof truly move from a “one-off spectacle” to a “sustainable engineering capability.”