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 })