Tom de Jong, 5 April 2022, after discussion with MartΓn EscardΓ³.
(Refactoring an earlier addition dated 15 March 2022.)
The construction of set quotients in Quotient.Large takes a type X : π€
and a π₯-valued equivalence relation and constructs the quotient as a
type in π₯ βΊ β π€.
If we assume Set Replacement, as defined and explained in UF.Size.lagda, then we
get a quotient in π₯ β π€. In particular, for a π€-valued equivalence relation on a
type X : π€, the quotient will live in the same universe π€. This particular case
was first proved in [Corollary 5.1, Rijke2017], but under a different
replacement assumption (again, see UF.Size.lagda for details).
[Rijke2017] Egbert Rijke. The join construction.
https://arxiv.org/abs/1701.07538, January 2017.
\begin{code}
{-# OPTIONS --safe --without-K #-}
open import UF.FunExt
open import UF.PropTrunc
open import UF.Subsingletons
module Quotient.FromSetReplacement
(pt : propositional-truncations-exist)
(fe : Fun-Ext)
(pe : Prop-Ext)
where
open import MLTT.Spartan
open import UF.Equiv
open import UF.EquivalenceExamples
open import UF.Powerset
open import UF.Sets
open import UF.Sets-Properties
open import UF.Size
open import UF.Subsingletons-FunExt
open import UF.SubtypeClassifier
open import UF.SubtypeClassifier-Properties
open import Quotient.Large pt fe pe
open import Quotient.Type
open general-set-quotients-exist large-set-quotients
module _
(R : Set-Replacement pt)
{X : π€ Μ }
(β@(_β_ , βp , βr , βs , βt) : EqRel {π€} {π₯} X)
where
abstract
resize-set-quotient : (X / β) is (π€ β π₯) small
resize-set-quotient = R equiv-rel (X , (β-refl X)) Ξ³
(powersets-are-sets'' fe fe pe)
where
open large-quotient X β using (equiv-rel)
Ξ³ : (X β Ξ© π₯) is-locally π€ β π₯ small
Ξ³ f g = S , β-sym e
where
S : π€ β π₯ Μ
S = (x : X) β f x holds β g x holds
e : (f οΌ g) β S
e = (f οΌ g) ββ¨ β-funext fe f g β©
f βΌ g ββ¨ I β©
S β
where
I : (f βΌ g) β S
I = Ξ -cong fe fe II
where
II : (x : X) β (f x οΌ g x) β (f x holds β g x holds)
II x = logically-equivalent-props-are-equivalent
(Ξ©-is-set fe pe)
(Γ-is-prop (Ξ -is-prop fe (Ξ» _ β holds-is-prop (g x)))
(Ξ -is-prop fe (Ξ» _ β holds-is-prop (f x))))
(Ξ» p β transport _holds p , transportβ»ΒΉ _holds p)
(Ξ» (u , v) β Ξ©-extensionality pe fe u v)
\end{code}
We now use the above resizing to construct a quotient that strictly lives in the
universe π€ β π₯, yielding set quotients as defined in
Quotient.Quotient.lagda.
\begin{code}
X/ββ : π€ β π₯ Μ
X/ββ = prβ resize-set-quotient
Ο : X/ββ β X / β
Ο = prβ resize-set-quotient
Ξ·/β : X β X/ββ
Ξ·/β = β Ο ββ»ΒΉ β Ξ·/ β
Ξ·/β-identifies-related-points : identifies-related-points β Ξ·/β
Ξ·/β-identifies-related-points e = ap β Ο ββ»ΒΉ (Ξ·/-identifies-related-points β e)
/β-is-set : is-set (X/ββ)
/β-is-set = equiv-to-set Ο (/-is-set β)
/β-induction : β {π¦} {P : X/ββ β π¦ Μ }
β ((x' : X/ββ) β is-prop (P x'))
β ((x : X) β P (Ξ·/β x))
β (x' : X/ββ) β P x'
/β-induction {π¦} {P} i h x' = transport P e (Ξ³ (β Ο β x'))
where
P' : X / β β π¦ Μ
P' = P β β Ο ββ»ΒΉ
Ξ³ : (y : X / β) β P' y
Ξ³ = /-induction β (Ξ» y β i (β Ο ββ»ΒΉ y)) h
e : β Ο ββ»ΒΉ (β Ο β x') οΌ x'
e = β-sym-is-linv Ο x'
/β-universality : {A : π¦ Μ } β is-set A
β (f : X β A)
β identifies-related-points β f
β β! f' κ (X/ββ β A), f' β Ξ·/β βΌ f
/β-universality {π¦} {A} i f p =
equiv-to-singleton (β-sym e) (/-universality β i f p)
where
e = (Ξ£ f' κ (X / β β A) , f' β Ξ·/ β βΌ f) ββ¨ β¦
1β¦ β©
(Ξ£ f' κ (X / β β A) , f' β β Ο β β Ξ·/β βΌ f) ββ¨ β¦
2β¦ β©
(Ξ£ f' κ (X/ββ β A) , f' β Ξ·/β βΌ f) β
where
β¦
1β¦ = Ξ£-cong
(Ξ» f' β Ξ -cong fe fe (Ξ» x β οΌ-cong-l (f' (Ξ·/ β x)) (f x)
(ap f' ((β-sym-is-rinv Ο (Ξ·/ β x)) β»ΒΉ))))
β¦
2β¦ = Ξ£-change-of-variable _ (_β β Ο β)
(qinvs-are-equivs (_β β Ο β)
(qinv-pre (Ξ» _ _ β dfunext fe) β Ο β
(equivs-are-qinvs β Ο β (ββ-is-equiv Ο))))
where
open import UF.Equiv-FunExt using (qinv-pre)
Ξ·/β-relates-identified-points : {x y : X} β Ξ·/β x οΌ Ξ·/β y β x β y
Ξ·/β-relates-identified-points {x} {y} eβ = large-effective-set-quotients β e
where
note : β Ο ββ»ΒΉ (Ξ·/ β x) οΌ β Ο ββ»ΒΉ (Ξ·/ β y)
note = eβ
e = Ξ·/ β x οΌβ¨ (β-sym-is-rinv Ο (Ξ·/ β x)) β»ΒΉ β©
β Ο β (β Ο ββ»ΒΉ (Ξ·/ β x)) οΌβ¨ ap β Ο β note β©
β Ο β (β Ο ββ»ΒΉ (Ξ·/ β y)) οΌβ¨ β-sym-is-rinv Ο (Ξ·/ β y) β©
Ξ·/ β y β
set-quotients-from-set-replacement : Set-Replacement pt β set-quotients-exist
set-quotients-from-set-replacement R = record
{ _/_ = Ξ» X β X/ββ R
; Ξ·/ = Ξ·/β R
; Ξ·/-identifies-related-points = Ξ·/β-identifies-related-points R
; /-is-set = /β-is-set R
; /-universality = /β-universality R
}
set-replacement-gives-effective-set-quotients
: (sr : Set-Replacement pt)
β are-effective (set-quotients-from-set-replacement sr)
set-replacement-gives-effective-set-quotients sr {π€} {π₯} R {x} {y} =
Ξ·/β-relates-identified-points sr R
\end{code}