h5i

Appendix F

Notation and Glossary

Every symbol, judgment, and technical term used in the book, with the chapter that introduces it. Use this appendix as a reference while reading, or as a checklist of what the book covers.

Notation

Terms

Notation Meaning Chapter
Sort u\Sort{u} the universe at level uu; Sort 0\Sort{0} is the universe of propositions 2
x,y,zx, y, z variables 2
cc a constant from the signature 7
Π(x:A). B\tPi{x}{A}{B} dependent function type (Π\Pi-type) 2
A→BA \to B non-dependent function type, Π(_:A). B\tPi{\_}{A}{B} 2
λ(x:A). t\tLam{x}{A}{t} function (λ\lambda-abstraction) 2
t  st\;s application, left-associative 2
h  a1⋯anh\;a_1 \cdots a_n a spine: head hh applied to arguments 2
(x⃗:A⃗)(\vec{x} : \vec{A}), Π(x⃗:A⃗). B\tPi{\vec{x}}{\vec{A}}{B} a telescope of bindings and a Π\Pi over it 8
FV(t)\FV(t) the free variables of tt 11
t[x↦s]\subst{t}{x}{s} capture-avoiding substitution of ss for xx in tt 11
⌊t⌋E\db{t}{E} the nameless (de Bruijn) form of tt under binders EE B
?m\hole{m} a hole (metavariable) in a partial proof term 10

Judgments and relations

Notation Meaning Chapter
Γ\Gamma a context, an ordered list of assumptions x:Ax : A 3
⋅\cdot the empty context 3
dom(Γ)\dom(\Gamma) the names assumed in Γ\Gamma 3
⊢Γ;ok\ctxok{\Gamma} Γ\Gamma is well formed 3
Γ⊢t:A\Gamma \vdash t : A tt has type AA in Γ\Gamma 3
Σ\Sigma the signature of constants 7
c:C:=tc : C \mathrel{:=} t a definition with body tt 7
imax(u,v)\imax(u, v) 00 if v=0v = 0, else max⁡(u,v)\max(u, v) 3, 13
s=αts \alphaeq t alpha-equivalence 11
E1;E2⊢s=αtE_1; E_2 \vdash s \alphaeq t algorithmic alpha-equivalence under binder lists E1E_1, E2E_2 11
idx(E,x)\mathrm{idx}(E, x) position of the last xx in EE, from the right 11
t→βt′t \betared t', t→δt′t \deltared t', t→ιt′t \iotared t' beta-, delta-, iota-reduction 3, 7
t→t′t \to t' one reduction step of any kind 12
s≡ts \conv t definitional equality (conversion) 3, 12
Δ⊢φ\Delta \vdash \varphi provability in second-order propositional logic 4
φ∗\varphi^\ast, Δ∗\Delta^\ast translation of a formula, of a hypothesis list 4
⟨Γ⊢?m:T⟩\goal{\Gamma}{\hole{m}}{T} a goal: find a term of type TT in Γ\Gamma for hole mm 10

Constants of the standard kernel

Notation Type leanmini name Chapter
Nat\Nat Sort 1\Sort{1} Nat 7
zero\zero Nat\Nat Nat.zero 7
succ\suc Nat→Nat\Nat \to \Nat Nat.succ 7
Nat.recu\NatRec{u} see Figure 7.1 Nat.rec0, Nat.rec1 7
Equ\Eq{u} Π(A:Sort u). A→A→Sort 0\tPi{A}{\Sort{u}}{A \to A \to \Sort{0}} Eq 9
reflu\refl{u} Π(A:Sort u). Π(a:A). Equ  A  a  a\tPi{A}{\Sort{u}}{\tPi{a}{A}{\Eq{u}\;A\;a\;a}} Eq.refl 9
Eq.recu,v\EqRecDep{u,v} dependent eliminator, Figure 9.1 Eq.rec0, Eq.rec1 9
Eq.ndrecu,v\EqRec{u,v} non-dependent eliminator (a definition) not predeclared 9
add\add, m+nm + n Nat→Nat→Nat\Nat \to \Nat \to \Nat add (defined in scripts) 7

Algorithms

Name Role Rust Chapter
Infer(Γ,t)\Infer(\Gamma, t) compute the type of tt Kernel::infer 5
Check(Γ,t,T)\Check(\Gamma, t, T) verify t:Tt : T Kernel::check 5
InferSort(Γ,A)\InferSort(\Gamma, A) verify AA is a type, return its level Kernel::infer_sort 5
Freshen(Γ,x,b)\Freshen(\Gamma, x, b) rename a binder that would shadow Γ\Gamma rename_binder_if_needed 5
Whnf(t)\Whnf(t) weak head normal form Kernel::whnf 12
Normalize(t)\Normalize(t) full normal form Kernel::normalize 12
IsDefEq(s,t)\IsDefEq(s, t) decide s≡ts \conv t Kernel::is_def_eq 12

Glossary

Alpha-equivalence. Equality of terms up to renaming of bound variables. Decided by comparing bound variables by binder position and free variables by name. Chapter 11.

Beta-reduction. The computation step (λ(x:A). t)  s→t[x↦s](\tLam{x}{A}{t})\;s \to \subst{t}{x}{s}. Chapters 3 and 12.

Capture. The error of substituting a term under a binder that binds one of the term's free variables, changing its meaning. Avoided by renaming the binder. Chapter 11.

Confluence. The property that different orders of reduction reach the same normal form. It is what lets conversion be decided by normalizing. Chapter 12.

Consistency. No closed term has type Π(P:Sort 0). P\tPi{P}{\Sort{0}}{P}. The property that makes the kernel's acceptance meaningful. Chapters 4 and 14.

Constructor. A constant that builds values of an inductive type, such as zero\zero and succ\suc. Constructors never reduce. Chapter 7.

Context. An ordered list of typing assumptions. Chapter 3.

Conversion. See definitional equality.

Curry-Howard correspondence. Propositions are types, proofs are terms, proof checking is type checking. Chapter 1.

De Bruijn index. A representation of a bound variable by the number of binders between its occurrence and its binder, which makes alpha-equivalent terms identical. Chapter 11, Appendix B.

Definitional equality. The equivalence on terms generated by reduction and alpha-equivalence; decided by the kernel. Contrasted with propositional equality. Chapters 9 and 12.

Delta-reduction. Unfolding a defined constant into its body. Chapter 7.

Dependent function type. A Π\Pi-type whose result type may mention the argument; the type of proofs of a universal statement. Chapter 1.

Elimination (large). Using the recursor of a proposition to build data, allowed only for subsingletons. Chapter 8.

Field. An argument of a constructor other than the parameters. Chapter 8.

Goal. A context together with a type for which a term is still to be found. Chapter 10.

Impredicative. A universe that contains types quantifying over that same universe. Sort 0\Sort{0} is impredicative; higher universes are not. Chapter 13.

Index. An argument of an inductive type former that may differ between constructors, such as the length of a vector or the right side of an equation. Chapter 8.

Induction hypothesis. In a minor premise, the assumption that the motive already holds for a recursive field. Chapter 7.

Inductive type. A type specified by its constructors, from which the kernel generates a recursor and iota-rules. Chapters 7 and 8.

Iota-reduction. Running a recursor on a constructor application. Chapters 7 and 12.

Kernel. The trusted component that decides Γ⊢t:A\Gamma \vdash t : A. Everything else only produces terms for it. Chapter 1.

Major premise. The argument of a recursor whose constructor selects the iota-rule. Chapter 7.

Metavariable. Lean's name for a hole in a partial term. Chapter 10.

Minor premise. The argument of a recursor giving the case for one constructor. Chapter 7.

Motive. The function MM that gives the result type of a recursor for each element; a predicate, for induction. Chapter 7.

Neutral term. A normal term headed by a variable (or, with constants, a stuck constant). Chapter 14, Appendix D.

Normal form. A term to which no reduction step applies. Chapter 12.

Parameter. An argument of an inductive type former that is the same in every constructor, such as the element type of a list. Chapter 8.

Positivity (strict). The condition that a recursive field mentions the inductive type only as the result of a function, never as an argument. Required for termination and consistency. Chapter 8.

Predicative. A universe that does not contain types quantifying over it. Sort u\Sort{u} for u≥1u \ge 1. Chapter 13.

Proof irrelevance. Lean's rule that any two proofs of a proposition are definitionally equal. Not implemented in MiniLean4. Chapter 13.

Propositional equality. The inductive type Eq\Eq{}. Its proofs are terms; contrast with definitional equality. Chapter 9.

Recursor. The constant generated for an inductive type that expresses structural recursion and induction. Chapter 7.

Signature. The table of constants and their types, with bodies for definitions. Chapter 7.

Spine. The view of a term as a head applied to a list of arguments. Chapter 2.

Strong normalization. Every reduction sequence from a well-typed term is finite. Chapter 14.

Subject reduction. Reduction preserves types. Chapter 14.

Subsingleton. A proposition with at most one constructor whose fields are all proofs or indices; it may eliminate into any universe. Chapter 8.

Syntax-directed. A rule system in which the shape of the term determines the applicable rule. All typing rules except T-Conv. Chapter 5.

Tactic. A program outside the kernel that assigns terms to holes in a proof state. Chapter 10.

Telescope. A sequence of bindings in which later types may mention earlier variables. Chapter 8.

Transport. Moving a fact about aa to a fact about bb along a proof of a=ba = b, via the recursor of Eq\Eq{}. Chapter 9.

Universe. A type whose elements are types: Sort u\Sort{u}. Chapters 2 and 13.

Weak head normal form. The result of reducing only at the head of a term until its outermost shape is visible. Chapter 12.

What to remember

  • Terms, judgments, and algorithms each have a fixed notation used consistently throughout the book; the tables above map each to its Rust counterpart.
  • The two equalities (definitional and propositional) and the two kinds of universe (impredicative and predicative) are the distinctions to keep straight.