Formal Verification of a 250,000-Page LLM Proof: The Engineering Reality

    This article examines a four-page claim of a machine-checked proof of the generalized Riemann hypothesis, backed by 17 million lines of formal proof code that expanded to over 250,000 pages in human-readable form. It breaks down why formal proofs balloon in scale, proposes a layered credibility model showing why a successful compile does not equal mathematical validity, and outlines practical review checklists, human-AI division of labor, and infrastructure practices for governing massive AI-generated artifacts. Engineers will learn how to treat machine checkers as the single source of truth while reserving abstraction and explanation for humans.

    1. What Happened: A Four-Page Statement and 17 Million Lines of Code

    A young researcher who had long worked on number theory published a four-page statement on a personal homepage. The statement claimed that, in collaboration with an AI coding assistant, the researcher had produced a proof of the Riemann hypothesis, in a stronger generalized form.

    The full natural-language proof was not released. When the model was asked to generate a complete human-readable derivation, the output swelled to more than 250,000 pages. Instead, the author released 17 million lines of formal proof code, claiming it contained a complete verification that a machine could check.

    Once the news spread, the global formal mathematics community quickly entered a “compilation race.” Multiple independent teams attempted to build the code. Public information so far indicates that several teams have compiled it successfully. But this only shows that the code is internally consistent under the current logic kernel; it does not mean the mathematical community has signed off. The reason is straightforward: if the logic kernel itself has a flaw, a passing checker is not an absolute guarantee.

    The more critical issue is readability. At 250,000 pages and 17 million lines, no human can review it line by line, so the increment in mathematical understanding is close to zero. The original author acknowledged that substantial compression and restructuring would be needed before it could become a proof that people can actually read. Some researchers criticized this path for replacing understanding with symbol manipulation, deviating from the goals of mathematics. The author responded that the proof depends on a vast body of existing knowledge, and that directly releasing unreadable, redundant content would be inappropriate, so only the formal code was published.

    One telling detail: after the statement was released, the head of a university mathematics department uploaded a manuscript of more than nine hundred pages, forming a sharp contrast—traditional proofs are measured in pages, while machine proofs are measured in tens of thousands of lines.

    2. Technical Breakdown: Why a Formal Proof Balloons to 250,000 Pages

    To understand the scale, you first have to understand the nature of a formal proof: it reduces every step of reasoning to the application of primitive rules that a logic kernel can verify, with no allowance for human shortcuts like “obviously,” “clearly,” or “similarly.”

    The bloat comes from four compounding factors:

    1. Detail explosion. One line of human conclusion may require hundreds of lines of supporting lemmas for a machine.
    2. Library dependencies. Modern formal mathematics relies on massive foundational libraries (natural numbers, algebraic structures, topology, analytic functions, and so on), and the dependency closure is enormous.
    3. Search traces from automation tactics. Automated reasoning leaves behind many intermediate goals and retry branches.
    4. Sampling behavior of generative models. Models tend to “write a bit more to be safe” and lack a global compression objective.

    A schematic of the layered structure (pseudocode, expressing only the layering idea):

    1. theorem generalized_riemann_hypothesis :
    2. ∀ (χ : DirichletCharacter) (s : ℂ),
    3. χ.primitive → L(χ, s) = 0 → 0 < s.re → s.re = 1/2 := by
    4. -- Reduction: reduce to a finite set of decidable lemmas
    5. reduce_to(finite_checkable_lemmas)
    6. -- Reuse existing analytic number theory results from the library
    7. exact analytic_continuation_package
    8. -- Close the remaining goals one by one
    9. all_goals sorry_free

    The genuinely hard part in engineering is the final step, sorry_free: no unproven placeholder may remain. A single placeholder turns “proof complete” into an illusion.

    3. Credibility Assessment: Compiling Is Not the Same as Mathematical Validity

    Treat this as a technical review, and credibility should be assessed in layers:

    • L0 Syntax: can it be parsed, and can it pass type checking.
    • L1 Kernel: have the logic kernel and axiom assumptions been scrutinized by the community over the long term.
    • L2 Dependencies: have the cited existing theorems been independently reviewed, and is there any axiom overreach.
    • L3 Semantics: does the formal statement faithfully correspond to the original mathematical proposition (the most error-prone and hardest to detect automatically).
    • L4 Readability: can it be distilled by humans into transmissible understanding.

    Most disputes concentrate at L3. When translating a natural-language proposition into a formal statement, subtle deviations in quantifier order, boundary conditions, or a function’s domain can make a proof of a weaker proposition look like the task was completed. This is why the community stresses running “statement review” and “independent reproduction” in parallel.

    An actionable review checklist:

    1. Freeze dependency versions and record the full build environment and hashes.
    2. Have independent parties who did not write the code compile it, with no shared cached artifacts.
    3. Manually spot-check the correspondence between key lemmas and the original proposition.
    4. Explicitly list all introduced axioms and assumptions.
    5. Stay skeptical of “stronger conclusions” and require a reduction-path diagram.

    4. The Right Way to Collaborate with AI: Put the Model in a Verifiable Position

    The most valuable engineering lesson from this event is redrawing the boundary of responsibilities between humans and models. The stronger the verifiability, the more suitable the task is for the model; the heavier the aesthetics and abstraction, the more it should be handled by humans.

    Recommended division of roles:

    • The model handles: draft generation, lemma decomposition, templated boilerplate code, locating error messages, and adjusting retry strategies.
    • Humans handle: the correctness of proposition formalization, the macro design of proof strategy, and the explanation and compression of results.

    A practical iterative loop:

    1. while not verified:
    2. draft = model.generate(subgoal, context=verified_prefix)
    3. result = checker.compile(draft) # Machine adjudication, the single source of truth
    4. if result.ok: commit(draft)
    5. else: feed(result.errors, minimal_counterexample) back to model

    The key is a “single source of machine adjudication”: do not accept the model’s self-assessment, only the checker’s output. Also require each commit to be minimal, making it easy to localize and roll back.

    5. Engineering Governance of Extremely Large Artifacts: From Version Control to Observability

    Seventeen million lines of code and 250,000 pages of text are, in essence, an ultra-large-scale engineering asset that requires mature infrastructure:

    • Source hosting and version control: large repositories need sharded cloning and sparse checkout to avoid pulling everything locally.
    • Continuous integration: make compile checks a pipeline gate, so any placeholder or warning causes a failure.
    • Object storage: store build artifacts, proof snapshots, and archived text, with lifecycle policies to control cost.
    • Message queues: decouple the “submit-compile-report” chain to support parallel verification across multiple teams.
    • Container platforms: unify the build environment to guarantee reproducibility.
    • Logging services and monitoring alerts: collect compile time, failure rate, and retry counts, with automatic escalation on anomalies.

    On Baidu AI Cloud, the capabilities above can be carried by general product categories such as object storage, message queues, container platforms, and logging services with monitoring alerts, forming a trusted “submit-and-verify” pipeline.

    6. A Transferable Methodology: Applicable to Any AI-Generated Code

    This experience is not limited to mathematics. Whenever AI output is large in scale and impractical for manual review, the same principles apply:

    1. Verifiability first: prioritize output forms that a machine can adjudicate automatically.
    2. Minimal reviewable units: split large artifacts into small blocks that can be verified independently.
    3. Dependency whitelist: explicitly declare axioms, library versions, and assumptions.
    4. Dual-track review: automated checks plus manual semantic spot-checks.
    5. Compression as a delivery standard: treat unreadable artifacts as unfinished.

    7. A Rational Conclusion

    “A AI solved a Millennium Prize problem” is, for now, more accurately stated as: AI significantly amplifies productivity in highly verifiable formal environments, but credibility still depends on three safeguards—the kernel, the dependency libraries, and semantic alignment—and the ultimate value depends on whether humans can compress and understand it. The lesson for engineering teams is clear: hand uncertainty to machine adjudication, keep abstraction and explanation with humans, and use pipelines, observability, and governance standards to hold the scale.