FailureOfTotalSeparatedness

Martin Escardo, 10-12th June 2026.

This is a companion to Ordinals.BrouwerCodesInterpretations.

Recall that Brouwer ordinal codes are countably branching trees,
inductively defined by the constructors

  Z : B,
  S : B β†’ B,
  L : (β„• β†’ B) β†’ B.

The standard interpretation ⟦_βŸ§β‚€, given in
Ordinals.BrouwerCodesInterpretations, interprets Z as the ordinal
zero, S as successor of ordinals, and L as supremum of ordinals (least
upper bound).  See also Ordinals.FailureOfTrichotomy.

The alternative sup-of-extension interpretation ⟦_βŸ§β‚‚, given in the
same file, interprets Z as one (rather than zero), S again as
successor, but L as the supremum of the extension β„•βˆž β†’ Ordinal of a
family β„• β†’ Ordinal, given by the algebraic injectivity of the type of
ordinals as constructed in the file Ordinals.Injectivity.

This non-standard interpretation gives compact (aka searchable)
ordinals. A question we had for some time was whether the resulting
ordinals are also totally separated. Here we answer this in the
negative. More precisely, from the assumption that the resulting
ordinals are totally separated, we conclude that ¬¬ WLPO holds.

More generally, and this is what we start with in this file, we show
that a supremum of totally separated ordinals doesn't need to be
totally separated itself, even if the ordinals are further assumed to
be compact and the index set is assumed to be compact and totally
separated.

To prove this, we show that the supremum of the extension of the
constantly 2 sequence of ordinals is a Sierpinski-like type.


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

open import UF.Univalence
open import UF.PropTrunc
open import UF.Size

module Ordinals.FailureOfTotalSeparatedness
        (ua : Univalence)
        (pt : propositional-truncations-exist)
        (sr : Set-Replacement pt)
       where

open import UF.FunExt
open import UF.Subsingletons
open import UF.UA-FunExt

private
 fe : FunExt
 fe = Univalence-gives-FunExt ua

 fe' : Fun-Ext
 fe' {𝓀} {π“₯} = fe 𝓀 π“₯

 pe : Prop-Ext
 pe = Univalence-gives-Prop-Ext ua

open PropositionalTruncation pt

open import CoNaturals.Type
open import MLTT.Spartan
open import MLTT.Two-Properties
open import Naturals.Order
open import Notation.CanonicalMap
open import Notation.Order
open import Ordinals.Equivalence
open import Ordinals.Injectivity
open import Ordinals.Maps
open import Ordinals.Notions
open import Ordinals.OrdinalOfOrdinals ua
open import Ordinals.OrdinalOfOrdinalsSuprema ua
open import Ordinals.Two
open import Ordinals.Type
open import Ordinals.Underlying
open import UF.Base
open import UF.DiscreteAndSeparated
open import UF.Embeddings
open import UF.Equiv
open import UF.ImageAndSurjection pt
open import UF.Sets
open import UF.Sets-Properties
open import UF.Subsingletons-FunExt
open import UF.Subsingletons-Properties
open import UF.SubtypeClassifier
open import UF.SubtypeClassifier-Properties

open suprema pt sr

private
 extension : (β„• β†’ Ordinal 𝓀₀) β†’ (β„•βˆž β†’ Ordinal 𝓀₀)
 extension Ξ± = Ξ± β†— (embedding-β„•-to-β„•βˆž fe')
  where
   open ordinals-injectivity fe


To achieve the above goal, we work with the constantly 2 sequence of
ordinals, abbreviated Ξ± here.


Ξ± : β„• β†’ Ordinal 𝓀₀
Ξ± _ = πŸšβ‚’

Ξ±Μ… : β„•βˆž β†’ Ordinal 𝓀₀
Ξ±Μ… = extension Ξ±


For u : β„•βˆž, an element of ⟨ Ξ±Μ… u ⟩ is a function ΞΎ : is-finite u β†’ 𝟚,
that is, a partial element of 𝟚 with domain of definition is-finite u.
We let Ο† range over the type is-finite u.


_ : (u : β„•βˆž) β†’ ⟨ Ξ±Μ… u ⟩ = (is-finite u β†’ 𝟚)
_ = Ξ» u β†’ refl

𝓼 : Ordinal 𝓀₀
𝓼 = sup Ξ±Μ…

𝓼-is-set : is-set ⟨ 𝓼 ⟩
𝓼-is-set = underlying-type-is-set fe 𝓼


The following are all the properties of the supremum that we need for
our purposes, all labelled by ΞΈ.


ΞΈ : {u : β„•βˆž} β†’ ⟨ Ξ±Μ… u ⟩ β†’ ⟨ 𝓼 ⟩
ΞΈ {u} = [ Ξ±Μ… u , 𝓼 ]⟨ sup-is-upper-bound Ξ±Μ… u ⟩

ΞΈ-is-simulation : {u : β„•βˆž} β†’ is-simulation (Ξ±Μ… u) 𝓼 ΞΈ
ΞΈ-is-simulation {u} = [ Ξ±Μ… u , 𝓼 ]⟨ sup-is-upper-bound Ξ±Μ… u ⟩-is-simulation

ΞΈ-is-order-preserving : {u : β„•βˆž} β†’ is-order-preserving (Ξ±Μ… u) 𝓼 ΞΈ
ΞΈ-is-order-preserving {u} = simulations-are-order-preserving (Ξ±Μ… u) 𝓼 ΞΈ
                             ΞΈ-is-simulation

ΞΈ-is-initial-segment : {u : β„•βˆž} β†’ is-initial-segment (Ξ±Μ… u) 𝓼 ΞΈ
ΞΈ-is-initial-segment {u} ΞΎ z = simulations-are-initial-segments (Ξ±Μ… u) 𝓼 ΞΈ
                                ΞΈ-is-simulation ΞΎ z

ΞΈ-is-jointly-surjective : (y : ⟨ 𝓼 ⟩) β†’ βˆƒ u κž‰ β„•βˆž , fiber (ΞΈ {u}) y
ΞΈ-is-jointly-surjective = sup-is-upper-bound-jointly-surjective Ξ±Μ…

ΞΈ-downset : {u : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… u ⟩) β†’ 𝓼 ↓ ΞΈ ΞΎ = Ξ±Μ… u ↓ ΞΎ
ΞΈ-downset {u} = initial-segment-of-sup-at-component Ξ±Μ… u


We work with the following alternative formulation of semidecidability.

TODO. In the future, establish this equivalence formally, and probably
move all code for the alternative definition to the file
NotionsOfDecidability.SemiDecidable. But notice that we don't need to
establish this equivalence to get our desired conclusions discussed
above.


is-semidecidable : (X : 𝓀 Μ‡ ) β†’ 𝓀 Μ‡
is-semidecidable X = βˆƒ u κž‰ β„•βˆž , (X ≃ is-finite u)

being-semidecidable-is-prop : (X : 𝓀 Μ‡ )
                            β†’ is-prop (is-semidecidable X)
being-semidecidable-is-prop X = βˆƒ-is-prop

𝟘-is-semidecidable : is-semidecidable 𝟘
𝟘-is-semidecidable = ∣ ∞ , qinveq
                            𝟘-elim
                            ((Ξ» (n , e) β†’ ∞-is-not-finite n (e ⁻¹)) ,
                             (Ξ» z β†’ 𝟘-elim z) ,
                             (Ξ» (n , e) β†’ 𝟘-elim (∞-is-not-finite n (e ⁻¹)))) ∣

πŸ™-is-semidecidable : is-semidecidable (πŸ™ {𝓀})
πŸ™-is-semidecidable = ∣ Zero , qinveq
                              (Ξ» _ β†’ 0 , refl)
                              (unique-to-πŸ™ ,
                               (Ξ» _ β†’ refl) ,
                               (Ξ» Ο† β†’ β„•-to-β„•βˆž-is-embedding fe' Zero
                                       (to-fiber β„•-to-β„•βˆž 0) Ο†)) ∣

π•Š : 𝓀₁ Μ‡
π•Š = Ξ£ p κž‰ Ξ© 𝓀₀ , is-semidecidable (p holds)

βŠ₯β‚› βŠ€β‚› : π•Š
βŠ₯β‚› = βŠ₯ , 𝟘-is-semidecidable
βŠ€β‚› = ⊀ , πŸ™-is-semidecidable


We can think of π•Š as a Sierpinski type. We define the domain of
definition of an element of π•Š as follows.


Ξ΄ : π•Š β†’ Ξ© 𝓀₀
Ξ΄ = pr₁


We order the Sierpinski type as follows.


_β‰Ίβ‚›_ : π•Š β†’ π•Š β†’ 𝓀₁ Μ‡
t β‰Ίβ‚› t' = (Ξ΄ t holds β†’ 𝟘 {𝓀₁}) Γ— (Ξ΄ t' holds)


NB. For simplicity, we are deliberately making the order live in the
universe 𝓀₁, rather than 𝓀₀, because its carrier already lives in 𝓀₁.
A conclusion of our development, recorded below, is that both π•Š and
its order have a copy in 𝓀₀ under our assumptions above.

The Sierpinski type π•Š is a set, its equality is characterized by
logical equivalence of domains of definition, and β‰Ίβ‚› is a well-order,
all of which are immediate.


π•Š-is-set : is-set π•Š
π•Š-is-set = Ξ£-is-set (Ξ©-is-set fe' pe)
            (Ξ» p β†’ props-are-sets
                    (being-semidecidable-is-prop (p holds)))

to-π•Š-= : {t t' : π•Š}
        β†’ (Ξ΄ t holds ↔ Ξ΄ t' holds)
        β†’ t = t'
to-π•Š-= (f , g) = to-subtype-=
                   (Ξ» p β†’ being-semidecidable-is-prop (p holds))
                   (Ξ©-extensionality pe fe' f g)

β‰Ίβ‚›-prop-valued : is-prop-valued _β‰Ίβ‚›_
β‰Ίβ‚›-prop-valued t t' = Γ—-is-prop
                       (Ξ -is-prop fe' (Ξ» _ β†’ 𝟘-is-prop))
                       (holds-is-prop (Ξ΄ t'))

β‰Ίβ‚›-transitive : is-transitive _β‰Ίβ‚›_
β‰Ίβ‚›-transitive t t' t'' (Ξ½ , _) (_ , h') = Ξ½ , h'

β‰Ίβ‚›-extensional : is-extensional _β‰Ίβ‚›_
β‰Ίβ‚›-extensional t t' f g = to-π•Š-= (I , II)
 where
  I : Ξ΄ t holds β†’ Ξ΄ t' holds
  I s = prβ‚‚ (f βŠ₯β‚› (𝟘-elim , s))

  II : Ξ΄ t' holds β†’ Ξ΄ t holds
  II s' = prβ‚‚ (g βŠ₯β‚› (𝟘-elim , s'))


TODO. Find a sensible name for the above projection prβ‚‚. We must have
a definition somewhere. If not, define it at an appropriate file.


β‰Ίβ‚›-well-founded : is-well-founded _β‰Ίβ‚›_
β‰Ίβ‚›-well-founded t = acc (Ξ» _ (Ξ½ , _) β†’ acc (Ξ» _ (_ , h) β†’ 𝟘-elim (Ξ½ h)))

𝓒 : Ordinal 𝓀₁
𝓒 = π•Š , _β‰Ίβ‚›_ , β‰Ίβ‚›-prop-valued ,
    β‰Ίβ‚›-well-founded , β‰Ίβ‚›-extensional , β‰Ίβ‚›-transitive


Eventually we will show that 𝓼 ≃ₒ 𝓒. Notice that the former lives in
the first universe 𝓀₀ and the latter in next universe 𝓀₁, which is one
way of interpreting the choice of capitalization.


𝟎 𝟏 : {u : β„•βˆž} β†’ ⟨ Ξ±Μ… u ⟩
𝟎 Ο† = β‚€
𝟏 Ο† = ₁


The following specialized transports are to make the type checking
performance feasible. We struggled to make the draft versions of this
file to type check, where we used the general transport construction,
with Agda spinning "for ever". We use similar tricks in a number of
places below, for the same reason.


β‰Ί-transportβ‚— : {x x' y : ⟨ 𝓼 ⟩} β†’ x = x' β†’ x β‰ΊβŸ¨ 𝓼 ⟩ y β†’ x' β‰ΊβŸ¨ 𝓼 ⟩ y
β‰Ί-transportβ‚— refl l = l

β‰Ί-transportα΅£ : {x y y' : ⟨ 𝓼 ⟩} β†’ y = y' β†’ x β‰ΊβŸ¨ 𝓼 ⟩ y β†’ x β‰ΊβŸ¨ 𝓼 ⟩ y'
β‰Ί-transportα΅£ refl l = l

β‰Ίβ‚›-transportβ‚— : {t t' r : π•Š} β†’ t = t' β†’ t β‰Ίβ‚› r β†’ t' β‰Ίβ‚› r
β‰Ίβ‚›-transportβ‚— refl l = l

β‰Ίβ‚›-transportα΅£ : {t r r' : π•Š} β†’ r = r' β†’ t β‰Ίβ‚› r β†’ t β‰Ίβ‚› r'
β‰Ίβ‚›-transportα΅£ refl l = l


We have that, for any u : β„•βˆž and ΞΎ : ⟨ Ξ±Μ… u ⟩, the type

  fiber ΞΎ ₁ := (Ξ£ Ο† : is-finite , ΞΎ Ο† = ₁)

is a proposition. We need to show that it is semidecidable.


𝓕 : {u : β„•βˆž} β†’ ⟨ Ξ±Μ… u ⟩ β†’ 𝓀₀ Μ‡
𝓕 ΞΎ = fiber ΞΎ ₁

𝓕-is-prop : {u : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… u ⟩) β†’ is-prop (𝓕 ΞΎ)
𝓕-is-prop {u} ΞΎ = Ξ£-is-prop (being-finite-is-prop fe' u) (Ξ» Ο† β†’ 𝟚-is-set)


To show that the proposition 𝓕 ΞΎ is semidecidable, we construct a
conatural number

 semidecider ΞΎ : β„•βˆž

that is finite if and only if 𝓕 ΞΎ holds.


Ο• : {n : β„•} {u : β„•βˆž} β†’ ΞΉ u n = β‚€ β†’ is-finite u
Ο• {n} {u} = bounded-is-finite fe' n u

finiteness-is-prop : {u : β„•βˆž} β†’ is-prop (is-finite u)
finiteness-is-prop {u} = being-finite-is-prop fe' u

raw-semidecider : {u : β„•βˆž} β†’ ⟨ Ξ±Μ… u ⟩ β†’ (β„• β†’ 𝟚)
raw-semidecider {u} ΞΎ m =
 𝟚-equality-cases
  (Ξ» (e : ΞΉ u m = β‚€) β†’ complement (ΞΎ (Ο• e)))
  (Ξ» (_ : ΞΉ u m = ₁) β†’ ₁)

raw-semidecider-is-decreasing : {u : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… u ⟩)
                              β†’ is-decreasing (raw-semidecider ΞΎ)
raw-semidecider-is-decreasing {u} ΞΎ m = ≀₂-criterion I
 where
  I : raw-semidecider ΞΎ (succ m) = ₁ β†’ raw-semidecider ΞΎ m = ₁
  I e₁ = h (ΞΉ u m) refl
   where
    h : (c : 𝟚) β†’ ΞΉ u m = c β†’ raw-semidecider ΞΎ m = ₁
    h ₁ e = 𝟚-equality-cases₁ e
    h β‚€ e =
     raw-semidecider ΞΎ m                 =⟨ 𝟚-equality-casesβ‚€ e ⟩
     complement (ΞΎ (Ο• e))                =⟨ ap (Ξ» - β†’ complement (ΞΎ -))
                                                (finiteness-is-prop (Ο• e)
                                                  (Ο• (stays-zero u e))) ⟩
     complement (ΞΎ (Ο• (stays-zero u e))) =⟨ (𝟚-equality-casesβ‚€
                                               (stays-zero u e))⁻¹ ⟩
     raw-semidecider ΞΎ (succ m)          =⟨ e₁ ⟩
     ₁                                   ∎


NB. If we write the above chain of equations in the usual TypeTopology
style, e.g. using roman numbers for the equality proofs defined in a
`where` clause (as in some examples below), we get a number of
unsolved constraints.


semidecider : {u : β„•βˆž} β†’ ⟨ Ξ±Μ… u ⟩ β†’ β„•βˆž
semidecider ΞΎ = raw-semidecider ΞΎ , raw-semidecider-is-decreasing ΞΎ

finite-semidecider-gives-𝓕 : {u : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… u ⟩)
                           β†’ is-finite (semidecider ΞΎ)
                           β†’ 𝓕 ΞΎ
finite-semidecider-gives-𝓕 {u} ΞΎ (n , p) = h (ΞΉ u n) refl
 where
  I : raw-semidecider ΞΎ n = β‚€
  I = raw-semidecider ΞΎ n =⟨ (ap (Ξ» - β†’ ΞΉ - n) p)⁻¹ ⟩
      ΞΉ (ΞΉ n) n           =⟨ β„•-to-β„•βˆž-diagonalβ‚€ n ⟩
      β‚€                   ∎

  h : (c : 𝟚) β†’ ΞΉ u n = c β†’ 𝓕 ΞΎ
  h ₁ e = 𝟘-elim (zero-is-not-one
                   (β‚€                   =⟨ I ⁻¹ ⟩
                    raw-semidecider ΞΎ n =⟨ 𝟚-equality-cases₁ e ⟩
                    ₁                   ∎))
  h β‚€ e = Ο† , complementβ‚€ q
   where
    Ο† : is-finite u
    Ο† = Ο• e

    q : complement (ΞΎ Ο†) = β‚€
    q = complement (ΞΎ Ο†)    =⟨ (𝟚-equality-casesβ‚€ e)⁻¹ ⟩
        raw-semidecider ξ n =⟨ I ⟩
        β‚€                   ∎

𝓕-gives-finite-semidecider : {u : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… u ⟩)
                           β†’ 𝓕 ΞΎ
                           β†’ is-finite (semidecider ΞΎ)
𝓕-gives-finite-semidecider {u} ΞΎ ((n , p) , geq) = n , ((IV n I III)⁻¹)
 where
  I : (m : β„•) β†’ m < n β†’ raw-semidecider ΞΎ m = ₁
  I m l = 𝟚-equality-cases₁ Iβ‚€
   where
    Iβ‚€ : ΞΉ u m = ₁
    Iβ‚€ = ΞΉ u m     =⟨ (ap (Ξ» w β†’ ΞΉ w m) p)⁻¹ ⟩
         ι (ι n) m =⟨ <-gives-⊏ m n l ⟩
         ₁         ∎

  II : ΞΉ u n = β‚€
  II = ΞΉ u n     =⟨ (ap (Ξ» w β†’ ΞΉ w n) p)⁻¹ ⟩
       ΞΉ (ΞΉ n) n =⟨ β„•-to-β„•βˆž-diagonalβ‚€ n ⟩
       β‚€         ∎

  III : raw-semidecider ΞΎ n = β‚€
  III = raw-semidecider ΞΎ n    =⟨ 𝟚-equality-casesβ‚€ II ⟩
        complement (ΞΎ (Ο• II))  =⟨ ap (Ξ» - β†’ complement (ΞΎ -))
                                      (finiteness-is-prop (Ο• II) (n , p)) ⟩
        complement (ξ (n , p)) =⟨ ap complement geq ⟩
        β‚€                      ∎

  IV : (n : β„•)
     β†’ ((m : β„•) β†’ m < n β†’ raw-semidecider ΞΎ m = ₁)
     β†’ raw-semidecider ΞΎ n = β‚€
     β†’ semidecider ΞΎ = ΞΉ n
  IV 0         lt a = is-Zero-equal-Zero fe' a
  IV (succ n') lt a = Succ-criterion fe' (lt n' (<-succ n')) a

𝓕-≃-finite-semidecider : {u : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… u ⟩)
                       β†’ 𝓕 ΞΎ ≃ is-finite (semidecider ΞΎ)
𝓕-≃-finite-semidecider ΞΎ = logically-equivalent-props-are-equivalent
                            (𝓕-is-prop ΞΎ)
                            finiteness-is-prop
                            (𝓕-gives-finite-semidecider ΞΎ)
                            (finite-semidecider-gives-𝓕 ΞΎ)

𝓕-is-semidecidable : {u : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… u ⟩) β†’ is-semidecidable (𝓕 ΞΎ)
𝓕-is-semidecidable ΞΎ = ∣ semidecider ΞΎ , 𝓕-≃-finite-semidecider ΞΎ ∣

𝔽 : {u : β„•βˆž} β†’ ⟨ Ξ±Μ… u ⟩ β†’ π•Š
𝔽 ΞΎ = (𝓕 ΞΎ , 𝓕-is-prop ΞΎ) , 𝓕-is-semidecidable ΞΎ


We now show that 𝔽 is order preserving.


disjoint-fibers : {u : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… u ⟩) β†’ fiber ΞΎ β‚€ β†’ fiber ΞΎ ₁ β†’ 𝟘
disjoint-fibers ΞΎ (Ο†β‚€ , eβ‚€) (φ₁ , e₁) = one-is-not-zero I
 where
  I : ₁ = β‚€
  I = ₁    =⟨ e₁ ⁻¹ ⟩
      ΞΎ φ₁ =⟨ ap ΞΎ (finiteness-is-prop φ₁ Ο†β‚€) ⟩
      ΞΎ Ο†β‚€ =⟨ eβ‚€ ⟩
      β‚€    ∎

𝔽-is-order-preserving : {u : β„•βˆž} β†’ is-order-preserving (Ξ±Μ… u) 𝓒 𝔽
𝔽-is-order-preserving ξ₁ ΞΎβ‚‚ (Ο† , l) =
 (Ξ» s β†’ 𝟘-elim (disjoint-fibers ξ₁ (Ο† , β‰Ίβ‚‚-left l) s)) ,
 (Ο† , β‰Ίβ‚‚-right l)


If the lower sets of ΞΎ and ΞΎ' in the ordinals Ξ±Μ… u and Ξ±Μ… u' are equal,
then so are 𝔽 ΞΎ and 𝔽 ΞΎ'.


↓-to-𝔽-= : {u u' : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… u ⟩) (ΞΎ' : ⟨ Ξ±Μ… u' ⟩)
         β†’ Ξ±Μ… u ↓ ΞΎ = Ξ±Μ… u' ↓ ΞΎ'
         β†’ 𝔽 ΞΎ = 𝔽 ΞΎ'
↓-to-𝔽-= {u} {u'} ΞΎ ΞΎ' e = to-π•Š-= (IV , V)
 where
  I : (Ξ£ ΞΆ κž‰ ⟨ Ξ±Μ… u ⟩ , ΞΆ β‰ΊβŸ¨ Ξ±Μ… u ⟩ ΞΎ) = (Ξ£ ΞΆ' κž‰ ⟨ Ξ±Μ… u' ⟩ , ΞΆ' β‰ΊβŸ¨ Ξ±Μ… u' ⟩ ΞΎ')
  I = ap ⟨_⟩ e

  II : {w : β„•βˆž} (ρ : ⟨ Ξ±Μ… w ⟩) β†’ 𝓕 ρ β†’ Ξ£ ΞΆ κž‰ ⟨ Ξ±Μ… w ⟩ , ΞΆ β‰ΊβŸ¨ Ξ±Μ… w ⟩ ρ
  II ρ (Ο† , eβ‚‚) = 𝟎 , Ο† , β‰Ίβ‚‚-left-right refl eβ‚‚

  III : {w w' : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… w ⟩) (ΞΎ' : ⟨ Ξ±Μ… w' ⟩)
      β†’ ((Ξ£ ΞΆ κž‰ ⟨ Ξ±Μ… w ⟩ , ΞΆ β‰ΊβŸ¨ Ξ±Μ… w ⟩ ΞΎ) β†’ (Ξ£ ΞΆ' κž‰ ⟨ Ξ±Μ… w' ⟩ , ΞΆ' β‰ΊβŸ¨ Ξ±Μ… w' ⟩ ΞΎ'))
      β†’ 𝓕 ΞΎ
      β†’ 𝓕 ΞΎ'
  III {w} {w'} ΞΎ ΞΎ' h s = IIIβ‚€ (h (II ΞΎ s))
   where
    IIIβ‚€ : (Ξ£ ΞΆ' κž‰ ⟨ Ξ±Μ… w' ⟩ , ΞΆ' β‰ΊβŸ¨ Ξ±Μ… w' ⟩ ΞΎ') β†’ 𝓕 ΞΎ'
    IIIβ‚€ (ΞΆ' , ψ , l) = ψ , β‰Ίβ‚‚-right l

  IV : 𝓕 ΞΎ β†’ 𝓕 ΞΎ'
  IV = III ΞΎ ΞΎ' (Idtofun I)

  V : 𝓕 ΞΎ' β†’ 𝓕 ΞΎ
  V = III ξ' ξ (Idtofun (I ⁻¹))

ΞΈ-to-𝔽-= : {u u' : β„•βˆž} {ΞΎ : ⟨ Ξ±Μ… u ⟩} {ΞΎ' : ⟨ Ξ±Μ… u' ⟩}
         β†’ ΞΈ ΞΎ = ΞΈ ΞΎ'
         β†’ 𝔽 ΞΎ = 𝔽 ΞΎ'
ΞΈ-to-𝔽-= {u} {u'} {ΞΎ} {ΞΎ'} e = ↓-to-𝔽-= ΞΎ ΞΎ' I
 where
  I : Ξ±Μ… u ↓ ΞΎ = Ξ±Μ… u' ↓ ΞΎ'
  I = Ξ±Μ… u ↓ ΞΎ   =⟨ (ΞΈ-downset ΞΎ)⁻¹ ⟩
      𝓼 ↓ ΞΈ ΞΎ   =⟨ ap (𝓼 ↓_) e ⟩
      𝓼 ↓ ΞΈ ΞΎ'  =⟨ ΞΈ-downset ΞΎ' ⟩
      Ξ±Μ… u' ↓ ΞΎ' ∎


We now define a map Ο„ : ⟨ 𝓼 ⟩ β†’ π•Š by first defining a type-valued
version T of it, after showing that it is singleton-valued. Although
T-point gives data, it is defined by propositional-truncation
induction, and, for that purpose, we first need to show that T is
proposition valued. Getting the construction of Ο„ using something such
as T was the biggest headache of this file, luckily with a
simple-looking solution.


T : ⟨ 𝓼 ⟩ β†’ 𝓀₁ Μ‡
T y = Ξ£ t κž‰ π•Š , ((u : β„•βˆž) (ΞΎ : ⟨ Ξ±Μ… u ⟩) β†’ ΞΈ ΞΎ = y β†’ 𝔽 ΞΎ = t)

T-is-prop-valued : (y : ⟨ 𝓼 ⟩) β†’ is-prop (T y)
T-is-prop-valued y (t , h) (t' , h') =
 to-subtype-=
  (Ξ» - β†’ Π₃-is-prop fe' (Ξ» u ΞΎ e β†’ π•Š-is-set))
  (βˆ₯βˆ₯-rec π•Š-is-set (Ξ» (u , ΞΎ , e) β†’ t   =⟨ (h u ΞΎ e)⁻¹ ⟩
                                    𝔽 ΞΎ =⟨ h' u ΞΎ e ⟩
                                    t'  ∎)
  (ΞΈ-is-jointly-surjective y))

T-point : (y : ⟨ 𝓼 ⟩) β†’ T y
T-point y = βˆ₯βˆ₯-rec (T-is-prop-valued y) I (ΞΈ-is-jointly-surjective y)
 where
  I : (Ξ£ u κž‰ β„•βˆž , Ξ£ ΞΎ κž‰ ⟨ Ξ±Μ… u ⟩ , ΞΈ ΞΎ = y) β†’ T y
  I (u , ΞΎ , e) = 𝔽 ΞΎ , (Ξ» u' ΞΎ' e' β†’ ΞΈ-to-𝔽-= (Iβ‚€ ΞΎ' e'))
   where
    Iβ‚€ : {u' : β„•βˆž} (ΞΎ' : ⟨ Ξ±Μ… u' ⟩) β†’ ΞΈ ΞΎ' = y β†’ ΞΈ ΞΎ' = ΞΈ ΞΎ
    Iβ‚€ ΞΎ' e' = ΞΈ ΞΎ' =⟨ e' ⟩
               y    =⟨ e ⁻¹ ⟩
               θ ξ  ∎

Ο„ : ⟨ 𝓼 ⟩ β†’ π•Š
Ο„ y = pr₁ (T-point y)


We have that Ο„ ∘ ΞΈ ∼ 𝔽. For future use, it is convenient to formulate
this in the following equivalent form, and in any case this is what
the definition of T gives directly.


by-construction-of-Ο„ : {u : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… u ⟩) (y : ⟨ 𝓼 ⟩)
                     β†’ ΞΈ ΞΎ = y
                     β†’ Ο„ y = 𝔽 ΞΎ
by-construction-of-Ο„ {u} ΞΎ y e = (prβ‚‚ (T-point y) u ΞΎ e)⁻¹

Ο„-fiber-transport : {y : ⟨ 𝓼 ⟩} {t t' : π•Š}
                  β†’ t = t'
                  β†’ (Ξ£ yβ‚€ κž‰ ⟨ 𝓼 ⟩ , (yβ‚€ β‰ΊβŸ¨ 𝓼 ⟩ y) Γ— (Ο„ yβ‚€ = t))
                  β†’ (Ξ£ yβ‚€ κž‰ ⟨ 𝓼 ⟩ , (yβ‚€ β‰ΊβŸ¨ 𝓼 ⟩ y) Γ— (Ο„ yβ‚€ = t'))
Ο„-fiber-transport refl Οƒ = Οƒ

Ο„-βŠ₯-no-preds : (u : β„•βˆž) (ΞΎ : ⟨ Ξ±Μ… u ⟩) (y z : ⟨ 𝓼 ⟩)
             β†’ ΞΈ ΞΎ = y
             β†’ Ο„ y = βŠ₯β‚›
             β†’ Β¬ (z β‰ΊβŸ¨ 𝓼 ⟩ y)
Ο„-βŠ₯-no-preds u ΞΎ y z e c l = II (ΞΈ-is-initial-segment ΞΎ z l')
 where
  l' : z β‰ΊβŸ¨ 𝓼 ⟩ ΞΈ ΞΎ
  l' = β‰Ί-transportα΅£ (e ⁻¹) l

  I : 𝔽 ΞΎ = βŠ₯β‚›
  I = 𝔽 ΞΎ =⟨ (by-construction-of-Ο„ ΞΎ y e)⁻¹ ⟩
      Ο„ y =⟨ c ⟩
      βŠ₯β‚›  ∎

  II : (Ξ£ ΞΎβ‚€ κž‰ ⟨ Ξ±Μ… u ⟩ , (ΞΎβ‚€ β‰ΊβŸ¨ Ξ±Μ… u ⟩ ΞΎ) Γ— (ΞΈ ΞΎβ‚€ = z)) β†’ 𝟘 {𝓀₀}
  II (ΞΎβ‚€ , m , p) = transport (Ξ» - β†’ Ξ΄ - holds) I
                     (prβ‚‚ (𝔽-is-order-preserving ΞΎβ‚€ ΞΎ m))

Ο„-lc-at-βŠ₯ : (y y' : ⟨ 𝓼 ⟩) β†’ Ο„ y = βŠ₯β‚› β†’ Ο„ y' = βŠ₯β‚› β†’ y = y'
Ο„-lc-at-βŠ₯ y y' c c' =
 βˆ₯βˆ₯-recβ‚‚ 𝓼-is-set I (ΞΈ-is-jointly-surjective y) (ΞΈ-is-jointly-surjective y')
 where
  I : (Ξ£ u  κž‰ β„•βˆž , Ξ£ ΞΎ  κž‰ ⟨ Ξ±Μ… u  ⟩ , ΞΈ ΞΎ  = y)
    β†’ (Ξ£ u' κž‰ β„•βˆž , Ξ£ ΞΎ' κž‰ ⟨ Ξ±Μ… u' ⟩ , ΞΈ ΞΎ' = y')
    β†’ y = y'
  I (u , ΞΎ , e) (u' , ΞΎ' , e') = Extensionality 𝓼 y y' f g
   where
    f : (z : ⟨ 𝓼 ⟩) β†’ z β‰ΊβŸ¨ 𝓼 ⟩ y β†’ z β‰ΊβŸ¨ 𝓼 ⟩ y'
    f z l = 𝟘-elim (Ο„-βŠ₯-no-preds u ΞΎ y z e c l)

    g : (z : ⟨ 𝓼 ⟩) β†’ z β‰ΊβŸ¨ 𝓼 ⟩ y' β†’ z β‰ΊβŸ¨ 𝓼 ⟩ y
    g z l = 𝟘-elim (Ο„-βŠ₯-no-preds u' ΞΎ' y' z e' c' l)


We now show that the map Ο„ is a simulation. For the initial-segment
property, the crucial point is that the only β‰Ίβ‚›-predecessor of
anything is βŠ₯β‚›, whose Ο„-preimages are unique by the previous lemma, so
that the required Ξ£-type is a proposition.


Ο„-lemma₁ : (y y' : ⟨ 𝓼 ⟩)
         β†’ {u  : β„•βˆž} (ΞΎ  : ⟨ Ξ±Μ… u ⟩)
           {u' : β„•βˆž} (ΞΎ' : ⟨ Ξ±Μ… u' ⟩)
         β†’ ΞΈ ΞΎ  = y
         β†’ ΞΈ ΞΎ' = y'
         β†’ y β‰ΊβŸ¨ 𝓼 ⟩ y'
         β†’ Ο„ y β‰Ίβ‚› Ο„ y'
Ο„-lemma₁ y y' ΞΎ {u'} ΞΎ' e e' l = III (ΞΈ-is-initial-segment ΞΎ' (ΞΈ ΞΎ) II)
 where
  I : ΞΈ ΞΎ β‰ΊβŸ¨ 𝓼 ⟩ y'
  I = β‰Ί-transportβ‚— (e ⁻¹) l

  II : ΞΈ ΞΎ β‰ΊβŸ¨ 𝓼 ⟩ ΞΈ ΞΎ'
  II = β‰Ί-transportα΅£ (e' ⁻¹) I

  III : (Ξ£ ΞΎβ‚€ κž‰ ⟨ Ξ±Μ… u' ⟩ , (ΞΎβ‚€ β‰ΊβŸ¨ Ξ±Μ… u' ⟩ ΞΎ') Γ— (ΞΈ ΞΎβ‚€ = ΞΈ ΞΎ))
      β†’ Ο„ y β‰Ίβ‚› Ο„ y'
  III (ΞΎβ‚€ , m , p) = IIIβ‚…
   where
    IIIβ‚€ : 𝔽 ΞΎβ‚€ β‰Ίβ‚› 𝔽 ΞΎ'
    IIIβ‚€ = 𝔽-is-order-preserving ΞΎβ‚€ ΞΎ' m

    III₁ : 𝔽 ΞΎ' = Ο„ y'
    III₁ = (by-construction-of-Ο„ ΞΎ' y' e') ⁻¹

    IIIβ‚‚ : ΞΈ ΞΎβ‚€ = y
    IIIβ‚‚ = ΞΈ ΞΎβ‚€ =⟨ p ⟩
           θ ξ  =⟨ e ⟩
           y    ∎

    III₃ : 𝔽 ΞΎβ‚€ = Ο„ y
    III₃ = (by-construction-of-Ο„ ΞΎβ‚€ y IIIβ‚‚) ⁻¹

    IIIβ‚„ : 𝔽 ΞΎβ‚€ β‰Ίβ‚› Ο„ y'
    IIIβ‚„ = β‰Ίβ‚›-transportα΅£ {𝔽 ΞΎβ‚€} {𝔽 ΞΎ'} {Ο„ y'} III₁ IIIβ‚€

    IIIβ‚… : Ο„ y β‰Ίβ‚› Ο„ y'
    IIIβ‚… = β‰Ίβ‚›-transportβ‚— {𝔽 ΞΎβ‚€} {Ο„ y} {Ο„ y'} III₃ IIIβ‚„

Ο„-is-order-preserving : is-order-preserving 𝓼 𝓒 Ο„
Ο„-is-order-preserving y y' l =
 βˆ₯βˆ₯-rec (β‰Ίβ‚›-prop-valued (Ο„ y) (Ο„ y'))
  (Ξ» (u , ΞΎ , e) β†’ βˆ₯βˆ₯-rec
                     (β‰Ίβ‚›-prop-valued (Ο„ y) (Ο„ y'))
                     (Ξ» (u' , ΞΎ' , e') β†’ Ο„-lemma₁ y y' ΞΎ ΞΎ' e e' l)
                     (ΞΈ-is-jointly-surjective y'))
  (ΞΈ-is-jointly-surjective y)

Ο„-lemmaβ‚‚ : (y : ⟨ 𝓼 ⟩) {u : β„•βˆž} (ΞΎ : ⟨ Ξ±Μ… u ⟩)
         β†’ ΞΈ ΞΎ = y
         β†’ 𝓕 ΞΎ
         β†’ Ξ£ yβ‚€ κž‰ ⟨ 𝓼 ⟩ , (yβ‚€ β‰ΊβŸ¨ 𝓼 ⟩ y) Γ— (Ο„ yβ‚€ = βŠ₯β‚›)
Ο„-lemmaβ‚‚ y ΞΎ e (Ο† , e') = ΞΈ 𝟎 , II , III
 where
  I : ΞΈ 𝟎 β‰ΊβŸ¨ 𝓼 ⟩ ΞΈ ΞΎ
  I = ΞΈ-is-order-preserving 𝟎 ΞΎ (Ο† , β‰Ίβ‚‚-left-right refl e')

  II : ΞΈ 𝟎 β‰ΊβŸ¨ 𝓼 ⟩ y
  II = β‰Ί-transportα΅£ e I

  III : Ο„ (ΞΈ 𝟎) = βŠ₯β‚›
  III = Ο„ (ΞΈ 𝟎) =⟨ by-construction-of-Ο„ 𝟎 (ΞΈ 𝟎) refl ⟩
        𝔽 𝟎     =⟨ to-π•Š-= ((disjoint-fibers 𝟎 (Ο† , refl)) , 𝟘-elim) ⟩
        βŠ₯β‚›       ∎

Ο„-is-initial-segment : is-initial-segment 𝓼 𝓒 Ο„
Ο„-is-initial-segment y t (Ξ½ , h) = V
 where
  I : βŠ₯β‚› = t
  I = to-π•Š-= (𝟘-elim , (Ξ» s β†’ 𝟘-elim (Ξ½ s)))

  II : is-prop (Ξ£ yβ‚€ κž‰ ⟨ 𝓼 ⟩ , (yβ‚€ β‰ΊβŸ¨ 𝓼 ⟩ y) Γ— (Ο„ yβ‚€ = βŠ₯β‚›))
  II (yβ‚€ , m , c) (yβ‚€' , m' , c') =
   to-subtype-=
    (Ξ» y₁ β†’ Γ—-is-prop (Prop-valuedness 𝓼 y₁ y) π•Š-is-set)
    (Ο„-lc-at-βŠ₯ yβ‚€ yβ‚€' c c')

  III : (Ξ£ u κž‰ β„•βˆž , Ξ£ ΞΎ κž‰ ⟨ Ξ±Μ… u ⟩ , ΞΈ ΞΎ = y)
      β†’ Ξ£ yβ‚€ κž‰ ⟨ 𝓼 ⟩ , (yβ‚€ β‰ΊβŸ¨ 𝓼 ⟩ y) Γ— (Ο„ yβ‚€ = βŠ₯β‚›)
  III (u , ΞΎ , e) = Ο„-lemmaβ‚‚ y ΞΎ e s
   where
    s : 𝓕 ΞΎ
    s = transport (Ξ» - β†’ Ξ΄ - holds) (by-construction-of-Ο„ ΞΎ y e) h

  IV : Ξ£ yβ‚€ κž‰ ⟨ 𝓼 ⟩ , (yβ‚€ β‰ΊβŸ¨ 𝓼 ⟩ y) Γ— (Ο„ yβ‚€ = βŠ₯β‚›)
  IV = βˆ₯βˆ₯-rec II III (ΞΈ-is-jointly-surjective y)

  V : Ξ£ yβ‚€ κž‰ ⟨ 𝓼 ⟩ , (yβ‚€ β‰ΊβŸ¨ 𝓼 ⟩ y) Γ— (Ο„ yβ‚€ = t)
  V = Ο„-fiber-transport I IV


Which gives the desired conclusion.


Ο„-is-simulation : is-simulation 𝓼 𝓒 Ο„
Ο„-is-simulation = Ο„-is-initial-segment , Ο„-is-order-preserving


We continue with more lemmas about Ο„.


Ο„-is-surjection : is-surjection Ο„
Ο„-is-surjection (p , Οƒ) = IV
 where
  I : (Ξ£ u κž‰ β„•βˆž , (p holds ≃ is-finite u))
    β†’ fiber Ο„ (p , Οƒ)
  I (u , 𝕗) = ΞΈ 𝟏 , III
   where
    II : 𝔽 𝟏 = (p , Οƒ)
    II = to-π•Š-= (IIβ‚€ , II₁)
     where
      IIβ‚€ : 𝓕 𝟏 β†’ p holds
      IIβ‚€ (Ο† , _) = ⌜ 𝕗 ⌝⁻¹ Ο†

      II₁ : p holds β†’ 𝓕 𝟏
      II₁ s = ⌜ 𝕗 ⌝ s , refl

    III : Ο„ (ΞΈ 𝟏) = (p , Οƒ)
    III = Ο„ (ΞΈ 𝟏) =⟨ by-construction-of-Ο„ 𝟏 (ΞΈ 𝟏) refl ⟩
          𝔽 𝟏     =⟨ II ⟩
          (p , Οƒ)  ∎

  IV : βˆ₯ fiber Ο„ (p , Οƒ) βˆ₯
  IV = βˆ₯βˆ₯-functor I Οƒ


A surjective simulation is an order equivalence, and so we get the
promised description of the supremum.


Ο„-lc : left-cancellable Ο„
Ο„-lc = simulations-are-lc 𝓼 𝓒 Ο„ Ο„-is-simulation

Ο„-is-embedding : is-embedding Ο„
Ο„-is-embedding = lc-maps-into-sets-are-embeddings Ο„ Ο„-lc π•Š-is-set

Ο„-is-equiv : is-equiv Ο„
Ο„-is-equiv = surjective-embeddings-are-equivs Ο„ Ο„-is-embedding Ο„-is-surjection

Ο„-is-order-reflecting : is-order-reflecting 𝓼 𝓒 Ο„
Ο„-is-order-reflecting y y' l = I (Ο„-is-initial-segment y' (Ο„ y) l)
 where
  I : (Ξ£ yβ‚€ κž‰ ⟨ 𝓼 ⟩ , (yβ‚€ β‰ΊβŸ¨ 𝓼 ⟩ y') Γ— (Ο„ yβ‚€ = Ο„ y)) β†’ y β‰ΊβŸ¨ 𝓼 ⟩ y'
  I (yβ‚€ , m , c) = β‰Ί-transportβ‚— (Ο„-lc c) m

τ⁻¹ : π•Š β†’ ⟨ 𝓼 ⟩
τ⁻¹ = inverse Ο„ Ο„-is-equiv

τ⁻¹-is-order-preserving : is-order-preserving 𝓒 𝓼 τ⁻¹
τ⁻¹-is-order-preserving =
 order-reflecting-gives-inverse-order-preserving 𝓼 𝓒 Ο„ Ο„-is-equiv
  Ο„-is-order-reflecting


Therefore, as promised, the sup of Ξ±Μ… is 𝓒:


𝓼-is-𝓒 : 𝓼 ≃ₒ 𝓒
𝓼-is-𝓒 = Ο„ , Ο„-is-order-preserving , Ο„-is-equiv , τ⁻¹-is-order-preserving

βŸ¨π“ΌβŸ©-is-π•Š : ⟨ 𝓼 ⟩ ≃ π•Š
βŸ¨π“ΌβŸ©-is-π•Š = ≃ₒ-gives-≃ 𝓼 𝓒 𝓼-is-𝓒


As a corollary, we conclude that, although π•Š lives in 𝓀₁ by
construction, it has a copy in 𝓀₀, as mentioned above.


π•Š-is-small : is-small π•Š
π•Š-is-small = ⟨ 𝓼 ⟩ , βŸ¨π“ΌβŸ©-is-π•Š


The underlying type of the ordinal 𝓼, or equivalently the type π•Š,
fails to be totally separated in general in the following sense: its
total separatedness implies the constructive taboo ¬¬ WLPO, which is a
principle that fails in both Johnstone's Topological Topos and Hylands
Effective Topos, for instance.


open import TypeTopology.TotallySeparated
open import Taboos.WLPO
open import Taboos.BasicDiscontinuity fe'

being-finite-is-semidecidable : (u : β„•βˆž) β†’ is-semidecidable (is-finite u)
being-finite-is-semidecidable u = ∣ u , ≃-refl (is-finite u) ∣

is-fin : β„•βˆž β†’ π•Š
is-fin u = (is-finite u , being-finite-is-prop fe' u) ,
           being-finite-is-semidecidable u

naturals-are-fin : (n : β„•) β†’ is-fin (ΞΉ n) = βŠ€β‚›
naturals-are-fin n = to-π•Š-= ((Ξ» _ β†’ ⋆) , (Ξ» _ β†’ n , refl))

∞-is-not-fin : is-fin ∞ = βŠ₯β‚›
∞-is-not-fin = to-π•Š-= (is-infinite-∞ , 𝟘-elim)

βŠ₯β‚›-is-not-βŠ€β‚› : βŠ₯β‚› β‰  βŠ€β‚›
βŠ₯β‚›-is-not-βŠ€β‚› e = transport (Ξ» - β†’ Ξ΄ - holds) (e ⁻¹) ⋆

π•Š-separation-gives-WLPO : (p : π•Š β†’ 𝟚) β†’ p βŠ₯β‚› β‰  p βŠ€β‚› β†’ WLPO
π•Š-separation-gives-WLPO p Ξ½ = h (p βŠ₯β‚›) (p βŠ€β‚›) refl refl
 where
  q : β„•βˆž β†’ 𝟚
  q u = p (is-fin u)

  qβ‚€ : (n : β„•) β†’ q (ΞΉ n) = p βŠ€β‚›
  qβ‚€ n = ap p (naturals-are-fin n)

  q∞ : q ∞ = p βŠ₯β‚›
  q∞ = ap p ∞-is-not-fin

  h : (b c : 𝟚) β†’ p βŠ₯β‚› = b β†’ p βŠ€β‚› = c β†’ WLPO
  h β‚€ β‚€ e e' = 𝟘-elim (Ξ½ (p βŠ₯β‚› =⟨ e ⟩
                          β‚€    =⟨ e' ⁻¹ ⟩
                          p βŠ€β‚› ∎))
  h β‚€ ₁ e e' = basic-discontinuity-taboo (Ξ» u β†’ complement (q u)) (Iβ‚€ , I∞)
   where
    Iβ‚€ : (n : β„•) β†’ complement (q (ΞΉ n)) = β‚€
    Iβ‚€ n = complement (q (ΞΉ n)) =⟨ ap complement (qβ‚€ n) ⟩
           complement (p βŠ€β‚›)    =⟨ ap complement e' ⟩
           β‚€                    ∎

    I∞ : complement (q ∞) = ₁
    I∞ = complement (q ∞)  =⟨ ap complement q∞ ⟩
         complement (p βŠ₯β‚›) =⟨ ap complement e ⟩
         ₁                 ∎
  h ₁ β‚€ e e' = basic-discontinuity-taboo q (Iβ‚€ , I∞)
   where
    Iβ‚€ : (n : β„•) β†’ q (ΞΉ n) = β‚€
    Iβ‚€ n = q (ΞΉ n) =⟨ qβ‚€ n ⟩
           p βŠ€β‚›    =⟨ e' ⟩
           β‚€       ∎

    I∞ : q ∞ = ₁
    I∞ = q ∞  =⟨ q∞ ⟩
         p βŠ₯β‚› =⟨ e ⟩
         ₁    ∎
  h ₁ ₁ e e' = 𝟘-elim (Ξ½ (p βŠ₯β‚› =⟨ e ⟩
                          ₁    =⟨ e' ⁻¹ ⟩
                          p βŠ€β‚› ∎))

π•Š-totally-separated-gives-¬¬WLPO : is-totally-separated π•Š β†’ ¬¬ WLPO
π•Š-totally-separated-gives-¬¬WLPO ts nwlpo = βŠ₯β‚›-is-not-βŠ€β‚› (ts I)
 where
  I : (p : π•Š β†’ 𝟚) β†’ p βŠ₯β‚› = p βŠ€β‚›
  I p = h (p βŠ₯β‚›) (p βŠ€β‚›) refl refl
   where
    h : (b c : 𝟚) β†’ p βŠ₯β‚› = b β†’ p βŠ€β‚› = c β†’ p βŠ₯β‚› = p βŠ€β‚›
    h β‚€ β‚€ e e' = p βŠ₯β‚› =⟨ e ⟩
                 β‚€    =⟨ e' ⁻¹ ⟩
                 p βŠ€β‚› ∎
    h β‚€ ₁ e e' = 𝟘-elim (nwlpo (π•Š-separation-gives-WLPO p Ξ½))
     where
      Ξ½ : p βŠ₯β‚› β‰  p βŠ€β‚›
      Ξ½ d = zero-is-not-one (β‚€    =⟨ e ⁻¹ ⟩
                             p βŠ₯β‚› =⟨ d ⟩
                             p βŠ€β‚› =⟨ e' ⟩
                             ₁    ∎)
    h ₁ β‚€ e e' = 𝟘-elim (nwlpo (π•Š-separation-gives-WLPO p Ξ½))
     where
      Ξ½ : p βŠ₯β‚› β‰  p βŠ€β‚›
      Ξ½ d = one-is-not-zero (₁    =⟨ e ⁻¹ ⟩
                             p βŠ₯β‚› =⟨ d ⟩
                             p βŠ€β‚› =⟨ e' ⟩
                             β‚€    ∎)
    h ₁ ₁ e e' = p βŠ₯β‚› =⟨ e ⟩
                 ₁    =⟨ e' ⁻¹ ⟩
                 p βŠ€β‚› ∎

𝓼-totally-separated-gives-¬¬WLPO : is-totally-separated ⟨ 𝓼 ⟩ β†’ ¬¬ WLPO
𝓼-totally-separated-gives-¬¬WLPO ts =
 π•Š-totally-separated-gives-¬¬WLPO (equiv-to-totally-separated βŸ¨π“ΌβŸ©-is-π•Š ts)


Putting the above together, we get the desired counter-example
discussed in the introduction to this file.


open import TypeTopology.CompactTypes
open import TypeTopology.GenericConvergentSequenceCompactness fe'
open import TypeTopology.MicroTychonoff

counterexample-to-total-separatedess
 : Ξ£ I κž‰ (𝓀₀ Μ‡ ) ,
   Ξ£ Ξ± κž‰ (I β†’ Ordinal 𝓀₀) , ((is-compactβˆ™ I)
                          Γ— (is-totally-separated I)
                          Γ— ((i : I) β†’ is-compactβˆ™ ⟨ Ξ± i ⟩)
                          Γ— ((i : I) β†’ is-totally-separated ⟨ Ξ± i ⟩)
                          Γ— (is-totally-separated ⟨ sup Ξ± ⟩ β†’ ¬¬ WLPO))
counterexample-to-total-separatedess =
 β„•βˆž ,
 Ξ±Μ… ,
 β„•βˆž-compactβˆ™ ,
 β„•βˆž-is-totally-separated fe' ,
 (Ξ» i β†’ micro-tychonoff fe' (β„•-to-β„•βˆž-is-embedding fe' i) (Ξ» _ β†’ 𝟚-is-compactβˆ™)) ,
 (Ξ» i β†’ Ξ -is-totally-separated fe' (Ξ» _ β†’ 𝟚-is-totally-separated)) ,
 𝓼-totally-separated-gives-¬¬WLPO


We now get back to our main concern, the sup-of-extension
interpretation ⟦_βŸ§β‚‚ discussed in the introduction to this file. In
order to make sense of the proof below, remember our remark that this
non-standard interpretation maps Z to one rather than zero.


open import Ordinals.BrouwerCodes
open import Ordinals.BrouwerCodesInterpretations ua pt sr using (⟦_βŸ§β‚‚)
open import Ordinals.Arithmetic fe renaming (πŸšβ‚’ to πŸšβ‚’-standard)

total-separatedness-of-the-sup-of-extension-interpretation-gives-¬¬WLPO
 : ((b : B) β†’ is-totally-separated ⟨ ⟦ b βŸ§β‚‚ ⟩) β†’ ¬¬ WLPO
total-separatedness-of-the-sup-of-extension-interpretation-gives-¬¬WLPO ts
 = V
 where
  _ : ⟦ Z βŸ§β‚‚ = πŸ™β‚’
  _ = refl

  _ : ⟦ S Z βŸ§β‚‚ = πŸšβ‚’-standard
  _ = refl

  I : πŸšβ‚’ = ⟦ S Z βŸ§β‚‚
  I = eqtoidβ‚’ (ua 𝓀₀) fe' πŸšβ‚’ ⟦ S Z βŸ§β‚‚ (πŸšβ‚€-agrees-with-πŸšβ‚€-standard fe)

  b : B
  b = L (Ξ» _ β†’ S Z)

  II : ⟦ b βŸ§β‚‚ = 𝓼
  II = ap (sup ∘ extension) (dfunext fe' (Ξ» _ β†’ I ⁻¹))

  III : is-totally-separated ⟨ ⟦ b βŸ§β‚‚ ⟩
  III = ts b

  IV : is-totally-separated ⟨ 𝓼 ⟩
  IV = transport (Ξ» - β†’ is-totally-separated ⟨ - ⟩) II III

  V : ¬¬ WLPO
  V = 𝓼-totally-separated-gives-¬¬WLPO IV