Martin Escardo, 17th July 2024.

Sequentially Hausdorff types.

Motivated by https://grossack.site/2024/07/03/life-in-johnstones-topological-topos

The idea in this file, and many files in TypeTopology, is that we are
working in an arbitrary topos, which may or may not be a topological
topos, and we are interested in proving things synthetically in
topological toposes.

\begin{code}

{-# OPTIONS --safe --without-K #-}

open import UF.FunExt

module TypeTopology.SequentiallyHausdorff
        (feβ‚€ : funextβ‚€)
       where

open import CoNaturals.Type
open import MLTT.Spartan
open import Notation.CanonicalMap
open import Taboos.BasicDiscontinuity feβ‚€
open import Taboos.WLPO

\end{code}

A topological space is sequentially Hausdorff if every sequence
converges to at most one point. In our synthetic setting, this can be
formulated as follows, following the above blog post by Chris
Grossack.

\begin{code}

is-sequentially-Hausdorff : 𝓀 Μ‡ β†’ 𝓀 Μ‡
is-sequentially-Hausdorff X = (f g : β„•βˆž β†’ X)
                            β†’ ((n : β„•) β†’ f (ΞΉ n) = g (ΞΉ n))
                            β†’ f ∞ = g ∞

\end{code}

If WLPO holds in our topos, then our topos is not topological, in any
conceivable sense, and no type with two distinct points is
sequentially Hausdorff.

\begin{code}

no-non-trivial-sequentially-Hausdorff-types-under-WLPO
 : WLPO
 β†’ (X : 𝓀 Μ‡ )
 β†’ has-two-distinct-points X
 β†’ Β¬ is-sequentially-Hausdorff X
no-non-trivial-sequentially-Hausdorff-types-under-WLPO
 wlpo X ((xβ‚€ , x₁), d) X-is-seq-Haus = III
 where
  f : β„•βˆž β†’ X
  f u = xβ‚€

  g' : (u : β„•βˆž) β†’ (u = ∞) + (u β‰  ∞) β†’ X
  g' u (inl _) = x₁
  g' u (inr _) = xβ‚€

  g : β„•βˆž β†’ X
  g u = g' u (wlpo u)

  I : (n : β„•) (c : (ΞΉ n = ∞) + (ΞΉ n β‰  ∞)) β†’ g' (ΞΉ n) c = xβ‚€
  I n (inl e) = 𝟘-elim (∞-is-not-finite n (e ⁻¹))
  I n (inr _) = refl

  a : (n : β„•) β†’  f (ΞΉ n) = g (ΞΉ n)
  a n =  f (ι n) =⟨ refl ⟩
         xβ‚€      =⟨ (I n (wlpo (ΞΉ n)))⁻¹ ⟩
         g (ι n) ∎

  II : (c : (∞ = ∞) + (∞ β‰  ∞)) β†’ g' ∞ c = x₁
  II (inl _) = refl
  II (inr ν) = 𝟘-elim (ν refl)

  III : 𝟘
  III = d (xβ‚€  =⟨ refl ⟩
           f ∞ =⟨ X-is-seq-Haus f g a ⟩
           g ∞ =⟨ II (wlpo ∞) ⟩
           x₁  ∎)

\end{code}

The reason WLPO doesn't hold topological in toposes is that the
negation of WLPO is a weak continuity principle [1], which holds in
topological toposes. So it makes sense to investigate which sets are
sequentially Hausdorff assuming Β¬ WLPO or stronger continuity
principles.

[1] https://doi.org/10.1017/S096012951300042X

To begin with, we show that all totally separated types are
sequentially Hausdorff in topological toposes.

\begin{code}

open import TypeTopology.TotallySeparated
open import UF.DiscreteAndSeparated

totally-separated-types-are-sequentially-Hausdorff
 : Β¬ WLPO
 β†’ (X : 𝓀 Μ‡ )
 β†’ is-totally-separated X
 β†’ is-sequentially-Hausdorff X
totally-separated-types-are-sequentially-Hausdorff nwlpo X X-is-ts f g a = II
 where
  I : (p : X β†’ 𝟚) β†’ p (f ∞) = p (g ∞)
  I p = I₃
   where
    Iβ‚€ : (n : β„•) β†’ p (f (ΞΉ n)) = p (g (ΞΉ n))
    Iβ‚€ n = ap p (a n)

    I₁ : p (f ∞) β‰  p (g ∞) β†’ WLPO
    I₁ = disagreement-taboo (p ∘ f) (p ∘ g) Iβ‚€

    Iβ‚‚ : Β¬ (p (f ∞) β‰  p (g ∞))
    Iβ‚‚ = contrapositive I₁ nwlpo

    I₃ : p (f ∞) = p (g ∞)
    I₃ = 𝟚-is-¬¬-separated (p (f ∞)) (p (g ∞)) Iβ‚‚

  II : f ∞ = g ∞
  II = X-is-ts I

\end{code}

There are plenty of totally separated types. For example, the types 𝟚,
β„• and β„•βˆž are totally separated, and the totally separated types are
closed under products (and hence function spaces and more generally
form an exponential ideal) and under retracts, as proved in the above
import TypeTopology.TotallySeparated.

And here is an example of a non-sequentially Hausdorff space, which
was originally offered in the following imported module as an example
of a type which is not totally separated in general. This is the type

    β„•βˆžβ‚‚ = Ξ£ u κž‰ β„•βˆž , (u = ∞ β†’ 𝟚),

which amounts to β„•βˆž with the point ∞ split into two copies

    βˆžβ‚€ = (∞ , Ξ» _ β†’ β‚€),
    βˆžβ‚ = (∞ , Ξ» _ β†’ ₁).

\begin{code}

open import TypeTopology.FailureOfTotalSeparatedness feβ‚€

β„•βˆžβ‚‚-is-not-sequentially-Hausdorff : Β¬ is-sequentially-Hausdorff β„•βˆžβ‚‚
β„•βˆžβ‚‚-is-not-sequentially-Hausdorff h = III
 where
  f g : β„•βˆž β†’ β„•βˆžβ‚‚
  f u = u , Ξ» (e : u = ∞) β†’ β‚€
  g u = u , Ξ» (e : u = ∞) β†’ ₁

  I : (n : β„•) β†’ (Ξ» (e : ΞΉ n = ∞) β†’ β‚€) = (Ξ» (e : ΞΉ n = ∞) β†’ ₁)
  I n = dfunext feβ‚€ (Ξ» (e : ΞΉ n = ∞) β†’ 𝟘-elim (∞-is-not-finite n (e ⁻¹)))

  a : (n : β„•) β†’ f (ΞΉ n) = g (ΞΉ n)
  a n = ap (ΞΉ n ,_) (I n)

  II : βˆžβ‚€ = βˆžβ‚
  II = h f g a

  III : 𝟘
  III = βˆžβ‚€-and-βˆžβ‚-different II

\end{code}

The following was already proved in TypeTopology.FailureOfTotalSeparatedness.

\begin{code}

β„•βˆžβ‚‚-is-not-totally-separated-in-topological-toposes
 : Β¬ WLPO
 β†’ Β¬ is-totally-separated β„•βˆžβ‚‚
β„•βˆžβ‚‚-is-not-totally-separated-in-topological-toposes nwlpo ts =
 β„•βˆžβ‚‚-is-not-sequentially-Hausdorff
  (totally-separated-types-are-sequentially-Hausdorff nwlpo β„•βˆžβ‚‚ ts)

\end{code}

The proof given here is the same, but factored in two steps, by
considering sequentially Hausdorff spaces as an intermediate step.