gist.not-an-apartness
Martin Escardo, 3rd Feb 2025. Does the type โโโ have a tight apartness? I don't think so. Here is an illustrative failed attempt, which satisfies all conditions except cotransitivity. We use the standard apartness relation _โฏ_ on the Cantor type โ โ ๐ to define our attempted apartness relation _#_ on โโโ.{-# OPTIONS --safe --without-K #-} open import UF.FunExt open import UF.PropTrunc module gist.not-an-apartness (fe : Fun-Ext) (pt : propositional-truncations-exist) where open import Apartness.Definition open import CoNaturals.Type open import MLTT.Spartan open import MLTT.Two-Properties open import Notation.CanonicalMap open import Notation.Order open import Taboos.LPO open import TypeTopology.Cantor open import TypeTopology.FailureOfTotalSeparatedness fe open import UF.Base open import UF.DiscreteAndSeparated hiding (_โฏ_) open import UF.Subsingletons open import UF.Subsingletons-FunExt open PropositionalTruncation pt open Apartness pt module failed-attempt where _#_ : โโโ โ โโโ โ ๐คโ ฬ (x@(ฮฑ , _) , f) # (y@(ฮฒ , _) , g) = (ฮฑ โฏ ฮฒ) + (ฮฃ p ๊ x ๏ผ โ , ฮฃ q ๊ y ๏ผ โ , f p โ g q) s : is-strong-apartness _โฏ_ s = โฏ-is-strong-apartness fe I : is-prop-valued _#_ I (x , f) (y , g) (inl a) (inl a') = ap inl (strong-apartness-is-prop-valued _โฏ_ s (ฮน x) (ฮน y) a a') I (x , f) (y , g) (inl a) (inr (p , q , _)) = ๐-elim (strong-apartness-is-irreflexive' _โฏ_ s (ฮน x) (ฮน y) a (ap ฮน (p โ q โปยน))) I (x , f) (y , g) (inr (p , q , _)) (inl a) = ๐-elim (strong-apartness-is-irreflexive' _โฏ_ s (ฮน x) (ฮน y) a (ap ฮน (p โ q โปยน))) I (x , f) (y , g) (inr b) (inr b') = ap inr (ฮฃ-is-prop (โโ-is-set fe) (ฮป p โ ฮฃ-is-prop (โโ-is-set fe) (ฮป q โ negations-are-props fe)) b b') II : is-irreflexive _#_ II (x , f) (inl a) = strong-apartness-is-irreflexive _โฏ_ s (ฮน x) a II (x , f) (inr (p , q , d)) = ๐-elim (d (ap f (โโ-is-set fe p q))) III : is-symmetric _#_ III (x , f) (y , g) (inl a) = inl (strong-apartness-is-symmetric _โฏ_ s (ฮน x) (ฮน y) a) III (x , f) (y , g) (inr (p , q , d)) = inr (q , p , (โ -sym d)) IV : is-tight _#_ IV (x , f) (y , g) ฮฝ = to-ฮฃ-๏ผ (IVโ , IVโ) where IVโ : ยฌ ((ฮน x) โฏ (ฮน y)) IVโ a = ฮฝ (inl a) IVโ : (p : x ๏ผ โ) (q : y ๏ผ โ) โ f p ๏ผ g q IVโ p q = ๐-is-ยฌยฌ-separated (f p) (g q) (ฮป d โ ฮฝ (inr (p , q , d))) IVโ : x ๏ผ y IVโ = to-subtype-๏ผ (being-decreasing-is-prop fe) (โฏ-is-tight fe (ฮน x) (ฮน y) IVโ) IVโ : (r : x ๏ผ y) โ transport (ฮป - โ - ๏ผ โ โ ๐) r f ๏ผ g IVโ refl = dfunext fe (ฮป u โ IVโ u u) IVโ : transport (ฮป - โ - ๏ผ โ โ ๐) IVโ f ๏ผ g IVโ = IVโ IVโ V : is-cotransitive _#_ โ LPO V sc = LPO-criterion fe Vโ where module _ (x : โโ) where ฮฑ : ๐แดบ ฮฑ = ฮน x u : โโโ u = (x , ฮป _ โ โ) a : โโ # โโ a = inr (refl , refl , zero-is-not-one) Vโ : (โโ # u) โจ (โโ # u) Vโ = sc โโ โโ u a Vโ : ((๐ โฏ ฮฑ) + (ฮฃ p ๊ โ ๏ผ โ , ฮฃ q ๊ x ๏ผ โ , โ โ โ)) โจ ((๐ โฏ ฮฑ) + (ฮฃ p ๊ โ ๏ผ โ , ฮฃ q ๊ x ๏ผ โ , โ โ โ)) Vโ = Vโ Vโ : ((๐ โฏ ฮฑ) + (ฮฃ p ๊ โ ๏ผ โ , ฮฃ q ๊ x ๏ผ โ , โ โ โ)) + ((๐ โฏ ฮฑ) + (ฮฃ p ๊ โ ๏ผ โ , ฮฃ q ๊ x ๏ผ โ , โ โ โ)) โ (๐ โฏ ฮฑ) + (ฮฑ ๏ผ ๐) Vโ (inl (inl a)) = inl a Vโ (inl (inr (p , q , d))) = ๐-elim (d refl) Vโ (inr (inl a)) = inl a Vโ (inr (inr (p , q , d))) = inr (ap ฮน q) Vโ : is-prop ((๐ โฏ ฮฑ) + (ฮฑ ๏ผ ๐)) Vโ = sum-of-contradictory-props (โฏ-is-prop-valued fe ๐ ฮฑ) (Cantor-is-set fe) Vโ-โ where Vโ-โ : (๐ โฏ ฮฑ) โ (ฮฑ ๏ผ ๐) โ ๐ {๐คโ} Vโ-โ (n , d , _) refl = d refl Vโ : (๐ โฏ ฮฑ) + (ฮฑ ๏ผ ๐) Vโ = โฅโฅ-rec Vโ Vโ Vโ Vโ : type-of Vโ โ is-decidable (ฮฃ n ๊ โ , ฮฑ n ๏ผ โ) Vโ (inl (n , d , _)) = inl (n , different-from-โ-equal-โ (โ -sym d)) Vโ (inr p) = inr (ฮป (n , q) โ equal-โ-different-from-โ (happly p n) q) Vโ : is-decidable (ฮฃ n ๊ โ , x โ n) Vโ = Vโ VโExperiment (9th Feb 2025). Characterization of wconstant endomaps of the type P + Q, where P and Q are propositions, and hence of when we have a map โฅ P + Q โฅ โ P + Q (by generalized Hedberg). This is to be moved elsewhere when it is tidied up and completed. We show that there is a wconstant endomap of P + Q if and only there are functions gโ : P โ ๐ gโ : (p : P) โ gโ p ๏ผ โ โ Q hโ : Q โ ๐ hโ : (q : Q) โ hโ q ๏ผ โ โ P w : (p : P) (q : Q) โ gโ p ๏ผ hโ q The idea is to get rid of "+", with only the type ๐ left as its shadow.open import UF.Hedberg module _ (P : ๐ค ฬ ) (Q : ๐ฅ ฬ ) (P-is-prop : is-prop P) (Q-is-prop : is-prop Q) where module _ (gโ : P โ ๐) (gโ : (p : P) โ gโ p ๏ผ โ โ Q) (hโ : Q โ ๐) (hโ : (q : Q) โ hโ q ๏ผ โ โ P) (w : (p : P) (q : Q) โ gโ p ๏ผ hโ q) where private fโ : (p : P) (m : ๐) โ gโ p ๏ผ m โ P + Q fโ p โ r = inl p fโ p โ r = inr (gโ p r) fโ : (q : Q) (n : ๐) โ hโ q ๏ผ n โ P + Q fโ q โ s = inl (hโ q s) fโ q โ s = inr q f : P + Q โ P + Q f (inl p) = fโ p (gโ p) refl f (inr q) = fโ q (hโ q) refl private wc : (p : P) (q : Q) (m n : ๐) (r : gโ p ๏ผ m) (s : hโ q ๏ผ n) โ fโ p m r ๏ผ fโ q n s wc p q โ โ r s = ap inl (P-is-prop p (hโ q s)) wc p q โ โ r s = ๐-elim (zero-is-not-one (r โปยน โ w p q โ s)) wc p q โ โ r s = ๐-elim (one-is-not-zero (r โปยน โ w p q โ s)) wc p q โ โ r s = ap inr (Q-is-prop (gโ p r) q) f-is-wconstant : wconstant f f-is-wconstant (inl p) (inl p') = ap (ฮป - โ fโ - (gโ -) refl) (P-is-prop p p') f-is-wconstant (inl p) (inr q) = wc p q (gโ p) (hโ q) refl refl f-is-wconstant (inr q) (inl p) = (wc p q (gโ p) (hโ q) refl refl)โปยน f-is-wconstant (inr q) (inr q') = ap (ฮป - โ fโ - (hโ -) refl) (Q-is-prop q q') module _ (f : P + Q โ P + Q) (f-is-wconstant : wconstant f) where private ฯ : P + Q โ ๐ ฯ (inl p) = โ ฯ (inr q) = โ ฯโ : (z t : P + Q) โ f z ๏ผ t โ ฯ t ๏ผ โ โ Q ฯโ (inl p) (inr q) r s = q ฯโ (inr q) (inr q') r s = q' ฯโ : (z t : P + Q) โ f z ๏ผ t โ ฯ t ๏ผ โ โ P ฯโ (inl p) (inl p') r s = p' ฯโ (inr q) (inl p) r s = p gโ : P โ ๐ gโ p = ฯ (f (inl p)) gโ : (p : P) โ gโ p ๏ผ โ โ Q gโ p = ฯโ (inl p) (f (inl p)) refl hโ : Q โ ๐ hโ q = ฯ (f (inr q)) hโ : (q : Q) โ hโ q ๏ผ โ โ P hโ q = ฯโ (inr q) (f (inr q)) refl private wc : (p : P) (q : Q) (m n : ๐) โ gโ p ๏ผ m โ hโ q ๏ผ n โ m ๏ผ n wc p q โ โ r s = refl wc p q โ โ r s = r โปยน โ ap ฯ (f-is-wconstant (inl p) (inr q)) โ s wc p q โ โ r s = r โปยน โ ap ฯ (f-is-wconstant (inl p) (inr q)) โ s wc p q โ โ r s = refl w : (p : P) (q : Q) โ gโ p ๏ผ hโ q w p q = wc p q (gโ p) (hโ q) refl reflNotice that the second direction doesn't use the fact that P and Q are propositions. But notice also that gโ and hโ are wconstant because f is. So maybe, using this fact, we can instead add the additional requirement that these two functions are wconstant. Of course, if we assume that P and Q are propositions, they are wconstant. In any case, the above two constructions should give a type equivalence, rather than merely a logical equivalence, when P and Q are propositions.