FailureOfTrichotomy
Martin Escardo, 14th 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). A question we had for some
time was whether the resulting ordinals are trichotomous. Here we
answer this in the negative. More precisely, from the assumption that
the resulting ordinals are trichotomous, we conclude that LPO holds.
To prove this, we exhibit, from any given conatural u, a Brouwer code
such that if the standard interpretation of the code is trichotomous
then the finiteness of u is decidable, which amounts to LPO.
{-# OPTIONS --safe --without-K #-}
open import UF.Univalence
open import UF.PropTrunc
open import UF.Size
module Ordinals.FailureOfTrichotomy
(ua : Univalence)
(pt : propositional-truncations-exist)
(sr : Set-Replacement pt)
where
open import UF.FunExt
open import UF.UA-FunExt
private
fe : FunExt
fe = Univalence-gives-FunExt ua
fe' : Fun-Ext
fe' {π€} {π₯} = fe π€ π₯
open import CoNaturals.Type
open import MLTT.Spartan
open import MLTT.Two-Properties
open import Notation.CanonicalMap
open import NotionsOfDecidability.Decidable
open import Ordinals.AdditionProperties ua
open import Ordinals.Arithmetic fe
open import Ordinals.BrouwerCodes
open import Ordinals.Notions
open import Ordinals.OrdinalOfOrdinals ua
open import Ordinals.OrdinalOfOrdinalsSuprema ua
open import Ordinals.Propositions ua
open import Ordinals.Type
open import Ordinals.Underlying
open import Taboos.LPO
open import UF.Base
open PropositionalTruncation pt
open suprema pt sr
The standard interpretation of Brouwer ordinal codes is called β¦_β§β.
open import Ordinals.BrouwerCodesInterpretations ua pt sr using (β¦_β§β)
From a given conatural u : ββ, we construct various Brouwer codes and
associated ordinals.
module _ (u : ββ) where
private
π π π : B
π = Z
π = S π
π = S π
π-to-B : π β B
π-to-B β = π
π-to-B β = π
g : β β B
g i = S (π-to-B (ΞΉ u i))
Ξ± : β β Ordinal π€β
Ξ± i = β¦ g i β§β
h : β β B
h 0 = π
h 1 = S (L g)
h (succ (succ _)) = π
Ξ² : β β Ordinal π€β
Ξ² i = β¦ h i β§β
Ξ±-is-πβ : (i : β) β ΞΉ u i οΌ β β Ξ± i οΌ πβ
Ξ±-is-πβ i e = Ξ± i οΌβ¨ ap (Ξ» - β β¦ π-to-B - β§β +β πβ) e β©
(πβ +β πβ) +β πβ οΌβ¨ ap (_+β πβ) (πβ-left-neutral πβ) β©
πβ +β πβ β
Ξ±-is-πβ : (i : β) β ΞΉ u i οΌ β β Ξ± i οΌ πβ
Ξ±-is-πβ i e = Ξ± i οΌβ¨ ap (Ξ» - β β¦ π-to-B - β§β +β πβ) e β©
πβ +β πβ οΌβ¨ πβ-left-neutral πβ β©
πβ β
xβ : β¨ sup Ξ± β©
xβ = [ Ξ± 0 , sup Ξ± ]β¨ sup-is-upper-bound Ξ± 0 β© (inr β)
Ξ²β-is-πβ : Ξ² 0 οΌ πβ
Ξ²β-is-πβ = ap (_+β πβ) (πβ-left-neutral πβ)
supΞ±β²Ξ²β : sup Ξ± β² Ξ² 1
supΞ±β²Ξ²β = (inr β , ((successor-lemma-right (sup Ξ±)) β»ΒΉ))
πββ²supΞ² : πβ β² sup Ξ²
πββ²supΞ² = β²-β΄-gives-β² πβ (Ξ² 0) (sup Ξ²)
(transport (πβ β²_) (Ξ²β-is-πβ β»ΒΉ) πββ²πβ)
(sup-is-upper-bound Ξ² 0)
supΞ±β²supΞ² : sup Ξ± β² sup Ξ²
supΞ±β²supΞ² = β²-β΄-gives-β² (sup Ξ±) (Ξ² 1) (sup Ξ²)
supΞ±β²Ξ²β
(sup-is-upper-bound Ξ² 1)
yβ yβ : β¨ sup Ξ² β©
yβ = β²-witness πββ²supΞ²
yβ = β²-witness supΞ±β²supΞ²
lower-set-of-yβ-is-πβ : sup Ξ² β yβ οΌ πβ
lower-set-of-yβ-is-πβ = (β²-witness-property πββ²supΞ²)β»ΒΉ
lower-set-of-yβ-is-supΞ± : sup Ξ² β yβ οΌ sup Ξ±
lower-set-of-yβ-is-supΞ± = (β²-witness-property supΞ±β²supΞ²)β»ΒΉ
Β¬supΞ±β²πβ : Β¬ (sup Ξ± β² πβ)
Β¬supΞ±β²πβ (b , e) = π-elim (transport β¨_β© I xβ)
where
I : sup Ξ± οΌ πβ
I = sup Ξ± οΌβ¨ e β©
πβ β b οΌβ¨ πβ-β β©
πβ β
finite-gives-πββ²supΞ± : is-finite u β πβ β² sup Ξ±
finite-gives-πββ²supΞ± (n , e) =
β²-β΄-gives-β² πβ (Ξ± n) (sup Ξ±)
(transport (πβ β²_) ((Ξ±-is-πβ n I) β»ΒΉ) πββ²πβ)
(sup-is-upper-bound Ξ± n)
where
I : ΞΉ u n οΌ β
I = ΞΉ u n οΌβ¨ ap (Ξ» - β ΞΉ - n) (e β»ΒΉ) β©
ΞΉ (ΞΉ n) n οΌβ¨ β-to-ββ-diagonalβ n β©
β β
πββ²supΞ±-gives-finite : πβ β² sup Ξ± β is-finite u
πββ²supΞ±-gives-finite (s , e) =
β₯β₯-rec
(being-finite-is-prop fe' u)
I
(sup-is-upper-bound-jointly-surjective Ξ± s)
where
I : (Ξ£ i κ β , Ξ£ b κ β¨ Ξ± i β© , [ Ξ± i , sup Ξ± ]β¨ sup-is-upper-bound Ξ± i β© b οΌ s)
β is-finite u
I (i , b , q) = π-equality-cases IIIβ IIIβ
where
II : πβ οΌ Ξ± i β b
II = πβ οΌβ¨ e β©
sup Ξ± β s οΌβ¨ IIβ β©
sup Ξ± β [ Ξ± i , sup Ξ± ]β¨ sup-is-upper-bound Ξ± i β© b οΌβ¨ IIβ β©
Ξ± i β b β
where
IIβ = ap (sup Ξ± β_) (q β»ΒΉ)
IIβ = initial-segment-of-sup-at-component Ξ± i b
IIIβ : ΞΉ u i οΌ β β is-finite u
IIIβ c = bounded-is-finite fe' i u c
IIIβ : ΞΉ u i οΌ β β is-finite u
IIIβ c = π-elim (Β¬πββ²πβ (transport (πβ β²_) (Ξ±-is-πβ i c) (b , II)))
main-lemma : is-trichotomous (sup Ξ²) β is-decidable (is-finite u)
main-lemma Ο = I (Ο yβ yβ)
where
I : (yβ βΊβ¨ sup Ξ² β© yβ) + (yβ οΌ yβ) + (yβ βΊβ¨ sup Ξ² β© yβ)
β is-decidable (is-finite u)
I (inl l) = inl (πββ²supΞ±-gives-finite
(transportβ _β²_
lower-set-of-yβ-is-πβ
lower-set-of-yβ-is-supΞ±
(β-preserves-order (sup Ξ²) yβ yβ l)))
I (inr (inl e)) = inr Iβ
where
Iβ : πβ οΌ sup Ξ±
Iβ = πβ οΌβ¨ lower-set-of-yβ-is-πβ β»ΒΉ β©
sup Ξ² β yβ οΌβ¨ ap (sup Ξ² β_) e β©
sup Ξ² β yβ οΌβ¨ lower-set-of-yβ-is-supΞ± β©
sup Ξ± β
Iβ : Β¬ is-finite u
Iβ Ο = Β¬πββ²πβ (transport (πβ β²_) (Iβ β»ΒΉ) (finite-gives-πββ²supΞ± Ο))
I (inr (inr l)) = π-elim (Β¬supΞ±β²πβ
(transportβ _β²_
lower-set-of-yβ-is-supΞ±
lower-set-of-yβ-is-πβ
(β-preserves-order (sup Ξ²) yβ yβ l)))
Ranging over all conatural numbers, this amounts to LPO.
brouwer-code : ββ β B
brouwer-code u = L (h u)
trichotomy-of-the-standard-interpretation-gives-LPO
: ((b : B) β is-trichotomous β¦ b β§β) β LPO
trichotomy-of-the-standard-interpretation-gives-LPO Ο
= LPO'-gives-LPO (Ξ» u β main-lemma u (Ο (brouwer-code u)))