···11\input{nodes/conventions}
2233\begin{xsect}{Introduction}
44- In the setting of Martin-L\"of's intensional type theory~\citep{nordstrom-peterson-smith:1990}, every type $A$ comes equipped with a type constructor $x:A,y:A\vdash \Id{A}{x}{y}:\TYPE$ that classifies \emph{identifications} between elements of $A$, \ie witnesses that two given elements are ``equal''. Rather than being defined separately for each $A$, the identity type constructor $\IdCon{A}$ is specified generically for all types by means of formation, introduction, elimination, and computation rules:
55- %
66- \begin{mathparpagebreakable}
77- \inferrule[formation]{
88- \Gamma\vdash A:\TYPE\\
99- \Gamma\vdash u,v:A
1010- }{
1111- \Gamma\vdash\Id{A}{u}{v}:\TYPE
1212- }
1313- \and
1414- \inferrule[introduction]{
1515- \Gamma\vdash A:\TYPE\\
1616- \Gamma\vdash u:A
1717- }{
1818- \Gamma\vdash \Refl : \Id{A}{u}{u}
1919- }
2020- \and
2121- \inferrule[elimination]{
2222- \Gamma\vdash A:\TYPE\\
2323- \Gamma,x:A,y:A,p:\Id{A}{x}{y}\vdash C\prn{x,y,p}:\TYPE\\\\
2424- \Gamma,x:A\vdash c\prn{x} : C\prn{x,x,\Refl}\\
2525- \Gamma\vdash u,v:A\\
2626- \Gamma\vdash w:\Id{A}{u}{v}
2727- }{
2828- \Gamma\vdash \J{A}{C}{c}{u}{v}{w} : C\prn{u,v,w}
2929- }
3030- \and
3131- \inferrule[computation]{
3232- \Gamma\vdash A:\TYPE\\
3333- \Gamma,x:A,y:A,p:\Id{A}{x}{y}\vdash C\prn{x,y,p}:\TYPE\\
3434- \Gamma,x:A\vdash c\prn{x} : C\prn{x,x,\Refl}\\
3535- \Gamma\vdash u:A
3636- }{
3737- \Gamma\vdash \J{A}{C}{c}{u}{u}{\Refl} \equiv c\prn{u} : C\prn{u,u,\Refl}
3838- }
3939- \end{mathparpagebreakable}
4044141- The formation and introduction rule for the identity type can be thought of as equipping $A$ with the structure of a \emph{reflexive graph}\footnote{In the context of category theory, one uses the term ``graph'' to refer to what combinatorialists would normally refer to as \emph{multigraphs} or \emph{pseudo-graphs}. A graph in the traditional sense would be a graph (in the present generalised sense) in which the type of vertices is a set and the type of edges between two fixed vertices is a proposition; we might refer to such objects as ``locally propositional set-graphs''.} (see \cref{def:reflexive-graph}). The elimination and computation rule then ensure that this reflexive graph structure is the smallest possible one that can be formed with vertices in $A$.
55+ \begin{xsect}{Martin-L\"of's identity types}
66+ In the setting of Martin-L\"of's intensional type theory~\citep{nordstrom-peterson-smith:1990}, every type $A$ comes equipped with a type constructor $x:A,y:A\vdash \Id{A}{x}{y}:\TYPE$ that classifies \emph{identifications} between elements of $A$, \ie witnesses that two given elements are ``equal''. Rather than being defined separately for each $A$, the identity type constructor $\IdCon{A}$ is specified generically for all types by means of formation, introduction, elimination, and computation rules:
77+ %
88+ \begin{mathparpagebreakable}
99+ \inferrule[formation]{
1010+ \Gamma\vdash A:\TYPE\\
1111+ \Gamma\vdash u,v:A
1212+ }{
1313+ \Gamma\vdash\Id{A}{u}{v}:\TYPE
1414+ }
1515+ \and
1616+ \inferrule[introduction]{
1717+ \Gamma\vdash A:\TYPE\\
1818+ \Gamma\vdash u:A
1919+ }{
2020+ \Gamma\vdash \Refl : \Id{A}{u}{u}
2121+ }
2222+ \and
2323+ \inferrule[elimination]{
2424+ \Gamma\vdash A:\TYPE\\
2525+ \Gamma,x:A,y:A,p:\Id{A}{x}{y}\vdash C\prn{x,y,p}:\TYPE\\\\
2626+ \Gamma,x:A\vdash c\prn{x} : C\prn{x,x,\Refl}\\
2727+ \Gamma\vdash u,v:A\\
2828+ \Gamma\vdash w:\Id{A}{u}{v}
2929+ }{
3030+ \Gamma\vdash \J{A}{C}{c}{u}{v}{w} : C\prn{u,v,w}
3131+ }
3232+ \and
3333+ \inferrule[computation]{
3434+ \Gamma\vdash A:\TYPE\\
3535+ \Gamma,x:A,y:A,p:\Id{A}{x}{y}\vdash C\prn{x,y,p}:\TYPE\\
3636+ \Gamma,x:A\vdash c\prn{x} : C\prn{x,x,\Refl}\\
3737+ \Gamma\vdash u:A
3838+ }{
3939+ \Gamma\vdash \J{A}{C}{c}{u}{u}{\Refl} \equiv c\prn{u} : C\prn{u,u,\Refl}
4040+ }
4141+ \end{mathparpagebreakable}
42424343- This universal property of the identity type ensures that identifications between elements of a given type $A$ are automatically respected by any possible construction or predicate.
4343+ The formation and introduction rule for the identity type can be thought of as equipping $A$ with the structure of a \emph{reflexive graph}\footnote{In the context of category theory, one uses the term ``graph'' to refer to what combinatorialists would normally refer to as \emph{multigraphs} or \emph{pseudo-graphs}. A graph in the traditional sense would be a graph (in the present generalised sense) in which the type of vertices is a set and the type of edges between two fixed vertices is a proposition; we might refer to such objects as ``locally propositional set-graphs''.} (see \cref{def:reflexive-graph}). The elimination and computation rule then ensure that this reflexive graph structure is the smallest possible one that can be formed with vertices in $A$. This universal property is most commonly employed in terms of the principle of \emph{identification induction} below.
44444545+ \begin{principle}[{Identification induction}]\label[principle]{principle:identification-induction}
4646+ Given a family of types $x,y:A;p:\Id{A}{x}{y}\vdash C\prn{x,y,p}: \TYPE$, to define a dependent function $x,y:A;p:\Id{A}{x}{y}\vdash f\prn{x,y,p}:C\prn{x,y,p}$ it suffices to specify $x:A\vdash f\prn{x,x,\Refl}:C\prn{x,x,\Refl}$.
4747+ \end{principle}
45484646- % \begin{xsect}{Using identification induction}
4747- % As discussed in \S1.12.1 of the HoTT Book~\citep{hottbook}, the primitive elimination and computation rules of the identity type constructor allow for the definition of (dependent) functions on identifications by \emph{induction}.
48494949- % \begin{principle}[{Identification induction}]\label[principle]{principle:identification-induction}
5050- % Given a family of types \[x,y:A;p:\Id{A}{x}{y}\vdash C\prn{x,y,p}: \TYPE,\] to define a dependent function \[x,y:A;p:\Id{A}{x}{y}\vdash f\prn{x,y,p}:C\prn{x,y,p}\] it suffices to specify $x:A\vdash f\prn{x,x,\Refl}:C\prn{x,x,\Refl}$.
5151- % \end{principle}
5050+ \begin{proof}
5151+ To define $x,y,p\vdash f\prn{x,y,p}:C\prn{x,y,p}$ in terms of $x\vdash f\prn{x,x,\Refl}:C\prn{x,x,\Refl}$, we use the elimination rule of the identity type as follows:
5252+ \[
5353+ f\prn{x,y,p} :\equiv
5454+ \J{A}{C}{\Bind{x}f\prn{x,x,\Refl}}{x}{y}{p}
5555+ \qedhere
5656+ \]
5757+ \end{proof}
52585353- % \begin{proof}
5454- % To define $x,y,p\vdash f\prn{x,y,p}:C\prn{x,y,p}$ in terms of $x\vdash f\prn{x,x,\Refl}:C\prn{x,x,\Refl}$, we use the elimination rule of the identity type as follows:
5555- % \[
5656- % f\prn{x,y,p} :\equiv
5757- % \J{A}{C}{\Bind{x}f\prn{x,x,\Refl}}{x}{y}{p}
5858- % \qedhere
5959- % \]
6060- % \end{proof}
5959+ A special case of \cref{principle:identification-induction} is \emph{transport}, which materialises identifications $\Id{A}{u}{v}$ as functions $B\prn{u}\to B\prn{v}$ for any family $x:A\vdash B\prn{x}:\TYPE$.
61606262- % A special case of \cref{principle:identification-induction} is \emph{transport}, which materialises identifications $\Id{A}{u}{v}$ as functions $B\prn{u}\to B\prn{v}$ for any family $x:A\vdash B\prn{x}:\TYPE$.
6161+ \begin{corollary}[Transport]\label[corollary]{cor:transport}
6262+ Given a family of types $x:A\vdash B\prn{x}: \TYPE$, for any $x,y:A$ and $p:\Id{A}{x}{y}$ we may define a mapping $p_*^B\colon B\prn{x} \to B\prn{y}$ such that for all $x : A$ and $b:B\prn{x}$ we have $\Refl_* b \equiv b$.
6363+ \end{corollary}
63646464- % \begin{corollary}[Transport]\label[corollary]{cor:transport}
6565- % Given a family of types $x:A\vdash B\prn{x}: \TYPE$, for any $x,y:A$ and $p:\Id{A}{x}{y}$ we may define a mapping $p_*^B\colon B\prn{x} \to B\prn{y}$ such that for all $x : A$ and $b:B\prn{x}$ we have $\Refl_* b \equiv b$.
6666- % \end{corollary}
6565+ \begin{proof}
6666+ Let $C\prn{x,y,p} :\equiv B\prn{x} \to B\prn{y}$; using \cref{principle:identification-induction} we may define a dependent function $\mathsf{transport}\prn{x,y,p}:C\prn{x,y,p}$ by specifying
6767+ $
6868+ \mathsf{transport}\prn{x,x,\Refl} :\equiv \Lam{b}b
6969+ $. Then for any $p:\Id{A}{x}{y}$ we define $p_*^Bb :\equiv \mathsf{transport}\prn{x,y,p}$.
7070+ \end{proof}
67716868- % \begin{proof}
6969- % Let $C\prn{x,y,p} :\equiv B\prn{x} \to B\prn{y}$; using \cref{principle:identification-induction} we may define a dependent function $\mathsf{transport}\prn{x,y,p}:C\prn{x,y,p}$ by specifying
7070- % $
7171- % \mathsf{transport}\prn{x,x,\Refl} :\equiv \Lam{b}b
7272- % $. Then for any $p:\Id{A}{x}{y}$ we define $p_*^Bb :\equiv \mathsf{transport}\prn{x,y,p}$.
7373- % \end{proof}
7272+ \begin{definition}[Singletons]\label[definition]{def:singleton}
7373+ Given an element $u:A$, we define the \DefEmph{singleton type} at $x$ to be the type $\Singleton{A}{u}$ of elements of $A$ equipped with identifications from $u$:
7474+ \[
7575+ \Singleton{A}{u} :\equiv \Sum{y:A}\Id{A}{u}{y}
7676+ \]
7777+ \end{definition}
74787575- % \begin{definition}[Singletons]\label[definition]{def:singleton}
7676- % Given an element $u:A$, we define the \DefEmph{singleton type} at $x$ to be the type $\Singleton{A}{u}$ of elements of $A$ equipped with identifications from $u$:
7777- % \[
7878- % \Singleton{A}{u} :\equiv \Sum{y:A}\Id{A}{u}{y}
7979- % \]
8080- % \end{definition}
7979+ Of course, the simplest element of $\Singleton{A}{u}$ is the pair $\prn{u,\Refl}$. We can prove using \cref{principle:identification-induction} that $\prn{u,\Refl}$ is the \emph{only} element of $\Singleton{A}{u}$.
81808282- % Of course, the simplest element of $\Singleton{A}{u}$ is the pair $\prn{u,\Refl}$. We can prove using \cref{principle:identification-induction} that $\prn{u,\Refl}$ is the \emph{only} element of $\Singleton{A}{u}$.
8181+ \begin{corollary}[Contractibility of singletons]\label[corollary]{cor:contractibility-of-singletons}
8282+ For any fixed element $u:A$, we may define a dependent function
8383+ $\Phi_{u} \colon \Prod{q : \Singleton{A}{u}} \Id{\Singleton{A}{u}}{\prn{u,\Refl}}{q}$ witnessing that any element of $\Singleton{A}{u}$ can be identified with $\prn{u,\Refl}$, such that $\Phi_u\,\prn{u,\Refl} \equiv \Refl$.
8484+ \end{corollary}
83858484- % \begin{corollary}[Contractibility of singletons]\label[corollary]{cor:contractibility-of-singletons}
8585- % For any fixed element $u:A$, we may define a dependent function
8686- % $\Phi_{u} \colon \Prod{q : \Singleton{A}{u}} \Id{\Singleton{A}{u}}{\prn{u,\Refl}}{q}$ witnessing that any element of $\Singleton{A}{u}$ can be identified with $\prn{u,\Refl}$, such that $\Phi_u\,\prn{u,\Refl} \equiv \Refl$.
8787- % \end{corollary}
8686+ \begin{proof}
8787+ We define the following dependent function using \cref{principle:identification-induction}:
88888989- % \begin{proof}
9090- % We define the following dependent function using \cref{principle:identification-induction}:
8989+ \iblock{
9090+ \mhang{
9191+ x,y:A;p:\Id{A}{x}{y} \vdash \Phi_x\prn{y,p} :
9292+ \Id{\Singleton{A}{x}}{\prn{x,\Refl}}{\prn{y,q}}
9393+ }{
9494+ \commentrow{by \cref{principle:identification-induction}}
9595+ \mrow{
9696+ x:A\vdash \Phi_x\prn{x,\Refl} : \Id{\Singleton{A}{x}}{\prn{x,\Refl}}{\prn{x,\Refl}}
9797+ }
9898+ \commentrow{by reflexivity}
9999+ \mrow{
100100+ x:A\vdash \Phi_x\prn{x,\Refl} :\equiv \Refl
101101+ }
102102+ \qedhere
103103+ }
104104+ }
105105+ \end{proof}
911069292- % \iblock{
9393- % \mhang{
9494- % x,y:A;p:\Id{A}{x}{y} \vdash \Phi_x\prn{y,p} :
9595- % \Id{\Singleton{A}{x}}{\prn{x,\Refl}}{\prn{y,q}}
9696- % }{
9797- % \commentrow{by \cref{principle:identification-induction}}
9898- % \mrow{
9999- % x:A\vdash \Phi_x\prn{x,\Refl} : \Id{\Singleton{A}{x}}{\prn{x,\Refl}}{\prn{x,\Refl}}
100100- % }
101101- % \commentrow{by reflexivity}
102102- % \mrow{
103103- % x:A\vdash \Phi_x\prn{x,\Refl} :\equiv \Refl
104104- % }
105105- % \qedhere
106106- % }
107107- % }
108108- % \end{proof}
109107110110- % There is an alternative, equivalent, formulation of identification induction due to \citet{paulin-mohring:1993}, that fixes an element $u:A$ and allows induction on data of the form $y:A, p:u=y$. This is called ``based identification induction'':
108108+ There is an alternative, equivalent, formulation of identification induction due to \citet{paulin-mohring:1993}, that fixes an element $u:A$ and allows induction on data of the form $y:A, p:u=y$. This is called ``based identification induction'':
111109112112- % \begin{principle}[{Based identification induction}]\label[principle]{principle:based-identification-induction}
113113- % Given a fixed element $u:A$ and a family of types $y:A,p:\Id{A}{u}{y}\vdash B\prn{y,p}:\TYPE$, to define a dependent function $y:A,p:\Id{A}{u}{y}\vdash f\prn{y,p}:B\prn{y,p}$ it suffices to specify $f\prn{u,\Refl} : B\prn{u,\Refl}$.
114114- % \end{principle}
115110116116- % %% Typo, but I have to re-understand the math to fix the typo.
117117- % It is not difficult to \cref{principle:identification-induction} to \cref{principle:based-identification-induction}. The converse direction is slightly more difficult and rests on both \cref{cor:transport,cor:contractibility-of-singletons}; we recall Martin Hofmann's proof below as reported by \citet[Addendum]{streicher:1994}.
111111+ \begin{principle}[{Based identification induction}]\label[principle]{principle:based-identification-induction}
112112+ Given a fixed element $u:A$ and a family of types $y:A,p:\Id{A}{u}{y}\vdash B\prn{y,p}:\TYPE$, to define a dependent function $y:A,p:\Id{A}{u}{y}\vdash f\prn{y,p}:B\prn{y,p}$ it suffices to specify $f\prn{u,\Refl} : B\prn{u,\Refl}$.
113113+ \end{principle}
118114119119- % \begin{proof}
120120- % Let $q:\Singleton{A}{u}\vdash B^\sharp\prn{u} : \TYPE$ be the family $B^\sharp\prn{\prn{y,p}} :\equiv B\prn{y,p}$. For any $y:A$ and $p:\Id{A}{x}{y}$ we have by the contractiblity of singletons (\cref{cor:contractibility-of-singletons}) an identification $\Phi_{u}\,\prn{y,p}: \Id{\Singleton{A}{u}}{\prn{u,\Refl}}{\prn{y,p}}$. By transport (\cref{cor:transport}), we have $\prn{\Phi_{u}\,\prn{y,p}}_*^{B^\sharp}\colon B\prn{x,\Refl}\to B\prn{y,p}$.
121121- % %
122122- % We may therefore define $y,p\vdash f:\prn{y,p}:B\prn{y,p}$ to be
123123- % $\prn{\Phi_{u}\,\prn{y,p}}_*^{B^{\sharp}}\prn{f\prn{u,\Refl}}$, as we have the following definitional equivalences:
124124- % \[
125125- % \prn{\Phi_{u}\,\prn{u,\Refl}}_*^{B^{\sharp}}\prn{f\prn{u,\Refl}}
126126- % \equiv
127127- % \Refl_*^{B^{\sharp}}\prn{f\prn{u,\Refl}}
128128- % \equiv f\prn{u,\Refl}
129129- % \qedhere
130130- % \]
131131- % \end{proof}
115115+ We recall Martin Hofmann's proof below as reported by \citet[Addendum]{streicher:1994}.
132116133133- % Independently, \citet{van-den-berg-garner:2011} and \citet{lumsdaine:2010} have shown that identification induction exhibits a weak globular $\infty$-groupoid structure on each type $A$. In the lowest dimension, this corresponds to the construction of compositors for identifications and associators for the resulting compositions, \etc.
117117+ \begin{proof}
118118+ Let $q:\Singleton{A}{u}\vdash B^\sharp\prn{u} : \TYPE$ be the family $B^\sharp\prn{\prn{y,p}} :\equiv B\prn{y,p}$. For any $y:A$ and $p:\Id{A}{x}{y}$ we have by the contractiblity of singletons (\cref{cor:contractibility-of-singletons}) an identification $\Phi_{u}\,\prn{y,p}: \Id{\Singleton{A}{u}}{\prn{u,\Refl}}{\prn{y,p}}$. By transport (\cref{cor:transport}), we have $\prn{\Phi_{u}\,\prn{y,p}}_*^{B^\sharp}\colon B\prn{x,\Refl}\to B\prn{y,p}$.
119119+ %
120120+ We may therefore define $y,p\vdash f:\prn{y,p}:B\prn{y,p}$ to be
121121+ $\prn{\Phi_{u}\,\prn{y,p}}_*^{B^{\sharp}}\prn{f\prn{u,\Refl}}$, as we have the following definitional equivalences:
122122+ \[
123123+ \prn{\Phi_{u}\,\prn{u,\Refl}}_*^{B^{\sharp}}\prn{f\prn{u,\Refl}}
124124+ \equiv
125125+ \Refl_*^{B^{\sharp}}\prn{f\prn{u,\Refl}}
126126+ \equiv f\prn{u,\Refl}
127127+ \qedhere
128128+ \]
129129+ \end{proof}
134130135135- % \begin{construction}[Unbiased compositor]\label[construction]{con:unbiased-compositor}
136136- % For each $p:\Id{A}{u}{v}$ and $q:\Id{A}{v}{w}$, we may define an identification $p\ct q:\Id{A}{u}{w}$ in such a way that $\Refl\ct\Refl \equiv \Refl$.
137137- % \end{construction}
131131+ Independently, \citet{van-den-berg-garner:2011} and \citet{lumsdaine:2010} have shown that identification induction exhibits a weak globular $\infty$-groupoid structure on each type $A$. In the lowest dimension, this corresponds to the construction of compositors for identifications and associators for the resulting compositions, \etc.
138132139139- % \begin{proof}
140140- % Generalising over all our assumptions, define the following term using \cref{principle:based-identification-induction} followed by \cref{principle:identification-induction}:
133133+ \begin{construction}[Unbiased compositor]\label[construction]{con:unbiased-compositor}
134134+ For each $p:\Id{A}{u}{v}$ and $q:\Id{A}{v}{w}$, we may define an identification $p\ct q:\Id{A}{u}{w}$ in such a way that $\Refl\ct\Refl \equiv \Refl$.
135135+ \end{construction}
141136142142- % \iblock{
143143- % \mhang{
144144- % x,y:A; p:\Id{A}{x}{y}, z : A, q : \Id{A}{y}{z}
145145- % \vdash p\ct q : \Id{A}{x}{z}
146146- % }{
147147- % \commentrow{by \cref{principle:based-identification-induction}}
148148- % \mrow{
149149- % x,y:A;p:\Id{A}{x}{y} \vdash p \ct\Refl : \Id{A}{x}{y}
150150- % }
151151- % \commentrow{by \cref{principle:identification-induction}}
152152- % \mrow{
153153- % x:A\vdash \Refl\ct\Refl : \Id{A}{x}{x}
154154- % }
155155- % \commentrow{by reflexivity}
156156- % \mrow{
157157- % x:A\vdash \Refl\ct\Refl :\equiv \Refl
158158- % }
159159- % \qedhere
160160- % }
161161- % }
162162- % \end{proof}
137137+ \begin{proof}
138138+ Generalising over all our assumptions, define the following term using \cref{principle:based-identification-induction} followed by \cref{principle:identification-induction}:
163139164164- % \begin{construction}[Left unitor]
165165- % For any $p:\Id{A}{u}{v}$, we may define an identification $\mathsf{lunit}_p:\Id{\Id{A}{u}{v}}{\Refl\ct p}{p}$ in such a way that $\mathsf{lunit}_{\Refl} \equiv \Refl$.
166166- % \end{construction}
167167- % \begin{proof}
168168- % We define the following term using \cref{principle:identification-induction}:
140140+ \iblock{
141141+ \mhang{
142142+ x,y:A; p:\Id{A}{x}{y}, z : A, q : \Id{A}{y}{z}
143143+ \vdash p\ct q : \Id{A}{x}{z}
144144+ }{
145145+ \commentrow{by \cref{principle:based-identification-induction}}
146146+ \mrow{
147147+ x,y:A;p:\Id{A}{x}{y} \vdash p \ct\Refl : \Id{A}{x}{y}
148148+ }
149149+ \commentrow{by \cref{principle:identification-induction}}
150150+ \mrow{
151151+ x:A\vdash \Refl\ct\Refl : \Id{A}{x}{x}
152152+ }
153153+ \commentrow{by reflexivity}
154154+ \mrow{
155155+ x:A\vdash \Refl\ct\Refl :\equiv \Refl
156156+ }
157157+ \qedhere
158158+ }
159159+ }
160160+ \end{proof}
169161170170- % \iblock{
171171- % \mhang{
172172- % x,y:A;p:\Id{A}{x}{y} \vdash \mathsf{lunit}_p : \Id{\Id{A}{x}{y}}{\Refl\ct p}{p}
173173- % }{
174174- % \commentrow{by \cref{principle:identification-induction}}
175175- % \mrow{
176176- % x:A\vdash \mathsf{lunit}_\Refl : \Id{\Id{A}{x}{x}}{\Refl\ct \Refl}{\Refl}
177177- % }
178178- % \commentrow{by \cref{con:unbiased-compositor}}
179179- % \mrow{
180180- % x:A\vdash \mathsf{lunit}_\Refl : \Id{\Id{A}{x}{x}}{\Refl}{\Refl}
181181- % }
182182- % \commentrow{by reflexivity}
183183- % \mrow{
184184- % x:A\vdash \mathsf{lunit}_\Refl :\equiv \Refl
185185- % }
186186- % \qedhere
187187- % }
188188- % }
189189- % \end{proof}
162162+ \begin{construction}[Left unitor]
163163+ For any $p:\Id{A}{u}{v}$, we may define an identification $\mathsf{lunit}_p:\Id{\Id{A}{u}{v}}{\Refl\ct p}{p}$ in such a way that $\mathsf{lunit}_{\Refl} \equiv \Refl$.
164164+ \end{construction}
165165+ \begin{proof}
166166+ We define the following term using \cref{principle:identification-induction}:
190167191191- % \begin{exercise}[Associator]
192192- % For any identifications $p:\Id{A}{t}{u}$, $q:\Id{A}{u}{v}$, and $r:\Id{A}{v}{w}$, constructor an identification $\alpha_{p,q,r}:\Id{\Id{A}{t}{w}}{\prn{p\ct q}\ct r}{p\ct\prn{q\ct r}}$ in such a way that $\alpha_{\Refl,\Refl,\Refl} \equiv \Refl$.
193193- % \end{exercise}
168168+ \iblock{
169169+ \mhang{
170170+ x,y:A;p:\Id{A}{x}{y} \vdash \mathsf{lunit}_p : \Id{\Id{A}{x}{y}}{\Refl\ct p}{p}
171171+ }{
172172+ \commentrow{by \cref{principle:identification-induction}}
173173+ \mrow{
174174+ x:A\vdash \mathsf{lunit}_\Refl : \Id{\Id{A}{x}{x}}{\Refl\ct \Refl}{\Refl}
175175+ }
176176+ \commentrow{by \cref{con:unbiased-compositor}}
177177+ \mrow{
178178+ x:A\vdash \mathsf{lunit}_\Refl : \Id{\Id{A}{x}{x}}{\Refl}{\Refl}
179179+ }
180180+ \commentrow{by reflexivity}
181181+ \mrow{
182182+ x:A\vdash \mathsf{lunit}_\Refl :\equiv \Refl
183183+ }
184184+ \qedhere
185185+ }
186186+ }
187187+ \end{proof}
194188195195- % Higher identities relating different ways of composing the associators and unitors can be established in the same way as the above.
189189+ \begin{exercise}[Associator]
190190+ For any identifications $p:\Id{A}{t}{u}$, $q:\Id{A}{u}{v}$, and $r:\Id{A}{v}{w}$, constructor an identification $\alpha_{p,q,r}:\Id{\Id{A}{t}{w}}{\prn{p\ct q}\ct r}{p\ct\prn{q\ct r}}$ in such a way that $\alpha_{\Refl,\Refl,\Refl} \equiv \Refl$.
191191+ \end{exercise}
196192197197- % \begin{construction}[Biased compositors]
198198- % For each $p:\Id{A}{u}{v}$ and $q:\Id{A}{v}{w}$ we may define identifications $p \ctl q, p \ctr q: \Id{A}{u}{w}$ such that $\Refl \ctl
199199- % q \equiv q$ and $p\ctr \Refl \equiv p$.
200200- % \end{construction}
193193+ Higher identities relating different ways of composing the associators and unitors can be established in the same way as the above.
201194202202- % \begin{proof}
203203- % The right-biased compositor is constructed using \cref{principle:based-identification-induction} like so:
195195+ \begin{construction}[Biased compositors]
196196+ For each $p:\Id{A}{u}{v}$ and $q:\Id{A}{v}{w}$ we may define identifications $p \ctl q, p \ctr q: \Id{A}{u}{w}$ such that $\Refl \ctl
197197+ q \equiv q$ and $p\ctr \Refl \equiv p$.
198198+ \end{construction}
204199205205- % \iblock{
206206- % \mhang{
207207- % x,y:A;p:\Id{A}{x}{y},z:A,q:\Id{A}{y}{z} \vdash p \ctr q : \Id{A}{x}{z}
208208- % }{
209209- % \commentrow{by \cref{principle:based-identification-induction}}
210210- % \mrow{
211211- % x,y:A;p:\Id{A}{x}{y} \vdash p \ctr \Refl : \Id{A}{x}{y}
212212- % }
213213- % \commentrow{by hypothesis}
214214- % \mrow{
215215- % x,y:A;p:\Id{A}{x}{y}\vdash p\ctr\Refl :\equiv p
216216- % }
217217- % }
218218- % }
200200+ \begin{proof}
201201+ The right-biased compositor is constructed using \cref{principle:based-identification-induction} like so:
219202220220- % The left-biased compositor is constructed using \cref{principle:identification-induction} as follows:
203203+ \iblock{
204204+ \mhang{
205205+ x,y:A;p:\Id{A}{x}{y},z:A,q:\Id{A}{y}{z} \vdash p \ctr q : \Id{A}{x}{z}
206206+ }{
207207+ \commentrow{by \cref{principle:based-identification-induction}}
208208+ \mrow{
209209+ x,y:A;p:\Id{A}{x}{y} \vdash p \ctr \Refl : \Id{A}{x}{y}
210210+ }
211211+ \commentrow{by hypothesis}
212212+ \mrow{
213213+ x,y:A;p:\Id{A}{x}{y}\vdash p\ctr\Refl :\equiv p
214214+ }
215215+ }
216216+ }
221217222222- % \iblock{
223223- % \mhang{
224224- % x,y:A;p:\Id{A}{x}{y},z:A,q:\Id{A}{y}{z} \vdash p \ctl q : \Id{A}{x}{z}
225225- % }{
226226- % \commentrow{by \cref{principle:identification-induction}}
227227- % \mrow{
228228- % x,z:A;q:\Id{A}{x}{z} \vdash \Refl \ctl q : \Id{A}{x}{z}
229229- % }
230230- % \commentrow{by hypothesis}
231231- % \mrow{
232232- % x,z:A;q:\Id{A}{x}{z}\vdash \Refl\ctl q :\equiv q
233233- % }
234234- % \qedhere
235235- % }
236236- % }
237237- % \end{proof}
218218+ The left-biased compositor is constructed using \cref{principle:identification-induction} as follows:
238219239239- % \begin{construction}[Action on identifications]\label[construction]{con:act}
240240- % Given a function $f\colon A\to B$, to each identification $p:\Id{A}{u}{v}$ we may assign an identification $\Act{f}{p}:\Id{B}{fu}{fv}$ such that $\Act{f}{\Refl} \equiv \Refl$. This assignment is called the \emph{action of $f$ on identifications}.\footnote{Owing to the terminology of the HoTT Book~\citep{hottbook}, $\Act{f}$ is often written as $\mathsf{ap}_f$.}
241241- % \end{construction}
242242- % \begin{proof}
243243- % We may define the action of $f$ on identifications by one application of \cref{principle:identification-induction}.
220220+ \iblock{
221221+ \mhang{
222222+ x,y:A;p:\Id{A}{x}{y},z:A,q:\Id{A}{y}{z} \vdash p \ctl q : \Id{A}{x}{z}
223223+ }{
224224+ \commentrow{by \cref{principle:identification-induction}}
225225+ \mrow{
226226+ x,z:A;q:\Id{A}{x}{z} \vdash \Refl \ctl q : \Id{A}{x}{z}
227227+ }
228228+ \commentrow{by hypothesis}
229229+ \mrow{
230230+ x,z:A;q:\Id{A}{x}{z}\vdash \Refl\ctl q :\equiv q
231231+ }
232232+ \qedhere
233233+ }
234234+ }
235235+ \end{proof}
236236+237237+ \begin{construction}[Action on identifications]\label[construction]{con:act}
238238+ Given a function $f\colon A\to B$, to each identification $p:\Id{A}{u}{v}$ we may assign an identification $\Act{f}{p}:\Id{B}{fu}{fv}$ such that $\Act{f}{\Refl} \equiv \Refl$. This assignment is called the \emph{action of $f$ on identifications}.\footnote{Owing to the terminology of the HoTT Book~\citep{hottbook}, $\Act{f}$ is often written as $\mathsf{ap}_f$.}
239239+ \end{construction}
240240+ \begin{proof}
241241+ We may define the action of $f$ on identifications by one application of \cref{principle:identification-induction}.
244242245245- % \iblock{
246246- % \mhang{
247247- % x,y:A;p:\Id{A}{x}{y} \vdash \Act{f}p : \Id{B}{fx}{fy}
248248- % }{
249249- % \commentrow{by \cref{principle:identification-induction}}
250250- % \mrow{
251251- % x:A\vdash \Act{f}\Refl : \Id{B}{fx}{fx}
252252- % }
253253- % \commentrow{by reflexivity}
254254- % \mrow{
255255- % x:A\vdash \Act{f}{\Refl} :\equiv \Refl
256256- % }
257257- % \qedhere
258258- % }
259259- % }
260260- % \end{proof}
243243+ \iblock{
244244+ \mhang{
245245+ x,y:A;p:\Id{A}{x}{y} \vdash \Act{f}p : \Id{B}{fx}{fy}
246246+ }{
247247+ \commentrow{by \cref{principle:identification-induction}}
248248+ \mrow{
249249+ x:A\vdash \Act{f}\Refl : \Id{B}{fx}{fx}
250250+ }
251251+ \commentrow{by reflexivity}
252252+ \mrow{
253253+ x:A\vdash \Act{f}{\Refl} :\equiv \Refl
254254+ }
255255+ \qedhere
256256+ }
257257+ }
258258+ \end{proof}
261259262262- % \begin{construction}[Action of the identity map]\label[construction]{con:act-idn}
263263- % For any identification $p:\Id{A}{u}{v}$, we can define a higher identification $\ActIdn\,p : \Id{\Id{A}{u}{v}}{\Act{1_A}{p}}{p}$ witnessing that the action of the identity function is the identity function on identifications, such that we have $\ActIdn\,\Refl \equiv \Refl$.
264264- % \end{construction}
265265- % \begin{proof}
266266- % We may construct the witness using \cref{principle:identification-induction} as follows:
260260+ \begin{construction}[Action of the identity map]\label[construction]{con:act-idn}
261261+ For any identification $p:\Id{A}{u}{v}$, we can define a higher identification $\ActIdn\,p : \Id{\Id{A}{u}{v}}{\Act{1_A}{p}}{p}$ witnessing that the action of the identity function is the identity function on identifications, such that we have $\ActIdn\,\Refl \equiv \Refl$.
262262+ \end{construction}
263263+ \begin{proof}
264264+ We may construct the witness using \cref{principle:identification-induction} as follows:
267265268268- % \iblock{
269269- % \mhang{
270270- % x,y:A; p:\Id{A}{u}{v} \vdash \ActIdn\,p : \Id{\Id{A}{x}{y}}{\Act{1_A}{p}}{p}
271271- % }{
272272- % \commentrow{by \cref{principle:identification-induction}}
273273- % \mrow{
274274- % x:A \vdash \ActIdn\,\Refl : \Id{\Id{A}{x}{y}}{\Act{1_A}{\Refl}}{p}
275275- % }
276276- % \commentrow{by \cref{con:act}}
277277- % \mrow{
278278- % x:A \vdash \ActIdn\,\Refl : \Id{\Id{A}{x}{y}}{p}{p}
279279- % }
280280- % \commentrow{by reflexivity}
281281- % \mrow{
282282- % x:A\vdash \ActIdn\,\Refl :\equiv \Refl
283283- % }
284284- % \qedhere
285285- % }
286286- % }
287287- % \end{proof}
266266+ \iblock{
267267+ \mhang{
268268+ x,y:A; p:\Id{A}{u}{v} \vdash \ActIdn\,p : \Id{\Id{A}{x}{y}}{\Act{1_A}{p}}{p}
269269+ }{
270270+ \commentrow{by \cref{principle:identification-induction}}
271271+ \mrow{
272272+ x:A \vdash \ActIdn\,\Refl : \Id{\Id{A}{x}{y}}{\Act{1_A}{\Refl}}{p}
273273+ }
274274+ \commentrow{by \cref{con:act}}
275275+ \mrow{
276276+ x:A \vdash \ActIdn\,\Refl : \Id{\Id{A}{x}{y}}{p}{p}
277277+ }
278278+ \commentrow{by reflexivity}
279279+ \mrow{
280280+ x:A\vdash \ActIdn\,\Refl :\equiv \Refl
281281+ }
282282+ \qedhere
283283+ }
284284+ }
285285+ \end{proof}
286286+ \end{xsect}
288287289289- % \end{xsect}
288288+ \begin{xsect}{Characterising identity types using (displayed) reflexive graphs}
290289291291- % \begin{xsect}{Working with specific identity types}
292292- % Although Martin-L\"of's identity types exhibit a well-behaved globular structure uniformly across all types, it is not easy to work with identifications in any \emph{specific} type. This is because the rules of the identity types $\Id{A}{u}{v}$ are completely general and not attuned to the specifics of any given type $A$. For this reason, wise practitioners of the formalisation of univalent foundations in homotopy type theory have found it to be essential to \emph{immediately} characterise the identity type of any given type in terms of simpler types.
290290+ The role of the identity type is similar to that of equality in set theory: it expresses a single \emph{global} notion of identification whose rules apply to all types simultaneously.\footnote{Naturally, intensional type theory can speak about more than sets --- but the spirit of having a single global notion of identity is the same in both type theory and set theory.} On the other hand, because the rules of identity types have to apply uniformly to all types, these rules do not reflect any of the specific characteristics of individual types that would, if taken seriously, make it easier to both exhibit and use identifications.
293291294294- % Some of these characterisations are derivable in pure intensional type theory; for example, we can characterise the identity type of a sum $\Sum{x:A}B\prn{x}$ in terms of the identity types of $A$ and of each $B\prn{x}$.
292292+ \begin{remark}
293293+ Everything in this section is derived from prior works, such as the HoTT Book~\citep{hottbook}, Rijke's textbook on homotopy type theory~\citep{rijke:2022}, and the work of \citet{schipp-von-branitz-buchholtz:2021}, although we do impose our own terminological conventions.
294294+ \end{remark}
295295296296- % \begin{proposition}\label[proposition]{prop:id-dsum}
297297- % The following dependent function defined by identification induction is a family of equivalences:
298298- % \begin{align*}
299299- % & f:\Prod{u,v:\DelimProtect{\Sum{x:A}B\prn{x}}} \Id{\Sum{x:A}B\prn{x}}{u}{v} \to \Sum{p:\Id{A}{\pi_1 u}{\pi_1 v}} \Id{B\prn{\pi_1 v}}{p_*^B\prn{\pi_2u}}{\pi_2\prn{v}} \\
300300- % & f\, u\, u\, \Refl :\equiv \prn{\Refl, \Refl}
301301- % \end{align*}
302302- % \end{proposition}
296296+ \begin{xsect}[sec:shallow]{Shallow characterisation of identity types}
297297+ For example, it is very natural to build up an identification of type $\Id{A\times B}{\prn{x,u}}{\prn{y,v}}$ from a pair of identifications $\Id{A}{x}{y}$ and $\Id{B}{u}{v}$. This principle can be formalised by \emph{characterising} the identity type of $A\times B$ in terms of the identity types of $A$ and $B$.
303298304304- % In other words, we have an equivalence between the identity type $\Id{\Sum{x:A}B\prn{x}}{u}{v}$ of a sum, and the sum $\Sum{p:\Id{A}{\pi_1 u}{\pi_1 v}} \Id{B\prn{\pi_1 v}}{p_*^B\prn{\pi_2u}}{\pi_2\prn{v}}$ of identity types.
299299+ \begin{proposition}[Shallow characterisation of the binary product]\label[proposition]{ex:shallow-bin-prod}
300300+ Each of the following functions is an equivalence:
301301+ \begin{align*}
302302+ x,y:A; u,v:B & \vdash \mathsf{splitId}_{A,B} \colon : \Id{A\times B}{\prn{x,u}}{\prn{y,v}} \to \prn{\Id{A}{x}{y}}\times \prn{\Id{B}{u}{v}}
303303+ \\
304304+ x:A, u:B & \vdash \mathsf{splitId}_{A,B} ~\Refl :\equiv \prn{\Refl, \Refl}
305305+ \end{align*}
306306+ \end{proposition}
307307+ \begin{proof}
308308+ We can explicitly construct an inverse to $\mathsf{splitId}_{A,B}$ as follows:
309309+ \begin{align*}
310310+ x,y:A; u,v:B
311311+ & \vdash
312312+ \mathsf{unsplitId}_{A,B} \colon : \prn{\Id{A}{x}{y}}\times \prn{\Id{B}{u}{v}} \to \Id{A\times B}{\prn{x,u}}{\prn{y,v}}
313313+ \\
314314+ x:A, u:V
315315+ & \vdash
316316+ \mathsf{unsplitId}_{A,B}\,\prn{\Refl,\Refl} :\equiv \Refl
317317+ \end{align*}
305318319319+ The coherences of the equivalence are given by identification induction.
320320+ \end{proof}
306321307307- % \begin{xsect}{Motivating path objects and displayed path objects}
308308- % Although \cref{prop:id-dsum} is a fundamental result in intensional type theory, it is inadequate in practice for two reasons.
309309- % %
310310- % \begin{enumerate}
311311- % \item \textbf{What if $A$ and $B$ are complex types?} If $A$ and $B$ are specific complex types (\eg perhaps they are sums themselves), we would want to characterise the identity type of $\Sum{x:A}B\prn{x}$ not in terms of the identity types of $A$ and $B\prn{x}$ but rather in terms of some (other) characterisations of these identity types.
312312- % \item \textbf{The presence of transports.} Although we have succeeded to decompose identifications in sums $\Sum{x:A}B\prn{x}$ in terms of identifications in $A$ and identifications in $B\prn{x}$, we still have to deal with the presence of the \emph{transport} function $p_*^B\colon B\prn{\pi_1u}\to B\prn{\pi_1v}$ in the latter --- necessitated from the fact that $B\prn{x}$ is dependent on $x:A$. Just as identifications in specific types are not easy to work with because of the generality of the rules, \emph{transports} in specific families are likewise prohibitively difficult to work with.
313313- % \end{enumerate}
322322+ Of course, although the characterisation of identifications in $A\times B$ in \cref{ex:shallow-bin-prod} is useful, it does not help us directly to characterise identifications in more complex types. For example, we may wish to characterise the identity type of $\prn{A\times B}\times C$ by asserting that the canonical map $\Id{\prn{A\times B}\times C}{\prn{\prn{x,u},m}}{\prn{\prn{y,v},n}}\to \prn{\prn{\Id{A}{x}{y}}\times\prn{\Id{B}{u}{v}}}\times\prn{\Id{C}{m}{n}}$ is an equivalence. This can be established directly in the same way as \cref{ex:shallow-bin-prod}, but this existing lemma does not help do so. Naturally, it would be better to have a toolkit for building up ``deep'' characterisations of identity types piece-by-piece.
314323315315- % To address the first problem, several equivalent type theoretic notions of \emph{path object} have been introduced and employed systematically, \eg in the textbook of \citet{rijke:2022}, the agda-unimath library~\citep{agda-unimath}, or the 1Lab~\citep{1lab}.\footnote{Our terminology of \emph{path object} refers to what the HoTT Book~\citep{hottbook}, \citet{rijke:2022} and many other authors refer to as \emph{identity systems}; they are referred to by \citet{schipp-von-branitz-buchholtz:2021} as \emph{univalent reflexive graphs} and by \citet{rijke:2019} as \emph{discrete reflexive graphs}.} To a first approximation, a path object is a reflexive graph structure that imposes a computationally tractable notion of identification on its vertices --- such that this computationally tractable notion is equivalent to the one provided by the identity type.
324324+ \end{xsect}
316325317317- % To address the problem of transports between components of dependent types, it has been necessary to introduce \emph{displayed} or \emph{heterogeneous} versions of path objects that allow an identification in a family $B\prn{x}$ to span from $B\prn{u}$ to $B\prn{v}$ along some identification from $u$ to $v$.
326326+ \begin{xsect}{Deep characterisation using reflexive graphs}
327327+ A ``deep'' characterisation of the identity type for binary products would take the following form:
318328319319- % \end{xsect}
329329+ \begin{quote}
330330+ If we have characterised the identity type of $A$ and the identity type of $B$, then we may characterise the identity type of $A\times B$.
331331+ \end{quote}
320332333333+ \cref{ex:shallow-bin-prod} can be ``deepened'' along these lines by replacing the types $A$ and $B$ with \emph{reflexive graphs} $\gA$ and $\gB$ so that we have the following data:
321334322322- % \begin{xsect}{Disadvantageous of displayed path objects}
323323- % Displayed path objects have enabled the characterisation of identity types for very complicated dependent types, including (for instance) those of groups, categories, and other sophisticated structures.
324324- % %
325325- % On the other hand, because a displayed path object is not just a special kind of path object (or a family of path objects), it has been challenging to develop a toolkit of \emph{composable} results for building up complex path objects in the presence of type dependency.
335335+ \begin{multicols}{2}
336336+ \iblock{
337337+ \mrow{\vrt{\gA} : \TYPE}
338338+ \mrow{{\Edge{\gA}} : \vrt{\gA}\to \vrt{\gA}\to \TYPE}
339339+ \mrow{\Rx{\gA} : \Prod{x:\vrt{\gA}} x\Edge{\gA}x}
340340+ \columnbreak
341341+ \mrow{\vrt{\gB} : \TYPE}
342342+ \mrow{{\Edge{\gB}} : \vrt{\gB}\to \vrt{\gB}\to \TYPE}
343343+ \mrow{\Rx{\gB} : \Prod{x:\vrt{\gB}} x\Edge{\gB}x}
344344+ }
345345+ \end{multicols}
326346327327- % In fact, most displayed path objects that occur in practice arise in a specific way from a family of ordinary path objects --- which we systematise in this paper with the aim of improving compositionality in the practical characterisation of identity types.
328328- % \end{xsect}
329329- % \end{xsect}
347347+ These reflexive graph structures follow the pattern of instances of the formation and introduction rules for the identity type. Tentatively, we shall say that a given reflexive graph $\gG$ is \DefEmph{univalent} when the following function is an equivalence:\footnote{See \cref{def:univalent-reflexive-graph}; in fact, our provisional definition of the univalence condition for a reflexive graph is not the most practical one for everyday use, but it is one of several equivalent conditions that we shall expose later.}
348348+ \begin{align*}
349349+ x,y:\vrt{\gG} & \vdash \mathsf{idToEdge}_\gG^{x,y} : \Id{\vrt{\gG}}{x}{y} \to x\Edge{\gG}y
350350+ \\
351351+ x:\vrt{\gG} & \vdash \mathsf{idToEdge}_\gG^{x,x} \Refl :\equiv \Rx{\gG}{x}
352352+ \end{align*}
353353+354354+ We shall often refer to a univalent reflexive graph as a \DefEmph{path object} for short. With these constructions on reflexive graphs in hand, a \emph{deep} characterisation of the identity type for binary products can be formulated.
355355+356356+ First we define a new reflexive graph $\gA\times \gB$ as follows:
357357+ \begin{align*}
358358+ \vrt{\gA\times \gB}
359359+ & :\equiv
360360+ \vrt{\gA}\times \vrt{\gB}
361361+ \\
362362+ \prn{x,u} \Edge{\gA\times \gB} \prn{y,v}
363363+ & :\equiv
364364+ \prn{x\Edge{\gA}y}
365365+ \times
366366+ \prn{u\Edge{\gB}v}
367367+ \\
368368+ \Rx{\gA\times\gB}\prn{x,u}
369369+ & :\equiv
370370+ \prn{\Rx{\gA}{x},\Rx{\gB}{u}}
371371+ \end{align*}
372372+373373+ Then the deep characterisation of binary products amounts saying that path objects (\ie univalent reflexive graphs) are closed under binary products.
374374+375375+ \begin{proposition}[Deep characterisation of the binary product]\label[proposition]{prop:deep-bin-prod}
376376+ If $\gA$ and $\gB$ are two path objects, then $\gA\times \gB$ is a path object.
377377+ \end{proposition}
378378+379379+ The compositional character of \cref{prop:deep-bin-prod} allows us to deduce other useful corollaries immediately by iteration. For example, if $\gA,\gB,\gC$ are all univalent reflexive graphs, then $\prn{\gA\times\gB}\times\gC$ is a univalent reflexive graph, \etc
380380+ \end{xsect}
381381+382382+ \begin{xsect}{Dependent types and displayed reflexive graphs}
383383+384384+ So far we have described how to give shallow and deep characterisations of \emph{non-dependent} types. Of course, most mathematical structures of any interest (\eg monoids, groups, rings, \etc, or even reflexive graphs themselves!) are described by dependent types, as the types of the operations depend on the carrier types.
385385+386386+ Given a type $A:\TYPE$ and a family of types $x:A\vdash B\prn{x} : \TYPE$, how can we characterise the identity type of the sum $\Sum{x:A}B\prn{x}$? A shallow characterisation in the style of \cref{sec:shallow} is at least not out of reach.
387387+388388+ \begin{proposition}[Shallow characterisation of the indexed sum]\label[proposition]{prop:shallow-dependent}
389389+ Each of the following functions is an equivalence:
390390+391391+ \iblock{
392392+ \mhang{
393393+ x,y:A; u:B\prn{x}, v:B\prn{y} \vdash
394394+ }{
395395+ \mrow{
396396+ \mathsf{dsplitId}_{A,B} \colon \Id{\Sum{x:A}{B\prn{x}}}{\prn{x,u}}{\prn{y,v}}
397397+ \to
398398+ \Sum{p:\Id{A}{x}{y}}
399399+ \Id{B\prn{y}}{p_*^B u}{v}
400400+ }
401401+ \mrow{
402402+ \mathsf{dsplitId}_{A,B}\,\Refl :\equiv \prn{\Refl,\Refl}
403403+ }
404404+ }
405405+ }
406406+ \end{proposition}
407407+408408+ The shallow characterisation in \cref{prop:shallow-dependent} is more complex than that of \cref{ex:shallow-bin-prod} because the second component of the the sum $\Sum{p:\Id{A}{x}{y}}
409409+ \Id{B\prn{y}}{p_*^B u}{v}$ involves a \emph{transport}. From a higher vantage point, the problem being solved by transport here is that we wish to identify $u:B\prn{x}$ with $v:B\prn{y}$ but these do not have the same type. Transport uses the identification $p:\Id{A}{x}{y}$ to find a common type in which $u$ and $v$ can be compared; but note that the choice of a forward transport $p_*^B\colon B\prn{x}\to B\prn{y}$ is somewhat arbitrary, as we might have also defined a backward transport $p^*_B \colon B\prn{y}\to B\prn{x}$ and compared $u,v$ in $B\prn{x}$.
410410+411411+ In order to generalise \cref{prop:shallow-dependent} to a \emph{deep} characterisation of the indexed sum, we must naturally generalise the concept of reflexive graph to one in which vertices form a \emph{dependent} type and edges go between different components linked by an edge in the base. This is precisely the purpose of the \emph{displayed reflexive graphs} of \cite{schipp-von-branitz-buchholtz:2021}.
412412+413413+ In particular, let $\gA$ be a reflexive graph as before and let $\gB$ be a \DefEmph{displayed reflexive graph} over $\gA$ so that we have the following data:
414414+415415+ \begingroup
416416+ \setlength\columnsep{-4cm}
417417+ \begin{multicols}{2}
418418+ \iblock{
419419+ \mrow{\vrt{\gA} : \TYPE}
420420+ \mrow{{\Edge{\gA}} : \vrt{\gA}\to \vrt{\gA}\to \TYPE}
421421+ \mrow{\Rx{\gA} : \Prod{x:\vrt{\gA}} x\Edge{\gA}x}
422422+ \columnbreak
423423+ \mrow{\vrt{\gB} : \vrt{\gA}\to \TYPE}
424424+ \mrow{{\Edge{\gB}[\bullet]} : \Prod[\brc]{x,y:\vrt{\gA}} x\Edge{\gA}y\to \vrt{\gB}\prn{x}\to \vrt{\gB}\prn{y}\to \TYPE}
425425+ \mrow{\DRx{\gB}{\bullet} : \Prod{x:\vrt{\gA}}\Prod{u:\vrt{\gB}\prn{x}} u\Edge{\gB}[\Rx{\gA}{x}]u}
426426+ }
427427+ \end{multicols}
428428+ \endgroup
429429+430430+ Any displayed reflexive graph such as $\gB$ gives rise to a family of ordinary reflexive graphs $\gB\prn{x}$ indexed in vertices $x:\vrt{\gA}$.
431431+ \begin{align*}
432432+ \vrt{\gB\prn{x}}
433433+ & :\equiv
434434+ \vrt{\gB}\prn{x}
435435+ \\
436436+ u \Edge{\gB\prn{x}} v
437437+ & :\equiv
438438+ u \Edge{\gB}[\Rx{\gA}{x}] v
439439+ \\
440440+ \Rx{\gB\prn{x}}{u}
441441+ & :\equiv
442442+ \DRx{\gB}{x}{u}
443443+ \end{align*}
444444+445445+446446+ A displayed reflexive graph $\gB$ will be called \DefEmph{univalent} (or a displayed path object for short) when each of its components is univalent. We can now define the \DefEmph{total reflexive graph} of $\gB$ with vertices in the sum of $\vrt{\gB}$ over $\vrt{\gA}$ as follows:
447447+ \begin{align*}
448448+ \vrt{\gA.\gB}
449449+ & :\equiv
450450+ \Sum{x:\vrt{\gA}}\vrt{\gB}\prn{x}
451451+ \\
452452+ \prn{x,u} \Edge{\gA.\gB} \prn{y,v}
453453+ & :\equiv
454454+ \Sum{p:x\Edge{\gA}y}
455455+ u\Edge{\gB}[p] v
456456+ \\
457457+ \Rx{\gA.\gB}{\prn{x,u}}
458458+ & :\equiv
459459+ \prn{\Rx{\gA}{x},\DRx{\gB}{x}{u}}
460460+ \end{align*}
461461+462462+ Then the deep characterisation for indexed sums is exactly the statement that the total reflexive graph of a displayed path object is a path object.
463463+464464+ \begin{proposition}[Deep characterisation of the indexed sum]\label[proposition]{prop:deep-dependent}
465465+ Let $\gB$ be a displayed path object over a reflexive graph $\gA$. Then the total reflexive graph $\gA.\gB$ is a path object.
466466+ \end{proposition}
467467+468468+ \end{xsect}
469469+ \end{xsect}
470470+471471+472472+473473+ \begin{xsect}{Characterising \emph{transport} with reflexive graph lenses}
474474+ Everything we have described so far is more or less standard. Path objects (and equivalent concepts such as \emph{torsorial families}) have been used to great effect in a variety of formalised libraries of univalent mathematics, including \texttt{agda-unimath}~\citep{agda-unimath} and the 1Lab~\citep{1lab}. The purpose of the present paper is to give a deeper analysis of a large class of displayed path objects that arise in a particularly simple way, in fact obviating the need to separately prove many univalence lemmas. We return to the shallow characterisation of the identity types of dependent sums from \cref{prop:shallow-dependent}:
475475+ \[
476476+ \Id{\Sum{x:A}B\prn{x}}{\prn{x,u}}{\prn{y,v}} \cong
477477+ \Sum{p:\Id{A}{x}y}
478478+ \Id{B\prn{y}}{p_*^Bu}{v}
479479+ \]
480480+481481+ In our deep characterisation (\cref{prop:deep-dependent}), we generalised $\Id{A}{x}{y}$ to the edges $x\Edge{\gA}y$ of a reflexive graph $\gA$ and we generalised $\Id{B\prn{y}}{p_*^Bu}{v}$ to the \emph{displayed edges} $u\Edge{\gB}[p]{v}$ of a displayed reflexive graph $\gB$ over $\gA$. This generalisation abstracts away the use of transport to get the vertices $u$ and $v$ to lie in the same component of $B$, at the cost of needing to specify $\gB$ as a displayed reflexive graph rather than as a family of reflexive graphs indexed in $\gA$.
482482+483483+ Our starting point is to consider a different, less abstract, generalisation of \cref{prop:shallow-dependent} in which we replace $A$ with a reflexive graph $\gA$ as before, but we replace $B$ not with a displayed reflexive graph over $\gA$, but instead with a \emph{family} of reflexive graphs $\gB\prn{x}$ indexed in vertices $x:\vrt{\gA}$ that is equipped with a \emph{transport} or \emph{pushforward} operation to jump from one component to the next. To a first approximation, we have assumed the following data:
484484+485485+ \iblock{
486486+ \setlength\columnsep{-3cm}
487487+ \begin{multicols}{2}
488488+ \mrow{\vrt{\gA} : \TYPE}
489489+ \mrow{{\Edge{\gA}} : \vrt{\gA}\to \vrt{\gA}\to \TYPE}
490490+ \mrow{\Rx{\gA} : \Prod{x:\vrt{\gA}} x\Edge{\gA}x}
491491+ \columnbreak
492492+ \mrow{\vrt{\gB\prn{-}} : \vrt{\gA}\to \TYPE}
493493+ \mrow{{\Edge{\gB\prn{-}}} : \Prod{x:\vrt{\gA}} \vrt{\gB\prn{x}}\to\vrt{\gB\prn{x}}\to \TYPE}
494494+ \mrow{\Rx{\gB\prn{-}} : \Prod{x:\vrt{\gA}}\Prod{u:\vrt{\gB}\prn{x}} u\Edge{\gB}u}
495495+ \end{multicols}
496496+ \mrow{
497497+ \Push{\gB}{} :
498498+ \Prod[\brc]{x,y:\vrt{\gA}}
499499+ \Prod{p:x\Edge{\gA}y}
500500+ \vrt{\gB\prn{x}}\to \vrt{\gB\prn{y}}
501501+ }
502502+ }
503503+504504+ With this data in hand, we can define an appropriate displayed reflexive graph $\CovDisp{\gA}{\gB}$ over $\gA$ that mirrors the passage from the shallow characterisation (\cref{prop:shallow-dependent}) to the deep characterisation (\cref{prop:deep-dependent}):
505505+ %
506506+ \begin{align*}
507507+ \vrt{\CovDisp{\gA}{\gB}}\prn{x}
508508+ &:\equiv
509509+ \vrt{\gB\prn{x}}
510510+ \\
511511+ u \Edge{\CovDisp{\gA}{\gB}}[p:x\Edge{\gA}y] v
512512+ &:\equiv
513513+ \Push{\gB}{p}{u}\Edge{\gB\prn{y}} v
514514+ \end{align*}
515515+516516+ It remains to define the displayed reflexivity datum $\DRx{\CovDisp{\gA}{\gB}}{x}{u} : \Push{\gB}{\Rx{\gA}{x}}{u} \Edge{\gB\prn{x}} u$, but we do not have anything on hand from which to define this. We are therefore led to assert this reflexivity datum as part of the \emph{data} of $\gB$:
517517+518518+ \iblock{
519519+ \mrow{
520520+ \PushRx{\gB}[\bullet] : \Prod{x:\vrt{\gA}} \Prod{u:\vrt{\gB\prn{x}}} \Push{\gB}{\Rx{\gA}{x}}{u} \Edge{\gB\prn{x}} u
521521+ }
522522+ }
523523+524524+ Thea above has the appearance of an \emph{oplax unitor} for the pushforward operation. Using this oplax unitor, we may finish defining the displayed reflexive graph $\CovDisp{\gA}{\gB}$:
525525+ %
526526+ \begin{align*}
527527+ \DRx{\CovDisp{\gA}{\gB}}{x}{u}
528528+ &:\equiv
529529+ \PushRx{\gB}[x]{u}
530530+ \end{align*}
531531+532532+ Altogether, we shall refer to a family of reflexive graphs $\gB$ equipped with $\Push{\gB}{}$ and $\PushRx{\gB}[\bullet]$ as an \DefEmph{oplax covariant lens} of reflexive graphs (see \cref{def:oplax-cov-lens}) over $\gA$ --- \emph{covariant} because $\Push{\gB}{}$ implements a forward transport, and \emph{oplax} because of the orientation of the unitor $\PushRx{\gB}$. The terminology of \emph{lenses} is borrowed from \citep{chollet-et-al:2022:lenses}, who use it to refer to an algebraic generalisation of fibrations in which the chosen lifts are not required to have a universal property but instead satisfy a unit law (strictly, in the case of \opcit).
533533+534534+ Naturally, we can (and will) introduce a dual notion of \emph{lax contravariant lens} for characterising backward transport in a family of reflexive graphs. When $\gB$ is a lax contravariant lens in this sense (see \cref{def:lax-ctrv-lens}), we can likewise associate a displayed reflexive graph $\CtrvDisp{\gA}{\gB}$ in which a displayed edge $u\Edge{\CtrvDisp{\gA}{\gB}}[p:x\Edge{\gA} y] v$ is given by an edge $u \Edge{\gB\prn{x}} \Pull{\gB}{p}{v}$.
535535+536536+537537+ \begin{proposition}[See \cref{lem:cov-disp-po}]
538538+ Let $\gB$ be an oplax covariant (\resp lax contravariant) lens of path objects over a reflexive graph $\gA$. Then the displayed reflexive graph $\CovDisp{\gA}{\gB}$ (\resp $\CtrvDisp{\gA}{\gB}$) is univalent.
539539+ \end{proposition}
540540+541541+542542+ The pay-off of introducing lenses of reflexive graphs is twofold. First of all, many naturally occuring displayed reflexive graphs have the shape of $\CovDisp{\gA}{\gB}$ or $\CtrvDisp{\gA}{\gB}$ already; more importantly, however, it frequently happens that the components of the given displayed reflexive graph arise as a pre-existing family of reflexive graphs for which we have already proved univalence. Therefore, it is advantageous to obtain a displayed path object automatically from a very simple algebraic structure on a pre-existing family of path objects: a pushforward operator and a lax unitor.
543543+544544+ \end{xsect}
545545+330546\end{xsect}
331547332548