Lecture. Dependent types II [01FF]
- August 27, 2025
- Jon Sterling
This lecture includes live-coding in the Agda proof assistant. It is recommended to install Agda on your own machine beforehand so that you can follow along; I use Emacs to edit Agda, but it is also possible to use Visual Studio Code. If you have difficulty installing Agda, you can also use an online Emacs session in your browser with Agda pre-loaded. We will start from scratch and not make use of any standard library. But first, we continue on with some basic non-Agda material.
More on identifications [01J9]
- August 27, 2025
- Jon Sterling
Flipping identifications [01EJ]
- October 15, 2025
- Jon Sterling
Fix A~\mathit {type} and u,v:A. Given an identification p:u=_Av we should be able to define a “flipped” identification \bar {p}:v=_Au. We will do so by means of an implicit definition:
\begin {aligned} & \mathsf {flip}: {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u,v:A)}}\; u=_Av\to v=_Au \\ & \mathsf {flip}~u~u~\mathsf {refl}_u :\equiv \mathsf {refl}_u \end {aligned}Then we define \bar {p}:\equiv \mathsf {flip}\,u\,v\,p when u,v are understood.
Above we were allowed to collapse the pair (v,p) to (u,\mathsf {refl}_u) by virtue of the identification elimination rule. The corresponding explicit definition is as follows:
\mathsf {flip} :\equiv \lambda u,v,p\mathpunct {.} \mathsf {J}_{y,z\mathpunct {.}y=u}(p; \mathsf {refl}_u)Lemma Flipping is involutive [01EK]
- October 15, 2025
- Jon Sterling
Given p:u=_Av, we may identify p with \overline {\overline {p}}. In particular, we may construct the following witness of involution:
\begin {aligned} & \mathsf {flipInv} : {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u,v:A)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(p:u=_Av)}} \overline {\overline {p}}=_{u=_Av} p \\ & \mathsf {flipInv}~u~u~\mathsf {refl}_u :\equiv \mathsf {refl}_{\mathsf {refl}_u} \end {aligned}The implicit definition above is justified by the following closed form:
\mathsf {flipInv} :\equiv \lambda u,v,p\mathpunct {.} \mathsf {J}_{y,q\mathpunct {.} \overline {\overline {q}} =_{u=_Ay} q}(p; \mathsf {refl}_{\mathsf {refl}_u})Definition Fibres [01ES]
By combining function types, dependent pair types, and identification types, we can finally define something useful. Given a function f:A\to B and an element b:B, we define the fibre of f over b to by the type of elements of A whose image in B is identified with b:
\mathsf {fib}_f(b) :\equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}} fx=_B bWe could have defined fibres with an equation in the opposite direction. The two versions are going to be equivalent; but if it matters, we’ll write the following notations:
\begin {aligned} \mathsf {fib}^-_f(b) &:\equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{fx=_Bb} \\ \mathsf {fib}^+_f(b) &:\equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}}{b=_B fx} \end {aligned}Singletons and singleton induction [01J6]
- October 15, 2025
- Jon Sterling
A special case of fibres is the singleton types.
Definition Inward and outward singleton types [01J7]
- October 15, 2025
- Jon Sterling
Given an element u:A, we may define the “inward” and “outward” singleton types respectively as follows:
\begin {aligned} \left \{u\right \}^-_{A} &:\equiv \mathsf {fib}^-_{1_A}(u) \equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}} x=_Au \\ \left \{u\right \}^+_{A} &:\equiv \mathsf {fib}^+_{1_A}(u) \equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:A)}} u=_Ax \end {aligned}Both the inward and outward singletons at u are inhabited by the pair \left \langle u,\mathsf {refl}_u\right \rangle .
Singleton induction [01J8]
- October 15, 2025
- Jon Sterling
We will now see how to reformulate the identification elimination rule into an “induction principle” for singletons. The idea is the following:
If you want to prove something about all \left \{u\right \}^\pm _{A} it suffices to consider just the trivial element \left \langle u,\mathsf {refl}_u\right \rangle .
In other words, \left \langle u,\mathsf {refl}_u\right \rangle is the “base case” for an induction on \left \{u\right \}^\pm _{A}, in the same way that 0 is the base case for mathematical induction; the induction here is simpler than mathematical induction, because there is only a base case and no inductive step.
We will derive singleton induction using the \mathsf {J} elimination rule, which we recall below:
\frac { w:u=_Av\quad y:A,z:u=_Ay\vdash C[y,z]~\mathit {type}\quad c:C[u,\mathsf {refl}_u] }{ \mathsf {J}_{y,z\mathpunct {.} C[y,z]}(w; c) :C[v,w] }We wish to define the following derived forms:
\frac { z:\left \{u\right \}^-_{A}\vdash C[z]~\mathit {type} \quad p:\left \{u\right \}^\pm _{A} \quad c:C[\left \langle u,\mathsf {refl}_u\right \rangle ] }{ \mathsf {J}^\pm _{z\mathpunct {.}{C[z]}}(p; c): C[p] }We can specify the following implicit definitions for the derived induction principles:
\begin {aligned} \mathsf {J}^+_{z\mathpunct {.}C[z]}(\left \langle u,\mathsf {refl}_u\right \rangle ; c) &:\equiv c\\ \mathsf {J}^-_{z\mathpunct {.}C[z]}(\left \langle u,\mathsf {refl}_u\right \rangle ; c) &:\equiv c \end {aligned}The first one above is easy to justify:
\begin {aligned} \mathsf {J}^+_{z\mathpunct {.}{C[z]}}(p; c) &:\equiv \mathsf {J}_{y,z\mathpunct {.}{C[\left \langle y,z\right \rangle ]}}( p.2 ; c) \end {aligned}The second one is harder to justify. It turns out that the simplest way to proceed is to first define a “defective” version of \mathsf {J}^- in terms of \mathsf {J}^- that has the wrong type, and then use transport to correct the type. In particular, we define:
\begin {aligned} & \tilde {\mathsf {J}}^-_{z\mathpunct {.}C[z]}(p;c) : C \left \langle p.1, \overline {\overline {p.2}}\right \rangle \\ &\tilde {\mathsf {J}}^-_{z\mathpunct {.}C[z]}(p;c) :\equiv \mathsf {J}^+_{z\mathpunct {.}{C\left [\left \langle z.1,\overline {z.2}\right \rangle \right ]}}\left (\left \langle p.1,\overline {p.2}\right \rangle ; c\right ) \end {aligned}Then we define:
\mathsf {J}^-_{z\mathpunct {.}{C[z]}}(p; c) :\equiv \mathsf {transport}_{q\mathpunct {.} C[\left \langle p.1,q\right \rangle ]}(\mathsf {flipInv}~(p.1)~u~(p.2); \tilde {\mathsf {J}}^-_{z\mathpunct {.}C[z]}(p;c) )You need to convince yourself that all of the above is well-typed.
The benefit of singleton induction is that it provides a (perhaps) less noisy way to think about the identification elimination rule, and gives a schema for defining correct implicit definitions by “matching” on identifications no matter which side of the identification the “fixed” variable is located.
The three operations \mathsf {J}, \mathsf {J}^+, and \mathsf {J}^- are all equivalent, in the sense that you can derive any two from the remaining one. There is a further option seen in Exercise [01EE], which is also equivalent to all of these. In the end, we work mainly with implicit definitions which we know to be justified by any one of these principles.
Contractibility of singletons [01ER]
Using singleton induction, we can easily prove that any singleton \left \{u\right \}^\pm _{A} is “really” a singleton, in the sense that all its elements are equal to the trivial element \left \langle u,\mathsf {refl}_u\right \rangle . This property is called contractibility, which we will learn about in generality later. In particular, singleton elimination justifies the following implicit definition:
\begin {aligned} &\mathsf {singlContr}_A^\pm : {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u:A)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(s:\left \{u\right \}^\pm _{A})}} s=_{\left \{u\right \}^\pm _{A}} \left \langle u,\mathsf {refl}_u\right \rangle \\ &\mathsf {singlContr}_A^\pm ~u~\left \langle u,\mathsf {refl}_u\right \rangle :\equiv \mathsf {refl}_{\left \langle u,\mathsf {refl}_u\right \rangle } \end {aligned}Before we justify this with an explicit definition, we will first explain the “idea” of the definition in English.
- We have u:A and s:\left \{u\right \}^\pm _{A} and we are trying to construct \mathsf {singlContr}_A^\pm ~u~s : s =_{\left \{u\right \}^\pm _{A}} \left \langle u,\mathsf {refl}_u\right \rangle .
- By singleton induction it suffices to consider just the case where s \equiv \left \langle u,\mathsf {refl}_u\right \rangle ; in this case, then, we are trying to construct \mathsf {singlContr}_A^\pm ~\left \langle u,\mathsf {refl}_u\right \rangle : \left \langle u,\mathsf {refl}_u\right \rangle =_{\left \{u\right \}^\pm _{A}} \left \langle u,\mathsf {refl}_u\right \rangle .
- We finish off with the reflexive identification.
The explicit definition is as follows:
\mathsf {singlContr}^\pm _A :\equiv \lambda u,s\mathpunct {.} \mathsf {J}^\pm _{z\mathpunct {.} z=_{\left \{u\right \}^\pm _{A}} \left \langle u,\mathsf {refl}_u\right \rangle }(s; \mathsf {refl}_{\left \langle u,\mathsf {refl}_u\right \rangle })Pasting identifications [01EH]
- October 15, 2025
- Jon Sterling
Fix A~\mathit {type} and u,v,w:A. Given p:u=_Av and q:v=_Aw we may define an identification p\cdot q:u=_Aw. The idea of the pasting operation is to use identification elimination to consider just the case where (v,p) \equiv (u,\mathsf {refl}_u); in that case we would have q:u=_Aw and so we may just return that. We first give an implicit definition of the pasting operation, and then we will show that it is well-defined by constructing an explicit definition:
\begin {aligned} & \mathsf {paste}: {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u,v,w:A)}} \; u=_Av\to v=_Aw\to u=_Aw \\ & \mathsf {paste}~u~u~w~\mathsf {refl}_{u}~q :\equiv q \end {aligned}Then we would define p\cdot q :\equiv \mathsf {paste}~u~v~w~p~q when u,v,w are understood.
In our implicit definition above, we have given an equation just for the case where the first two vertices are exactly the same and the first edge is the trivial one. The informal rule of thumb is that when you are binding a pair (v,p) of an identification p:u=_Av with one of its endpoints, you are free to collapse this data to (u,\mathsf {refl}_u); when both endpoints are fixed, you can’t do this. The collapsing move used above is justified by the identification elimination rule, which we can show by instantiating the above with an explicit definition.
\begin {aligned} & \mathsf {paste}: {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u,v,w:A)}} \; u=_Av\to v=_Aw\to u=_Aw \\ & \mathsf {paste} :\equiv \lambda u,v,w,p\mathpunct {.} \mathsf {J}_{ y,z\mathpunct {.} y=_Aw\to u=_Aw }(p; \lambda q\mathpunct {.}{q}) \end {aligned}We verify that the defining equation holds:
\begin {aligned} &\mathsf {paste}~u~u~w~\mathsf {refl}_u~q \\ &\quad \equiv \mathsf {J}_{y,z\mathpunct {.}y=_Aw\to u=_Aw}(\mathsf {refl}_u; \lambda q\mathpunct {.}{q}) ~q \\ &\quad \equiv (\lambda q\mathpunct {.}{q})~q \\ &\quad \equiv q \end {aligned}If you are not yet confident in the use of implicit definitions, you should verify that this equation uniquely defines \mathsf {paste}. In particular, we might check for any f:{\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u,v,w:A)}}u=_Av\to v=_Aw\to u=_Aw satisfying f~u~u~w~\mathsf {refl}_u~q \equiv q we may find some family of identifications H_f: {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u,v,w:A)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(p:u=_Av)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(q:v=_Aw)}} fuvwpq =_{u=_Aw} \mathsf {paste}~u~v~w~p~q \text {.}
For clarity, we give an implicit definition of H_f:
H_f~u~u~w~\mathsf {refl}_u~q :\equiv \mathsf {refl}_qThe corresponding explicit definition would be a more complicated instance of \mathsf {J}:
H_f :\equiv \lambda u,v,w,p\mathpunct {.} \mathsf {J}_{ y,z\mathpunct {.} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(q:y=_Aw)}} fuywzq =_{u=_Aw} \mathsf {paste}~u~y~w~z~q }(p; \lambda q\mathpunct {.} \mathsf {refl}_q )Basic results [01EL]
- October 15, 2025
- Jon Sterling
Exercise Pasting is associative [01EM]
- October 15, 2025
- Jon Sterling
Construct an element of the following type witnessing that pasting is associative:
{\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u,v,w,x:A)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(p:u=_Av)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(q:v=_Aw)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(r:w=_Ax)}} u\cdot (v\cdot w) =_{u=_Aw} (u\cdot v) \cdot wExercise Flipping inverts identifications [01EN]
- October 15, 2025
- Jon Sterling
Construct an element of the following type witnessing that the result of composing an identification with its flipping is trivial:
{\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u,v:A)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(p:u=_Av)}} p\cdot \bar p =_{u=_Au} \mathsf {refl}_uUniverses, or types of types [01ET]
- October 15, 2025
- Jon Sterling
As we have presented it, dependent type theory has two kinds of entity: types and their elements. In many cases, it is useful to have a type whose elements are themselves types!
- Even though we have not been shy about writing phrases like “Let A be a type”, we do not currently have the ability to say something like “Let f be a polymorphic function on lists”. If we had a type of types like \mathsf {type}~\mathit {type}, we would give f a precise typing like f:{\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(A:\mathsf {type})}}\;\mathsf {List}~A\to \mathsf {List}~A.
- If we had a type of types, we would be able to define more examples of dependent types that do something different depending on some value. For example, we would be able to define a type-level
ifexpression without relying on large elimination. In fact, we will see that either large elimination or a universe is required to prove that \mathsf {true} is not equal to \mathsf {false}!
We do need to be careful, for two reasons:
- Syntactic objection. A type of types doesn’t make sense, because types are syntactically different kinds of entities from elements. We will solve this by distinguishing between the “code” of a type, which is an element, and the type that it encodes.
- Semantic objection. Even if we address the syntactic objection, a type of all types leads to contradiction via the Burali-Forti/Russell “paradox”, because such a type would include itself. Sidenote: the term “paradox” comes from a time when people were far more confused than we are today; we should think of these as no-go theorems instead. We will solve this by considering only types of some types.
Although there are many ways to handle these things in a technical sense, we will adopt a particular approach described by Rijke. The idea is to have a type \mathcal {U}~\mathit {type} together with a family X:\mathcal {U}\vdash \mathcal {T}[X]~\mathit {type}; then an element X:\mathcal {U} is thought of as encoding the type \mathcal {T}[X]~\mathit {type}.
Definition Universe [01F6]
- October 15, 2025
- Jon Sterling
A universe is defined to be a type \mathcal {U}~\mathit {type} together with a family X:\mathcal {U}\vdash \mathcal {T}[X]~\mathit {type} that is closed under all the type constructors in the sense that we have the following operations and laws:
\frac {}{ \overline {\mathsf {empty}}:\mathcal {U} \qquad \mathcal {T}[\overline {\mathsf {empty}}]\equiv \mathsf {empty} ~\mathit {type} } \frac {}{ \overline {\mathsf {unit}}:\mathcal {U} \qquad \mathcal {T}[\overline {\mathsf {unit}}]\equiv \mathsf {unit} ~\mathit {type} } \frac {}{ \overline {\mathsf {bool}}:\mathcal {U} \qquad \mathcal {T}[\overline {\mathsf {bool}}]\equiv \mathsf {bool} ~\mathit {type} } \frac { X:\mathcal {U}\quad x:\mathcal {T}[X]\vdash Y[x]:\mathcal {U} }{ {\mathop {\mathchoice {\textstyle \overline \prod }{\textstyle \overline \prod }{\scriptstyle \overline \prod }{\scriptscriptstyle \overline \prod } }_{(x:X)}}Y[x]:\mathcal {U} \qquad \mathcal {T}\bigl [ {\mathop {\mathchoice {\textstyle \overline \prod }{\textstyle \overline \prod }{\scriptstyle \overline \prod }{\scriptscriptstyle \overline \prod } }_{(x:X)}}Y[x] \bigr ] \equiv {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(x:\mathcal {T}[X])}} \mathcal {T}[Y[x]] ~\mathit {type} } \frac { X:\mathcal {U}\quad x:\mathcal {T}[X]\vdash Y[x]:\mathcal {U} }{ {\mathop {\mathchoice {\textstyle \overline \sum }{\textstyle \overline \sum }{\scriptstyle \overline \sum }{\scriptscriptstyle \overline \sum } }_{(x:X)}}Y[x]:\mathcal {U} \qquad \mathcal {T}\bigl [ {\mathop {\mathchoice {\textstyle \overline \sum }{\textstyle \overline \sum }{\scriptstyle \overline \sum }{\scriptscriptstyle \overline \sum } }_{(x:X)}}Y[x] \bigr ] \equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:\mathcal {T}[X])}} \mathcal {T}[Y[x]] ~\mathit {type} } \frac { X:\mathcal {U}\quad u,v:\mathcal {T}[X] }{ \overline {\mathsf {Id}}(X,u,v):\mathcal {U} \qquad \mathcal {T}[ \overline {\mathsf {Id}}(X,u,v) ]\equiv (u =_{\mathcal {T}[X]} v) ~\mathit {type} }Conflating elements of universes and types [01F7]
- October 15, 2025
- Jon Sterling
Now, because we have avoided syntactically conflating elements with types, we are free to conflate them notationally:
- When we have X:\mathcal {U}, we may simply write X~\mathit {type} to mean \mathcal {T}[X]~\mathit {type}.
- When we have A~\mathit {type} such that we know of some evident \bar {A}:\mathcal {U} such that A\equiv \mathcal {T}[\bar {A}]~\mathit {type}, we may simply write A:\mathcal {U} rather than \bar {A}:\mathcal {U}.
The above are only notation: we are not changing the syntactic status of types and elements, but instead describing a convention by which readers and writers agree to understand expressions involving universes.
The axiom of universes [01F8]
- October 15, 2025
- Jon Sterling
We have not assumed that any universes actually exist; we have just described the rules of universes. There are many ways to axiomatise universes, but one particularly clean approach (due to Grothendieck and adapted to the type theoretic setting by Rijke) is to declare that for any finite sequence of families \mathbf {A} \equiv (A_i~\mathit {type})_{(i<n)} \qquad \mathbf {B} \equiv (x:A_i\vdash B_i[x]~\mathit {type})_{(i<n)} we have a universe (\mathcal {U}_{\mathbf {A},\mathbf {B}}, \mathcal {T}_{\mathcal {A},\mathcal {B}}) closed additionally under the following rules for each k<n: \frac { u:A_k }{ \overline {B_k[u]}:\mathcal {U}_{\mathbf {A},\mathbf {B}} \qquad \mathcal {T}\bigl [ \overline {B_k[u]} \bigr ] \equiv B_k[u] ~\mathit {type} }
It can be difficult to understand what is going on in the axiom of universes. It is simplest to understand in the case of n=1, so that we are looking at a single family x:A\vdash B[x]~\mathit {type}. In this case, the universe \mathcal {U}_{A,B} contains each type B[u] for u:A; so the role of the family here is to close the universe under all the components of a family at once. Multiple families are allowed for further expressivity; to see why this is needed, consider the following example of a universe hierarchy:
Example A hierarchy of universes [01FA]
- October 15, 2025
- Jon Sterling
We let (\mathcal {U}_0,\mathcal {T}_0) be the universe associated to the empty set of families. Then for each n, we define (\mathcal {U}_{n+1},\mathcal {T}_{n+1}) to be universe associated to the following two families:
\_:\mathsf {unit}\vdash \mathcal {U}_n~\mathit {type} \qquad X:\mathcal {U}_n\vdash \mathcal {T}_n[X]~\mathit {type}Thus \mathcal {U}_1 contains \mathcal {U}_0 and also any type that \mathcal {U}_0 contains, and so on
Many presentations of type theory (including those used in Agda, Rocq, and Lean) impose universe hierarchies at the start. We’ll take an agnostic approach, and just assume a universe where it is needed. We won’t assume that this universe necessarily comes from the hierarchy described above.
Non-triviality of the booleans, cooked two ways [01FB]
When we say that the booleans are non-trivial, we mean that \mathsf {true} is not equal to \mathsf {false}. This kind of statement can be expressed in type theory by the following type:
\mathsf {true} =_{\mathsf {bool}} \mathsf {false} \to \mathsf {empty}An element of the type above would witness that \mathsf {true} =_{\mathsf {bool}} \mathsf {false} is contradictory, since if the antecedent would be witnessed, then we would be able to form an element of the empty type. Without either large elimination or a universe, we cannot construct a witness of this type; I don’t just mean that it is not easy to see how to construct such a witness, but rather that type theory without these facilities is consistent with there being a witness of \mathsf {true} =_{\mathsf {bool}} \mathsf {false} or even with the judgemental assertion \mathsf {true} \equiv \mathsf {false}:\mathsf {bool} holding. (Consistency can be seen using a very simple model where every type is interpreted by a subsingleton set.) So large eliminations and universes add a lot of power!
Via large elimination [01FC]
Let us see how to witness \mathsf {true} =_{\mathsf {bool}}\mathsf {false}\to \mathsf {empty} using a large elimination. First define a family x:\mathsf {bool}\vdash T[x]~\mathit {type} using the large elimination: T[x] :\equiv \mathsf {If}(x, \mathsf {unit}, \mathsf {empty})
Then we define a witness f:\mathsf {true} =_{\mathsf {bool}}\mathsf {false}\to \mathsf {empty} using transport:
fp :\equiv p_*^T()To see that the above makes sense, we note that p_*^T is a function from T[\mathsf {true}] to T[\mathsf {false}] because we have p:\mathsf {true}=_{\mathsf {bool}}\mathsf {false}. But T[\mathsf {true}]\equiv \mathsf {unit} and T[\mathsf {false}]\equiv \mathsf {empty}! So we have p_*^T():\mathsf {empty}.
Via a universe [01FD]
Let (\mathcal {U},\mathcal {T}) be a universe. Then we define the famiy x:\mathsf {bool}\vdash T[x]~\mathit {type} using the universe and the ordinary elimination rule of the booleans:
T[x] :\equiv \mathcal {T}\bigl [ \mathsf {if}_{\_\mathpunct {.}\mathcal {U}}(x, \overline {\mathsf {unit}}, \overline {\mathsf {empty}}) \bigr ]The witness f:\mathsf {true}=_{\mathsf {bool}}\mathsf {false}\to \mathsf {empty} is then defined as in § [01FC]:
fp :\equiv p_*^T()This works because T[\mathsf {true}] \equiv \mathcal {T}[\overline {\mathsf {unit}}]\equiv \mathsf {unit} and T[\mathsf {false}]\equiv \mathcal {T}[\overline {\mathsf {empty}}]\equiv \mathsf {empty}.
Exercises [01J5]
- August 27, 2025
- Jon Sterling
Exercise. Pasting identifications › Basic results › Pasting is associative [01EM]
- October 15, 2025
- Jon Sterling
Construct an element of the following type witnessing that pasting is associative:
{\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u,v,w,x:A)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(p:u=_Av)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(q:v=_Aw)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(r:w=_Ax)}} u\cdot (v\cdot w) =_{u=_Aw} (u\cdot v) \cdot wExercise. Pasting identifications › Basic results › Flipping inverts identifications [01EN]
- October 15, 2025
- Jon Sterling
Construct an element of the following type witnessing that the result of composing an identification with its flipping is trivial:
{\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u,v:A)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(p:u=_Av)}} p\cdot \bar p =_{u=_Au} \mathsf {refl}_u