Context
Type theory
Foundations
foundations
The basis of it all
-
mathematical logic
-
deduction system, natural deduction, sequent calculus, lambda-calculus, judgment
-
type theory, simple type theory, dependent type theory
-
collection, object, type, term, set, element
-
equality, judgmental equality, typal equality
-
universe, size issues
-
higher-order logic
Set theory
Foundational axioms
Removing axioms
Contents
Idea
Book HoTT is the dependent type theory which appears in the HoTT book. It is notable in that, unlike most other dependent type theories which have been formally written in natural deduction, it does not have a separate type judgment. Instead, it only has term judgments, and an infinite sequence of Russell universes indexed by a natural numbers primitive. Types are represented by terms of a Russell universe.
However, when formally defining the natural numbers primitive, in order to ensure that the dependent type theory does not have a separate type judgment, one has to define the natural numbers primitive in a separate layer, meaning that formal book HoTT is a layered type theory. There are many different ways to define the layer containing the natural numbers primitive:
The presentation of formal book HoTT we have chosen is a type theory with judgments for contexts
- , that is a context
Universe levels and Peano arithmetic
Then we have judgments for universe levels and predicate logic:
-
, that is a universe level,
-
, that is a proposition,
-
, that is a true proposition,
and the formal signature and inference rules of first-order Heyting arithmetic or Peano arithmetic.
These rules ensure that there are an infinite number of indices, which are strictly ordered with strict total order and upwardly unbounded, where is true for all indices .
Typing judgments and Russell universes
Now, we introduce the typing judgment , which says that is a term of the type . Instead of type judgments, we introduce a special kind of type called a Russell universe, whose terms are the types themselves. Russell universes are formalized with the following rules:
In addition, we have rules for contexts which state that one could add typing judgments to the list of contexts:
Structural rules
There are three structural rules in dependent type theory, the variable rule, the weakening rule, and the substitution rule.
The variable rule states that we may derive a typing judgment if the typing judgment is in the context already:
Let be any arbitrary judgment. Then we have the following rules:
The weakening rule:
The substitution rule:
The weakening and substitution rules are admissible rules: they do not need to be explicitly included in the type theory as they could be proven by induction on the structure of all possible derivations.
Structural rules for judgmental equality
Judgmental equality has its own structural rules: introduction rules for judgmentally equal terms, reflexivity, symmetry, transitivity, the principle of substitution, and the variable conversion rule.
-
Introduction rules for judgmentally equal terms
-
Reflexivity of judgmental equality
-
Symmetry of judgmental equality
-
Transitivity of judgmental equality
-
Principle of substitution:
-
Variable conversion rule:
We also have a rules saying that equality is preserved across universe levels:
Dependent product types
- Formation rules for dependent product types:
- Introduction rules for dependent product types:
- Elimination rules for dependent product types:
- Computation rules for dependent product types:
- Uniqueness rules for dependent product types:
Dependent sum types
- Formation rules for dependent sum types:
- Introduction rules for dependent sum types:
- Elimination rules for dependent sum types:
- Computation rules for dependent sum types:
- Uniqueness rules for dependent sum types:
Sum types
- Formation rules for sum types:
- Introduction rules for sum types:
- Elimination rules for sum types:
- Computation rules for sum types:
Empty type
- Formation rules for the empty type:
- Elimination rules for the empty type:
Unit type
- Formation rules for the unit type:
- Introduction rules for the unit type:
- Elimination rules for the unit type:
- Computation rules for the unit type:
Natural numbers
-
Formation rules for the natural numbers:
-
Introduction rules for the natural numbers:
-
Elimination rules for the natural numbers:
-
Computation rules for the natural numbers:
Identity types
There is another version of equality in book HoTT, called typal equality. Typal equality is represented by the identity type.
-
Formation rule for identity types:
-
Introduction rule for identity types:
-
Elimination rule for identity types:
-
Computation rules for identity types:
Univalence
Given types and , a function is an equivalence of types if the fiber of at each element of has exactly one element. The property of the type having exactly one element is represented by the isContr modality which states that the type is contractible. The fiber of at an element is given by the type
We formally define the property of being a one-to-one correspondence or an equivalence of types as the type:
We define the type of equivalences from to as
There is a function
which is inductively defined on reflexivity to be the identity function on
The univalence axiom then states that is an equivalence for all external natural numbers and types and :
Related pages
Some of the kinds of inductive definitions mentioned in the HoTT Book are:
See also
References