# What "Lean-verified" means, and what it does not

Sonny

**What this book shows**
- **My result.** Seven small Lean 4.34.1 files (Lean has a small judge inside it, the kernel, that checks every step of a proof against a fixed list of rules), with what Lean actually printed. Five of them make a clean-looking build say 2 + 2 = 5, and a different check catches each kind of trick.
- **What a clean build tells you:** that Lean built the file without an error, given the definitions and axioms (starting assumptions that are not proved) in scope, and nothing more. It does not by itself show that the kernel checked every declaration: a switch can turn that check off and the build still passes. An added axiom or a sorry (a placeholder for a missing proof) shows in the axiom report (Lean's list of the assumptions a theorem rests on); a switch that turns kernel checking off is caught by leanchecker, which replays every declaration through the kernel; a true theorem about a one-number system or a redefined plus sign passes every automatic check and is caught by reading the statement, by no automatic check.
- **Why it matters.** More and more mathematics, and more claims made by computers, carry a "checked in Lean" label. Knowing which check catches which problem lets a reader ask the right question of a result.
- **In Lean:** all seven files. Four are proved in Lean, as written, and accepted by leanchecker and by a separately written kernel, nanoda (a second checker for Lean proofs, written by different people). Two depend on an added or placeholder assumption, which the axiom report shows and nanoda refuses. One is rejected by the re-check.
- Every theorem in this book is listed in the [theorem library](/theorems/).

**Status:** seven Lean demonstrations, each checked by Lean and leanchecker, and by a second kernel checker, nanoda, on a rebuild with Lean 4.35.0; not yet refereed.

## The question

When a mathematical result is called "Lean-verified", what has actually been checked, and can a file that Lean accepts still say something false?

Lean is a program for writing mathematics so exactly that a small piece of software, the kernel, can check every step. A "Lean-verified" label is a strong claim and is easy to over-read. The people who build Lean ask the same question: the Lean Language Reference has a chapter, "Validating a Lean Proof", on how to judge a result you did not write. In July 2026 the question stopped being only about readers' care: a user reported a bug in the kernel itself, in an issue titled "Kernel accepts wrong-structure projections, allowing an axiom-free proof of False" (issue 14576 in the Lean repository, 28 July 2026), and it was fixed the same day.

This book answers the question for one narrow case: what a clean build does and does not tell you, shown on seven small Lean files.

The short answer is that a clean build tells you that Lean built the file without an error, given the definitions and axioms in scope, and nothing more; a separate replay with leanchecker is what shows the kernel accepted every declaration. Five of the files below make a clean-looking build say 2 + 2 = 5, and a different check catches each kind of trick.

## Why it matters

More and more mathematics, and more and more claims made by computers, are presented with a "checked in Lean" label. A reader who takes the label to mean "the English sentence I just read is proved" can be wrong in four ways: the Lean sentence may say something else, a definition may mean something else, part of the argument may sit outside Lean, or the checking program may have a bug. Knowing which check catches which problem lets a reader ask the right question of a result.

## What answering it would help with

- A reader of a "Lean-verified" claim may use the same short list of checks (the axiom report, a re-check through the kernel, a second kernel, reading the statement) to see how far the label can be trusted.
- Authors may be able to say which of these checks a result has passed, in the same words every time, so that labels become comparable.
- Teachers may use the seven files as small, runnable examples of what a formal check does and does not cover.

## What our research shows

**What this is:** A short book on what a "Lean-verified" label covers, with seven small Lean 4.34.1 files that show how a clean-looking build can still say "2 + 2 = 5" (Sonny, 2026).
**Still open:** ways a Lean result can mislead beyond the four this book covers. The book explains the label; it reviews no one's proofs.
**Checked by:** Each file was built with Lean 4.34.1 and re-checked with leanchecker; the same files built with Lean 4.35.0 were also given to a separately written kernel, nanoda. Supporting files are available on request.

<!--BOX-->
### What's in this book

Counts are computed from the book's statement file (its table of seven demonstrations), except the open item, which comes from chapter 4 and the check guide.

| Status | Count |
| --- | --- |
| Proved and checked in Lean (the Lean statement as written, accepted by the kernel; the meaning of the statement is not claimed) | 4 (the honest file, the one-number system, the different plus sign, the faulty definition) |
| Accepted by the build but dependent on an added or placeholder assumption, visible in the axiom report | 2 |
| Stored with kernel checking turned off, rejected by the re-check | 1 |
| Open | 1 (a run with lean4lean, which could not read the compiled files here) |

| Item | Count |
| --- | --- |
| Chapters | 4 |
| Statement files | 2 (a table and its machine-readable form) |
| Written check recipes | 7, one per demonstration, plus an optional second-kernel recipe and the fingerprint check |
| Lean files | 7 |
| Fingerprint list | 1 (SHA-256 of the seven Lean files and the build files) |
<!--/BOX-->

### Yesterday, today, tomorrow

**Yesterday.** Leonardo de Moura and the Lean community built Lean. Kim Morrison and Sebastian Ullrich wrote leanchecker (earlier lean4checker), which replays a compiled proof through the kernel to detect tampering. Mario Carneiro wrote lean4lean and ammkrn wrote nanoda, two checkers that re-implement the kernel separately. The Lean reference manual has a chapter, "Validating a Lean Proof", on how to judge a result you did not write. In July 2026 a bug in the kernel itself was reported and fixed.

**Today.** I ran seven small demonstrations on Lean 4.34.1, on one Windows PC, and pasted what Lean actually printed. An added axiom builds and is shown by the axiom report. A sorry builds with a warning and is shown by the axiom report. A true theorem about a one-number system, or about a redefined plus sign, passes every automatic check and is caught only by reading the statement. A switch that turns kernel checking off lets a false statement build with "no axioms", and leanchecker rejects it. The separate kernel, nanoda, accepted the files that only a reader can catch, and did not accept the one with checking switched off.

**Tomorrow.** The same checks can be run by anyone on these files in a few minutes. lean4lean, a second separately written kernel, could not read the compiled files here, so only nanoda was used; running lean4lean too would be a natural next step. Other readers may know more ways a Lean result can mislead, and those can be added here with the same format: the file, the real output, and the check that catches it.

## Check it yourself

In this book: the project file that builds the seven Lean files, a SHA-256 fingerprint (a 64-character code computed from a file; change one bit and the code changes) for each of those files, and a written recipe for each demonstration in the check guide. The seven Lean files are in the demos folder, and chapter 3 prints each one in full. A recipe gives the exact command, the exact output to expect, and the standard tool that produces it: Lean's build tool, the axiom report, leanchecker, and optionally nanoda. To try one, install Lean through elan (Lean's installer), go to the lean folder and run:

```
lake build Demo.Honest
lake env leanchecker Demo.Honest
```

The build prints that the theorem does not depend on any axioms, and leanchecker accepts silently.

How I direct this work, and my own tools, are not part of this book. Everything you need to check the results is public: the results, their certificates and fingerprints, the Lean proofs, and a written recipe for each check. In this book the results are the seven Lean files and what each check printed; there are no certificate files beyond the fingerprint list of those files.

About this research: https://gocheckyourself.org/about/#how

## The chapters

- [What "Lean-verified" means](chapters/01-what-the-label-means.md): the guarantee, step by step.
- [What "Lean-verified" does not mean](chapters/02-what-it-does-not-mean.md): four things the label leaves out.
- [Five ways to get 2 + 2 = 5 past a build](chapters/03-two-plus-two-is-five.md): the seven files, with real output.
- [Kernel bugs, and why a second checker helps](chapters/04-kernel-bugs-and-second-checkers.md): the case where the check itself is wrong.

The [statement of the seven demonstrations](statement/STATEMENT.md), the [check guide](VERIFY.md), the [plain words page](PLAIN-WORDS.md), the [children's version](KIDS.md) and the [credits page](CREDITS.md) complete the book.

We stand on the shoulders of giants: Lean, its checkers and the people who found and fixed kernel bugs are other people's work, credited on the credits page.

## Where to go next

- Which one of the seven files would you have missed if you only read the build log? See [Five ways to get 2 + 2 = 5 past a build](chapters/03-two-plus-two-is-five.md).
- If the kernel itself can be wrong, how much does a second kernel help? See [Kernel bugs, and why a second checker helps](chapters/04-kernel-bugs-and-second-checkers.md).

Go check yourself.

Have a question about this? [Ask it](https://gocheckyourself.org/about/#contact)
