How to Verify AI Mathematical Proofs: A Formal Verification Guide
This guide explains how to verify AI-assisted mathematical proofs through formal verification with tools such as Lean 4, Coq, and Isabelle/HOL. It covers how to tell claims apart from consensus, runnable Lean and Coq examples, a step-by-step workflow for AI-assisted proofs, the limits of AI in generating versus judging proofs, and how to manage large proof codebases with versioning and dependency tracking. A pre-submission checklist helps distinguish a proof that has passed formal verification from a mathematical result the community has accepted.
How to Verify AI Mathematical Proofs: A Formal Verification Guide
Bottom line up front: When AI takes part in difficult mathematical proofs, formal verification is the foundation of trust for AI-era mathematics. It turns “the author claims to have proved it” into a chain of evidence that a machine can check. However, passing a formal check does not automatically mean the mathematical community has accepted the conclusion.
Scope of this article: Statements about unverified events are phrased conditionally. Tool information is based on the public documentation of projects such as Lean, Coq, and Isabelle. As of the time of writing, the Riemann Hypothesis has still not been proven to the satisfaction of the mathematical community.
How to Read Riemann Hypothesis Claims: Separate Claims from Consensus
According to public reports and online discussions, some research materials have claimed to use AI collaboration to produce candidate proofs of the Riemann Hypothesis and even stronger versions of it. Even if those claims turn out to be true, the materials should be treated only as candidates. They are not grounds for concluding that the Riemann Hypothesis has been solved.
When evaluating such claims, readers should ask three questions first:
- Is the proof text publicly available?
- Is the formalized statement equivalent to the original conjecture?
- Are there unclosed goals, undeclared axioms, or an environment that cannot be run?
Traditional peer review relies on experts reading through long documents. AI-generated materials, however, may contain large numbers of lemmas, definitions, and case splits, which make line-by-line human review expensive. This is why formal verification has become a necessary step.
It is important to understand what formal verification actually checks: whether every step of reasoning follows the rules of a given formal system, with a given set of axioms and definitions. Passing the check only shows that the formalized object has no logical gaps within that system. The mathematical community must still decide whether the problem has been correctly expressed, whether the definitions are natural, and whether the axioms are reasonable.
How Formal Verification Works: Real Tools and Executable Examples
Common formal verification tools include Lean 4 (together with its mathlib library), Coq, and Isabelle/HOL. When choosing a tool, look at four points:
- Whether a mature mathematics library is available
- Whether error messages are readable
- Whether dependency versions can be pinned
- Whether continuous checking is supported
A minimal Lean 4 example illustrates what machine checking looks like:
import Mathlibexample (a b : ℕ) : a + b = b + a := byomega
In an environment with Lean 4 and mathlib installed, save the code as Example.lean and run lake env lean Example.lean. If it compiles, the theorem is accepted by the kernel under the current Lean version and mathlib dependencies. If it fails, the compiler points to the location of the syntax, type, or proof goal problem.
In Coq, coqc Example.v compiles and checks the file. In Isabelle, you can use isabelle build or build a session file to run the check. Whichever tool you use, record:
- The tool version
- The math library version
- The operating system
- The command you ran
- The log output
For more complex materials, pin the project down to a runnable repository that includes:
- Dependency configuration
- Source files
- Checking scripts
- A dependency lock file
- Version notes
At minimum, pin the Lean, Coq, or Isabelle version used and record dependency library versions such as mathlib.
A Standard Workflow for AI-Assisted Proofs
AI-assisted proving is usually not a one-sentence answer. It is an engineering loop:
- Definition alignment: Turn the natural-language conjecture into a formal statement, and check that concepts such as limits, analytic continuation, zero distribution, and the functional equation match the original problem.
- Strategy decomposition: Break the work into main lemmas, auxiliary lemmas, boundary cases, and paths to rule out.
- Candidate generation: Let AI generate candidate proofs, alternative expressions, and counterexample searches.
- Formalization translation: Replace vague expressions such as “obvious” and “sufficiently large” with rigorous conditions.
- Kernel checking: Use Lean, Coq, or Isabelle to check that dependencies are closed and whether the goal still has gaps.
- Error back-tracing: Use error locations to find definition errors, type errors, missing lemmas, or axiom assumptions.
- Human review: Experts decide whether the conclusion has genuine mathematical meaning or merely proves a reformulated problem.
- Archiving and reproducibility: Keep the proof code, dependency graph, checking logs, version numbers, and environment configuration.
AI’s Strengths and Limits: It Generates, but It Does Not Judge Value
AI has three main strengths:
- Expanding the search space: It can quickly try constructing lemmas, enumerating cases, or looking for counterexamples.
- Lowering the formalization barrier: It helps fill in common proof patterns.
- Improving collaboration: Other teams can reproduce checks by following the dependency graph.
AI also has clear limits:
- It can generate candidate proofs, but it cannot judge whether a problem is important.
- It can complete local steps, but it cannot guarantee that the original conjecture was formalized correctly.
- It can reduce the amount of human reading, but it cannot replace mathematical consensus.
As a result, the role of human researchers shifts toward posing problems, designing approaches, abstracting concepts, and making value judgments.
Managing Large Proof Materials: Versioning, Dependencies, and Reproducibility
When materials grow to thousands or even hundreds of thousands of lines, manage the proof as a software evidence chain:
- Modularization: Each lemma has its own goal, dependencies, status, and logs.
- Version control: Keep a commit record for every change so that changes to definitions can be traced.
- Dependency management: Clearly state which axioms, theorems, and library versions each lemma depends on.
- Continuous checking: Run the checker automatically after each commit instead of validating everything once at the end.
- Regression testing: After changing a lemma, re-verify the upstream and downstream goals it affects.
- Tiered review: Cross-check key lemmas with multiple independent paths, and run routine steps through automated batch verification.
Pre-submission formal verification checklist:
- Is the formal statement consistent with the original problem?
- Does every key definition have a public source or verifiable text?
- Are the axioms used, classical logic, and any extra assumptions declared?
- Is the dependency graph closed, with no unproven lemmas?
- Are there any gaps such as
sorry,admit, oraxiom? - Can the check be reproduced with a single command in a clean environment?
- Are the Lean, Coq, or Isabelle versions and the dependency lock saved?
- Have key lemmas been reviewed by a second person or independently implemented?
- Are error logs and fix records traceable?
- Does the write-up distinguish “formal verification passed” from “accepted by mathematical consensus”?
Common Misreadings and Rational Judgment
Four misreadings about AI mathematical proofs should be avoided:
- Treating “it passed the machine check” as “a major conjecture has been solved.”
- Chasing proof length while ignoring conciseness and readability.
- Ignoring expert judgment and overlooking whether definitions are natural and lemmas are necessary.
- Underestimating the cost of reproduction: if materials cannot be run or maintained, they will struggle to have a lasting impact.
A more rational evaluation path has four steps:
- Check the source and public availability.
- Check whether the formal statement is equivalent to the original.
- Run the tools to confirm dependency closure.
- Have experts assess the mathematical significance.
If any step is missing, the right wording is “candidate proof,” not “solved.”
In short, formal verification does not replace mathematicians. It builds trusted infrastructure for AI-era mathematics. It connects proof production, machine checking, and expert judgment, so that complex mathematical results can be audited, reproduced, and revised step by step.
