UnivalentFamilies
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).{-# OPTIONS --safe --without-K #-} module ReflexiveGraphs.UnivalentFamilies where open import MLTT.Spartan open import UF.Equiv open import UF.EquivalenceExamples open import UF.Subsingletons open import UF.Univalence open import ReflexiveGraphs.Type open import ReflexiveGraphs.UnivalentThe 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).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)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) consisting 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.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-equivWe conclude by defining a univalent family of univalent reflexive graphs.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) โฉแตค))We observe that a univalent universe is a univalent family and thus a univalent reflexive graph.universe-refl-graph : (๐ค : Universe) โ Refl-Graph (๐ค โบ) ๐ค universe-refl-graph ๐ค = refl-graph-image (๐ค ฬ) id module _ (๐ค : Universe) (ua : is-univalent ๐ค) where univalent-universe-is-univalent-family : is-univalent-family ((๐ค ฬ) , id) univalent-universe-is-univalent-family X = singletons-are-props (equiv-to-singleton (I X) (singleton-types-are-singletons X)) where I : (X : ๐ค ฬ) โ (ฮฃ Y ๊ ๐ค ฬ , X โ Y) โ (ฮฃ Y ๊ ๐ค ฬ , X ๏ผ Y) I X = ฮฃ-cong (ฮป - โ โ-sym (univalence-โ ua X -)) universe-univalent-refl-graph : Univalent-Refl-Graph (๐ค โบ) ๐ค universe-univalent-refl-graph = (universe-refl-graph ๐ค , univalent-universe-is-univalent-family)