Lean 4
Also known as Lean
A proof assistant and functional programming language based on dependent type theory; a small kernel checks every proof term.
You write definitions and proofs in Lean; tactics and automation build proof terms, and the kernel checks each one before it is accepted.
Trust card
What you trust when you accept a proof from Lean 4. Logic: Dependent type theory (a version of the calculus of inductive constructions with quotient types).
Trusted coreProof kernel. The small trusted core of a proof assistant that checks every proof.
De Bruijn-style kernel: a type checker for Lean's core type theory, written in C++. The elaborator, tactics and unification are outside it; their output is re-checked by the kernel. It has built-in fast arithmetic on natural-number literals (one source of past bugs).
sourceIndependent re-checkers
- nanoda — Independent type checker written in Rust; reads lean4export files. Bundled with Lean and run by
lake check --paranoidandlake comparator --paranoid. - Lean4Lean — Kernel re-implemented in Lean, with metatheory. Its README says it is derived from the C++ kernel and likely shares some of its bugs. Bundled with
--paranoid. - con-leche — External checker written in Lean with a machine-checked proof (in Lean) that it does not accept a proof of False. Bundled with
--paranoid. - con-ron — Close Rust port of con-leche, to guard against bugs in Lean's own compiler and runtime. Bundled with
--paranoid. - leanchecker (formerly lean4checker) — Replays compiled .olean files through the official kernel; ships with Lean since v4.28.0. It catches environment tampering by metaprograms but is not an independent implementation.
- Lean Kernel Arena — Shared test suite and scoreboard for dozens of third-party Lean checkers in many languages.
Axioms
Standard axioms: propext, Quot.sound and Classical.choice. #print axioms lists what a theorem depends on. sorryAx marks an incomplete proof. Lean.ofReduceBool (used by native_decide) trusts the compiler; since v4.29.0, decide +native and bv_decide add one dedicated axiom per native computation.
CertificatesProof certificate. A record of a proof that a separate, simpler program can check.
Yes. lean4export writes declarations in a plain-text export format that external checkers read. Since v4.35.0, lake check and lake comparator build in a sandbox, export, check the axioms used, and replay the export through the kernel; --paranoid adds the bundled external checkers.
Soundness record
4 notable issues in the last five years. An empty list means none were found, not that none exist. Reports go to this channel.
- Nov 2026 leanchecker accepted an axiom-free proof of False built by editing compiled .olean files Fixed by PR 16717. Maintainers note that this tool is not part of the recommended
lake checkprocedure. Fixed - Jul 2026 Kernel accepted wrong-structure projections in nested inductive types, giving an axiom-free proof of False Needed a malicious metaprogram; also worked under comparator. Fixed in v4.32.2 (PR 14577). Fixed
- Jul 2026 Missing kernel check on opaque declarations allowed a proof of False after an adversarial metaprogram Fixed by PR 14498 (kernel now checks opaque values for free variables). Fixed
- Aug 2022 Wrong result from the C++ Nat.mod on large numbers gave a proof of False by rfl Fixed
In this index
Entries that rely on Lean 4.
Toolchains
Semantics usable here
Automation checked by it
- AlphaProof · Google DeepMind
- AlphaProof Code · Google DeepMind
- Aristotle · Harmonic
- DeepSeek-Prover · DeepSeek
- Goedel-Prover · Princeton Language and Intelligence, Princeton University
- LeanHammer · Carnegie Mellon University
- Seed-Prover · ByteDance Seed