Lean’s Dependent Type Theory
Lean’s Type Theory: From Lambda Calculus to a Classical Axiomatic System
Lean is an interactive theorem prover and functional programming language. Its central idea is that mathematical statements, proofs, programs, and types can all be represented within one formal system. Lean’s foundation is dependent type theory, a type theory in which types may depend on values.
Understanding Lean therefore requires understanding the layers from which its system is built:
- The untyped lambda calculus, which provides a model of computation.
- Simple type theory, which assigns types to expressions.
- Dependent type theory, in which types can depend on terms.
- Universes, which organize types and prevent paradoxes.
- The Curry–Howard correspondence, which connects propositions and types.
- Inductive types, which define data structures and logical constructions.
- Definitional equality, which determines when expressions count as interchangeable.
- Classical axioms, proof irrelevance, and quotient constructions.
- Metatheoretic properties such as normalization, consistency, soundness, and decidability.
Lean is based on a classical dependent type theory. It is closely related to the Calculus of Inductive Constructions, or CIC, associated with systems such as Coq, but it is not based on homotopy type theory. In particular, Lean includes proof irrelevance and classical principles that are incompatible with univalence in homotopy type theory.
The Untyped Lambda Calculus
The untyped lambda calculus is a very small formal system designed to describe computation. It was developed by Alonzo Church and has the same computational power as Turing machines.
An expression in the lambda calculus has one of three forms:
- A variable, such as x.
- An application, written by placing two expressions next to each other, such as e1e2.
- A lambda abstraction, written λx.e, which represents a function whose parameter is x and whose body is e.
For example,
λx.xis the identity function: it takes an argument and returns that same argument.
An application such as
(λx.x)ameans that the identity function is applied to a.
Beta Reduction
The central computation rule is beta reduction:
(λx.e)a⟶e[a/x].The notation e[a/x] means that every appropriate free occurrence of x in e is replaced by a. Thus,
(λx.x)a⟶a.This operation is substitution. Substitution must respect bound variables so that a variable inside another lambda expression is not accidentally captured. For example, substitution requires care when the replacing expression contains variables that could become bound after replacement.
The reduction rules can be viewed as nondeterministic. If an expression contains several reducible applications, any one of them may be reduced first. Different reduction paths can therefore produce different intermediate expressions.
For example, an expression might reduce in one step at an outer application or in a separate step inside one of its arguments. Some reduction sequences may continue forever, while others may reach a normal form.
Confluence and the Church–Rosser Theorem
Although the lambda calculus can have multiple reduction paths, it has an important property called confluence.
If an expression e can reduce to both e1 and e2, then there is some expression e′ such that both e1 and e2 can eventually reduce to e′:
e⟶∗e1ande⟶∗e2imply
e1⟶∗e′ande2⟶∗e′.Here, ⟶∗ means zero or more reduction steps.
This is the Church–Rosser theorem. It says that different choices of reduction order do not lead to permanently incompatible results. The system may fail to terminate, but if two reduction paths eventually reach normal forms, those normal forms agree.
Different evaluation strategies restrict which reduction is performed first. Examples include call-by-value and call-by-name. The unrestricted theory considers all possible reductions.
Key idea: Confluence guarantees agreement between successful reduction paths, but it does not guarantee that every reduction path terminates.
Think About It
Why can a computation still be useful if a formal system permits infinitely long reduction sequences? The important distinction is between the existence of some infinite paths and the behavior of the particular terms used in a program or proof.
Adding Simple Types
The untyped lambda calculus allows every expression to be applied to every other expression, including nonsensical applications such as applying a number to a function. Simple type theory restricts this by assigning types to expressions.
A basic simply typed system contains:
- Function types, such as α→β.
- At least one base type, represented here by ι.
The base type is needed so that the theory contains some type at all. Without any primitive type, there would be no initial type from which to construct function types.
A lambda expression now carries a type annotation:
λx:α.e.This means that x is assumed to have type α.
Typing Contexts
Typing judgments have the general form
Γ⊢e:τ,which means that, under the assumptions recorded in context Γ, expression e has type τ.
A context is a collection of variable declarations, such as
Γ=x:α,y:β.The context records the types that are available for variables.
The Variable Rule
The variable rule says that a variable may be assigned the type recorded for it in the context:
Γ⊢x:τx:τ∈Γ.In words, if the context contains the assumption that x has type τ, then x has type τ under that context.
The Application Rule
Suppose e1 is a function from α to β and e2 has type α:
Γ⊢e1:α→βΓ⊢e2:α.Then the application e1e2 has type β:
Γ⊢e1e2:βΓ⊢e1:α→βΓ⊢e2:α.The argument type must match the function’s domain. This is the basic mechanism by which the type checker rejects invalid applications.
The Lambda Rule
A lambda expression has a function type. If, after assuming that x has type α, the body e has type β, then the lambda has type α→β:
Γ⊢λx:α.e:α→βΓ,x:α⊢e:β.For example, the identity function has type
λx:α.x:α→α.The body x has type α because the context contains x:α.
Strong Normalization
Simple typing eliminates certain nonterminating expressions that exist in the untyped lambda calculus. In particular, expressions such as the Y combinator do not receive valid simple types.
As a result, every well-typed term in the simply typed lambda calculus eventually reduces to a normal form. This property is called strong normalization.
Strong normalization is valuable because it ensures that well-typed computations cannot unfold forever. A type system can therefore act as a termination guarantee for the terms it accepts.
Key idea: Simple types do more than classify expressions. They restrict computation strongly enough to rule out certain infinite computations.
Dependent Function Types
Simple function types have the form
α→β.The result type β is fixed and cannot refer to the particular input. Dependent type theory generalizes this by allowing the result type to depend on the argument.
A dependent function type is written
∀x:α,β(x),or, using the traditional notation,
Πx:α,β(x).The symbol Π is commonly called the dependent product or Pi type. The source uses “forall” and “Pi” interchangeably in this setting.
The essential difference is that β may contain x. For example, the result type might describe a vector whose length is exactly the input number.
When the result does not depend on x, the dependent function type reduces to an ordinary function type:
∀x:α,βbehaves like
α→β.Dependent Application
For an ordinary function, applying a function of type α→β to an argument of type α produces an expression of type β.
For a dependent function, the result type must be specialized to the actual argument. If
e1:∀x:α,β(x)and
e2:α,then
e1e2:β(e2).The type β(x) is obtained by substituting the argument e2 for x.
Dependent Lambda Abstraction
The lambda rule also becomes dependent. If assuming x:α allows the body e to have type β(x), then
λx:α.ehas type
∀x:α,β(x).This makes it possible for a function to compute not only a value but also information about the type of its result.
Type-Level Computation
Dependent type theory allows expressions to occur in types. Consequently, computation can occur at the type level.
A function may take a type as an argument and return another type. For example, a polymorphic identity function should work for every type. To express this, the function must quantify over a variable whose value is itself a type.
That requires a type of types.
Universes and the Type Hierarchy
A naive system might introduce a single type called Type and assert
Type:Type.This is inconsistent. It enables a version of Russell’s paradox, leading to the conclusion that every proposition is inhabited, meaning that every proposition is provable. Such a system would no longer distinguish truth from falsehood.
Universe Levels
Lean avoids this circularity with a hierarchy of universes:
U0:U1,U1:U2,…More generally,
Un:Un+1.A universe at one level is itself an object in the next higher universe, but it is not an object of itself. This prevents the self-reference that causes the paradox.
Lean’s universe levels are not merely ordinary natural-number labels. They can contain universe expressions involving operations such as imax and universe variables. This supports definitions that are polymorphic over universe levels.
Universe Levels of Pi Types
If the domain lies in universe Um and the codomain lies in universe Un, then the corresponding dependent function type normally lies in a universe determined by the larger level.
A simple version would use
max(m,n).However, propositions receive special treatment, so Lean uses a modified operation called imax. It behaves like maximum except when the codomain universe is U0:
imax(m,0)=0,while for positive codomain levels it behaves like the appropriate maximum.
This special behavior is connected to the impredicativity of the universe of propositions.
The Curry–Howard Correspondence
The Curry–Howard correspondence identifies propositions with types and proofs with terms.
Under this correspondence:
- A proposition is represented as a type.
- A proof of that proposition is an element of the type.
- A proposition is true when its type is inhabited.
- A proposition is false when its type is empty.
- A function from proofs of P to proofs of Q represents an implication P→Q.
- A dependent function represents universal quantification.
For example, a term of type
P→Qis a function that transforms a proof of P into a proof of Q. This is why the function arrow corresponds to material implication.
Similarly, a term of type
∀x:α,P(x)is a construction that gives a proof of P(x) for every x:α.
The Universe of Propositions
Lean treats propositions as belonging to a special lowest universe, commonly denoted
Prop=U0.A proposition is therefore a type in U0.
For example, natural numbers may belong to a higher universe such as U1, while a proposition about natural numbers initially belongs to U0. Without the special universe rule, combining a proposition with natural numbers could force the resulting proposition into U1.
The imax rule prevents that elevation when the result is still a proposition. Thus a statement such as
∀n:N,Even(n)∨Odd(n)remains a proposition in Prop rather than becoming an ordinary higher-universe type.
This feature is called impredicativity. Informally, impredicativity allows a proposition to quantify over a collection that includes propositions, while still remaining in the universe of propositions.
Key idea: Universes prevent paradoxes, while impredicative Prop allows logical statements to remain propositions even when they quantify over objects from higher universes.
Think About It
Why is an empty type a natural representation of a false proposition? If a proposition has no inhabitants, then there is no term that can serve as a proof of it.
Definitional Equality and Convertibility
Dependent types create a subtle problem. Two types may compute to the same result even when they are not written identically.
For example, suppose an identity function is applied to a type τ:
(λx:U.x)τ.This expression is not textually identical to τ, but beta reduction shows that it computes to τ:
(λx:U.x)τ⟶τ.Without a notion of convertibility, Lean might reject an application whose function expects an argument of type (λx.x)τ even though that type computes to τ.
Lean therefore uses a definitional equality or convertibility judgment. If types α and β are definitionally equal, then an expression of type α may be used where an expression of type β is expected.
Definitional equality is not ordinary proved equality. It is built into type checking and is determined by the computational and structural rules of the theory.
Rules for Definitional Equality
Definitional equality has the usual properties of an equivalence relation:
- Reflexivity: α is definitionally equal to itself.
- Symmetry: if α is definitionally equal to β, then β is definitionally equal to α.
- Transitivity: if α is definitionally equal to β and β is definitionally equal to γ, then α is definitionally equal to γ.
It also has compatibility rules. If corresponding components of larger expressions are definitionally equal, then the larger expressions are definitionally equal as well.
For example, if α is definitionally equal to α′ and β is definitionally equal to β′, then the corresponding function types are definitionally equal.
Beta and Eta Equality
The beta rule is the ordinary function-computation rule:
(λx.e)a≡e[a/x].The eta rule expresses extensionality for functions. If x does not occur freely in e, then
λx.ex≡e.The eta rule says that a function that merely takes an argument and passes it to e is definitionally the same as e itself.
Algorithmic Type Checking
The ideal definitional equality relation of the full theory is problematic: with all of Lean’s features combined, it is not decidable in general. That means there is no algorithm guaranteed to answer every definitional-equality question correctly and terminate.
Lean therefore uses an algorithmic typing judgment that underapproximates the ideal rules. The algorithm may reject an expression that is theoretically well typed because it declines to perform an extremely difficult or potentially nonterminating computation.
This practical approximation can produce a relation that is not fully transitive. In unusual cases, Lean may recognize one definitional-equality step and another separate step without recognizing the combined path.
Identity functions can sometimes expose the smaller steps:
idγ(idβ(e)).The additional layers can guide the elaborator or type checker through conversions that it could not recognize as one large conversion.
However, these identity functions may act as computational blockers until they are unfolded carefully. In practical developments, ordinary propositional equality is often preferred when relying on definitional equality becomes fragile. Ordinary equality is proved and transported explicitly, while definitional equality is silently used by the type checker.
Subject Reduction
A typical type theory has subject reduction: if a well-typed term reduces, its reduct remains well typed. In the behavior discussed here, Lean’s virtual machine can evaluate terms in ways that do not directly preserve the formal typing discipline at every intermediate stage.
This makes the relationship between Lean’s kernel-level theory and its virtual-machine evaluation behavior particularly subtle.
Inductive Types
The next major feature is the ability to define inductive types. An inductive type is generated by constructors and is understood as the smallest type closed under those constructors.
The natural numbers are the fundamental example:
- 0 is a natural number.
- If n is a natural number, then succ(n) is a natural number.
Symbolically, the natural numbers can be viewed as the fixed point of a type expression resembling
T↦1+T,where the first alternative supplies zero and the second supplies a successor of an existing element.
The constructors are therefore
zero:Nand
succ:N→N.The phrase “freely generated” means that natural numbers contain exactly the objects generated from zero and successor, without adding unrelated elements.
Logical Inductive Types
Inductive definitions can represent logical connectives.
Existential Quantification
An existential proposition can be represented by a constructor that takes:
- A witness x.
- A proof that P(x) holds.
The constructor then produces a proof of
∃x,P(x).Because the type is generated by such witnesses, reasoning about an existential proof can proceed by examining its witness and its accompanying proof.
Conjunction
Conjunction has a constructor requiring both proofs:
P→Q→P∧Q.An inhabitant of P∧Q therefore contains a proof of P and a proof of Q.
Disjunction
Disjunction has two constructors:
P→P∨Qand
Q→P∨Q.An inhabitant records which side was supplied.
False and True
False is an inductive proposition with no constructors. Since there is no way to construct an element of it, it has no proofs.
True is an inductive proposition with exactly one constructor. That constructor supplies the unique proof of truth.
Recursors and Induction
Every inductive type generates not only its type and constructors but also a recursor. A recursor is a general mechanism for defining functions out of the inductive type.
For natural numbers, suppose there is a dependent family C(n) describing the desired output type for each natural number. If there is:
- An element of C(0).
- A way to produce an element of C(succ(n)) from an element of C(n).
Then there is an element of C(n) for every natural number n.
The recursor therefore captures both primitive recursion and mathematical induction.
Its computation rules state that:
- The recursor applied to zero reduces to the base case.
- The recursor applied to a successor reduces to the step function applied to the predecessor and the recursively computed result.
Schematically,
rec(0)=c0and
rec(succ(n))=csn(rec(n)).When the result family lies in Prop, this recursor gives the ordinary induction principle for natural numbers, corresponding to the Peano induction axiom.
Key idea: An inductive type is defined by its constructors, and its recursor is what makes computation and induction possible.
Think About It
Why must an inductive type be the smallest type closed under its constructors? Without minimality, the type could contain arbitrary extra elements that do not arise from the intended data-generation process.
Strict Positivity
Inductive definitions cannot be completely unrestricted. Lean requires inductive specifications to be strictly positive.
Very roughly, the type being defined may not appear negatively inside a constructor argument. In particular, it cannot occur on the left side of the left side of an arrow in a way that allows the type to refer to itself contravariantly.
This restriction is needed for consistency. If arbitrary recursive occurrences were allowed, one could define a problematic type such as a type that contains functions from itself to a two-element type. Such a definition would yield an injection from the powerset of the type into the type itself, contradicting Cantor’s theorem.
Because Cantor’s theorem is provable, that contradiction would make the entire system inconsistent. Strict positivity prevents the problematic construction.
Inductive Families and Equality
An inductive family is an inductive type indexed by values. Equality is defined in this way.
For a fixed value x, equality at x has a constructor
reflx:x=x.There is no primitive constructor directly producing an equality proof between arbitrary different values. Equality is generated from reflexivity.
The recursor for equality expresses the substitution principle:
If x=y and a property or type family C holds at x, then it holds at y.
This is the formal foundation for replacing equals by equals in dependent contexts.
Proof Irrelevance and Elimination Restrictions
Proof irrelevance says that proofs of propositions are treated as indistinguishable. If p and q are both elements of the proposition universe, then they are definitionally equal in the relevant sense:
p≡q.This means that the identity of a proof object is ignored. Only the fact that the proposition is inhabited matters.
Proof irrelevance conflicts with the principles of homotopy type theory, especially univalence. Under univalence, certain equality types can have multiple unequal inhabitants. Proof irrelevance instead collapses proofs of propositions, so assuming both principles leads to inconsistency.
Subsingletons
A subsingleton is a type with at most one element. If an inductive proposition has at most one possible inhabitant, then treating its proofs as equal does not lose meaningful information.
However, not every proposition may be eliminated into arbitrary higher types. If an inductive proposition has multiple constructors or multiple ways to carry computational data, unrestricted elimination could allow proof information to be extracted in ways that conflict with proof irrelevance.
A small-eliminating proposition can be eliminated only into propositions.
A subsingleton-eliminating proposition may be eliminated into higher universes when its structure guarantees that it has at most one meaningful inhabitant. Equality is an important example: although equality lies in Prop, its recursor can eliminate into arbitrary universes.
The accessibility predicate used to express well-foundedness is another important example discussed in this context. Its structure permits elimination into higher types because its nonrecursive arguments satisfy the relevant restrictions.
Additional Axioms and Classical Reasoning
Lean’s core type theory can be extended with axioms: terms introduced at specified types without computational interpretations.
Propositional Extensionality
Propositional extensionality states that propositions are equal when they imply each other.
If there are terms of types
P→Qand
Q→P,then P and Q are identified as equal propositions:
P=Q.This allows substitution of one proposition for the other in any context. It is weaker than full univalence but resembles a limited extensionality principle for the lowest universe.
Quotient Types
A quotient identifies elements according to an equivalence relation R. Instead of freely generating a type from constructors, a quotient generates it subject to the additional rule that related elements are identified.
A quotient typically provides:
- A map placing elements into the quotient.
- A lifting operation for defining functions out of the quotient.
- A condition requiring the target function to respect the relation.
If a and b satisfy R(a,b), then a function defined on the quotient must assign them equal results.
Quotients are not simply propositions. The quotient of a type by the total relation produces a propositional-truncation-like object, but it need not have the same proof-irrelevance behavior as a proposition in Prop.
Nonemptiness and Choice
For a type α, the proposition Nonempty(α) can be defined with a constructor of type
α→Nonempty(α).This proposition records only that some element of α exists; it does not provide a computationally accessible element in the same way that an ordinary term of type α does.
The axiom of choice supplies the reverse direction:
Nonempty(α)→α.This principle has no computational interpretation in the system under discussion. It is introduced to support classical mathematics. Together with the other classical principles, it yields the law of excluded middle, making Lean’s logic fully classical.
Undecidability of Definitional Equality
A surprising consequence of combining Lean’s features is that the ideal type system is not decidable in general.
The problematic combination involves:
- Proof irrelevance.
- Subsingleton elimination.
- Recursive inductive propositions.
- Definitional equality.
Accessibility
Consider an accessibility predicate Acc<(x), expressing that x is accessible with respect to a relation <. Its constructor says, informally:
If every y<x is accessible, then x is accessible.
This captures well-foundedness: elements are reachable from the bottom by repeatedly moving to smaller elements.
Because of the way its recursive argument appears, accessibility can be eliminated into arbitrary universes. Its recursor can therefore be used computationally even though accessibility is a proposition.
The crucial issue is that the proof of accessibility can be unfolded repeatedly without consuming a separate computational resource. A recursive proof object can effectively contain a route back to itself.
Encoding a Nondecidable Property
Suppose P(n) is a decidable proposition for each individual natural number n, but the statement
∀n,P(n)is not decidable. A typical example concerns whether a particular computation halts within n steps: each finite case can be checked, while the universal statement may not be decidable.
Under an inconsistent assumption such as a proof that a particular starting point is accessible with respect to a descending relation, one can define a function that:
- Tests P(n).
- Moves to the next natural number if P(n) holds.
- Returns zero when P(n) fails.
Repeated reduction then searches through the values of P.
If every P(n) holds, the computation continues indefinitely. If some P(n) fails, the computation eventually reduces to zero. Thus a definitional-equality question can encode the nondecidable statement
∃n,¬P(n)or, equivalently, the failure of
∀n,P(n).The inconsistent assumption can be abstracted away with lambda abstraction, so the issue is not limited to an explicitly contradictory local context. The resulting definitional-equality problem remains equivalent to a nondecidable proposition.
Practical Consequences
Lean’s actual type-checking algorithm does not attempt to solve every ideal definitional-equality problem. It uses an underapproximation that may reject some theoretically valid conversions.
An alternative would be a semidecision procedure: it could keep reducing, eventually finding a proof of equality when one exists, but potentially run forever when equality does not hold.
To recover full decidability, one possible approach would be to restrict or remove subsingleton elimination, especially for recursive propositions such as accessibility. Equality might be treated more permissively because it lacks the same recursive structure. Such restrictions could preserve more practical behavior while preventing the nonterminating reduction mechanism.
A Set-Theoretic Model
Lean’s type theory admits a natural interpretation in set theory.
Under this interpretation:
- A type is interpreted as a set.
- A term of that type is interpreted as an element of the set.
- A dependent function type is interpreted as a set of dependent functions.
- A proposition is interpreted as either the empty set or a singleton set.
Because of proof irrelevance and classical principles, the model of Prop has only two possibilities:
- The empty set, representing false.
- A singleton set, representing true.
Different proofs of the same true proposition are therefore interpreted as the same element.
Higher universes must be interpreted by very large sets closed under the relevant type-forming operations, including function types and inductive constructions. These are modeled using Grothendieck universes, associated with inaccessible cardinal assumptions.
Soundness
The soundness theorem states, in simplified form, that if
Γ⊢e:α,then the interpretation of e is an element of the interpretation of α.
If two expressions are definitionally equal, then their interpretations are equal in the ordinary set-theoretic sense.
Soundness implies consistency: the system cannot prove a proposition whose interpretation is empty.
Unique Typing
Lean also has a unique typing property. If an expression has two types,
Γ⊢e:αandΓ⊢e:β,then the two types are definitionally equal:
α≡β.This property ensures that an expression belongs to one well-defined universe level rather than several unrelated ones.
Lean’s lack of universe cumulativity helps preserve this result. In a cumulative system such as Coq’s universe treatment, a type may be viewed as belonging to higher universes through a subtyping-like relation without those universe levels being definitionally equal. The corresponding unique-typing statement is therefore more complicated.
What Cannot Generally Be Proved
The system has limits on what can be established internally.
Heterogeneous Equality
Heterogeneous equality compares terms that may have different types. A known limitation is that application does not generally preserve heterogeneous equality in the way it preserves ordinary homogeneous equality.
Equality of Types
It is generally difficult to prove that two types are unequal. For example, one cannot generally prove that Z and N are unequal merely from their definitions, nor can one prove that two separately declared but structurally identical copies of the natural numbers are unequal.
The two types may be shown to be isomorphic, but isomorphism is weaker than equality.
A reliable way to distinguish types is by cardinality. If two types have different cardinalities, they cannot be equal, because equality would preserve their cardinality. Apart from such structural differences, the theory may not provide enough information to prove that two types are distinct.
Virtual-Machine Evaluation and Type Erasure
Lean’s virtual machine does not always evaluate terms exactly according to the kernel’s formal reduction relation.
For example, when a term contains casts between types, the virtual machine may ignore those casts rather than fully reducing the corresponding equality recursors. During evaluation, it may therefore pass through intermediate representations that are not formally well typed in the strict kernel sense, while still producing the correct final result.
This behavior motivates a type-erasure map: a translation that removes type information and retains the computational content. A useful theory of erasure would explain why removing types preserves the result of execution.
Such a theory would also help justify virtual-machine overrides, in which one implementation is replaced by another implementation in the VM. The replacement should preserve observable computation.
Open Metatheoretic Questions
Several properties remain important goals for a complete understanding of Lean’s theory:
- A full proof of strong normalization for the complete system.
- A precise account of the VM’s evaluation behavior.
- A formal theory of type erasure.
- A formal correctness criterion for VM overrides.
- A complete treatment of the relationship between algorithmic reduction and ideal definitional equality.
A restricted algorithmic reduction relation is expected to be strongly normalizing because it stops before reaching the problematic forms of unrestricted reduction. The challenge is to relate that practical relation rigorously to Lean’s full axiomatic system.
Comprehensive Review
Lean is built from the lambda calculus, but its type system transforms the computational foundation into a system for both programming and proving.
- The untyped lambda calculus supplies variables, application, abstraction, substitution, and beta reduction.
- Confluence, expressed by the Church–Rosser theorem, ensures that different successful reduction paths can be joined.
- Simple types restrict invalid applications and provide strong normalization.
- Dependent function types allow result types to depend on input values.
- Universes organize types into levels and prevent the paradox caused by Type:Type.
- Impredicative Prop keeps logical statements in the proposition universe even when they quantify over higher-level objects.
- The Curry–Howard correspondence identifies propositions with types and proofs with inhabitants.
- Definitional equality lets Lean treat expressions as interchangeable when they compute or reduce to the same form.
- Inductive types define data and logical constructions through constructors.
- Recursors provide computation and induction principles for inductive types.
- Strict positivity prevents inconsistent self-referential inductive definitions.
- Proof irrelevance identifies proofs of propositions and explains restrictions on eliminating propositions into computational types.
- Propositional extensionality, quotient types, and choice support classical mathematical reasoning.
- The interaction of recursive propositions, proof irrelevance, and subsingleton elimination creates undecidability in ideal definitional equality.
- Lean therefore uses an algorithmic approximation in practice.
- A set-theoretic model supports soundness and consistency, while unique typing ensures that types have coherent universe levels.
- Lean’s virtual machine adds a separate computational layer involving casts, erasure, and evaluation that is not identical to kernel reduction.
The central lesson is that Lean’s power comes from combining computation and logic in one typed language. That same combination creates delicate metatheoretic tradeoffs: richer dependent types provide expressive proofs and programs, while convertibility, proof irrelevance, classical axioms, and recursive elimination complicate normalization and decidability.

Ask anything
We've read this whole study set, so questions about it get the best answers.