higher inductive type


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
equivalence classquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
completely presented setdiscrete object/0-truncated objecth-level 2-type/preset/h-set
setinternal 0-groupoidBishop set/setoid
universeobject classifiertype of types
modalityclosure operator, (idemponent) 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





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.


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

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; see this blog post.

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 2-sphere

Similarly the homotopy type of the 2-dimensional sphere

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


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.


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.


The (homotopy) pushout of f:ABf \colon A\to B and g:ACg\colon A\to C:

Inductive hpushout {A B C : Type} (f : A -> B) (g : A -> C) : Type :=
| inl : B -> hpushout f g
| inr : C -> hpushout f g
| glue : forall (a : A), inl (f a) == inr (g a).

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.


Suppose we are given a family of functions:

Hypothesis I : Type.
Hypothesis S T : I -> Type.
Hypothesis f : forall i, S i -> T i.

A type is said to be II-local if it sees each of these functions as an equivalence:

Definition is_local Z := forall i,
  is_equiv (fun g : T i -> Z => g o f i).

The following HIT can be shown to be a reflection of all types into the local types, constructing the localization of the category of types at the given family of maps.

Inductive localize X :=
| to_local : X -> localize X
| local_extend : forall (i:I) (h : S i -> localize X),
    T i -> localize X
| local_extension : forall (i:I) (h : S i -> localize X) (s : S i),
    local_extend i h (f i s) == h s
| local_unextension : forall (i:I) (g : T i -> localize X) (t : T i),
    local_extend i (g o f i) t == g t
| local_triangle : forall (i:I) (g : T i -> localize X) (s : S i),
    local_unextension i g (f i s) == local_extension i (g o f i) s.

The first constructor gives a map from X to localize X, while the other four specify exactly that localize X is local (by giving adjoint equivalence data to the map that we want to become an equivalence). See this blog post for details. This construction is also already interesting in extensional type theory.


A prespectrum is a sequence of pointed types X nX_n with pointed maps X nΩX n+1X_n \to \Omega X_{n+1}:

Definition prespectrum :=
  {X : nat -> Type & 
   { pt : forall n, X n &
    { glue : forall n, X n -> pt (S n) == pt (S n) &
      forall n, glue n (pt n) == idpath (pt (S n)) }}}.

A prespectrum is a spectrum if each of these maps is an equivalence.

Definition is_spectrum (X : prespectrum) : Type :=
  forall n, is_equiv (pr1 (pr2 (pr2 X)) n).

In classical algebraic topology, there is a spectrification functor which is left adjoint to the inclusion of spectra in prespectra. For instance, this is how a suspension spectrum is constructed: by spectrifying the prespectrum X nΣ nAX_n \coloneqq \Sigma^n A.

The following HIT should construct spectrification in homotopy type theory (though this has not yet been verified formally). (There are some abuses of notation below, which can be made precise using Coq typeclasses and implicit arguments.)

Inductive spectrify (X : prespectrum) : nat -> Type :=
| to_spectrify : forall n, X n -> spectrify X n
| spectrify_glue : forall n, spectrify X n ->
    to_spectrify (S n) (pt (S n)) == to_spectrify (S n) (pt (S n))
| to_spectrify_is_prespectrum_map : forall n (x : X n),
    spectrify_glue n (to_spectrify n x)
    == loop_functor (to_spectrify (S n)) (glue n x)
| spectrify_glue_retraction : forall n
    (p : to_spectrify (S n) (pt (S n)) == to_spectrify (S n) (pt (S n))),
    spectrify X n
| spectrify_glue_retraction_is_retraction : forall n (sx : spectrify X n),
    spectrify_glue_retraction n (spectrify_glue n sx) == sx
| spectrify_glue_section : forall n
    (p : to_spectrify (S n) (pt (S n)) == to_spectrify (S n) (pt (S n))),
    spectrify X n
| spectrify_glue_section_is_section : forall n
    (p : to_spectrify (S n) (pt (S n)) == to_spectrify (S n) (pt (S n))),
    spectrify_glue n (spectrify_glue_section n p) == p.

We can unravel this as follows, using more traditional notation. Let LXL X denote the spectrification being constructed. The first constructor says that each (LX) n(L X)_n comes with a map from X nX_n, called n\ell_n say (denoted to_spectrify n above). This induces a basepoint in each type (LX) n(L X)_n, namely the image n(*)\ell_n(*) of the basepoint of X nX_n. The many occurrences of

to_spectrify (S n) (pt (S n)) == to_spectrify (S n) (pt (S n))

simply refer to the based loop space of Ω n+1(*)(LX) n+1\Omega_{\ell_{n+1}(*)} (L X)_{n+1} of (LX) n+1(L X)_{n+1} at this base point.

Thus, the second constructor spectrify_glue gives the structure maps (LX) nΩ(LX) n+1(L X)_n \to \Omega (L X)_{n+1} to make LXL X into a prespectrum. Similarly, the third constructor says that the maps n:X n(LX) n\ell_n\colon X_n \to (L X)_n commute with the structure maps up to a specified homotopy.

Since the basepoints of the types (LX) n(L X)_n are induced from those of each X nX_n, this automatically implies that the maps (LX) nΩ(LX) n+1(L X)_n \to \Omega (L X)_{n+1} are pointed maps (up to a specified homotopy) and that the n\ell_n commute with these pointings (up to a specified homotopy). This makes \ell into a map of prespectra.

Finally, the fourth through seventh constructors say that LXL X is a spectrum, by giving h-isomorphism data: a retraction and a section for each glue map (LX) nΩ(LX) n+1(L X)_n \to \Omega (L X)_{n+1}. We could use adjoint equivalence data as we did for localization, but this approach avoids the presence of level-3 path constructors. (We could have used h-iso data in localization too, thereby avoiding even level-2 constructors there.) It is important, in general, to use a sort of equivalence data which forms an h-prop; otherwise we would be adding structure rather than merely the property of such-and-such map being an equivalence.


Expositions include

Details are in

An experimental implementation is described in:

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

A detailed description of a subset of the HITs is in:

See also

Revised on March 15, 2017 05:57:52 by Anonymous (