@@ -8,16 +8,21 @@ module Ordinal.Buchholz.WellFounded where
88open import Data.Empty using (⊥; ⊥-elim)
99open import Data.Nat.Base using (ℕ; _<_)
1010open import Data.Nat.Induction as NatInd using (<-wellFounded)
11+ open import Data.Product.Base using (_×_; _,_; proj₁; proj₂)
12+ open import Data.Sum.Base using (inj₁; inj₂)
1113open import Relation.Nullary using (¬_)
14+ open import Relation.Binary.PropositionalEquality using (refl)
1215open import Induction.WellFounded using (Acc; acc; WellFounded; wf⇒asym)
1316
1417open import Ordinal.OmegaMarkers using
1518 ( OmegaIndex
19+ ; _≤Ω_
1620 ; fin
1721 ; ω
1822 ; _<Ω_
1923 ; fin<fin
2024 ; fin<ω
25+ ; ≤Ω-split
2126 )
2227open import Ordinal.Buchholz.Syntax using (BT; bzero; bOmega; bplus; bpsi)
2328open import Ordinal.Buchholz.Order using
@@ -28,6 +33,7 @@ open import Ordinal.Buchholz.Order using
2833 ; <ᵇ-ΩΩ
2934 ; <ᵇ-Ωψ
3035 ; <ᵇ-ψΩ
36+ ; <ᵇ-ψΩ≤
3137 ; <ᵇ-+1
3238 )
3339
@@ -52,44 +58,47 @@ open import Ordinal.Buchholz.Order using
5258<ᵇ-acc-bzero : Acc _<ᵇ_ bzero
5359<ᵇ-acc-bzero = acc <ᵇ-pred-bzero
5460
55- mutual
61+ ΩBundle : OmegaIndex → Set
62+ ΩBundle μ = Acc _<ᵇ_ (bOmega μ) × ((α : BT) → Acc _<ᵇ_ (bpsi μ α))
5663
57- <ᵇ-pred-bOmega-fromΩ : ∀ {μ x} → Acc _<Ω_ μ → x <ᵇ bOmega μ → Acc _<ᵇ_ x
58- <ᵇ-pred-bOmega-fromΩ _ <ᵇ-0-Ω = <ᵇ-acc-bzero
59- <ᵇ-pred-bOmega-fromΩ (acc rsμ) (<ᵇ-ΩΩ κ<μ) = <ᵇ-acc-bOmega-fromΩ (rsμ κ<μ)
64+ <ᵇ-bundle-fromΩ : ∀ {μ} → Acc _<Ω_ μ → ΩBundle μ
65+ <ᵇ-bundle-fromΩ {μ} aμ@(acc rsμ) = omegaAcc , psiAcc
66+ where
67+ mutual
6068
61- <ᵇ-acc-bOmega-fromΩ : ∀ {μ} → Acc _<Ω_ μ → Acc _<ᵇ_ (bOmega μ)
62- <ᵇ-acc-bOmega-fromΩ aμ = acc (<ᵇ-pred-bOmega-fromΩ aμ)
69+ omegaAcc : Acc _<ᵇ_ (bOmega μ)
70+ omegaAcc = acc predOmega
6371
64- mutual
72+ predOmega : ∀ {x} → x <ᵇ bOmega μ → Acc _<ᵇ_ x
73+ predOmega <ᵇ-0-Ω = <ᵇ-acc-bzero
74+ predOmega (<ᵇ-ΩΩ κ<μ) = proj₁ (<ᵇ-bundle-fromΩ (rsμ κ<μ))
75+ predOmega (<ᵇ-ψΩ≤ {α = α} ν≤μ) with ≤Ω-split ν≤μ
76+ ... | inj₁ ν<μ = proj₂ (<ᵇ-bundle-fromΩ (rsμ ν<μ)) α
77+ ... | inj₂ refl = psiAcc α
6578
66- <ᵇ-pred-bplus-from : ∀ {α β x} → Acc _<ᵇ_ α → x <ᵇ bplus α β → Acc _<ᵇ_ x
67- <ᵇ-pred-bplus-from _ <ᵇ-0-+ = <ᵇ-acc-bzero
68- <ᵇ-pred-bplus-from (acc rsα) (<ᵇ-+1 {x₂ = x₂} x₁<α) = <ᵇ-acc-bplus-from (rsα x₁<α) x₂
69-
70- <ᵇ-acc-bplus-from : ∀ {α} → Acc _<ᵇ_ α → (β : BT) → Acc _<ᵇ_ (bplus α β)
71- <ᵇ-acc-bplus-from aα β = acc (<ᵇ-pred-bplus-from aα)
79+ psiAcc : (α : BT) → Acc _<ᵇ_ (bpsi μ α)
80+ psiAcc α = acc λ where
81+ <ᵇ-0-ψ → <ᵇ-acc-bzero
82+ (<ᵇ-Ωψ κ<μ) → proj₁ (<ᵇ-bundle-fromΩ (rsμ κ<μ))
83+ (<ᵇ-ψΩ {α = β} κ<μ) → proj₂ (<ᵇ-bundle-fromΩ (rsμ κ<μ)) β
7284
7385mutual
7486
75- <ᵇ-pred-bpsi-fromΩ : ∀ {μ α x} → Acc _<Ω_ μ → x <ᵇ bpsi μ α → Acc _<ᵇ_ x
76- <ᵇ-pred-bpsi-fromΩ _ <ᵇ-0-ψ = <ᵇ-acc-bzero
77- <ᵇ-pred-bpsi-fromΩ (acc rsμ) (<ᵇ-Ωψ κ<μ) = <ᵇ-acc-bOmega-fromΩ (rsμ κ<μ)
78- <ᵇ-pred-bpsi-fromΩ (acc rsμ) (<ᵇ-ψΩ {α = β} κ<μ) = <ᵇ-acc-bpsi-fromΩ (rsμ κ<μ) β
79-
80- <ᵇ-acc-bpsi-fromΩ : ∀ {μ} → Acc _<Ω_ μ → (α : BT) → Acc _<ᵇ_ (bpsi μ α)
81- <ᵇ-acc-bpsi-fromΩ aμ α = acc (<ᵇ-pred-bpsi-fromΩ aμ)
87+ <ᵇ-acc-bOmega : (μ : OmegaIndex) → Acc _<ᵇ_ (bOmega μ)
88+ <ᵇ-acc-bOmega μ = proj₁ (<ᵇ-bundle-fromΩ (<Ω-wf μ))
8289
83- mutual
90+ <ᵇ-pred-bplus-from : ∀ {α β x} → Acc _<ᵇ_ α → x <ᵇ bplus α β → Acc _<ᵇ_ x
91+ <ᵇ-pred-bplus-from _ <ᵇ-0-+ = <ᵇ-acc-bzero
92+ <ᵇ-pred-bplus-from (acc rsα) (<ᵇ-+1 {x₂ = x₂} x₁<α) = <ᵇ-acc-bplus-from (rsα x₁<α) x₂
8493
85- <ᵇ-acc-bOmega : (μ : OmegaIndex ) → Acc _<ᵇ_ (bOmega μ )
86- <ᵇ-acc-bOmega μ = <ᵇ-acc-bOmega-fromΩ (<Ω-wf μ )
94+ <ᵇ-acc-bplus-from : ∀ {α} → Acc _<ᵇ_ α → (β : BT ) → Acc _<ᵇ_ (bplus α β )
95+ <ᵇ-acc-bplus-from aα β = acc ( <ᵇ-pred-bplus-from aα )
8796
8897 <ᵇ-acc-bplus : (α β : BT) → Acc _<ᵇ_ (bplus α β)
8998 <ᵇ-acc-bplus α β = <ᵇ-acc-bplus-from (wf-<ᵇ α) β
9099
91100 <ᵇ-acc-bpsi : (μ : OmegaIndex) (α : BT) → Acc _<ᵇ_ (bpsi μ α)
92- <ᵇ-acc-bpsi μ α = <ᵇ-acc-bpsi- fromΩ (<Ω-wf μ) α
101+ <ᵇ-acc-bpsi μ α = proj₂ ( <ᵇ-bundle- fromΩ (<Ω-wf μ) ) α
93102
94103 wf-<ᵇ : WellFounded _<ᵇ_
95104 wf-<ᵇ bzero = <ᵇ-acc-bzero
0 commit comments