5.5 Homotopy-inductive types
In Β§5.3 (http://planetmath.org/53wtypes) we showed how to encode natural numbers as -types, with
We also showed how one can define a function on using the recursion principle. When it comes to the induction principle, however, this encoding is no longer satisfactory: given and recurrences and , we can only construct a dependent function satisfying the given recurrences propositionally, i.e.Β up to a path. This means that the computation rules for natural numbers, which give judgmental equalities, cannot be derived from the rules for -types in any obvious way.
This problem goes away if instead of the conventional inductive types we consider homotopy-inductive types, where all computation rules are stated up to a path, i.e.Β the symbol is replaced by . For instance, the computation rule for the homotopy version of -types becomes:
-
β’
For any and we have
Homotopy-inductive types have an obvious disadvantage when it comes to computational properties β the behavior of any function constructed using the induction principle can now only be characterized propositionally. But numerous other considerations drive us to consider homotopy-inductive types as well. For instance, while we showed in Β§5.4 (http://planetmath.org/54inductivetypesareinitialalgebras) that inductive types are homotopy-initial algebras, not every homotopy-initial algebra is an inductive type (i.e.Β satisfies the corresponding induction principle) β but every homotopy-initial algebra is a homotopy-inductive type. Similarly, we might want to apply the uniqueness argument from Β§5.2 (http://planetmath.org/52uniquenessofinductivetypes) when one (or both) of the types involved is only a homotopy-inductive type β for instance, to show that the -type encoding of is equivalent to the usual .
Additionally, the notion of a homotopy-inductive type is now internal to the type theory. For example, this means we can form a type of all natural numbers objects and make assertions about it. In the case of -types, we can characterize a homotopy -type as any type endowed with a supremum function and an induction principle satisfying the appropriate (propositional) computation rule:
In http://planetmath.org/node/87579Chapter 6 we will see some other reasons why propositional computation rules are worth considering.
In this section, we will state some basic facts about homotopy-inductive types. We omit most of the proofs, which are somewhat technical.
Theorem 5.5.1.
For any and , the type is a mere proposition.
It turns out that there is an equivalent characterization of -types using a recursion principle, plus certain uniqueness and coherence laws. First we give the recursion principle:
-
β’
When constructing a function from the -type into the type , it suffices to give its value for , assuming we are given the values of all with . In other words, it suffices to construct a function
The associated computation rule for is as follows:
-
β’
For any and we have a witness for equality
Furthermore, we assert the following uniqueness principle, saying that any two functions defined by the same recurrence are equal:
-
β’
Let and be given. Let be two functions which satisfy the recurrence up to propositional equality, i.e., such that we have
Then and are equal, i.e.Β there is of type .
Recall that when we have an induction principle rather than only a recursion principle, this propositional uniqueness principle is derivable (Theorem 5.3.1 (http://planetmath.org/53wtypes#Thmprethm1)). But with only recursion, the uniqueness principle is no longer derivable β and in fact, the statement is not even true (exercise). Hence, we postulate it as an axiom. We also postulate the following coherence law, which tells us how the proof of uniqueness behaves on canonical elements:
-
β’
For any and , the following diagram commutes propositionally:
where abbreviates the path .
Putting all of this data together yields another characterization of , as a type with a supremum function, satisfying simple elimination, computation, uniqueness, and coherence rules:
Theorem 5.5.2.
For any and , the type is a mere proposition.
Finally, we have a third, very concise characterization of as an h-initial -algebra:
Theorem 5.5.3.
For any and , the type is a mere proposition.
It turns out all three characterizations of -types are in fact equivalent:
Lemma 5.5.4.
For any and , we have
Indeed, we have the following theorem, which is an improvement over Theorem 5.4.7 (http://planetmath.org/54inductivetypesareinitialalgebras#Thmprethm3):
Theorem 5.5.5.
The types satisfying the formation, introduction, elimination, and propositional computation rules for -types are precisely the homotopy-initial -algebras.
Sketch of proof.
Inspecting the proof of Theorem 5.4.7 (http://planetmath.org/54inductivetypesareinitialalgebras#Thmprethm3), we see that only the propositional computation rule was required to establish the h-initiality of . For the converse implication, let us assume that the polynomial functor associated to and , has an h-initial algebra ; we show that satisfies the propositional rules of -types. The -introduction rule is simple; namely, for and , we define to be the result of applying the structure map to . For the -elimination rule, let us assume its premisses and in particular that . Using the other premisses, one shows that the type can be equipped with a structure map . By the h-initiality of , we obtain an algebra homomorphism . Furthermore, the first projection can be equipped with the structure of a homomorphism, so that we obtain a diagram of the form
But the identity function has a canonical structure of an algebra homomorphism and so, by the contractibility of the type of homomorphisms from to itself, there must be an identity proof between the composite of with and . This implies, in particular, that there is an identity proof .
Since , we can define
where the transport is with respect to the family
The verification of the propositional -computation rule is a calculation, involving the naturality properties of operations of the form . β
Finally, as desired, we can encode homotopy-natural-numbers as homotopy--types:
Theorem 5.5.6.
The rules for natural numbers with propositional computation rules can be derived from the rules for -types with propositional computation rules.
Title | 5.5 Homotopy-inductive types |
---|---|
\metatable |