Martin Escardo, July 2018
Closure properties of some ordinal constructions.
\begin{code}
{-# OPTIONS --safe --without-K #-}
open import UF.FunExt
module Ordinals.Closure
(fe : FunExt)
where
open import CoNaturals.Type
open import InjectiveTypes.Blackboard fe
open import MLTT.AlternativePlus
open import MLTT.Plus-Properties
open import MLTT.Spartan
open import MLTT.Two-Properties
open import Naturals.Binary hiding (_+_ ; L ; R)
open import Notation.CanonicalMap
open import Ordinals.Arithmetic fe
open import Ordinals.Equivalence
open import Ordinals.InfProperty
open import Ordinals.Injectivity
open import Ordinals.LexicographicCompactness
open import Ordinals.LexicographicOrder
open import Ordinals.ToppedArithmetic fe
open import Ordinals.ToppedType fe
open import Ordinals.Underlying
open import TypeTopology.CompactTypes
open import TypeTopology.Density
open import TypeTopology.LimitPoints
open import TypeTopology.ConvergentSequenceHasInf
open import TypeTopology.MicroInfTychonoff
open import TypeTopology.SigmaDiscrete
open import TypeTopology.SquashedCantor fe
open import TypeTopology.SquashedSum fe
open import UF.Base
open import UF.DiscreteAndSeparated
open import UF.Embeddings
open import UF.Equiv
open import UF.PairFun
open import UF.Retracts
open import UF.Subsingletons
private
feโ : funext ๐คโ ๐คโ
feโ = fe ๐คโ ๐คโ
\end{code}
Ordinal-indexed sums of topped ordinals are closed under compactness:
\begin{code}
โ-compactโ : (ฯ : Ordแต) (ฯ
: โจ ฯ โฉ โ Ordแต)
โ is-compactโ โจ ฯ โฉ
โ ((x : โจ ฯ โฉ) โ is-compactโ โจ ฯ
x โฉ)
โ is-compactโ โจ โ ฯ ฯ
โฉ
โ-compactโ ฯ ฯ
ฮต ฮด = ฮฃ-is-compactโ ฮต ฮด
\end{code}
More compactness closure properties are in the module TypeTopology.SquashedSum.
The complication of the following proof in the case for addition is
that the ordinal ๐แต has underlying set ๐+๐ rather than ๐, and that
(hence) we defined the ordinal +แต as a sum indexed by ๐+๐ rather than
as a co-product. This saved lots of code elsewhere, but adds labour
here (and in some helper lemmas/constructions that we added in other
modules for this purpose). Notice that +' is the sum indexed by ๐,
defined in the module MLTT.Spartan. The bulk of the work for the
following construction is performed in the module TypeTopology.SquashedCantor.
\begin{code}
+-retract-of-Cantor : (ฯ : Ordแต) (ฯ
: Ordแต)
โ retract โจ ฯ โฉ of Cantor
โ retract โจ ฯ
โฉ of Cantor
โ retract โจ ฯ +แต ฯ
โฉ of Cantor
+-retract-of-Cantor ฯ ฯ
ฮต ฮด = retracts-compose d e
where
a : retract (Cantor +' Cantor) of (Cantor + Cantor)
a = +'-retract-of-+
b : retract (Cantor +' Cantor) of Cantor
b = retracts-compose +-Cantor-retract a
c : retract โจ ฯ โฉ +' โจ ฯ
โฉ of (Cantor +' Cantor)
c = +'-retract ฮต ฮด
d : retract โจ ฯ โฉ +' โจ ฯ
โฉ of Cantor
d = retracts-compose b c
e : retract โจ ฯ +แต ฯ
โฉ of (โจ ฯ โฉ +' โจ ฯ
โฉ)
e = transport (ฮป - โ retract โจ ฯ +แต ฯ
โฉ of (ฮฃ -)) (dfunext (fe ๐คโ ๐คโ) l) h
where
f : ๐ โ ๐ + ๐
f = retraction retract-๐+๐-of-๐
h : retract โจ ฯ +แต ฯ
โฉ of (ฮฃ i ๊ ๐ , โจ cases (ฮป _ โ ฯ) (ฮป _ โ ฯ
) (f i) โฉ)
h = ฮฃ-reindex-retract f (retraction-has-section retract-๐+๐-of-๐)
l : (i : ๐) โ โจ cases (ฮป _ โ ฯ) (ฮป _ โ ฯ
) (f i) โฉ
๏ผ ๐-cases โจ ฯ โฉ โจ ฯ
โฉ i
l โ = refl
l โ = refl
ร-retract-of-Cantor : (ฯ : Ordแต) (ฯ
: Ordแต)
โ retract โจ ฯ โฉ of Cantor
โ retract โจ ฯ
โฉ of Cantor
โ retract โจ ฯ รแต ฯ
โฉ of Cantor
ร-retract-of-Cantor ฯ ฯ
ฮต ฮด = retracts-compose a b
where
a : retract (Cantor ร Cantor) of Cantor
a = pair-seq-retract
b : retract โจ ฯ โฉ ร โจ ฯ
โฉ of (Cantor ร Cantor)
b = ร-retract ฮต ฮด
\end{code}
More Cantor-retract properties are in the module TypeTopology.SquashedCantor.
\begin{code}
ฮฃ-retract-of-โ : {X : ๐ค ฬ } {Y : X โ ๐ฅ ฬ }
โ retract X of โ
โ ((x : X) โ retract (Y x) of โ)
โ retract (ฮฃ Y) of โ
ฮฃ-retract-of-โ {๐ค} {๐ฅ} {X} {Y} ฯ ฯ = retracts-compose b a
where
a : retract (ฮฃ Y) of (โ ร โ)
a = ฮฃ-retractโ ฯ ฯ
b : retract (โ ร โ) of โ
b = โ-gives-โ pairing
ฮฃโ-โ-retract : {X : โ โ ๐ค ฬ }
โ ((n : โ) โ retract (X n) of โ)
โ retract (ฮฃโ X) of โ
ฮฃโ-โ-retract {๐ค} {X} ฯ = retracts-compose c b
where
a : (z : โ + ๐) โ retract (X / over) z of ((ฮป _ โ โ) / over) z
a = retract-extension X (ฮป _ โ โ) over ฯ
b : retract (ฮฃโ X) of ฮฃโ (ฮป _ โ โ)
b = ฮฃ-retract (X / over) ((ฮป _ โ โ) / over) a
c : retract ฮฃโ (ฮป _ โ โ) of โ
c = ฮฃ-retract-of-โ
(โ-gives-โ โ-plus-๐)
(ฮป (z : โ + ๐) โ r z , s z , rs z)
where
r : (z : โ + ๐) โ โ โ ((ฮป _ โ โ) / inl) z
r (inl n) m w = m
r (inr *) m (k , p) = ๐-elim (+disjoint p)
s : (z : โ + ๐) โ ((ฮป _ โ โ) / inl) z โ โ
s (inl n) ฯ = ฯ (n , refl)
s (inr *) ฯ = 0
rs : (z : โ + ๐) (ฯ : ((ฮป _ โ โ) / inl) z) โ r z (s z ฯ) ๏ผ ฯ
rs (inl n) ฯ = dfunext feโ g
where
g : (w : fiber inl (inl n)) โ r (inl n) (s (inl n) ฯ) w ๏ผ ฯ w
g (n , refl) = refl
rs (inr *) ฯ = dfunext feโ g
where
g : (w : fiber inl (inr *)) โ r (inr *) (s (inr *) ฯ) w ๏ผ ฯ w
g (k , p) = ๐-elim (+disjoint p)
\end{code}
Preservation of discreteness:
\begin{code}
โ-is-discrete : (ฯ : Ordแต) (ฯ
: โจ ฯ โฉ โ Ordแต)
โ is-discrete โจ ฯ โฉ
โ ((x : โจ ฯ โฉ) โ is-discrete โจ ฯ
x โฉ)
โ is-discrete โจ โ ฯ ฯ
โฉ
โ-is-discrete ฯ ฯ
ฮต ฮด = ฮฃ-is-discrete ฮต ฮด
\end{code}
Some maps and their order preservation, used to show that the
embedding of the discrete ordinals into the compact ordinals is order
preserving.
\begin{code}
is-order-preserving is-order-reflecting : (ฯ ฯ
: Ordแต) โ (โจ ฯ โฉ โ โจ ฯ
โฉ) โ ๐คโ ฬ
is-order-preserving ฯ ฯ
f = (x y : โจ ฯ โฉ) โ x โบโจ ฯ โฉ y โ f x โบโจ ฯ
โฉ f y
is-order-reflecting ฯ ฯ
f = (x y : โจ ฯ โฉ) โ f x โบโจ ฯ
โฉ f y โ x โบโจ ฯ โฉ y
comp-is-order-preserving : (ฯ ฯ
ฯ : Ordแต)
(f : โจ ฯ โฉ โ โจ ฯ
โฉ)
(g : โจ ฯ
โฉ โ โจ ฯ โฉ)
โ is-order-preserving ฯ ฯ
f
โ is-order-preserving ฯ
ฯ g
โ is-order-preserving ฯ ฯ (g โ f)
comp-is-order-preserving ฯ ฯ
ฯ f g p q x y l = q (f x) (f y) (p x y l)
pair-fun-is-order-preserving
: (ฯ ฯ
: Ordแต)
(A : โจ ฯ โฉ โ Ordแต)
(B : โจ ฯ
โฉ โ Ordแต)
(f : โจ ฯ โฉ โ โจ ฯ
โฉ)
(g : (x : โจ ฯ โฉ) โ โจ A x โฉ โ โจ B (f x) โฉ)
โ is-order-preserving ฯ ฯ
f
โ ((x : โจ ฯ โฉ) โ is-order-preserving (A x) (B (f x)) (g x))
โ is-order-preserving (โ ฯ A) (โ ฯ
B) (pair-fun f g)
pair-fun-is-order-preserving ฯ ฯ
A B f g ฯ ฮณ (x , a) (y , b) (inl l) =
inl (ฯ x y l)
pair-fun-is-order-preserving ฯ ฯ
A B f g ฯ ฮณ (x , a) (x , b) (inr (refl , l)) =
inr (refl , ฮณ x a b l)
ฮน๐แต : โจ succโ ฯ โฉ โ โจ โโแต โฉ
ฮน๐แต = ฮน๐
ฮน๐แต-is-order-preserving : is-order-preserving (succโ ฯ) โโแต ฮน๐แต
ฮน๐แต-is-order-preserving (inl n) (inl m) l = โ-to-โโ-order-preserving n m l
ฮน๐แต-is-order-preserving (inl n) (inr *) * = n , (refl , refl)
ฮน๐แต-is-order-preserving (inr *) (inl m) l = ๐-elim l
ฮน๐แต-is-order-preserving (inr *) (inr *) l = ๐-elim l
open topped-ordinals-injectivity fe
over-ฮน-map-is-order-preserving : (ฯ : โ โ Ordแต) (z : โ + ๐)
โ is-order-preserving
((ฯ โ (over , over-embedding)) z)
((ฯ โ embedding-โ-to-โโ feโ) (ฮน๐ z))
(over-ฮน-map (ฮป n โ โจ ฯ n โฉ) z)
over-ฮน-map-is-order-preserving ฯ (inl n) x y ((.n , refl) , l) = (n , refl) , ฮณ
where
ฮณ : over-ฮน-map (ฮป n โ โจ ฯ n โฉ) (inl n) x (n , refl) โบโจ ฯ n โฉ
over-ฮน-map (ฮป n โ โจ ฯ n โฉ) (inl n) y (n , refl)
ฮณ = transportโโปยน
(ฮป a b โ a โบโจ ฯ n โฉ b)
(over-ฮน-map-left (ฮป n โ โจ ฯ n โฉ) n x)
(over-ฮน-map-left (ฮป n โ โจ ฯ n โฉ) n y)
l
over-ฮน-map-is-order-preserving ฯ (inr *) x y ((n , p) , l) = ๐-elim (+disjoint p)
โ-up : (ฯ : โ โ Ordแต) โ โจ โโ ฯ โฉ โ โจ โยน ฯ โฉ
โ-up ฯ = ฮฃ-up (ฮป n โ โจ ฯ n โฉ)
โ-up-is-order-preserving : (ฯ : โ โ Ordแต)
โ is-order-preserving (โโ ฯ) (โยน ฯ) (โ-up ฯ)
โ-up-is-order-preserving ฯ = pair-fun-is-order-preserving
(succโ ฯ)
โโแต
(ฯ โ (over , over-embedding))
(ฯ โ embedding-โ-to-โโ feโ)
ฮน๐แต
(over-ฮน-map (ฮป n โ โจ ฯ n โฉ))
ฮน๐แต-is-order-preserving
(over-ฮน-map-is-order-preserving ฯ)
โโ : (ฯ ฯ
: โ โ Ordแต) (f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ โจ โโ ฯ โฉ โ โจ โยน ฯ
โฉ
โโ ฯ ฯ
= ฮฃโ (ฮป n โ โจ ฯ n โฉ) (ฮป n โ โจ ฯ
n โฉ)
Overแต : (ฯ ฯ
: โ โ Ordแต) (f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ (z : โ + ๐) โ โจ (ฯ โ (over , over-embedding)) z โฉ โ โจ (ฯ
โ (over , over-embedding)) z โฉ
Overแต ฯ ฯ
= Over (ฮป n โ โจ ฯ n โฉ) (ฮป n โ โจ ฯ
n โฉ)
Overแต-is-order-preserving : (ฯ ฯ
: โ โ Ordแต) (f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ ((n : โ) โ is-order-preserving (ฯ n) (ฯ
n) (f n))
โ (z : โ + ๐) โ is-order-preserving
((ฯ โ (over , over-embedding)) z)
((ฯ
โ (over , over-embedding)) z)
(Overแต ฯ ฯ
f z)
Overแต-is-order-preserving ฯ ฯ
f p (inl n) x y ((.n , refl) , l) =
(n , refl) , p n _ _ l
Overแต-is-order-preserving ฯ ฯ
f p (inr *) x y ((n , q) , l) =
๐-elim (+disjoint q)
โโ-functor : (ฯ ฯ
: โ โ Ordแต) (f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ โจ โโ ฯ โฉ โ โจ โโ ฯ
โฉ
โโ-functor ฯ ฮฝ = ฮฃโ-functor (ฮป n โ โจ ฯ n โฉ) (ฮป n โ โจ ฮฝ n โฉ)
โโ-functor-is-order-preserving
: (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ ((n : โ) โ is-order-preserving (ฯ n) (ฯ
n) (f n))
โ is-order-preserving (โโ ฯ) (โโ ฯ
) (โโ-functor ฯ ฯ
f)
โโ-functor-is-order-preserving ฯ ฯ
f p =
pair-fun-is-order-preserving
(succโ ฯ)
(succโ ฯ)
(ฯ โ (over , over-embedding))
(ฯ
โ (over , over-embedding))
id
(Over (ฮป n โ โจ ฯ n โฉ) (ฮป n โ โจ ฯ
n โฉ) f)
(ฮป x y l โ l)
(Overแต-is-order-preserving ฯ ฯ
f p)
โโ-is-order-preserving : (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ ((n : โ) โ is-order-preserving (ฯ n) (ฯ
n) (f n))
โ is-order-preserving (โโ ฯ) (โยน ฯ
) (โโ ฯ ฯ
f)
โโ-is-order-preserving ฯ ฯ
f p = comp-is-order-preserving
(โโ ฯ)
(โโ ฯ
)
(โยน ฯ
)
(ฮฃโ-functor
(ฮป n โ โจ ฯ n โฉ)
(ฮป n โ โจ ฯ
n โฉ)
f)
(โ-up ฯ
)
(โโ-functor-is-order-preserving ฯ ฯ
f p)
(โ-up-is-order-preserving ฯ
)
\end{code}
And now order reflection.
\begin{code}
comp-is-order-reflecting : (ฯ ฯ
ฯ : Ordแต)
(f : โจ ฯ โฉ โ โจ ฯ
โฉ)
(g : โจ ฯ
โฉ โ โจ ฯ โฉ)
โ is-order-reflecting ฯ ฯ
f
โ is-order-reflecting ฯ
ฯ g
โ is-order-reflecting ฯ ฯ (g โ f)
comp-is-order-reflecting ฯ ฯ
ฯ f g p q x y l = p x y (q (f x) (f y) l)
pair-fun-is-order-reflecting
: (ฯ ฯ
: Ordแต)
(A : โจ ฯ โฉ โ Ordแต)
(B : โจ ฯ
โฉ โ Ordแต)
(f : โจ ฯ โฉ โ โจ ฯ
โฉ)
(g : (x : โจ ฯ โฉ) โ โจ A x โฉ โ โจ B (f x) โฉ)
โ is-order-reflecting ฯ ฯ
f
โ is-embedding f
โ ((x : โจ ฯ โฉ) โ is-order-reflecting (A x) (B (f x)) (g x))
โ is-order-reflecting (โ ฯ A) (โ ฯ
B) (pair-fun f g)
pair-fun-is-order-reflecting ฯ ฯ
A B f g ฯ e ฮณ (x , a) (y , b) (inl l) =
inl (ฯ x y l)
pair-fun-is-order-reflecting ฯ ฯ
A B f g ฯ e ฮณ (x , a) (y , b) (inr (r , l)) =
inr (c r , p)
where
e' : is-equiv (ap f)
e' = embedding-gives-embedding' f e x y
c : f x ๏ผ f y โ x ๏ผ y
c = inverse (ap f) e'
ฮท : (q : f x ๏ผ f y) โ ap f (c q) ๏ผ q
ฮท = retract-condition (ap f , equivs-have-sections (ap f) e')
i : transport (ฮป - โ โจ B (f -) โฉ) (c r) (g x a)
๏ผ transport (ฮป - โ โจ B - โฉ) (ap f (c r)) (g x a)
i = transport-ap (ฮป - โ โจ B - โฉ) f (c r)
j : transport (ฮป - โ โจ B - โฉ) (ap f (c r)) (g x a) โบโจ B (f y) โฉ (g y b)
j = transportโปยน
(ฮป - โ transport (ฮป - โ โจ B - โฉ) - (g x a) โบโจ B (f y) โฉ (g y b))
(ฮท r)
l
k : transport (ฮป - โ โจ B (f -) โฉ) (c r) (g x a) โบโจ B (f y) โฉ (g y b)
k = transportโปยน (ฮป - โ - โบโจ B (f y) โฉ (g y b)) i j
h : {x y : โจ ฯ โฉ} (s : x ๏ผ y) {a : โจ A x โฉ} {b : โจ A y โฉ}
โ transport (ฮป - โ โจ B (f -) โฉ) s (g x a) โบโจ B (f y) โฉ (g y b)
โ transport (ฮป - โ โจ A - โฉ) s a โบโจ A y โฉ b
h {x} refl {a} {b} = ฮณ x a b
p : transport (ฮป - โ โจ A - โฉ) (c r) a โบโจ A y โฉ b
p = h (c r) k
ฮน๐แต-is-order-reflecting : is-order-reflecting (succโ ฯ) โโแต ฮน๐แต
ฮน๐แต-is-order-reflecting (inl n) (inl m) l =
โ-to-โโ-order-reflecting n m l
ฮน๐แต-is-order-reflecting (inl n) (inr *) l = *
ฮน๐แต-is-order-reflecting (inr *) (inl m) (n , (p , l)) =
๐-elim (โ-is-not-finite n p)
ฮน๐แต-is-order-reflecting (inr *) (inr *) (n , (p , l)) =
๐-elim (โ-is-not-finite n p)
over-ฮน-map-is-order-reflecting : (ฯ : โ โ Ordแต) (z : โ + ๐)
โ is-order-reflecting
((ฯ โ (over , over-embedding)) z)
((ฯ โ embedding-โ-to-โโ feโ) (ฮน๐ z))
(over-ฮน-map (ฮป n โ โจ ฯ n โฉ) z)
over-ฮน-map-is-order-reflecting ฯ (inl n) x y ((m , p) , l) = (n , refl) , q
where
x' : โจ ฯ n โฉ
x' = over-ฮน-map (ฮป n โ โจ ฯ n โฉ) (inl n) x (n , refl)
y' : โจ ฯ n โฉ
y' = over-ฮน-map (ฮป n โ โจ ฯ n โฉ) (inl n) y (n , refl)
r : n , refl ๏ผ m , p
r = โ-to-โโ-is-embedding feโ (ฮน n) (n , refl) (m , p)
t : โจ ฯ n โฉ โ โจ ฯ m โฉ
t = transport (ฮป - โ โจ ฯ (prโ -) โฉ) r
tr : {w t : fiber ฮน (ฮน n)} (r : w ๏ผ t)
โ is-order-reflecting
(ฯ (prโ w))
(ฯ (prโ t))
(transport (ฮป - โ โจ ฯ (prโ -) โฉ) r)
tr refl x y l = l
a : t x' ๏ผ over-ฮน-map (ฮป n โ โจ ฯ n โฉ) (inl n) x (m , p)
a = apd (over-ฮน-map (ฮป n โ โจ ฯ n โฉ) (inl n) x) r
b : t y' ๏ผ over-ฮน-map (ฮป n โ โจ ฯ n โฉ) (inl n) y (m , p)
b = apd (over-ฮน-map (ฮป n โ โจ ฯ n โฉ) (inl n) y) r
c : t x' โบโจ ฯ m โฉ t y'
c = transportโโปยน (ฮป a b โ a โบโจ ฯ m โฉ b) a b l
d : x' โบโจ ฯ n โฉ y'
d = tr r _ _ c
q : x (n , refl) โบโจ ฯ n โฉ y (n , refl)
q = transportโ
(ฮป a b โ a โบโจ ฯ n โฉ b)
(over-ฮน-map-left (ฮป n โ โจ ฯ n โฉ) n x)
(over-ฮน-map-left (ฮป n โ โจ ฯ n โฉ) n y)
d
over-ฮน-map-is-order-reflecting ฯ (inr *) x y ((m , p) , l) =
๐-elim (โ-is-not-finite m (p โปยน))
โ-up-is-order-reflecting : (ฯ : โ โ Ordแต)
โ is-order-reflecting (โโ ฯ) (โยน ฯ) (โ-up ฯ)
โ-up-is-order-reflecting ฯ = pair-fun-is-order-reflecting
(succโ ฯ)
โโแต
(ฯ โ (over , over-embedding))
(ฯ โ embedding-โ-to-โโ feโ)
ฮน๐แต
(over-ฮน-map (ฮป n โ โจ ฯ n โฉ))
ฮน๐แต-is-order-reflecting
(ฮน๐-is-embedding feโ)
(over-ฮน-map-is-order-reflecting ฯ)
Overแต-is-order-reflecting : (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ ((n : โ) โ is-order-reflecting (ฯ n) (ฯ
n) (f n))
โ (z : โ + ๐) โ is-order-reflecting
((ฯ โ (over , over-embedding)) z)
((ฯ
โ (over , over-embedding)) z)
(Overแต ฯ ฯ
f z)
Overแต-is-order-reflecting ฯ ฯ
f p (inl n) x y ((.n , refl) , l) =
(n , refl) , p n _ _ l
Overแต-is-order-reflecting ฯ ฯ
f p (inr *) x y ((n , q) , l) =
๐-elim (+disjoint q)
โโ-functor-is-order-reflecting
: (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ ((n : โ) โ is-order-reflecting (ฯ n) (ฯ
n) (f n))
โ is-order-reflecting (โโ ฯ) (โโ ฯ
) (โโ-functor ฯ ฯ
f)
โโ-functor-is-order-reflecting ฯ ฯ
f p =
pair-fun-is-order-reflecting
(succโ ฯ)
(succโ ฯ)
(ฯ โ (over , over-embedding))
(ฯ
โ (over , over-embedding))
id
(Over (ฮป n โ โจ ฯ n โฉ) (ฮป n โ โจ ฯ
n โฉ) f)
(ฮป x y l โ l)
id-is-embedding
(Overแต-is-order-reflecting ฯ ฯ
f p)
โโ-is-order-reflecting : (ฯ ฯ
: โ โ Ordแต) (f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ ((n : โ) โ is-order-reflecting (ฯ n) (ฯ
n) (f n))
โ is-order-reflecting (โโ ฯ) (โยน ฯ
) (โโ ฯ ฯ
f)
โโ-is-order-reflecting ฯ ฯ
f p = comp-is-order-reflecting
(โโ ฯ)
(โโ ฯ
)
(โยน ฯ
)
(ฮฃโ-functor
(ฮป n โ โจ ฯ n โฉ)
(ฮป n โ โจ ฯ
n โฉ)
f)
(โ-up ฯ
)
(โโ-functor-is-order-reflecting ฯ ฯ
f p)
(โ-up-is-order-reflecting ฯ
)
\end{code}
Added August 2026. Some lemmas about ฮฃโ of the module
TypeTopology.SquashedSum that are not already available here,
transported to families of topped ordinals, namely density and being
an embedding, the isolatedness and limit-point lemmas, and the
characterization of ฮฃโ as an equivalence.
\begin{code}
โโ-dense : (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ ((n : โ) โ is-dense (f n))
โ is-dense (โโ ฯ ฯ
f)
โโ-dense ฯ ฯ
= ฮฃโ-dense (ฮป n โ โจ ฯ n โฉ) (ฮป n โ โจ ฯ
n โฉ)
โโ-embedding : (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ ((n : โ) โ is-embedding (f n))
โ is-embedding (โโ ฯ ฯ
f)
โโ-embedding ฯ ฯ
= ฮฃโ-embedding (ฮป n โ โจ ฯ n โฉ) (ฮป n โ โจ ฯ
n โฉ)
โโ-preserves-isolatedness : (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
(n : โ)
(ฯ : โจ (ฯ โ (over , over-embedding)) (inl n) โฉ)
โ is-isolated (f n (ฯ (n , refl)))
โ is-isolated (โโ ฯ ฯ
f (inl n , ฯ))
โโ-preserves-isolatedness ฯ ฯ
= ฮฃโ-preserves-isolatedness
(ฮป n โ โจ ฯ n โฉ)
(ฮป n โ โจ ฯ
n โฉ)
โโ-reflects-isolatedness : (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
(n : โ)
(ฯ : โจ (ฯ โ (over , over-embedding)) (inl n) โฉ)
โ is-isolated (โโ ฯ ฯ
f (inl n , ฯ))
โ is-isolated (f n (ฯ (n , refl)))
โโ-reflects-isolatedness ฯ ฯ
= ฮฃโ-reflects-isolatedness
(ฮป n โ โจ ฯ n โฉ)
(ฮป n โ โจ ฯ
n โฉ)
โโ-reflects-weak-isolatedness : (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
(n : โ)
(ฯ : โจ (ฯ โ (over , over-embedding)) (inl n) โฉ)
โ is-weakly-isolated (โโ ฯ ฯ
f (inl n , ฯ))
โ is-weakly-isolated (f n (ฯ (n , refl)))
โโ-reflects-weak-isolatedness ฯ ฯ
= ฮฃโ-reflects-weak-isolatedness
(ฮป n โ โจ ฯ n โฉ)
(ฮป n โ โจ ฯ
n โฉ)
โโ-limit-point : (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ ((n : โ) โ is-compactโ โจ ฯ
n โฉ)
โ (ฯ : โจ (ฯ โ (over , over-embedding)) (inr โ) โฉ)
โ is-limit-point (โโ ฯ ฯ
f (inr โ , ฯ))
โโ-limit-point ฯ ฯ
= ฮฃโ-limit-point (ฮป n โ โจ ฯ n โฉ) (ฮป n โ โจ ฯ
n โฉ)
โโ-limit-pointโบ : (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ ((n : โ) โ is-compactโ โจ ฯ
n โฉ)
โ (ฯ : โจ (ฯ โ (over , over-embedding)) (inr โ) โฉ)
โ is-limit-pointโบ (โโ ฯ ฯ
f (inr โ , ฯ))
โโ-limit-pointโบ ฯ ฯ
= ฮฃโ-limit-pointโบ (ฮป n โ โจ ฯ n โฉ) (ฮป n โ โจ ฯ
n โฉ)
โโ-is-equiv : is-equiv ฮน๐
โ (ฯ ฯ
: โ โ Ordแต)
(f : (n : โ) โ โจ ฯ n โฉ โ โจ ฯ
n โฉ)
โ ((n : โ) โ is-equiv (f n))
โ is-equiv (โโ ฯ ฯ
f)
โโ-is-equiv j ฯ ฯ
= ฮฃโ-is-equiv j (ฮป n โ โจ ฯ n โฉ) (ฮป n โ โจ ฯ
n โฉ)
\end{code}
28 July 2018. Inf property.
\begin{code}
๐แต-has-infs-of-complemented-subsets : has-infs-of-complemented-subsets (๐แต {๐ค})
๐แต-has-infs-of-complemented-subsets p = โ , f , g , h
where
f : (ฮฃ x ๊ ๐ , p x ๏ผ โ) โ p โ ๏ผ โ
f (โ , r) = r
g : (x : ๐) โ p x ๏ผ โ โ โ โพโจ ๐แต โฉ x
g โ r a = ๐-elim a
h : (x : ๐) โ is-roots-lower-bound (ฮป x y โ x โพโจ ๐แต โฉ y) p x โ x โพโจ ๐แต โฉ โ
h โ ฯ a = ๐-elim a
๐แต-has-infs-of-complemented-subsets : has-infs-of-complemented-subsets ๐แต
๐แต-has-infs-of-complemented-subsets p = ๐-equality-cases ฯ ฮณ
where
_โค_ : ๐ + ๐ โ ๐ + ๐ โ ๐คโ ฬ
x โค y = x โพโจ ๐แต โฉ y
ฯ : (r : p (inl โ) ๏ผ โ) โ ฮฃ x ๊ ๐ + ๐ , is-conditional-root _โค_ p x ร is-roots-infimum _โค_ p x
ฯ r = inl โ , f , g , h
where
f : (ฮฃ x ๊ ๐ + ๐ , p x ๏ผ โ) โ p (inl โ) ๏ผ โ
f (inl โ , s) = s
f (inr โ , s) = r
g : (x : ๐ + ๐) โ p x ๏ผ โ โ inl โ โค x
g (inl โ) s l = ๐-elim l
g (inr โ) s l = ๐-elim l
h : (x : ๐ + ๐) โ is-roots-lower-bound _โค_ p x โ x โค inl โ
h (inl โ) ฯ l = ๐-elim l
h (inr โ) ฯ โ = ฯ (inl โ) r โ
ฮณ : (r : p (inl โ) ๏ผ โ)
โ ฮฃ x ๊ ๐ + ๐ , is-conditional-root _โค_ p x ร is-roots-infimum _โค_ p x
ฮณ r = inr โ , f , g , h
where
f : (ฮฃ x ๊ ๐ + ๐ , p x ๏ผ โ) โ p (inr โ) ๏ผ โ
f (inl โ , s) = ๐-elim (zero-is-not-one (s โปยน โ r))
f (inr โ , s) = s
g : (x : ๐ + ๐) โ p x ๏ผ โ โ inr โ โค x
g (inl โ) s l = ๐-elim (zero-is-not-one (s โปยน โ r))
g (inr โ) s l = ๐-elim l
h : (x : ๐ + ๐) โ is-roots-lower-bound _โค_ p x โ x โค inr โ
h (inl โ) ฯ a = ๐-elim a
h (inr โ) ฯ a = ๐-elim a
\end{code}
It is not necessary to use propositional extensionality to prove the
following, but it is simpler to do so given that we have already
proved has-infs-of-complemented-subsets for various types using
different, logically equivalent orders.
TODO. This is a bottleneck. The use of propext here propagates to a
number of files which otherwise wouldn't need to assume propext. Maybe
get rid of this at some point, here and in the other files.
\begin{code}
โ-has-infs-of-complemented-subsets
: propext ๐คโ
โ (ฯ : Ordแต) (ฯ
: โจ ฯ โฉ โ Ordแต)
โ has-infs-of-complemented-subsets ฯ
โ ((x : โจ ฯ โฉ) โ has-infs-of-complemented-subsets (ฯ
x))
โ has-infs-of-complemented-subsets (โ ฯ ฯ
)
โ-has-infs-of-complemented-subsets pe ฯ ฯ
ฮต ฮด = ฮณ
where
_โค_ : โจ โ ฯ ฯ
โฉ โ โจ โ ฯ ฯ
โฉ โ ๐คโ ฬ
_โค_ = lex-order (ฮป x y โ x โพโจ ฯ โฉ y) (ฮป {x} a b โ a โพโจ ฯ
x โฉ b)
โค-prop-valued : (z t : โจ โ ฯ ฯ
โฉ) โ is-prop (z โค t)
โค-prop-valued (x , a) (y , b) (p , u) (q , v) =
to-ฮฃ-๏ผ
(โพ-prop-valued ฯ x y p q ,
dfunext feโ (ฮป r โ โพ-prop-valued (ฯ
y) _ _ _ _))
ฯ : has-inf _โค_
ฯ = ฮฃ-has-inf ((ฮป x y โ x โพโจ ฯ โฉ y)) ((ฮป {x} a b โ a โพโจ ฯ
x โฉ b)) ฮต ฮด
open lexicographic-commutation
(underlying-order ฯ)
(ฮป {x} โ underlying-order (ฯ
x))
(๐ {๐คโ})
hiding (_โค_)
i : (z t : โจ โ ฯ ฯ
โฉ) โ z โค t โ z โพโจ โ ฯ ฯ
โฉ t
i (x , a) (y , b) = back y x b a
j : (z t : โจ โ ฯ ฯ
โฉ) โ z โพโจ โ ฯ ฯ
โฉ t โ z โค t
j (x , a) (y , b) = forth y x b a
k : (z t : โจ โ ฯ ฯ
โฉ) โ z โค t ๏ผ z โพโจ โ ฯ ฯ
โฉ t
k z t = pe (โค-prop-valued z t) (โพ-prop-valued (โ ฯ ฯ
) z t) (i z t) (j z t)
l : _โค_ ๏ผ (ฮป z t โ z โพโจ โ ฯ ฯ
โฉ t)
l = dfunext (fe ๐คโ ๐คโ) (ฮป z โ dfunext (fe ๐คโ ๐คโ) (k z))
ฮณ : has-infs-of-complemented-subsets (โ ฯ ฯ
)
ฮณ = transport has-inf l ฯ
โโแต-has-infs-of-complemented-subsets : propext ๐คโ
โ has-infs-of-complemented-subsets โโแต
โโแต-has-infs-of-complemented-subsets pe = transport has-inf p (โโ-has-inf feโ)
where
p : _โผโโ_ ๏ผ underlying-weak-order โโแต
p = dfunext (fe ๐คโ ๐คโ)
(ฮป u โ dfunext (fe ๐คโ ๐คโ)
(ฮป v โ pe (โผ-is-prop-valued feโ u v)
(โพ-prop-valued โโแต u v)
(โผ-gives-not-โบ u v)
(not-โบ-gives-โผ feโ u v)))
โยน-has-infs-of-complemented-subsets
: propext ๐คโ
โ (ฯ : โ โ Ordแต)
โ ((n : โ) โ has-infs-of-complemented-subsets (ฯ n))
โ has-infs-of-complemented-subsets (โยน ฯ)
โยน-has-infs-of-complemented-subsets pe ฯ ฮต =
โ-has-infs-of-complemented-subsets pe
โโแต
(ฮป (x : โโ) โ (ฯ โ embedding-โ-to-โโ feโ) x)
(โโแต-has-infs-of-complemented-subsets pe)
a
where
a : (x : โจ โโแต โฉ) โ has-infs-of-complemented-subsets
((ฯ โ embedding-โ-to-โโ feโ) x)
a x = micro-inf-tychonoff fe
(โ-to-โโ-is-embedding feโ x)
(ฮป {w} x y โ x โบโจ ฯ (prโ w) โฉ y)
(ฮป w โ ฮต (prโ w))
\end{code}
Added August 2026.
\begin{code}
โ-โโ : (ฯ : Ordแต) (ฯ
ฯ
' : โจ ฯ โฉ โ Ordแต)
โ ((x : โจ ฯ โฉ) โ [ ฯ
x ] โโ [ ฯ
' x ])
โ [ โ ฯ ฯ
] โโ [ โ ฯ ฯ
' ]
โ-โโ ฯ ฯ
ฯ
' g = f ,
order-preserving-reflecting-equivs-are-order-equivs
[ โ ฯ ฯ
] [ โ ฯ ฯ
' ] f
f-is-equiv
f-is-order-preserving
f-is-order-reflecting
where
h : (x : โจ ฯ โฉ) โ โจ ฯ
x โฉ โ โจ ฯ
' x โฉ
h x = โโ-to-fun [ ฯ
x ] [ ฯ
' x ] (g x)
e : (x : โจ ฯ โฉ) โ is-order-equiv [ ฯ
x ] [ ฯ
' x ] (h x)
e x = โโ-to-fun-is-order-equiv [ ฯ
x ] [ ฯ
' x ] (g x)
f : โจ โ ฯ ฯ
โฉ โ โจ โ ฯ ฯ
' โฉ
f = pair-fun id h
f-is-equiv : is-equiv f
f-is-equiv = pair-fun-is-equiv
id
h
(id-is-equiv โจ ฯ โฉ)
(ฮป x โ order-equivs-are-equivs [ ฯ
x ] [ ฯ
' x ] (e x))
f-is-order-preserving : is-order-preserving (โ ฯ ฯ
) (โ ฯ ฯ
') f
f-is-order-preserving =
pair-fun-is-order-preserving ฯ ฯ ฯ
ฯ
' id h
(ฮป x y l โ l)
(ฮป x โ order-equivs-are-order-preserving [ ฯ
x ] [ ฯ
' x ] (e x))
f-is-order-reflecting : is-order-reflecting (โ ฯ ฯ
) (โ ฯ ฯ
') f
f-is-order-reflecting =
pair-fun-is-order-reflecting ฯ ฯ ฯ
ฯ
' id h
(ฮป x y l โ l)
id-is-embedding
(ฮป x โ order-equivs-are-order-reflecting [ ฯ
x ] [ ฯ
' x ] (h x) (e x))
\end{code}
Added August 2026. The extension of the constant family at the
one-point ordinal is again the one-point ordinal, and a sum whose
summands are all one-point ordinals is the index type. Together these
identify the two extended sums of the constant family at ๐แต.
\begin{code}
โ-of-๐แต : {I J : ๐คโ ฬ } (๐ฎ : I โช J) (j : J)
โ [ ((ฮป _ โ ๐แต) โ ๐ฎ) j ] โโ ๐โ {๐คโ}
โ-of-๐แต {I} {J} ๐ฎ j =
f ,
(ฮป u v (w , l) โ ๐-elim l) ,
f-is-equiv ,
(ฮป x y l โ ๐-elim l)
where
f : โจ ((ฮป _ โ ๐แต) โ ๐ฎ) j โฉ โ ๐
f _ = โ
f-is-equiv : is-equiv f
f-is-equiv = qinvs-are-equivs f
((ฮป _ _ โ โ) ,
(ฮป u โ dfunext (fe ๐คโ ๐คโ) (ฮป w โ ๐-is-prop โ (u w))) ,
(ฮป โ โ refl))
โ-of-๐แต : (ฯ : Ordแต) (ฯ
: โจ ฯ โฉ โ Ordแต)
โ ((x : โจ ฯ โฉ) โ [ ฯ
x ] โโ ๐โ {๐คโ})
โ [ โ ฯ ฯ
] โโ [ ฯ ]
โ-of-๐แต ฯ ฯ
e =
f ,
order-preserving-reflecting-equivs-are-order-equivs
[ โ ฯ ฯ
] [ ฯ ] f
f-is-equiv f-is-order-preserving f-is-order-reflecting
where
f : โจ โ ฯ ฯ
โฉ โ โจ ฯ โฉ
f = prโ
s : (x : โจ ฯ โฉ) โ is-singleton โจ ฯ
x โฉ
s x = equiv-to-singleton
(โโ-to-fun [ ฯ
x ] (๐โ {๐คโ}) (e x) ,
โโ-to-fun-is-equiv [ ฯ
x ] (๐โ {๐คโ}) (e x))
๐-is-singleton
f-is-equiv : is-equiv f
f-is-equiv = prโ-is-equiv โจ ฯ โฉ (ฮป x โ โจ ฯ
x โฉ) s
f-is-order-preserving : is-order-preserving (โ ฯ ฯ
) ฯ f
f-is-order-preserving (x , y) (x' , y') (inl l) = l
f-is-order-preserving (x , y) (x , y') (inr (refl , m)) =
๐-elim (order-equivs-are-order-preserving
[ ฯ
x ] (๐โ {๐คโ})
(โโ-to-fun-is-order-equiv [ ฯ
x ] (๐โ {๐คโ}) (e x))
y y' m)
f-is-order-reflecting : is-order-reflecting (โ ฯ ฯ
) ฯ f
f-is-order-reflecting (x , y) (x' , y') l = inl l
โยน-of-๐แต : [ โยน (ฮป _ โ ๐แต) ] โโ [ โโแต ]
โยน-of-๐แต = โ-of-๐แต
โโแต
((ฮป _ โ ๐แต) โ embedding-โ-to-โโ feโ)
(โ-of-๐แต (embedding-โ-to-โโ feโ))
โโ-of-๐แต : [ โโ (ฮป _ โ ๐แต) ] โโ [ succโ ฯ ]
โโ-of-๐แต = โ-of-๐แต
(succโ ฯ)
((ฮป _ โ ๐แต) โ (over , over-embedding))
(โ-of-๐แต (over , over-embedding))
\end{code}