11{-# OPTIONS --safe --without-K #-}
22
33-- Lexicographic target that keeps the current Buchholz order on the
4- -- first coordinate, but relaxes the equality side-condition to
5- -- "same comparison binder" for the deferred shared-binder shapes.
4+ -- first coordinate, but relaxes the equality side-condition along
5+ -- recursive ψ-rooted comparison spines and uses a tagged payload
6+ -- order for the deferred shared-binder shapes.
67
78module Ordinal.Buchholz.VeblenComparisonTarget where
89
910open import Data.Product.Base using (_×_; _,_)
1011open import Data.Product.Relation.Binary.Lex.Strict using (×-Lex; ×-wellFounded')
1112open import Data.Sum.Base using (inj₁; inj₂)
12- open import Induction.WellFounded using (WellFounded)
13- open import Relation.Binary.Core using (Rel)
13+ open import Function.Base using (_on_)
14+ open import Induction.WellFounded using (WellFounded; module Subrelation )
15+ open import Relation.Binary.Core using (Rel; _⇒_)
16+ open import Relation.Binary.Construct.On as On using (wellFounded)
1417open import Relation.Binary.Definitions using (_Respectsʳ_)
18+ open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl)
1519
1620open import Ordinal.OmegaMarkers using (OmegaIndex)
1721open import Ordinal.Buchholz.Syntax using (BT; bzero; bOmega; bplus; bpsi)
@@ -25,25 +29,77 @@ open import Ordinal.Buchholz.Order using
2529 ; <ᵇ-ψΩ
2630 ; <ᵇ-+1
2731 ; <ᵇ-+ψ
32+ ; <ᵇ-inv-+Ω
33+ ; <ᵇ-inv-+ψ
2834 )
2935open import Ordinal.Buchholz.WellFounded using (wf-<ᵇ)
3036
3137ComparisonMeasure : Set
32- ComparisonMeasure = BT × BT
38+ data Payload : Set where
39+ payload-neutral : Payload
40+ payload-psi : BT → Payload
41+ payload-plus : BT → BT → Payload
42+
43+ ComparisonMeasure = BT × Payload
3344
3445infix 4 _≈ᶜ_ _≺C_
46+ infix 4 _≺P_
3547
3648data _≈ᶜ_ : BT → BT → Set where
3749 ≈ᶜ-zero : bzero ≈ᶜ bzero
3850 ≈ᶜ-Ω : ∀ {μ : OmegaIndex} → bOmega μ ≈ᶜ bOmega μ
3951 ≈ᶜ-+ : ∀ {x y z} → bplus x y ≈ᶜ bplus x z
4052 ≈ᶜ-ψ : ∀ {ν α β} → bpsi ν α ≈ᶜ bpsi ν β
53+ ≈ᶜ-ψ+ : ∀ {ν α x y} → bpsi ν α ≈ᶜ x → bpsi ν α ≈ᶜ bplus x y
54+
55+ data _≺P_ : Payload → Payload → Set where
56+ pPsiPsi : ∀ {α β} → α <ᵇ β → payload-psi α ≺P payload-psi β
57+ pPsiPlus : ∀ {α β y} → α <ᵇ β → payload-psi α ≺P payload-plus β y
58+ pPlusPlus : ∀ {a y z} → y <ᵇ z → payload-plus a y ≺P payload-plus a z
4159
4260≈ᶜ-trans : ∀ {x y z} → x ≈ᶜ y → y ≈ᶜ z → x ≈ᶜ z
4361≈ᶜ-trans ≈ᶜ-zero ≈ᶜ-zero = ≈ᶜ-zero
4462≈ᶜ-trans ≈ᶜ-Ω ≈ᶜ-Ω = ≈ᶜ-Ω
4563≈ᶜ-trans ≈ᶜ-+ ≈ᶜ-+ = ≈ᶜ-+
4664≈ᶜ-trans ≈ᶜ-ψ ≈ᶜ-ψ = ≈ᶜ-ψ
65+ ≈ᶜ-trans ≈ᶜ-ψ (≈ᶜ-ψ+ x≈y) = ≈ᶜ-ψ+ (≈ᶜ-trans ≈ᶜ-ψ x≈y)
66+ ≈ᶜ-trans (≈ᶜ-ψ+ x≈y) ≈ᶜ-+ = ≈ᶜ-ψ+ x≈y
67+
68+ <ᵇ-respʳ-≡ : _<ᵇ_ Respectsʳ _≡_
69+ <ᵇ-respʳ-≡ refl x<y = x<y
70+
71+ payload-rank : Payload → BT × BT
72+ payload-rank payload-neutral = bzero , bzero
73+ payload-rank (payload-psi α) = α , bzero
74+ payload-rank (payload-plus a y) = a , y
75+
76+ _≺PL_ : Rel (BT × BT) _
77+ _≺PL_ = ×-Lex _≡_ _<ᵇ_ _<ᵇ_
78+
79+ payload-embed : _≺P_ ⇒ (_≺PL_ on payload-rank)
80+ payload-embed (pPsiPsi α<β) = inj₁ α<β
81+ payload-embed (pPsiPlus α<β) = inj₁ α<β
82+ payload-embed (pPlusPlus y<z) = inj₂ (refl , y<z)
83+
84+ ≺PL-wf : WellFounded _≺PL_
85+ ≺PL-wf = ×-wellFounded' (λ where refl refl → refl) <ᵇ-respʳ-≡ wf-<ᵇ wf-<ᵇ
86+
87+ ≺P-wf : WellFounded _≺P_
88+ ≺P-wf =
89+ let module SR = Subrelation payload-embed
90+ in SR.wellFounded (wellFounded payload-rank ≺PL-wf)
91+
92+ <ᵇ-lift-plus : ∀ {x y z} → x <ᵇ y → x <ᵇ bplus y z
93+ <ᵇ-lift-plus {x} {y} {z} = lift x y z
94+ where
95+ lift : ∀ x y z → x <ᵇ y → x <ᵇ bplus y z
96+ lift bzero y z _ = <ᵇ-0-+
97+ lift (bOmega μ) y z x<y = <ᵇ-Ω+ x<y
98+ lift (bpsi ν α) y z x<y = <ᵇ-ψ+ x<y
99+ lift (bplus x₁ x₂) (bOmega μ) z x<Ω = <ᵇ-+1 (<ᵇ-inv-+Ω x<Ω)
100+ lift (bplus x₁ x₂) (bpsi ν α) z x<ψ = <ᵇ-+1 (<ᵇ-inv-+ψ x<ψ)
101+ lift (bplus x₁ x₂) (bplus y₁ y₂) z (<ᵇ-+1 x<y) =
102+ <ᵇ-+1 (lift x₁ y₁ y₂ x<y)
47103
48104<ᵇ-respʳ-≈ᶜ : _<ᵇ_ Respectsʳ _≈ᶜ_
49105<ᵇ-respʳ-≈ᶜ ≈ᶜ-zero ()
@@ -56,15 +112,25 @@ data _≈ᶜ_ : BT → BT → Set where
56112<ᵇ-respʳ-≈ᶜ ≈ᶜ-ψ (<ᵇ-Ωψ μ<ν) = <ᵇ-Ωψ μ<ν
57113<ᵇ-respʳ-≈ᶜ ≈ᶜ-ψ (<ᵇ-ψΩ μ<ν) = <ᵇ-ψΩ μ<ν
58114<ᵇ-respʳ-≈ᶜ ≈ᶜ-ψ (<ᵇ-+ψ x<ψ) = <ᵇ-+ψ (<ᵇ-respʳ-≈ᶜ ≈ᶜ-ψ x<ψ)
115+ <ᵇ-respʳ-≈ᶜ (≈ᶜ-ψ+ ψ≈x) x<ψ = <ᵇ-lift-plus (<ᵇ-respʳ-≈ᶜ ψ≈x x<ψ)
59116
60117_≺C_ : Rel ComparisonMeasure _
61- _≺C_ = ×-Lex _≈ᶜ_ _<ᵇ_ _<ᵇ_
118+ _≺C_ = ×-Lex _≈ᶜ_ _<ᵇ_ _≺P_
62119
63120by-first : ∀ {x y α β} → x <ᵇ y → (x , α) ≺C (y , β)
64121by-first = inj₁
65122
66- by-second : ∀ {x y α β} → x ≈ᶜ y → α <ᵇ β → (x , α) ≺C (y , β)
123+ by-second : ∀ {x y α β} → x ≈ᶜ y → α ≺P β → (x , α) ≺C (y , β)
67124by-second x≈y α<β = inj₂ (x≈y , α<β)
68125
126+ by-payload-ψψ : ∀ {α β} → α <ᵇ β → payload-psi α ≺P payload-psi β
127+ by-payload-ψψ = pPsiPsi
128+
129+ by-payload-ψ+ : ∀ {α β y} → α <ᵇ β → payload-psi α ≺P payload-plus β y
130+ by-payload-ψ+ = pPsiPlus
131+
132+ by-payload-++ : ∀ {a y z} → y <ᵇ z → payload-plus a y ≺P payload-plus a z
133+ by-payload-++ = pPlusPlus
134+
69135≺C-wf : WellFounded _≺C_
70- ≺C-wf = ×-wellFounded' ≈ᶜ-trans <ᵇ-respʳ-≈ᶜ wf-<ᵇ wf-<ᵇ
136+ ≺C-wf = ×-wellFounded' ≈ᶜ-trans <ᵇ-respʳ-≈ᶜ wf-<ᵇ ≺P-wf
0 commit comments