# Lean 4

> 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.

- Kind: proof-assistant
- Logic: Dependent type theory (a version of the calculus of inductive constructions with quotient types)
- Checker level: Strong (green)
- Licence: open-source, Apache-2.0
- Latest release: v4.36.0 (2026-11-16) https://github.com/leanprover/lean4/releases/tag/v4.36.0

## Trust card

- Kernel: 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). ([source](https://lean-lang.org/doc/reference/latest/Elaboration-and-Compilation/))
- Independent checkers: [nanoda](https://github.com/ammkrn/nanoda_lib) (Independent type checker written in Rust; reads lean4export files. Bundled with Lean and run by `lake check --paranoid` and `lake comparator --paranoid`.); [Lean4Lean](https://github.com/digama0/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](https://github.com/leanprover/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](https://github.com/leanprover/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)](https://github.com/leanprover/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](https://arena.lean-lang.org/) (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. ([source](https://lean-lang.org/doc/reference/4.36.0/ValidatingProofs/))
- Certificates: 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. ([source](https://github.com/leanprover/comparator))
- Soundness reports: https://github.com/leanprover/lean4/issues

## Soundness issues (notable, recent first)
- 2026-11: [leanchecker accepted an axiom-free proof of False built by editing compiled .olean files](https://github.com/leanprover/lean4/issues/16730) — fixed. Fixed by PR 16717. Maintainers note that this tool is not part of the recommended `lake check` procedure.
- 2026-07: [Kernel accepted wrong-structure projections in nested inductive types, giving an axiom-free proof of False](https://github.com/leanprover/lean4/issues/14576) — fixed. Needed a malicious metaprogram; also worked under comparator. Fixed in v4.32.2 (PR 14577).
- 2026-07: [Missing kernel check on opaque declarations allowed a proof of False after an adversarial metaprogram](https://github.com/leanprover/lean4/issues/14484) — fixed. Fixed by PR 14498 (kernel now checks opaque values for free variables).
- 2022-08: [Wrong result from the C++ Nat.mod on large numbers gave a proof of False by rfl](https://github.com/leanprover/lean4/issues/1433) — fixed

Used by toolchains: aeneas, lnsym

---
Last checked 2026-11-26. Data: [JSON](/provers/lean4.json) · Page: [HTML](/provers/lean4/) · Methodology v0.1: [/methodology/](/methodology/) · Corrections: [/contribute/](/contribute/)
