Martin Escardo, 6th May 2022
Arithmetic for trichotomous ordinals.
\begin{code}
{-# OPTIONS --safe --without-K #-}
open import UF.FunExt
module Ordinals.TrichotomousArithmetic
(fe : FunExt)
where
open import MLTT.Spartan
open import Notation.CanonicalMap
open import Ordinals.Type
open import Ordinals.Notions
open import Ordinals.Arithmetic fe
open import Ordinals.WellOrderArithmetic
open import Ordinals.TrichotomousType fe
open import Ordinals.Underlying
_+β_ : Ordinalβ π€ β Ordinalβ π€ β Ordinalβ π€
Ο +β Ο
= ([ Ο ] +β [ Ο
]) , +β-is-trichotomous [ Ο ] [ Ο
]
(3is-trichotomous Ο)
(3is-trichotomous Ο
)
πβ πβ πβ : Ordinalβ π€
πβ = πβ , πβ-is-trichotomous
πβ = πβ , πβ-is-trichotomous
πβ = πβ +β πβ
Οβ : Ordinalβ π€β
Οβ = Ο , Ο-is-trichotomous
βΒ³ : (Ο : Ordinalβ π€) β (β¨ Ο β© β Ordinalβ π€) β Ordinalβ π€
βΒ³ {π€} (Ξ±@(X , _<_ , o) , t) Ο
= ((Ξ£ x κ X , β¨ Ο
x β©) ,
Sum.order ,
Sum.well-order o (Ξ» x β 3is-well-ordered (Ο
x))) ,
sum.trichotomy-preservation _ _ t (Ξ» x β 3is-trichotomous (Ο
x))
where
_βΊ_ : {x : X} β β¨ Ο
x β© β β¨ Ο
x β© β π€ Μ
y βΊ z = y βΊβ¨ Ο
_ β© z
module Sum = sum-cotransitive fe _<_ _βΊ_ (tricho-gives-cotrans _<_ (Transitivity Ξ±) t)
_Γβ_ : Ordinalβ π€ β Ordinalβ π€ β Ordinalβ π€
Ο Γβ Ο
= βΒ³ Ο (Ξ» (_ : β¨ Ο β©) β Ο
)
\end{code}