Univalence principles for algebraic structures [01I1]
- September 13, 2025
- Jon Sterling
When we have a univalent universe \mathcal {U}, the identification types of \mathcal {U} classify equivalences of types. Combining this with identification elimination, we obtain several very useful reasoning principles that are unique to univalent foundations:
To prove something about all types equipped with an equivalence onto A:\mathcal {U}, it suffices to prove that thing just about the identity equivalence on A.
This gives us a simpler way to prove many basic theorems. For example, we can prove that the composition of equivalences is associative and unital by reducing to the case of composing the identity equivalence with itself. That is a kind of reasoning that is impossible in traditional foundations, but completely natural in univalent foundations.
We can use the same principle to transfer properties and structure between equivalent types. For example, we previously observed that any type that is equivalent to a proposition is a proposition; that can be proved directly, but univalence provides a particularly simple proof in which we consider just the case of the identity equivalence.
The universe being univalent is, however, just the start. At many times we want to transfer properties and structures along not an equivalence of types, but rather an equivalence of (e.g.) monoids or categories, or something else. To give a simple example, let’s consider the exampe of the fixed points of a unary algebra; this is just an example, so do not worry if you haven’t heard of such things.
Definition Unary algebra [01I2]
- September 13, 2025
- Jon Sterling
A unary algebra A is given by a type \left \lvert {A}\right \rvert together with an endo-function \mathsf {f}_{A}:\left \lvert {A}\right \rvert \to \left \lvert {A}\right \rvert .
Definition Fixed points of a unary algebra [01I3]
- September 13, 2025
- Jon Sterling
A fixed point of a unary algebra A is an element a:\left \lvert {A}\right \rvert together with an identification \phi : fa=_{\left \lvert {A}\right \rvert }a. So the type of fixed points in A is the following sum:
\mathsf {FP}(A) :\equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(a:\left \lvert {A}\right \rvert )}}{ fa=_{\left \lvert {A}\right \rvert }a }Now, we can also speak of equivalences of unary algebras; these ought to be equivalences of the underlying types that preserve the associated endo-function.
Definition Equivalences of unary algebras [01I4]
- September 13, 2025
- Jon Sterling
Given two unary algebras A and B, an equivalence of unary algebras h from A to B is given by an equivalence \left \lvert {h}\right \rvert :\left \lvert {A}\right \rvert \xrightarrow {\sim }\left \lvert {B}\right \rvert together with a family of homotopies \mathsf {f}_{h} : \left \lvert {h}\right \rvert \circ \mathsf {f}_{A} \sim \mathsf {f}_{B}\circ \left \lvert {h}\right \rvert \text {.}
False Start Univalent universes can’t do it all alone! [01I5]
- September 13, 2025
- Jon Sterling
Now let A and B be unary algebras which we freely assume to lie within some univalent universe \mathcal {U}, and suppose that we have an equivalence of unary algebras h:A\to B. We might wish to find a way to transfer a fixed point of A to obtain a fixed point of B. It seems at first that univalence should help with this, as (indeed) the underyling function \left \lvert {h}\right \rvert :\left \lvert {A}\right \rvert \to \left \lvert {B}\right \rvert is an equivalence and so we may consider just the case that it is the identity equivalence. We are trying to construct the following transfer function:
\begin {aligned} &A,B:\mathsf {UnaryAlg}_{\mathcal {U}}, h:\mathsf {UnaryAlgEquiv}(A,B), a:\mathsf {FP}(A) \vdash \mathsf {FP}(B) \end {aligned}We first destructure all of our assumptions:
\begin {aligned} &A,B:\mathcal {U}; f_A:A\to A, f_B:B\to B,\\ &h:\mathsf {Equiv}(A,B), f_h: h\circ f_A\sim f_B\circ h, \\ &a : \mathsf {FP}\left \langle A,f_A\right \rangle \\ &\vdash \mathsf {FP}\left \langle B,f_B\right \rangle \end {aligned}What the univalence of \mathcal {U} allows us to do is reduce to just the case that (B,h) are the identity equivalence on the type A. So it would suffice to exhibit:
\begin {aligned} &A:\mathcal {U}; f_A:A\to A, f_A':A\to A,\\ &f_h: f_A\sim f_A', \\ &a : \mathsf {FP}\left \langle A,f_A\right \rangle \\ &\vdash \mathsf {FP}\left \langle A,f_A'\right \rangle \end {aligned}This was not quite as magical as we had hoped! We are still going to need to use the homotopy above to convert a fixed point of f_A to a fixed point of f_A'. This is obviously possible, but there is nothing automatic about it; if we had many more operations and laws than are present in the theory of unary algebras, doing so would quickly become unwieldy.
Some eminent mathematicians, whom one might view as unscrupulous if judging only from their misleading and inaccurate public statements on univalent foundations, have concluded for this reason that univalence is a bit of hype and cannot actually achieve what is claimed. Our goal today is to see how univalence, wielded in a cultured and educated manner, really can solve this kind of problem elegantly and simply.
Our lesson from the false start above is that we instead need to characterise the identification type of the type of unary algebras, building on the univalence principle of the universe. We can do so directly, but it will be most useful to develop some general-purpose machinery that can be re-used.
Definition Displayed reflexive graph [01I6]
- September 13, 2025
- Jon Sterling
Let A be a reflexive graph. A displayed reflexive graph B over A is given by the following data:
\begin {aligned} x:\left \lvert {A}\right \rvert &\vdash \left \lvert {B}\right \rvert [x]~\mathit {type} \\ x,y:\left \lvert {A}\right \rvert ; e:x\approx _{A}y, u:\left \lvert {B}\right \rvert [x], v:\left \lvert {B}\right \rvert [y] &\vdash u \approx ^{B}_{e} v ~\mathit {type} \\ x:\left \lvert {A}\right \rvert ,u:\left \lvert {B}\right \rvert [x] &\vdash \mathsf {rx}^{A}_{x}u : u\approx ^{B}_{\mathsf {rx}_{A}{x}}u \end {aligned}An element of \left \lvert {B}\right \rvert [x] is called a vertex displayed over x. Given an edge p:x\approx _{A}y in A and displayed vertices u,v over x,y respectively, an element of u\approx ^{B}_{p}v is called a displayed edge over p. Finally, \mathsf {rx}^{A}_{x}u is called the displayed reflexivity edge on u over x.
Displayed reflexive graphs over A give rise to ordinary reflexive graphs in two major ways: by taking their component over a vertex x:A, and by computing the total reflexive graph.
Construction Components of a displayed reflexive graph [01I7]
- September 13, 2025
- Jon Sterling
Let B be a displayed reflexive graph over a reflexive graph A. The component of B over a vertex x:\left \lvert {A}\right \rvert is the reflexive graph B[x] specified below:
\begin {aligned} \left \lvert {B[x]}\right \rvert &:\equiv \left \lvert {B}\right \rvert [x] \\ \left ( u \approx _{B[x]} v \right ) &:\equiv u \approx ^{B}_{\mathsf {rx}_{A}{x}} v \\ \mathsf {rx}_{B[x]}{u} &:\equiv \mathsf {rx}^{B}_{x}{u} \end {aligned}Construction The total reflexive graph of a displayed reflexive graph [01I8]
- September 13, 2025
- Jon Sterling
Let B be a displayed reflexive graph over a reflexive graph A. The total reflexive graph of B is defined to be the reflexive graph A.B specified below:
\begin {aligned} \left \lvert {A.B}\right \rvert &:\equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:\left \lvert {A}\right \rvert )}}{\left \lvert {B}\right \rvert [x]} \\ \left ( \left \langle x,u\right \rangle \approx _{A.B} \left \langle y,v\right \rangle \right ) &:\equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(e:x\approx _{A}y)}} u\approx ^{B}_{e} v \\ \mathsf {rx}_{A.B}{\left \langle x,u\right \rangle } &:\equiv \left \langle \mathsf {rx}_{A}{x}, \mathsf {rx}^{B}_{x}{u} \right \rangle \end {aligned}Definition Univalent displayed reflexive graph [01I9]
- September 13, 2025
- Jon Sterling
A displayed reflexive graph is called univalent when all of its components are univalent.
Lemma Univalent total reflexive graphs [01IA]
- September 13, 2025
- Jon Sterling
Let B be a displayed reflexive graph over a reflexive graph A. If A is univalent and B is univalent, then the total reflexive graph A.B is univalent.
Proof.
- September 13, 2025
- Jon Sterling
We will show that for every a:\left \lvert {A}\right \rvert and b:\left \lvert {B}\right \rvert the fan \left \{\left \langle a,b\right \rangle \right \}^+_{A.B} is a proposition. We consider the following sequence of equivalences:
\begin {aligned} &\left \{\left \langle a,b\right \rangle \right \}^+_{A.B} \\ &\xrightarrow {(1)} {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(p:{\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:\left \lvert {A}\right \rvert )}}\left \lvert {B}\right \rvert [x])}} {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(e:a\approx _{A} p.1)}} b\approx ^{B}_{e} p.2 \\ &\xrightarrow {(2)} {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(x:\left \lvert {A}\right \rvert )}} {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(e:a\approx _{A} x)}} {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(u:\left \lvert {B}\right \rvert [x])}} b\approx ^{B}_{e} u \\ &\xrightarrow {(3)} {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(\phi :\left \{a\right \}^+_{A})}} {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(u:\left \lvert {B}\right \rvert [\phi .1])}} b\approx ^{B}_{\phi .2} u \\ &\xleftarrow {(4)} {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(u:\left \lvert {B}\right \rvert [a])}} b\approx ^{B}_{\mathsf {rx}_{A}{a}}u \\ &\xrightarrow {(5)} \left \{b\right \}^+_{B[a]} \end {aligned}Above:
- (1) and (5) are the identity equivalences.
- (2) and (3) is just re-associating the data.
- (4) is given by our assumption that A is univalent.
Because each fan of A.B is equivalent to a fan of some component of B, and B is univalent, we conclude that A.B is univalent.
Example A displayed reflexive graph for endofunctions [01IB]
- September 13, 2025
- Jon Sterling
We recall our definition of unary algebra in a universe \mathcal {U}, which we do not necessarily assume univalent here.
\mathsf {UnaryAlg}_{\mathcal {U}} :\equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(A:\mathcal {U})}} A\to AWe will construct a displayed reflexive graph whose total reflexive graph \mathsf {Endofun}_{\mathcal {U}} will be exactly the desired notion of equivalence of unary algebras, i.e.:
\mathsf {UnaryAlgEquiv}(A,B) :\equiv {\mathop {\mathchoice {\textstyle \sum }{\textstyle \sum }{\scriptstyle \sum }{\scriptscriptstyle \sum } }_{(h:\mathsf {Equiv}(A,B))}} h\circ \mathsf {f}_{A}\sim \mathsf {f}_{B}\circ hBecause the first component above needs to be an equivalence of types, we know what the base reflexive graph needs to be: the reflexive graph image \mathcal {U} / \mathcal {T}! To construct the displayed reflexive graph \mathsf {Endofun}_{\mathcal {U}} over \mathcal {U} / \mathcal {T}, we proceed as follows:
\begin {aligned} &A:\mathcal {U} \\ &\vdash \left \lvert {\mathsf {Endofun}_{\mathcal {U}}}\right \rvert [A] :\equiv A\to A \\[12pt] & A,B:\mathcal {U}; e:\mathsf {Equiv}(A,B), f_A:A\to A, f_B:B\to B \\ &\vdash \left (f_A\approx ^{\mathsf {EndoFun}_{\mathcal {U}}}_{e} f_B\right ) :\equiv e\circ f_A \sim f_B\circ e \\[12pt] &A:\mathcal {U}, f_A:A\to A \\ &\vdash \mathsf {rx}^{\mathsf {EndoFun}_{\mathcal {U}}}_{A}{f_A} :\equiv \lambda x\mathpunct {.} \mathsf {refl}_{f_Ax} \end {aligned}Computation Total reflexive graph for endofunctions [01IF]
- September 13, 2025
- Jon Sterling
The total reflexive graph of the displayed reflexive graph for endofunctions \mathsf {Endofun}_{\mathcal {U}} is precisely the following:
\begin {aligned} \left \lvert {(\mathcal {U} / \mathcal {T}).\mathsf {Endofun}_{\mathcal {U}}}\right \rvert &\equiv \mathsf {UnaryAlg}_{\mathcal {U}} \\ \left (A\approx _{(\mathcal {U} / \mathcal {T}).\mathsf {Endofun}_{\mathcal {U}}}B\right ) &\equiv \mathsf {UnaryAlgEquiv}(A,B) \\ \mathsf {rx}_{(\mathcal {U} / \mathcal {T}).\mathsf {Endofun}_{\mathcal {U}}}{A} &\equiv \left \langle 1_A, \lambda x\mathpunct {.}\mathsf {refl}_{\mathsf {f}_{A}x}\right \rangle \end {aligned}Computation Components of the displayed reflexive graph for endofunctions [01IC]
- September 13, 2025
- Jon Sterling
Given a type A:\mathcal {U}, the component of \mathsf {Endofun}_{\mathcal {U}} over A is computed as follows:
\begin {aligned} \left \lvert {\mathsf {Endofun}_{\mathcal {U}}}\right \rvert [A] &\equiv A\to A \\ \left (f\approx _{\mathsf {Endofun}_{\mathcal {U}}[A]} g\right ) &\equiv f\sim g \\ \mathsf {rx}_{\mathsf {Endofun}_{\mathcal {U}}[A]}{f} &\equiv \lambda x\mathpunct {.}{\mathsf {refl}_{fx}} \end {aligned}Inspecting the above, we see that we have the following judgemental equality of reflexive graphs:
\mathsf {Endofun}_{\mathcal {U}}[A] \equiv {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(x:A)}} \Delta ACorollary Displayed univalence for endfunctions [01ID]
- September 13, 2025
- Jon Sterling
It follows immediately that the displayed reflexive graph for endofunctions \mathsf {Endofun}_{\mathcal {U}} is univalent (regardless of whether \mathcal {U} is univalent).
Proof.
- September 13, 2025
- Jon Sterling
We need only verify that each component \mathsf {Endofun}_{\mathcal {U}}[A] is univalent; but we already computed that this component is precisely the product {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(x:A)}}\Delta A\text {,} which is univalent by the univalence principle for products of discrete reflexive graphs, i.e. function extensionality.
Corollary The univalence principle for unary algebras [01IE]
- September 13, 2025
- Jon Sterling
If \mathcal {U} is a univalent universe, then the total reflexive graph (\mathcal {U} / \mathcal {T}).\mathsf {Endofun}_{\mathcal {U}} is univalent.
Proof.
- September 13, 2025
- Jon Sterling
This follows from our lemma for univalent total reflexive graphs via our assumption that \mathcal {U} is a univalent universe and our displayed univalence lemma for endofunctions.
Univalence principles such as the one above for algebraic structures are often called structure identity principles, a name (to my knowledge) chosen by the late Peter Aczel. These can be derived for pretty any algebraic structure whatsoever in the way that we have shown above.
Example Univalent transfer of fixed points along equivalences of unary algebras [01IG]
- September 13, 2025
- Jon Sterling
With the univalence principle for unary algebras in hand, it is now trivial to transfer fixed points along an equivalence of unary algebras, as we have the following equivalences:
\begin {aligned} & {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(A,B:\mathsf {UnaryAlg}_{\mathcal {U}})}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(e:\mathsf {UnaryAlgEquiv}(A,B))}}\; \mathsf {FP}(A)\to \mathsf {FP}(B) \\ &\xrightarrow {(1)} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(A:\mathsf {UnaryAlg}_{\mathcal {U}})}} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(\phi : \left \{A\right \}^+_{(\mathcal {U} / \mathcal {T}).\mathsf {Endofun}_{\mathcal {U}}} )}} \; \mathsf {FP}(A)\to \mathsf {FP}(\phi .1) \\ &\xrightarrow {(2)} {\mathop {\mathchoice {\textstyle \prod }{\textstyle \prod }{\scriptstyle \prod }{\scriptscriptstyle \prod } }_{(A:\mathsf {UnaryAlg}_{\mathcal {U}})}} \mathsf {FP}(A)\to \mathsf {FP}(A) \end {aligned}Above, (1) is just reassociating data and (2) is the univalence princile for unary algebras, as we contract the fan \phi onto (A,1_A) where 1_A is the identity equivalence of unary algebras.