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/path type
equivalence classquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive 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, (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





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.


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.


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 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.


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:


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

Rezk completion

According to Homotopy Type Theory – Univalent Foundations of Mathematics the Rezk completion? or stack completion? of a pregroupoid? to a groupoid is a higher inductive type and the 1-truncated analogue of the quotient set construction above.

… (translate into Coq)


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


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.


See (Lumsdaine-Shulman17).


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 July 11, 2021 at 06:22:09. See the history of this page for a list of all contributions to it.