natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory
An inductive type is…
In terms of categorical semantics, an inductive type is a type whose interpretation is given by an initial algebra of an endofunctor.
This has the usual meaning in ordinary category theory. In applications to (∞,1)-category theory, the uniqueness clause in the notion of initial object is modified to allow for a contractible space of choices (as discussed at initial object in an (∞,1)-category), and this difference is reflected accordingly in the type-theoretic set-up. The syntax will give back the traditional meaning whenever equality is interpreted extensionally.
There are two equivalent ways of defining the judgement rules for inductive types. The first describes elimination on dependent types over the given type. This is the formalization of the notion of induction, and discussed below in
The second describes elimination on absolute types. This is the formalization of the notion of recursion, and discussed below
(…)
(…)
We discuss the categorical semantics of inductive types.
The categorical interpretation of induction, hence of the dependent elimination and computation rules from above are the following.
Let be the ambient category.
The interpretation of inductive term introduction is by an endofunctor and an algebra over an endofunctor, exhibited by a morphism in of the form
The interpretation of the dependent elimination rule says that given a display map , where is given an -algebra structure and the display map is an -algebra homomorphism, the dependent eliminator is interpreted as a specified section , hence as a diagram
in .
The interpretation of the dependent computation rules is that the section from above is required to be an algebra homomorphism.
The categorical interpretation of recursion, hence of the absolute elimination rules from above in a suitable category is the following
The interpretation of inductive term introduction is by an endofunctor and an algebra over an endofunctor, exhibited by a morphism in of the form
The interpretation of the absolute elimination rule is that for any other -algebra, there is a morphism in .
The interpretation of the absolute computation rule says that the morphism from above is an algebra homomorphism and is unique as such.
In summary this says that the recursion rules are interpreted as an initial algebra of an endofunctor.
When interpreted in a category of homotopy 0-types = sets, definition and definition are indeed equivalent.
First suppose that is an initial -algebra as in def. . Then since initiality entails first of all the existence of a morphims to any other object it follows that with another -algebra there is a homomorphism , and since secondly initiality entails uniqueness of this morphism, it follows that given a homomorphism the composite has to equal the identity , hence that has a section, and uniquely so.
Conversely, assume that satisfies definition . For any other -algebra we can form the trivial display map by projection and a section of this is equivalently just a morphism , so we have a homomorphism from to any other -algebra . Therefore to show that is an initial -algebra it remains to show that for two algebra homomorphism, they are necessarily equal.
To that end, notice that by the assumption of 0-truncation, the diagonal is a display map / fibration.
Form its pullback
which is also an algebra homomorphism. Therefore by the interpretation of the elimination rule it has a (specified) section . But is the pullback of a monomorphism and therefore itself a monomorphism, and so the section forces it to be in fact an isomorphism. This in turn means that and are equal.
In intensional type theory, where the diagonal is not a display map, we can perform the same argument using a path object (represented in type theory by an identity type), showing thereby that and are homotopic. A fancier version of this argument enables us to show that the space of algebra maps is actually contractible. In other words, the axioms for an inductive type still imply that algebra maps out of are essentially unique, even though the axioms do not state this explicitly.
Any inductive type is a homotopy initial F-algebra: the space of -algebra maps is contractible.
Informally, the natural numbers are generated by two constructors:
The type of natural numbers is the inductive type defined as follows.
(check, this probably still has syntax errors…)
(…)
See for instance (Pfenning, section 2).
In Coq-syntax the natural numbers are the inductive type defined by
Inductive nat : Type :=
| zero : nat
| succ : nat -> nat.
In the categorical semantics this is interpreted as the initial algebra for the endofunctor that sends an object to its coproduct with the terminal object
or in different equivalent notation, which is very suggestive here:
That initial algebra is (as explained there) precisely a natural number object . The two components of the morphism that defines the algebra structure are the 0-element and the successor endomorphism
In the following we write of course for short and .
We spell out in detail how the fact that satisfied def. is the classical induction principle.
That principle says informally that if a proposition depending on the natural numbers is true at and such that if it is true for some then it is true for , then it is true for all natural numbers.
Here is how this is formalized in type theory and then interpreted in some suitable ambient category .
First of all, that is a proposition depending on the natural numbers means that it is a dependent type
The categorical interpretation of this is by a display map
in the given category .
Next, the fact that holds at 0 means that there is a (proof-)term
In the categorical semantics the substitution of for 0 that gives is given by the pullback of the above fibration
and the term is interpreted as a section of the resulting fibration over the terminal object
But by the defining universal property of the pullback, this is equivalently just a commuting diagram
Next the induction step. Formally it says that for all there is an implication
The categorical semantics of the substitution of for is now given by the pullback
and the interpretation of the implication term is as a morphism in
Again by the universal property of the pullback this is the same as a commuting diagram
In summary this shows that the fact that is a proposition depending on natural numbers which holds at 0 and which holds at if it holds at is interpreted precisely as an -algebra homomorphism
The induction principle is supposed to deduce from this that holds for every , hence that there is a proof for all :
The categorical interpretation of this is as a morphism in . The existence of this is indeed exactly what the interpretation of the elimination rule, def. , gives, or (equivalently by prop. ) exactly what the initiality of the -algebra gives.
We spell out how the fact that satisfies def. is the classical recursion principle.
So let be an -algebra object, hence equipped with a morphism
and a morphism
By initiality of the -algebra , there is then a (unique) morphism
such that the diagram
commutes. This means precisely that is the function defined recursively by
;
.
If is any set, then the inductive type of lists of elements of has constructors:
Therefore, is a list, is a list for any list and , and all lists are generated in this way.
The introduction, elimination and computation rules for identity types are discussed there.
In Coq-syntax the identity types are the inductive types (or more precisely, the inductive family) defined by
Inductive id {A} : A -> A -> Type :=
idpath : forall x, id x x.
We may interpret identity types in suitable categories such as a type-theoretic model category.
The categorical interpretation of identity types in a category is as the initial algebra for the endofunctor
of the slice category over which is constant at the diagonal :
So an algebra for this endofunctor is a morphism
and the initial such is the path space object .
We spell out in detail how the the induction principle def. for identity types is the principle of substitution of equals for equals.
To have an -algebra over means precisely to have a diagram
in .
This is the interpretation of the elimination rule: is the interpretation of a type
and the lift is a section of the pullback of to , hence an interpretation of a term in the substitution
The elimination rule then says that this extends to a section , hence a “proof of over all identifications” .
We spell out how the the recursion principle def. for identity types is related to the Segal-completeness condition and in particular to univalence.
Notice that an algebra over the endofunctor that defines identity types, example ,
constitutes the 1-skeleton of a simplicial object
The recursion principle says that the degeneracy map factors through the path space object of as a lift in the diagram
Semantically, this lift exists because is an acyclic cofibration by definition of path space object, and is a fibration (display map) by the interpretation rule for dependent types.
This morphism
lifts paths/morphisms that exist in to the morphisms exhibited by , if we think of the above as the 1-skeleton of a simplicial object that represents an internal category in an (infinity,1)-category.
Suppose this exists, then there will be a notion of equivalences in , those morphisms that are invertible with respect to the given composition operation. In good situations this will give the core inclusion
In this case the Segal-completeness condition in degree 1 says that the path recursion exhibits this inclusion
In the case that is the classifier of the codomain fibration, then this is called the univalence-condition.
inductive type, initial algebra of an endofunctor
higher inductive type, initial algebra of a presentable ∞-monad
A very basic introduction to the concept, with an eye towards explaining identity types is in
A textbook account in the context of programming languages is in section 15 of
Discussion of inductive types in the context of Coq-programming is in chapter 3 of
See also
Expositions with an eye towards higher inductive types include
Mike Shulman, Homotopy type theory IV (web)
Peter LeFanu Lumsdaine, Higher inductive types, a tour of the menagerie (blog post)
Mike Shulman, Inductive and higher inductive types, talk slides (2012) (pdf)
Original references include
The formalization in Coq is discussed in
A study of the homotopy-initiality of inductive types in homotopy type theory is in
The corresponding Coq-code is at
Exposition and discussion of that result is in
Discussion of the inductive type of natural numbers is in
Discussion of inductive types in the context of linear type theory is in
Last revised on August 13, 2021 at 11:32:30. See the history of this page for a list of all contributions to it.