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 E:ππ°βπ° and recurrences ez:E(0π°) and es:β(n:ππ°)β(y:E(n))E(π¬π°(n)), we can only construct a dependent function r(E,ez,es):β(n:ππ°)E(n) 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:
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 πΆ(x:A)B(x) 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 A:U and B:AβU, the type Wd(A,B) 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 πΆh(x:A)B(x) into the type C, it suffices to give its value for πππ(a,f), assuming we are given the values of all f(b) with b:B(a).
In other words, it suffices to construct a function
c:βa:A(B(a)βC)βC.
The associated computation rule for ππΎπΌπΆh(x:A)B(x)(C,c):(πΆ(x:A)B(x))βC is as follows:
β’
For any a:A and f:B(a)βπΆh(x:A)B(x) we have
a witness Ξ²(C,c,a,f) for equality
Furthermore, we assert the following uniqueness principle, saying that any two functions defined by the same recurrence are equal:
β’
Let C:π° and c:β(a:A)(B(a)βC)βC be given. Let g,h:(πΆh(x:A)B(x))βC be two functions which satisfy the recurrence c up to propositional equality, i.e., such that we have
Ξ²g
:βa,fg(πππ(a,f))=c(a,Ξ»b.g(f(b))),
Ξ²h
:βa,fh(πππ(a,f))=c(a,Ξ»b.h(f(b))).
Then g and h are equal, i.e. there is Ξ±(C,c,f,g,Ξ²g,Ξ²h) of type g=h.
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 a:A and f:B(a)βC, the following diagram commutes propositionally:
\includegraphics
HoTT_fig_5.5.1.png
where Ξ± abbreviates the path Ξ±(C,c,f,g,Ξ²g,Ξ²h):g=h.
Putting all of this data together yields another characterization of πΆ(x:A)B(x), as a type with a supremum function, satisfying simple elimination, computation, uniqueness, and coherence rules:
For any A:U and B:AβU, the type Wh(A,B) is a mere proposition.
It turns out all three characterizations of πΆ-types are in fact equivalent:
Lemma 5.5.4.
For any A:U and B:AβU, we have
πΆd(A,B)βπΆs(A,B)βπΆh(A,B)
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 W-types are precisely the homotopy-initial W-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 πΆ(x:A)B(x).
For the converse implication, let us assume that the polynomial functor associated
to A:π° and B:Aβπ°, has an h-initial algebra (W,sW); we show that W satisfies the propositional rules of πΆ-types.
The πΆ-introduction rule is simple; namely, for a:A and t:B(a)βW, we define πππ(a,t):W to be the
result of applying the structure mapsW:PWβW to (a,t):PW.
For the πΆ-elimination rule, let us assume its premisses and in particular that Cβ²:Wβπ°.
Using the other premisses, one shows that the type C:β‘β(w:W)Cβ²(w)
can be equipped with a structure map sC:PCβC. By the h-initiality of W,
we obtain an algebra homomorphism (f,sf):(W,sW)β(C,sC). Furthermore,
the first projectionππ1:CβW can be equipped with the structure of a
homomorphism, so that we obtain a diagram of the form
\includegraphics
HoTT_fig_5.5.2.png
But the identity function1W:WβW has a canonical structure of an
algebra homomorphism and so, by the contractibility of the type of homomorphisms
from (W,sW) to itself, there must be an identity proof between the composite
of (f,sf) with (ππ1,sππ1) and (1W,s1W). This implies, in particular,
that there is an identity proof p:ππ1βf=1W.
Since (ππ2βf)w:C((ππ1βf)w), we can define
ππΎπΌ(w,c):β‘p*((ππ2βf)w):C(w)
where the transport p* is with respect to the family
Ξ»u.Cβu:(WβW)βWβπ°.
The verification of the propositional πΆ-computation rule is a calculation,
involving the naturality properties of operations of the form p*.
β
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 W-types with propositional computation rules.