What a Proof Rests On
A proof depends on other proofs, on axioms, and on a small piece of software that checks it. How dependencies propagate, why a single sorry can hide three lemmas away, what a file that compiles has and has not shown, and what a second, independent checker adds.
In Chapter 6 — The AI Proof That Wasn’t Finished (Part I, Chapter 5), a published Lean file stated a hard olympiad problem,
proved four helper lemmas about it, and left the main theorem’s proof as a
single word, sorry. Lean accepted the file. A reader who counts “the file
compiles” as “the theorem is proved” gets the wrong answer, and nothing in the
compiler’s exit code will tell them so.
Chapter 15 asked what a checked theorem says. This chapter asks what it rests on: the other results it uses, the axioms beneath them, and the software that does the checking. The answers decide whether “proved” means anything.
Proofs depend on proofs
A proof rarely stands alone. It cites lemmas, which cite other lemmas, down to definitions and axioms. Those citations form a dependency graph: an arrow from each result to every result its proof uses.
The graph matters because trust flows along it. A result is only as well established as everything beneath it. If one lemma deep in the graph is unproved, then every result above it that uses it is unproved too, however careful their own proofs are.
Mathematicians have always worked this way. A paper that cites “Lemma 3 of [12]” rests on [12]. What a proof assistant adds is that the graph is explicit and complete, so the question “what does this rest on?” has a mechanical answer.
Axioms are the bottom of the graph
At the bottom of every dependency graph are statements that are assumed, not
proved. In Lean these are axioms. Lean’s #print axioms follows the graph
from a declaration all the way down and lists every axiom it reaches.
Here is a small file, checked with Lean 4.35:
theorem stepA (n : Nat) : n + 0 = n := sorry
theorem stepB (n : Nat) : (n + 0) + 0 = n := (stepA (n + 0)).trans (stepA n)
theorem stepC (n : Nat) : 0 * n = 0 := Nat.zero_mul n
Lean reports:
'stepB' depends on axioms: [sorryAx]
'stepC' does not depend on any axioms
Look at stepB. Its own proof is complete; it contains no sorry. It inherits
the gap from stepA, through the graph. Lean warns “declaration uses sorry”
only at stepA, but #print axioms finds the gap at every declaration above
it. And the file still compiles, with exit status 0.
sorryAx is an axiom that asserts any proposition at all. A proof that uses it
has assumed what it was meant to show. So the rule is simple:
A declaration is proved, in the kernel’s sense, only if its axiom list contains nothing beyond the accepted standard axioms.
For Lean with Mathlib, the accepted list is usually propext,
Classical.choice and Quot.sound (Chapter 15). Anything else is a finding:
sorryAx: a gap, somewhere below;- a project’s own
axiom: an assumption someone added. A file that declaresaxiom cheat : Falsecan prove1 = 2, and#print axiomsshowscheat; - an axiom generated by
native_decide: the proof trusts the result of compiled code, not just the kernel. In Lean 4.35 it appears as an auxiliary axiom named after the declaration. That can be a reasonable trade, but it is a different trust base, and the list makes it visible.
Reading the grasshopper artifact
Part I’s audit applied this rule to every declaration in the published file:
- The four helper lemmas depend only on the standard axioms. They are proved.
- The main theorem depends on
sorryAx. It is not proved. - When the audit injected a
sorryinto one helper, it surfaced in that helper and in the other helper that uses it, exactly asstepBinherits fromstepA, and the two helpers that do not depend on it stayed clean.
The same figure as Chapter 6: the dependency graph is the proof’s load-bearing structure. Taint flows downstream and never upstream, which is why the audit reads every declaration’s axioms, not just the file’s verdict.
So “the artifact proves the grasshopper problem” is false. “The artifact proves four lemmas about partial sums, and states the problem” is true. Whether those lemmas are real progress towards a proof is a mathematical judgement about how they would fit together. The kernel cannot grade promise.
This shape is common in AI-assisted formal work, and it is not dishonest in
itself. A file that states a target, proves the parts it can, and marks the
gap with sorry is a scaffold. It becomes misleading only when someone
reports the scaffold as a proof.
What a file that compiles has shown
A file that compiles has shown that every declaration in it type-checks,
given the axioms its declarations depend on. Lean accepts sorry with a
warning, so compiling shows nothing about whether those axioms include a gap.
The honest report for each declaration therefore has three parts:
- Is it accepted by the kernel? (Does the file compile?)
- What does it rest on? (
#print axioms.) - Is it a proof of the statement we meant? (The binding of Chapter 15.)
Chapter 6 — The AI Proof That Wasn’t Finished (Part I, Chapter 5)’s substitution variant shows why all three are needed. A
main theorem restated as True and proved trivially passes questions 1 and 2:
it compiles, and its axioms are clean. It fails question 3.
The trusted base
When the kernel accepts a proof, what must we trust for that to mean the theorem is true? The list is called the trusted base:
- the kernel, the small program that checks proof terms;
- the axioms in the list;
- the definitions the statement uses (Chapter 15: is
/the division you meant?); - the statement itself, and its correspondence to the claim;
- the hardware and the build, which we normally take on trust.
Notably absent from the list are tactics, the automation that searches for proofs, and the AI or human who wrote the file. They produce a proof term, and the kernel checks the term. A wrong tactic, or a wrong suggestion from an AI, produces a term the kernel rejects. This design, a small checker beneath untrusted proof search, is called the de Bruijn criterion, after the designer of the Automath system. It is why a proof assistant can safely accept proofs from an unreliable source: the source does not need to be trusted, only checked.
That is also the right role for AI in this book. An AI can propose a statement, a lemma or a proof. Its proposals enter the trusted base only through the kernel’s check, and its statements enter only through a person’s judgement that they match the claim.
A second checker
If the kernel itself had a bug, a false theorem could be accepted. The usual answer is a second, independent check. In this book’s MATH01 investigation, the Lorentz interval theorem is proved separately in Lean and in Rocq.
It is worth being exact about what that adds.
- Independent kernels. Lean and Rocq are separate implementations. A bug in one is unlikely to be repeated in the other. This is real protection.
- Independent proofs. The two proofs were written separately.
- Not independent statements. The same project wrote both statements from the same contract. A misreading of the claim would be shared, and both kernels would correctly accept the misreading.
- Not identical mathematics. Lean’s and Rocq’s real numbers are built differently. Nobody has proved the two constructions equivalent. For the interval theorem this hardly matters, because it is a polynomial identity that holds in any commutative ring. For anything that uses the square root, it matters more.
So a second checker guards against a faulty checker. It does not guard against a faulty statement. Only review of the statement does that.
The kernel must be seen to say no
One last check is easy to forget. A pipeline that has never rejected anything
has not shown that it can. That is why the investigations carry failure
controls: deliberately false statements, wrong constants, injected sorrys
and substituted theorems, each of which must be rejected on every run. In
Chapter 6 — The AI Proof That Wasn’t Finished (Part I, Chapter 5), four variants of the file were built to fail in four
different ways, and each did. A check that passes everything is not a check.
Evidence note
The stepA/stepB example, the cheat axiom and the native_decide axiom
were run with Lean 4.35.0; they are illustrations, not claims.
The grasshopper findings come from Chapter 6 — The AI Proof That Wasn’t Finished (Part I, Chapter 5)’s pinned audit, whose
relation to IMO 2009 Problem 6 is not established. The Lean and Rocq
interval proofs are kernel-checked (MATH01); their independence is analysed,
not proved. Full standing: Part IV, evidence tables.
Exercises
- Draw the dependency graph of the
stepA/stepB/stepCfile. Which declarations would become clean ifstepAwere proved? - Prove
stepAwithoutsorry. (Hint: on natural numbers,n + 0andnare equal by definition.) What does#print axioms stepBreport then? - A file has six lemmas and a main theorem. Lean prints one
sorrywarning, at lemma 2. Which declarations can you trust without running#print axioms? - Explain why the
substitutionvariant in Chapter 6 — The AI Proof That Wasn’t Finished (Part I, Chapter 5) passes the axiom check but is still refused. - Two kernels accept a theorem. Name one error this rules out and one it does not.
Worked answers: Chapter 35 — Appendix A: Solutions to the Exercises (Part IV, Appendix A)#chapter-7-what-a-proof-rests-on.
Further Reading
For deeper study; not sources for the chapter’s claims.
- Robert Pollack. “How to believe a machine-checked proof.” In Twenty Five Years of Constructive Type Theory (Oxford University Press, 1998), 205–220. DOI. Why read it: Directly examines what it means to trust a proof checker, separating the formal question of derivability from the informal question of what the theorem says.
- Henk Barendregt, Herman Geuvers. “Proof-Assistants Using Dependent Type Systems.” In Handbook of Automated Reasoning (Elsevier, 2001), 1149–1238. DOI. Why read it: An authoritative account of dependent type systems and the de Bruijn criterion, the design idea behind a small kernel beneath a large proof development.
- Herman Geuvers. “Proof assistants: History, ideas and future.” Sadhana 34(1) (2009), 3–25. DOI. Why read it: A concise survey of the history, design choices and trust models of proof assistants, useful for placing Lean and Rocq in a longer tradition.
Next in Part II: Chapter 17, events, frames and simultaneity.