1. Introduction
1.1 Martin-Löf’s identity types
In the setting of Martin-Löf’s intensional type theory (Nordström et al. Reference Nordström, Peterson and Smith1990), every type A comes equipped with a type constructor
$x:A,y:A\vdash x =_{A} y:\mathbf{type}$
that classifies identifications between elements of A, i.e. witnesses that two given elements are “equal”. Rather than being defined separately for each A, the identity type constructor
$=_{A}$
is specified generically for all types by means of formation, introduction, elimination, and computation rules. The formation and introduction rule for the identity type
can be thought of as equipping A with the structure of a reflexive graph Footnote 1 (see Definition 9). The elimination and computation rules
\begin{align*} &\qquad \qquad \frac{\substack{\Gamma\vdash A:\mathbf{type}\quad \Gamma,x:A,y:A,p:x =_{A} y\vdash C(x,y,p):\mathbf{type}\\ \Gamma,x:A\vdash c(x) : C(x,x,\mathbf{refl})\quad \Gamma\vdash u,v:A\quad \Gamma\vdash w:u =_{A} v}}{\Gamma\vdash \mathbf{J}_{A}^{C}(c;\;u,v,w) : C(u,v,w)}\\ &\frac{\substack{\Gamma\vdash A:\mathbf{type}\\ \Gamma,x:A,y:A,p:x =_{A} y\vdash C(x,y,p):\mathbf{type}\quad \Gamma,x:A\vdash c(x) : C(x,x,\mathbf{refl})\quad \Gamma\vdash u:A}}{\Gamma\vdash \mathbf{J}_{A}^{C}(c;\;u,u,\mathbf{refl}) \equiv c(u) : C(u,u,\mathbf{refl})} \end{align*}
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 identification induction below.
Principle 1 (Identification induction). Given a family of types
$x,y:A;\;p:x =_{A} y\vdash C(x,y,p): \mathbf{type}$
, to define a dependent function
$x,y:A;\;p:x =_{A} y\vdash f(x,y,p):C(x,y,p)$
it suffices to specify
$x:A\vdash f(x,x,\mathbf{refl}):C(x,x,\mathbf{refl})$
.
There is an alternative, equivalent, formulation of identification induction due to Paulin-Mohring (Reference Paulin-Mohring, Bezem and Groote1993) 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”:
Principle 2 (Based identification induction). Given a fixed element
$u:A$
and a family of types
$y:A,p:u =_{A} y\vdash B(y,p):\mathbf{type}$
, to define a dependent function
$y:A,p:u =_{A} y\vdash f(y,p):B(y,p)$
, it suffices to specify
$f(u,\mathbf{refl}) : B(u,\mathbf{refl})$
.
Independently, van den Berg and Garner (Reference van den Berg and Garner2011) and Lumsdaine (Reference Lumsdaine2010) 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.
1.2 Characterising identity types using (displayed) reflexive graphs
The role of the identity type is similar to that of equality in set theory: it expresses a single global notion of identification whose rules apply to all types simultaneously.Footnote 2 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.
The goal of reflexive graphs is to provide a methodology within Martin-Löf’s type theory by which the special properties of identifications in different types can be made explicit. An alternative design would be to use a type theory in which the identity types are not defined uniformly in each type, and instead each type comes with its own identity type, as in Observational Type Theory (Altenkirch et al. Reference Altenkirch, McBride and Swierstra2007; Altenkirch and McBride Reference Altenkirch and McBride2006) and Higher Observational Type Theory (Altenkirch et al. Reference Altenkirch, Chamoun, Kaposi and Shulman2024). Each design has trade-offs, but in this paper, we are restricting attention to what can be done without changing the type theory.
Remark 1. Everything in this section is derived from prior works, such as the HoTT Book (Univalent Foundations Program Reference Univalent Foundations Program2013), Rijke’s textbook on homotopy type theory (Rijke Reference Rijke2025), and the work of Schipp von Branitz and Buchholtz (Reference Schipp von Branitz and Buchholtz2021), although we do impose our own terminological conventions.
1.2.1 Shallow characterisation of identity types
For example, it is very natural to build up an identification of type
$(x,u) =_{A\times B} (y,v)$
from a pair of identifications
$x =_{A} y$
and
$u =_{B} v$
. This principle can be formalised by characterising the identity type of
$A\times B$
in terms of the identity types of A and B.
Proposition 2 (Shallow characterisation of the binary product). Each of the following functions is an equivalence:
Proof. We can explicitly construct an inverse to
$\mathsf{splitId}_{A,B}$
as follows:
The coherences of the equivalence are given by identification induction.
Of course, although the characterisation of identifications in
$A\times B$
in Proposition 2 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
$(A\times B)\times C$
by asserting that the canonical map
$((x,u),m) =_{(A\times B)\times C} ((y,v),n)\to ((x =_{A} y)\times(u =_{B} v))\times(m =_{C} n)$
is an equivalence. This can be established directly in the same way as Proposition 2 or by making use of the lemma, but the latter saves very little time. We would prefer to have a toolkit for building up “deep” characterisations of identity types piece-by-piece.
1.2.2 Deep characterisation using reflexive graphs
A “deep” characterisation of the identity type for binary products would take the following form: 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$
.
Proposition 2 can be “deepened” along these lines by replacing the types A and B with reflexive graphs
$\mathcal{A}$
and
$\mathcal{B}$
so that we have the following data:
\begin{align*}\begin{array}{l@{\qquad\qquad}l} {\lvert \mathcal{A} \rvert : \mathbf{type}}& {\lvert \mathcal{B} \rvert : \mathbf{type}}\\ {{\approx_{\mathcal{A}}} : \lvert \mathcal{A} \rvert\to \lvert \mathcal{A} \rvert\to \mathbf{type}}& {{\approx_{\mathcal{B}}} : \lvert \mathcal{B} \rvert\to \lvert \mathcal{B} \rvert\to \mathbf{type}}\\ {\mathsf{rx}_{\mathcal{A}} : \prod_{(x:\lvert \mathcal{A} \rvert)} x\approx_{\mathcal{A}}x} & {\mathsf{rx}_{\mathcal{B}} : \prod_{(x:\lvert \mathcal{B} \rvert)} x\approx_{\mathcal{B}}x}\\\end{array} \end{align*}
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
$\mathcal{G}$
is
univalent
when the following function is an equivalence:Footnote
3
\begin{align*} x,y:\lvert \mathcal{G} \rvert & \vdash \mathsf{idToEdge}_{\mathcal{G}}^{x,y} : x =_{\lvert \mathcal{G} \rvert} y \to x\approx_{\mathcal{G}}y \\ x:\lvert \mathcal{G} \rvert & \vdash \mathsf{idToEdge}_{\mathcal{G}}^{x,x} \mathbf{refl} :\equiv \mathsf{rx}_{\mathcal{G}}{x} \end{align*}
We shall often refer to a univalent reflexive graph as a path object for short. With these constructions on reflexive graphs in hand, a deep characterisation of the identity type for binary products can be formulated.
First, we define a new reflexive graph
$\mathcal{A}\times \mathcal{B}$
as follows:
\begin{align*} \lvert \mathcal{A}\times \mathcal{B} \rvert & :\equiv \lvert \mathcal{A} \rvert\times \lvert \mathcal{B} \rvert \\ (x,u) \approx_{\mathcal{A}\times \mathcal{B}} (y,v) & :\equiv (x\approx_{\mathcal{A}}y) \times (u\approx_{\mathcal{B}}v) \\ \mathsf{rx}_{\mathcal{A}\times\mathcal{B}}(x,u) & :\equiv (\mathsf{rx}_{\mathcal{A}}{x},\mathsf{rx}_{\mathcal{B}}{u}) \end{align*}
Then, the deep characterisation of binary products amounts to saying that path objects (i.e. univalent reflexive graphs) are closed under binary products.
Proposition 3 (Deep characterisation of the binary product). If
$\mathcal{A}$
and
$\mathcal{B}$
are two path objects, then
$\mathcal{A}\times \mathcal{B}$
is a path object.
The compositional character of Proposition 3 allows us to deduce other useful corollaries immediately by iteration. For example, if
$\mathcal{A},\mathcal{B},\mathcal{C}$
are all univalent reflexive graphs, then
$(\mathcal{A}\times\mathcal{B})\times\mathcal{C}$
is a univalent reflexive graph, etc. On the other hand, the shallow characterisation (Proposition 2) is immediately recoverable via the following definition of the
discrete
reflexive graph on a type A, which is univalent by definition:
\begin{align*} \lvert {\triangle}{A} \rvert & :\equiv A \\ x\approx_{{\triangle}{A}} y & :\equiv x =_{A} y \\ \mathsf{rx}_{{\triangle}{A}}{x} & :\equiv \mathbf{refl} \end{align*}
Then, Proposition 2 is precisely the instantiation of Proposition 3 with
$\mathcal{A} :\equiv {\triangle}{A}$
and
$\mathcal{B} :\equiv {\triangle}{B}$
. We can also generalise the binary product of reflexive graphs to arbitrary arity: if A is a type and
$\mathcal{B}(x)$
is a reflexive graph for each
$x:A$
, define
$\prod_{(x:A)}\mathcal{B}(x)$
to be the following reflexive graph:

Proposition 4 (Deep characterisation of product). Given
$\mathcal{B}(x)$
a path object for each
$x:A$
, the product
$\prod_{(x:A)}\mathcal{B}(x)$
is univalent assuming dependent function extensionality holds.
1.2.3 Dependent types and displayed reflexive graphs
So far, we have described how to give shallow and deep characterisations of non-dependent types. Of course, most mathematical structures of any interest (e.g. 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.
Given a type
$A:\mathbf{type}$
and a family of types
$x:A\vdash B(x) : \mathbf{type}$
, how can we characterise the identity type of the sum
$\sum_{(x:A)}B(x)$
? A shallow characterisation in the style of Section 1.2.1 is at least not out of reach.
Proposition 5 (Shallow characterisation of the indexed sum). Each of the following functions is an equivalence:

The shallow characterisation in Proposition 5 is more complex than that of Proposition 2 because the second component of the sum
$\sum_{(p:x =_{A} y)} p_*^B u =_{B(y)} v$
involves a transport. From a higher vantage point, the problem being solved by transport here is that we wish to identify
$u:B(x)$
with
$v:B(y)$
but these do not have the same type. Transport uses the identification
$p:x =_{A} 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(x)\to B(y)$
is somewhat arbitrary, as we might have also defined a backward transport
$p^*_B \colon B(y)\to B(x)$
and compared u,v in B(x).
In order to generalise Proposition 5 to a deep characterisation of the indexed sum, we must naturally generalise the concept of reflexive graph to one in which vertices form a dependent type and edges go between different components linked by an edge in the base. This is precisely the purpose of the displayed reflexive graphs of Schipp von Branitz and Buchholtz (Reference Schipp von Branitz and Buchholtz2021).
In particular, let
$\mathcal{A}$
be a reflexive graph as before and let
$\mathcal{B}$
be a
displayed reflexive graph
over
$\mathcal{A}$
so that we have the following data:

Any displayed reflexive graph such as
$\mathcal{B}$
gives rise to a family of ordinary reflexive graphs
$\mathcal{B}(x)$
indexed in vertices
$x:\lvert \mathcal{A} \rvert$
.
\begin{align*} \lvert \mathcal{B}(x) \rvert & :\equiv \lvert \mathcal{B} \rvert(x) \\ u \approx_{\mathcal{B}(x)} v & :\equiv u \approx_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}} v \\ \mathsf{rx}_{\mathcal{B}(x)}{u} & :\equiv \mathsf{rx}_{\mathcal{B}}^{x}{u} \end{align*}
A displayed reflexive graph
$\mathcal{B}$
will be called
univalent
(or a displayed path object for short) when each of its components is univalent. Considering only the components for univalence may seem at first counterintuitive, but this definition is justified by Proposition 6 below. For this, we first define the
total reflexive graph
of
$\mathcal{B}$
with vertices in the sum of
$\lvert \mathcal{B} \rvert$
over
$\lvert \mathcal{A} \rvert$
as follows:

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.
Proposition 6 (Deep characterisation of the indexed sum). Let
$\mathcal{B}$
be a displayed path object over a reflexive graph
$\mathcal{A}$
. Then, the total reflexive graph
$\mathcal{A}.\mathcal{B}$
is a path object.
1.3 Characterising transport with reflexive graph lenses
Everything we have described so far is more or less standard. Path objects (and equivalent concepts such as torsorial families) have been used to great effect in a variety of formalised libraries of univalent mathematics, including agda-unimath (Rijke et al. Reference Rijke, Stenholm, Prieto-Cubides and Bakke2023) and the 1Lab (1Lab Development Team 2022). 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 Proposition 5:
In our deep characterisation (Proposition 6), we generalised
$x =_{A} y$
to the edges
$x\approx_{\mathcal{A}}y$
of a reflexive graph
$\mathcal{A}$
, and we generalised
$p_*^Bu =_{B(y)} v$
to the displayed edges
$u\approx_{\mathcal{B}}^{p}{v}$
of a displayed reflexive graph
$\mathcal{B}$
over
$\mathcal{A}$
. 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
$\mathcal{B}$
as a displayed reflexive graph rather than as a family of reflexive graphs indexed in
$\mathcal{A}$
.
Our starting point is to consider a different, less abstract, generalisation of Proposition 5 in which we replace A with a reflexive graph
$\mathcal{A}$
as before, but we replace B not with a displayed reflexive graph over
$\mathcal{A}$
, but instead with a family of reflexive graphs
$\mathcal{B}(x)$
indexed in vertices
$x:\lvert \mathcal{A} \rvert$
that is equipped with a transport or pushforward operation to jump from one component to the next. To a first approximation, we have assumed the following data:

With this data in hand, we can define an appropriate displayed reflexive graph
$\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}$
over
$\mathcal{A}$
that mirrors the passage from the shallow characterisation (Proposition 5) to the deep characterisation (Proposition 6):
\begin{align*} \lvert \mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}} \rvert(x) & :\equiv \lvert \mathcal{B}(x) \rvert \\ u \approx_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{p:x\approx_{\mathcal{A}}y} v & :\equiv \mathsf{push}_{\mathcal{B}}^{p}{u}\approx_{\mathcal{B}(y)} v \end{align*}
It remains to define the displayed reflexivity datum
$\mathsf{rx}_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{x}{u} : \mathsf{push}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u} \approx_{\mathcal{B}(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 data of
$\mathcal{B}$
:
The above has the appearance of an oplax unitor for the pushforward operation. Using this oplax unitor, we may finish defining the displayed reflexive graph
$\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}$
:
Altogether, we shall refer to a family of reflexive graphs
$\mathcal{B}$
equipped with
$\mathsf{push}_{\mathcal{B}}^{\bullet}$
and
$\mathsf{pushRx}_{\mathcal{B}}^{\bullet}$
as an
oplax covariant lens
of reflexive graphs (see Definition 54) over
$\mathcal{A}$
— covariant because
$\mathsf{push}_{\mathcal{B}}^{\bullet}$
implements a forward transport and oplax because of the orientation of the unitor
$\mathsf{pushRx}_{\mathcal{B}}$
. The terminology of lenses is borrowed from Johnson and Rosebrugh (Reference Johnson and Rosebrugh2013); Chollet et al. (Reference Chollet, Clarke, Johnson, Songa, Wang and Zardini2022), 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 op. cit.).
Naturally, we can (and will) introduce a dual notion of lax contravariant lens for characterising backward transport in a family of reflexive graphs. When
$\mathcal{B}$
is a lax contravariant lens in this sense (see Definition 55), we can likewise associate a displayed reflexive graph
$\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}$
in which a displayed edge
$u\approx_{\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}}^{p:x\approx_{\mathcal{A}} y} v$
is given by an edge
$u \approx_{\mathcal{B}(x)} \mathsf{pull}_{\mathcal{B}}^{p}{v}$
.
Proposition 7 (See Lemma 60). Let
$\mathcal{B}$
be an oplax covariant (resp. lax contravariant) lens of path objects over a reflexive graph
$\mathcal{A}$
. Then the displayed reflexive graph
$\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}$
(resp.
$\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}$
) is univalent.
The pay-off of introducing lenses of reflexive graphs is twofold. First of all, many naturally occurring displayed reflexive graphs have the shape of
$\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}$
or
$\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}$
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.
1.4 Characterising identification induction with dependent lenses
Naturally, not all useful displayed path objects arise from (oplax covariant, lax contravariant) lenses. We have found, however, that many of the important counterexamples instead arise from a common generalisation of oplax covariant and lax contravariant lenses, which shares the advantages thereof over working directly with displayed reflexive graphs. Consider, for example, the case of magmas in a universe U, which are specified by the following data:

An equivalence of magmas
$M\approx_{\mathsf{Magma}_U} N$
is given by an equivalence of types
$f : \lvert M \rvert \cong \lvert N \rvert$
that preserves the binary operation in the following sense:

If we write
$\mathcal{U}$
for the reflexive graph structure on the universe U given by equivalences of types, then we would expect that the reflexive graph
$\mathsf{Magma}_U$
should arise as the total reflexive graph of the following displayed reflexive graph over
$\mathcal{U}$
:

The displayed reflexive graph above does not arise from an oplax covariant lens, nor from a lax contravariant lens. The following somewhat artificial displayed reflexive graphs could have been obtained from such lenses, but they would be difficult to use:

In order to capture the structure necessary to obtain the displayed reflexive graph
$\mathsf{BinOp}_U$
from a family of ordinary reflexive graphs, we must consider a different kind of lens. Before generalising, we first work with this specific case. Let
$\mathsf{BinOp}_U^\pm(\,f)$
be a reflexive graph as defined below for each equivalence
$f:A\approx_{\mathcal{U}}B$
of types:
Then we define the following operations on
$\mathsf{BinOp}_U^\pm$
:

We can now reconstruct the displayed reflexive graph
$\mathsf{BinOp}_U$
in terms of
$\mathsf{BinOp}_U^\pm$
:
\begin{align*} \lvert \mathsf{BinOp}_U \rvert(A) & \equiv \lvert \mathsf{BinOp}_U^\pm(\mathsf{rx}_{\mathcal{U}}{A}) \rvert \\ {\otimes_A} \approx_{\mathsf{BinOp}_U}^{\,f:A\approx_{\mathcal{U}}B} {\otimes_B} & \equiv \mathsf{lext}_{\mathsf{BinOp}_U^\pm}^{\,f}{\otimes_A} \approx_{\mathsf{BinOp}_U^\pm(\,f)} \mathsf{rext}_{\mathsf{BinOp}_U^\pm}^{\,f}{\otimes_B} \\ \mathsf{rx}_{\mathsf{BinOp}_U}^{A}{\otimes_A} & \equiv \mathsf{extRx}_{\mathsf{BinOp}_U^\pm}^{A} {\otimes_A} \end{align*}
Abstracting from the specific example of binary operations, the critical move above has been (1) to replace a given family of reflexive graphs
$x:\lvert \mathcal{A} \rvert\vdash \mathcal{B}(x)$
with a more general family
$x,y:\lvert \mathcal{A} \rvert;\;p:x\approx_{\mathcal{A}}y \vdash \mathcal{B}'(x,y,p)$
such that
$\mathcal{B}'(x,x,\mathsf{rx}_{\mathcal{A}}{x})\equiv \mathcal{B}(x)$
, and then (2) define coercions
$\mathsf{lext}_{\mathcal{B}'}^{\bullet} : \mathcal{B}(x) \to \mathcal{B}'(x,y,p)$
and
$\mathsf{rext}_{\mathcal{B}'}^{\bullet} : \mathcal{B}(y)\to \mathcal{B}'(x,y,p)$
from the “left-hand” and “right-hand” diagonal components to the “centre”. Naturally, these coercions must be further equipped with at least a coherence of the form
$\mathsf{extRx}_{\mathcal{B}'}^{x} u : \mathsf{lext}_{\mathcal{B}'}^{\mathsf{rx}_{\mathcal{A}}{x}}u \approx_{\mathcal{B}(x)} \mathsf{rext}_{\mathcal{B}'}^{\mathsf{rx}_{\mathcal{A}}{x}}u$
in order to generate a reflexivity datum; it will happen that in order for the univalence property carry over from
$\mathcal{B}$
to the associated displayed reflexive graph, we shall also need a coherence of the form
$\mathsf{rextRx}_{\mathcal{B}'}^{x} {u} : u \approx_{\mathcal{B}(x)} \mathsf{rext}_{\mathcal{B}'}^{\mathsf{rx}_{\mathcal{A}}{x}}{u}$
. Together, all this data forms what we shall refer to as a
unbiased dependent lens
of reflexive graphs over
$\mathcal{A}$
.
Remark 8. In the same way as oplax covariant (resp. lax contravariant) lenses express the interface of forward (resp. backward) transport for a family of reflexive graphs, unbiased dependent lenses express the interface of (forward and backward) based identification induction: the coercions
$\mathsf{lext}_{}^{}$
and
$\mathsf{rext}_{}^{}$
extend data defined on a given reflexivity datum
$\mathsf{rx}_{\mathcal{A}}{x}$
to data defined on an arbitrary path based at
$x:\lvert \mathcal{A} \rvert$
.
1.5 Discussion of related work
1.5.1 Path objects in homotopy type theory
A biased version of path objects was introduced already in the HoTT Book (Univalent Foundations Program Reference Univalent Foundations Program2013, § 5.8) under the name identity system; this concept is developed much further in the displayed direction by Rijke in his introductory textbook on homotopy type theory (Rijke Reference Rijke2025, § 11.2). In their guise as torsorial families, biased identity systems are employed pervasively in agda-unimath, an “online encyclopedia of formalized mathematics … from a univalent point of view” (Rijke et al. Reference Rijke, Stenholm, Prieto-Cubides and Bakke2023). An unbiased version of identity systems is used extensively in the 1Lab (1Lab Development Team 2022), another library of univalent mathematics formalised in Cubical Agda (Vezzosi et al. Reference Vezzosi, Mörtberg and Abel2019).
Our work is most directly inspired by that of Schipp von Branitz and Buchholtz (Reference Schipp von Branitz and Buchholtz2021); Schipp von Branitz (Reference Schipp von Branitz2020), who have emphasised the importance of displayed path objects as an organising principle for univalent mathematics. The various notions of lens that we introduce can be thought of as organisational devices to simplify carrying out the methods suggested by op. cit. in practice.
1.5.2 Reflexive graphs and reflexive graph fibrations
Although univalent reflexive graphs are the ones that are important for characterising identity types, we have found it very useful to develop as much structure as possible in the language of ordinary reflexive graphs; this is because the reflexive graph structure captures the aspects of an identity type’s characterisation that we intend to have good definitional/computational behaviour, whereas the univalent part describes a universal property that we expect to hold (opaquely) only up to homotopy. Our starting point in studying the theory of reflexive graphs has been the doctoral dissertation of Rijke (Reference Rijke2019), who introduces many important concepts from the univalent point of view, including the univalence condition (called discreteness by op. cit.) as well as the notion of (covariant, contravariant) fibration of reflexive graphs. (It should be noted that the concept of fibred (non-reflexive) graph was introduced already by Boldi and Vigna (Reference Boldi and Vigna2002).)
Schipp von Branitz and Buchholtz (Reference Schipp von Branitz and Buchholtz2021); Schipp von Branitz (Reference Schipp von Branitz2020) introduced displayed reflexive graphs as a more type theoretical presentation of homomorphisms of reflexive graphs; we have re-based Rijke (Reference Rijke2019)’s theory of reflexive graph fibrations in terms of displayed reflexive graphs in roughly the same way that Ahrens and Lumsdaine (Reference Ahrens and Lumsdaine2019) re-examine (Street) fibrations of categories in terms of displayed categories.
1.5.3 The structure identity principle
Coquand and Danielsson (Reference Coquand and Danielsson2013) have famously observed that Voevodsky’s univalence principle ensures that the identity types of various algebraic structures (e.g. groups, rings, graphs, etc.) can be characterised so as to coincide precisely with the natural notion of invertible homomorphism: for example, an identification of groups valued in a univalent universe is precisely a group isomorphism. Results of this kind are called structure identity principles; a convenient general form of the structure identity principle for concrete categories appears in the HoTT Book (Univalent Foundations Program Reference Univalent Foundations Program2013, § 9.8); a simpler version was introduced by Escardó (Reference Escardó2022) for his lectures at the Midlands Graduate School in 2019, and included as part of the TypeTopology and cubical Agda libraries (The Agda Community 2024; Escardó and contributors 2024).
These structure identity principles are the special case of the more general theory of path objects, restricted to the case of displaying an algebraic structure over the path object given by types and equivalences. Of course, not all important path objects take this form: for example, it is necessary to characterise the identity type of the type of sections of a given map, and the base of this thing is a function space rather than a universe. This is why it is important to develop the theory of path objects in its most general form, and then specialise it to obtain a variety of structure identity principles.
1.5.4 Delta lenses and applied category theory
Diskin et al. (Reference Diskin, Xiong and Czarnecki2011) have introduced delta lenses as an algebraic structure modelling bidirectional transformations between systems (modelled as categories). As many authors have pointed out (Clarke Reference Clarke2020; Chollet et al. Reference Chollet, Clarke, Johnson, Songa, Wang and Zardini2022; Johnson and Rosebrugh Reference Johnson and Rosebrugh2013), delta lenses can be thought of as an algebraic generalisation of split opfibrations in which lifts are chosen functorially but are not required to be cocartesian.
Our reflexive graph lenses resemble a version of delta lenses that replaces categories with reflexive graphs, but there are some important differences. When
$\mathcal{B}' :\equiv \mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}$
is the displayed reflexive graph associated to an oplax covariant lens
$\mathcal{B}$
, we do indeed assign to each
$u:\lvert \mathcal{B}' \rvert(x)$
and
$p:x\approx_{\mathcal{A}}y$
a displayed vertex
$\mathsf{push}_{\mathcal{B}}^{p}{u} : \lvert \mathcal{B}' \rvert(x)$
and a lift
$\bar{p}: u\approx_{\mathcal{B}'}^{p}\mathsf{push}_{\mathcal{B}}^{p}{u}$
given by the reflexivity datum on the former in
$\mathcal{B}(y)$
. In contrast to delta lenses, we do not require that
$\mathsf{push}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}u$
is equal to u: we require only an oplax unitor, i.e. an edge
$\mathsf{pushRx}_{\mathcal{B}}^{x}{u} : \mathsf{push}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u}\approx_{\mathcal{B}(y)}u$
.
We also consider contravariant versions of reflexive graph lenses, which turn out to be equally important in practice. Our alignment of (covariant, contravariant) and (oplax, lax) is not chosen arbitrarily, but is rather forced by the need to transform a lens of whichever variance into a displayed reflexive graph.
In Section 3.4, we study an important class of reflexive graph lenses in which pushforward along the reflexivity edge is definitionally equivalent to the identity function. These definitional lenses correspond most closely to delta lenses and arise frequently when establishing structure identity principles in the sense of Section 1.5.3.
1.6 The structure of this paper
In Section 2, we shall recall the theory of (displayed) reflexive graphs and path objects in detail (at the risk of some repetition). In Section 3, we expose the theory of (oplax covariant, lax contravariant, and unbiased dependent) lenses and prove the uniqueness of all these structures on families of path objects over a path object. In Section 4, we develop a case study that applies the theory of reflexive graph lenses to characterise the identity types of reflexive graphs, displayed reflexive graphs, etc. — in short, we construct large reflexive graphs classifying small reflexive graphs, etc. Finally, in Section 5, we develop the theory of reflexive graph fibrations (building on Rijke (Reference Rijke2019)) and conclude with our main result: an equivalence between reflexive graph fibrations and lenses of path objects.
Conventions. We work in Martin-Löf’s intensional dependent type theory with products
$\prod_{(x:A)}{B(x)}$
, sums
$\sum_{(x:A)}B(x)$
, identity types
$x =_{A} y$
, a unit type
$\mathbf{1}$
, and type
$\mathbb{N}$
of natural numbers; products, sums, and the unit type are assumed to have definitional
$\eta$
-laws. We do not globally assume any universes, nor function extensionality, nor univalence; these constructs are assumed locally where needed. We use the symbol
$\equiv$
to denote definitional equality, and
$=_A$
to denote identity types. We follow the vernacular of univalent foundations, in which propositions and sets are defined extrinsically in terms of identity types. When we refer to existence, we mean it in the usual propositionally truncated sense of standard mathematical vernacular rather than in the sense of the HoTT Book (Univalent Foundations Program Reference Univalent Foundations Program2013).
2. Reflexive Graphs and Path Objects
We recall the theory of reflexive graphs from Rijke (Reference Rijke2019), incorporating the viewpoint of displayed reflexive graphs from Schipp von Branitz and Buchholtz (Reference Schipp von Branitz and Buchholtz2021).
Definition 9 (Reflexive graph). A reflexive graph
$\mathcal{A} \equiv (\lvert \mathcal{A} \rvert,\approx_{\mathcal{A}},\mathsf{rx}_{\mathcal{A}})$
is defined to be a type
$\lvert \mathcal{A} \rvert:\mathbf{type}$
of vertices together with a family of types
$x:\lvert \mathcal{A} \rvert,y:\lvert \mathcal{A} \rvert\vdash x\approx_{\mathcal{A}} y$
of edges and a reflexivity datum
$x:\lvert \mathcal{A} \rvert\vdash \mathsf{rx}_{\mathcal{A}}{x}:x\approx_{\mathcal{A}} x$
.
At times, we may refer to homomorphisms of reflexive graphs.
Definition 10.
Let
$\mathcal{A}$
and
$\mathcal{B}$
be reflexive graphs. A homomorphism
$f\colon \mathcal{A}\to \mathcal{B}$
is given by the following data:
\begin{align*} x:\lvert \mathcal{A} \rvert&\vdash \lvert\,f \rvert(x): \lvert \mathcal{B} \rvert\\ x,y:\lvert \mathcal{A} \rvert;\;p:x\approx_{\mathcal{A}}y&\vdash f^{\approx}_{x,y}(p) \colon \lvert\,f \rvert(x)\approx_{\mathcal{B}}\lvert\,f \rvert(y)\\ x:\lvert \mathcal{A} \rvert&\vdash f^{\approx}_{x,x}(\mathsf{rx}_{\mathcal{A}}x) =_{\lvert f \rvert x\approx_{\mathcal{B}}\lvert f \rvert x} \mathsf{rx}_{\mathcal{B}}(\lvert\,f \rvert x) \end{align*}
Definition 11 (Displayed reflexive graph). Let
$\mathcal{A}$
be a reflexive graph. A displayed reflexive graph
$\mathcal{B} \equiv (\lvert \mathcal{B} \rvert,\approx_{\mathcal{B}}^{\bullet},\mathsf{rx}_{\mathcal{B}}^{\bullet})$
over
$\mathcal{A}$
is given by the following data:
\begin{align*} x:\lvert \mathcal{A} \rvert & \vdash \lvert \mathcal{B} \rvert(x):\mathbf{type}\tag{vertices} \\ p:x\approx_{\mathcal{A}} y,u:\lvert \mathcal{B} \rvert(x),v:\lvert \mathcal{B} \rvert(y) & \vdash u\approx_{\mathcal{B}}^{p} v:\mathbf{type}\tag{edges} \\ x:\lvert \mathcal{A} \rvert,u:\lvert \mathcal{B} \rvert(x) & \vdash \mathsf{rx}_{\mathcal{B}}^{x}{u}:u \approx_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}} u\tag{reflexivity} \end{align*}
Definition 12 (Components of a displayed reflexive graph). Let
$\mathcal{B}$
be a displayed reflexive graph over
$\mathcal{A}$
. Then, the component of
$\mathcal{B}$
at an element
$x:\lvert \mathcal{A} \rvert$
is the reflexive graph
$\mathcal{B}(x)$
defined from
$\mathcal{B}$
as follows:
\begin{align*} \lvert \mathcal{B}(x) \rvert & :\equiv \lvert \mathcal{B} \rvert(x) \\ u\approx_{\mathcal{B}(x)}v & :\equiv u \approx_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}} v \\ \mathsf{rx}_{\mathcal{B}(x)}{u} & :\equiv \mathsf{rx}_{\mathcal{B}}^{x}{u} \end{align*}
Notation 13 (Diagonal family of reflexive graphs). When
$\mathcal{B}$
is a displayed reflexive graph over
$\mathcal{A}$
, we will at times write
$\mathcal{B}_{\mathsf{rx}}$
for the “diagonal”
$\lvert \mathcal{A} \rvert$
-indexed family of reflexive graphs assigning to each
$x:\lvert \mathcal{A} \rvert$
the component
$\mathcal{B}_{\mathsf{rx}}(x) :\equiv \mathcal{B}(x)$
.
2.1 Basic constructions on reflexive graphs
The most basic reflexive graph structure is the discrete one provided by its identity type.
Definition 14 (Discrete reflexive graph). The discrete reflexive graph
${\triangle}{A}$
on a type A is given by its identity type, i.e. we define
${\triangle}{A} :\equiv (A, =_{A},\mathbf{refl})$
.
On the other extreme, we may consider the codiscrete reflexive graph structure.
Definition 15 (Codiscrete reflexive graph). A type A can be, conversely, equipped with the codiscrete reflexive graph structure
${\triangledown}{A}$
that identifies any two elements:
\begin{align*} \lvert {\triangledown}{A} \rvert & :\equiv A \\ x \approx_{{\triangledown}{A}}y & :\equiv \mathbf{1} \\ \mathsf{rx}_{{\triangledown}{A}}{x} & :\equiv * \end{align*}
Definition 16 (Total reflexive graph). If
$\mathcal{A}$
is a reflexive graph and
$\mathcal{B}$
is a displayed reflexive graph over
$\mathcal{A}$
, then the total reflexive graph
$\mathcal{A}.\mathcal{B}$
can be defined with vertices in
$\sum_{(x:\lvert \mathcal{A} \rvert)}\lvert \mathcal{B} \rvert(x)$
and edges
$(a_0,b_0) \approx_{\mathcal{A}.\mathcal{B}} (a_1,b_1)$
in
$\sum_{(p:a_0\approx_{\mathcal{A}} a_1)} b_0 \approx_{\mathcal{B}}^{p} b_1$
, with reflexivity data given by
$\mathsf{rx}_{\mathcal{A}.\mathcal{B}}{(a,b)} :\equiv (\mathsf{rx}_{A}{a},\mathsf{rx}_{B}{b})$
. Naturally, we have a homomorphism
$\pi_{\mathcal{B}}\colon \mathcal{A}.\mathcal{B} \to \mathcal{A}$
of reflexive graphs:
\begin{align*} \lvert \pi_{\mathcal{B}} \rvert\,(x,y) & :\equiv x \\ \pi_{\mathcal{B}}^{\approx}\,(p,q) & :\equiv p \\ \pi_{\mathcal{B}}^{\mathsf{rx}}\,(x,y) & :\equiv \mathbf{refl} \end{align*}
Definition 17 (Binary product of reflexive graphs). If
$\mathcal{A}$
and
$\mathcal{B}$
are reflexive graphs, then we may form the product of reflexive graphs
$\mathcal{A}\times\mathcal{B}$
with vertices in
$\lvert \mathcal{A} \rvert\times\lvert \mathcal{B} \rvert$
, where the type of edges
$(a_0,b_0)\approx_{\mathcal{A}\times\mathcal{B}} (a_1,b_1)$
is the cartesian product
$(a_0\approx_{\mathcal{A}} a_1) \times (b_0\approx_{\mathcal{B}} b_1)$
with reflexivity data defined by
$\mathsf{rx}_{\mathcal{A}\times\mathcal{B}}{(x,y)} :\equiv (\mathsf{rx}_{\mathcal{A}}{x},\mathsf{rx}_{\mathcal{B}}{y})$
.
We can generalise Definition 17 to arbitrary families.
Definition 18 (Product of reflexive graphs). Let A be a type and let
$\mathcal{B}(x)$
be a reflexive graph for each
$x:A$
. The product
$\prod_{(x:A)}\mathcal{B}(x)$
of the family of
$\mathcal{B}$
reflexive graphs is defined like so:

Definition 19 (Coproduct of reflexive graphs). Let A be a type and let
$\mathcal{B}(x)$
be a reflexive graph for each
$x:A$
. The coproduct
$\coprod_{(x:A)}\mathcal{B}(x)$
of the family
$\mathcal{B}$
of reflexive graphs is defined like so:

Later on in Example 73, we will see how to refactor the construction of the coproduct of reflexive graphs in terms of a lens over the discrete reflexive graph
${\triangle}{A}$
.
Definition 20 (Tensor and cotensor of reflexive graphs). Let A be a type and let
$\mathcal{B}$
be a reflexive graph; then, the tensor and cotensor of
$\mathcal{B}$
by A are defined, respectively, using coproducts and products as below:

Definition 21 (Constant displayed reflexive graph). Let
$\mathcal{A}$
and
$\mathcal{B}$
be reflexive graphs. The constant displayed reflexive graph over
$\mathcal{A}$
induced by
$\mathcal{B}$
is the displayed reflexive graph specified
$\mathcal{A}^*\mathcal{B}$
below:
\begin{align*} \lvert \mathcal{A}^*\mathcal{B} \rvert(x) & :\equiv \lvert \mathcal{B} \rvert \\ u \approx_{\mathcal{A}^*\mathcal{B}}^{p} v & :\equiv u \approx_{\mathcal{B}} v \\ \mathsf{rx}_{\mathcal{A}^*\mathcal{B}}^{x}{u} & :\equiv \mathsf{rx}_{\mathcal{B}}{u} \end{align*}
Thus, evidently, we have
$(\mathcal{A}^*\mathcal{B})(x)\equiv \mathcal{B}$
for all
$x:\lvert \mathcal{A} \rvert$
.
Observation 22 (Binary product as a total reflexive graph). For any two reflexive graphs
$\mathcal{A}$
and
$\mathcal{B}$
, we have
$\mathcal{A}.(\mathcal{A}^*\mathcal{B}) \equiv \mathcal{A}\times \mathcal{B}$
.
Definition 23 (Subgraph comprehension). Let
$\mathcal{A}$
be a reflexive graph, and let P(x) be a proposition for each vertex
$x:\mathcal{A}$
. We define the comprehension of P to be the following reflexive graph:

Construction 24 (Restriction of iterated displayed reflexive graphs). Let
$\mathcal{A}$
be a reflexive graph object, and let
$\mathcal{B}$
be a displayed reflexive graph over
$\mathcal{A}$
, and let
$\mathcal{C}$
be a displayed reflexive graph over
$\mathcal{A}.\mathcal{B}$
. Then for any
$x:\lvert \mathcal{A} \rvert$
, we may define a displayed reflexive graph
$\mathcal{C}_{\vert \mathcal{B}(x)}$
over the component
$\mathcal{B}(x)$
with vertices given as follows:
Displayed edges and reflexivity data are defined in terms of those of
$\mathcal{C}$
like so:

Computation 25 (Components of the restriction). Let
$\mathcal{A}$
be a reflexive graph, and let
$\mathcal{B}$
be a displayed reflexive graph over
$\mathcal{A}$
, and let
$\mathcal{C}$
be a displayed reflexive graph over
$\mathcal{A}.\mathcal{B}$
. Given
$x:\lvert \mathcal{B} \rvert$
and
$u:\lvert \mathcal{B} \rvert(x)$
, the component
$(\mathcal{C}_{\vert \mathcal{B}(x)})(u)$
of the restriction of
$\mathcal{C}$
to
$\mathcal{B}(x)$
at u is definitionally equal to the component
$\mathcal{C}((x,u))$
of
$\mathcal{C}$
at
$(x,u):\lvert \mathcal{A}.\mathcal{B} \rvert$
.
2.2 Duality involution for reflexive graphs
Definition 26 (Opposite reflexive graph). We define the opposite of a reflexive graph
$\mathcal{A}$
as follows:
\begin{align*} \lvert \mathcal{A}^{\mathsf{op}} \rvert &:\equiv \lvert \mathcal{A} \rvert \\ x \approx_{\mathcal{A}^{\mathsf{op}}} y &:\equiv y\approx_{\mathcal{A}} x \\ \mathsf{rx}_{\mathcal{A}^{\mathsf{op}}}{x} &:\equiv \mathsf{rx}_{\mathcal{A}}{x} \end{align*}
Observation 27
The opposite reflexive graph operation is definitionally involutive: we have
$(\mathcal{A}^{\mathsf{op}})^{\mathsf{op}} \equiv \mathcal{A}$
definitionally.
Definition 28 (Total opposite of a displayed reflexive graph). Let
$\mathcal{A}$
be a reflexive graph, and let
$\mathcal{B}$
be a displayed reflexive graph over
$\mathcal{A}$
. We define the total opposite
$\mathcal{B}^{\widetilde{\mathsf{op}}}$
of
$\mathcal{B}$
to be the following displayed reflexive graph over
$\mathcal{A}^{\mathsf{op}}$
,
\begin{align*} \lvert \mathcal{B}^{\widetilde{\mathsf{op}}} \rvert(x) &:\equiv \lvert \mathcal{B} \rvert(x) \\ u \approx_{\mathcal{B}^{\widetilde{\mathsf{op}}}}^{p} v &:\equiv v\approx_{\mathcal{B}}^{p}u \\ \mathsf{rx}_{\mathcal{B}^{\widetilde{\mathsf{op}}}}^{x}{u} &:\equiv \mathsf{rx}_{\mathcal{B}}^{x}{u}\text{,} \end{align*}
so that we have
$(\mathcal{A}.\mathcal{B})^{\mathsf{op}} \equiv \mathcal{A}^{\mathsf{op}}.\mathcal{B}^{\widetilde{\mathsf{op}}}$
.
Note that Definition 28 does not define the actual “opposite” of a displayed reflexive graph
$\mathcal{B}$
, which would naturally have the same base as
$\mathcal{B}$
; opposites of arbitrary displayed reflexive graphs do not make sense (for the same reason that Bénabou’s definition of opposites applies only to displayed categories that are additionally fibrations).
Observation 27 extends to the following duality involution on displayed reflexive graphs vs Definition 28.
Observation 29 (Duality involution for displayed reflexive graphs). The operation sending a displayed reflexive graph to its total opposite is definitionally involutive, i.e. we have
$(\mathcal{B}^{\widetilde{\mathsf{op}}})^{\widetilde{\mathsf{op}}} \equiv \mathcal{B}$
.
2.3 Path objects and the univalence condition
Definition 30 (Fans of a vertex). Let
$\mathcal{A}$
be a reflexive graph. The fan of a vertex
$x:\lvert \mathcal{A} \rvert$
is defined to be the type
$\{x\}_{\mathcal{A}}^{+} :\equiv \sum_{(y:A)}x\approx_{\mathcal{A}}y$
of vertices equipped with an edge from x; dually, the co-fan of a vertex
$x:\lvert \mathcal{A} \rvert$
is defined to be the type
$\{x\}_{\mathcal{A}}^{-} :\equiv \sum_{(y:A)}y\approx_{\mathcal{A}}x$
of vertices equipped with an edge toward x.
Lemma 31. Let
$\mathcal{A}$
be a reflexive graph, then every fan of
$\mathcal{A}$
is a proposition if and only if every co-fan of
$\mathcal{A}$
is a proposition.
Proof. First, we assume that every fan is contractible:

Conversely, assume that every co-fan is contractible.

Construction 32 (From identifications to edges). The reflexivity datum of a reflexive graph
$\mathcal{A}$
induces a function from identifications to edges as follows:

When it causes no ambiguity, we will write
$\lfloor p\rfloor_{\mathcal{A}}$
for
$ \lfloor p\rfloor^{x,y}_{\mathcal{A}}$
.
Lemma 33 (From edges to identifications via propositional fans). Suppose that each fan
$\{x\}_{\mathcal{A}}^{+}$
of a reflexive graph
$\mathcal{A}$
is a proposition. Then, each
$\lfloor{-}\rfloor^{x,y}_{\mathcal{A}}$
has a quasi-inverse
$[\![{-}]\!]^{x,y}_{\mathcal{A}} \colon x\approx_{\mathcal{A}}y\to x =_{\lvert \mathcal{A} \rvert} y$
and is therefore an equivalence.
Proof. Let
$\Phi_x$
be the proof that a given fan
$\{x\}_{\mathcal{A}}^{+}$
is a proposition. Rather than defining
$[\![{-}]\!]^{x,y}_{\mathcal{A}} : x\approx_{\mathcal{A}}y\to x =_{\lvert \mathcal{A} \rvert} y$
directly, we construct a slightly more general function that anticipates the contractibility of
$\{x\}_{\mathcal{A}}^{+}$
.

Then, we define
$[\![{-}]\!]^{x,y}_{\mathcal{A}}$
by instantiation.
Next we prove that
$[\![{-}]\!]^{x,y}_{\mathcal{A}}$
is a section of
$\lfloor{-}\rfloor^{x,y}_{\mathcal{A}}$
.

Finally, we prove that
$[\![{-}]\!]^{x,y}_{\mathcal{A}}$
is a retraction of
$\lfloor{-}\rfloor^{x,y}_{\mathcal{A}}$
.

Lemma 34. For a reflexive graph
$\mathcal{A}$
, each function
$\lfloor{-}\rfloor^{x,y}_{\mathcal{A}}$
is an equivalence if and only if each fan
$\{z\}_{\mathcal{A}}^{+}$
is a proposition.
Proof. We have seen one direction already in Lemma 33. Conversely, suppose that each component of
$\lfloor{-}\rfloor^{x,y}_{\mathcal{A}}$
is an equivalence; then clearly each
$\{z\}_{\mathcal{A}}^{+}\equiv \sum_{(y:\lvert \mathcal{A} \rvert)} z \approx_{\mathcal{A}}y$
is a retract of
$\sum_{(y:\lvert \mathcal{A} \rvert)}x =_{\lvert \mathcal{A} \rvert} y \equiv \{x\}_{\lvert \mathcal{A} \rvert}$
, which is contractible by the contractibility of singletons. Therefore, each fan is contractible and hence a proposition.
Definition 35 (Univalent reflexive graph). A reflexive graph
$\mathcal{A}$
is called univalent when any of the following equivalent conditions hold:
-
(1) Each fan
$\{x\}_{\mathcal{A}}^{+}$
is a proposition.
-
(2) Each co-fan
$\{x\}_{\mathcal{A}}^{-}$
is a proposition.
-
(3) Each fan
$\{x\}_{\mathcal{A}}^{+}$
is contractible with centre
$(x,\mathsf{rx}_{\mathcal{A}}{x})$
. -
(4) Each co-fan
$\{x\}_{\mathcal{A}}^{-}$
is contractible with centre
$(x,\mathsf{rx}_{\mathcal{A}}{x})$
. -
(5) Each of the functions
$\mathsf{idToEdge}_{x,y} : x =_{\lvert \mathcal{A} \rvert} y \to x\approx_{\mathcal{A}}y$
defined in Construction 32 is an equivalence.
We shall refer to a univalent reflexive graph as a path object .
Proof. The equivalence of the stated conditions follows from Lemmas 31 and 34.
Definition 36 (Univalent displayed reflexive graph). Let
$\mathcal{A}$
be a reflexive graph. A displayed reflexive graph
$\mathcal{B}$
over
$\mathcal{A}$
is called univalent when for each
$x:\lvert \mathcal{A} \rvert$
, the component (Definition 12)
$\mathcal{B}(x)$
is univalent in the sense of Definition 35. We shall refer to a univalent displayed reflexive graph as a displayed path object, regardless of whether the base
$\mathcal{A}$
is univalent.
2.4 Path algebra in a path object
Edges in an arbitrary reflexive graph cannot be concatenated or inverted; when the reflexive graph is univalent, i.e. a path object, the type of edges becomes (by Lemma 34) equivalent to the first level of the canonical
$\infty$
-groupoid structure on the type of vertices, and as such brooks fully coherent concatenation and inversion operations. We will need these operations only rarely — and indeed, the central thesis of the theory of path objects in univalent foundations is that it is often possible to avoid painful path algebra by very careful choices of path object structure.
Construction 37 (Path algebra toolkit). Given any path object
$\mathcal{A}$
, we may construct the following terms facilitating path algebra in
$\mathcal{A}$
.

Of course, there is no end to the possible combinators, so we have presented just a few representative examples that we will make use of.
Lemma 38 (Pre-concatenation equivalence). For a path object
$\mathcal{A}$
and an edge
$p:x\approx_{\mathcal{A}}y$
, we have a family of equivalences induced by pre-concatenation with p as below,
with chosen inverse
$(p^{-1}_{\mathcal{A}} {{\,\centerdot\,}}_{\mathcal{A}} -) : x\approx_{\mathcal{A}}z \to y\approx_{\mathcal{A}}z$
.
Proof. Simple path algebra using
$\mathsf{assoc}$
,
$\mathsf{lunit}$
,
$\mathsf{lsym}$
, and
$\mathsf{rsym}$
from Construction 37.
2.5 Univalent families and reflexive graph images
Definition 39 (Reflexive graph image). The reflexive graph image of a type A under a family of types
$x:A\vdash B(x):\mathbf{type}$
is defined to be the following reflexive graph
$A/B$
:
\begin{align*} \lvert A/B \rvert & :\equiv A \\ x \approx_{A/B} y & :\equiv \mathsf{Equiv}(B(x),B(y)) \\ \mathsf{rx}_{A/B}{x} & :\equiv \mathsf{idnEquiv}_{B(x)} \end{align*}
Definition 40 (Univalent family of types). Let A be a type, and let B be a family of types indexed in A. The pair (A,B) is said to be univalent when any of the following equivalent conditions hold:
-
(1) For each
$x:A$
, the type
$\sum_{(y:A)}\mathsf{Equiv}(B(x),B(y))$
is a proposition.
-
(2) For each
$x:A$
, the type
$\sum_{(y:A)}\mathsf{Equiv}(B(x),B(y))$
is a contractible.
-
(3) For each
$x,y:A$
the canonical map
$x =_{A} y\to \mathsf{Equiv}(B(x),B(y))$
sending
$\mathbf{refl}$
to the identity equivalence is an equivalence.
-
(4) The reflexive graph image
$A/B$
is univalent.
Proof. For (1,2), inhabited types are propositions if and only if they are contractible. The remainder is the “fundamental theorem of identity types” (Rijke Reference Rijke2025).
One often refers to a univalent family of types (U,E) as a universe to emphasise that it may be closed under various type constructors, etc.
Definition 41 (Propositional reflexive graph image). Let B(x) be a proposition for each
$x:A$
. The propositional reflexive graph image of A under B is defined to be the following reflexive graph
$A/_{-1}B$
:
\begin{align*} \lvert A/_{-1}B \rvert & :\equiv A \\ x \approx_{A/_{-1}B} y & :\equiv (B(x)\to B(y))\times(B(y)\to B(x)) \\ \mathsf{rx}_{A/_{-1}B}{x} & :\equiv (\lambda{u}\mathpunct{.}{u},\lambda{u}\mathpunct{.}{u}) \end{align*}
Observation 42
Let B be a family of propositions indexed in A. The pair (A,B) is univalent if and only if the propositional reflexive graph image
$A/_{-1}B$
is univalent.
Definition 43 (Univalent family of path objects). A univalent family of path objects is defined to be a pair
$(U,\mathcal{E})$
where U is a type and
$A:U\vdash \mathcal{E}(A)$
is a family of path objects in U such that the reflexive graph image
$U/\lvert \mathcal{E} \rvert$
is univalent.
2.6 Basic closure properties of path objects
Lemma 44 (Opposite path object). A reflexive graph
$\mathcal{A}$
is univalent if and only if its opposite
$\mathcal{A}^{\mathsf{op}}$
is univalent.
Proof. This is an immediate consequence of Lemma 31.
Lemma 45 (Total path object). If
$\mathcal{A}$
is a path object and
$\mathcal{B}$
is a displayed path object over
$\mathcal{A}$
, then
$\mathcal{A}.\mathcal{B}$
is a path object.
Proof. Univalence is established as follows.

Observation 46 (Constant displayed path object). Let
$\mathcal{A}$
be a reflexive graph and let
$\mathcal{B}$
be a path object. Then the constant displayed reflexive graph
$\mathcal{A}^*\mathcal{B}$
over
$\mathcal{A}$
is univalent.
Proof. This follows immediately, considering that we have
$(\mathcal{A}^*\mathcal{B})(x)\equiv \mathcal{B}$
for each
$x:\lvert \mathcal{A} \rvert$
by definition.
Corollary 47 (Binary product of path objects). If
$\mathcal{A}$
and
$\mathcal{B}$
are path objects, then so is
$\mathcal{A}\times \mathcal{B}$
.
Definition 48 (Function extensionality). Dependent function extensionality is precisely the property that for each type A and family
$\mathcal{B}(x)$
of path objects indexed in
$x:A$
, the product
$\prod_{(x:A)}\mathcal{B}(x)$
is a path object. Likewise, non-dependent function extensionality states that for each type A and path object
$\mathcal{B}$
, the cotensor
$A\pitchfork \mathcal{B}$
is a path object.
Lemma 49
(Coproduct of path objects). For any type A and family
$\mathcal{B}(x)$
of path objects indexed in
$x:A$
, the coproduct
$\coprod_{(x:A)}\mathcal{B}(x)$
is a path object.
Proof. We establish the univalence condition as follows.

Corollary 50 (Tensor of path objects). The tensor
$A\cdot\mathcal{B}$
of a path object
$\mathcal{B}$
by a type A is a path object.
Corollary 51 (Discrete path object). The discrete reflexive graph
${\triangle}{A}$
on any type A is univalent.
Proof. This is precisely the contractibility of singletons.
Lemma 52 (Codiscrete path object). The codiscrete reflexive graph
${\triangledown}{A}$
on a type A is univalent if and only if A is a proposition.
Proof. Suppose that
$\mathcal{A}$
is a proposition. Then univalence is established like so:

Conversely, assume that
${\triangledown}{A}$
is univalent. For any two
$x,y:A$
, we evidently have
$*:x\approx_{{\triangledown}{A}}y$
and thus
$[\![{*}]\!]^{x,y}_{{\triangledown}{A}} : x =_{A} y$
by Lemma 33.
Lemma 53 (Path subobject comprehension). If
$\mathcal{A}$
is a path object and P(x) is a proposition for each vertex
$x:\lvert \mathcal{A} \rvert$
, then the comprehension
${\{x:\mathcal{A}| P(x)\}}$
is a path object.
Proof. Univalence is established as follows:

3. Lenses of Reflexive Graphs and Path Objects
In this section, we are concerned with various kinds of families of ordinary reflexive graphs, and how they give rise to certain naturally occurring displayed reflexive graphs.
3.1 Lenses of reflexive graphs
We introduce two dual kinds of lens of reflexive graphs.
Definition 54 (Oplax covariant lens). Let
$\mathcal{A}$
be a reflexive graph. An oplax covariant lens of reflexive graphs over
$\mathcal{A}$
is defined to be a family of reflexive graphs
$\mathcal{B}(x)$
indexed in
$x:\lvert \mathcal{A} \rvert$
equipped with the following data:
Definition 55 (Lax contravariant lens). Let
$\mathcal{A}$
be a reflexive graph. A lax contravariant lens of reflexive graphs over
$\mathcal{A}$
is defined to be a family of reflexive graphs
$\mathcal{B}(x)$
indexed in
$x:\lvert \mathcal{A} \rvert$
equipped with the following data:
In the context of Definition 54 or Definition 55, we will refer to
$\mathcal{B}$
as a
lens of path objects
or a
univalent lens
when each
$\mathcal{B}(x)$
is univalent.
Summary of univalence lemmas for (displayed) reflexive graphs.

Summary of univalence lemmas for reflexive graph lenses.

Definition 56 (Display of oplax covariant lenses). Let
$\mathcal{B}$
be an oplax covariant lens over a reflexive graph
$\mathcal{A}$
. The (covariant) display of
$\mathcal{B}$
over
$\mathcal{A}$
is defined to be the following displayed reflexive graph
$\mathsf{disp}^+_{\mathcal{A}}\mathcal{B}$
over
$\mathcal{A}$
:
\begin{align*} x:\lvert \mathcal{A} \rvert & \vdash \lvert \mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}} \rvert(x) :\equiv \lvert \mathcal{B}(x) \rvert \\ p:x\approx_{\mathcal{A}}y, u:\lvert \mathcal{B}(x) \rvert,v:\lvert \mathcal{B}(y) \rvert & \vdash u \approx_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{p} v :\equiv \mathsf{push}_{\mathcal{B}}^{p}u \approx_{\mathcal{B}(y)} v \\ x:\lvert \mathcal{A} \rvert,u:\lvert \mathcal{B}(x) \rvert & \vdash \mathsf{rx}_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{x}{u} :\equiv \mathsf{pushRx}_{\mathcal{B}}^{x}{u} \end{align*}
Definition 57 (Display of lax contravariant lenses). Let
$\mathcal{B}$
be a lax contravariant lens over a reflexive graph
$\mathcal{A}$
. The (contravariant) display of
$\mathcal{B}$
over
$\mathcal{A}$
is defined to be the following displayed reflexive graph
$\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}$
over
$\mathcal{A}$
:
\begin{align*} x:\lvert \mathcal{A} \rvert & \vdash \lvert \mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}} \rvert(x) :\equiv \lvert \mathcal{B}(x) \rvert \\ p:x\approx_{\mathcal{A}}y, u:\lvert \mathcal{B}(x) \rvert,v:\lvert \mathcal{B}(y) \rvert & \vdash u \approx_{\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}}^{p} v :\equiv u\approx_{\mathcal{B}(x)}\mathsf{pull}_{\mathcal{B}}^{p}{v} \\ x:\lvert \mathcal{A} \rvert,u:\lvert \mathcal{B}(x) \rvert & \vdash \mathsf{rx}_{\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}}^{x}{u} :\equiv \mathsf{pullRx}_{\mathcal{B}}^{x}{u} \end{align*}
Computation 58 (Components of the display of oplax covariant lenses). Let
$\mathcal{B}$
be an oplax covariant lens over a reflexive graph
$\mathcal{A}$
. For any
$x:\lvert \mathcal{A} \rvert$
, the component
$(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})(x)$
is precisely the following:
\begin{align*} \lvert (\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})(x) \rvert & \equiv \lvert \mathcal{B}(x) \rvert \\ u\approx_{(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})(x)} v & \equiv \mathsf{push}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u} \approx_{\mathcal{B}(x)} v \\ \mathsf{rx}_{(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})(x)}{u} & \equiv \mathsf{pushRx}_{\mathcal{B}}^{x}{u} \end{align*}
We likewise have the following description of fans:
Computation 59 (Components of the display of lax contravariant lenses). Let
$\mathcal{B}$
be a lax contravariant lens over a reflexive graph
$\mathcal{A}$
. For any
$x:\lvert \mathcal{A} \rvert$
, the component
$(\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}})(x)$
is unfolds as follows:
\begin{align*} \lvert (\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}})(x) \rvert & \equiv \lvert \mathcal{B}(x) \rvert \\ u\approx_{(\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}})(x)} v & \equiv u \approx_{\mathcal{B}(x)} \mathsf{pull}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{v} \\ \mathsf{rx}_{(\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}})(x)}{u} & \equiv \mathsf{pullRx}_{\mathcal{B}}^{x}{u} \end{align*}
We have the following description of co-fans:
Lemma 60 (Display of oplax covariant lenses of path objects). Let
$\mathcal{B}$
be an oplax covariant lens over a reflexive graph
$\mathcal{A}$
. If each
$\mathcal{B}(x)$
is univalent, then the display
$\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}$
is univalent.
Proof. We must check that each component
$(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})(x)$
is univalent. It suffices to check that for each
$u:\lvert \mathcal{B}(x) \rvert$
, the fan
$\{u\}_{(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})(x)}^{+}$
is a proposition. By Computation 58, we have
$\{u\}_{(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})(x)}^{+}\equiv \{\mathsf{push}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u}\}_{\mathcal{B}(x)}^{+}$
, which is a proposition by our assumption that
$\mathcal{B}(x)$
is univalent.
Lemma 61 (Display of lax contravariant lenses of path objects). Let
$\mathcal{B}$
be a lax contravariant lens over a reflexive graph
$\mathcal{A}$
. If each
$\mathcal{B}(x)$
is univalent, then the display
$\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}$
is univalent.
Proof. Analogous to Lemma 60.
3.2 Unbiased dependent lenses
In this section, we describe a slightly strange technical device that generalises both oplax covariant and lax contravariant lenses that we name the unbiased dependent lens. The reason for introducing these is to characterise the identity types of structures involving mixed variance (including, for example, the type of reflexive graphs!).
Definition 62 (Unbiased dependent lens). Let
$\mathcal{A}$
be a reflexive graph. A unbiased dependent lens over
$\mathcal{A}$
is defined to be a family of reflexive graphs
$\mathcal{B}(p)$
indexed in edges
$p:x\approx_{\mathcal{A}}y$
equipped with the following data:
\begin{align*} x,y:\lvert \mathcal{A} \rvert;\;p:x\approx_{\mathcal{A}}y,u:\lvert \mathcal{B}(\mathsf{rx}_{\mathcal{A}}{x}) \rvert & \vdash \mathsf{lext}_{\mathcal{B}}^{p}{u} : \lvert \mathcal{B}(p) \rvert \\ x,y:\lvert \mathcal{A} \rvert;\;p:x\approx_{\mathcal{A}}y,u:\lvert \mathcal{B}(\mathsf{rx}_{\mathcal{A}}{y}) \rvert & \vdash \mathsf{rext}_{\mathcal{B}}^{p}{u} : \lvert \mathcal{B}(p) \rvert \\ x:\lvert \mathcal{A} \rvert,u:\lvert \mathcal{B}(\mathsf{rx}_{\mathcal{A}}{x}) \rvert & \vdash \mathsf{extRx}_{\mathcal{B}}^{x} {u} : \mathsf{lext}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u} \approx_{\mathcal{B}(\mathsf{rx}_{\mathcal{A}}{x})} \mathsf{rext}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u} \\ x:\lvert \mathcal{A} \rvert,u:\lvert \mathcal{B}(\mathsf{rx}_{\mathcal{A}}{x}) \rvert & \vdash \mathsf{rextRx}_{\mathcal{B}}^{x} {u} : u \approx_{\mathcal{B}(\mathsf{rx}_{\mathcal{A}}{x})} \mathsf{rext}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u} \end{align*}
Definition 63 (Display of unbiased dependent lenses). Let
$\mathcal{B}$
be a unbiased dependent lens over a reflexive graph
$\mathcal{A}$
. The display of
$\mathcal{B}$
over
$\mathcal{A}$
is defined to be the following displayed reflexive graph
$\mathsf{disp}^\pm_{\mathcal{A}}$
over
$\mathcal{A}$
:
\begin{align*} x:\lvert \mathcal{A} \rvert & \vdash \lvert \mathsf{disp}^\pm_{\mathcal{A}}\mathcal{B} \rvert(x) :\equiv \lvert \mathcal{B}(\mathsf{rx}_{\mathcal{A}}{x}) \rvert \\ p : x\approx_{\mathcal{A}}y, u:\lvert \mathcal{B}(x) \rvert, v : \lvert \mathcal{B}(y) \rvert & \vdash u \approx_{{\mathsf{disp}^\pm_{\mathcal{A}}}^{p}\mathcal{B}} v :\equiv \mathsf{lext}_{\mathcal{B}}^{p}{u} \approx_{\mathcal{B}(p)} \mathsf{rext}_{\mathcal{B}}^{p}{u} \\ x:\lvert \mathcal{A} \rvert, u:\lvert \mathcal{B}(x) \rvert & \vdash \mathsf{rx}_{{\mathsf{disp}^\pm_{\mathcal{A}}}^{x}\mathcal{B}}{u} :\equiv \mathsf{extRx}_{\mathcal{B}}^{x} {u} \end{align*}
Remark 64. Only
$\mathsf{extRx}_{\mathcal{B}}^{x} {u}$
was needed to define the display of unbiased dependent lenses, whereas the lax unitor
$u \approx_{\mathcal{B}(\mathsf{rx}_{\mathcal{A}}{x})} \mathsf{rext}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u}$
played no role. The reason for including the latter is that it is required in order for univalence of each
$\mathcal{B}(p)$
to imply univalence for the display
$\mathsf{disp}^\pm_{\mathcal{A}}$
. Naturally, univalence would also follow if we instead included an oplax unitor
$\mathsf{lext}_{\mathcal{B}}^{p}{u} \approx_{\mathcal{B}(\mathsf{rx}_{\mathcal{A}}{x})}u$
. What we must not do is include both
$\mathsf{lext}_{\mathcal{B}}^{p}{u} \approx_{\mathcal{B}(\mathsf{rx}_{\mathcal{A}}{x})}u$
and
$u \approx_{\mathcal{B}(\mathsf{rx}_{\mathcal{A}}{x})} \mathsf{rext}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u}$
, as we intend the type of fiberwise univalent unbiased dependent lens structures on a family of path objects over a path object to be a proposition. This situation is somewhat similar to that of half-adjoint equivalences in homotopy type theory being coherent only by virtue of omitting one of the snake identities, which can be obtained from the other. Of course, our current situation in the world of reflexive graphs is a bit different as we cannot obtain the lax unitor from the oplax unitor and vice versa: as these unitors play no computational role, however, we will let it slide.
Lemma 65 (Display of unbiased dependent lenses of path objects). Let
$\mathcal{B}$
be a unbiased dependent lens over a reflexive graph
$\mathcal{A}$
. If each
$\mathcal{B}(x)$
is univalent, then so is the display
$\mathsf{disp}^\pm_{\mathcal{A}}$
.
The following Construction 66 shows that unbiased dependent lenses generalise both oplax covariant and lax contravariant lenses up to definitional equality.
Construction 66 (From biased to unbiased lenses). Let
$\mathcal{A}$
be a path object.
-
(1) Any oplax covariant lens
$\mathcal{B}$
over
$\mathcal{A}$
induces a unbiased dependent lens
$[\mathcal{B}]_+^\pm$
over
$\mathcal{A}$
such that
$\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}\equiv\mathsf{disp}^\pm_{\mathcal{A}}{[\mathcal{B}]_+^\pm}$
definitionally:
\begin{align*} p:x\approx_{\mathcal{A}}y & \vdash [\mathcal{B}]_+^\pm(p) :\equiv \mathcal{B}(y) \\ p:x\approx_{\mathcal{A}}y, u:\lvert \mathcal{B}(x) \rvert & \vdash \mathsf{lext}_{[\mathcal{B}]_+^\pm}^{p}u :\equiv \mathsf{push}_{\mathcal{B}}^{p}{u} \\ p:x\approx_{\mathcal{A}}y, u:\lvert \mathcal{B}(y) \rvert & \vdash \mathsf{rext}_{[\mathcal{B}]_+^\pm}^{p}u :\equiv u \\ x:\lvert \mathcal{A} \rvert,u:\lvert \mathcal{B}(x) \rvert & \vdash \mathsf{extRx}_{[\mathcal{B}]_+^\pm}^{x} {u} :\equiv \mathsf{pushRx}_{\mathcal{B}}^{x}{u} \\ x:\lvert \mathcal{A} \rvert,u:\lvert \mathcal{B}(x) \rvert & \vdash \mathsf{rextRx}_{[\mathcal{B}]_+^\pm}^{x} {u} :\equiv \mathsf{rx}_{\mathcal{B}(x)}{u} \end{align*}
-
(2) Any lax contravariant lens
$\mathcal{B}$
over
$\mathcal{A}$
induces a unbiased dependent lens
$[\mathcal{B}]_-^\pm$
over
$\mathcal{A}$
such that
$\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}} \equiv \mathsf{disp}^\pm_{\mathcal{A}}{[\mathcal{B}]_-^\pm}$
definitionally:
\begin{align*} p:x\approx_{\mathcal{A}}y & \vdash [\mathcal{B}]_-^\pm(p) :\equiv \mathcal{B}(x) \\ p:x\approx_{\mathcal{A}}y, u:\lvert \mathcal{B}(x) \rvert & \vdash \mathsf{lext}_{[\mathcal{B}]_-^\pm}^{p}u :\equiv u \\ p:x\approx_{\mathcal{A}}y,u:\lvert \mathcal{B}(y) \rvert & \vdash \mathsf{rext}_{[\mathcal{B}]_-^\pm}^{p}{u} :\equiv \mathsf{pull}_{\mathcal{B}}^{p}{u} \\ x:\lvert \mathcal{A} \rvert,u:\lvert \mathcal{B}(x) \rvert & \vdash \mathsf{extRx}_{[\mathcal{B}]_-^\pm}^{x} {u} :\equiv \mathsf{pullRx}_{\mathcal{B}}^{x}{u} \\ x:\lvert \mathcal{A} \rvert,u:\lvert \mathcal{B}(x) \rvert & \vdash \mathsf{rextRx}_{[\mathcal{B}]_-^\pm}^{x} {u} :\equiv \mathsf{pullRx}_{\mathcal{B}}^{x}{u} \end{align*}
Computation. We compute the displays as follows.
\begin{align*} & \lvert \mathsf{disp}^\pm_{\mathcal{A}}[\mathcal{B}]_+^\pm \rvert(x) \equiv \lvert [\mathcal{B}]_+^\pm \rvert(\mathsf{rx}_{\mathcal{A}}{x}) \equiv \lvert \mathcal{B}(x) \rvert \equiv \lvert \mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}} \rvert(x) \\ & \lvert \mathsf{disp}^\pm_{\mathcal{A}} [\mathcal{B}]_-^\pm \rvert(x) \equiv \lvert [\mathcal{B}]_-^\pm \rvert(\mathsf{rx}_{\mathcal{A}}{x}) \equiv \lvert \mathcal{B}(x) \rvert \equiv \lvert \mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}} \rvert(x) \\ & u \approx_{\mathsf{disp}^\pm_{\mathcal{A}}[\mathcal{B}]_-^\pm}^{p} v \equiv \mathsf{lext}_{[\mathcal{B}]_+^\pm}^{p}{u} \approx_{[\mathcal{B}]_+^\pm(p)} \mathsf{rext}_{[\mathcal{B}]_+^\pm}^{p}{v} \equiv \mathsf{push}_{\mathcal{B}}^{p}{u} \approx_{\mathcal{B}(y)} u \equiv u \approx_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{p}v \\ & u \approx_{\mathsf{disp}^\pm_{\mathcal{A}}[\mathcal{B}]_-^\pm}^{p} v \equiv \mathsf{lext}_{[\mathcal{B}]_-^\pm}^{p}{u} \approx_{[\mathcal{B}]_-^\pm(p)} \mathsf{rext}_{[\mathcal{B}]_-^\pm}^{p}{v} \equiv u \approx_{\mathcal{B}(y)} \mathsf{pull}_{\mathcal{B}}^{p}{v} \equiv u \approx_{\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}}^{p}v \\ & \mathsf{rx}_{\mathsf{disp}^\pm_{\mathcal{A}}[\mathcal{B}]_-^\pm}^{x}{u} \equiv \mathsf{extRx}_{[\mathcal{B}]_+^\pm}^{x} {u} \equiv \mathsf{push}_{\mathcal{B}}^{p}{u} \equiv \mathsf{rx}_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{x}{u} \\ & \mathsf{rx}_{\mathsf{disp}^\pm_{\mathcal{A}}[\mathcal{B}]_-^\pm}^{x}{u} \equiv \mathsf{extRx}_{[\mathcal{B}]_-^\pm}^{x} {u} \equiv \mathsf{pull}_{\mathcal{B}}^{p}{u} \equiv \mathsf{rx}_{\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}}^{x}{u} & & \end{align*}
3.3 Duality involution for reflexive graph lenses
We have seen in Definition 26 and Observation 27, the duality involution for reflexive graphs that flips the direction of edges. This involution hosts a (definitional) equivalence between the types of oplax covariant and lax contravariant lenses, respectively. By virtue of this equivalence, from a result about all oplax covariant lenses one obtains automatically a dual result about all lax contravariant lenses.
Definition 67 (Total opposite of a lens). Let
$\mathcal{A}$
be a reflexive graph, and let
$\mathcal{B}$
be an oplax covariant lens of reflexive graphs over
$\mathcal{A}$
. We define the total opposite of
$\mathcal{B}$
to be the following lax contravariant lens
$\mathcal{B}^{\widetilde{\mathsf{op}}}$
over
$\mathcal{A}^{\mathsf{op}}$
:
\begin{align*} \mathcal{B}^{\widetilde{\mathsf{op}}}(x) & :\equiv \mathcal{B}(x)^{\mathsf{op}} \\ \mathsf{pull}_{\mathcal{B}^{\widetilde{\mathsf{op}}}}^{p}{u} & :\equiv \mathsf{push}_{\mathcal{B}}^{p}{u} \\ \mathsf{pullRx}_{\mathcal{B}^{\widetilde{\mathsf{op}}}}^{x}{u} & :\equiv \mathsf{pushRx}_{\mathcal{B}}^{x}{u} \end{align*}
Conversely, if
$\mathcal{B}$
is a lax contravariant lens, we define its total opposite to be the following lax contravariant lens
$\mathcal{B}^{\widetilde{\mathsf{op}}}$
over
$\mathcal{A}^{\mathsf{op}}$
:
\begin{align*} \mathcal{B}^{\widetilde{\mathsf{op}}}(x) & :\equiv \mathcal{B}(x)^{\mathsf{op}} \\ \mathsf{push}_{\mathcal{B}^{\widetilde{\mathsf{op}}}}^{p}{u} & :\equiv \mathsf{pull}_{\mathcal{B}}^{p}{u} \\ \mathsf{pushRx}_{\mathcal{B}^{\widetilde{\mathsf{op}}}}^{x}{u} & :\equiv \mathsf{pullRx}_{\mathcal{B}}^{x}{u} \end{align*}
The purpose of total opposites is to exhibit a duality involution identifying oplax covariant and lax contravariant lenses.
Observation 68 (Duality involution for lenses). By virtue of Definition 67, we see that an oplax covariant lens over
$\mathcal{A}$
is precisely the same thing as a lax contravariant lens over
$\mathcal{A}^{\mathsf{op}}$
; and, conversely, that a lax contravariant lens over
$\mathcal{A}$
is precisely the same thing as an oplax covariant lens over
$\mathcal{A}^{\mathsf{op}}$
.
Lemma 69 (Display of total opposites). Let
$\mathcal{B}$
be an oplax covariant lens of reflexive graphs over a reflexive graph
$\mathcal{A}$
. Then, we have a definitional equivalence
$\mathsf{disp}^-_{\mathcal{A}^{\mathsf{op}}}{(\mathcal{B}^{\widetilde{\mathsf{op}}})} \equiv (\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})^{\widetilde{\mathsf{op}}}$
of displayed reflexive graphs.
Proof. We compute explicitly.

Corollary 70. Let
$\mathcal{B}$
be a lax contravariant lens of reflexive graphs over a reflexive graph
$\mathcal{A}$
. Then, we have a definitional equivalence
$\mathsf{disp}^+_{\mathcal{A}^{\mathsf{op}}}{(\mathcal{B}^{\widetilde{\mathsf{op}}})} \equiv (\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}})^{\widetilde{\mathsf{op}}}$
of displayed reflexive graphs.
Although many other definitions can be obtained directly by duality, we will continue to specify various concepts and results for both oplax covariant and lax contravariant lenses in order to facilitate easy reference.
3.4 Definitional lenses of reflexive graphs
An (oplax covariant, lax contravariant) lens equips a family with a pushforward or pullback operator together with a witness of a unit law holding up to a directed edge. That the unit law holds only up to an edge is the meaning of the “oplax/lax” terminology. An important class of lenses are the ones in which the unit law holds up to definitional equality, so that the oplax or lax witness or the unit law can be given by the reflexivity datum of the component reflexive graph. We study these definitional lenses in the present section, with an eye to developing the theory of polynomials and partial products of lenses in Section 3.4.4.
Definition 71 (Definitional lens). A definitional covariant lens is an oplax covariant lens
$\mathcal{B}$
over
$\mathcal{A}$
in which the following equations hold definitionally:
By the same token, a definitional contravariant lens is a lax contravariant lens in which the following equations hold definitionally:
Remark 72. We note that Definition 71 must be understood “metatheoretically” or “judgmentally”, because definitional equality cannot be stated as a type in Martin-Löf type theory. One way to formalise this would be by means of a conservative extension such as two-level type theory (Annenkov et al. Reference Annenkov, Capriotti and Kraus2017); we remain agnostic and treat Definition 71 as a definitional extension of the judgements of Martin-Löf type theory rather than as a type.
Example 73 (Definitional lenses over discrete reflexive graphs). Let
$\mathcal{B}(x)$
be a family of reflexive graphs indexed in
$x:A$
. Then we may turn
$\mathcal{B}$
canonically into an oplax covariant lens or a lax contravariant lens over the discrete reflexive graph
${\triangle}{A}$
as follows using transport:
\begin{align*} x,y:A;\; p:x =_{A} y, u:\lvert \mathcal{B}(x) \rvert &\vdash \mathsf{push}_{\mathcal{B}}^{p}u :\equiv p_*u\\ x,y:A;\; p:x =_{A} y, u:\lvert \mathcal{B}(y) \rvert &\vdash \mathsf{pull}_{\mathcal{B}}^{p}u :\equiv p^{-1}_*u \end{align*}
The total reflexive graph of the display of
$\mathcal{B}$
qua covariant lens is then definitionally equal to the coproduct
$\coprod_{(x:A)}\mathcal{B}(x)$
from Definition 19.
Computation 74 (Display of definitional lenses). The display of definitional lenses is, naturally, more simple than that of ordinary lenses. If
$\mathcal{B}$
is a definitional covariant lens over
$\mathcal{A}$
, its display computes as follows:
\begin{align*} \lvert \mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}} \rvert(x) &\equiv \lvert \mathcal{B}(x) \rvert \\ u \approx_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{p:x\approx_{\mathcal{A}}y} v &\equiv \mathsf{push}_{\mathcal{B}}^{p}{u} \approx_{\mathcal{B}(y)} v \\ \mathsf{rx}_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{x}{u} &\equiv \mathsf{rx}_{\mathcal{B}(x)}{u} \end{align*}
Likewise, if
$\mathcal{B}$
is a definitional contravariant lens, its display computes as follows:
\begin{align*} \lvert \mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}} \rvert(x) &\equiv \lvert \mathcal{B}(x) \rvert \\ u \approx_{\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}}^{p:x\approx_{\mathcal{A}}y} v &\equiv u \approx_{\mathcal{B}(x)} \mathsf{pull}_{\mathcal{B}}^{p}{v} \\ \mathsf{rx}_{\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}}^{x}{u} &\equiv \mathsf{rx}_{\mathcal{B}(x)}{u} \end{align*}
3.4.1 Example: definitional lenses from univalent families
Example 75 (Definitional lenses of from univalent families). Any univalent family of path objects has a canonical definitional lens structure. In particular, given a univalent family of path objects
$(U,\mathcal{E})$
, we can equip
$\mathcal{E}$
with the structure of a covariant and a contravariant lens over the reflexive graph image
$U/\mathcal{E}$
:
\begin{align*} A_0,A_1:U;\; f : A_0\approx_{U/\mathcal{E}} A_1;\; a : \lvert \mathcal{E}(A_0) \rvert & \vdash \mathsf{push}_{\mathcal{E}}^{\,f}{a} :\equiv f a \\ A_0,A_1:U;\; f : A_0\approx_{U/\mathcal{E}} A_1;\; a : \lvert \mathcal{E}(A_1) \rvert & \vdash \mathsf{pull}_{\mathcal{E}}^{\,f}{a} :\equiv f^{-1} a \\ A:U;\; a:\lvert \mathcal{E}(A) \rvert & \vdash \mathsf{pushRx}_{\mathcal{E}}^{A} {a} :\equiv \mathsf{rx}_{\mathcal{E}(A)}{a} \\ A:U;\; a:\lvert \mathcal{E}(A) \rvert & \vdash \mathsf{pullRx}_{\mathcal{E}}^{A}{a} :\equiv \mathsf{rx}_{\mathcal{E}(A)}{a} \end{align*}
Example 76 (Definitional lenses from universes). Any univalent family of types (U,E), e.g. a universe, determines a univalent family of path objects
$(U,{\triangle}{E})$
. In this case,
$U/\lvert {\triangle}{E} \rvert\equiv U/E$
is precisely the canonical path object structure on U determined by equivalences between components of E, and we may consider the corresponding definitional lens structures on
${\triangle}{E}$
by specialising Example 75.
Example 77 (Definitional lenses from subuniverses). Let
$(U,\mathcal{E})$
be a univalent family, and let P(A) be a proposition for every
$A:U$
, We can restrict
$\mathcal{E}$
to a family of path objects
$\mathcal{E}_P$
over
$\{{A:U/\lvert \mathcal{E}| \rvert}{P(A)}\}$
setting
$\mathcal{E}_P(A,h) :\equiv \mathcal{E}(A)$
. Then
$\mathcal{E}_P$
can be equipped with the structure of a definitional covariant and contravariant lens over
$U/\lvert \mathcal{E} \rvert$
in the following way:
\begin{align*} A, B:\lvert \{{A:U/\lvert \mathcal{E} \rvert}{P(A)}\} \rvert;\; f : A\approx_{U/\lvert \mathcal{E} \rvert}B, x : \lvert \mathcal{E}(\pi_1{A}) \rvert & \vdash \mathsf{push}_{\mathcal{E}_P}^{\,f}{x} :\equiv fx \\ A, B:\lvert \{{A:U/\lvert \mathcal{E} \rvert}{P(A)}\} \rvert;\; f : A\approx_{U/\lvert \mathcal{E} \rvert}B, x : \lvert \mathcal{E}(\pi_1{B}) \rvert & \vdash \mathsf{pull}_{\mathcal{E}_P}^{\,f}{x} :\equiv f^{-1}{x} \\ A:\lvert \{{A:U/\lvert \mathcal{E} \rvert}{P(A)}\} \rvert, x : \lvert \mathcal{E}(\pi_1{A}) \rvert & \vdash \mathsf{pushRx}_{\mathcal{E}_P}^{A}{x} :\equiv \mathsf{rx}_{\mathcal{E}(\pi_1A)}{x} \\ A:\lvert \{{A:U/\lvert \mathcal{E} \rvert}{P(A)}\} \rvert, x : \lvert \mathcal{E} \rvert(\pi_1{A}) & \vdash \mathsf{pullRx}_{\mathcal{E}_P}^{A}{x} :\equiv \mathsf{rx}_{\mathcal{E}(\pi_1A)}{x} \end{align*}
3.4.2 Example: definitional lenses for finite ordinals
For each
$n:\mathbb{N}$
, let
$\mathcal{F}(n)$
be the following path object with vertices in the standard finite set with n elements:
The reflexive graph image of
$\mathbb{N}$
under
$\mathcal{F}$
is not univalent because
$\mathbb{N}$
is a set and thus each
$m =_{\mathbb{N}} n$
is a proposition, whereas there is a proper set of equivalences from
$\mathcal{F}(m)$
to
$\mathcal{F}(m)$
for
$m \geq 2$
. Therefore, we cannot apply Example 75 nor Example 77 to obtain a good definitional lens structure on
$\mathcal{F}$
. Nonetheless, we can impose with some ingenuity a more restricted path object structure on
$\mathbb{N}$
over which it is not difficult to exhibit
$\mathcal{F}$
as a definitional lens.
Example 78. We may classify the
augmented simplices
by the following reflexive graph structure
$\Delta_{a}$
with vertices in the natural numbers and edges given by monotone equivalences between finite ordinals:

We shall deduce that Example 78 yields a path object, using the fact that the category of augmented simplices is gaunt in the sense that there is at most one monotone isomorphism between any two finite ordinals.
Lemma 79 (A path object classifying augmented simplices). The reflexive graph
$\Delta_{a}$
of augmented simplices is univalent.
Proof. Fixing
$m:\mathbb{N}$
, we must check that the fan
$\{m\}_{\Delta_{a}}^{+}$
is a proposition. Unfolding definitions, we have
$ \{m\}_{\Delta_{a}}^{+} \equiv \sum_{(n:\mathbb{N})} \sum_{(f:\mathsf{Equiv}(\lvert \mathcal{F}(m) \rvert,\lvert \mathcal{F}(n) \rvert))} \mathsf{isMonotone}\,f $
. As there can be at most one monotone equivalence between
$\lvert \mathcal{F}(m) \rvert$
and some
$\lvert \mathcal{F}(n) \rvert$
, it remains only to observe that
$\lvert \mathcal{F}(n) \rvert$
being equinumerous with
$\lvert \mathcal{F}(m) \rvert$
implies
$m=n$
.
Example 80 (Definitional lens structure of finite ordinals). We may exhibit definitional covariant and contravariant lens structures on
$\mathcal{F}$
over
$\Delta_{a}$
like so:
\begin{align*} m,n:\mathbb{N};\; (\,f,f^\leq) : m \approx_{\Delta_{a}} n, i : \lvert \mathcal{F}(m) \rvert & \vdash \mathsf{push}_{\mathcal{F}}^{(f,f^\leq)}{i} :\equiv f i \\ m,n:\mathbb{N};\; (\,f,f^\leq) : m \approx_{\Delta_{a}} n, i : \lvert \mathcal{F}(n) \rvert & \vdash \mathsf{pull}_{\mathcal{F}}^{(f,f^\leq)}{i} :\equiv f^{-1} i \\ m:\mathbb{N};\; i:\lvert \mathcal{F}(m) \rvert & \vdash \mathsf{pushRx}_{\mathcal{F}}^{m}{i} :\equiv \mathsf{rx}_{\mathcal{F}(m)}{i} \\ m:\mathbb{N};\; i:\lvert \mathcal{F}(m) \rvert & \vdash \mathsf{pullRx}_{\mathcal{F}}^{m}{i} :\equiv \mathsf{rx}_{\mathcal{F}(m)}{i} \end{align*}
3.4.3 Definitional replacement of lenses
We have seen that in some examples of definitional lenses, the reflexive graph structure on the base required some ingenuity. In this section, we describe a general method to reparameterise any lens as a definitional lens over a different base.
Construction 81 (Flattening of lenses). Let
$\mathcal{B}$
be an oplax covariant or lax contravariant lens of reflexive graphs over a reflexive graph
$\mathcal{A}$
. We may equip
$\lvert \mathcal{A} \rvert$
with a new reflexive graph structure
$\mathcal{A}_{{\downarrow}\mathcal{B}}^{+}$
or
$\mathcal{A}_{{\downarrow}\mathcal{B}}^{-}$
, respectively, called the flattening of
$\mathcal{B}$
onto
$\mathcal{A}$
.

Lemma 82 (Flattening of lenses of path objects onto path objects). Let
$\mathcal{B}$
be an oplax covariant or lax contravariant lens of path objects over a path object
$\mathcal{A}$
. Assuming function extensionality, the flattening of
$\mathcal{B}$
onto
$\mathcal{A}$
is univalent.
Proof. We consider only the covariant case, as the contravariant one is similar. Fixing
$x:\lvert \mathcal{A} \rvert$
, we must check that the fan
$\{x\}_{\mathcal{A}_{{\downarrow}\mathcal{B}}^{+}}^{+}$
is a proposition. First, we compute the fan up to definitional equality:

As each
$\mathcal{B}(y)$
is univalent, we deduce from function extensionality that the cotensor
$\lvert \mathcal{B}(x) \rvert\pitchfork\mathcal{B}(y)$
is univalent. Therefore, each fan
$\{\mathsf{push}_{\mathcal{B}}^{p}\}_{\lvert \mathcal{B}(x) \rvert\pitchfork\mathcal{B}(y)}^{+}$
is contractible and so we have the following equivalences:

As
$\mathcal{A}$
is assumed to be univalent,
$\{x\}_{\mathcal{A}}^{+}$
is a proposition and thus so is
$\{x\}_{\mathcal{A}_{{\downarrow}\mathcal{B}}^{+}}^{+}$
.
Construction 83 (The definitional replacement of a lens). Let
$\mathcal{B}$
be an oplax covariant lens of reflexive graphs over a reflexive graph
$\mathcal{A}$
. The covariant definitional replacement of
$\mathcal{B}$
is defined to be the following definitional covariant lens
$\mathsf{drep}^+_{\mathcal{A}}\mathcal{B}$
over the flattening
$\mathcal{A}_{{\downarrow}\mathcal{B}}^{+}$
with
$\mathcal{B}$
as its underlying family of reflexive graphs.
\begin{align*} (\mathsf{drep}^+_{\mathcal{A}}\mathcal{B})(x) &:\equiv \mathcal{B}(x) \\ \mathsf{push}_{\mathsf{drep}^+_{\mathcal{A}}\mathcal{B}}^{(p,p')}{u} &:\equiv p'u \end{align*}
On the other hand, if
$\mathcal{B}$
is a lax contravariant lens of reflexive graphs over a reflexive graph
$\mathcal{A}$
, we define the
contravariant definitional replacement
of
$\mathcal{B}$
to be the following definitional contravariant lens
$\mathsf{drep}^-_{\mathcal{A}}\mathcal{B}$
over the flattening
$\mathcal{A}_{{\downarrow}\mathcal{B}}^{-}$
:
\begin{align*} (\mathsf{drep}^-_{\mathcal{A}}\mathcal{B})(x) &:\equiv \mathcal{B}(x) \\ \mathsf{pull}_{\mathsf{drep}^-_{\mathcal{A}}\mathcal{B}}^{(p,p')}{u} &:\equiv p'u \end{align*}
3.4.4 Polynomials and partial products of reflexive graphs
Any family of types
$x:A\vdash B(x) : \mathbf{type}$
induces a
polynomial
type operator
$\mathbf{P}_{{A}}({C, B}) :\equiv \sum_{(x:A)}\prod_{(u:B(x))}C$
; the universal property of
$\mathbf{P}_{{A}}({C, B})$
is that of a partial product (Dyckhoff and Tholen Reference Dyckhoff and Tholen1987). In this section, we generalise the construction of polynomials to lenses of reflexive graphs; the definitions of the polynomial reflexive graphs will then mirror the description of covariant and contravariant partial products in a 2-category (Johnstone Reference Johnstone1993; Johnstone Reference Johnstone2002). We then show how to specialise the construction of polynomials to obtain suitable path object structures on the partial map classifier of a given dominance as in synthetic domain theory (Rosolini Reference Rosolini1986).
In this section, we assume function extensionality.
Construction 84.
Let
$\mathcal{B}$
be a definitional covariant lens of reflexive graphs over a reflexive graph
$\mathcal{A}$
, and let
$\mathcal{C}$
be an arbitrary reflexive graph. Then, we may define a definitional contravariant lens of reflexive graphs
$\mathsf{pp}^+_{\mathcal{A}}(\mathcal{C},\mathcal{B})$
over
$\mathcal{A}$
by setting each
$(\mathsf{pp}^+_{\mathcal{A}}(\mathcal{C},\mathcal{B}))(x) :\equiv \lvert \mathcal{B}(x) \rvert\pitchfork \mathcal{C}$
. The definitional contravariant lens structure of
$\mathsf{pp}^+_{\mathcal{A}}(\mathcal{C},\mathcal{B})$
over
$\mathcal{A}$
is defined from the definitional covariant lens structure of
$\mathcal{B}$
by precomposition like so:

Construction 85.
Let
$\mathcal{B}$
be a definitional contravariant lens of reflexive graphs over a reflexive graph
$\mathcal{A}$
, and let
$\mathcal{C}$
be an arbitrary reflexive graph. Then, we may define a definitional covariant family of path objects
$\mathsf{pp}^-_{\mathcal{A}}(\mathcal{C},\mathcal{B})$
over
$\mathcal{A}$
by setting each
$(\mathsf{pp}^-_{\mathcal{A}}(\mathcal{C},\mathcal{B}))(x) :\equiv \lvert \mathcal{B}(x) \rvert\pitchfork \mathcal{C}$
. The definitional covariant lens structure of
$\mathsf{pp}^-_{\mathcal{A}}(\mathcal{C},\mathcal{B})$
over
$\mathcal{A}$
is defined from the definitional contravariant lens struture of
$\mathcal{B}$
by precomposition:

Definition 86 (Partial products of definitional lenses). Let
$\mathcal{B}$
be a definitional covariant lens of reflexive graphs over a reflexive graph
$\mathcal{A}$
. Then the covariant partial product of a reflexive graph
$\mathcal{C}$
with
$\mathcal{B}$
over
$\mathcal{A}$
is defined to be the following total reflexive graph:
When
$\mathcal{B}$
is a definitional contravariant lens, we define the
contravariant partial product
of
$\mathcal{C}$
with
$\mathcal{B}$
over
$\mathcal{A}$
as follows:
Computation 87 (Covariant partial product). The covariant partial product of a reflexive graph
$\mathcal{C}$
with a definitional covariant lens of reflexive graphs
$\mathcal{B}$
over a reflexive graphs
$\mathcal{A}$
computes as follows:

Computation 88 (Contravariant partial product). The contravariant partial product of a reflexive graph
$\mathcal{C}$
with a definitional contravariant lens of reflexive graphs
$\mathcal{B}$
over a reflexive graph
$\mathcal{A}$
unravels up to definitional equivlance as follows:

Example 89 (Partial map classifiers). A
dominance
in the sense of Rosolini (Reference Rosolini1986) is a univalent universe
$(\Sigma, T)$
closed under the terminal type and internal sums such that for each
$\phi:\Sigma$
, the component
$T(\phi)$
is a proposition. In this case, we may equip each
$T(\phi)$
with the codiscrete path object structure
${\triangledown}(T(\phi))$
so that
$(\Sigma,{\triangledown}{T})$
is a univalent family of path objects and
${\triangledown}{T}$
has definitional covariant and contravariant lens structure over the propositional reflexive graph image
$\Sigma/_{-1}T$
.
The partial map classifier of a given type A in the dominance
$(\Sigma,T)$
is the polynomial type
$\mathbf{P}_{{\Sigma}}({A, T}) \equiv \sum_{(\phi:\Sigma)}\prod_{(p:T(\phi))} A$
. A suitable lifting of the partial map classifiers to path objects
$\mathcal{A}$
can be obtained by means of covariant or contravariant partial products:
We compute the above reflexive graph structures as follows:

Example 90 (Lists). A simple example of a polynomial type operator is that of lists: letting F(n) be the standard finite type
$\sum_{(i:\mathbb{N})}i<n$
, we may define
$\mathsf{List}(A) :\equiv \mathbf{P}_{{\mathbb{N}}}({A, F})$
. This representation of lists lifts to path objects by means of partial products via our account in Section 3.4.2 of the path object
$\Delta_{a}$
classifying finite ordinals and the definitional lens
$\mathcal{F}$
of elements of a given finite ordinal. In particular, for any path object
$\mathcal{A}$
, we consider the following covariant and contravariant partial products:
These reflexive graphs compute as follows:

Buchholtz (Reference Buchholtz2023) has shown how to use the classifying space of the symmetric group on two elements to define several variations on unordered pairs in univalent foundations. In what follows, we assume the existence of propositional truncations
$\lVert - \rVert$
.
Example 91 (Homotopy unordered pairs (Buchholtz Reference Buchholtz2023)). Let (U,E) be a univalent universe containing the two-element type
$\mathbf{2}$
; following Buchholtz (Reference Buchholtz2023), we may define the “classifying type”
$B\Sigma_2$
to the type of U-small types merely equivalent to
$\mathbf{2}$
as follows, i.e. we define
$B\Sigma_2 :\equiv \sum_{(X:U)}\lVert \mathsf{Equiv}(E(X),\mathbf{2}) \rVert$
. We define a decoding family
$K:B\Sigma_2 \vdash E_2(K):\mathbf{type}$
by setting
$E_2(X,h) :\equiv E(X)$
. Then, op. cit. defines the type of
homotopy unordered pairs
in a type A to be the following polynomial type:
A suitable path object structure on
$B\Sigma_2$
is obtained by path object comprehension:
Then,
$E_2$
lifts discretely to a definitional covariant and contravariant lens
$\mathcal{E}_2$
of path objects over
$\mathcal{B}\Sigma_2$
by Example 77, setting
$\mathcal{E}_2(K) :\equiv {\triangle}(E_2(K))$
. A suitable path object structure on homotopy unordered pairs is then obtained by either covariant or contravariant partial products:
These reflexive graph structures compute as follows:

3.5 Coherence in the theory of path object lenses
Lemma 92. Assuming dependent function extensionality, it is a proposition that a given reflexive graph is univalent.
Proof. Let
$\mathcal{A}$
be a reflexive graph; a witness that
$\mathcal{A}$
is univalent is an element of the following product:
As being a proposition is a proposition, this is a product of propositions. Dependent function extensionality implies the closure of propositions under products.
Lemma 93. Let
$\mathcal{A}$
be a reflexive graph, and let
$\mathcal{B}$
be a displayed reflexive graph over
$\mathcal{A}$
. Assuming dependent function extensionality, it is a proposition that
$\mathcal{B}$
is univalent.
Proof. Univalence of
$\mathcal{B}$
amounts to the following product:
By dependent function extensionality, it suffices to check that each
$\mathsf{isUnivalent}\,(\mathcal{B}(x))$
is a proposition; but this is Lemma 92.
Lemma 94. Let
$\mathcal{A}$
be a path object and let
$\mathcal{B}$
be a family of path objects over
$\mathcal{A}$
. Assuming dependent function extensionality, the type of oplax covariant lens structures on
$\mathcal{B}$
over
$\mathcal{A}$
is a proposition.
Proof. We first write out in detail the type of oplax covariant lens structrures on
$\mathcal{B}$
:
By the distributivity of products over sums, the above is equivalent to the following:
By dependent function extensionality, it suffices to assume that for each
$x:\lvert \mathcal{A} \rvert$
the following type is a proposition:
Re-associating, the above is equivalent to:

By our assumption that
$\mathcal{A}$
is univalent, we know that
$\{x\}_{\mathcal{A}}^{-}$
is contractible with centre
$(x,\mathsf{rx}_{\mathcal{A}}{x})$
. Therefore, the above is equivalent to the following simplified type:
The above is definitionally equal to the co-fan of the identity function in
$\lvert \mathcal{B}(x) \rvert \pitchfork \mathcal{B}(x)$
as we can see below:

This co-fan is indeed a proposition, as we have assumed that each
$\mathcal{B}(x)$
is univalent.
Lemma 95. Let
$\mathcal{A}$
be a path object and let
$\mathcal{B}$
be a family of path objects over
$\mathcal{A}$
. Assuming dependent function extensionality, the type of lax contravariant lens structures on
$\mathcal{B}$
over
$\mathcal{A}$
is a proposition.
Proof. Analogous to Lemma 94.
Lemma 96. Let
$\mathcal{A}$
be a path object, and let
$\mathcal{B}(p)$
be a path object for each edge
$p : x \approx_{\mathcal{A}}y$
in
$\mathcal{A}$
. Assuming dependent function extensionality, the type of unbiased dependent lens structures on
$\mathcal{B}$
over
$\mathcal{A}$
is a proposition.
Proof. The type of unbiased dependent lens structures on
$\mathcal{B}$
over
$\mathcal{A}$
can be written as follows:

Considering the distributivity of products over sums, it suffices by dependent function extensionality to prove that for each
$x:\lvert \mathcal{A} \rvert$
, the following type is a proposition:

We re-associate to expose various fans in
$\mathcal{A}$
:

As
$\mathcal{A}$
is univalent, the fan
$\{x\}_{\mathcal{A}}^{+}$
contracts onto
$(x,\mathsf{rx}_{\mathcal{A}}{x})$
as reflected below:

The above is definitionally equivalent to the following:

We can re-associate the above as follows:

As
$\mathcal{B}(x,x,\mathsf{rx}_{\mathcal{A}}{a})$
is assumed to be univalent, so is its cotensor by
$\lvert \mathcal{B}(x,x,\mathsf{rx}_{\mathcal{A}}{x}) \rvert$
; thus, the fan of
$\lambda{u}\mathpunct{.}{u}$
in the cotensor contracts to
$(\lambda{u}\mathpunct{.}{u}, \lambda{u}\mathpunct{.}{\mathsf{rx}_{\mathcal{B}(x,x,\mathsf{rx}_{\mathcal{A}})}{u}})$
:

The above is just the co-fan
$\{\lambda{u}\mathpunct{.}u\}_{\lvert \mathcal{B}(x,x,\mathsf{rx}_{\mathcal{A}}{x}) \rvert\pitchfork {\mathcal{B}}(x,x,\mathsf{rx}_{\mathcal{A}}{x})n}^{-}$
, which is a proposition because
$\mathcal{B}(x,x,\mathsf{rx}_{\mathcal{A}}{x})$
is assumed univalent.
4. Case Study: Path Objects Classifying Reflexive Graphs
In this section, we assume dependent function extensionality. Let (U,E) be a univalent family in the sense of Definition 40 so that the reflexive graph image
$U/E$
is univalent. Given
$A:U$
, we will write
$A:\mathbf{type}$
in place of E(A) when it causes no confusion.
4.1 Classifying reflexive graphs
Construction 97 (A univalent lens for graph structures). A U-small graph structure on
$A:U$
is given by a vertex of the path structure
$\mathsf{GphOn}_U(A) :\equiv A\pitchfork A\pitchfork U/E$
. We shall equip
$\mathsf{GphOn}_U$
as a oplax covariant lens of path objects over
$U/E$
as follows:

Computation 98 (A path object classifying graphs). Thus, we obtain a path object classifying U-small graphs by taking the total path object of the display of the oplax covariant lens
$\mathsf{GphOn}_U$
over
$U/E$
, defining
$\mathsf{Gph}_U :\equiv (U/E).\mathsf{disp}^-_{U/E}{\mathsf{GphOn}_U}$
. Unraveling definitions, we see that its underlying reflexive graph structure is precisely the natural one that would arise from invertible graph homomorphisms:

Given
$f : \mathcal{G}_0\approx_{\mathsf{Gph}_U}\mathcal{G}_1$
, we will write
$\lvert\,f \rvert:\mathsf{Equiv}(\lvert \mathcal{G}_0 \rvert,\lvert \mathcal{G}_1 \rvert)$
for the first component and
$f^\approx : \prod_{(x,y:\lvert \mathcal{G}_0 \rvert)}\mathsf{Equiv}(x\approx_{\mathcal{G}_0}y,\lvert\,f \rvert x\approx_{\mathcal{G}_1}\lvert\,f \rvert y)$
for the second component.
In order to classify reflexive graphs, we naturally wish to define a further lens over
$\mathsf{Gph}_U$
whose components classify reflexivity data on a given graph. Unfortunately, due to the mixed variance of reflexivity data in the underlying graph, it seems we can find neither a suitable lax contravariant nor oplax covariant lens for reflexivity data. It happens, however, that the desirable displayed path object over
$\mathsf{Gph}_U$
arises via Lemma 65 from a particularly simple unbiased dependent lens that we now define straightaway.
Construction 99 (A univalent unbiased dependent lens for reflexivity data). A reflexivity datum over an equivalence of U-small graphs
$f : \mathcal{A} \approx_{\mathsf{Gph}_U} \mathcal{B}$
is given by an assignment of self-edges in the image of f; these are the vertices of the following family of path objects:

When instantiated to the reflexivity datum in
$\mathsf{Gph}_U$
on a specific graph
$\mathcal{A}$
, we recover the usual notion of reflexivity data up to definitional equality:
We now equip
$\mathsf{RxOn}_U$
with the structure of a unbiased dependent lens over
$\mathsf{Gph}_U$
:

The laws of the dependent lens hold definitionally, so we are done!
Computation 100 (A path object classifying reflexive graphs). A path object classifying U-small reflexive graphs is obtained from the display of the unbiased dependent lens
$\mathsf{RxOn}_U$
over
$\mathsf{Gph}_U$
by setting
$\mathsf{RxGph}_U :\equiv \mathsf{Gph}_U.\mathsf{disp}^\pm_{\mathsf{Gph}_U}$
. It is not difficult to see that the underlying reflexive graph of
$\mathsf{RxGph}_U$
is precisely the desired one:

Given
$f : \mathcal{A}_0 \approx_{\mathsf{RxGph}_U}\mathcal{A}_1$
, we will write
$f : \mathcal{A}_0\approx_{\mathsf{Gph}_U}\mathcal{A}_1$
for the first component and
$f^{\mathsf{rx}} : \prod_{(x:\lvert \mathcal{A}_0 \rvert)}f^\approx\,x\,x\,(\mathsf{rx}_{\mathcal{A}_0}{x}) =_{\lvert f \rvert x\approx_{\mathcal{A}_1}\lvert f \rvert x} \mathsf{rx}_{\mathcal{A}_1}(\lvert\,f \rvert x) $
for the second component.
4.2 Classifying displayed reflexive graphs over a fixed base
In this section, let
$\mathcal{A}$
be a fixed reflexive graph.
Construction 101 (A lens for displayed graph structures over a fixed family of displayed vertices). We shall define a lax contravariant lens over
$\lvert \mathcal{A} \rvert\pitchfork U/E$
classifying displayed graph structures on a fixed family of types representing displayed vertices.
We equip the family of path objects above with the structure of a definitional contravariant lens over
$\lvert \mathcal{A} \rvert\pitchfork U/E$
as follows:

Computation 102 (A path object for displayed graph structures over
$\mathcal{A}$
). From the display of
$\mathsf{DGphOn}_U^{\mathcal{A}}$
over
$\lvert \mathcal{A} \rvert\pitchfork U/E$
, we obtain a suitable path object
$\mathsf{DGph}_U^{\mathcal{A}} :\equiv (\lvert \mathcal{A} \rvert\pitchfork U/E).\mathsf{disp}^-_{\lvert \mathcal{A} \rvert\pitchfork U/E}{\mathsf{DGphOn}_U^{\mathcal{A}}}$
classifying displayed graph structures over
$\mathcal{A}$
.

Construction 103 (A univalent unbiased dependent lens for displayed reflexivity data). Next, we exhibit a unbiased dependent lens classifying displayed reflexivity data on a given displayed graph over
$\mathcal{A}$
. In particular, we specify a family of path objects
$\mathsf{DRxOn}_U^{\mathcal{A}}$
over the edges of
$\mathsf{DGph}_U^{\mathcal{A}}$
in the following way:

Along the diagonal we recover the desired notion of displayed reflexivity data:
The dependent lens structure is given in such a way that the laws hold definitionally:

Computation 104.
From the display of
$\mathsf{DRxOn}_U^{\mathcal{A}}$
over
$\mathsf{DGph}_U^{\mathcal{A}}$
, we obtain a path object classifying displayed reflexive graphs over
$\mathcal{A}$
, defining
$\mathsf{DRxGphOver}_U(\mathcal{A})$
as follows:
Unraveling definitions, we see that the underlying reflexive graph
$\mathsf{DRxGphOver}_U(\mathcal{A})$
is precisely the desirable one classifying displayed reflexive graphs over
$\mathcal{A}$
:

4.3 Classifying displayed reflexive graphs with variable base
Construction 105 (A lax contravariant lens for small displayed reflexive graphs over a given reflexive graph). We can extend
$\mathsf{DRxGphOver}_U$
with the structure of a definitional contravariant lens over
$\mathsf{RxGph}_U$
. We first describe how to restrict a displayed reflexive graph
$\mathcal{B}$
along a reflexive graph equivalence
$f : \mathcal{A}_0\approx_{\mathsf{RxGph}_U}\mathcal{A}_1$
; on vertices and edges, one simply uses the restriction of the corresponding components of
$\mathcal{B}$
along f:

To define the restricted reflexivity datum, we must transport along the witness that f preserves reflexivity data.

The lens is definitional because
$\mathcal{B} \equiv \mathsf{pull}_{\mathsf{DRxGphOver}_U^{}}^{\mathsf{rx}_{\mathsf{RxGph}_U}{\mathcal{A}}}\mathcal{B}$
definitionally.
Computation 106 (A path object classifying small displayed reflexive graphs over a variable base). By computing the display of
$\mathsf{DRxGphOver}_U$
over
$\mathsf{RxGph}_U$
, we obtain a path object classifying reflexive graphs
$\mathcal{A}$
equipped with a displayed reflexive graph
$\mathcal{B}$
over
$\mathcal{A}$
.
We compute as follows.

4.4 Classifying families and lenses of reflexive graphs
Construction 107 (A definitional covariant lens for vertices). We can define a definitional covariant lens
$\mathsf{Vtx}_U$
over the path object
$\mathsf{RxGph}_U$
whose component over a U-small reflexive graph
$\mathcal{A}$
is
$\mathcal{A}$
itself. Setting
$\mathsf{Vtx}_U(\mathcal{A}) :\equiv \mathcal{A}$
, we define the definitional lens structure as follows:

Computation 108 (A path object classifying U-small families of U-small reflexive graphs). Using our theory of partial products of lenses (Section 3.4.4), we can define a path object that classifies pairs
$(\mathcal{A}, \mathcal{B})$
where
$\mathcal{A}$
is a U-small reflexive graph and
$\mathcal{B}$
is a family of U-small reflexive graphs indexed in the vertices of
$\mathcal{A}$
.
We have the following computation:

It would be desirable to find a good path object classifying lens structures on a given family of reflexive graphs. Unfortunately, there are some limitations on our ability to do this: although the pushforward/pullback data are easy to classify, it is unclear how to define a notion of path between oplax/lax unitors over a homotopy between pushforward/pullback data. Therefore, the best we can do is impose the discrete reflexive graph structure on the first component of a lens, combining it with a family of path object structures classifying unitors by coproduct (Definition 19 and Lemma 49); on the other hand, we can still exhibit a useful displayed reflexive graph structure classifying lenses with variable base by means of a unbiased dependent lens as we shall see in Construction 109 below.
Construction 109 (A definitional unbiased dependent lens classifying oplax covariant lens structure). Let
$\mathcal{A}$
be a fixed reflexive graph. We define a componentwise discrete definitional unbiased dependent lens
$\mathsf{LensStr}^+_{\mathcal{A}}$
over
$\lvert \mathcal{A} \rvert\pitchfork\mathsf{RxGph}_U$
as follows:

Naturally,
$\mathsf{LensStr}^+_{\mathcal{A}}(\mathsf{rx}_{\mathsf{RxGph}_U}{\mathcal{B}})$
is precisely the type of oplax covariant lens structures on family of U-small reflexive graphs
$\mathcal{B}$
over
$\mathcal{A}$
.

The unit laws of this unbiased dependent lens hold definitionally.
Computation 110 (A path object classifying oplax covariant lenses with fixed base). Finally, we may define a path object classifying oplax covariant lenses over a fixed reflexive graph
$\mathcal{A}$
.
5. Fibred Reflexive Graphs
A lens is kind of like a fibration in which the lifts have no universal property, as noted by Chollet et al. (Reference Chollet, Clarke, Johnson, Songa, Wang and Zardini2022). In this section, we make the analogy between lenses and fibrations of reflexive graphs precise by characterising fibrations precisely as lenses of path objects in Corollary 129. We begin by translating the notion of fibred reflexive graphs from Rijke (Reference Rijke2019) into the language of displayed reflexive graphs.
Definition 111.
A covariant fibration over a reflexive graph
$\mathcal{A}$
is defined to be a displayed reflexive graph
$\mathcal{B}$
over
$\mathcal{A}$
such that for every edge
$p:x\approx_{\mathcal{A}}y$
and displayed vertex
$u:\lvert \mathcal{B} \rvert(x)$
, the sum
$\sum_{(v:\lvert \mathcal{B} \rvert(y))}u\approx_{\mathcal{B}}^{p}v$
is contractible.
We will write
$p_*^{\mathcal{B}} u:\lvert \mathcal{B} \rvert(y)$
and
$p_\dagger^{\mathcal{B}} u : u \approx_{\mathcal{B}}^{p} p_*^{\mathcal{B}} u$
for the first and second components component of the centre of contraction, respectively.
Definition 112.
A contravariant fibration over a reflexive graph
$\mathcal{A}$
is defined to be a displayed reflexive graph
$\mathcal{B}$
over
$\mathcal{A}$
such that for every edge
$p:x\approx_{\mathcal{A}}y$
and displayed vertex
$v:\lvert \mathcal{B} \rvert(y)$
, the sum
$\sum_{(v':\lvert \mathcal{B} \rvert(x))}v'\approx_{\mathcal{B}}^{p}v$
is contractible.
We shall write
$p^*_{\mathcal{B}} v:\lvert \mathcal{B} \rvert(x)$
and
$p^\dagger_{\mathcal{B}} v : p^*_{\mathcal{B}} v \approx_{\mathcal{B}}^{p} v$
for the first and second components of the centre of contraction, respectively.
5.1 Duality involution for fibred reflexive graphs
In this section, we show that covariant and contravariant fibrations are interchangeable via the duality involution for displayed reflexive graphs (Section 2.2).
Lemma 113 (Total opposite of a fibration). Let
$\mathcal{B}$
be a covariant (resp. contravariant) fibration of reflexive graphs over a reflexive graph
$\mathcal{A}$
. Then the total opposite displayed reflexive graph
$\mathcal{B}^{\widetilde{\mathsf{op}}}$
is a contravariant (resp. covariant) fibration over
$\mathcal{A}^{\mathsf{op}}$
.
Lemma 113 allows us to translate results about all covariant fibrations into results about all contravariant fibrations.
5.2 Fibred reflexive graphs and univalence
Fibred reflexive graphs are always univalent, as we see in Lemma 114. Therefore, it is natural to refer to a fibration of reflexive graphs as a fibration of path objects.
Lemma 114 (Fibrations of reflexive graphs are univalent). Any (covariant, contravariant) fibration of reflexive graphs over a reflexive graph
$\mathcal{A}$
is univalent, i.e. a displayed path object.
Proof. Suppose without loss of generality (by Lemma 113) that
$\mathcal{B}$
is a covariant fibration. Fixing
$x:\lvert \mathcal{A} \rvert$
and
$u:\lvert \mathcal{B} \rvert(x)$
, it suffices to show that the fan
$\{u\}_{\mathcal{B}(x)}^{+}$
is a proposition. We have the following definitional computation of the fan:

The latter is contractible by our assumption that
$\mathcal{B}$
is a covariant fibration. Suppose, on the other hand, that
$\mathcal{B}$
is a contravariant fibration. To show that
$\mathcal{B}$
is univalent, it suffices to show that each of the co-fans
$\{u\}_{\mathcal{B}(x)}^{-}$
is a proposition, which we compute below:

The latter is contractible because
$\mathcal{B}$
is a contravariant assumption.
A converse to Lemma 114 cannot hold, as we see in Example 115.
Example 115.
Not every univalent displayed reflexive graph is a fibration. In particular, consider the following displayed reflexive graph over the codiscrete reflexive graph
${\triangledown}{\mathbf{2}}$
:

We can see that for each
$i:\mathbf{2}$
, the component
$\mathcal{G}(i)$
is the codiscrete reflexive graph
${\triangledown}(i =_{\mathbf{2}} 1)$
, which is univalent by Lemma 52 as
$\mathbf{2}$
is a set. Therefore
$\mathcal{G}$
is univalent, and we will see that it can be neither a covariant nor a contravariant fibration.
Suppose that
$\mathcal{G}$
were a covariant fibration. We have an edge
${*} : 1 \approx_{{\triangledown}{\mathbf{2}}} 0$
and thus a pushforward map
$(*)_* \colon 1 =_{\mathbf{2}} 1\to 0 =_{\mathbf{2}} 1$
. On the other hand, if
$\mathcal{G}$
were a contravariant fibration, we would use pullback along
${*}:0 \approx_{{\triangledown}{\mathbf{2}}}1$
to obtain a contradiction.
Example 115 also shows that not every univalent displayed reflexive graph can be obtained from a lens structure on its components.
5.3 Fibred reflexive graphs from lenses of path objects
We will now show that when a lens is valued in path objects, its display is a fibration.
Definition 116 (Universal pushforwards/pullbacks). An oplax covariant lens
$\mathcal{B}$
over a reflexive graph
$\mathcal{A}$
is said to have universal pullforwards when for every edge
$p:x\approx_{\mathcal{A}}y$
and vertex
$u:\lvert \mathcal{B}(x) \rvert$
, the fan
$\{\mathsf{push}_{\mathcal{B}}^{p}{u}\}_{\mathcal{B}(y)}^{+}$
is a proposition.
Conversely, a lax contravariant lens
$\mathcal{B}$
over a reflexive graph
$\mathcal{A}$
is said to have
universal pullbacks
when for every edge
$p:x\approx_{\mathcal{A}}y$
and vertex
$v:\lvert \mathcal{B}(y) \rvert$
, the co-fan
$\{\mathsf{pull}_{\mathcal{B}}^{p}{u}\}_{\mathcal{B}(x)}^{-}$
is a proposition.
Lemma 117 (Covariant fibrations from universal pushforwards). Let
$\mathcal{B}$
be an oplax covariant lens over a reflexive graph
$\mathcal{A}$
that has universal pushforwards. Then the covariant display
$\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}$
can be made into a covariant fibration of reflexive graphs in which
$p_* u \equiv \mathsf{push}_{\mathcal{B}}^{p}u$
and
$p_\dagger u \equiv \mathsf{rx}_{\mathcal{B}(y)}(\mathsf{push}_{\mathcal{B}}^{p}{u})$
.
Proof. We note that for any edge
$p:x\approx_{\mathcal{A}}y$
and vertex
$u:\lvert \mathcal{B}(x) \rvert$
, we have the following sequence of definitional equivalences:

Thus, we may choose a centre of contraction for the latter freely so long as it is a proposition (which we have by assumption).
Lemma 118 (Contravariant fibrations from universal pullbacks). Let
$\mathcal{B}$
be a lax contravariant lens over a reflexive graph
$\mathcal{A}$
that has universal pullbacks. Then the contravariant display
$\mathsf{disp}^-_{\mathcal{A}}{\mathcal{B}}$
can be made into a contravariant fibration of reflexive graphs in which
$p^*u \equiv \mathsf{pull}_{\mathcal{B}}^{p}{u}$
and
$p^\dagger u \equiv \mathsf{rx}_{\mathcal{B}(x)}(\mathsf{pull}_{\mathcal{B}}^{p}{u})$
.
Proof. Analogous to Lemma 117.
Corollary 119. An (oplax covariant, lax contravariant) lens
$\mathcal{B}$
has universal (pushforwards, pullbacks) if and only if each component
$\mathcal{B}(x)$
is univalent.
Proof. Let
$\mathcal{B}$
be an oplax covariant lens over a reflexive graph
$\mathcal{A}$
.
-
(1) Suppose that
$\mathcal{B}$
has universal pushforwards. We want to show that each fan
$\{u\}_{\mathcal{B}(x)}^{+}$
is a proposition; using our assumption of universal pushforwards, we can show that
$\{u\}_{\mathcal{B}(x)}^{+}$
is a retract of
$\{\mathsf{push}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u}\}_{\mathcal{B}(x)}^{+}$
, which is a proposition because
$\mathcal{B}$
has universal pushforwards. -
(2) Suppose conversely that each component
$\mathcal{B}(x)$
is univalent; then all fans in the components of
$\mathcal{B}$
are propositions, including
$\{\mathsf{push}_{\mathcal{B}}^{p}{u}\}_{\mathcal{B}(y)}^{+}$
for some
$p:x\approx_{\mathcal{A}}y$
and
$u:\lvert \mathcal{B}(y) \rvert$
.
The case for when
$\mathcal{B}$
is a lax contravariant lens is established by duality via Lemma 114 and Lemma 118.
5.4 The underlying lens of a covariant fibration of reflexive graphs
The pushforward operation
$p_*^{\mathcal{B}}$
of a covariant fibration gives rise to an oplax covariant lens structure on the components of
$\mathcal{B}$
, which we construct and study in this section.
-
(1) We first exhibit a “straightening/unstraightening” equivalence between displayed edges
$u\approx_{\mathcal{B}}^{p:x\approx_{\mathcal{A}}y}v$
and vertical edges
$\mathsf{push}_{\mathcal{B}}^{p}{u}\approx_{\mathcal{B}(y)} v$
in Construction 120, Construction 121, and Lemma 122. -
(2) We use the straightening equivalence to exhibit the underlying lens of a displayed reflexive graph in Construction 123.
-
(3) Finally, Theorem 128 exhibits an equivalence of displayed reflexive graphs between any displayed reflexive graph
$\mathcal{B}$
and the display of its underlying lens.
5.5 Straightening of displayed edges
Construction 120 (Straightening of edges). Let
$\mathcal{B}$
be a covariant fibration of reflexive graphs over a reflexive graph
$\mathcal{A}$
. We can define a “straightening” function that converts displayed edges in
$\mathcal{B}$
to vertical edges using the pushforward operation of the fibration.
First, we define a more general function incorporating a witness of contraction.

Then, we define the straightening function by instantiation with one of the witnesses of contraction of
$\sum_{(w:\lvert \mathcal{B} \rvert(y))}u\approx_{\mathcal{B}}^{p}w$
, which we leave nameless.

Construction 121 (Unstraightening of edges). Let
$\mathcal{B}$
be a covariant fibration of reflexive graphs over a reflexive graph
$\mathcal{A}$
. We can “unstraighten” vertical edges of the form
$p_*^{\mathcal{B}} u \approx_{\mathcal{B}(y)} v$
to displayed edges
$u\approx_{\mathcal{B}}^{p} v$
as follows:

Then, we define the unstraightening function by instantiation with an anonymous witness that can be obtained from the fact that
$\sum_{(w:\lvert \mathcal{B} \rvert(y))}p_*^{\mathcal{B}} u \approx_{\mathcal{B}(y)}w$
is a proposition.

Lemma 122 (Straightening is an equivalence). Let
$\mathcal{B}$
be a covariant fibration of reflexive graphs over a reflexive graph
$\mathcal{A}$
. Each straightening function
$\mathsf{str}_{\mathcal{B}}^{p} : u \approx_{\mathcal{B}}^{p}v \to p_*^{\mathcal{B}} u\approx_{\mathcal{B}(y)} v$
is an equivalence, with the inverse tracked by
$\mathsf{unstr}_{\mathcal{B}}^{p} : p_*^{\mathcal{B}} u\approx_{\mathcal{B}(y)} v \to u \approx_{\mathcal{B}}^{p}v$
.
Proof. We first check that straightening is a retraction of unstraightening. It suffices to prove the following slightly generalised lemma.

Conversely, we check that straightening is a section of unstraightening by means of the following generalised lemma.

5.6 The underlying lens of a covariant fibration
We are now equipped to construct the underlying lens of a given covariant fibration.
Construction 123 (The underlying lens of a covariant fibration). A covariant fibration of reflexive graphs
$\mathcal{B}$
over a reflexive graph
$\mathcal{A}$
induces a (canonical, as we shall see) oplax covariant lens structure on the diagonal family
$\mathcal{B}_{\mathsf{rx}}$
via straightening.

Theorem 124 below shows that if we take the display of the underlying lens of a covariant fibration, we obtain the original displayed reflexive graph.
Theorem 124 (Roundtrip for fibrations of reflexive graphs). Let (U,E) be a univalent universe, and let
$\mathcal{B}$
be a U-small covariant fibration of reflexive graphs over a reflexive graph
$\mathcal{A}$
. Then the display
$\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}_{\mathsf{rx}}}$
of the underlying lens of
$\mathcal{B}$
may be identified with
$\mathcal{B}$
by means of an equivalence of displayed reflexive graphs
$\mathcal{B}\approx_{\mathsf{DRxGphOver}_U(\mathcal{A})} \mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}_{\mathsf{rx}}}$
.
Proof. We shall use the characterisation of identifications of displayed reflexive graphs that we established in Section 4.2. In particular, we shall construct an equivalence of displayed reflexive graphs
$\phi : \mathcal{B} \approx_{\mathsf{DRxGphOver}_U(\mathcal{A})} \mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}_{\mathsf{rx}}}$
. We can use the identity equivalence on vertices and the straightening–unstraightening equivalence on edges:

The displayed reflexivity data are preserved up to definitional equality, as we have:

5.7 Characterisation of fibred reflexive graphs
Let
$\mathcal{B}$
be an oplax covariant lens of U-small path objects over a reflexive graph
$\mathcal{A}$
. By Lemma 117, the display
$\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}$
is a covariant fibration. By Construction 123, we obtain an oplax covariant lens
$(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}$
that we may compare with
$\mathcal{B}$
. We first recall from Computation 58 the underlying reflexive graph of each component
$(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}(x)$
:
\begin{align*} \lvert (\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}(x) \rvert & \equiv \lvert \mathcal{B}(x) \rvert \\ u\approx_{(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}(x)} v & \equiv \mathsf{push}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u} \approx_{\mathcal{B}(x)} v \\ \mathsf{rx}_{(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}(x)}{u} & \equiv \mathsf{pushRx}_{\mathcal{B}}^{x}{u} \end{align*}
Computation 125.
We compute the lens structure of
$(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}$
as follows, recalling Construction 123 and Lemma 117.
\begin{align*} \mathsf{push}_{(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}}^{p}{u} & \equiv p_*^{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}u \equiv \mathsf{push}_{\mathcal{B}}^{p}{u} \\ \mathsf{pushRx}_{(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}}^{x}{u} & \equiv \mathsf{str}_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{\mathsf{rx}_{\mathcal{A}}x}{(\mathsf{rx}_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{x}{u})} \equiv \mathsf{str}_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{\mathsf{rx}_{\mathcal{A}}x}{(\mathsf{pushRx}_{\mathcal{B}}^{x}{u})} \end{align*}
Construction 126.
We have an equivalence
$\eta_{\mathcal{B}} : \mathcal{B}\approx_{\lvert \mathcal{A} \rvert\pitchfork\mathsf{RxGph}_U}(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}$
of underlying families of reflexive graphs over
$\mathcal{A}$
, which we define below making use of Corollary 119, Construction 37, and Lemma 38.
\begin{align*} \eta_{\mathcal{B}} & : \mathcal{B} \approx_{\lvert \mathcal{A} \rvert\pitchfork\mathsf{RxGph}_U} (\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}} \\ \lvert \eta_{\mathcal{B}} x \rvert & :\equiv \mathsf{rx}_{U/E}{\lvert \mathcal{B}(x) \rvert} \\ (\eta_{\mathcal{B}} x)^\approx & :\equiv \lambda{u,v}\mathpunct{.} (\mathsf{pushRx}_{\mathcal{B}}^{x}{u}{{\,\centerdot\,}}_{\mathcal{B}(x)}-) \\ (\eta_{\mathcal{B}} x)^{\mathsf{rx}} & :\equiv \lambda{u}\mathpunct{.} \mathsf{runit}_{\mathsf{pushRx}_{\mathcal{B}}^{x}{u}} \end{align*}
Computation 127.
Write
$\mathsf{lext}_{\mathsf{LensStr}^+_{\mathcal{A}}}^{\eta_{\mathcal{B}}}\mathcal{B} : \mathsf{LensStr}^+_{\mathcal{A}}(\eta_{\mathcal{B}})$
for the extension of the lens structure from
$\mathcal{B}$
onto the equivalence
$\eta_{\mathcal{B}} : \mathcal{B}\approx_{\lvert \mathcal{A} \rvert\pitchfork\mathsf{RxGph}_U}(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}$
of families of reflexive graphs. Likewise, write
$\mathsf{rext}_{\mathsf{LensStr}^+_{\mathcal{A}}}^{\eta_{\mathcal{B}}}(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}} : \mathsf{LensStr}^+_{\mathcal{B}}(\eta_{\mathcal{B}})$
for the corresponding extension of the lens structure of
$(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}$
onto
$\eta_{\mathcal{B}}$
. We have the definitional computations of the lens structures:
\begin{align*} \mathsf{push}_{\mathsf{lext}_{\mathsf{LensStr}^+_{\mathcal{A}}}^{\eta_{\mathcal{B}}}\mathcal{B}}^{p}{u} & \equiv \mathsf{push}_{\mathcal{B}}^{p}{u} \\ \mathsf{pushRx}_{\mathsf{lext}_{\mathsf{LensStr}^+_{\mathcal{A}}}^{\eta_{\mathcal{B}}}\mathcal{B}}^{x}{u} & \equiv \mathsf{pushRx}_{\mathcal{B}}^{x}{ (\mathsf{push}_{\mathcal{B}}^{\mathsf{rx}_{\mathcal{A}}{x}}{u}) } {{\,\centerdot\,}}_{\mathcal{B}(x)} \mathsf{pushRx}_{\mathcal{B}}^{x}{u} \\ \mathsf{push}_{\mathsf{rext}_{\mathsf{LensStr}^+_{\mathcal{A}}}^{\eta_{\mathcal{B}}}(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}}^{p}{u} & \equiv \mathsf{push}_{\mathcal{B}}^{p}{u} \\ \mathsf{pushRx}_{\mathsf{rext}_{\mathsf{LensStr}^+_{\mathcal{A}}}^{\eta_{\mathcal{B}}}(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}}^{x}{u} & \equiv \mathsf{str}_{\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}}^{\mathsf{rx}_{\mathcal{A}}x}]{(\mathsf{pushRx}_{\mathcal{B}}^{x}{u})} \end{align*}
Proof. We outline the explicit computations below, unfolding Construction 109, Construction 123, and Computation 125.

Theorem 128 (Roundtrip for oplax covariant lenses of path objects). The equivalence
$\eta_{\mathcal{B}} : \mathcal{B} \approx_{\lvert \mathcal{A} \rvert\pitchfork\mathsf{RxGph}_U} (\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}$
of families of reflexive graphs extends to an equivalence
$\mathcal{B} \approx_{\mathsf{Lens}^+_{\mathcal{A}}} (\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}$
of oplax covariant lenses over
$\mathcal{A}$
.
Proof. We must construct a displayed equivalence
$\mathcal{B}\approx_{\mathsf{disp}^\pm_{\lvert \mathcal{A} \rvert\pitchfork \mathsf{RxGph}_U}{\mathsf{LensStr}^+_{\mathcal{A}}}}^{\eta_{\mathcal{B}}} \!(\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}})_{\mathsf{rx}}$
of lens structures over
$\eta_{\mathcal{B}}$
. This consists of an (ordinary) equivalence of lenses as below:
Unfolding the definition of
$\mathsf{Lens}^+_{\mathcal{A}}{\eta_{\mathcal{B}}}$
from Construction 109 and using Computation 127, we see that the pushforward datum for each lens depicted above is definitionally equal to that of
$\mathcal{B}$
. Therefore, it suffices to construct an equivalence between oplax unitors as below:

Up to definitional equality, the goal above is a substitution instance of the following more general goal which we establish below.

Corollary 129 (Characterisation of fibred reflexive graphs). Let
$\mathcal{A}$
be a reflexive graph, and let (U,E) be a univalent universe. Assuming function extensionality, the following two types are equivalent:
-
(1) The type of oplax covariant (resp. lax contravariant) lenses of U-small path objects over
$\mathcal{A}$
. -
(2) The type of covariant (resp. contravariant) fibrations of U-small reflexive graphs over
$\mathcal{A}$
.
Proof. An oplax covariant lens of path objects
$\mathcal{B}$
over
$\mathcal{A}$
is sent to covariant fibration
$\mathsf{disp}^+_{\mathcal{A}}{\mathcal{B}}$
as described in Lemma 117. Conversely, a covariant fibration
$\mathcal{B}$
over
$\mathcal{A}$
is sent to its underlying lens of path objects
$\mathcal{B}_{\mathsf{rx}}$
as specified in Construction 123. That these transformations are mutually inverse follows from Theorem 124 and Theorem 128, as both
$\mathsf{Lens}^+_{\mathcal{A}}$
and
$\mathsf{DRxGphOver}_U(\mathcal{A})$
are univalent in the presence of function extensionality.
The equivalence between lax contravariant lenses and contravariant fibrations is established from the above by duality (Section 2.2 and Section 5.1).
Acknowledgements
I thank Rafaël Bocquet for suggesting the terminology of path objects. I am also grateful to Fredrik Bakke, Marcelo Fiore, Daniel Gratzer, Tom de Jong, Egbert Rijke, and David Wärn for helpful conversations and to Ulrik Buchholtz and Johannes Schipp von Branitz for many helpful suggestions and clarifications. I owe a great debt to Ian Ray for finding many mistakes in an earlier draft of this paper. This work was funded by the United States Air Force Office of Scientific Research under grant FA9550-23-1-0728 (New Spaces for Denotational Semantics; Dr. Tristan Nguyen, Program Manager). Views and opinions expressed are however those of the author only and do not necessarily reflect those of AFOSR.
Competing interests
The author declares none.


