Martin Escardo December 2018. The lifting of a type forms a univalent pre-β-category with hom types l β m, which is a partial order if the type is a set. At the moment we don't have categories in this development, but this doesn't prevent us from giving this particular example of a univalent category. \begin{code} {-# OPTIONS --safe --without-K #-} open import MLTT.Spartan module Lifting.UnivalentPrecategory (π£ : Universe) {π€ : Universe} (X : π€ Μ ) where open import Lifting.IdentityViaSIP π£ open import Lifting.Construction π£ open import UF.Base open import UF.Equiv open import UF.Equiv-FunExt open import UF.EquivalenceExamples open import UF.FunExt open import UF.Lower-FunExt open import UF.Sets open import UF.Subsingletons open import UF.Subsingletons-FunExt open import UF.UA-FunExt open import UF.Univalence \end{code} We define l β m to mean that if l is defined then so is m with the same value. Here the suffix "-pr" standands for preservation (and also for projection!). \begin{code} _β_ : π X β π X β π€ β π£ Μ l β m = Ξ£ f κ (is-defined l β is-defined m) , value l βΌ value m β f def-pr : (l m : π X) β l β m β (is-defined l β is-defined m) def-pr l m = prβ val-pr : (l m : π X) (Ξ± : l β m) β value l βΌ value m β (def-pr l m Ξ±) val-pr l m = prβ dom : {l m : π X} β l β m β π X dom {l} {m} Ξ± = l cod : {l m : π X} β l β m β π X cod {l} {m} Ξ± = m π-id : (l : π X) β l β l π-id l = id , (Ξ» x β refl) π-Id-to-arrow : (l m : π X) β l οΌ m β l β m π-Id-to-arrow l l refl = π-id l π-comp : (l m n : π X) β l β m β m β n β l β n π-comp l m n (f , Ξ΄) (g , Ξ΅) = g β f , (Ξ» p β Ξ΄ p β Ξ΅ (f p)) π-comp-unit-right : (l m : π X) (Ξ± : l β m) β π-comp l m m Ξ± (π-id m) οΌ Ξ± π-comp-unit-right l m Ξ± = refl π-comp-unit-left : funext π£ π€ β (l m : π X) (Ξ± : l β m) β π-comp l l m (π-id l) Ξ± οΌ Ξ± π-comp-unit-left fe l m Ξ± = to-Ξ£-οΌ (refl , dfunext fe Ξ» p β refl-left-neutral) π-comp-assoc : funext π£ π€ β {l m n o : π X} (Ξ± : l β m) (Ξ² : m β n) (Ξ³ : n β o) β π-comp l n o (π-comp l m n Ξ± Ξ²) Ξ³ οΌ π-comp l m o Ξ± (π-comp m n o Ξ² Ξ³) π-comp-assoc fe (f , Ξ΄) (g , Ξ΅) (h , ΞΆ) = to-Ξ£-οΌ (refl , dfunext fe (Ξ» p β βassoc (Ξ΄ p) (Ξ΅ (f p)) (ΞΆ (g (f p))))) \end{code} Thus, the associativity law in this pre-β-category is that of function composition in the first component (where it hence holds definitionally) and that of path composition in the first component. (Hence this pre-β-category should qualify as an β-category, with all coherence laws satisfied automatically, except that there is at present no definition of β-category in univalent type theory.) If X is a set, then _β_ is a partial order: \begin{code} β-prop-valued : funext π£ π£ β funext π£ π€ β is-set X β (l m : π X) β is-prop (l β m) β-prop-valued fe fe' s l m (f , Ξ΄) (g , Ξ΅) = to-Ξ£-οΌ (dfunext fe (Ξ» p β being-defined-is-prop m (f p) (g p)) , Ξ -is-prop fe' (Ξ» d β s) _ Ξ΅) \end{code} TODO. This order is directed complete (easy). We should also do least fixed points of continuous maps. This TODO was implemented by Tom de Jong in the file DomainTheory.Lifting.LiftingSet.lagda. Next we show that for any l : π X, fiber Ξ· l β is-defined l, using the fact that the fiber is a proposition by virtue of Ξ· being an embedding. \begin{code} β-anti-lemma : propext π£ β funext π£ π£ β funext π£ π€ β {l m : π X} β l β m β (is-defined m β is-defined l) β l οΌ m β-anti-lemma pe fe fe' {Q , Ο , j} {P , Ο , i} (f , Ξ΄) g = e where Ξ΅ : (p : P) β Ο (g p) οΌ Ο p Ξ΅ p = Ξ΄ (g p) β ap Ο (i (f (g p)) p) a : Q οΌ P a = pe j i f g b : Idtofun (a β»ΒΉ) οΌ g b = dfunext fe (Ξ» p β j (Idtofun (a β»ΒΉ) p) (g p)) c : transport (Ξ» - β (- β X) Γ is-prop -) a (Ο , j) οΌ[ (P β X) Γ is-prop P ] (transport (Ξ» - β - β X) a Ο , transport is-prop a j) c = transport-Γ (Ξ» - β - β X) is-prop a d = prβ (transport (Ξ» - β (- β X) Γ is-prop -) a (Ο , j)) οΌβ¨ I β© transport (Ξ» - β - β X) a Ο οΌβ¨ II β© Ο β Idtofun (a β»ΒΉ) οΌβ¨ III β© Ο β g οΌβ¨ IV β© Ο β where I = ap prβ c II = transport-is-pre-comp a Ο III = ap (Ξ» - β Ο β -) b IV = dfunext fe' Ξ΅ e : Q , Ο , j οΌ P , Ο , i e = to-Ξ£-οΌ (a , to-Γ-οΌ d (being-prop-is-prop fe _ i)) β-anti : propext π£ β funext π£ π£ β funext π£ π€ β {l m : π X} β (l β m) Γ (m β l) β l οΌ m β-anti pe fe fe' ((f , Ξ΄) , (g , Ξ΅)) = β-anti-lemma pe fe fe' (f , Ξ΄) g \end{code} We can now establish the promised fact: \begin{code} open import Lifting.EmbeddingDirectly π£ Ξ·-fiber-same-as-is-defined : propext π£ β funext π£ π£ β funext π£ π€ β funext π€ (π£ βΊ β π€) β (l : π X) β (Ξ£ x κ X , Ξ· x οΌ l) β is-defined l Ξ·-fiber-same-as-is-defined pe fe fe' fe'' l = qinveq (f l) (g l , gf , fg) where f : (l : π X) β fiber Ξ· l β is-defined l f (.π , .(Ξ» _ β x) , .π-is-prop) (x , refl) = β g : (l : π X) β is-defined l β fiber Ξ· l g (P , Ο , i) p = Ο p , β-anti pe fe fe' (a , b) where a : Ξ· (Ο p) β (P , Ο , i) a = (Ξ» _ β p) , (Ξ» _ β refl) b : (P , Ο , i) β Ξ· (Ο p) b = (Ξ» _ β β) , (Ξ» q β ap Ο (i q p)) fg : (d : is-defined l) β f l (g l d) οΌ d fg d = being-defined-is-prop l (f l (g l d)) d gf : (z : fiber Ξ· l) β g l (f l z) οΌ z gf z = Ξ·-is-embedding pe fe fe' fe'' l (g l (f l z)) z \end{code} They can't be equal, in the absence of cumulativity (and propositional resizing), as the lhs lives in a universe higher than the rhs, and equality is well-typed only for elements of the same type (here of the same universe). This can be seen by adding type annotations to the formulation of the above equivalence: \begin{code} private Ξ·-fiber-same-as-is-defined' : propext π£ β funext π£ π£ β funext π£ π€ β funext π€ (π£ βΊ β π€) β (l : π X) β (fiber Ξ· l βΆ π£ βΊ β π€ Μ ) β (is-defined l βΆ π£ Μ ) Ξ·-fiber-same-as-is-defined' = Ξ·-fiber-same-as-is-defined \end{code} For no choice of universes π€ and π£ can we have π£ βΊ β π€ to coincide with π£. However, for some dominances other than is-prop, it is possible to have the equality between the fiber of l and the definedness of l. The following simplified proof of β-anti uses the SIP via the construction of _βΒ·_ in another module: \begin{code} β-anti-sip : is-univalent π£ β funext π£ π€ β {l m : π X} β (l β m) Γ (m β l) β l οΌ m β-anti-sip ua fe {Q , Ο , j} {P , Ο , i} ((f , Ξ΄) , (g , Ξ΅)) = β π-IdΒ· ua fe (Q , Ο , j) (P , Ο , i) ββ»ΒΉ Ξ³ where e : Q β P e = f , ((g , (Ξ» p β i (f (g p)) p)) , (g , (Ξ» q β j (g (f q)) q))) Ξ³ : (Q , Ο , j) βΒ· (P , Ο , i) Ξ³ = e , Ξ΄ \end{code} Could the map (anti l m) be an equivalence? No. We instead have an equivalence (l β m) Γ (m β l) β (l οΌ m) Γ (l οΌ m), reflecting the fact that there are two candidate proofs for the equality. \begin{code} to-βΒ· : (l m : π X) β (l β m) Γ (is-defined m β is-defined l) β (l βΒ· m) to-βΒ· (Q , Ο , j) (P , Ο , i) ((f , Ξ΄) , g) = (f , ((g , (Ξ» p β i (f (g p)) p)) , (g , (Ξ» q β j (g (f q)) q)))) , Ξ΄ from-βΒ· : (l m : π X) β (l βΒ· m) β (l β m) Γ (is-defined m β is-defined l) from-βΒ· l m (f , g) = (β f β , g) , β f ββ»ΒΉ from-to-βΒ· : (l m : π X) β from-βΒ· l m β to-βΒ· l m βΌ id from-to-βΒ· l m e = refl to-from : funext π£ π£ β (l m : π X) β to-βΒ· l m β from-βΒ· l m βΌ id to-from fe l m π@((f , Ξ΄) , g) = b where Ξ΄' : is-equiv f Ξ΄' = β is-defined-βΒ· l m (to-βΒ· l m (from-βΒ· l m π)) β-is-equiv a : Ξ΄' οΌ Ξ΄ a = being-equiv-is-prop'' fe f Ξ΄' Ξ΄ b : (f , Ξ΄') , g οΌ (f , Ξ΄) , g b = ap (Ξ» - β (f , -) , g) a β-anti-equiv-lemma'' : funext π£ π£ β (l m : π X) β is-equiv (to-βΒ· l m) β-anti-equiv-lemma'' fe l m = qinvs-are-equivs (to-βΒ· l m) (from-βΒ· l m , from-to-βΒ· l m , to-from fe l m) β-anti-equiv-lemma' : funext π£ π£ β (l m : π X) β (l β m) Γ (is-defined m β is-defined l) β (l βΒ· m) β-anti-equiv-lemma' fe l m = to-βΒ· l m , β-anti-equiv-lemma'' fe l m β-anti-equiv-lemma : is-univalent π£ β funext π£ π€ β (l m : π X) β (l β m) Γ (is-defined m β is-defined l) β (l οΌ m) β-anti-equiv-lemma ua fe l m = (β-anti-equiv-lemma' (univalence-gives-funext ua) l m) β (β-sym (π-IdΒ· ua fe l m)) β-anti-equiv : is-univalent π£ β funext π£ π€ β (l m : π X) β (l β m) Γ (m β l) β (l οΌ m) Γ (m οΌ l) β-anti-equiv ua fe l m = Ξ³ β (Γ-cong (β-anti-equiv-lemma ua fe l m) (β-anti-equiv-lemma ua fe m l)) where A = (l β m) Γ (m β l) B = ((l β m) Γ (is-defined m β is-defined l)) Γ ((m β l) Γ (is-defined l β is-defined m)) Ξ³ : A β B Ξ³ = qinveq u (v , vu , uv) where u : A β B u ((f , Ξ΄) , (g , Ξ΅)) = ((f , Ξ΄) , g) , ((g , Ξ΅) , f) v : B β A v (((f , Ξ΄) , h) , ((g , Ξ΅) , k)) = (f , Ξ΄) , (g , Ξ΅) vu : (a : A) β v (u a) οΌ a vu a = refl uv : (b : B) β u (v b) οΌ b uv (((f , Ξ΄) , h) , ((g , Ξ΅) , k)) = t where r : g οΌ h r = dfunext (univalence-gives-funext ua) (Ξ» p β being-defined-is-prop l (g p) (h p)) s : f οΌ k s = dfunext (univalence-gives-funext ua) (Ξ» p β being-defined-is-prop m (f p) (k p)) t : ((f , Ξ΄) , g) , (g , Ξ΅) , f οΌ ((f , Ξ΄) , h) , (g , Ξ΅) , k t = apβ (Ξ» -β -β β ((f , Ξ΄) , -β) , (g , Ξ΅) , -β) r s \end{code} Next we show that (l β m) β (is-defined l β l οΌ m), so that elements of l β m can be seen as partial elements of the identity type l οΌ m. We begin with the following auxiliary construction, which shows that the type l β m is modal for the open modality induced by the proposition "is-defined l" (and gave me a headache): \begin{code} β-open : funext π£ π£ β funext π£ (π£ β π€) β (l m : π X) β (l β m) β (is-defined l β l β m) β-open fe fe'' (Q , Ο , j) (P , Ο , i) = qinveq Ο (Ο , ΟΟ , ΟΟ) where l = (Q , Ο , j) m = (P , Ο , i) Ο : l β m β (is-defined l β l β m) Ο Ξ± d = Ξ± Ο : (is-defined l β l β m) β l β m Ο h = (Ξ» d β def-pr l m (h d) d) , (Ξ» d β val-pr l m (h d) d) ΟΟ : Ο β Ο βΌ id ΟΟ Ξ± = refl Ο-lemma : (h : is-defined l β l β m) (q : is-defined l) β Ο h οΌ h q Ο-lemma h q = Ξ³ where remark : h q οΌ def-pr l m (h q) , val-pr l m (h q) remark = refl k : (d : Q) β def-pr l m (h d) d οΌ def-pr l m (h q) d k d = ap (Ξ» - β def-pr l m (h -) d) (j d q) a : (Ξ» d β def-pr l m (h d) d) οΌ def-pr l m (h q) a = dfunext fe k u : (d : Q) {f g : Q β P} (k : f βΌ g) β ap (Ξ» (- : Q β P) β Ο (- d)) (dfunext fe k) οΌ ap Ο (k d) u d {f} {g} k = ap-funext f g Ο k fe d v : (d : Q) β val-pr l m (h d) d β ap (Ξ» - β Ο (- d)) a οΌ val-pr l m (h q) d v d = val-pr l m (h d) d β ap (Ξ» - β Ο (- d)) a οΌβ¨ I β© val-pr l m (h d) d β ap Ο (ap (Ξ» - β def-pr l m (h -) d) (j d q)) οΌβ¨ II β© val-pr l m (h d) d β ap (Ξ» - β Ο (def-pr l m (h -) d)) (j d q) οΌβ¨ III β© ap (Ξ» _ β Ο d) (j d q) β val-pr l m (h q) d οΌβ¨ IV β© refl β val-pr l m (h q) d οΌβ¨ V β© val-pr l m (h q) d β where I = ap (Ξ» - β val-pr l m (h d) d β -) (u d k) II = ap (Ξ» - β val-pr l m (h d) d β -) (ap-ap (Ξ» - β def-pr l m (h -) d) Ο (j d q)) III = homotopies-are-natural (Ξ» _ β Ο d) (Ξ» - β Ο (def-pr l m (h -) d)) (Ξ» - β val-pr l m (h -) d) {d} {q} {j d q} IV = ap (Ξ» - β - β val-pr l m (h q) d) (ap-const (Ο d) (j d q)) V = refl-left-neutral t : {f g : Q β P} (r : f οΌ g) (h : Ο βΌ Ο β f) β transport (Ξ» - β Ο βΌ Ο β -) r h οΌ Ξ» q β h q β ap (Ξ» - β Ο (- q)) r t refl h = refl b = transport (Ξ» - β Ο βΌ Ο β -) a (Ξ» d β val-pr l m (h d) d) οΌβ¨ I β© (Ξ» d β val-pr l m (h d) d β ap (Ξ» - β Ο (- d)) a) οΌβ¨ II β© val-pr l m (h q) β where I = t a (Ξ» d β val-pr l m (h d) d) II = dfunext (lower-funext π£ π£ fe'') v Ξ³ : (Ξ» d β def-pr l m (h d) d) , (Ξ» d β val-pr l m (h d) d) οΌ h q Ξ³ = to-Ξ£-οΌ (a , b) ΟΟ : Ο β Ο βΌ id ΟΟ h = dfunext fe'' (Ο-lemma h) \end{code} Using this we have the following, as promised: \begin{code} β-in-terms-of-οΌ : is-univalent π£ β funext π£ (π£ βΊ β π€) β (l m : π X) β (l β m) β (is-defined l β l οΌ m) β-in-terms-of-οΌ ua feβΊ l m = l β m ββ¨ a β© (is-defined l β l β m) ββ¨ b β© ((is-defined l β l β m) Γ π) ββ¨ c β© (is-defined l β l β m) Γ (is-defined l β is-defined m β is-defined l) ββ¨ d β© (is-defined l β (l β m) Γ (is-defined m β is-defined l)) ββ¨ e β© (is-defined l β l οΌ m) β where fe : funext π£ π£ fe = univalence-gives-funext ua s : (is-defined l β is-defined m β is-defined l) β π {π€} s = singleton-β-π ((Ξ» d e β d) , Ξ -is-prop fe (Ξ» d β Ξ -is-prop fe (Ξ» e β being-defined-is-prop l)) (Ξ» d e β d)) a = β-open fe (lower-funext π£ ((π£ βΊ) β π€) feβΊ) l m b = β-sym π-rneutral c = Γ-cong (β-refl _) (β-sym s) d = β-sym Ξ Ξ£-distr-β e = βcong feβΊ (lower-funext π£ ((π£ βΊ) β π€) feβΊ) (β-refl (is-defined l)) (β-anti-equiv-lemma ua (lower-funext π£ ((π£ βΊ) β π€) feβΊ) l m) \end{code} And we also get the promised map l β m β π (l οΌ m) that regards elements of hom-type l β m as partial element of identity the type l οΌ m. (Conjectural conjecture: this map is an embedding.) TODO. This map should be an embedding. \begin{code} β-lift : is-univalent π£ β funext π£ (π£ βΊ β π€) β (l m : π X) β l β m β π (l οΌ m) β-lift ua fe l m Ξ± = is-defined l , β β-in-terms-of-οΌ ua fe l m β Ξ± , being-defined-is-prop l \end{code} We now show that the pre-β-category π X is univalent if the universe π£ is univalent and we have enough function extensionality for π£ and π€. \begin{code} π-pre-comp-with : (l m : π X) β l β m β (n : π X) β m β n β l β n π-pre-comp-with l m Ξ± n = π-comp l m n Ξ± is-π-equiv : (l m : π X) β l β m β π£ βΊ β π€ Μ is-π-equiv l m Ξ± = (n : π X) β is-equiv (π-pre-comp-with l m Ξ± n) being-π-equiv-is-prop : funext (π£ βΊ β π€) (π£ β π€) β (l m : π X) (Ξ± : l β m) β is-prop (is-π-equiv l m Ξ±) being-π-equiv-is-prop fe l m Ξ± = Ξ -is-prop fe (Ξ» n β being-equiv-is-prop'' (lower-funext (π£ βΊ) π€ fe) (π-pre-comp-with l m Ξ± n)) is-π-equivβ : (l m : π X) (Ξ± : l β m) β is-π-equiv l m Ξ± β is-equiv (def-pr l m Ξ±) is-π-equivβ l m Ξ± e = qinvs-are-equivs (def-pr l m Ξ±) (def-pr m l Ξ² , (Ξ» p β being-defined-is-prop l (def-pr m l Ξ² (def-pr l m Ξ± p)) p) , (Ξ» q β being-defined-is-prop m (def-pr l m Ξ± (def-pr m l Ξ² q)) q)) where u : m β l β l β l u = π-pre-comp-with l m Ξ± l Ξ² : m β l Ξ² = inverse u (e l) (π-id l) is-π-equivβ : propext π£ β funext π£ π£ β funext π£ π€ β (l m : π X) (Ξ± : l β m) β is-equiv (def-pr l m Ξ±) β is-π-equiv l m Ξ± is-π-equivβ pe fe fe' l m Ξ± e = Ξ³ where r : l οΌ m r = β-anti-lemma pe fe fe' Ξ± (inverse (def-pr l m Ξ±) e) Ο : (l n : π X) (Ξ± : l β l) β def-pr l l Ξ± οΌ id β Ξ£ Ξ΄ κ ((q : is-defined l) β value l q οΌ value l q) , π-pre-comp-with l l Ξ± n βΌ Ξ» Ξ² β (def-pr l n Ξ² , (Ξ» q β Ξ΄ q β val-pr l n Ξ² q)) Ο l n (.id , Ξ΄) refl = Ξ΄ , Ξ» Ξ² β refl Ο : (l : π X) (Ξ± : l β l) β is-equiv (def-pr l l Ξ±) β is-π-equiv l l Ξ± Ο l Ξ± e n = equiv-closed-under-βΌ u (π-pre-comp-with l l Ξ± n) i h where s : def-pr l l Ξ± οΌ id s = dfunext fe (Ξ» q β being-defined-is-prop l (def-pr l l Ξ± q) q) Ξ΄ : (q : is-defined l) β value l q οΌ value l q Ξ΄ = prβ (Ο l n Ξ± s) u : l β n β l β n u Ξ² = def-pr l n Ξ² , Ξ» q β Ξ΄ q β val-pr l n Ξ² q h : π-pre-comp-with l l Ξ± n βΌ u h = prβ (Ο l n Ξ± s) v : l β n β l β n v Ξ³ = def-pr l n Ξ³ , (Ξ» p β (Ξ΄ p)β»ΒΉ β val-pr l n Ξ³ p) vu : v β u βΌ id vu (g , Ξ΅) = to-Ξ£-οΌ (refl , dfunext fe' a) where a : (q : is-defined l) β (Ξ΄ q)β»ΒΉ β (Ξ΄ q β Ξ΅ q) οΌ Ξ΅ q a q = (Ξ΄ q)β»ΒΉ β (Ξ΄ q β Ξ΅ q) οΌβ¨ I β© ((Ξ΄ q)β»ΒΉ β Ξ΄ q) β Ξ΅ q οΌβ¨ II β© refl β Ξ΅ q οΌβ¨ III β© Ξ΅ q β where I = (βassoc ((Ξ΄ q)β»ΒΉ) (Ξ΄ q) (Ξ΅ q))β»ΒΉ II = ap (Ξ» - β - β Ξ΅ q) ((sym-is-inverse (Ξ΄ q))β»ΒΉ) III = refl-left-neutral uv : u β v βΌ id uv (g , Ξ΅) = to-Ξ£-οΌ (refl , dfunext fe' a) where a : (q : is-defined l) β Ξ΄ q β ((Ξ΄ q)β»ΒΉ β Ξ΅ q) οΌ Ξ΅ q a q = Ξ΄ q β ((Ξ΄ q)β»ΒΉ β Ξ΅ q) οΌβ¨ I β© (Ξ΄ q β ((Ξ΄ q)β»ΒΉ)) β Ξ΅ q οΌβ¨ II β© refl β Ξ΅ q οΌβ¨ III β© Ξ΅ q β where I = (βassoc (Ξ΄ q) ((Ξ΄ q)β»ΒΉ) (Ξ΅ q))β»ΒΉ II = ap (Ξ» - β - β Ξ΅ q) ((sym-is-inverse' (Ξ΄ q))β»ΒΉ) III = refl-left-neutral i : is-equiv u i = qinvs-are-equivs u (v , vu , uv) Ο : (l m : π X) β l οΌ m β (Ξ± : l β m) β is-equiv (def-pr l m Ξ±) β is-π-equiv l m Ξ± Ο l .l refl = Ο l Ξ³ : is-π-equiv l m Ξ± Ξ³ = Ο l m r Ξ± e \end{code} With this and Yoneda we can now easily derive the univalence of the pre-β-category π X. The univalence of π£ is more than we need in the following. Propositional extensionality for propositions in π£ suffices, but the way we proved this using a general SIP relies on univalence (we could prove a specialized version of the SIP, but this is probably not worth the trouble (we'll see)). \begin{code} module univalence-of-π (ua : is-univalent π£) (fe : Fun-Ext) where pe : propext π£ pe = univalence-gives-propext ua is-π-equiv-charac : (l m : π X) (Ξ± : l β m) β is-π-equiv l m Ξ± β (is-defined m β is-defined l) is-π-equiv-charac l m Ξ± = is-π-equiv l m Ξ± ββ¨ a β© is-equiv (def-pr l m Ξ±) ββ¨ b β© (is-defined m β is-defined l) β where a = logically-equivalent-props-are-equivalent (being-π-equiv-is-prop fe l m Ξ±) (being-equiv-is-prop'' fe (def-pr l m Ξ±)) (is-π-equivβ l m Ξ±) (is-π-equivβ pe fe fe l m Ξ±) b = logically-equivalent-props-are-equivalent (being-equiv-is-prop'' fe (def-pr l m Ξ±)) (Ξ -is-prop fe (Ξ» p β being-defined-is-prop l)) (inverse (def-pr l m Ξ±)) (Ξ» g β qinvs-are-equivs (def-pr l m Ξ±) (g , (Ξ» q β being-defined-is-prop l (g (def-pr l m Ξ± q)) q) , (Ξ» p β being-defined-is-prop m (def-pr l m Ξ± (g p)) p))) _ββ¨πβ©_ : π X β π X β π£ βΊ β π€ Μ l ββ¨πβ© m = Ξ£ Ξ± κ l β m , is-π-equiv l m Ξ± ββ¨πβ©-charac : (l m : π X) β (l ββ¨πβ© m) β (l β m) Γ (is-defined m β is-defined l) ββ¨πβ©-charac l m = Ξ£-cong (is-π-equiv-charac l m) ββ¨πβ©-is-Id : (l m : π X) β (l ββ¨πβ© m) β (l οΌ m) ββ¨πβ©-is-Id l m = (ββ¨πβ©-charac l m) β (β-anti-equiv-lemma ua fe l m) π-is-univalent' : (l : π X) β β! m κ π X , (l ββ¨πβ© m) π-is-univalent' l = equiv-to-singleton e (singleton-types-are-singletons l) where e : (Ξ£ m κ π X , l ββ¨πβ© m) β (Ξ£ m κ π X , l οΌ m) e = Ξ£-cong (ββ¨πβ©-is-Id l) π-id-is-π-equiv : (l : π X) β is-π-equiv l l (π-id l) π-id-is-π-equiv l n = (id , h) , (id , h) where h : π-pre-comp-with l l (π-id l) n βΌ id h (f , Ξ΄) = to-Ξ£-οΌ (refl , dfunext fe (Ξ» p β refl-left-neutral)) π-refl : (l : π X) β l ββ¨πβ© l π-refl l = π-id l , π-id-is-π-equiv l Id-to-π-eq : (l m : π X) β l οΌ m β l ββ¨πβ© m Id-to-π-eq l m r = transport (l ββ¨πβ©_) r (π-refl l) π-is-univalent : (l m : π X) β is-equiv (Id-to-π-eq l m) π-is-univalent l = universality-equiv l (π-refl l) (central-point-is-universal (l ββ¨πβ©_) (l , π-refl l) (singletons-are-props (π-is-univalent' l) (l , π-refl l))) where open import UF.Yoneda \end{code} This completes the main goal of the module. We have yet another equivalence, using the above techniques: \begin{code} Ξ·-maximal' : (x : X) (l : π X) β Ξ· x β l β l β Ξ· x Ξ·-maximal' x (P , Ο , i) (f , Ξ΄) = (Ξ» p β β) , (Ξ» p β ap Ο (i p (f β)) β (Ξ΄ β)β»ΒΉ) Ξ·-maximal : propext π£ β funext π£ π£ β funext π£ π€ β (x : X) (l : π X) β Ξ· x β l β Ξ· x οΌ l Ξ·-maximal pe fe fe' x l a = β-anti pe fe fe' (a , Ξ·-maximal' x l a) β₯-least : (l : π X) β β₯ β l β₯-least l = unique-from-π , Ξ» z β unique-from-π z β₯-initial : funext π£ π£ β funext π£ π€ β (l : π X) β is-singleton (β₯ β l) β₯-initial fe fe' l = β₯-least l , (Ξ» Ξ± β to-Ξ£-οΌ (dfunext fe (Ξ» z β unique-from-π z) , dfunext fe'(Ξ» z β unique-from-π z))) Ξ·-οΌ-gives-β : {x y : X} β x οΌ y β Ξ· x β Ξ· y Ξ·-οΌ-gives-β {x} {y} p = id , (Ξ» d β p) Ξ·-β-gives-οΌ : {x y : X} β Ξ· x β Ξ· y β x οΌ y Ξ·-β-gives-οΌ (f , Ξ΄) = Ξ΄ β Ξ·-οΌ-gives-β-is-equiv : funext π£ π£ β funext π£ π€ β {x y : X} β is-equiv (Ξ·-οΌ-gives-β {x} {y}) Ξ·-οΌ-gives-β-is-equiv fe fe' {x} {y} = qinvs-are-equivs Ξ·-οΌ-gives-β (Ξ·-β-gives-οΌ , Ξ± , Ξ²) where Ξ± : {x y : X} (p : x οΌ y) β Ξ·-β-gives-οΌ (Ξ·-οΌ-gives-β p) οΌ p Ξ± p = refl Ξ² : {x y : X} (q : Ξ· x β Ξ· y) β Ξ·-οΌ-gives-β (Ξ·-β-gives-οΌ q) οΌ q Ξ² (f , Ξ΄) = to-Γ-οΌ (dfunext fe (Ξ» x β π-is-prop x (f x))) (dfunext fe' (Ξ» x β ap Ξ΄ (π-is-prop β x))) Id-via-lifting : funext π£ π£ β funext π£ π€ β {x y : X} β (x οΌ y) β (Ξ· x β Ξ· y) Id-via-lifting fe fe' = Ξ·-οΌ-gives-β , Ξ·-οΌ-gives-β-is-equiv fe fe' \end{code} Added 13th March 2024. \begin{code} Ξ·-image : funext π£ π£ β funext π£ π€ β propext π£ β {X : π€ Μ } β Β¬ (Ξ£ l κ π X , (l β β₯) Γ ((x : X) β l β Ξ· x)) Ξ·-image fe fe' pe ((P , Ο , P-is-prop) , Ξ½ , f) = no-props-other-than-π-or-π pe (P , P-is-prop , g , h) where g : Β¬ (P οΌ π) g e = Ξ½ (to-Ξ£-οΌ (e , to-subtype-οΌ (Ξ» _ β being-prop-is-prop fe) (dfunext fe' (Ξ» x β π-elim x)))) h : Β¬ (P οΌ π) h refl = f (Ο β) (to-Ξ£-οΌ (refl , to-subtype-οΌ (Ξ» _ β being-prop-is-prop fe) (dfunext fe' (Ξ» β β refl)))) Ξ·-bounded : (y : π X) (x x' : X) β Ξ· x β y β Ξ· x' β y β x οΌ x' Ξ·-bounded y@(P , Ο , P-is-prop) x x' (p , e) (p' , e') = x οΌβ¨ e β β© Ο (p β) οΌβ¨ ap Ο (P-is-prop (p β) (p' β)) β© Ο (p' β) οΌβ¨ (e' β)β»ΒΉ β© x' β \end{code}