Dependent types I › Identification types [01E8]
- August 11, 2025
- Jon Sterling
Rule Formation [01EA]
- August 11, 2025
- Jon Sterling
Given A~\mathit {type} and u,v:A we may form the identification type u=_Av~\mathit {type}.
\frac { A~\mathit {type}\quad u,v:A }{ u=_Av~\mathit {type} }Rule Introduction [01EB]
- August 11, 2025
- Jon Sterling
Given A~\mathit {type} and u:A, we may form \mathsf {refl}_u:u=_Au.
\frac { A~\mathit {type}\quad u:A }{ \mathsf {refl}_u:u=_Au }The idea of the identity type on A is that for each u:A, the family x:A\vdash u=x~\mathit {type} is the smallest family of types equipped with an element \mathsf {refl}_u:u=_Au. We witness this by means of an elimination rule below.
Rule Elimination [01EC]
- August 11, 2025
- Jon Sterling
Fix A~\mathit {type} and u,v:A and w:u=_Av. Given a family y:A,z:u=_Ay\vdash C[y,z]~\mathit {type} and an element c:C[u,\mathsf {refl}_u], we may form \mathsf {J}_{y,z\mathpunct {.} C[y,z]}(w; c) :C[v,w].
\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] }The elimination rule provides an induction principle for identifications whose left end-point is u. It says that if you want to prove something for all such identifications starting with u, it suffices to prove it for the trivial one given by \mathsf {refl}_u:u=_Au.
Formally, the \mathsf {J} term secretly must mention u,v; we omit these because they can always be deduced from context. We may even write \mathsf {J}_C rather than \mathsf {J}_{y,z\mathpunct {.} C[y,z]} when our meaning is clear.
Rule Computation [01ED]
- August 11, 2025
- Jon Sterling
The computation rule for the identification type explains what the elimination rule does when applied to the trivial identification.
\frac { u:A\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]}(\mathsf {refl}_u; c) \equiv c :C[u,\mathsf {refl}_u] }Exercise Unicity of self-identifications [01EQ]
- August 11, 2025
- Jon Sterling
Using the elimination rule above, try to construct elements of the following types:
{\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u:A)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(p:u=_Au)}} p=_{u=_Au}\mathsf {refl}_u {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(u,v:A)}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(p,q:u=_Av)}} p=_{u=_Av}qWhat goes wrong? What do you think this implies about the notion of “sameness” that we get from identification types?
Definition Transport [01EO]
- August 11, 2025
- Jon Sterling
A special case of the identification elimination rule is transport. Where the elimination rule allows the family C to depend on the identification being eliminated, sometimes we only need to depend on one of its endpoints.
Given x:A\vdash B[x]~\mathit {type}, p:u=_Av, and b:B[u] we may define \begin {aligned} & \mathsf {transport}_{x\mathpunct {.}{B[x]}}(p;b) : B[v] \end {aligned} satisfying \mathsf {transport}_{x\mathpunct {.}{B[x]}}(\mathsf {refl}_u;b) \equiv b :B[u] using identification elimination: \mathsf {transport}_{x\mathpunct {.}B[x]}(p;b) :\equiv \mathsf {J}_{y,z\mathpunct {.}B[y]}(p; b)
We may write p_*^Bb for \mathsf {transport}_{x\mathpunct {.}{B[x]}}(p;b) or even p_*b when B is understood in context.
Warning A warning about transport [01EP]
- August 11, 2025
- Jon Sterling
If you find yourself using transport a lot, you are in for a world of trouble later. It is often a good sign that a different or more streamlined approach to the problem is needed. We will learn some methods for avoiding transports in later lectures.
The action of a function on identifications [01GN]
- August 11, 2025
- Jon Sterling
Given a function f:A\to B and an identification p:u=_Av we should be able to obtain an identification \mathsf {act}_fp:fu=_B fv. This should satisfy the judgemental equation \mathsf {act}_f(\mathsf {refl}_u)\equiv \mathsf {refl}_{fu}\text {.}
We can define the action using transport, where the family is a function space:
\mathsf {act}_fp :\equiv \bigl (\mathsf {transport}_{z\mathpunct {.} fz=_Bfx \to fz=_Bfy} (p; \lambda q\mathpunct {.}q)\bigr ) (\mathsf {refl}_{fu})Make sure you understand why the definition above work!
In many texts, this operation may be written \mathsf {ap}_fp; this stands for “action on paths”. In this course we prefer the word “identification” to “path”, but we might slip up sometimes. It is important to be flexible and find peace with a variety of different terminologies that may appear in different books and papers.
Exercise Unbiased elimination rule (extremely hard!) [01EE]
- August 11, 2025
- Jon Sterling
Prove that the elimination and computation rules for the identification type are equivalent to the following “unbiased” ones that do not fix u outside of the family C:
\frac { w:u=_A v\quad x:A,y:A,z:x=_Ay\vdash C[x,y,z]~\mathit {type}\quad x:A\vdash c[x]:C[x,x,\mathsf {refl}_u] \quad }{ \mathsf {J}'_{x,y,z\mathpunct {.}C[x,y,z]}(w; x\mathpunct {.} c[x]) : C[u,v,w] } \frac { u:A\quad x:A,y:A,z:x=_Ay\vdash C[x,y,z]~\mathit {type}\quad x:A\vdash c[x]:C[x,x,\mathsf {refl}_x] \quad }{ \mathsf {J}'_{x,y,z\mathpunct {.}C[x,y,z]}(\mathsf {refl}_u; x\mathpunct {.}{c[x]}) \equiv c[u] :C[u,u,\mathsf {refl}_u] }Explicitly, you are being asked to use \mathsf {J} to define \mathsf {J}' and vice versa. This exercise is extremely difficult, so don’t waste too much time on it.