Lean 4 is a functional programming language and interactive proof assistant used to formalize mathematics and verify software correctness. It functions as a dependent type theorem prover and a formal verification tool that allows users to construct mathematical proofs and ensure program correctness. Additionally, it serves as a logic-based source for generating verified datasets used to train and benchmark artificial intelligence reasoning systems.
The system distinguishes itself through a small-kernel verification model, where all proofs are verified by a trusted core of basic logical rules. It employs a tactic-based approach to automate proof construction and supports the creation of modular mathematical libraries for collaborative development. The environment also includes capabilities for literate programming, combining formal proofs with informal prose for scientific documentation.
The project covers a broad range of capabilities, including formal software verification for distributed protocols and program semantics, as well as general-purpose functional programming with monadic effect management. It provides tools for automated reasoning, counterexample generation, and differential testing to ensure systems behave exactly as specified.
The language is designed for efficiency with pure functional compilation and reference-counting memory management, and it can be executed directly within a web browser.