Reproduce “Lean4Lean: Verifying a Typechecker for Lean, in Lean” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Mario Carneiro

An independent typechecker for Lean 4, implemented in Lean itself, has been developed to provide a verifiable alternative to the C++ kernel. This implementation successfully validated large projects including Mathlib and identified a soundness bug in the existing production kernel.

Key insights

  • The process of formal verification can uncover subtle, exploitable soundness bugs in production theorem prover kernels, as demonstrated by the integer overflow bug found.
  • Even sophisticated type theories like Lean's present significant theoretical challenges for proving fundamental structural properties such as unique typing and strengthening.
  • Implementing core components of a proof assistant within its own language creates a "whitebox" understanding, enhancing transparency and enabling deeper introspection for users and developers.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.