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.

  1. 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 .
  2. 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 .
  3. 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 })