Ian Ray. 28th August 2025.
Minor changes and merged into TypeToplogy in April 2026.
We define the notion of univalent family in terms of a reflexive graph image.
The terminology here is borrowed from "Reflexive graph lenses in univalent
foundations" by Jon Sterling (see ReflexiveGraphs.index for link).
\begin{code}
{-# OPTIONS --safe --without-K #-}
module ReflexiveGraphs.UnivalentFamilies where
open import MLTT.Spartan
open import UF.Equiv
open import ReflexiveGraphs.Type
open import ReflexiveGraphs.Univalent
\end{code}
The reflexive graph image with carrier A, on a family B : A โ Type, has edges
x โ y given by an equivalence between the fibers, that is B(x) โ B(y).
\begin{code}
refl-graph-image : (A : ๐ค ฬ) โ (A โ ๐ฃ ฬ) โ Refl-Graph ๐ค ๐ฃ
refl-graph-image {๐ค} {๐ฃ} A B = (A , I , II)
where
I : A โ A โ ๐ฃ ฬ
I x y = B x โ B y
II : (x : A) โ I x x
II x = โ-refl (B x)
is-univalent-family : ฮฃ A ๊ ๐ค ฬ , (A โ ๐ฃ ฬ)
โ ๐ค โ ๐ฃ ฬ
is-univalent-family (A , B) = is-univalent-refl-graph (refl-graph-image A B)
\end{code}
This definition is intentionally general and offers a robust theoretical
framework for working with universes. Concretely, if one were working directly
with the codes of a Tarski style universe presentation then a univalent family
could be a pair (๐ค , El) consiting of the universe type and the decoding map
El : ๐ค โ Type. In Agda the user may operate as if universes where presented ร
la Russel and thus the pair of interest is simply (๐ค , id). But there are other
examples of univalent families of interest such as any h-level sub-universe
(e.g. (Prop, prโ), (Set, prโ)). Perhaps (โ , finset) offers a more non-standard
and interesting example for your consideration.
We can give some equivalent characterizations of univalent family of types.
\begin{code}
id-to-equiv-family : {A : ๐ค ฬ} {B : A โ ๐ฃ ฬ}
โ (x y : A)
โ x ๏ผ y
โ B x โ B y
id-to-equiv-family {_} {_} {A} {B} x y = id-to-edge (refl-graph-image A B)
is-univalent-family-implies-id-to-equiv
: {A : ๐ค ฬ} {B : A โ ๐ฃ ฬ}
โ is-univalent-family (A , B)
โ (x y : A)
โ is-equiv (id-to-equiv-family x y)
is-univalent-family-implies-id-to-equiv {๐ค} {๐ฃ} {A} {B} is-ua-fam
= prop-fans-implies-id-to-edge-equiv (refl-graph-image A B) is-ua-fam
id-to-equiv-family-implies-univalent-family
: {A : ๐ค ฬ} {B : A โ ๐ฃ ฬ}
โ ((x y : A) โ is-equiv (id-to-equiv-family x y))
โ is-univalent-family (A , B)
id-to-equiv-family-implies-univalent-family {๐ค} {๐ฃ} {A} {B} is-equiv
= id-to-edge-equiv-implies-prop-fans (refl-graph-image A B) is-equiv
\end{code}
We conclude by defining a univalent family of univalent reflexive graphs.
\begin{code}
univalent-family-of-univalent-refl-graphs
: {๐ฆ ๐ฃ : Universe}
โ ((U , ๐) : ฮฃ U ๊ ๐ค ฬ , (U โ Univalent-Refl-Graph ๐ฆ ๐ฃ))
โ ๐ค โ ๐ฆ ฬ
univalent-family-of-univalent-refl-graphs (U , ๐)
= is-univalent-refl-graph (refl-graph-image U (ฮป A โ โจ (๐ A) โฉแตค))
\end{code}