Martin Escardo, 17-19 June 2025.
The totally separated reflection of the type Ξ© of propositions.
Any type X has a totally separated reflection, given by the image of
the evaluation map X β ((X β π) β π). Here we explore whether the
totally separated reflection of Ξ© has a more direct description.
First, we show, assuming propositional resizing, that the type
T := (WEM β π)
has the universal property of the totally separated reflection of Ξ©,
where
WEM := (p : Ξ©) β Β¬ (p holds) + ¬¬ (p holds)
is the principle of weak excluded middle.
The unit Ξ· : Ξ© β T of the reflection sends a proposition p to the
function that, given a witness of WEM, gives β or β according to
whether ¬ p holds or ¬¬ p holds.
The universal property says that, for every totally separated type Y,
precomposition with Ξ· (the restriction map) is an equivalence
(T β Y) β (Ξ© β Y).
Resizing is used to define a section s : T β Ξ© of Ξ· by
s t = "the resized proposition that t is the constant function β".
Second, we ask whether this equivalence be established without
assuming propositional resizing.
We don't know, but we explore this a bit here. In particular, we
establish the equivalence, without resizing, for types Y that are
retracts of powers of π.
TODO. Is every totally separated type a retract of a power of π,
without assuming resizing? No, because this excludes the empty type
(as pointed out to us by Jason Carr). But what can we say in this
direction?
A side-conclusion of this technical development is that we have an
equivalence
(Ξ© β π) β (π + WEM Γ π).
There are always two maps Ξ© β π, namely the constant ones, plus two
when WEM holds.
Moreover, we show that Ξ· is the universal map of Ξ© into a totally
separated type if and only if it is a surjection.
\begin{code}
{-# OPTIONS --safe --without-K --lossy-unification #-}
open import UF.FunExt
open import UF.Subsingletons
open import MLTT.Spartan
module gist.TotallySeparatedReflectionOfOmega
(fe : Fun-Ext)
(pe : Prop-Ext)
(π€ : Universe)
where
open import MLTT.Two-Properties
open import TypeTopology.CompactTypes
open import TypeTopology.MicroTychonoff
open import TypeTopology.TotallySeparated
open import TypeTopology.SigmaTotallySeparated
open import UF.Base
open import UF.ClassicalLogic
using (EM ; LEM ; EM-gives-LEM ; double-negation-of-decision)
open import UF.DiscreteAndSeparated
open import UF.Embeddings
open import UF.Equiv
open import UF.PropTrunc
open import UF.Retracts
open import UF.Sets
open import UF.Size
open import UF.SubtypeClassifier renaming (Ξ© to Ξ©-of)
open import UF.Subsingletons-FunExt
private
fe' : FunExt
fe' π€ π₯ = fe {π€} {π₯}
π€βΊ = π€ βΊ
Ξ© : π€βΊ Μ
Ξ© = Ξ©-of π€
WEM : π€βΊ Μ
WEM = (p : Ξ©) β is-decidable (Β¬ (p holds))
WEM-is-prop : is-prop WEM
WEM-is-prop = Ξ -is-prop fe
(Ξ» p β decidability-of-prop-is-prop fe (negations-are-props fe))
T : π€βΊ Μ
T = WEM β π
T-is-totally-separated : is-totally-separated T
T-is-totally-separated = Ξ -is-totally-separated fe
(Ξ» _ β π-is-totally-separated)
T-is-set : is-set T
T-is-set = totally-separated-types-are-sets fe T
T-is-totally-separated
Ο : π β T
Ο b = Ξ» _ β b
Οβ Οβ : T
Οβ = Ο β
Οβ = Ο β
\end{code}
NB. The function Ξ΄ needs --lossy-unification to avoid unsolved constraints.
\begin{code}
Ξ΄ : {p : Ξ©} β is-decidable (Β¬ (p holds)) β π
Ξ΄ (inl _) = β
Ξ΄ (inr _) = β
\end{code}
The unit of the reflection and its non-definitional "computation" rules.
\begin{code}
Ξ· : Ξ© β T
Ξ· p w = Ξ΄ (w p)
Ξ·β : (p : Ξ©) (w : WEM) β Β¬ (p holds) β Ξ· p w οΌ β
Ξ·β p w ph = I (w p)
where
I : (d : is-decidable (Β¬ (p holds))) β Ξ΄ d οΌ β
I (inl _) = refl
I (inr Ξ½) = π-elim (Ξ½ ph)
Ξ·β : (p : Ξ©) (w : WEM) β ¬¬ (p holds) β Ξ· p w οΌ β
Ξ·β p w Ξ½ = I (w p)
where
I : (d : is-decidable (Β¬ (p holds))) β Ξ΄ d οΌ β
I (inl ph) = π-elim (Ξ½ ph)
I (inr _) = refl
Ξ·β₯ : Ξ· β₯ οΌ Οβ
Ξ·β₯ = dfunext fe (Ξ» w β Ξ·β β₯ w β₯-doesnt-hold)
Ξ·β€ : Ξ· β€ οΌ Οβ
Ξ·β€ = dfunext fe (Ξ» w β Ξ·β β€ w (¬¬-intro β€-holds))
Ο-lemma : (t : T) (w : WEM) β t οΌ Ο (t w)
Ο-lemma t w = dfunext fe (Ξ» w' β ap t (WEM-is-prop w' w))
\end{code}
Sufficient condition for boolean-valued maps on Ξ© being constant.
\begin{code}
lemma-β₯ : (f : Ξ© β π) (p : Ξ©) β Β¬ (p holds) β f p οΌ f β₯
lemma-β₯ f p Ξ½ = ap f (fails-gives-equal-β₯ pe fe p Ξ½)
lemma-β€ : (f : Ξ© β π) (p : Ξ©) β p holds β f p οΌ f β€
lemma-β€ f p ph = ap f (holds-gives-equal-β€ pe fe p ph)
\end{code}
Given f : Ξ© β π, we can decide whether f β₯ οΌ f β€ or not.
* If so, then f is constant.
* Otherwise, WEM follows.
\begin{code}
constancy-lemma : (f : Ξ© β π) β f β₯ οΌ f β€ β (p : Ξ©) β f p οΌ f β₯
constancy-lemma f e p = π-is-¬¬-separated (f p) (f β₯) I
where
I : ¬¬ (f p οΌ f β₯)
I ne = Iβ Iβ
where
Iβ : Β¬ (p holds)
Iβ ph = ne (f p οΌβ¨ lemma-β€ f p ph β©
f β€ οΌβ¨ e β»ΒΉ β©
f β₯ β)
Iβ : ¬¬ (p holds)
Iβ Ξ½ = ne (lemma-β₯ f p Ξ½)
WEM-lemma : (f : Ξ© β π) β f β₯ β f β€ β WEM
WEM-lemma f ne p = I (π-is-discrete (f p) (f β€))
where
I : is-decidable (f p οΌ f β€) β is-decidable (Β¬ (p holds))
I (inl e) = inr (Ξ» ph β ne (f β₯ οΌβ¨ (lemma-β₯ f p ph)β»ΒΉ β©
f p οΌβ¨ e β©
f β€ β))
I (inr ne') = inl (Ξ» ph β ne' (lemma-β€ f p ph))
\end{code}
Some observations not needed for our development:
\begin{code}
_ : (Y : π₯ Μ ) β is-totally-separated Y β is-¬¬-separated Y
_ = totally-separated-types-are-¬¬-separated
_ : {Y : π₯ Μ }
β is-¬¬-separated Y
β (f : Ξ© β Y) β f β₯ οΌ f β€ β (p q : Ξ©) β f p οΌ f q
_ = β₯-β€-density' fe pe
Β¬WEM-observation : Β¬ WEM
β {Y : π₯ Μ }
β is-totally-separated Y
β (f : Ξ© β Y) (p q : Ξ©) β f p οΌ f q
Β¬WEM-observation nwem {Y} ts f = III
where
I : (g : Y β π) β g (f β₯) οΌ g (f β€)
I g = π-is-¬¬-separated (g (f β₯)) (g (f β€)) Iβ
where
Iβ : ¬¬ (g (f β₯) οΌ g (f β€))
Iβ ne = nwem (WEM-lemma (g β f) ne)
II : f β₯ οΌ f β€
II = ts I
III : (p q : Ξ©) β f p οΌ f q
III = β₯-β€-density' fe pe (totally-separated-types-are-¬¬-separated Y ts) f II
¬¬WEM-observation : {Y : π₯ Μ }
β is-totally-separated Y
β (Ξ£ f κ (Ξ© β Y) , f β₯ β f β€)
β ¬¬ WEM
¬¬WEM-observation ts (f , ne) =
contrapositive
(Ξ» (nwem : Β¬ WEM) β Β¬WEM-observation nwem ts f β₯ β€)
ne
\end{code}
Restriction along Ξ·:
\begin{code}
Ο : (Y : π₯ Μ ) β (T β Y) β (Ξ© β Y)
Ο Y g = g β Ξ·
\end{code}
We now show that T is the totally separated reflection of Ξ© assuming
resizing, and after that we record everything we know about the
universal property of T without assuming resizing.
\begin{code}
module T-is-ts-reflection-of-Ξ©-assuming-resizing
(r : propositional-resizing π€βΊ π€)
where
being-equal-to-Οβ-is-prop : (t : T) β is-prop (t οΌ Οβ)
being-equal-to-Οβ-is-prop t = T-is-set
\end{code}
We apply resizing to the proposition (t οΌ Οβ), to show that T is a
retract of Ξ© with a section s of Ξ·.
\begin{code}
s : T β Ξ©
s t = resize r (t οΌ Οβ) (being-equal-to-Οβ-is-prop t) ,
resize-is-prop r (t οΌ Οβ) (being-equal-to-Οβ-is-prop t)
to-s-holds : (t : T) β (t οΌ Οβ) β s t holds
to-s-holds t = to-resize r (t οΌ Οβ) (being-equal-to-Οβ-is-prop t)
from-s-holds : (t : T) β s t holds β (t οΌ Οβ)
from-s-holds t = from-resize r (t οΌ Οβ) (being-equal-to-Οβ-is-prop t)
Ξ·s : (t : T) β Ξ· (s t) οΌ t
Ξ·s t = dfunext fe (Ξ» w β π-equality-cases (I w) (II w))
where
I : (w : WEM) β t w οΌ β β Ξ· (s t) w οΌ t w
I w eβ = Ξ· (s t) w οΌβ¨ Ξ·β (s t) w Iβ β©
β οΌβ¨ eβ β»ΒΉ β©
t w β
where
Iβ : Β¬ (s t holds)
Iβ h = zero-is-not-one
(β οΌβ¨ eβ β»ΒΉ β©
t w οΌβ¨ happly (from-s-holds t h) w β©
Οβ w οΌβ¨ refl β©
β β)
II : (w : WEM) β t w οΌ β β Ξ· (s t) w οΌ t w
II w eβ = Ξ· (s t) w οΌβ¨ Ξ·β (s t) w IIβ β©
β οΌβ¨ eβ β»ΒΉ β©
t w β
where
IIβ : t οΌ Οβ
IIβ = t οΌβ¨ Ο-lemma t w β©
Ο (t w) οΌβ¨ ap Ο eβ β©
Οβ β
IIβ : ¬¬ (s t holds)
IIβ Ξ½ = Ξ½ (to-s-holds t IIβ)
\end{code}
Although s is not necessarily a retraction of Ξ·, any function Ξ© β π
believes it is, assuming WEM. But then this can be used to get the
same conclusion without assuming WEM.
\begin{code}
sΞ·-with-WEM : WEM β (f : Ξ© β π) (p : Ξ©) β f (s (Ξ· p)) οΌ f p
sΞ·-with-WEM w f p = I (w p)
where
I : is-decidable (Β¬ (p holds)) β f (s (Ξ· p)) οΌ f p
I (inl Ξ½) = f (s (Ξ· p)) οΌβ¨ ap f (fails-gives-equal-β₯ pe fe (s (Ξ· p)) Iβ) β©
f β₯ οΌβ¨ (lemma-β₯ f p Ξ½)β»ΒΉ β©
f p β
where
Iβ : Β¬ (s (Ξ· p) holds)
Iβ sh = zero-is-not-one
(β οΌβ¨ (Ξ·β p w Ξ½)β»ΒΉ β©
Ξ· p w οΌβ¨ happly (from-s-holds (Ξ· p) sh) w β©
Οβ w οΌβ¨ refl β©
β β)
I (inr Ξ½Ξ½) = f (s (Ξ· p)) οΌβ¨ ap f (holds-gives-equal-β€ pe fe (s (Ξ· p)) Iβ) β©
f β€ οΌβ¨ Iβ β»ΒΉ β©
f p β
where
Iβ : Ξ· p οΌ Οβ
Iβ = dfunext fe (Ξ» w β Ξ·β p w Ξ½Ξ½)
Iβ : s (Ξ· p) holds
Iβ = to-s-holds (Ξ· p) Iβ
Iβ : f p οΌ f β€
Iβ = π-is-¬¬-separated (f p) (f β€)
(Ξ» (ne : f p β f β€) β Ξ½Ξ½ (Ξ» (ph : p holds) β ne (lemma-β€ f p ph)))
sΞ· : (f : Ξ© β π) (p : Ξ©) β f (s (Ξ· p)) οΌ f p
sΞ· f p = π-is-¬¬-separated (f (s (Ξ· p))) (f p) I
where
I : ¬¬ (f (s (Ξ· p)) οΌ f p)
I ne = ne (f (s (Ξ· p)) οΌβ¨ constancy-lemma f Iβ (s (Ξ· p)) β©
f β₯ οΌβ¨ (constancy-lemma f Iβ p)β»ΒΉ β©
f p β)
where
Iβ : Β¬ WEM
Iβ w = ne (sΞ·-with-WEM w f p)
Iβ : f β₯ οΌ f β€
Iβ = π-is-¬¬-separated (f β₯) (f β€) (Ξ» ne' β Iβ (WEM-lemma f ne'))
Ο-is-equiv : (Y : π¦ Μ )
β is-totally-separated Y
β is-equiv (Ο Y)
Ο-is-equiv Y ts = qinvs-are-equivs (Ο Y) (Οβ»ΒΉ , I , II)
where
Οβ»ΒΉ : (Ξ© β Y) β (T β Y)
Οβ»ΒΉ f = f β s
I : (g : T β Y) β Οβ»ΒΉ (Ο Y g) οΌ g
I g = dfunext fe (Ξ» t β ap g (Ξ·s t))
II : (f : Ξ© β Y) β Ο Y (Οβ»ΒΉ f) οΌ f
II f = dfunext fe (Ξ» p β ts (Ξ» h β sΞ· (Ξ» q β h (f q)) p))
reflection : (Y : π¦ Μ )
β is-totally-separated Y
β (T β Y) β (Ξ© β Y)
reflection Y ts = Ο Y , Ο-is-equiv Y ts
module _ (pt : propositional-truncations-exist) where
open import UF.ImageAndSurjection pt
open PropositionalTruncation pt
resizing-gives-Ξ·surjection : is-surjection Ξ·
resizing-gives-Ξ·surjection t = β£ s t , Ξ·s t β£
\end{code}
This is the end of the above module assuming resizing, and we now
record everything we know about the universal property of T without
assuming resizing.
We first show that the universal property holds when π is the target type.
\begin{code}
extensionβ'-along-Ξ· : (f : Ξ© β π) β is-decidable (f β₯ οΌ f β€) β T β π
extensionβ'-along-Ξ· f (inl _) t = f β₯
extensionβ'-along-Ξ· f (inr ne) t = π-cases (f β₯) (f β€) (t (WEM-lemma f ne))
extensionβ-along-Ξ· : (Ξ© β π) β (T β π)
extensionβ-along-Ξ· f = extensionβ'-along-Ξ· f (π-is-discrete (f β₯) (f β€))
extensionβ'-property : (f : Ξ© β π) (d : is-decidable (f β₯ οΌ f β€)) (p : Ξ©)
β extensionβ'-along-Ξ· f d (Ξ· p) οΌ f p
extensionβ'-property f (inl e) p = (constancy-lemma f e p)β»ΒΉ
extensionβ'-property f (inr ne) p = I (WEM-lemma f ne p)
where
I : (d : is-decidable (Β¬ (p holds))) β π-cases (f β₯) (f β€) (Ξ΄ d) οΌ f p
I (inl Ξ½) = (lemma-β₯ f p Ξ½)β»ΒΉ
I (inr Ξ½Ξ½) = (π-is-¬¬-separated (f p) (f β€)
(Ξ» (ne : f p β f β€) β Ξ½Ξ½ (Ξ» (ph : p holds) β ne (lemma-β€ f p ph))))β»ΒΉ
extensionβ-property : (f : Ξ© β π) (p : Ξ©) β extensionβ-along-Ξ· f (Ξ· p) οΌ f p
extensionβ-property f p = extensionβ'-property f (π-is-discrete (f β₯) (f β€)) p
Οβ : (T β π) β Ξ© β π
Οβ = Ο π
restriction-of-extensionβ : (f : Ξ© β π) β Οβ (extensionβ-along-Ξ· f) οΌ f
restriction-of-extensionβ f = dfunext fe (Ξ» p β extensionβ-property f p)
\end{code}
The points Οβ and Οβ are ¬¬-dense in T, which gives left-cancellability of Οβ.
\begin{code}
Οββ-density : (t : T) β ¬¬ ((t οΌ Οβ) + (t οΌ Οβ))
Οββ-density t Ξ½ = II (Ξ» d β Ξ½ (I d))
where
I : is-decidable WEM β (t οΌ Οβ) + (t οΌ Οβ)
I (inl w) = π-equality-cases
(Ξ» e β inl (t οΌβ¨ Ο-lemma t w β©
Ο (t w) οΌβ¨ ap Ο e β©
Οβ β))
(Ξ» e β inr (t οΌβ¨ Ο-lemma t w β©
Ο (t w) οΌβ¨ ap Ο e β©
Οβ β))
I (inr nw) = inl (dfunext fe (Ξ» w β π-elim (nw w)))
II : ¬¬ (is-decidable WEM)
II = double-negation-of-decision
Οβ-lc : (g g' : T β π) β Οβ g οΌ Οβ g' β g οΌ g'
Οβ-lc g g' e = dfunext fe (Ξ» t β π-is-¬¬-separated (g t) (g' t) (III t))
where
I : g Οβ οΌ g' Οβ
I = g Οβ οΌβ¨ ap g (Ξ·β₯ β»ΒΉ) β©
g (Ξ· β₯) οΌβ¨ happly e β₯ β©
g' (Ξ· β₯) οΌβ¨ ap g' Ξ·β₯ β©
g' Οβ β
II : g Οβ οΌ g' Οβ
II = g Οβ οΌβ¨ ap g (Ξ·β€ β»ΒΉ) β©
g (Ξ· β€) οΌβ¨ happly e β€ β©
g' (Ξ· β€) οΌβ¨ ap g' Ξ·β€ β©
g' Οβ β
III : (t : T) β ¬¬ (g t οΌ g' t)
III t ne = Οββ-density t IIIβ
where
IIIβ : Β¬ ((t οΌ Οβ) + (t οΌ Οβ))
IIIβ (inl eβ) = ne (g t οΌβ¨ ap g eβ β©
g Οβ οΌβ¨ I β©
g' Οβ οΌβ¨ ap g' (eβ β»ΒΉ) β©
g' t β)
IIIβ (inr eβ) = ne (g t οΌβ¨ ap g eβ β©
g Οβ οΌβ¨ II β©
g' Οβ οΌβ¨ ap g' (eβ β»ΒΉ) β©
g' t β)
extensionβ-of-restriction : (g : T β π) β extensionβ-along-Ξ· (Οβ g) οΌ g
extensionβ-of-restriction g = Οβ-lc (extensionβ-along-Ξ· (Οβ g)) g
(restriction-of-extensionβ (Οβ g))
Οβ-is-equiv : is-equiv Οβ
Οβ-is-equiv = qinvs-are-equivs Οβ
(extensionβ-along-Ξ· ,
extensionβ-of-restriction ,
restriction-of-extensionβ)
\end{code}
TODO. Actually, we can replace π by any discrete type to get the same
conclusion.
We now prove the universal property when the target type is a power of π,
pointwise. More generally, if Ο Y is an equivalence then so is Ο (J β Y)
for any J.
\begin{code}
module _
{π₯ π : Universe}
(Y : π₯ Μ )
{J : π Μ }
(ΟY-is-equiv : is-equiv (Ο Y))
where
private
π£ : (T β Y) β (Ξ© β Y)
π£ = (Ο Y , ΟY-is-equiv)
extension-power : (Ξ© β (J β Y)) β (T β (J β Y))
extension-power f t j = β π£ ββ»ΒΉ (Ξ» p β f p j) t
restriction-of-extension-power : (f : Ξ© β (J β Y))
β Ο (J β Y) (extension-power f) οΌ f
restriction-of-extension-power f = dfunext fe (Ξ» p β
dfunext fe (Ξ» j β happly
(inverses-are-sections' π£
(Ξ» (q : Ξ©) β f q j))
p))
extension-of-restriction-power : (g : T β (J β Y))
β extension-power (Ο (J β Y) g) οΌ g
extension-of-restriction-power g =
dfunext fe (Ξ» t β dfunext fe (Ξ» j β
happly (inverses-are-retractions' π£ (Ξ» t' β g t' j)) t))
Ο-of-power-is-equiv : is-equiv (Ο (J β Y))
Ο-of-power-is-equiv =
qinvs-are-equivs (Ο (J β Y))
(extension-power ,
extension-of-restriction-power ,
restriction-of-extension-power)
Ο-of-power-of-π-is-equiv : {π : Universe} {J : π Μ } β is-equiv (Ο (J β π))
Ο-of-power-of-π-is-equiv {π} {J} = Ο-of-power-is-equiv π Οβ-is-equiv
\end{code}
Retracts of targets that satisfy the universal property also satisfy
the universal property of totally separated reflection.
\begin{code}
Ο-of-retract-is-equiv : {Y : π¦ Μ } {Z : π£ Μ }
β retract Y of Z
β is-equiv (Ο Z)
β is-equiv (Ο Y)
Ο-of-retract-is-equiv {π¦} {π£} {Y} {Z} (r , s , rs) ez =
qinvs-are-equivs (Ο Y) (ΟYβ»ΒΉ , III , IV)
where
ΟZβ»ΒΉ : (Ξ© β Z) β (T β Z)
ΟZβ»ΒΉ = inverse (Ο Z) ez
I : (Ο : Ξ© β Z) β Ο Z (ΟZβ»ΒΉ Ο) οΌ Ο
I = inverses-are-sections (Ο Z) ez
II : (Ο : T β Z) β ΟZβ»ΒΉ (Ο Z Ο) οΌ Ο
II = inverses-are-retractions (Ο Z) ez
ΟYβ»ΒΉ : (Ξ© β Y) β (T β Y)
ΟYβ»ΒΉ f = r β ΟZβ»ΒΉ (s β f)
III : (g : T β Y) β ΟYβ»ΒΉ (Ο Y g) οΌ g
III g = ΟYβ»ΒΉ (Ο Y g) οΌβ¨ ap (Ξ» - β r β -) (II (s β g)) β©
r β (s β g) οΌβ¨ dfunext fe (Ξ» t β rs (g t)) β©
g β
IV : (f : Ξ© β Y) β Ο Y (ΟYβ»ΒΉ f) οΌ f
IV f = Ο Y (ΟYβ»ΒΉ f) οΌβ¨ ap (Ξ» - β r β -) (I (s β f)) β©
r β (s β f) οΌβ¨ dfunext fe (Ξ» p β rs (f p)) β©
f β
\end{code}
The universal property for retracts of powers of π.
\begin{code}
Ο-of-retract-of-power-of-π-is-equiv
: {π : Universe} {Y : π¦ Μ } {J : π Μ }
β retract Y of (J β π)
β is-equiv (Ο Y)
Ο-of-retract-of-power-of-π-is-equiv ret =
Ο-of-retract-is-equiv ret Ο-of-power-of-π-is-equiv
reflection-for-retract-of-power-of-π
: {π : Universe} {Y : π¦ Μ } {J : π Μ }
β retract Y of (J β π)
β (T β Y) β (Ξ© β Y)
reflection-for-retract-of-power-of-π r =
Ο _ , Ο-of-retract-of-power-of-π-is-equiv r
\end{code}
The remainder of this file has a number of observations, eventually
culminating in the fact that Ξ· : Ξ© β T is the universal map from Ξ© to
a totally separated type if and only if it is a surjection.
We first connect this to the investigation of π-injective types from
the file gist.2-injective-types.
\begin{code}
open import gist.2-injective-types fe'
T-is-π-injective : {π₯ π¦ : Universe} β π-injective T π₯ π¦
T-is-π-injective = first-dual-is-π-injective
Ξ·-is-π-injecting : is-π-injecting Ξ·
Ξ·-is-π-injecting f = extensionβ-along-Ξ· f , happly (restriction-of-extensionβ f)
Ο-of-π-injective-is-equiv : {Y : π¦ Μ }
β π-injective Y π¦ π¦
β is-equiv (Ο Y)
Ο-of-π-injective-is-equiv i =
Ο-of-retract-of-power-of-π-is-equiv (π-injectives-are-K-retracts i)
\end{code}
There is at most one extension for a totally separated target. The
following generalizes and uses Οβ-lc.
\begin{code}
Οβ-of-ts-is-lc : (Y : π¦ Μ )
β is-totally-separated Y
β (g g' : T β Y) β Ο Y g οΌ Ο Y g' β g οΌ g'
Οβ-of-ts-is-lc Y ts g g' e =
dfunext fe (Ξ» t β ts (Ξ» q β happly
(Οβ-lc
(Ξ» t' β q (g t'))
(Ξ» t' β q (g' t'))
(ap (Ξ» - β q β -) e)) t))
\end{code}
The notion of compactness is defined in TypeTopology.CompactTypes,
where it is proved that Ξ© is-compact.
\begin{code}
T-is-compactβ : is-compactβ T
T-is-compactβ = micro-tychonoff fe WEM-is-prop (Ξ» _ β π-is-compactβ)
EM-gives-Ξ©-discrete : EM π€ β is-discrete Ξ©
EM-gives-Ξ©-discrete em p q = II (I p) (I q)
where
I : LEM π€
I = EM-gives-LEM em
II : is-decidable (p holds) β is-decidable (q holds) β is-decidable (p οΌ q)
II (inl ph) (inl qh) = inl (p οΌβ¨ holds-gives-equal-β€ pe fe p ph β©
β€ οΌβ¨ (holds-gives-equal-β€ pe fe q qh)β»ΒΉ β©
q β)
II (inl ph) (inr nq) = inr (Ξ» e β nq (transport _holds e ph))
II (inr np) (inl qh) = inr (Ξ» e β np (transport _holds (e β»ΒΉ) qh))
II (inr np) (inr nq) = inl (p οΌβ¨ fails-gives-equal-β₯ pe fe p np β©
β₯ οΌβ¨ (fails-gives-equal-β₯ pe fe q nq)β»ΒΉ β©
q β)
EM-gives-Ξ©-totally-separated : EM π€ β is-totally-separated Ξ©
EM-gives-Ξ©-totally-separated em = discrete-types-are-totally-separated
(EM-gives-Ξ©-discrete em)
extensionβ-along-Ξ·-under-WEM : (f : Ξ© β π) (w : WEM) (t : T)
β extensionβ-along-Ξ· f t οΌ π-cases (f β₯) (f β€) (t w)
extensionβ-along-Ξ·-under-WEM f w t = I (π-is-discrete (f β₯) (f β€))
where
I : (d : is-decidable (f β₯ οΌ f β€))
β extensionβ'-along-Ξ· f d t οΌ π-cases (f β₯) (f β€) (t w)
I (inl e) = π-equality-cases
(Ξ» e' β f β₯ οΌβ¨ Iβ e' β©
π-cases (f β₯) (f β€) (t w) β)
(Ξ» e' β f β₯ οΌβ¨ e β©
f β€ οΌβ¨ Iβ e' β©
π-cases (f β₯) (f β€) (t w) β)
where
Iβ = Ξ» e' β ap (π-cases (f β₯) (f β€)) (e' β»ΒΉ)
Iβ = Ξ» e' β ap (π-cases (f β₯) (f β€)) (e' β»ΒΉ)
I (inr ne) = ap (π-cases (f β₯) (f β€))
(ap t (WEM-is-prop (WEM-lemma f ne) w))
extensionβ-along-Ξ·-under-Β¬WEM : (f : Ξ© β π) (t : T)
β Β¬ WEM
β extensionβ-along-Ξ· f t οΌ f β₯
extensionβ-along-Ξ·-under-Β¬WEM f t nw = I (π-is-discrete (f β₯) (f β€))
where
I : (d : is-decidable (f β₯ οΌ f β€)) β extensionβ'-along-Ξ· f d t οΌ f β₯
I (inl e) = refl
I (inr ne) = π-elim (nw (WEM-lemma f ne))
\end{code}
We now assume propositional truncations.
\begin{code}
module comparison (pt : propositional-truncations-exist) where
open import UF.ImageAndSurjection pt
ΞΉ : image Ξ· β T
ΞΉ = restriction Ξ·
ΞΉ-is-embedding : is-embedding ΞΉ
ΞΉ-is-embedding = restrictions-are-embeddings Ξ·
ΞΉ-image-is-ts : is-totally-separated (image Ξ·)
ΞΉ-image-is-ts = subtype-is-totally-separated' ΞΉ
T-is-totally-separated
ΞΉ-is-embedding
Ξ·c : Ξ© β image Ξ·
Ξ·c = corestriction Ξ·
section-of-ΞΉ-gives-Ξ·-surjection : (πΌ : T β image Ξ·)
β ΞΉ β πΌ οΌ id
β is-surjection Ξ·
section-of-ΞΉ-gives-Ξ·-surjection πΌ e =
β-is-surjection
(corestrictions-are-surjections Ξ·)
(equivs-are-surjections
(embeddings-with-sections-are-equivs ΞΉ ΞΉ-is-embedding (πΌ , happly e)))
Ο-equiv-gives-Ξ·-surjection
: ({π₯ : Universe} (Y : π₯ Μ ) β is-totally-separated Y β is-equiv (Ο Y))
β is-surjection Ξ·
Ο-equiv-gives-Ξ·-surjection up = section-of-ΞΉ-gives-Ξ·-surjection πΌ III
where
I : is-equiv (Ο (image Ξ·))
I = up (image Ξ·) ΞΉ-image-is-ts
πΌ : T β image Ξ·
πΌ = inverse (Ο (image Ξ·)) I Ξ·c
II : Ο (image Ξ·) πΌ οΌ Ξ·c
II = inverses-are-sections (Ο (image Ξ·)) I Ξ·c
III : ΞΉ β πΌ οΌ id
III = Οβ-of-ts-is-lc T T-is-totally-separated (ΞΉ β πΌ) id
(ap (Ξ» - β ΞΉ β -) II)
π-injective-image-gives-Ξ·-surjection : π-injective (image Ξ·) π€βΊ π€βΊ
β is-surjection Ξ·
π-injective-image-gives-Ξ·-surjection i = section-of-ΞΉ-gives-Ξ·-surjection πΌ III
where
I : Ξ£ πΌ κ (T β image Ξ·) , πΌ β Ξ· βΌ Ξ·c
I = i Ξ· Ξ·-is-π-injecting Ξ·c
πΌ : T β image Ξ·
πΌ = prβ I
II : πΌ β Ξ· βΌ Ξ·c
II = prβ I
III : ΞΉ β πΌ οΌ id
III = Οβ-of-ts-is-lc T T-is-totally-separated (ΞΉ β πΌ) id
(dfunext fe (Ξ» p β ap ΞΉ (II p)))
\end{code}
We now relate T to the general construction of the totally separated reflection
of any type X as the image of the evaluation map X β ((X β π) β π).
\begin{code}
open totally-separated-reflection fe' pt
\end{code}
The comparison map π¬.
\begin{code}
π¬ : π Ξ© β T
π¬ = β!-witness (totally-separated-reflection T-is-totally-separated Ξ·)
π¬-triangle : π¬ β Ξ·α΅ οΌ Ξ·
π¬-triangle = β!-is-witness
(totally-separated-reflection T-is-totally-separated Ξ·)
reflection-gives-π-equivalence
: ({π₯ : Universe} (Y : π₯ Μ ) β is-totally-separated Y β is-equiv (Ο Y))
β is-equiv π¬
reflection-gives-π-equivalence up
= qinvs-are-equivs π¬ (π¬β»ΒΉ , III , IV)
where
I : is-equiv (Ο (π Ξ©))
I = up (π Ξ©) π-is-totally-separated
π¬β»ΒΉ : T β π Ξ©
π¬β»ΒΉ = inverse (Ο (π Ξ©)) I Ξ·α΅
II : Ο (π Ξ©) π¬β»ΒΉ οΌ Ξ·α΅
II = inverses-are-sections (Ο (π Ξ©)) I Ξ·α΅
III : π¬β»ΒΉ β π¬ βΌ id
III = happly VI
where
V : (π¬β»ΒΉ β π¬) β Ξ·α΅ οΌ Ξ·α΅
V = (π¬β»ΒΉ β π¬) β Ξ·α΅ οΌβ¨ ap (Ξ» - β π¬β»ΒΉ β -) π¬-triangle β©
π¬β»ΒΉ β Ξ· οΌβ¨ II β©
Ξ·α΅ β
VI : π¬β»ΒΉ β π¬ οΌ id
VI = witness-uniqueness _
(totally-separated-reflection π-is-totally-separated Ξ·α΅)
(π¬β»ΒΉ β π¬) id V refl
IV : π¬ β π¬β»ΒΉ βΌ id
IV = happly VII
where
VII : π¬ β π¬β»ΒΉ οΌ id
VII = Οβ-of-ts-is-lc T T-is-totally-separated (π¬ β π¬β»ΒΉ) id
(Ο T (π¬ β π¬β»ΒΉ) οΌβ¨ ap (Ξ» - β π¬ β -) II β©
π¬ β Ξ·α΅ οΌβ¨ π¬-triangle β©
Ξ· β)
\end{code}
The above development gives the equivalence
(Ξ© β π) β (π + WEM Γ π)
more or less directly.
\begin{code}
Ο' : (f : Ξ© β π) β is-decidable (f β₯ οΌ f β€) β π + WEM Γ π
Ο' f (inl _) = inl (f β₯)
Ο' f (inr ne) = inr (WEM-lemma f ne , f β₯)
Ο : (Ξ© β π) β π + WEM Γ π
Ο f = Ο' f (π-is-discrete (f β₯) (f β€))
Οβ»ΒΉ : π + WEM Γ π β (Ξ© β π)
Οβ»ΒΉ (inl b) _ = b
Οβ»ΒΉ (inr (w , b)) p = π-cases b (complement b) (Ξ΄ (w p))
ΟΞ· : Οβ»ΒΉ β Ο βΌ id
ΟΞ· f = I (π-is-discrete (f β₯) (f β€))
where
I : (d : is-decidable (f β₯ οΌ f β€)) β Οβ»ΒΉ (Ο' f d) οΌ f
I (inl e) = dfunext fe (Ξ» p β (constancy-lemma f e p)β»ΒΉ)
I (inr ne) = dfunext fe II
where
w : WEM
w = WEM-lemma f ne
II : (p : Ξ©) β π-cases (f β₯) (complement (f β₯)) (Ξ΄ (w p)) οΌ f p
II p = III (w p)
where
III : (d : is-decidable (Β¬ (p holds)))
β π-cases (f β₯) (complement (f β₯)) (Ξ΄ d) οΌ f p
III (inl Ξ½) = (lemma-β₯ f p Ξ½)β»ΒΉ
III (inr Ξ½Ξ½) = complement (f β₯) οΌβ¨ (complement-of-different-booleans ne)β»ΒΉ β©
f β€ οΌβ¨ IV β»ΒΉ β©
f p β
where
IV = π-is-¬¬-separated (f p) (f β€)
(Ξ» Ξ½ β Ξ½Ξ½ (Ξ» ph β Ξ½ (lemma-β€ f p ph)))
ΟΞ΅ : Ο β Οβ»ΒΉ βΌ id
ΟΞ΅ (inl b) = I (π-is-discrete b b)
where
I : (d : is-decidable (b οΌ b)) β Ο' (Οβ»ΒΉ (inl b)) d οΌ inl b
I (inl _) = refl
I (inr ne) = π-elim (ne refl)
ΟΞ΅ (inr (w , b)) = IV (π-is-discrete (f β₯) (f β€))
where
f : Ξ© β π
f = Οβ»ΒΉ (inr (w , b))
I : f β₯ οΌ b
I = ap (π-cases b (complement b)) (Ξ·β β₯ w β₯-doesnt-hold)
II : f β€ οΌ complement b
II = ap (π-cases b (complement b)) (Ξ·β β€ w (¬¬-intro β€-holds))
III : f β₯ β f β€
III e = complement-no-fp b
(b οΌβ¨ I β»ΒΉ β©
f β₯ οΌβ¨ e β©
f β€ οΌβ¨ II β©
complement b β)
IV : (d : is-decidable (f β₯ οΌ f β€)) β Ο' f d οΌ inr (w , b)
IV (inl e) = π-elim (III e)
IV (inr ne) = ap inr (to-Γ-οΌ (WEM-is-prop (WEM-lemma f ne) w) I)
Ξ¨ : (Ξ© β π) β (π + WEM Γ π)
Ξ¨ = Ο , qinvs-are-equivs Ο (Οβ»ΒΉ , ΟΞ· , ΟΞ΅)
\end{code}
We now show that Ξ· : Ξ© β T is the universal map from Ξ© into a totally
separated type if and only if it is a surjection.
\begin{code}
module _ (pt : propositional-truncations-exist) where
open import UF.ImageAndSurjection pt
open PropositionalTruncation pt
open totally-separated-reflection fe' pt
open comparison pt
universal-property : π€Ο
universal-property = {π₯ : Universe} (Y : π₯ Μ )
β is-totally-separated Y
β is-equiv (Ο Y)
universal-property-gives-Ξ·-surjection : universal-property
β is-surjection Ξ·
universal-property-gives-Ξ·-surjection = Ο-equiv-gives-Ξ·-surjection
Ξ·-surjection-gives-universal-property : is-surjection Ξ·
β universal-property
Ξ·-surjection-gives-universal-property Ξ·-surj Y ts = Ο-is-equiv
where
_ : type-of (eval Y) οΌ (Y β ((Y β π) β π))
_ = refl
_ : eval Y οΌ (Ξ» (y : Y) (g : Y β π) β g y)
_ = refl
eval-is-embedding : is-embedding (eval Y)
eval-is-embedding = totally-separated-gives-totally-separatedβ fe ts
Ξ΅ : (Ξ© β Y) β (T β ((Y β π) β π))
Ξ΅ f t g = extensionβ-along-Ξ· (g β f) t
\end{code}
In the next step we show that
Ξ·
Ξ© ββββββββββββββββββββ T
β β
β β
f β β Ξ΅ f
β β
β β
Y ββββββββββββββ ((Y β π) β π)
eval Y
\begin{code}
Ξ΅-square : (f : Ξ© β Y) β Ξ΅ f β Ξ· βΌ eval Y β f
Ξ΅-square f p = dfunext fe (Ξ» g β extensionβ-property (g β f) p)
\end{code}
It is in the following step that the surjectivity of Ξ· is used:
\begin{code}
Ο : (f : Ξ© β Y) (t : T) β fiber (eval Y) (Ξ΅ f t)
Ο f t = β₯β₯-rec (eval-is-embedding (Ξ΅ f t)) I (Ξ·-surj t)
where
I : (Ξ£ p κ Ξ© , Ξ· p οΌ t) β fiber (eval Y) (Ξ΅ f t)
I (p , e) = f p , (eval Y (f p) οΌβ¨ (Ξ΅-square f p)β»ΒΉ β©
Ξ΅ f (Ξ· p) οΌβ¨ ap (Ξ΅ f) e β©
Ξ΅ f t β)
Ο : (Ξ© β Y) β (T β Y)
Ο f t = fiber-point (Ο f t)
\end{code}
Next we show that
T
β±β
β± β
β± β
β± β
β± β
Ο f β± β Ξ΅ f
β± β
β± β
β± β
β β
Y ββββββ ((Y β π) β π)
eval Y
\begin{code}
Ο-triangle : (f : Ξ© β Y) β eval Y β Ο f βΌ Ξ΅ f
Ο-triangle f t = fiber-identification (Ο f t)
\end{code}
Pasting these two diagrams we get that Ο is section of Ο.
\begin{code}
ΟΟ : Ο Y β Ο βΌ id
ΟΟ f = dfunext fe
(Ξ» p β embeddings-are-lc (eval Y) eval-is-embedding
(eval Y (Ο f (Ξ· p)) οΌβ¨ Ο-triangle f (Ξ· p) β©
Ξ΅ f (Ξ· p) οΌβ¨ Ξ΅-square f p β©
eval Y (f p) β))
\end{code}
And that Ο is a retraction of Ο follows from from this and the total
separatedness of Y.
\begin{code}
ΟΟ : Ο β Ο Y βΌ id
ΟΟ g = Ο (Ο Y g) οΌβ¨ Οβ-of-ts-is-lc Y ts (Ο (Ο Y g)) g I β©
g β
where
I : Ο Y (Ο (Ο Y g)) οΌ Ο Y g
I = ΟΟ (Ο Y g)
Ο-is-equiv : is-equiv (Ο Y)
Ο-is-equiv = qinvs-are-equivs (Ο Y) (Ο , ΟΟ , ΟΟ)
\end{code}
So the main question reduces to whether the map Ξ· : Ξ© β T is a
surjection in the absense of propositional resizing, or whether its
surjectivity implies an unprovable form of resizing.
Next we record the immediate fact that Ξ· : Ξ© β T is a surjection if
and only if the comparison map π¬ : π Ξ© β T is an equivalence.
\begin{code}
Οα΅-lc : (g g' : π Ξ© β π) β g β Ξ·α΅ οΌ g' β Ξ·α΅ β g οΌ g'
Οα΅-lc g g' e = dfunext fe
(surjection-induction Ξ·α΅ Ξ·α΅-is-surjection
(Ξ» t β g t οΌ g' t)
(Ξ» t β π-is-set)
(happly e))
π¬-lc : left-cancellable π¬
π¬-lc {x} {y} c = π-is-totally-separated I
where
I : (g : π Ξ© β π) β g x οΌ g y
I g = g x οΌβ¨ (happly Iβ x)β»ΒΉ β©
r (π¬ x) οΌβ¨ ap r c β©
r (π¬ y) οΌβ¨ happly Iβ y β©
g y β
where
r : T β π
r = inverse Οβ Οβ-is-equiv (g β Ξ·α΅)
Iβ : r β Ξ· οΌ g β Ξ·α΅
Iβ = inverses-are-sections Οβ Οβ-is-equiv (g β Ξ·α΅)
Iβ : r β π¬ οΌ g
Iβ = Οα΅-lc (r β π¬) g
((r β π¬) β Ξ·α΅ οΌβ¨ ap (Ξ» - β r β -) π¬-triangle β©
r β Ξ· οΌβ¨ Iβ β©
g β Ξ·α΅ β)
π¬-is-embedding : is-embedding π¬
π¬-is-embedding = lc-maps-into-sets-are-embeddings π¬ π¬-lc T-is-set
π¬-is-surjection : is-surjection Ξ· β is-surjection π¬
π¬-is-surjection Ο t = β₯β₯-functor f (Ο t)
where
f : (Ξ£ p κ Ξ© , Ξ· p οΌ t) β (Ξ£ z κ π Ξ© , π¬ z οΌ t)
f (p , e) = Ξ·α΅ p , (π¬ (Ξ·α΅ p) οΌβ¨ happly π¬-triangle p β©
Ξ· p οΌβ¨ e β©
t β)
Ξ·-surjection-gives-π¬-is-equiv : is-surjection Ξ· β is-equiv π¬
Ξ·-surjection-gives-π¬-is-equiv Ο = surjective-embeddings-are-equivs π¬
π¬-is-embedding
(π¬-is-surjection Ο)
π¬-is-equiv-gives-Ξ·-surjection : is-equiv π¬ β is-surjection Ξ·
π¬-is-equiv-gives-Ξ·-surjection e = transport is-surjection π¬-triangle
(β-is-surjection
Ξ·α΅-is-surjection
(equivs-are-surjections e))
\end{code}
It is worth comparing the development in this file to the earlier
development of the following module:
\begin{code}
import Taboos.P2
\end{code}