# What the words mean

**The question:** what do the words in a "Lean-verified" claim mean, in plain words and for experts? **The answer in brief:** each is one link in a chain, from the kernel that judges a proof, to the axiom report, to a second look, to the meaning of the sentence itself.

"Lean-verified" is a short label for a long chain of steps. Each idea below has a plain version and a version for experts.

## Yesterday, today, tomorrow

**Yesterday.** Lean was built so that a very small program, the kernel, is the judge of every proof, and so that a reader need not trust the person who wrote it. Its authors also wrote tools to look again at a finished proof, and two other groups wrote separate kernels that can re-check a proof exported from Lean.

**Today.** I ran small examples to show what the label covers. An extra axiom, an unfinished proof, a redefined plus sign, a number system with one number and a switch that turns checking off each give a Lean file that "proves" 2 + 2 = 5 (or a related falsehood). In each case the book shows what Lean printed and which check catches it.

**Tomorrow.** The same questions can be asked of any Lean result. Readers who know other ways a Lean result can mislead are asked to say so.

## The kernel

**In plain words.** Lean has a small judge inside it. You hand it a statement and a proof, and it checks every step against a fixed list of rules. If it says yes, the proof is correct for the statement as written, using the definitions and starting assumptions that are in scope. It does not decide whether the statement is the one you meant.

**For experts.** Lean 4's kernel is a type checker for a dependent type theory with inductive types, universes, quotients and definitional proof irrelevance. A theorem is accepted when its value has the stated type in the current environment. The kernel's input is an expression produced by the elaborator, so everything before that point (parsing, notation, instance resolution, tactics) is outside the trusted base, and everything after it (the kernel implementation, the compiler for native evaluation, the toolchain) is inside it.

## Axioms and the axiom report

**In plain words.** An axiom is a starting assumption that is not proved. Lean uses three standard ones. You can ask Lean to list the assumptions a theorem rests on. If the list is empty or holds only the three standard names, nothing extra was assumed. If it shows the special placeholder axiom, someone left a gap. If it shows a name nobody recognises, someone added an assumption, and the theorem is true only if that assumption is. The list reports the stored assumptions; a separate kernel replay is another check.

**For experts.** The axiom report collects the axioms reachable from a constant in the environment, including the placeholder axiom, axioms introduced by native evaluation (names ending in a native marker), and any user-declared axiom. It does not re-run the kernel, so a declaration added without checking (through the kernel-skip option, or the function that adds a declaration without checking it) is reported with whatever axioms its stored value mentions, which can be none.

## A second look

**In plain words.** There are two kinds. One is Lean looking again at its own stored work, with the same judge, which catches work that was stored without being judged. The other is a different judge, written by different people in a different language, which is given the proof as plain text. If both say yes, a bug in one is unlikely to be in the other. It is still not a guarantee.

**For experts.** leanchecker loads the compiled module files and replays each declaration through the same kernel, with its fresh mode replaying imports as well. It does not defend against a kernel bug or a malformed compiled file. External checkers (nanoda in Rust, lean4lean in Lean) read the lean4export text format and use separate kernel implementations. The reference manual's strongest recommendation, comparator, builds in a sandbox and then checks with Lean's kernel and an external checker. A kernel bug affecting all checkers used remains an assumption.

## A true sentence that means something else

**In plain words.** A proof is a proof of the exact sentence written in Lean, with the exact meanings of the symbols in scope. If someone redefines the plus sign, or uses a number system with a single number, or leaves a condition out of a definition, then Lean will happily confirm a sentence that looks like something else. The only defence is for a person to read what the sentence and its definitions really say.

**For experts.** Statement fidelity: elaboration of 2 + 2 = 5 depends on the instances in scope for addition and numerals and on the expected type. The statement (2 + 2 : Fin 1) = 5 is true by computation because the type with one element has a single value. A local addition instance on the natural numbers shadows the core instance within its scope and makes 2 + 2 = 5 hold by reflexivity. A definition of "prime" that omits the condition 2 ≤ n admits 1. In all three the kernel's verdict is correct and the axiom report is clean.

## The switch that turns checking off

**In plain words.** Lean has a setting, meant for experts debugging Lean itself, that tells it to store a declaration without sending it to the judge. A file that sets it can store a false statement, and the build and the assumption list both look clean. Looking again with leanchecker sends the stored statement to the judge, which refuses it. The setting can be placed in the build file, so searching the build file matters as much as searching the Lean files.

**For experts.** The kernel-skip option makes the kernel's add-declaration entry point store the declaration without checking it. Set in the options section of the project's build file, it applies to every module of the library, and no Lean source file mentions it. The elaborator still checks ordinary terms, so a false theorem needs a direct call that adds a declaration, from meta-code, to be stored. Lean's reference manual classes such use as dishonest.

## Where to go next

- Which of these words are shown at work, with real Lean output? See [Five ways to get 2 + 2 = 5 past a build](chapters/03-two-plus-two-is-five.md).
- What does the label leave unsaid? See [What "Lean-verified" does not mean](chapters/02-what-it-does-not-mean.md).

Experts: the files and checks are here: [check guide](VERIFY.md).
