Skip to main content
Back to insights
Evaluation & TestingLLM Engineering
David BresslerDEC 04, 202611 min read

Nobody Read the Proof. What Did They Check?

Share:

White line art on a coral background: columns of faint code lines fill the frame, and a magnifying glass shows two crisp lines, the short statement that people check.

Compile-Time Intelligence, Part 9

A 17-million-line mathematical proof offers a lesson in how to build AI-generated clinical software that experts can actually review.

On November 20, Levent Alpöge, a mathematician at Anthropic, announced that he and Claude had found a proof of the Riemann hypothesis. First posed in 1859, the hypothesis concerns the distribution of prime numbers and is arguably the most famous open problem in mathematics. [1] [2]

The proof arrived not as a paper, but as 175,187 files containing more than 17 million lines of Lean, a programming language and proof assistant that can mechanically check mathematical arguments. [3]

The next day, the Lean FRO and the Mathlib Initiative, the organizations behind Lean and its mathematical library, announced: "We have full confidence that Alpöge's proof of the Riemann Hypothesis is correct." [4]

On November 25, Luke Sernau and colleagues at Anthropic published a much shorter version. Its compact edition contains about 76,000 lines of code. As of December 2, the repository's README still says: "No mathematician has read it through, and no paper comes with it." [5] [6]

How can mathematicians have such confidence in a proof that nobody has read in full? The remarkable thing is not just that a machine can check millions of lines of mathematics. It is that the mathematical statement being proved is short enough for experts to review independently of the proof, and is written using definitions they already know and trust.

Imagine bringing that same division of labor to clinical software. An AI system could generate the code that implements a medical guideline, and machines could verify that the code follows the rules. Clinicians would focus on whether those rules accurately express what the guideline means, rather than having to inspect thousands of lines of generated code.

But a recent example from oncology shows how easily that division of labor can break down. The authors of a Lean library of clinical rules report that it compiles and passes its tests, yet 29 of its 32 rules are provably false. [7] The way mathematicians verified the Riemann proof offers a starting point for understanding why.

What exactly did mathematicians verify?

In Lean, a mathematical statement and a proof of that statement are two different things. The statement specifies what is being claimed. The proof supplies the chain of reasoning that establishes it. Lean's kernel, the small core of the proof assistant responsible for checking proofs, verifies that the reasoning establishes the statement from the permitted assumptions.

A proof can be valid even when the statement it proves is not the one we intended.

Eight days before Alpöge's release, Kevin Buzzard, a mathematician at Imperial College London, published a guide to assessing claims that a proof has been checked in Lean. He asks four questions: [8]

  • Does the formal statement in Lean match the informal mathematical claim?
  • Does the code compile?
  • Does the code actually prove the stated theorem?
  • Does the proof exploit a bug in Lean's kernel?

The maintainers confirmed that the development compiled, and two independent comparison tools confirmed that it proved exactly the theorem stated in a separate file importing only the trusted library. The proof relied on no assumptions beyond Lean's three standard axioms. An axiom is a statement accepted without proof. Several independently written kernels also accepted the result, reducing the risk that an error in any one checker had allowed an invalid proof through. Andrew Sutherland at MIT and Michael Rubinstein at the University of Waterloo published their own verification runs. [4] [3] [9]

These checks address the last three questions. The first required mathematical expertise: did the formal statement actually express the Riemann hypothesis?

Here is the definition from Mathlib, Lean's shared mathematics library (line breaks added for readability): [10]

Lean
def RiemannHypothesis : Prop :=
  ∀ (s : ℂ) (_ : riemannZeta s = 0)
    (_ : ¬∃ n : ℕ, s = -2 * (n + 1))
    (_ : s ≠ 1), s.re = 1 / 2

It says that every zero of the zeta function, apart from the known zeros at the negative even integers and with the point 1 set aside, has real part one half. A zero is an input at which a function equals zero. You do not need to understand the zeta function to appreciate what matters here: the statement fits in two lines of source code.

Those lines were not generated as part of Alpöge's proof. The definition was already in Mathlib, and the maintainers describe it as "carefully vetted by experts in Lean and number theory." [4] Four related statements about zeros of the zeta function and of Dirichlet L-functions were checked in the same way. [3]

What exactly did mathematicians verify? Nobody has read the proof in full. Experts reviewed the statement. The proof: 17,374,215 lines of Lean in 175,187 files. Checked by machines: it compiled; it proves exactly the stated theorem, per two comparison tools; no axioms beyond Lean's three standard ones; several independent kernels accepted it. The statement: def RiemannHypothesis : Prop := for all s in the complex numbers with riemannZeta s = 0, s not of the form -2(n + 1), and s not equal to 1, the real part of s is 1/2. Two lines of Mathlib source, shown with line breaks. The definition was already in Mathlib, "carefully vetted by experts in Lean and number theory." Reviewed by people: does this say what the Riemann hypothesis says?

What made a two-line statement possible?

The statement is so short because its mathematical vocabulary, including the definition of the zeta function, was already available in Mathlib. Experts had worked out how to express those concepts precisely in Lean.

Mathlib contains about 2.5 million lines of code. [11] To get a sense of how much can sit behind a seemingly simple theorem statement, consider Robin's inequality, an equivalent formulation of the Riemann hypothesis involving sums of divisors of integers. Sutherland counted 2,050 declarations (definitions and theorem statements) in Mathlib and Lean's core on which its meaning depends. [3]

Much of the work of establishing what a statement means can therefore be done before the proof exists, and reused in every new statement that draws on those definitions.

Where reviewed definitions are unavailable, the task looks quite different. Buzzard contrasts the Riemann hypothesis with two recent formalization efforts. A statement of the classification of finite simple groups depended on about 5,600 lines of new definitions in an AI-generated library. A proposed formal statement of the Hodge conjecture involved more than 10,000 lines of code. [8] In such cases, understanding precisely what is being claimed can itself be a substantial review project, regardless of whether a proof checks.

Even there, mathematics has a useful safeguard. If the statement has been mistranslated into a false claim, a sound proof checker should not accept a proof of it from consistent assumptions. The attempt to prove a theorem is therefore a partial test of the statement. It cannot catch every mistranslation, since the wrong statement might also be true, but it provides some resistance to errors.

A clinical guideline is different. The medical recommendation is not ordinarily something we prove from mathematical axioms. We encode it as a specification: a precise description of what the software should do. Lean will accept a well-formed definition whether the claim expressed by it is true or false. The distinction becomes much clearer when we look at a real example.

When the clinical rule itself is wrong

Synho Do, Young-Tak Kim and Hyunji Kim examined their own hand-written Lean 4 library of oncology guideline rules. In the abstract of their NeurIPS 2026 workshop poster (the full paper was not available to me), they report that the library "passes every ordinary signal. It compiles, contains no sorry, and its tests pass." The word sorry is Lean's placeholder for a missing proof. Yet 29 of the 32 rules were provably false, most because of a single misplaced quantifier. [7]

Consider one of the errors they describe. The intended rule was about a particular patient: the treatment given to that patient must be a tyrosine kinase inhibitor (TKI), a class of targeted cancer drugs. The written rule instead said that every treatment is a TKI. A quantifier, the part of a logical statement that specifies whether it applies to every object or some object, had changed the meaning completely.

Most of the executable checkers, however, captured the intended per-patient interpretation: the authors report that 21 of 25 did so exactly. [7] A checker is code that takes a patient's data and determines whether the rule is satisfied. Its tests check the answers it produces, not whether it agrees with the written formal rule.

We recreated this kind of error in a small Lean example. [12] Suppose that if a patient has a particular mutation, the treatment given to that patient must be a TKI. This is an illustrative rule, not clinical guidance or code from the authors' library.

Lean
def Intended (p : Patient) : Prop :=
  p.hasTargetMutation = true →
  p.given = Treatment.tki

def AsWritten (p : Patient) : Prop :=
  p.hasTargetMutation = true →
  ∀ t : Treatment, t = Treatment.tki

Notice the shift from p.given (the treatment given to this patient) to ∀ t : Treatment (every possible treatment). That small change means the second definition expresses a false proposition for every patient with the mutation.

When we tested our example on December 1, the file compiled and all four tests passed. We can even prove that the executable checker evaluates the intended rule correctly for every patient. None of that tells us whether the second definition expresses the rule correctly.

There are two ways we can expose the mistake. First, we can ask Lean to derive consequences of the written rule. If the rule were true for a patient with the mutation, it would follow that radiotherapy, another treatment in our example, is a TKI. Lean proves this implication, and a clinician can recognize the absurd consequence immediately without reading any Lean.

Second, we can require a proof that the executable checker agrees with the rule as formally written for every patient. When we attempt that proof, Lean gets stuck on exactly the problematic case: the checker correctly accepts a patient who received a TKI, but the written rule requires us to establish that every treatment is a TKI. That is impossible in our example. The proof obligation left open exposes the misplaced quantifier directly.

A misplaced quantifier, recreated in Lean. The file compiled and the tests passed. The written rule was still wrong. Intended: if the patient has the target mutation, p.given = Treatment.tki; the treatment given to this patient must be a TKI. As written: if the patient has the target mutation, for every treatment t, t = Treatment.tki; every possible treatment is a TKI, false for every patient with the mutation. What passed: the file compiled; all four tests passed; a proof that the checker evaluates the intended rule for every patient. What exposed it: a derived consequence, radiotherapy would be a TKI; a proof that the checker matches the rule as written gets stuck. An illustrative rule, not clinical guidance.

A proof that the checker matches the specification would catch the disagreement, but if both encoded the same mistake, it would succeed. We still need clinicians to assess whether the specification itself is right.

The Riemann verification suggests how to make that assessment manageable: separate the statement from the work a machine can check, and invest in making the statement itself easy for experts to review.

Five practices for making clinical rules reviewable

The verification of the Riemann proof suggests five practices. Some are already feasible; others would require building shared infrastructure for clinical formalization.

1. Keep the specification small and separate. The five theorem statements in the community's Riemann repository are kept in a separate file, using only Mathlib, and comparison tools establish that the full proof proves precisely those statements. [13] A clinical equivalent would be a standalone set of formal rules and the definitions they rely on. A clinician could review what the guideline says without having to inspect the code implementing it. The scope of that review would grow with the complexity of the guideline and its vocabulary, rather than with the number of lines of implementation code.

2. Build a shared, reviewed clinical vocabulary. Clinical informatics already has standardized terminologies, data standards such as FHIR, and rule languages such as CQL. Part 4 discussed FHIR and CQL. [14] What I have not found is a clinical counterpart to Mathlib that combines reusable definitions with precise formal semantics a proof checker can build on, reviewed by clinicians. What does "current medication" mean? What counts as a "treatment given" rather than a treatment ordered? If each new guideline must define these concepts afresh, each translation creates another opportunity for a subtle error. Reviewing them once and reusing them would concentrate human attention on what is genuinely new in each guideline.

3. Prove that the executable checker implements the specification. Rather than relying only on tests of individual cases, require a machine-checked proof that the checker gives the result specified by the rule for every possible input within the formal model. This is the binding between checker and rule that Do and colleagues propose. [7] It is exactly the requirement that exposed the error in our example. It establishes agreement between two formal objects, not the medical correctness of either.

4. Make assumptions explicit. The Riemann proof's axiom footprint, the set of assumptions it relies on, can be inspected. [3] Clinical rules should have the same transparency about what they take as given. A mathematical proof cannot establish an empirical claim about a drug's effect on survival simply because the claim has been encoded in a rule. [7] Nor should missing information silently turn into a negative finding. A reviewer needs to know which assumptions, definitions, and defaults are driving the decision.

5. Examine the consequences of the specification itself. Sutherland used the Riemann proof together with an independent formalization to establish Robin's inequality, a statement that does not even mention the zeta function. [3] The analogous clinical exercise is to derive patient cases from the formal rule and show them to a qualified clinician. What would the rule recommend for each patient, and is that recommendation consistent with the guideline? Part 6 explored how a solver can generate such cases; Part 8 showed how searching for cases with undesirable outcomes can help expose missing conditions. [15] [16] The point is to challenge the specification, not merely to see whether the code obeys it.

Together, these practices would let clinicians focus on what the rules mean and what follows from them, while machines verify that the implementation conforms to them.

Once the specification is fixed, the implementation can change

The original release contained 15,531,759 lines of code (17,374,215 lines including blanks). Five days later, the compact edition contained only 76,149 lines of code, excluding blank lines and comments. The five theorem statements remained identical. [6] [9]

There was no need to read the rewritten proof from beginning to end to establish that it proved the same results: both versions could be checked against the same statements.

Once the specification is fixed, the implementation can change. In five days the proof shrank about 200 times. The statements stayed identical. 15,531,759 lines of code in the original release, November 20; 76,149 lines of code in the compact edition, November 25; bars to scale. The five theorem statements were identical in both versions. Both versions were checked against the same statements, so nobody had to read the rewrite. For clinical software, AI systems could regenerate an implementation and prove each version against the approved rule.

For clinical software, this suggests a different way of thinking about the work involved in implementing guidelines. Much of the valuable human effort goes into establishing a formal specification that clinicians are willing to stand behind. Once that exists, AI systems could generate, optimize, and regenerate implementations, with a machine-checked proof for each version that its logic still follows the specification.

A hospital could also adapt that implementation to its own electronic health record system. The proof would not by itself guarantee that a field in that system corresponds to the clinical concept in the specification. Those local data bindings, discussed in Part 4, still need independent review. [14] But if the guideline remains unchanged, the approved rule does not have to be interpreted afresh simply because the implementation changes. And when the guideline is revised, clinicians can focus on reviewing what changed in the specification.

What humans still need to understand

A checked mathematical proof is not necessarily an understood proof. Mathematicians are now trying to understand the reasoning behind Alpöge's result, and a readable account may reveal insights that a valid formal derivation alone does not communicate. [9] [2]

The requirement for a clinician reviewing a compiled guideline is somewhat different. They need to be able to understand precisely what a rule says, which assumptions it makes, and what it recommends for patients. They should not have to read every line of generated implementation code in order to establish those things.

The Riemann verification demonstrates what machines can do, but also the value of the work that came before them: a shared language for stating mathematical claims precisely, with a community of experts who had already reviewed its meaning.

If we want AI to implement medical knowledge at scale, we need to invest in the clinical equivalent. The goal is to make the part that requires human judgment small enough that experts can actually review it, and give machines the much larger task of verifying that the code lives up to it.

Sources

  1. Alpöge L. Announcement note on a proof of the Riemann hypothesis. Nov. 20, 2026.
  2. Savitsky Z. Inside the global effort to make sense of AI's massive Riemann proof. Science, Nov. 30, 2026.
  3. Sutherland A. Verification files for the Lean proof of the Riemann Hypothesis. MIT, page updated Nov. 27, 2026. File and line counts, axioms, kernels, Robin's inequality and the 2,050-declaration count.
  4. Lean FRO and Mathlib Initiative. Lean verification of the Riemann Hypothesis. Lean community blog, Nov. 21, 2026.
  5. Sernau L. grh-lean: GRH for Dirichlet L-functions, in Lean 4. GitHub, Nov. 25, 2026. The quoted sentence is from the README's Status section.
  6. Sutherland A. Verification files for the shorter Lean proof of RH and of GRH for Dirichlet L-functions. MIT, page updated Nov. 27, 2026. The compact edition has 76,149 lines of code and the original 15,531,759.
  7. Do S, Kim Y-T, Kim H. When the Specification Is the Risk: Applying Formal Verification to Clinical Decision Rules. Poster, NeurIPS 2026 Workshop on AI for Verifiable Coding. Abstract only; the full paper was not available to me.
  8. Buzzard K. "...and the proof is checked in Lean". Xena Project blog, Nov. 12, 2026.
  9. Rubinstein M. Alpöge/Claude proof of the Generalized Riemann Hypothesis. University of Waterloo. Outline of the shortened proof, version 1.5, Nov. 27, 2026.
  10. Mathlib. RiemannZeta.lean, definition RiemannHypothesis. Read Dec. 1, 2026.
  11. de Moura L. Lean Now Ships with Verified Kernels. Oct. 15, 2026. Gives Mathlib's size as 2.5 million lines of code.
  12. Eventum. MisplacedQuantifier.lean. Illustrative example, tested December 1, 2026 using core Lean 4.35.0; not yet publicly released or independently reviewed.
  13. Lean community. riemann-hypothesis. GitHub. README, src/Statements.lean and Challenge.lean, read Dec. 1, 2026.
  14. Bressler D. The Guideline Compiled Cleanly. Where Did the Interpretation Go? Eventum, Oct. 22, 2026. Compile-Time Intelligence, Part 4.
  15. Bressler D. The Proof Checked. Does the Spec Say What the Guideline Says? Eventum, Oct. 28, 2026. Compile-Time Intelligence, Part 6.
  16. Bressler D. Jev Makes the Judgments. Lean Proves the Logic. Eventum, Nov. 23, 2026. Compile-Time Intelligence, Part 8.

Summarize with AI:

ChatGPTGrokGeminiClaude
Related service

Discovery, architecture, build, evaluation, deployment, handoff. Senior technical ownership end-to-end.

Diagonal halftone representing the AI project delivery flow.