{
  "id": "lean4",
  "name": "Lean 4",
  "aka": [
    "Lean"
  ],
  "summary": "A proof assistant and functional programming language based on dependent type theory; a small kernel checks every proof term.",
  "details": "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)",
  "open": "open-source",
  "license": "Apache-2.0",
  "links": {
    "homepage": "https://lean-lang.org/",
    "repo": "https://github.com/leanprover/lean4",
    "docs": "https://lean-lang.org/doc/reference/latest/"
  },
  "trust_card": {
    "kernel": {
      "summary": "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": [
      {
        "name": "nanoda",
        "url": "https://github.com/ammkrn/nanoda_lib",
        "note": "Independent type checker written in Rust; reads lean4export files. Bundled with Lean and run by `lake check --paranoid` and `lake comparator --paranoid`."
      },
      {
        "name": "Lean4Lean",
        "url": "https://github.com/digama0/lean4lean",
        "note": "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`."
      },
      {
        "name": "con-leche",
        "url": "https://github.com/leanprover/con-leche",
        "note": "External checker written in Lean with a machine-checked proof (in Lean) that it does not accept a proof of False. Bundled with `--paranoid`."
      },
      {
        "name": "con-ron",
        "url": "https://github.com/leanprover/con-ron",
        "note": "Close Rust port of con-leche, to guard against bugs in Lean's own compiler and runtime. Bundled with `--paranoid`."
      },
      {
        "name": "leanchecker (formerly lean4checker)",
        "url": "https://github.com/leanprover/lean4checker",
        "note": "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."
      },
      {
        "name": "Lean Kernel Arena",
        "url": "https://arena.lean-lang.org/",
        "note": "Shared test suite and scoreboard for dozens of third-party Lean checkers in many languages."
      }
    ],
    "axioms": {
      "summary": "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": {
      "summary": "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_issues": [
      {
        "date": "2026-11",
        "title": "leanchecker accepted an axiom-free proof of False built by editing compiled .olean files",
        "url": "https://github.com/leanprover/lean4/issues/16730",
        "fixed": true,
        "note": "Fixed by PR 16717. Maintainers note that this tool is not part of the recommended `lake check` procedure."
      },
      {
        "date": "2026-07",
        "title": "Kernel accepted wrong-structure projections in nested inductive types, giving an axiom-free proof of False",
        "url": "https://github.com/leanprover/lean4/issues/14576",
        "fixed": true,
        "note": "Needed a malicious metaprogram; also worked under comparator. Fixed in v4.32.2 (PR 14577)."
      },
      {
        "date": "2026-07",
        "title": "Missing kernel check on opaque declarations allowed a proof of False after an adversarial metaprogram",
        "url": "https://github.com/leanprover/lean4/issues/14484",
        "fixed": true,
        "note": "Fixed by PR 14498 (kernel now checks opaque values for free variables)."
      },
      {
        "date": "2022-08",
        "title": "Wrong result from the C++ Nat.mod on large numbers gave a proof of False by rfl",
        "url": "https://github.com/leanprover/lean4/issues/1433",
        "fixed": true
      }
    ],
    "soundness_channel": "https://github.com/leanprover/lean4/issues"
  },
  "checker_level": "green",
  "last_release": {
    "version": "v4.36.0",
    "date": "2026-11-16",
    "source": "https://github.com/leanprover/lean4/releases/tag/v4.36.0"
  },
  "last_checked": "2026-11-26",
  "attestation": "maintainer",
  "claimed_by_authors": false,
  "sources": [
    {
      "url": "https://lean-lang.org/doc/reference/4.36.0/ValidatingProofs/",
      "title": "Lean reference manual, Validating a Lean proof (v4.36.0)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://lean-lang.org/doc/reference/latest/releases/v4.32.2/",
      "title": "Lean v4.32.2 release notes (kernel soundness fix)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://github.com/leanprover/lean4/blob/v4.36.0/src/lake/Lake/CLI/Help.lean",
      "title": "lake check and lake comparator help text, listing the checkers run by --paranoid",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://github.com/leanprover/lean4/blob/master/.github/ISSUE_TEMPLATE/bug_report.md",
      "title": "Lean bug report template (asks reporters of suspected soundness bugs to use security@lean-fro.org if in doubt)",
      "accessed": "2026-11-26"
    },
    {
      "url": "https://hackmd.io/Tu2Z97xHSQilI7b91HQfAw",
      "title": "Kernel bug hunt (what counts as a Lean kernel soundness bug, and how to report it)",
      "accessed": "2026-11-26"
    }
  ],
  "computed": {
    "kind": "provers",
    "methodology_version": "0.1",
    "built": "2026-11-26",
    "links": {
      "html": "/provers/lean4/",
      "json": "/provers/lean4.json",
      "markdown": "/provers/lean4.md"
    },
    "used_by": [
      "aeneas",
      "lnsym"
    ],
    "semantics_available": [
      "evm-yul",
      "sail-arm",
      "sail-riscv"
    ]
  }
}