What “Lean-Verified” Means, and What It Does Not — Seven Lean 4.34.1 Anti-Spoofing Demonstrations
Want to test the tiny honest 2 + 2 = 4 file without installing Lean? Open Demo.Honest (2 + 2 = 4) in Lean 4 Web → (opens external live.lean-lang.org in a new tab; this page loads zero external scripts or iframes).
1. What Each File Says & What Each Check Reported
Core Lean 4.34.1 (commit 5045d005, zero Mathlib) ran every build and leanchecker replay (both default and --fresh). Because leanexport 3.1.0 and nanoda_bin 0.4.19 ship inside Lean 4.35.0 (commit eb6cafb7), the nanoda column ran on the Lean 4.35.0 build of the exact same source files with permitted axioms restricted to [propext, Classical.choice, Quot.sound].
| Demo | Formal Statement | lake build | Axiom Report | leanchecker & --fresh | nanoda (4.35.0 build) | What Catches It |
|---|---|---|---|---|---|---|
Honest fileDemo.Honest |
on Nat by rfl |
Passes | None | Accepts (both) | Checked 38 decls | Nothing needed — honest baseline |
Added axiomDemo.AddedAxiom |
via custom axiom Demo.bad |
Passes | Lists Demo.bad |
Accepts (both) | Refuses unpermitted axiom Demo.bad |
The axiom report & strict axiom policy |
Unfinished proofDemo.UsesSorry |
via placeholder sorry |
Passes (warning) | Lists sorryAx |
Accepts (both) | Refuses unpermitted axiom sorryAx |
Build warning & axiom report |
One-number systemDemo.SmallerNumberSystem |
inside Fin 1 () |
Passes | [propext] |
Accepts (both) | Checked 294 decls | Reading the statement (types in scope) |
Different plus signDemo.RedefinedPlus |
under local Add Nat (+1) |
Passes | None | Accepts (both) | Checked 38 decls | Reading definitions (#synth Add Nat) |
Faulty definitionDemo.WrongDefinition |
MyPrime 1 omitting |
Passes | [propext] |
Accepts (both) | Checked 198 decls | Reading the definition |
Kernel check offDemo.SkipKernelTC |
False via debug.skipKernelTC, then |
Passes | None | Rejects (exit 1) | Fails (panic, exit 101) | Kernel replay (lake env leanchecker) |
2. Five Ways to Get Past lake build
Honest Baseline (Demo.Honest)
theorem Demo.honest : 2 + 2 = 4 := rfl
#print axioms Demo.honest
-- Output: 'Demo.honest' does not depend on any axioms · nanoda: Checked 38 declarations
Trick 1 — Added Axiom (Demo.AddedAxiom)
Anyone can declare an arbitrary starting rule via axiom. Both lake build and leanchecker accept the file because no check was bypassed; #print axioms reports [Demo.bad] and nanoda refuses it under a standard three-axiom whitelist.
axiom Demo.bad : 2 + 2 = 5
theorem Demo.two_plus_two_is_five : 2 + 2 = 5 := Demo.bad
#print axioms Demo.two_plus_two_is_five
-- nanoda: Error: export file declares unpermitted axiom "Demo.bad"
Trick 2 — Unfinished Proof Placeholder (Demo.UsesSorry)
Using sorry succeeds with a warning (not an error) and inserts sorryAx into the axiom report. A log scraper checking only for Error: misses it.
theorem Demo.two_plus_two_is_five_sorry : 2 + 2 = 5 := by sorry
-- warning: declaration uses `sorry` · axiom: [sorryAx]
-- nanoda: Error: export file declares unpermitted axiom "sorryAx"
Tricks 3a, 3b & 3c — Valid Proofs About Altered Meanings (Caught ONLY by Human Statement Reading)
Here the proof and kernel trace are 100% genuine, so lake build, leanchecker, --fresh, and nanoda all pass cleanly:
- One-number system (
Demo.SmallerNumberSystem):theorem Demo.small_number_system : (2 + 2 : Fin 1) = 5 := by decide(modulo 1, both sides equal0; axioms[propext];nanodachecks 294 declarations). - Redefined
+sign (Demo.RedefinedPlus): Inside a namespace,local instance : Add Nat := <fun a b => Nat.succ (Nat.add a b)>turns2 + 2 = 5into a zero-axiomrfltheorem; outside the namespace#synth Add Natreverts toinstAddNat. - Faulty definition (
Demo.WrongDefinition):def MyPrime (n : Nat) : Prop := forall d : Nat, d | n -> d = 1 \/ d = nomits2 ≤ n, lettingDemo.one_is_prime : MyPrime 1pass with[propext]and 198nanodadeclarations.
Trick 4 — Kernel Check Disabled (Demo.SkipKernelTC)
Enabling set_option debug.skipKernelTC true inside meta-code stores a declaration of type False whose proof term has type True.intro without invoking Lean's kernel during elaboration (or via build-file flags invisible in .lean source!). Both lake build and #print axioms look spotless, yet replaying the compiled .olean rejects it immediately:
$ lake env leanchecker Demo.SkipKernelTC
leanchecker found a problem in Demo.SkipKernelTC
uncaught exception: while replaying declaration 'Demo.unchecked':
(kernel) declaration type mismatch, 'Demo.unchecked' has type True but it is expected to have type False
$ lake env nanoda_bin config.json
thread 'main' panicked at src\tc.rs:955:71: assertion failed: self.def_eq(u, v) # exit code 101
3. Kernel Soundness Bugs (#14576), Second Checkers & Open Limits
- What happened in Lean issue #14576 (July 2026): Reported by Kiran Gopinathan (
kiranandcode) after discovery by Ramana Kumar and fixed the same day via PR #14577 by Leonardo de Moura (shipped in Lean4.32.2+, including both4.34.1and4.35.0used here). Nested inductive parametric arguments bypassed type checking, allowing an axiom-free0 = 1proof that also bypassedleanchecker(same kernel) andcomparator, whilenanodaresisted that bug yet required a separate fix for a Collatz disproof noted onoss-security(Jonathan Brossard, 2 Aug 2026) andlean4leanshared the original inductive port. - What this means: Agreement between independent kernels is strong empirical evidence, not an absolute guarantee; toolchain versions matter. Both
4.34.1and4.35.0here include the #14577 fix, so the bug itself was not reproduced. - Why
lean4leanstays marked Open: Mario Carneiro'slean4leanbinary shipped in our Lean4.35.0folder failed with"incompatible header"on compiled.oleanfiles, so zerolean4leanverification is claimed. - How The GCY Standard responds: Every Lean deposit on Go Check Yourself isolates a compact zero-Mathlib kernel core (pinned under
trustLevel = 0), publishes Scoped Definition Audit tables mapping formal types to textbook math, and ships planted negative controls that invert definitions/constants to prove checks reject broken claims loudly.
4. Run All Seven Demos Yourself (lean-verified Files & SHA-256)
All seven .lean source files, Lake configuration files, and the pinned SHA256SUMS.txt live directly under /data/files/lean-verified/ (full walkthrough in lean-verified-REPLICATE.md):
sha256sum -c certificates/SHA256SUMS.txt && cd lean && lake build Demo.Honest && lake env leanchecker --fresh Demo.SkipKernelTC
Optional Lean 4.35.0 + nanoda_bin 0.4.19 config (--fresh takes ~100 s and ~1 GB per demo; set LEAN_NUM_THREADS=2 to keep memory modest):
lake env leanexport Demo.<Name> -- <theorem_name> > export.ndjson && lake env nanoda_bin config.json
{
"export_file_path": "export.ndjson",
"permitted_axioms": ["propext", "Classical.choice", "Quot.sound"],
"unpermitted_axiom_hard_error": true,
"nat_extension": true,
"string_extension": true,
"print_success_message": true,
"print_axioms": false,
"num_threads": 1,
"pp_to_stdout": false,
"pp_declars": []
}
Public File Path (under /data/files/lean-verified/) | SHA-256 Digest |
|---|---|
| demos/Demo/Honest.lean | 2c433c2bc1563475f0dcbf1c96659ad5a853fb0625b455fa9b107f1f4608f36f |
| demos/Demo/AddedAxiom.lean | a99d155e950dd1a59c540fb33f5cbde7224a06c7eb7b92d9b3ac141e5d04bd81 |
| demos/Demo/UsesSorry.lean | 44a013f949d8c018817b64ce3673a00fc7f773964632fb1618dd280f0a5cd092 |
| demos/Demo/SmallerNumberSystem.lean | 1ebb5a0216a24c2060fb08a414c52e60f473ef42fba1d2940fe3c79133af79b1 |
| demos/Demo/RedefinedPlus.lean | a29da88148cb85000ae2874a5049c56f8b9fb2c609d57e6f7aa9a93a26beca60 |
| demos/Demo/WrongDefinition.lean | 884281af9c1818640c7f1d72b1aa121304afe23ef90bac9f78f44d5ceabb411b |
| demos/Demo/SkipKernelTC.lean | e853101f51d13b281c6a270f9164f660edf05c6e763201d57a7821425bdb6676 |
| lean/lean-toolchain | d5edba4e4b8faad9c1baeadb265716d20d03be4d1a2647dc5e35b0c0325bea7b |
| lean/lakefile.toml | ef4b1311a487ca31ff37e382c2bce0b38faf28ee8a465362e192ee4ad0d98ba0 |
| lean/lake-manifest.json | cb0ca2fdba8da778ddea7d9bac0f6f92cee623b85a012a5d3e797997d583df0d |
5. Sources, Credits & Boundaries
- Leonardo de Moura, Sebastian Ullrich, Kim Morrison & Lean FRO / Community: Lean 4 (Apache 2.0), Lake,
leanchecker,lean4export, and Validating a Lean Proof reference chapter. - ammkrn (
github.com/ammkrn/nanoda_lib):nanoda_bin 0.4.19external Rust kernel. - Mario Carneiro:
lean4lean(github.com/digama0/lean4lean, 2024; marked Open here due to header incompatibility). - Ramana Kumar, Kiran Gopinathan (
kiranandcode) & Jonathan Brossard: July–August 2026 disclosures and Lean #14576 / #14577 postmortem; dumko2001, CaptainAni187 & hallerite for PrimeIntellect verifiers issue #2177. - A. Bastounis, F. Circelli & A. C. Hansen (
arXiv:2610.08144, 2026) and J. Xin, A. Schneidman, C. Cummins, K. Ram, S. Ganesh & J. Limperg (AXLE,arXiv:2606.26442, 2026) on formal-to-informal alignment and verification utilities.