AI-Generated Formal Proofs: Independent Verification and Lessons from a Riemann Hypothesis Claim

    This article examines a recent large-scale formal proof event to analyze what independent verification actually confirms when AI participates in generating formal proofs, which steps still depend on human judgment, and how these practices can inform AI code governance in software engineering. It focuses on reproducibility, semantic alignment, logical correctness, trust boundaries, audit challenges, and a verification pipeline for engineering teams.

    AI-Generated Formal Proofs: Independent Verification and Lessons from a Riemann Hypothesis Claim

    Recently, a notable event occurred in the field of mathematical formalization: a research team publicly released approximately 17 million lines of formal proof code, along with a brief description claiming that it proved the Riemann Hypothesis and that the method could be extended to the Generalized Riemann Hypothesis. Independent researchers then verified the public code and confirmed that it could be reproduced and compiled, that it exported the same proof files, and that the proposition proved by the code matched the standard formulation used by the mathematical community. This article does not focus on a specific product. Instead, it analyzes from a general technical perspective what independent verification actually verifies when AI participates in generating very large formal proofs, which parts still rely on human judgment, and what such practices imply for AI code governance in software engineering.

    The Nature of the Event: From “Generating a Proof” to “Building an Auditable Evidence Chain”

    The value of a formal proof is not that a machine can “say it is correct,” but that mathematical reasoning is transformed into symbolic objects that a machine can check step by step. For a proof to be accepted, three conditions usually need to be met at the same time: the objects being proved are clearly defined, the proof goal is semantically consistent with the original problem, and every derivation step follows the rules of the formal system. This event attracted attention because it combined AI generation capability with formal verification mechanisms: AI can participate in generating proof code that is enormous in scale and complex in structure, while independent verification mechanisms are responsible for turning a “claimed proof” into an “auditable evidence chain.”

    It is important to emphasize that passing a machine check does not automatically equal “absolute truth.” A formal system can only guarantee that “the proposition is provable under the given definitions, axioms, and inference rules.” If definitions are rewritten, the goal is weakened, or dependency libraries contain unreviewed assumptions, then even if every derivation step is correct, the conclusion may not correspond to the original problem. Therefore, the core of independent verification is not simply running a program once, but building multiple layers of evidence around reproducibility, semantic alignment, and logical correctness.

    Three Verification Questions: Reproducibility, Proposition Alignment, and Correct Derivation

    The first question is reproducibility. Whether the public code can be used by other researchers in independent environments to obtain the same proof files is the starting point of verification. Reproducibility requires that dependency versions, build scripts, system environments, and methods for validating proof artifacts are sufficiently clear. If only the author’s local machine can generate the proof files, external researchers cannot rule out environmental differences, hidden dependencies, or manual intervention. In this verification, dozens of researchers successfully reproduced and exported the same proof files within a relatively short period, indicating that the code and build process have a solid foundation for reproducibility.

    The second question is proposition alignment. A formal proof assistant can check mathematical derivations step by step, but it checks the proposition written in the code. The standard formulation of the Riemann Hypothesis is: the real part of every nontrivial zero of the Riemann zeta function is equal to 1/2. If the code changes the definition of “nontrivial zero,” narrows the range of zeros, or introduces additional restrictions, then even if the proof process is completely correct, it does not prove the original conjecture. For this reason, verifiers need to create independent comparison files that reference only standard definitions already reviewed in public mathematical libraries, and then compare the theorem to be verified with the standard formulation. Only when two separate tools perform the comparison and produce consistent results can it be shown that “what has been proved is indeed the target proposition,” rather than an approximation or a weakened version.

    The third question is correct derivation. The kernel of a formal proof assistant checks whether each inference step follows the rules, but complete verification also involves trust boundaries such as dependency libraries, axioms, compilers, runtime environments, and hardware. For very large proofs, manual line-by-line review is unrealistic, so a layered strategy is needed: first confirm the top-level theorem and key lemmas, then independently rewrite or perform differential checks on high-risk sections, and finally combine automated checks with expert sampling review.

    Trust Boundaries: What Assumptions Exist Beyond the Kernel?

    Formal verification is often understood as “the machine has already proved it,” but from an engineering perspective the trust boundary must be made explicit. Its credibility depends on at least the following assumptions: the proof assistant kernel is implemented correctly; the set of axioms matches expectations; definitions in public mathematical libraries have been sufficiently reviewed; the build environment has not been tampered with; there is a verifiable correspondence between proof files and source code; and the compiler and runtime do not introduce anomalous behavior. For large-scale code generated by AI, additional attention must be paid to whether the generation process introduces untraceable fragments, whether dependencies have been unintentionally replaced, and whether comments are semantically consistent with the code.

    Therefore, a responsible verification report should not merely state “check passed.” It should provide evidence: source code version, dependency lock information, build logs, proof file checksums, independent reproduction records, semantic comparison reports, and expert review opinions. Such an evidence chain can support acceptance by the mathematical community and also provide a foundation for subsequent reproduction and auditing.

    Audit Challenges for AI-Generated Large-Scale Proofs

    AI-generated code is characterized by large scale, high speed, local plausibility, and the possibility of semantic drift at the overall level. In formal proof scenarios, this risk manifests as: a proposition appears correct but its definition has been subtly modified; the proof relies on many auxiliary lemmas, one of which hides additional assumptions; the code compiles but the target type is not fully equivalent to the standard formulation; and there is an explanatory gap between generated content and human-readable descriptions. Solving these problems cannot rely only on “running it several more times.” It requires specification-first work, semantic anchoring, and independent comparison.

    Illustrative pseudocode:

    1. // Standard definition: reviewed definitions from a public mathematical library
    2. def standard_nontrivial_zero(s) := ...
    3. def standard_riemann_hypothesis :=
    4. forall s, standard_nontrivial_zero(s) -> real_part(s) = 1/2
    5. // Target declared in the file to be verified
    6. theorem claimed_target :
    7. forall s, standard_nontrivial_zero(s) -> real_part(s) = 1/2
    8. // Comparison check: not only check that claimed_target is provable,
    9. // but also check that its type is equivalent to the standard proposition
    10. check_equivalent(claimed_target.type, standard_riemann_hypothesis)

    The pseudocode above expresses the idea of “semantic anchoring”: verification is not just proving some theorem, but proving that “this theorem is the theorem we need.” In engineering practice, this corresponds to comparison checks among requirements specifications, interface contracts, and acceptance criteria.

    A Verification Pipeline for Engineering Teams

    For enterprise development teams, the main lesson from this event is that the speed of AI-generated code is exceeding human review capacity, so verification must be built into the pipeline. The following framework can be used:

    1. Specification first: before asking AI to generate code, fix interfaces, data constraints, boundary conditions, and acceptance criteria to avoid “write first, explain later.”
    2. Reproducible builds: lock dependency versions, standardize build environments, and record build logs and artifact checksums.
    3. Automated checks: combine static analysis, unit tests, property tests, and differential tests to cover critical paths and exception paths.
    4. Semantic comparison: establish independent comparison implementations or standard-definition comparisons for core modules to prevent “tests pass but semantics drift.”
    5. Supply-chain audit: check dependency sources, licenses, change records, and unreviewed assumptions to avoid pollution from hidden dependencies.
    6. Human sampling and critical review: conduct expert sampling, key lemma review, and independent rewrite verification for high-risk modules.
    7. Release gates: make reproduction records, test reports, semantic comparison reports, and review opinions prerequisites for release.

    Shared Lessons for Mathematics and Software Engineering

    This verification shows that AI can significantly accelerate the generation and exploration of formal proofs, but final credibility still comes from a verification system that is reproducible, comparable, and auditable. For the mathematical community, independent verification mechanisms can turn “individual claims” into “community-checkable evidence.” For software engineering, governance of AI-generated code also needs similar mechanisms: not simply trusting generated results, but building a complete evidence chain from specifications to artifacts and from dependencies to runtime.

    In the longer term, the combination of formal verification and AI generation may change how large software and mathematical arguments are developed collaboratively: AI expands the search space and generates candidate proofs, humans define problems, review semantics, and set standards; automated tools check step by step, and independent researchers reproduce and compare. Only when these roles form a closed loop can “looks correct” be elevated to “correctness acceptable to the community.” This may be more worth noting than the single event itself.