Skip to content

Commit 8c5333a

Browse files
committed
Add ψ≤Ω comparison branch and Ω-index bridge lemmas
1 parent 44bc1df commit 8c5333a

4 files changed

Lines changed: 84 additions & 30 deletions

File tree

proofs/agda/Ordinal/Buchholz/Order.agda

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
-- bzero │ – │ ✓ │ ✓ │ ✓
1818
-- bOmega │ │ ✓ │ │ ✓ (when μ <Ω ν)
1919
-- bplus │ │ │ ✓ │
20-
-- bpsi │ │ │ │ ✓ (when μ <Ω ν)
20+
-- bpsi │ │ │ │ ✓ (when μ <Ω ν)
2121
--
2222
-- Open cases (no constructor yet; must be discharged in follow-ups
2323
-- before `<ᵇ`-totality and well-foundedness can land):
@@ -26,9 +26,6 @@
2626
-- between atomic heads and additive normal forms.
2727
-- * bpsi vs bplus (either direction) — same reason, mediated by
2828
-- the leading bpsi summand of a bplus in CNF.
29-
-- * bpsi vs bOmega with ν ≤Ω μ — the admissibility condition makes
30-
-- bpsi ν α ≤ᵇ bOmega μ when μ exceeds ν; the exact form is part
31-
-- of the Buchholz 1986 comparison and is deferred.
3229
-- * Two same-binder sub-cases whose natural shapes run into Agda
3330
-- 2.6.3's `--without-K` restriction on reflexive-equation
3431
-- elimination and are deferred pending a K-free reformulation:
@@ -43,7 +40,17 @@ module Ordinal.Buchholz.Order where
4340

4441
open import Data.Empty using (⊥)
4542

46-
open import Ordinal.OmegaMarkers using (OmegaIndex; _<Ω_; <Ω-irrefl; <Ω-trans)
43+
open import Ordinal.OmegaMarkers using
44+
( OmegaIndex
45+
; _≤Ω_
46+
; _<Ω_
47+
; <Ω-irrefl
48+
; <Ω-trans
49+
; <Ω→≤Ω
50+
; ≤Ω-trans
51+
; ≤Ω-<Ω-trans
52+
; <Ω-≤Ω-trans
53+
)
4754
open import Ordinal.Buchholz.Syntax using (BT; bzero; bOmega; bplus; bpsi)
4855

4956
data _<ᵇ_ : BT BT Set where
@@ -63,6 +70,7 @@ data _<ᵇ_ : BT → BT → Set where
6370
-- bpsi comparison by Ω-index only. The same-index sub-case (lex on
6471
-- the ψ-argument) is deferred pending a K-free formulation.
6572
<ᵇ-ψΩ : {μ ν α β} μ <Ω ν bpsi μ α <ᵇ bpsi ν β
73+
<ᵇ-ψΩ≤ : {ν μ α} ν ≤Ω μ bpsi ν α <ᵇ bOmega μ
6674

6775
-- bplus comparison by the left summand. The same-left sub-case
6876
-- (compare right summands when lefts agree) is deferred for the
@@ -112,8 +120,15 @@ infix 4 _<ᵇ_
112120
<ᵇ-trans (<ᵇ-Ωψ p) (<ᵇ-ψΩ q) = <ᵇ-Ωψ (<Ω-trans p q)
113121
-- Left leg: <ᵇ-ψΩ (x = bpsi _ _, y = bpsi _ _)
114122
<ᵇ-trans (<ᵇ-ψΩ p) (<ᵇ-ψΩ q) = <ᵇ-ψΩ (<Ω-trans p q)
123+
<ᵇ-trans (<ᵇ-ψΩ p) (<ᵇ-ψΩ≤ q) = <ᵇ-ψΩ≤ (≤Ω-trans (<Ω→≤Ω p) q)
124+
-- Left leg: <ᵇ-ψΩ≤ (x = bpsi _ _, y = bOmega _)
125+
<ᵇ-trans (<ᵇ-ψΩ≤ p) (<ᵇ-ΩΩ q) = <ᵇ-ψΩ≤ (≤Ω-trans p (<Ω→≤Ω q))
126+
<ᵇ-trans (<ᵇ-ψΩ≤ p) (<ᵇ-Ωψ q) = <ᵇ-ψΩ (≤Ω-<Ω-trans p q)
115127
-- Left leg: <ᵇ-+1 (x = bplus _ _, y = bplus _ _)
116128
<ᵇ-trans (<ᵇ-+1 p) (<ᵇ-+1 q) = <ᵇ-+1 (<ᵇ-trans p q)
129+
-- Right leg: <ᵇ-ψΩ≤ (y = bpsi _ _, z = bOmega _)
130+
<ᵇ-trans <ᵇ-0-ψ (<ᵇ-ψΩ≤ _) = <ᵇ-0-Ω
131+
<ᵇ-trans (<ᵇ-Ωψ p) (<ᵇ-ψΩ≤ q) = <ᵇ-ΩΩ (<Ω-≤Ω-trans p q)
117132

118133
----------------------------------------------------------------------------
119134
-- WF-2 open-case inversions (Ω vs +)

proofs/agda/Ordinal/Buchholz/WellFounded.agda

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@ module Ordinal.Buchholz.WellFounded where
88
open import Data.Empty using (⊥; ⊥-elim)
99
open import Data.Nat.Base using (ℕ; _<_)
1010
open 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₂)
1113
open import Relation.Nullary using (¬_)
14+
open import Relation.Binary.PropositionalEquality using (refl)
1215
open import Induction.WellFounded using (Acc; acc; WellFounded; wf⇒asym)
1316

1417
open import Ordinal.OmegaMarkers using
1518
( OmegaIndex
19+
; _≤Ω_
1620
; fin
1721
; ω
1822
; _<Ω_
1923
; fin<fin
2024
; fin<ω
25+
; ≤Ω-split
2126
)
2227
open import Ordinal.Buchholz.Syntax using (BT; bzero; bOmega; bplus; bpsi)
2328
open 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

7385
mutual
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

proofs/agda/Ordinal/OmegaMarkers.agda

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@ module Ordinal.OmegaMarkers where
1010

1111
open import Data.Empty using (⊥)
1212
open import Data.Nat.Base using (ℕ; _≤_; _<_; z≤n; s≤s; zero; suc)
13-
open import Data.Nat.Properties using (≤-refl; ≤-trans; <-irrefl; <-trans)
13+
open import Data.Sum.Base using (_⊎_; inj₁; inj₂)
14+
open import Data.Nat.Properties using
15+
( ≤-refl
16+
; ≤-trans
17+
; <-irrefl
18+
; <-trans
19+
; ≤-<-trans
20+
; <-≤-trans
21+
; m≤n⇒m<n∨m≡n
22+
)
1423
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
1524

1625
data OmegaIndex : Set where
@@ -66,6 +75,26 @@ infix 4 _<Ω_
6675
<→≤ (s≤s (s≤s m<n)) = s≤s (<→≤ (s≤s m<n))
6776
<Ω→≤Ω fin<ω = fin≤ω
6877

78+
-- Mixed transitivity lemmas used by Buchholz order composition.
79+
80+
≤Ω-<Ω-trans : {α β γ} α ≤Ω β β <Ω γ α <Ω γ
81+
≤Ω-<Ω-trans (fin≤fin m≤n) (fin<fin n<k) = fin<fin (≤-<-trans m≤n n<k)
82+
≤Ω-<Ω-trans (fin≤fin _) fin<ω = fin<ω
83+
≤Ω-<Ω-trans fin≤ω ()
84+
≤Ω-<Ω-trans ω≤ω ()
85+
86+
<Ω-≤Ω-trans : {α β γ} α <Ω β β ≤Ω γ α <Ω γ
87+
<Ω-≤Ω-trans (fin<fin m<n) (fin≤fin n≤k) = fin<fin (<-≤-trans m<n n≤k)
88+
<Ω-≤Ω-trans (fin<fin _) fin≤ω = fin<ω
89+
<Ω-≤Ω-trans fin<ω ω≤ω = fin<ω
90+
91+
≤Ω-split : {ν μ} ν ≤Ω μ ν <Ω μ ⊎ ν ≡ μ
92+
≤Ω-split (fin≤fin m≤n) with m≤n⇒m<n∨m≡n m≤n
93+
... | inj₁ m<n = inj₁ (fin<fin m<n)
94+
... | inj₂ refl = inj₂ refl
95+
≤Ω-split fin≤ω = inj₁ fin<ω
96+
≤Ω-split ω≤ω = inj₂ refl
97+
6998
Omega0 : OmegaIndex
7099
Omega0 = fin zero
71100

proofs/agda/Smoke.agda

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ open import Ordinal.Buchholz.Order using
178178
; <ᵇ-ΩΩ
179179
; <ᵇ-Ωψ
180180
; <ᵇ-ψΩ
181+
; <ᵇ-ψΩ≤
181182
; <ᵇ-+1
182183
; <ᵇ-irrefl
183184
; <ᵇ-trans

0 commit comments

Comments
 (0)