MartΓn EscardΓ³ 1st May 2020.
This is ported from the Midlands Graduate School 2019 lecture notes, which are available online from the following links.
{-# OPTIONS --without-K --exact-split --safe #-} module MGS-Powerset where open import MGS-More-FunExt-Consequences public propext : β π€ β π€ βΊ Μ propext π€ = {P Q : π€ Μ } β is-prop P β is-prop Q β (P β Q) β (Q β P) β P β‘ Q global-propext : π€Ο global-propext = β {π€} β propext π€ univalence-gives-propext : is-univalent π€ β propext π€ univalence-gives-propext ua {P} {Q} i j f g = EqβId ua P Q Ξ³ where Ξ³ : P β Q Ξ³ = logically-equivalent-subsingletons-are-equivalent P Q i j (f , g) Id-from-subsingleton : propext π€ β dfunext π€ π€ β (P : π€ Μ ) β is-subsingleton P β (X : π€ Μ ) β is-subsingleton (P β‘ X) Id-from-subsingleton {π€} pe fe P i = Hedberg P (Ξ» X β h X , k X) where module _ (X : π€ Μ ) where f : P β‘ X β is-subsingleton X Γ (P β X) f p = transport is-subsingleton p i , Idβfun p , (Idβfun (p β»ΒΉ)) g : is-subsingleton X Γ (P β X) β P β‘ X g (l , Ο , Ο) = pe i l Ο Ο h : P β‘ X β P β‘ X h = g β f j : is-subsingleton (is-subsingleton X Γ (P β X)) j = Γ-is-subsingleton' ((Ξ» (_ : P β X) β being-subsingleton-is-subsingleton fe) , (Ξ» (l : is-subsingleton X) β Γ-is-subsingleton (Ξ -is-subsingleton fe (Ξ» p β l)) (Ξ -is-subsingleton fe (Ξ» x β i)))) k : wconstant h k p q = ap g (j (f p) (f q)) subsingleton-univalence : propext π€ β dfunext π€ π€ β (P : π€ Μ ) β is-subsingleton P β (X : π€ Μ ) β is-equiv (IdβEq P X) subsingleton-univalence pe fe P i X = Ξ³ where l : P β X β is-subsingleton X l e = equiv-to-subsingleton (β-sym e) i eqtoid : P β X β P β‘ X eqtoid e = pe i (equiv-to-subsingleton (β-sym e) i) β e β β β-sym e β m : is-subsingleton (P β X) m (f , k) (f' , k') = to-subtype-β‘ (being-equiv-is-subsingleton fe fe) (fe (Ξ» x β j (f x) (f' x))) where j : is-subsingleton X j = equiv-to-subsingleton (β-sym (f , k)) i Ξ΅ : (e : P β X) β IdβEq P X (eqtoid e) β‘ e Ξ΅ e = m (IdβEq P X (eqtoid e)) e Ξ· : (q : P β‘ X) β eqtoid (IdβEq P X q) β‘ q Ξ· q = Id-from-subsingleton pe fe P i X (eqtoid (IdβEq P X q)) q Ξ³ : is-equiv (IdβEq P X) Ξ³ = invertibles-are-equivs (IdβEq P X) (eqtoid , Ξ· , Ξ΅) subsingleton-univalence-β : propext π€ β dfunext π€ π€ β (X P : π€ Μ ) β is-subsingleton P β (P β‘ X) β (P β X) subsingleton-univalence-β pe fe X P i = IdβEq P X , subsingleton-univalence pe fe P i X Ξ© : (π€ : Universe) β π€ βΊ Μ Ξ© π€ = Ξ£ P κ π€ Μ , is-subsingleton P _holds : Ξ© π€ β π€ Μ _holds (P , i) = P holds-is-subsingleton : (p : Ξ© π€) β is-subsingleton (p holds) holds-is-subsingleton (P , i) = i Ξ©-ext : dfunext π€ π€ β propext π€ β {p q : Ξ© π€} β (p holds β q holds) β (q holds β p holds) β p β‘ q Ξ©-ext {π€} fe pe {p} {q} f g = to-subtype-β‘ (Ξ» _ β being-subsingleton-is-subsingleton fe) (pe (holds-is-subsingleton p) (holds-is-subsingleton q) f g) Ξ©-is-set : dfunext π€ π€ β propext π€ β is-set (Ξ© π€) Ξ©-is-set {π€} fe pe = types-with-wconstant-β‘-endomaps-are-sets (Ξ© π€) c where A : (p q : Ξ© π€) β π€ Μ A p q = (p holds β q holds) Γ (q holds β p holds) i : (p q : Ξ© π€) β is-subsingleton (A p q) i p q = Ξ£-is-subsingleton (Ξ -is-subsingleton fe (Ξ» _ β holds-is-subsingleton q)) (Ξ» _ β Ξ -is-subsingleton fe (Ξ» _ β holds-is-subsingleton p)) g : (p q : Ξ© π€) β p β‘ q β A p q g p q e = (u , v) where a : p holds β‘ q holds a = ap _holds e u : p holds β q holds u = Idβfun a v : q holds β p holds v = Idβfun (a β»ΒΉ) h : (p q : Ξ© π€) β A p q β p β‘ q h p q (u , v) = Ξ©-ext fe pe u v f : (p q : Ξ© π€) β p β‘ q β p β‘ q f p q e = h p q (g p q e) k : (p q : Ξ© π€) (d e : p β‘ q) β f p q d β‘ f p q e k p q d e = ap (h p q) (i p q (g p q d) (g p q e)) c : (p q : Ξ© π€) β Ξ£ f κ (p β‘ q β p β‘ q), wconstant f c p q = (f p q , k p q) powersets-are-sets : hfunext π€ (π₯ βΊ) β dfunext π₯ π₯ β propext π₯ β {X : π€ Μ } β is-set (X β Ξ© π₯) powersets-are-sets fe fe' pe = Ξ -is-set fe (Ξ» x β Ξ©-is-set fe' pe) π : π€ Μ β π€ βΊ Μ π {π€} X = X β Ξ© π€ powersets-are-sets' : Univalence β {X : π€ Μ } β is-set (π X) powersets-are-sets' {π€} ua = powersets-are-sets (univalence-gives-hfunext' (ua π€) (ua (π€ βΊ))) (univalence-gives-dfunext (ua π€)) (univalence-gives-propext (ua π€)) _β_ : {X : π€ Μ } β X β π X β π€ Μ x β A = A x holds _β_ : {X : π€ Μ } β π X β π X β π€ Μ A β B = β x β x β A β x β B β-is-subsingleton : {X : π€ Μ } (A : π X) (x : X) β is-subsingleton (x β A) β-is-subsingleton A x = holds-is-subsingleton (A x) β-is-subsingleton : dfunext π€ π€ β {X : π€ Μ } (A B : π X) β is-subsingleton (A β B) β-is-subsingleton fe A B = Ξ -is-subsingleton fe (Ξ» x β Ξ -is-subsingleton fe (Ξ» _ β β-is-subsingleton B x)) β-refl : {X : π€ Μ } (A : π X) β A β A β-refl A x = ππ (x β A) β-refl-consequence : {X : π€ Μ } (A B : π X) β A β‘ B β (A β B) Γ (B β A) β-refl-consequence {X} A A (refl A) = β-refl A , β-refl A subset-extensionality : propext π€ β dfunext π€ π€ β dfunext π€ (π€ βΊ) β {X : π€ Μ } {A B : π X} β A β B β B β A β A β‘ B subset-extensionality pe fe fe' {X} {A} {B} h k = fe' Ο where Ο : (x : X) β A x β‘ B x Ο x = to-subtype-β‘ (Ξ» _ β being-subsingleton-is-subsingleton fe) (pe (holds-is-subsingleton (A x)) (holds-is-subsingleton (B x)) (h x) (k x)) subset-extensionality' : Univalence β {X : π€ Μ } {A B : π X} β A β B β B β A β A β‘ B subset-extensionality' {π€} ua = subset-extensionality (univalence-gives-propext (ua π€)) (univalence-gives-dfunext (ua π€)) (univalence-gives-dfunext' (ua π€) (ua (π€ βΊ))) infix 40 _β_