Martin Escardo 4th May 2022.
\begin{code}
{-# OPTIONS --safe --without-K --lossy-unification #-}
open import UF.Univalence
module Ordinals.ToppedAdditionProperties
(ua : Univalence)
where
open import UF.Equiv
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 : PropExt
pe = Univalence-gives-PropExt ua
open import MLTT.Plus-Properties
open import MLTT.Spartan
open import Notation.CanonicalMap
open import Ordinals.Arithmetic fe
open import Ordinals.Closure fe using (โ-โโ)
open import Ordinals.Equivalence
open import Ordinals.Injectivity
open import Ordinals.Maps
open import Ordinals.ToppedArithmetic fe
open import Ordinals.ToppedType fe
open import Ordinals.Type
open import Ordinals.Underlying
open import TypeTopology.SquashedSum fe
open import UF.Embeddings
open topped-ordinals-injectivity fe
alternative-plusโ : (ฯโ ฯโ : Ordinalแต ๐ค)
โ [ ฯโ +แต ฯโ ] โโ ([ ฯโ ] +โ [ ฯโ ])
alternative-plusโ ฯโ ฯโ = e
where
ฯ
= cases (ฮป โ โ ฯโ) (ฮป โ โ ฯโ)
f : โจ โ ๐แต ฯ
โฉ โ โจ [ ฯโ ] +โ [ ฯโ ] โฉ
f (inl โ , x) = inl x
f (inr โ , y) = inr y
g : โจ [ ฯโ ] +โ [ ฯโ ] โฉ โ โจ โ ๐แต ฯ
โฉ
g (inl x) = (inl โ , x)
g (inr y) = (inr โ , y)
ฮท : g โ f โผ id
ฮท (inl โ , x) = refl
ฮท (inr โ , y) = refl
ฮต : f โ g โผ id
ฮต (inl x) = refl
ฮต (inr y) = refl
f-is-equiv : is-equiv f
f-is-equiv = qinvs-are-equivs f (g , ฮท , ฮต)
f-is-op : is-order-preserving [ โ ๐แต ฯ
] ([ ฯโ ] +โ [ ฯโ ]) f
f-is-op (inl โ , _) (inl โ , _) (inr (refl , l)) = l
f-is-op (inl โ , _) (inr โ , _) (inl โ) = โ
f-is-op (inr โ , _) (inl โ , _) (inl l) = l
f-is-op (inr โ , _) (inr โ , _) (inr (refl , l)) = l
g-is-op : is-order-preserving ([ ฯโ ] +โ [ ฯโ ]) [ โ ๐แต ฯ
] g
g-is-op (inl _) (inl _) l = inr (refl , l)
g-is-op (inl _) (inr _) โ = inl โ
g-is-op (inr _) (inl _) ()
g-is-op (inr _) (inr _) l = inr (refl , l)
e : [ โ ๐แต ฯ
] โโ ([ ฯโ ] +โ [ ฯโ ])
e = f , f-is-op , f-is-equiv , g-is-op
alternative-plus : (ฯโ ฯโ : Ordinalแต ๐ค)
โ [ ฯโ +แต ฯโ ] ๏ผ ([ ฯโ ] +โ [ ฯโ ])
alternative-plus ฯโ ฯโ = eqtoidโ (ua _) fe' _ _ (alternative-plusโ ฯโ ฯโ)
\end{code}
Added by Martin Escardo 2nd September 2026.
The successor sum of a countable family is the successor of the sum of
the family over ฯ.
\begin{code}
โโ-is-successorโ : (ฯ : โ โ Ordแต) โ [ โโ ฯ ] โโ (โโ ฯ ฯ +โ ๐โ)
โโ-is-successorโ ฯ = โโ-trans
[ โโ ฯ ]
[ โ (succโ ฯ) (cases ฯ (ฮป _ โ ๐แต)) ]
(โโ ฯ ฯ +โ ๐โ)
II
III
where
๐ฎ : โ โช โ + ๐
๐ฎ = over , over-embedding
I : (z : โ + ๐)
โ [ (ฯ โ ๐ฎ) z ] โโ [ cases ฯ (ฮป _ โ ๐แต) z ]
I (inl n) = โ-propertyโ ฯ ๐ฎ n
I (inr โ) = โ-out-of-range ฯ ๐ฎ (inr โ) (ฮป n โ +disjoint)
II : [ โโ ฯ ] โโ [ โ (succโ ฯ) (cases ฯ (ฮป _ โ ๐แต)) ]
II = โ-โโ (succโ ฯ) (ฯ โ ๐ฎ) (cases ฯ (ฮป _ โ ๐แต)) I
ฯ
: โ + ๐ โ Ordแต
ฯ
= cases ฯ (ฮป _ โ ๐แต)
f : โจ โ (succโ ฯ) ฯ
โฉ โ โจ โโ ฯ ฯ +โ ๐โ โฉ
f (inl n , x) = inl (n , x)
f (inr โ , _) = inr โ
g : โจ โโ ฯ ฯ +โ ๐โ โฉ โ โจ โ (succโ ฯ) ฯ
โฉ
g (inl (n , x)) = inl n , x
g (inr โ) = inr โ , โ
ฮท : g โ f โผ id
ฮท (inl n , x) = refl
ฮท (inr โ , โ) = refl
ฮต : f โ g โผ id
ฮต (inl (n , x)) = refl
ฮต (inr โ) = refl
f-is-equiv : is-equiv f
f-is-equiv = qinvs-are-equivs f (g , ฮท , ฮต)
f-is-op : is-order-preserving [ โ (succโ ฯ) ฯ
] (โโ ฯ ฯ +โ ๐โ) f
f-is-op (inl n , _) (inl m , _) (inl l) = inl l
f-is-op (inl n , _) (inl m , _) (inr (refl , l)) = inr (refl , l)
f-is-op (inl n , _) (inr โ , _) (inl โ) = โ
f-is-op (inr โ , _) (inl m , _) (inl l) = ๐-elim l
f-is-op (inr โ , _) (inr โ , _) (inl l) = ๐-elim l
f-is-op (inr โ , _) (inr โ , _) (inr (refl , l)) = ๐-elim l
g-is-op : is-order-preserving (โโ ฯ ฯ +โ ๐โ) [ โ (succโ ฯ) ฯ
] g
g-is-op (inl (n , _)) (inl (m , _)) (inl l) = inl l
g-is-op (inl (n , _)) (inl (m , _)) (inr (refl , l)) = inr (refl , l)
g-is-op (inl (n , _)) (inr โ) โ = inl โ
g-is-op (inr โ) (inr โ) l = ๐-elim l
III : [ โ (succโ ฯ) (cases ฯ (ฮป _ โ ๐แต)) ] โโ (โโ ฯ ฯ +โ ๐โ)
III = f , f-is-op , f-is-equiv , g-is-op
โโ-is-successor : (ฯ : โ โ Ordแต) โ [ โโ ฯ ] ๏ผ (โโ ฯ ฯ +โ ๐โ)
โโ-is-successor ฯ = eqtoidโ (ua _) fe' _ _ (โโ-is-successorโ ฯ)
\end{code}
End of addition.