UnivalentClosureProperties
Ian Ray. 28th August 2025. Minor changes and merged into TypeToplogy in March 2026. We observe some closure properties of univalent reflexive graphs (see index for references to Sterling, Buchholtz, etc.){-# OPTIONS --safe --without-K #-} module ReflexiveGraphs.UnivalentClosureProperties where open import MLTT.Spartan open import UF.Equiv open import UF.EquivalenceExamples open import UF.FunExt open import UF.PropIndexedPiSigma open import UF.Powerset-MultiUniverse open import UF.Subsingletons open import UF.Subsingletons-FunExt open import ReflexiveGraphs.Constructions open import ReflexiveGraphs.Displayed open import ReflexiveGraphs.DisplayedUnivalent open import ReflexiveGraphs.Type open import ReflexiveGraphs.UnivalentConceptually, showing that a total reflexive graph is univalent when the base reflexive graph and the displayed reflexive graph over it are both univalent is easy enough. Let (x,y) be a term of β¨ π οΉ π β©, that is x : β¨ π β© and y : βͺ π β« x. By the definition of univalence it suffices to show that any two fans of (x,y) are equal. If we unpack the definition of a fan of the total reflexive graph π οΉ π we get the following data: terms xβ, xβ : β¨ π β© with edges pβ : x ββ¨ π β© xβ and pβ : x ββ¨ π β© xβ and terms yβ : βͺ π β« xβ and yβ : βͺ π β« xβ with displayed edges qβ : y ββ¨ π βΈ΄ pβ β© yβ and qβ : y ββ¨ π βΈ΄ pβ β© yβ. So we must show ((xβ , yβ) , (pβ , qβ)) οΌ ((xβ , yβ) , (pβ , qβ)). As π is univalent the edges pβ and pβ are contractible and it suffices to show ((x , yβ) , (β-refl , qβ)) οΌ ((x , yβ) , (β-refl , qβ)). Now yβ and yβ are in the same fiber βͺ π β« x so by univalence of π the displayed edges qβ and qβ are contractible and it suffices to show ((x , y) , (β-refl , β-disp-refl)) οΌ ((x , y) , (β-refl , β-disp-refl)) which holds by refl. There are two important steps in this proof where we 'contract away' edges using the univalence assumption, and the latter step depends on the former. So we will record these steps in two lemmas. Note the essential use of the file PropIndexedPiSigma.lagda.total-component-fans-prop-lemma : (π : Refl-Graph π€ π₯) (π : Displayed-Refl-Graph π£ π¦ π) β is-displayed-univalent-refl-graph π π β (x : β¨ π β©) (y : βͺ π β« x) β ((yβ , qβ) (yβ , qβ) : fan ([ π ] x) y) β ((x , yβ) , (β-refl π x , qβ)) οΌ[ fan (π οΉ π) (x , y) ] ((x , yβ) , (β-refl π x , qβ)) total-component-fans-prop-lemma π π ua-π x y = Ξ -projβ»ΒΉ (y , β-refl ([ π ] x) y) (ua-π x y) (Ξ -projβ»ΒΉ (y , β-refl ([ π ] x) y) (ua-π x y) refl) total-fans-prop-lemma : (π : Refl-Graph π€ π₯) (π : Displayed-Refl-Graph π£ π¦ π) β is-univalent-refl-graph π β is-displayed-univalent-refl-graph π π β (x : β¨ π β©) (y : βͺ π β« x) β ((xβ , pβ) (xβ , pβ) : fan π x) β (yβ : βͺ π β« xβ) (qβ : y ββ¨ π βΈ΄ pβ β© yβ) β (yβ : βͺ π β« xβ) (qβ : y ββ¨ π βΈ΄ pβ β© yβ) β ((xβ , yβ) , (pβ , qβ)) οΌ[ fan (π οΉ π) (x , y) ] ((xβ , yβ) , (pβ , qβ)) total-fans-prop-lemma π π ua-π ua-π x y = Ξ -projβ»ΒΉ (x , β-refl π x) (ua-π x) (Ξ -projβ»ΒΉ (x , β-refl π x) (ua-π x) (Ξ» yβ qβ yβ qβ β total-component-fans-prop-lemma π π ua-π x y (yβ , qβ) (yβ , qβ))) univalence-closed-under-total : (π : Refl-Graph π€ π₯) (π : Displayed-Refl-Graph π£ π¦ π) β is-univalent-refl-graph π β is-displayed-univalent-refl-graph π π β is-univalent-refl-graph (π οΉ π) univalence-closed-under-total π π ua-π ua-π (x , y) ((xβ , yβ) , (pβ , qβ)) ((xβ , yβ) , (pβ , qβ)) = total-fans-prop-lemma π π ua-π ua-π x y (xβ , pβ) (xβ , pβ) yβ qβ yβ qβThe remaining closure conditions are relatively straightforward.univalence-closed-under-op : (π : Refl-Graph π€ π₯) β is-univalent-refl-graph π β is-univalent-refl-graph (π α΅α΅) univalence-closed-under-op π π-ua = prop-fan-to-cofan π π-ua univalence-closed-under-op-op : (π : Refl-Graph π€ π₯) β is-univalent-refl-graph (π α΅α΅) β is-univalent-refl-graph π univalence-closed-under-op-op π = univalence-closed-under-op (π α΅α΅) univalence-closed-under-constant : (π : Refl-Graph π€ π₯) β (π : Refl-Graph π€' π₯') β is-univalent-refl-graph π β is-displayed-univalent-refl-graph π (π * π) univalence-closed-under-constant π π ua-π x = ua-π univalence-closed-under-Γ : (π : Refl-Graph π€ π₯) (π' : Refl-Graph π€' π₯') β is-univalent-refl-graph π β is-univalent-refl-graph π' β is-univalent-refl-graph (π β π') univalence-closed-under-Γ π π' ua-π ua-π' = univalence-closed-under-total π (π * π') ua-π (univalence-closed-under-constant π π' ua-π') univalence-closed-under-Ξ : Fun-Ext β (A : π€' Μ) (π : A β Refl-Graph π€ π₯) β ((x : A) β is-univalent-refl-graph (π x)) β is-univalent-refl-graph (β x ΛΈ A , (π x)) univalence-closed-under-Ξ fe A π ua-π = III where I : (f : β¨ β x ΛΈ A , (π x) β©) β fan (β x ΛΈ A , (π x)) f β ((x : A) β fan (π x) (f x)) I f = fan (β x ΛΈ A , (π x)) f ββ¨reflβ© (Ξ£ g κ β¨ β x ΛΈ A , (π x) β© , f ββ¨ β x ΛΈ A , (π x) β© g) ββ¨reflβ© (Ξ£ g κ β¨ β x ΛΈ A , (π x) β© , ((x : A) β f x ββ¨ π x β© g x)) ββ¨ II β© ((x : A) β Ξ£ v κ β¨ π x β© , f x ββ¨ π x β© v) ββ¨reflβ© ((x : A) β fan (π x) (f x)) β where II = β-sym Ξ Ξ£-distr-β III : (f : β¨ β x ΛΈ A , (π x) β©) β is-prop (fan (β x ΛΈ A , (π x)) f) III f = equiv-to-prop (I f) (Ξ -is-prop fe (Ξ» x β ua-π x (f x))) univalence-closed-under-cotensor : Fun-Ext β (A : π€' Μ) (π : Refl-Graph π€ π₯) β is-univalent-refl-graph π β is-univalent-refl-graph (A β π) univalence-closed-under-cotensor fe A π ua-π = univalence-closed-under-Ξ fe A (Ξ» - β π) (Ξ» - β ua-π) univalence-closed-under-Ξ£ : (A : π€' Μ) (π : A β Refl-Graph π€ π₯) β ((x : A) β is-univalent-refl-graph (π x)) β is-univalent-refl-graph (β x ΛΈ A , (π x)) univalence-closed-under-Ξ£ A π ua-π (x , y) ((.x , yβ) , refl , qβ) ((.x , yβ) , refl , qβ) = II (yβ , qβ) (yβ , qβ) where I = fan (β x ΛΈ A , (π x)) (x , y) II : ((y' , q') (y'' , q'') : fan (π x) y) β ((x , y') , (refl , q')) οΌ[ I ] ((x , y'') , (refl , q'')) II = Ξ -projβ»ΒΉ (y , β-refl (π x) y) (ua-π x y) (Ξ -projβ»ΒΉ (y , β-refl (π x) y) (ua-π x y) refl) univalence-closed-under-tensor : (A : π€' Μ) (π : Refl-Graph π€ π₯) β is-univalent-refl-graph π β is-univalent-refl-graph (β _ ΛΈ A , π) univalence-closed-under-tensor A π ua-π = univalence-closed-under-Ξ£ A (Ξ» - β π) (Ξ» - β ua-π) discrete-refl-graph-is-univalent : (A : π€' Μ) β is-univalent-refl-graph (Ξ A) discrete-refl-graph-is-univalent A x = singletons-are-props (singleton-types-are-singletons x) codiscrete-refl-graph-is-univalent-when-prop : (A : π€' Μ) β is-prop A β is-univalent-refl-graph (codiscrete-reflexive-graph A) codiscrete-refl-graph-is-univalent-when-prop A A-prop x (x' , β) (y' , β) = ap (Ξ» - β (- , β)) (A-prop x' y') codiscrete-refl-graph-is-univalent-implies-prop : (A : π€' Μ) β is-univalent-refl-graph (codiscrete-reflexive-graph A) β is-prop A codiscrete-refl-graph-is-univalent-implies-prop A ua-codis-A x y = ap prβ (ua-codis-A x (x , β) (y , β)) univalence-closed-under-subgraph : (π : Refl-Graph π€ π₯) β (S : π {π£} β¨ π β©) β is-univalent-refl-graph π β is-univalent-refl-graph (x βΆ π β£ S x) univalence-closed-under-subgraph π S ua-π (x , s) ((x' , r) , p) ((y' , t) , q) = I (ua-π x (x , β-refl π x) (x' , p)) (ua-π x (x , β-refl π x) (y' , q)) where I : ((x , β-refl π x) οΌ (x' , p)) β ((x , β-refl π x) οΌ (y' , q)) β ((x' , r) , p) οΌ ((y' , t) , q) I refl refl = ap (Ξ» - β ((x , -) , β-refl π x)) (β-is-prop S x r t)