Lean (proof assistant)
Lean is a proof assistant and a functional programming language. It is based on the calculus of constructions with inductive types (specifically, the Calculus of Inductive Constructions), the foundational type theory developed with the Coq theorem prover, which was renamed to Rocq in 2024. It is a free and open-source software project hosted on GitHub. Development is currently supported by the nonprofit Lean Focused Research Organization (FRO). Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
Lean is a proof assistant and a functional programming language. It is based on the calculus of constructions with inductive types (specifically, the Calculus of Inductive Constructions), the foundational type theory developed with the Coq theorem prover, which was renamed to Rocq in 2024. It is a free and open-source software project hosted on GitHub. Development is currently supported by the nonprofit Lean Focused Research Organization (FRO). ==Examples (Lean 4)== The natural numbers can be defined as an inductive type. This definition is based on the Peano axioms and states that every natural number is either zero or the successor of some other natural number. inductive Nat : Type | zero : Nat | succ : Nat → Nat Addition of natural numbers can be defined recursively, using pattern matching. def Nat.add : Nat → Nat → Nat | n, Nat.zero => n -- n + 0 = n | n, Nat.succ m => Nat.succ (Nat.add n m) -- n + succ(m) = succ(n + m) This is a simple proof of (P \wedge Q) \implies (Q \wedge P) for two propositions and (where is the conjunction and \implies the implication) in Lean using tactic mode: theorem and_swap (p q : Prop) : p ∧ q → q ∧ p := by intro h -- assume p ∧ q with proof h, the goal is q ∧ p apply And.intro -- the goal is split into two subgoals, one is q and the other is p · exact h.right -- the first subgoal is exactly the right part of h : p ∧ q · exact h.left -- the second subgoal is exactly the left part of h : p ∧ q This same proof in term mode: theorem and_swap (p q : Prop) : p ∧ q → q ∧ p := fun ⟨hp, hq⟩ => ⟨hq, hp⟩ The theorem can also be proved using the grind tactic, which uses techniques from SMT solvers to automatically construct proofs: theorem and_swap (p q : Prop) : p ∧ q → q ∧ p := by grind ==See also== Dependent type List of proof assistants mimalloc Type theory ==References== --> ==External links== Lean Community Lean FRO The Natural Number Game - an interactive tutorial to learn Lean Moogle.ai - a semantic search engine for finding theorems in mathlib
Cite this
"Lean (proof assistant)". 1789237716. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1374563227 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy