AI Formal Verification: Lessons from Two Proofs of the Riemann Hypothesis

    This article uses the same-day appearance of two Riemann Hypothesis proofs—one from years of human work, the other from roughly 41 days of human-AI collaboration—to examine what happens when machine checkers, not peer reviewers, decide correctness. It covers why AI-assisted review exposes flaws in hours, how formal verification in Lean turns proofs into machine-checkable objects, the maintenance debt created by 17 million lines of proof code, a stable division of labor between humans, AI, and executable checkers, and a practical checklist for engineering teams.

    1. The Event: Two Proofs, Two Outcomes

    A math problem that had been open for 167 years received two proofs on the same day. One came from more than a decade of independent work by a human researcher. The other came from roughly 41 days of collaboration between a human and an AI coding tool. Within two days, their fates diverged: about eight hours after the first was made public, someone used AI tools to find a flaw; the second received joint confirmation from the formal verification community the day after release and was considered “fully trustworthy.”

    The delivery format is even more counterintuitive. The human-AI side produced almost no traditional paper. It delivered a four-page explanatory note written by a human, plus about 17 million lines of formal code intended exclusively for machine checking. More than 250,000 pages of AI-generated drafts were not published. The human note only explains the idea; correctness is handed entirely to an executable proof checker.

    The value of this event for developers has nothing to do with the math news itself. It puts one question on the table: when the correctness of a deliverable is decided by a machine, how should our engineering process change?

    2. Why “Flawed in Eight Hours” Is the Norm, Not an Accident

    Peer review for a traditional math paper takes months or even years, and errors often surface long after publication. AI-assisted review compresses that window to hours. This is not because reviewers got smarter; it is because the marginal cost of searching for candidate counterexamples dropped to nearly zero.

    Engineering has a directly analogous phenomenon. Human review catches design-level problems, but coverage of combinatorial explosion zones—boundary conditions, null paths, concurrent interleavings—is extremely low. A tool can enumerate input combinations you never thought of in seconds.

    The conclusion is straightforward: for high-complexity deliverables, relying on “a few more read-throughs” to establish correctness is not a viable strategy. Verifiability must be built in at the design stage, not patched on afterward.

    3. Formal Verification: From Academic Topic to Infrastructure

    The core idea of formal verification is to turn a “proof” into an object that a program can check line by line. In a dependent type language such as Lean, proof states are constrained by the type system, and the checker performs only mechanical verification. It does not accept human shortcuts like “obviously” or “trivially.”

    A minimal example of what a checkable assertion looks like:

    1. -- Claim: applying f to each element of a list and then summing
    2. -- is equivalent to summing first and then applying f
    3. -- (provided f is a linear map)
    4. theorem sum_map (f : ℕ → ℕ) (l : list ℕ) :
    5. (l.map f).sum = f l.sum := by
    6. induction l with
    7. | nil => simp
    8. | cons x xs ih => simp [ih]

    Three engineering implications follow:

    • Assertions are code. The spec and the implementation share one source, so there is no “docs say one thing, code does another.”
    • Checking cost is manageable. Verification is mechanical and can go into a pipeline, running on every commit.
    • Errors cannot be argued away. The checker ignores seniority and wording; it only looks at whether the claim holds.

    The cost is equally clear: formalization is extremely expensive. The engineering effort behind 17 million lines of proof code far exceeds that of a typical business system. It also only proves that something holds “under the given axioms and definitions.” Choose the wrong axioms and the conclusion is still wrong.

    4. The Real Engineering Problems Behind 17 Million Lines of Code

    Once the machine signs off, human readability becomes the bottleneck. No traditional journal can hold 250,000 pages of drafts, and no human can read tens of millions of lines of proofs. This exposes a general rule: raising verifiability creates new maintainability debt.

    Transferable practices:

    1. Layer the abstraction. The bottom layer is mechanically expanded detail, the top layer is readable high-level lemmas, and automated tactics fill the middle. Humans review only the top.
    2. Separate summaries from proofs. Human documentation describes only the strategy and key lemmas; details live in build artifacts, similar to a “design doc plus generated code” relationship.
    3. Keep dependencies auditable. Axioms, definitions, and external theorems a proof depends on must be listed explicitly, forming a bill of materials that makes the size of the “root of trust” easy to assess.
    4. Check artifacts into repositories. Proof and verification artifacts belong in version control and an artifact repository with reproducible builds, not scattered across individual machines.

    5. Redrawing Responsibilities Between Humans and AI

    The description that “AI runs faster toward the end and leaves humans behind” yields a stable division of labor:

    • Humans own problem definition, the choice of axioms and invariants, and interpretation of what the result means. This part sets the direction; get it wrong and everything downstream is wrong.
    • AI owns large-scale search, case enumeration, mechanical derivation, and draft generation. This part is a throughput contest.
    • The machine makes the final ruling. The executable checker is the only judge, which avoids “whoever is loudest is right.”

    In day-to-day development, this maps to three capabilities you can adopt immediately: AI coding tools for completion and refactoring, automated tests for behavioral constraints, and formal or semi-formal methods for strong constraints on critical paths. On the enterprise side, this typically requires object storage for build artifacts, a container platform to host reproducible verification environments, and logging plus monitoring and alerting to track the success rate and duration of verification jobs. Baidu AI Cloud provides standard-category support for these general capabilities; specific choices should still be evaluated against team size and compliance requirements.

    6. A Practical Checklist for Engineering Teams

    • Identify the critical path. Not all code deserves formalization; prioritize consistency, permissions, monetary amounts, and state machine transitions.
    • Write the spec before the implementation. Express the spec as executable assertions to avoid natural-language ambiguity.
    • Put verification in the pipeline. Make the checker a gate that blocks merges on failure.
    • Control the root of trust. Audit axioms and external dependencies, and record them in the bill of materials.
    • Keep a human-readable layer. High-level lemmas and decision records must be written down to prevent “verifiable but nobody can understand it.”
    • Invest in phases. Start with lightweight constraints on critical modules, measure returns by defect rate and regression cost, then decide whether to expand scope.

    7. Conclusion

    The real signal from this event is that the authority to decide correctness is migrating from peer review to executable checking. For developers, the earlier specs, verification, and artifact management are folded into the engineering system, the better you can hold the quality line after AI sharply compresses the production cycle.