Lemma. Truncation levels › Propositions are (some) sets [01G4]
Any proposition A is also a set. Assuming h_A: {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(x,y:A)}} x=_A y we must fill in the following hole: \begin {aligned} & \mathsf {propsAreSets}_A : {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(x,y:A)}} \mathsf {isProp}(x=_Ay) \\ &\mathsf {propsAreSets}_A~x~y :\equiv \{{?}[x,y]:\mathsf {isProp}(x=_Ay)\} \end {aligned}
Because contractible types are propositions, we can refine the goal further (this is a bit of a leap!):
\begin {aligned} & \mathsf {propsAreSets}_A : {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(x,y:A)}} \mathsf {isProp}(x=_Ay) \\ &\mathsf {propsAreSets}_A~x~y :\equiv \mathsf {contrTypesAreProps}~ \{{?}[x,y]:\mathsf {isContr}(x=_Ay)\} \end {aligned}To fill in the hole, we start making an auxiliary definition:
\begin {aligned} & \mathsf {propsAreSetsAux}_A : {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(x,y:A)}} \mathsf {isContr}(x=_Ay) \\ &\mathsf {propsAreSetsAux}_A~x~y = \{{?}[x,y]:\mathsf {isContr}(x=_Ay)\} \\\\ & \mathsf {propsAreSets}_A : {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(x,y:A)}} \mathsf {isProp}(x=_Ay) \\ &\mathsf {propsAreSets}_A~x~y :\equiv \mathsf {contrTypesAreProps}~(\mathsf {propsAreSetsAux}_A~x~y) \end {aligned}We start refining our auxiliary definition.
\begin {aligned} & \mathsf {propsAreSetsAux}_A : {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(x,y:A)}} \mathsf {isContr}(x=_Ay) \\ &\mathsf {propsAreSetsAux}_A~x~y~.1:\equiv \{{?_1}[x,y]:x=_Ay\} \\ &\mathsf {propsAreSetsAux}_A~x~y~.2~p:\equiv \{ {?_2}[x,y,p]: {?_1}[x,y] =_{x=_Ay} p \} \end {aligned}It is at this point where an idea is required, as there are several possibilities for how we might fill in ?_1. If we try defining {?_1}[x,y] :\equiv h_Axy, we will get stuck trying to fill in ?_2[x,y,p]. On the other hand, let's consider how we might eventually fill in the second hole regardless of how the first one gets filled in. It seems natural that we would use identification elimination to get rid of (y,p):
\begin {aligned} & \mathsf {propsAreSetsAux}_A : {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(x,y:A)}} \mathsf {isContr}(x=_Ay) \\ &\mathsf {propsAreSetsAux}_A~x~y~.1:\equiv \{{?_1}[x,y]:x=_Ay\} \\ &\mathsf {propsAreSetsAux}_A~x~x~.2~\mathsf {refl}_x:\equiv \{ {?_2}[x]: {?_1}[x,x] =_{x=_Ax} \mathsf {refl}_x \} \end {aligned}This is very interesting. What we know is that howsoever we fill in ?_1[x,y], we need to identify the “diagonal” case ?_1[x,x] with \mathsf {refl}_x. If we filled in {?_1}[x,y] :\equiv h_Axy we would be stuck when we try to fill in {?_2}[x]:h_Axx =_{x=_Ax}\mathsf {refl}_x. What we know is that whatever we do is going to have to involve h_Axy because that is the only way to identify x and y that we have in scope; but we need to do something that will vanish when x\equiv y. In this diagonal case, we will have some expression involving h_Axx and we want the rest of that expression to cancel this out so that we get \mathsf {refl}_x. One way to ensure this would be to find a way to define {?_1}[x,y] such that {?_1}[x,x] \equiv \overline {h_Axx}\cdot h_Axx, since this would cancel out due to the laws of identification flipping (see Exercise [01EN]). Thinking about this, we can come up with two good ideas for instantiating the hole:
- We could set {?_1}[x,y] :\equiv h_Axy\cdot \overline {h_Ayy}.
- Or we could set {?_1}[x,y] :\equiv \overline {h_Axx}\cdot h_Axy.
Both ideas will work, because we shall have h_Axx\cdot \overline {h_Axx} =_{x=_Ax} \mathsf {refl}_x =_{x=_Ax} \overline {h_Axx}\cdot h_Axx! Let’s do the second one:
\begin {aligned} & \mathsf {propsAreSetsAux}_A : {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(x,y:A)}} \mathsf {isContr}(x=_Ay) \\ &\mathsf {propsAreSetsAux}_A~x~y~.1:\equiv \overline {h_Axx}\cdot h_Axy \\ &\mathsf {propsAreSetsAux}_A~x~x~.2~\mathsf {refl}_x:\equiv \mathsf {flipPasteFlipLaw}~(h_Axx) \end {aligned}Above, we wrote \mathsf {flipPasteFlipLaw} for the witness constructed in Exercise [01EN].