nLab higher inductive type

Contents

Context

Type theory

natural deduction metalanguage, practical foundations

  1. type formation rule
  2. term introduction rule
  3. term elimination rule
  4. computation rule

type theory (dependent, intensional, observational type theory, homotopy type theory)

syntax object language

computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory

logiccategory theorytype theory
trueterminal object/(-2)-truncated objecth-level 0-type/unit type
falseinitial objectempty type
proposition(-1)-truncated objecth-proposition, mere proposition
proofgeneralized elementprogram
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
cut elimination for implicationcounit for hom-tensor adjunctionbeta reduction
introduction rule for implicationunit for hom-tensor adjunctioneta conversion
logical conjunctionproductproduct type
disjunctioncoproduct ((-1)-truncation of)sum type (bracket type of)
implicationinternal homfunction type
negationinternal hom into initial objectfunction type into empty type
universal quantificationdependent productdependent product type
existential quantificationdependent sum ((-1)-truncation of)dependent sum type (bracket type of)
equivalencepath space objectidentity type/path type
equivalence classquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
presettype without identity types
completely presented setdiscrete object/0-truncated objecth-level 2-type/set/h-set
setinternal 0-groupoidBishop set/setoid
universeobject classifiertype of types
modalityclosure operator, (idempotent) monadmodal type theory, monad (in computer science)
linear logic(symmetric, closed) monoidal categorylinear type theory/quantum computation
proof netstring diagramquantum circuit
(absence of) contraction rule(absence of) diagonalno-cloning theorem
synthetic mathematicsdomain specific embedded programming language

homotopy levels

semantics

Induction

Contents

Idea

Higher inductive types (HITs) are a generalization of inductive types which allow the constructors to produce, not just points of the type being defined, but also elements of its iterated identity types.

While HITs are already useful in extensional type theory, they are most useful and powerful in homotopy type theory, where they allow the construction of cell complexes, homotopy colimits, truncations, localizations, and many other objects from classical homotopy theory.

Defining what a HIT is “in general” is an open research problem. One mostly precise proposal may be found in (ShulmanLumsdaine16). A more syntactic description of a class of HITs may be found in (Brunerie16). A solution to this problem should determine how to define the concept of an elementary (∞,1)-topos.

See also higher inductive type.

Examples

All higher inductive types described below are given together with some pseudo-Coq code, which would implement that HIT if Coq supported HITs natively.

The circle

The circle type is:

Inductive circle : Type :=
| base : circle
| loop : base == base.

Using the univalence axiom, one can prove that the loop space base == base of the circle type is equivalent to the integers.

(Licata & Shulman 13, Bezem, Buchholtz, Grayson & Shulman 19).

The interval

The homotopy type of the interval can be encoded as

Inductive interval : Type :=
| zero : interval
| one : interval
| segment : zero == one.

See interval type. The interval can be proven to be contractible. On the other hand, if the constructors zero and one satisfy their elimination rules definitionally, then the existence of an interval type implies function extensionality; see this blog post. The interval can be defined as the -1-truncation of the booleans; see here:

Inductive interval : Type :=
| inj : boolean -> interval
| contr0 : forall (p q : interval) p == q

Or more directly:

Inductive interval : Type :=
| zero : interval
| one : interval
| contr0 : forall (p q : interval) p == q

The 2-sphere

Similarly the homotopy type of the 2-dimensional sphere

Inductive sphere2 : Type :=
| base2 : sphere2
| surf2 : idpath base2 == idpath base2.

Suspension

Inductive susp (X : Type) : Type :=
| north : susp X
| south : susp X
| merid : X -> north == south.

This is the unpointed suspension. It is also possible to define the pointed suspension. Using either one, we can define the nn-sphere by induction on nn, since S n+1S^{n+1} is the suspension of S nS^n.

Mapping cylinders

The construction of mapping cylinders is given by

Inductive cyl {X Y : Type} (f : X -> Y) : Y -> Type :=
| cyl_base : forall y:Y, cyl f y
| cyl_top : forall x:X, cyl f (f x)
| cyl_seg : forall x:X, cyl_top x == cyl_base (f x).

Using this construction, one can define a (cofibration, trivial fibration) weak factorization system for types.

Truncation

Inductive is_inhab (A : Type) : Type :=
| inhab : A -> is_inhab A
| inhab_path : forall (x y: is_inhab A), x == y.

This is the (-1)-truncation into h-propositions. One can prove that is_inhab A is always a proposition (i.e. (1)(-1)-truncated) and that it is the reflection of AA into propositions. More generally, one can construct the (effective epi, mono) factorization system by applying is_inhab fiberwise to a fibration.

Similarly, we have the 0-truncation into h-sets:

Inductive pi0 (X:Type) : Type :=
| cpnt : X -> pi0 X
| pi0_axiomK : forall (l : Circle -> pi0 X), refl (l base) == map l loop.

We can similarly define nn-truncation for any nn, and we should be able to define it inductively for all nn at once as well.

See at n-truncation modality.

Quotients of types

The quotient of a pure or Type-valued equivalence relation:

Inductive quotient (A : Type) (R : A -> A -> Type) : Type :=
| proj : A -> quotient A R
| relate : forall (x y : A), R x y -> proj x == proj y

This definition is translated into Coq from the Cubical Agda library.

Disjunctions

The disjunction of two types AA and BB, yielding an hProp:

Inductive disjunction (A B:Type) : Type :=
| inl : A -> disjunction A B
| inr : B -> disjunction A B.
| contr0 : forall (p q : disjunction A B) p == q

Existential quantifiers

The existential quantifier of a type AA and a type family B:ATypeB:A \to Type, yielding an hProp:

Inductive existquant (A:Type) (B:A->Type) : Type :=
| exist : forall (x:A), B x -> existquant A B
| contr0 : forall (p q : existquant A B) p == q

Quotients of sets

The quotient of an hProp-value equivalence relation, yielding an hSet (a 0-truncated type):

Inductive quotient (A : Type) (R : A -> A -> hProp) : Type :=
| proj : A -> quotient A R
| relate : forall (x y : A), R x y -> proj x == proj y
| contr1 : forall (x y : quotient A R) (p q : x == y), p == q.

This is already interesting in extensional type theory, where quotient types are not always included. For more general homotopical quotients of “internal groupoids” as in the (∞,1)-Giraud theorem, we first need a good definition of what such an internal groupoid is.

Quotient inductive types

A quotient inductive type is a higher inductive type that includes a “0-truncation” constructor such as contr1 for a set-quotient. Many of these are useful in set-based mathematics; in addition to colimits in Set, they can be used to construct free algebras and colimits of algebras of various sorts. Quotient inductive-inductive types are used to construct sets with propositional relations and various countable completions of structures. Examples can be found at quotient inductive type, including:

FinSet

Since FinSet is the initial 2-rig, one should be able to construct it as a higher inductive type with a 1-truncation constructor.

Integers

A definition of the set of integers as a higher inductive type.

Inductive int : Type :=
| zero : int
| succ : int -> int
| pred1 : int -> int
| pred2 : int -> int
| sec : forall (x : int) pred1 succ x == x
| ret : forall (x : int) succ pred2 x == x

Other

Semantics

See (Lumsdaine-Shulman17).

References

Expositions include

Details of the semantics are in

with precursors in

Discussion of a subset of the HITs is in:

Implementation in Agda/Coq is discussed in

  • Guillaume Brunerie, Implementation of higher inductive types in HoTT-Agda, 2016, github

  • Bruno Barras, Native implementation of Higher Inductive Types (HITs) in Coq PDF

Last revised on June 9, 2022 at 01:54:29. See the history of this page for a list of all contributions to it.