open import 1Lab.HLevel.Retracts open import 1Lab.HLevel open import 1Lab.Equiv open import 1Lab.Path open import 1Lab.Type module 1Lab.HIT.Truncation.Set where
Set truncationπ
Exactly analogously to the construction of [propositional truncations], we can construct the set truncation of a type, reflecting it onto the subcategory of sets.
data β₯_β₯β {β} (A : Type β) : Type β where inc : A β β₯ A β₯β squash : isSet β₯ A β₯β β₯-β₯β-map : β {β β'} {A : Type β} {B : Type β'} β (A β B) β β₯ A β₯β β β₯ B β₯β β₯-β₯β-map f (inc x) = inc (f x) β₯-β₯β-map f (squash x y p q i j) = squash (β₯-β₯β-map f x) (β₯-β₯β-map f y) (Ξ» i β β₯-β₯β-map f (p i)) (Ξ» i β β₯-β₯β-map f (q i)) i j β₯-β₯β-mapβ : β {β β' β''} {A : Type β} {B : Type β'} {C : Type β''} β (A β B β C) β β₯ A β₯β β β₯ B β₯β β β₯ C β₯β β₯-β₯β-mapβ f (inc x) (inc y) = inc (f x y) β₯-β₯β-mapβ f (squash x y p q i j) b = squash (β₯-β₯β-mapβ f x b) (β₯-β₯β-mapβ f y b) (Ξ» i β β₯-β₯β-mapβ f (p i) b) (Ξ» i β β₯-β₯β-mapβ f (q i) b) i j β₯-β₯β-mapβ f a (squash x y p q i j) = squash (β₯-β₯β-mapβ f a x) (β₯-β₯β-mapβ f a y) (Ξ» i β β₯-β₯β-mapβ f a (p i)) (Ξ» i β β₯-β₯β-mapβ f a (q i)) i j β₯-β₯β-elim : β {β β'} {A : Type β} {B : β₯ A β₯β β Type β'} β (β x β isSet (B x)) β (β x β B (inc x)) β β x β B x β₯-β₯β-elim Bset binc (inc x) = binc x β₯-β₯β-elim Bset binc (squash x y p q i j) = isSetβSquareP (Ξ» i j β Bset (squash x y p q i j)) (Ξ» _ β g x) (Ξ» i β g (p i)) (Ξ» i β g (q i)) (Ξ» i β g y) i j where g = β₯-β₯β-elim Bset binc β₯-β₯β-elimβ : β {β β' β''} {A : Type β} {B : Type β'} {C : β₯ A β₯β β β₯ B β₯β β Type β''} β (β x y β isSet (C x y)) β (β x y β C (inc x) (inc y)) β β x y β C x y β₯-β₯β-elimβ Bset f = β₯-β₯β-elim (Ξ» x β isHLevelΞ 2 (Bset x)) Ξ» x β β₯-β₯β-elim (Bset (inc x)) (f x) β₯-β₯β-elimβ : β {β β' β'' β'''} {A : Type β} {B : Type β'} {C : Type β''} {D : β₯ A β₯β β β₯ B β₯β β β₯ C β₯β β Type β'''} β (β x y z β isSet (D x y z)) β (β x y z β D (inc x) (inc y) (inc z)) β β x y z β D x y z β₯-β₯β-elimβ Bset f = β₯-β₯β-elimβ (Ξ» x y β isHLevelΞ 2 (Bset x y)) Ξ» x y β β₯-β₯β-elim (Bset (inc x) (inc y)) (f x y) β₯-β₯β-idempotent : β {β} {A : Type β} β isSet A β isEquiv (inc {A = A}) β₯-β₯β-idempotent {A = A} aset = isIsoβisEquiv (iso proj incβproj Ξ» _ β refl) where proj : β₯ A β₯β β A proj (inc x) = x proj (squash x y p q i j) = aset (proj x) (proj y) (Ξ» i β proj (p i)) (Ξ» i β proj (q i)) i j incβproj : (x : β₯ A β₯β) β inc (proj x) β‘ x incβproj = β₯-β₯β-elim (Ξ» _ β isPropβisSet (squash _ _)) Ξ» _ β refl