Fibrations vs. families of types [01JU]
- November 1, 2025
- Jon Sterling
After defining n-truncated types, we derived the notion of n-truncated function by considering the fibres of the function. Zooming out, the idea is that every function f:E\to B corresponds to a family of types b:B\vdash \mathsf {fib}_f(b)~\mathit {type}, and the way to generalise a property of types to a property of functions is to apply that property to the corresponding family of types.
Conversely, if we have a family of types b:B\vdash E[b]~\mathit {type}, we can get a function into B by considering the first projection of the sum of the types E[b] over b:B. Today we will study the round-trips induced by this process, showing that (assuming univalent universes), the operation of taking fibres is an equivalence.
Definition Fibration [01JT]
- November 1, 2025
- Jon Sterling
A fibration over a type B is defined to be a pair of a type E with a mapping p:E\to B.
When B:\mathcal {U} lies inside a universe, we can relativise the notion of a fibration over B. In particular, a \mathcal {U}-fibration over B is defined to be a type E:\mathcal {U} together with a mapping p\colon E\to B. We will write \mathsf {Fib}_{\mathcal {U}}(B) for the type of \mathcal {U}-fibrations over B:
\mathsf {Fib}_{\mathcal {U}}(B) :\equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(E:\mathcal {U})}}(E\to B)Definition Straightening a fibration to a family [01JQ]
- November 1, 2025
- Jon Sterling
The straightening of a fibration p:E\to B is defined to be the family b:B\vdash \mathsf {fib}_p(b)~\mathit {type} of types associating to each element of B the corresponding fibre of p.
In the case of \mathcal {U}-fibrations, the above amounts to a function:
\mathsf {str}_{B}\colon \mathsf {Fib}_{\mathcal {U}}(B)\to \mathcal {U}^BDefinition Unstraightening a family to a fibration [01JR]
- November 1, 2025
- Jon Sterling
The unstraightening of a family of types b:B\vdash E[b]~\mathit {type} is defined to be the fibration \begin {aligned} &\pi _E\colon {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(b:B)}}{E[b]}\to B \\ &\pi _E\left \langle b,e\right \rangle :\equiv b \end {aligned} that projects the index from the sum of E[b] over b:B.
In the case of \mathcal {U}-fibrations, the above amounts to a function:
\mathsf {unstr}_{B}\colon \mathcal {U}^B\to \mathsf {Fib}_{\mathcal {U}}(B)Remark “Fibrations” are functions with an attitude [01JS]
- November 1, 2025
- Jon Sterling
The operations of straightening and unstraightening suggest that functions f:A\to B can be thought of in two different ways. Sometimes a function is just a function: a way to turn elements of A into elements of B. But other times, a function is (contextually) meant to be thought of as defining some kind of structure over its codomain, which can be extracted by straightening. In this case, we like to call it a “fibration”. At this level, there is no technical distinction between a fibration and a function: the terms are rather hints to suggest how we are intending to think about it. At times, it is useful to think of a given function as both a function and a fibration: for example, an equivalence is a function that transforms elements of one type into another type, but we define the property of being an equivalence in terms of the function’s straightening (which indicates we are thinking of it as a fibration).
We will show that within a univalent universe, unstraightening and straightening are quasi-inverse to each other. This is a very important result of univalent foundations that you can only state state indirectly in ordinary type theory or traditional set theory. In order to prove this, we must first characterise the identification types of \mathcal {U}^B and \mathsf {Fib}_{\mathcal {U}}(B) using the theory of univalent reflexive graphs.
Lemma The univalence principle for families [01JA]
- November 1, 2025
- Jon Sterling
Let (\mathcal {U},\mathcal {T}) be a univalent universe. Then the reflexive graph (\mathcal {U} / \mathcal {T})^B :\equiv {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(b:B)}} \mathcal {U} / \mathcal {T} is univalent.
Proof.
- November 1, 2025
- Jon Sterling
Lemma The univalence principle for fibrations [01JB]
- November 1, 2025
- Jon Sterling
Let (\mathcal {U}, \mathcal {T}) be a universe (not yet assumed univalent). For any B:\mathcal {U}, we may define the following displayed reflexive graph structure B^\square over the reflexive graph image \mathcal {U} / \mathcal {T}.
\begin {aligned} \left \lvert {B^\square }\right \rvert [E] &:\equiv (E\to B) \\ \left (p\approx ^{B^\square }_{f\colon \mathsf {Equiv}(E,E')} p'\right ) &:\equiv p \sim p'\circ f \\ \mathsf {rx}^{B^\square }_{E}(p) &:\equiv \lambda e\mathpunct {.}\mathsf {refl}_{p(e)} \end {aligned}First we observe that B^\square is univalent as a displayed reflexive graph.
Proof.
- November 1, 2025
- Jon Sterling
For any E:\mathcal {U}, the component B^\square [E] is precisely the product (\Delta {B})^E :\equiv {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(e:E)}}\Delta B of discrete reflexive graphs, which we know to be univalent.
We now consider the total reflexive graph (\mathcal {U} / \mathcal {T}).B^\square .
\begin {aligned} \left \lvert {(\mathcal {U} / \mathcal {T}).B^\square }\right \rvert &\equiv \mathsf {Fib}_{\mathcal {U}}(B) \\ \left (\left \langle E,p\right \rangle \approx _{(\mathcal {U} / \mathcal {T}).B^\square }\left \langle E',p'\right \rangle \right ) &\equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(f:\mathsf {Equiv}(E,E'))}} p \sim p'\circ f \\ \mathsf {rx}_{(\mathcal {U} / \mathcal {T}).B^\square } \left \langle E,p\right \rangle &\equiv \left \langle 1_E,\lambda e\mathpunct {.}{\mathsf {refl}_{p(e)}}\right \rangle \end {aligned}If we further assume that (\mathcal {U}, \mathcal {T}) is a univalent universe, then we may conclude that the total reflexive graph (\mathcal {U} / \mathcal {T}).B^\square is univalent.
Lemma Unstraightening followed by straightening [01JC]
- November 1, 2025
- Jon Sterling
Let B:\mathcal {U} for some universe (\mathcal {U}, \mathcal {T}), and let E:B\to \mathcal {U} be an arbitrary family. We can construct an edge \mathsf {str}_B(\mathsf {unstr}_B E) \approx _{(\mathcal {U} / \mathcal {T})^B} E as follows.
First of all, such an edge is given by a family of equivalences {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(b:B)}} \mathsf {Equiv}\left ( \mathsf {fib}_{\pi _E}(b),E(b) \right ) where \pi _E\colon \left ({\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(b:B)}}E(b)\right )\to B is the evident projection. For each b:B we consider the following sequence of equivalences:
\begin {aligned} &\mathsf {fib}_{\pi _E}(b) \\ &\quad \xrightarrow {\equiv } {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(u:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:B)}}E(x))}}u.1=_Bb \\ &\quad \xrightarrow {(1)} {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:B)}}{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(e:E(x))}}x=_Bb \\ &\quad \xrightarrow {(2)} {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(u:\left \{b\right \}^-_{\Delta B})}} E(u.1) \\ &\quad \xrightarrow {(3)} E(b) \end {aligned}If (\mathcal {U}, \mathcal {T}) is univalent, then so is (\mathcal {U} / \mathcal {T})^B and thus we have exhibited \mathsf {str}_B as a retraction of \mathsf {unstr}_B.
Lemma Straightening followed by unstraightening [01JD]
- November 1, 2025
- Jon Sterling
Let B:\mathcal {U} for some universe (\mathcal {U}, \mathcal {T}), and let \left \langle E,p\right \rangle :\mathsf {Fib}_{\mathcal {U}} B be a fibration over B in \mathcal {U}. We can construct an edge \mathsf {unstr}_B(\mathsf {str}_B\left \langle E,p\right \rangle ) \approx _{ (\mathcal {U} / \mathcal {T}).B^\square } \left \langle E,p\right \rangle as follows.
First of all, such an edge is given by an equivalence f : \left ({\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(b:B)}} \mathsf {fib}_{p}(b)\right )\to E together with a homotopy h: {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(b:B)}}\mathsf {fib}_{p}(b))}} u.1 =_{B} {p}(fu) \text {.}
For the former, we define f like so:
\begin {aligned} &{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(b:B)}}\mathsf {fib}_p(b) \\ &\quad \xrightarrow {\equiv } {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(b:B)}}{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(e:E)}} pe=_Bb \\ &\quad \xrightarrow {(1)} {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(e:E)}}{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(b:B)}} pe=_Bb \\ &\quad \xrightarrow {\equiv } {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(e:E)}} \left \{pe\right \}^+_{\Delta B} \\ &\quad \xrightarrow {(2)} E \end {aligned}Explicitly, f\left \langle b,\left \langle e,q\right \rangle \right \rangle \equiv e is an equivalence because the fan \left \{pe\right \}^+_{\Delta B} is contractible. Now we must define the following homotopy:
{\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(b:B)}}{\mathsf {fib}_p(b)})}} u.1 =_B p(u.2.1)Given b:B, e:E and q:pe=_Bb, we must construct the following identification:
b =_B p(e)For this, we use \bar q.
Now, if (\mathcal {U}, \mathcal {T}) is univalent, we have just exhibited \mathsf {str}_B as a section of \mathsf {unstr}_B.
Corollary The straightening/unstraightening equivalence [01JE]
- November 1, 2025
- Jon Sterling
When (\mathcal {U}, \mathcal {T}) is a univalent universe, we have established \mathsf {str}_B and \mathsf {unstr}_B to be mutually inverse for any B:\mathcal {U}: