@@ -18,6 +18,8 @@ open import Cubical.Foundations.Equiv.HalfAdjoint
1818open import Cubical.Foundations.Univalence
1919
2020open import Cubical.Functions.FunExtEquiv
21+ open import Cubical.Functions.Embedding
22+ open import Cubical.Functions.Surjection
2123
2224open import Cubical.Data.Sigma
2325
@@ -353,6 +355,83 @@ descendMapPath f g isSetM path i x =
353355 ([]surjective x)
354356 i
355357
358+ -- If we have a function sending each element of A to its
359+ -- canonical representative under R, we can obtain A/R more
360+ -- simply as the set of fixed points of R.
361+
362+ CanonicalReprs : (A → A) → Type _
363+ CanonicalReprs {A = A} r = Σ[ x ∈ A ] r x ≡ x
364+
365+ -- Lemma 6.10.8 in HoTT Book: set quotients via canonical representatives
366+ module _ (isSetA : isSet A)
367+ (r : A → A)
368+ (ridem : (a : A) → r (r a) ≡ r a)
369+ (r≃R : (a b : A) → (r a ≡ r b) ≃ R a b)
370+ where
371+
372+ canonicalReprsUniversalIso : isSet B →
373+ Iso (CanonicalReprs r → B) (Σ[ f ∈ (A → B) ] ((a b : A) → R a b → f a ≡ f b))
374+ Iso.fun (canonicalReprsUniversalIso isSetB) g =
375+ (λ a → g (r a , ridem a)) ,
376+ λ a b Rab → cong g (Σ≡Prop (λ _ → isSetA _ _) (invEq (r≃R a b) Rab))
377+ Iso.inv (canonicalReprsUniversalIso isSetB) (f , R→f) (c , rc≡c) = f c
378+ Iso.sec (canonicalReprsUniversalIso isSetB) (f , R→f) =
379+ Σ≡Prop (λ _ → isPropΠ3 λ _ _ _ → isSetB _ _)
380+ (funExt λ a → R→f (r a) a (equivFun (r≃R (r a) a) (ridem a)))
381+ Iso.ret (canonicalReprsUniversalIso isSetB) g =
382+ funExt λ (c , rc≡c) → cong g (Σ≡Prop (λ _ → isSetA _ _) rc≡c)
383+
384+ canonicalReprsUniversal : isSet B →
385+ (CanonicalReprs r → B) ≃ (Σ[ f ∈ (A → B) ] ((a b : A) → R a b → f a ≡ f b))
386+ canonicalReprsUniversal isSetB = isoToEquiv (canonicalReprsUniversalIso isSetB)
387+
388+ private
389+ isSetCR : isSet (CanonicalReprs r)
390+ isSetCR = isSetΣSndProp isSetA (λ _ → isSetA _ _)
391+
392+ equivQuotCRIso : Iso (A / R) (CanonicalReprs r)
393+ Iso.fun equivQuotCRIso = invEq (setQuotUniversal isSetCR)
394+ (equivFun (canonicalReprsUniversal isSetCR) (idfun _))
395+ Iso.inv equivQuotCRIso (c , _) = [ c ]
396+ Iso.sec equivQuotCRIso = funExt⁻ (retEq (canonicalReprsUniversal isSetCR) (idfun _))
397+ Iso.ret equivQuotCRIso = funExt⁻
398+ (descendMapPath _ (idfun _) squash/ (λ a → eq/ _ _ (equivFun (r≃R (r a) a) (ridem a))))
399+
400+ equivQuotCR : (A / R) ≃ (CanonicalReprs r)
401+ equivQuotCR = isoToEquiv equivQuotCRIso
402+
403+ quotSurjectionEquiv : isSet B
404+ → (p : A → B) → isSurjection p
405+ → (A / (λ x y → p x ≡ p y)) ≃ B
406+ quotSurjectionEquiv isSetB p surj = fun , isEmbedding×isSurjection→isEquiv (funEmb , funSurj)
407+ where
408+ fun = rec isSetB p (λ _ _ q → q)
409+
410+ funEmb : isEmbedding fun
411+ funEmb = injEmbedding isSetB (elimProp2 {P = λ x y → fun x ≡ fun y → x ≡ y}
412+ (λ _ _ → isPropΠ λ _ → squash/ _ _) eq/ _ _)
413+
414+ funSurj : isSurjection fun
415+ funSurj = leftFactorSurjective [_] fun surj
416+
417+ -- Corollary 6.10.10 in HoTT Book
418+ quotRetractEquiv : isSet B
419+ → (p : A → B) → (s : B → A) → retract s p
420+ → (A / (λ x y → p x ≡ p y)) ≃ B
421+ quotRetractEquiv isSetB p s ret = quotSurjectionEquiv isSetB p (section→isSurjection ret)
422+
423+ -- Every set is equivalent to its quotient by _≡_.
424+ ER≡ : (A : Type ℓ) → isEquivRel ((_≡_) {ℓ = ℓ} {A})
425+ ER≡ {ℓ} A = equivRel (λ a i → a) (λ a b x i → x (~ i)) λ a b c x y i → (x ∙ y) i
426+
427+ ≡-quotEquiv : isSet A → A ≃ (A / _≡_)
428+ ≡-quotEquiv isSetA .fst = [_]
429+ ≡-quotEquiv isSetA .snd = isEmbedding×isSurjection→isEquiv ([]embedding , []surjective)
430+ where
431+ []embedding : isEmbedding [_]
432+ []embedding = injEmbedding squash/ (effective (λ _ _ → isSetA _ _) (ER≡ _) _ _)
433+
434+
356435-- An Isomorphism/R: An Isomorphism but up to equivalence R instead of equality _≡_:
357436module _ {A : Type ℓ} {B : Type ℓ'} {R : A → A → Type ℓ} (ER : isEquivRel R) where
358437
@@ -395,9 +474,6 @@ iso/R-A≡B {ℓ} {A}{B}{R} ER@{equivRel reflexive symmetric transitive} AB .lef
395474 step1 : ∀ x y → x ≡ y → R x y
396475 step1 x y xy = subst (R x) xy (reflexive x)
397476
398- ER≡ : (A : Type ℓ) → isEquivRel ((_≡_) {ℓ = ℓ} {A})
399- ER≡ {ℓ} A = equivRel (λ a i → a) (λ a b x i → x (~ i)) λ a b c x y i → (x ∙ y) i
400-
401477R→R* : {A : Type ℓ} {B : Type ℓ'} {R : A → A → Type ℓ}{ER : isEquivRel R} → {iso/r : Iso/R A B {R} ER}{a a' : A}
402478 → R a a' → R* {iso/r = iso/r} (iso/r .fun/R a) (iso/r .fun/R a')
403479R→R* {ℓ}{ℓ'}{A}{B}{R} {ER} {iso/r} raa' =
@@ -652,4 +728,3 @@ quotientEqualityLemma4 {ℓ} {A}{B}{R}{R'}{ER} iso/r R'→R R→R' =
652728 help b b' = refl
653729 step1 : (A / R) ≡ (B / R* {iso/r = iso/r})
654730 step1 = quotientEqualityLemma {ℓ}{A}{B}{R}{ER}{iso/r}
655-
0 commit comments