6.9 Truncations
In Β§3.7 (http://planetmath.org/37propositionaltruncation) we introduced the propositional truncation as a new type forming operation^{}; we now observe that it can be obtained as a special case of higher inductive types. This reduces the problem of understanding truncations to the problem of understanding higher inductives, which at least are amenable to a systematic treatment. It is also interesting because it provides our first example of a higher inductive type which is truly recursive, in that its constructors take inputs from the type being defined (as does the successor^{} $\mathrm{\pi \x9d\x97\x8c\pi \x9d\x97\x8e\pi \x9d\x96\u038c\pi \x9d\x96\u038c}:\mathrm{\beta \x84\x95}\beta \x86\x92\mathrm{\beta \x84\x95}$).
Let $A$ be a type; we define its propositional truncation $\beta \x88\u20afA\beta \x88\u20af$ to be the higher inductive type generated by:

β’
A function $\text{\beta \x80\x93}:A\beta \x86\x92\beta \x88\u20afA\beta \x88\u20af$, and

β’
For each $x,y:\beta \x88\u20afA\beta \x88\u20af$, a path $x=y$.
Note that the second constructor is by definition the assertion that $\beta \x88\u20afA\beta \x88\u20af$ is a mere proposition. Thus, the definition of $\beta \x88\u20afA\beta \x88\u20af$ can be interpreted as saying that $\beta \x88\u20afA\beta \x88\u20af$ is freely generated by a function $A\beta \x86\x92\beta \x88\u20afA\beta \x88\u20af$ and the fact that it is a mere proposition.
The recursion principle for this higher inductive definition is easy to write down: it says that given any type $B$ together with

β’
A function $g:A\beta \x86\x92B$, and

β’
For any $x,y:B$, a path $x{=}_{B}y$,
there exists a function $f:\beta \x88\u20afA\beta \x88\u20af\beta \x86\x92B$ such that

β’
$f(\lefta\right)\beta \x89\u2018g(a)$ for all $a:A$, and

β’
for any $x,y:\beta \x88\u20afA\beta \x88\u20af$, the function ${\mathrm{\pi \x9d\x96\u038a\pi \x9d\x97\x89}}_{f}$ takes the specified path $x=y$ in $\beta \x88\u20afA\beta \x88\u20af$ to the specified path $f\beta \x81\u2019(x)=f\beta \x81\u2019(y)$ in $B$ (propositionally).
These are exactly the hypotheses that we stated in Β§3.7 (http://planetmath.org/37propositionaltruncation) for the recursion principle of propositional truncation β a function $A\beta \x86\x92B$ such that $B$ is a mere proposition β and the first part of the conclusion^{} is exactly what we stated there as well. The second part (the action of ${\mathrm{\pi \x9d\x96\u038a\pi \x9d\x97\x89}}_{f}$) was not mentioned previously, but it turns out to be vacuous^{} in this case, because $B$ is a mere proposition, so any two paths in it are automatically equal.
There is also an induction^{} principle for $\beta \x88\u20afA\beta \x88\u20af$, which says that given any $B:\beta \x88\u20afA\beta \x88\u20af\beta \x86\x92\mathrm{\pi \x9d\x92\xb0}$ together with

β’
a function $g:{\beta \x88\x8f}_{(a:A)}B(\lefta\right)$, and

β’
for any $x,y:\beta \x88\u20afA\beta \x88\u20af$ and $u:B\beta \x81\u2019(x)$ and $v:B\beta \x81\u2019(y)$, a dependent path $q:u{=}_{p\beta \x81\u2019(x,y)}^{B}v$, where $p\beta \x81\u2019(x,y)$ is the path coming from the second constructor of $\beta \x88\u20afA\beta \x88\u20af$,
there exists $f:{\beta \x88\x8f}_{(x:\beta \x88\u20afA\beta \x88\u20af)}B\beta \x81\u2019(x)$ such that $f(\lefta\right)\beta \x89\u2018a$ for $a:A$, and also another computation rule. However, because there can be at most one function between any two mere propositions (up to homotopy), this induction principle is not really useful (see also http://planetmath.org/node/87806Exercise 3.20).
We can, however, extend this idea to construct similar truncations landing in $n$types, for any $n$. For instance, we might define the 0truncation ${\beta \x88\u20afA\beta \x88\u20af}_{0}$ to be generated by

β’
A function $\text{\beta \x80\x93}{}_{0}:A\beta \x86\x92\beta \x88\u20afA{\beta \x88\u20af}_{0}$, and

β’
For each $x,y:\beta \x88\u20afA{\beta \x88\u20af}_{0}$ and each $p,q:x=y$, a path $p=q$.
Then ${\beta \x88\u20afA\beta \x88\u20af}_{0}$ would be freely generated by a function $A\beta \x86\x92\beta \x88\u20afA{\beta \x88\u20af}_{0}$ together with the assertion that ${\beta \x88\u20afA\beta \x88\u20af}_{0}$ is a set. A natural induction principle for it would say that given $B:\beta \x88\u20afA{\beta \x88\u20af}_{0}\beta \x86\x92\mathrm{\pi \x9d\x92\xb0}$ together with

β’
a function $g:{\beta \x88\x8f}_{(a:A)}B(a{}_{0})$, and

β’
for any $x,y:\beta \x88\u20afA{\beta \x88\u20af}_{0}$ with $z:B\beta \x81\u2019(x)$ and $w:B\beta \x81\u2019(y)$, and each $p,q:x=y$ with $r:z{=}_{p}^{B}w$ and $s:z{=}_{q}^{B}w$, a 2path $v:p{=}_{u\beta \x81\u2019(x,y,p,q)}^{B}q$, where $u\beta \x81\u2019(x,y,p,q):p=q$ is obtained from the second constructor of ${\beta \x88\u20afA\beta \x88\u20af}_{0}$,
there exists $f:{\beta \x88\x8f}_{(x:\beta \x88\u20afA{\beta \x88\u20af}_{0})}B\beta \x81\u2019(x)$ such that $f(a{}_{0})\beta \x89\u2018g(a)$ for all $a:A$, and also ${\mathrm{\pi \x9d\x96\u038a\pi \x9d\x97\x89\pi \x9d\x96\xbd}}_{f}^{2}\left(u(x,y,p,q)\right)$ is the 2path specified above. (As in the propositional case, the latter condition turns out to be uninteresting.) From this, however, we can prove a more useful induction principle.
Lemma 6.9.1.
Suppose given $B\mathrm{:}\mathrm{\beta \x88\u20af}A{\mathrm{\beta \x88\u20af}}_{\mathrm{0}}\mathrm{\beta \x86\x92}\mathrm{U}$ together with $g\mathrm{:}{\mathrm{\beta \x88\x8f}}_{\mathrm{(}a\mathrm{:}A\mathrm{)}}B\mathrm{(}\mathrm{}a{\mathrm{}}_{\mathrm{0}}\mathrm{)}$, and assume that each $B\mathit{\beta \x81\u2019}\mathrm{(}x\mathrm{)}$ is a set. Then there exists $f\mathrm{:}{\mathrm{\beta \x88\x8f}}_{\mathrm{(}x\mathrm{:}\mathrm{\beta \x88\u20af}A{\mathrm{\beta \x88\u20af}}_{\mathrm{0}}\mathrm{)}}B\mathit{\beta \x81\u2019}\mathrm{(}x\mathrm{)}$ such that $f\mathrm{(}\mathrm{}a{\mathrm{}}_{\mathrm{0}}\mathrm{)}\mathrm{\beta \x89\u2018}g\mathrm{(}a\mathrm{)}$ for all $a\mathrm{:}A$.
Proof.
It suffices to construct, for any $x,y,z,w,p,q,r,s$ as above, a 2path $v:p{=}_{u\beta \x81\u2019(x,y,p,q)}^{B}q$. However, by the definition of dependent 2paths, this is an ordinary 2path in the fiber $B\beta \x81\u2019(y)$. Since $B\beta \x81\u2019(y)$ is a set, a 2path exists between any two parallel paths. β
This implies the expected universal property.
Lemma 6.9.2.
For any set $B$ and any type $A$, composition with $\mathrm{}\mathit{\text{\beta \x80\x93}}{\mathrm{}}_{\mathrm{0}}\mathrm{:}A\mathrm{\beta \x86\x92}\mathrm{\beta \x88\u20af}A{\mathrm{\beta \x88\u20af}}_{\mathrm{0}}$ determines an equivalence
$$(\beta \x88\u20afA{\beta \x88\u20af}_{0}\beta \x86\x92B)\beta \x89\x83(A\beta \x86\x92B).$$ 
Proof.
The special case of Lemma 6.9.1 (http://planetmath.org/69truncations#Thmprelem1) when $B$ is the constant family gives a map from right to left, which is a right inverse^{} to the βcompose with ${\text{\beta \x80\x93}}_{0}$β function from left to right. To show that it is also a left inverse, let $h:\beta \x88\u20afA{\beta \x88\u20af}_{0}\beta \x86\x92B$, and define ${h}^{\beta \x80\xb2}:\beta \x88\u20afA{\beta \x88\u20af}_{0}\beta \x86\x92B$ by applying Lemma 6.9.1 (http://planetmath.org/69truncations#Thmprelem1) to the composite $a\beta \x86\xa6h(a{}_{0})$. Thus, ${h}^{\beta \x80\xb2}(a{}_{0})=h(a{}_{0})$.
However, since $B$ is a set, for any $x:\beta \x88\u20afA{\beta \x88\u20af}_{0}$ the type $h\beta \x81\u2019(x)={h}^{\beta \x80\xb2}\beta \x81\u2019(x)$ is a mere proposition, and hence also a set. Therefore, by Lemma 6.9.1 (http://planetmath.org/69truncations#Thmprelem1), the observation that ${h}^{\beta \x80\xb2}(a{}_{0})=h(a{}_{0})$ for any $a:A$ implies $h\beta \x81\u2019(x)={h}^{\beta \x80\xb2}\beta \x81\u2019(x)$ for any $x:\beta \x88\u20afA{\beta \x88\u20af}_{0}$, and hence $h={h}^{\beta \x80\xb2}$. β
For instance, this enables us to construct colimits of sets. We have seen that if $A\stackrel{\pi \x9d\x91\x93}{\beta \x86\x90}C\stackrel{\pi \x9d\x91\x94}{\beta \x86\x92}B$ is a span of sets, then the pushout $A{\beta \x8a\x94}^{C}B$ may no longer be a set. (For instance, if $A$ and $B$ are $\mathrm{\pi \x9d\x9f\x8f}$ and $C$ is $\mathrm{\pi \x9d\x9f\x90}$, then the pushout is ${\mathrm{\pi \x9d\x95\x8a}}^{1}$.) However, we can construct a pushout that is a set, and has the expected universal property with respect to other sets, by truncating.
Lemma 6.9.3.
Let $A\stackrel{\pi \x9d\x91\x93}{\mathrm{\beta \x86\x90}}C\stackrel{\pi \x9d\x91\x94}{\mathrm{\beta \x86\x92}}B$ be a span of sets. Then for any set $E$, there is a canonical equivalence
$$(\beta \x88\u20afA{\beta \x8a\x94}^{C}B{\beta \x88\u20af}_{0}\beta \x86\x92E)\beta \x89\x83{\mathrm{\pi \x9d\x96\u038c\pi \x9d\x97\x88\pi \x9d\x96\u038c\pi \x9d\x97\x88\pi \x9d\x97\x87\pi \x9d\x96\u038e}}_{\mathrm{\pi \x9d\x92\x9f}}(E).$$ 
Proof.
Compose the equivalences in Lemma 6.8.2 (http://planetmath.org/68pushouts#Thmprelem1),Lemma 6.9.2 (http://planetmath.org/69truncations#Thmprelem2). β
We refer to ${\beta \x88\u20afA{\beta \x8a\x94}^{C}B\beta \x88\u20af}_{0}$ as the setpushout of $f$ and $g$, to distinguish it from the (homotopy) pushout $A{\beta \x8a\x94}^{C}B$. Alternatively, we could modify the definition of the pushout in Β§6.8 (http://planetmath.org/68pushouts) to include the $0$truncation constructor directly, avoiding the need to truncate afterwards. Similar remarks apply to any sort of colimit of sets; we will explore this further in http://planetmath.org/node/87584Chapter 10.
However, while the above definition of the 0truncation works β it gives what we want, and is consistent β it has a couple of issues. Firstly, it doesnβt fit so nicely into the general theory of higher inductive types. In general, it is tricky to deal directly with constructors such as the second one we have given for ${\beta \x88\u20afA\beta \x88\u20af}_{0}$, whose inputs involve not only elements of the type being defined, but paths in it.
This can be gotten round fairly easily, however. Recall in Β§5.1 (http://planetmath.org/51introductiontoinductivetypes) we mentioned that we can allow a constructor of an inductive type $W$ to take βinfinitely many arguments^{}β of type $W$ by having it take a single argument of type $\mathrm{\beta \x84\x95}\beta \x86\x92W$. There is a general principle behind this: to model a constructor with funnylooking inputs, use an auxiliary inductive type (such as $\mathrm{\beta \x84\x95}$) to parametrize them, reducing the input to a simple function^{} with inductive domain.
For the 0truncation, we can consider the auxiliary higher inductive type $S$ generated by two points $a,b:S$ and two paths $p,q:a=b$. Then the fishylooking constructor of ${\beta \x88\u20afA\beta \x88\u20af}_{0}$ can be replaced by the unobjectionable

β’
For every $f:S\beta \x86\x92A$, a path ${\mathrm{\pi \x9d\x96\u038a\pi \x9d\x97\x89}}_{f}\beta \x81\u2019(p)={\mathrm{\pi \x9d\x96\u038a\pi \x9d\x97\x89}}_{f}\beta \x81\u2019(q)$.
Since to give a map out of $S$ is the same as to give two points and two parallel paths between them, this yields the same induction principle.
A more serious problem with our current definition of $0$truncation, however, is that it doesnβt generalize very well. If we want to describe a notion of definition of β$n$truncationβ into $n$types uniformly for all $n:\mathrm{\beta \x84\x95}$, then this approach is unfeasible, since the second constructor would need a number of arguments that increases with $n$. In Β§7.3 (http://planetmath.org/73truncations), therefore, we will use a different idea to construct these, based on the observation that the type $S$ introduced above is equivalent^{} to the circle ${\mathrm{\pi \x9d\x95\x8a}}^{1}$. This includes the 0truncation as a special case, and satisfies generalized versions of Lemma 6.9.1 (http://planetmath.org/69truncations#Thmprelem1),Lemma 6.9.2 (http://planetmath.org/69truncations#Thmprelem2).
Title  6.9 Truncations 

\metatable 