nLab higher inductive type

Redirected from "HIT".
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

logicset theory (internal logic of)category theorytype theory
propositionsetobjecttype
predicatefamily of setsdisplay morphismdependent type
proofelementgeneralized elementterm/program
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
introduction rule for implicationcounit for hom-tensor adjunctionlambda
elimination rule for implicationunit for hom-tensor adjunctionapplication
cut elimination for implicationone of the zigzag identities for hom-tensor adjunctionbeta reduction
identity elimination for implicationthe other zigzag identity for hom-tensor adjunctioneta conversion
truesingletonterminal object/(-2)-truncated objecth-level 0-type/unit type
falseempty setinitial objectempty type
proposition, truth valuesubsingletonsubterminal object/(-1)-truncated objecth-proposition, mere proposition
logical conjunctioncartesian productproductproduct type
disjunctiondisjoint union (support of)coproduct ((-1)-truncation of)sum type (bracket type of)
implicationfunction set (into subsingleton)internal hom (into subterminal object)function type (into h-proposition)
negationfunction set into empty setinternal hom into initial objectfunction type into empty type
universal quantificationindexed cartesian product (of family of subsingletons)dependent product (of family of subterminal objects)dependent product type (of family of h-propositions)
existential quantificationindexed disjoint union (support of)dependent sum ((-1)-truncation of)dependent sum type (bracket type of)
logical equivalencebijection setobject of isomorphismsequivalence type
support setsupport object/(-1)-truncationpropositional truncation/bracket type
n-image of morphism into terminal object/n-truncationn-truncation modality
equalitydiagonal function/diagonal subset/diagonal relationpath space objectidentity type/path type
completely presented setsetdiscrete object/0-truncated objecth-level 2-type/set/h-set
setset with equivalence relationinternal 0-groupoidBishop set/setoid with its pseudo-equivalence relation an actual equivalence relation
equivalence class/quotient setquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
presettype without identity types
set of truth valuessubobject classifiertype of propositions
domain of discourseuniverseobject classifiertype universe
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

Homotopy theory

homotopy theory, (∞,1)-category theory, homotopy type theory

flavors: stable, equivariant, rational, p-adic, proper, geometric, cohesive, directed

models: topological, simplicial, localic, …

see also algebraic topology

Introductions

Definitions

Paths and cylinders

Homotopy groups

Basic facts

Theorems

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 [Shulman & Lumsdaine (2016)]. A more syntactic description of a class of HITs may be found in [Brunerie (2016), Vezzosi, Mörtberg & Abel (2019)]. A solution to this problem should determine how to define the concept of an elementary (∞,1)-topos.

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

Textbook account:

Expositions:

Details on the categorical semantics of HITs:

with precursors in

Discussion of HITs which arise as homotopy-initial algebras of an endofunctor:

Further developments:

Implementation of HITs in proof assistants:

in Agda:

in Cubical Agda:

in Coq:

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

in Lean: van Doorn (2018)

Discussion of coinduction via HITs:

Discussion of impredicative encodings of higher inductive types:

  • Steve Awodey, Jonas Frey, and Sam Speight. “Impredicative Encodings of (Higher) Inductive Types”. In: Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science. LICS ’18. Oxford, United Kingdom: ACM, 2018, pp. 76–85. (ISBN:978-1-4503-5583-4, doi:10.1145/3209108.3209130)

Last revised on February 10, 2024 at 22:34:20. See the history of this page for a list of all contributions to it.