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-Quotient where open import MGS-Unique-Existence public open import MGS-Subsingleton-Truncation public is-subsingleton-valued reflexive symmetric transitive is-equivalence-relation : {X : π€ Μ } β (X β X β π₯ Μ ) β π€ β π₯ Μ is-subsingleton-valued _β_ = β x y β is-subsingleton (x β y) reflexive _β_ = β x β x β x symmetric _β_ = β x y β x β y β y β x transitive _β_ = β x y z β x β y β y β z β x β z is-equivalence-relation _β_ = is-subsingleton-valued _β_ Γ reflexive _β_ Γ symmetric _β_ Γ transitive _β_ module quotient {π€ π₯ : Universe} (pt : subsingleton-truncations-exist) (hfe : global-hfunext) (pe : propext π₯) (X : π€ Μ ) (_β_ : X β X β π₯ Μ ) (βp : is-subsingleton-valued _β_) (βr : reflexive _β_) (βs : symmetric _β_) (βt : transitive _β_) where open basic-truncation-development pt hfe equiv-rel : X β (X β Ξ© π₯) equiv-rel x y = (x β y) , βp x y X/β : π₯ βΊ β π€ Μ X/β = image equiv-rel X/β-is-set : is-set X/β X/β-is-set = subsets-of-sets-are-sets (X β Ξ© π₯) _ (powersets-are-sets (dfunext-gives-hfunext hunapply) hunapply pe) (Ξ» _ β β-is-subsingleton) Ξ· : X β X/β Ξ· = corestriction equiv-rel Ξ·-surjection : is-surjection Ξ· Ξ·-surjection = corestriction-surjection equiv-rel Ξ·-induction : (P : X/β β π¦ Μ ) β ((x' : X/β) β is-subsingleton (P x')) β ((x : X) β P (Ξ· x)) β (x' : X/β) β P x' Ξ·-induction = surjection-induction Ξ· Ξ·-surjection Ξ·-equiv-equal : {x y : X} β x β y β Ξ· x β‘ Ξ· y Ξ·-equiv-equal {x} {y} e = to-subtype-β‘ (Ξ» _ β β-is-subsingleton) (hunapply (Ξ» z β to-subtype-β‘ (Ξ» _ β being-subsingleton-is-subsingleton hunapply) (pe (βp x z) (βp y z) (βt y x z (βs x y e)) (βt x y z e)))) Ξ·-equal-equiv : {x y : X} β Ξ· x β‘ Ξ· y β x β y Ξ·-equal-equiv {x} {y} p = equiv-rel-reflect (ap prβ p) where equiv-rel-reflect : equiv-rel x β‘ equiv-rel y β x β y equiv-rel-reflect q = b (βr y) where a : (y β y) β‘ (x β y) a = ap (Ξ» - β prβ(- y)) (q β»ΒΉ) b : y β y β x β y b = Idβfun a universal-property : (A : π¦ Μ ) β is-set A β (f : X β A) β ({x x' : X} β x β x' β f x β‘ f x') β β! f' κ (X/β β A), f' β Ξ· β‘ f universal-property {π¦} A i f Ο = e where G : X/β β π₯ βΊ β π€ β π¦ Μ G x' = Ξ£ a κ A , β x κ X , (Ξ· x β‘ x') Γ (f x β‘ a) Ο : (x' : X/β) β is-subsingleton (G x') Ο = Ξ·-induction _ Ξ³ induction-step where induction-step : (y : X) β is-subsingleton (G (Ξ· y)) induction-step x (a , d) (b , e) = to-subtype-β‘ (Ξ» _ β β-is-subsingleton) p where h : (Ξ£ x' κ X , (Ξ· x' β‘ Ξ· x) Γ (f x' β‘ a)) β (Ξ£ y' κ X , (Ξ· y' β‘ Ξ· x) Γ (f y' β‘ b)) β a β‘ b h (x' , r , s) (y' , t , u) = a β‘β¨ s β»ΒΉ β© f x' β‘β¨ Ο (Ξ·-equal-equiv (r β t β»ΒΉ)) β© f y' β‘β¨ u β© b β p : a β‘ b p = β₯β₯-recursion (i a b) (Ξ» Ο β β₯β₯-recursion (i a b) (h Ο) e) d Ξ³ : (x' : X/β) β is-subsingleton (is-subsingleton (G x')) Ξ³ x' = being-subsingleton-is-subsingleton hunapply k : (x' : X/β) β G x' k = Ξ·-induction _ Ο induction-step where induction-step : (y : X) β G (Ξ· y) induction-step x = f x , β£ x , refl (Ξ· x) , refl (f x) β£ f' : X/β β A f' x' = prβ (k x') r : f' β Ξ· β‘ f r = hunapply h where g : (y : X) β β x κ X , (Ξ· x β‘ Ξ· y) Γ (f x β‘ f' (Ξ· y)) g y = prβ (k (Ξ· y)) j : (y : X) β (Ξ£ x κ X , (Ξ· x β‘ Ξ· y) Γ (f x β‘ f' (Ξ· y))) β f'(Ξ· y) β‘ f y j y (x , p , q) = f' (Ξ· y) β‘β¨ q β»ΒΉ β© f x β‘β¨ Ο (Ξ·-equal-equiv p) β© f y β h : (y : X) β f'(Ξ· y) β‘ f y h y = β₯β₯-recursion (i (f' (Ξ· y)) (f y)) (j y) (g y) c : (Ο : Ξ£ f'' κ (X/β β A), f'' β Ξ· β‘ f) β (f' , r) β‘ Ο c (f'' , s) = to-subtype-β‘ (Ξ» g β Ξ -is-set hfe (Ξ» _ β i) (g β Ξ·) f) t where w : β x β f'(Ξ· x) β‘ f''(Ξ· x) w = happly (f' β Ξ·) (f'' β Ξ·) (r β s β»ΒΉ) t : f' β‘ f'' t = hunapply (Ξ·-induction _ (Ξ» x' β i (f' x') (f'' x')) w) e : β! f' κ (X/β β A), f' β Ξ· β‘ f e = (f' , r) , c