Skip to content

Commit 5b3bfa8

Browse files
committed
agda: close final Veblen comparison-model lemma
1 parent d30dc73 commit 5b3bfa8

3 files changed

Lines changed: 130 additions & 41 deletions

File tree

proofs/agda/Ordinal/Buchholz/Smoke.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ open import Ordinal.Buchholz.VeblenComparisonTarget using
150150
; _≺C_
151151
; ≈ᶜ-+
152152
; ≈ᶜ-ψ
153+
; ≈ᶜ-ψ+
153154
; by-first
154155
; by-second
155156
; ≺C-wf
@@ -159,6 +160,7 @@ open import Ordinal.Buchholz.VeblenComparisonModel using
159160
( cmp-payload
160161
; cmp-measure
161162
; cmp-dec-Ω+
163+
; cmp-dec-ψ+-same-index
162164
; cmp-dec-ψ+
163165
; comparison-interface
164166
; core-wf-from-comparison

proofs/agda/Ordinal/Buchholz/VeblenComparisonModel.agda

Lines changed: 54 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
-- Comparison-model follow-up for the Veblen route.
44
--
55
-- This packages the new lexicographic comparison target into a
6-
-- near-concrete interface instantiation. The two original deferred
7-
-- same-binder obligations are discharged internally; the remaining
8-
-- assumption is the lifted same-index ψ-to-plus case.
6+
-- concrete interface instantiation. The original deferred same-binder
7+
-- obligations and the lifted same-index ψ-to-plus case are all
8+
-- discharged internally.
99

1010
module Ordinal.Buchholz.VeblenComparisonModel where
1111

@@ -33,21 +33,37 @@ open import Ordinal.Buchholz.Order using
3333
open import Ordinal.Buchholz.VeblenInterface using (VeblenWFInterface)
3434
open import Ordinal.Buchholz.VeblenComparisonTarget using
3535
( ComparisonMeasure
36+
; Payload
37+
; payload-neutral
38+
; payload-psi
39+
; payload-plus
3640
; _≈ᶜ_
3741
; ≈ᶜ-+
3842
; ≈ᶜ-ψ
39-
; ≈ᶜ-Ω
43+
; ≈ᶜ-ψ+
4044
; _≺C_
45+
; _≺P_
46+
; pPsiPsi
47+
; pPsiPlus
4148
; by-first
4249
; by-second
50+
; by-payload-ψψ
51+
; by-payload-ψ+
52+
; by-payload-++
4353
; ≺C-wf
4454
)
4555

46-
cmp-payload : BT BT
47-
cmp-payload bzero = bzero
48-
cmp-payload (bOmega _) = bzero
49-
cmp-payload (bplus _ y) = y
50-
cmp-payload (bpsi _ α) = α
56+
cmp-anchor : BT BT
57+
cmp-anchor bzero = bzero
58+
cmp-anchor (bOmega μ) = bOmega μ
59+
cmp-anchor (bpsi _ α) = α
60+
cmp-anchor (bplus x _) = cmp-anchor x
61+
62+
cmp-payload : BT Payload
63+
cmp-payload bzero = payload-neutral
64+
cmp-payload (bOmega _) = payload-neutral
65+
cmp-payload (bplus x y) = payload-plus (cmp-anchor x) y
66+
cmp-payload (bpsi _ α) = payload-psi α
5167

5268
cmp-measure : BT ComparisonMeasure
5369
cmp-measure t = t , cmp-payload t
@@ -56,27 +72,37 @@ cmp-dec-Ω+ :
5672
{μ x y}
5773
cmp-measure (bOmega μ) ≺C cmp-measure x
5874
cmp-measure (bOmega μ) ≺C cmp-measure (bplus x y)
59-
cmp-dec-Ω+ (inj₁ Ω<x) = by-first (<ᵇ-Ω+ Ω<x)
60-
cmp-dec-Ω+ (inj₂ (≈ᶜ-Ω , ()))
75+
cmp-dec-Ω+ (inj₁ Ω<x) = by-first (<ᵇ-Ω+ Ω<x)
76+
cmp-dec-Ω+ {x = bzero} (inj₂ ())
77+
cmp-dec-Ω+ {x = bOmega _} (inj₂ (≈ᶜ-Ω , ()))
78+
cmp-dec-Ω+ {x = bplus _ _} (inj₂ ())
79+
cmp-dec-Ω+ {x = bpsi _ _} (inj₂ ())
80+
81+
cmp-payload-step :
82+
{ν α x y}
83+
bpsi ν α ≈ᶜ x
84+
cmp-payload (bpsi ν α) ≺P cmp-payload x
85+
cmp-payload (bpsi ν α) ≺P cmp-payload (bplus x y)
86+
cmp-payload-step ≈ᶜ-ψ (pPsiPsi α<β) = by-payload-ψ+ α<β
87+
cmp-payload-step (≈ᶜ-ψ+ _) (pPsiPlus α<β) = by-payload-ψ+ α<β
88+
89+
cmp-dec-ψ+-same-index :
90+
{ν α β y}
91+
α <ᵇ β
92+
cmp-measure (bpsi ν α) ≺C cmp-measure (bplus (bpsi ν β) y)
93+
cmp-dec-ψ+-same-index α<β =
94+
by-second (≈ᶜ-ψ+ ≈ᶜ-ψ) (by-payload-ψ+ α<β)
6195

6296
cmp-dec-ψ+ :
63-
(dec-ψ+-same-index :
64-
{ν α β y}
65-
α <ᵇ β
66-
cmp-measure (bpsi ν α) ≺C cmp-measure (bplus (bpsi ν β) y))
6797
{ν α x y}
6898
cmp-measure (bpsi ν α) ≺C cmp-measure x
6999
cmp-measure (bpsi ν α) ≺C cmp-measure (bplus x y)
70-
cmp-dec-ψ+ dec-ψ+-same-index (inj₁ ψ<x) = by-first (<ᵇ-ψ+ ψ<x)
71-
cmp-dec-ψ+ dec-ψ+-same-index (inj₂ (≈ᶜ-ψ , α<β)) = dec-ψ+-same-index α<β
100+
cmp-dec-ψ+ (inj₁ ψ<x) = by-first (<ᵇ-ψ+ ψ<x)
101+
cmp-dec-ψ+ (inj₂ (ψ≈x , ψ<x)) = by-second (≈ᶜ-ψ+ ψ≈x) (cmp-payload-step ψ≈x ψ<x)
72102

73103
comparison-interface :
74-
(dec-ψ+-same-index :
75-
{ν α β y}
76-
α <ᵇ β
77-
cmp-measure (bpsi ν α) ≺C cmp-measure (bplus (bpsi ν β) y))
78104
VeblenWFInterface ComparisonMeasure _≺C_
79-
comparison-interface dec-ψ+-same-index = record
105+
comparison-interface = record
80106
{ measure = cmp-measure
81107
; ≺-wf = ≺C-wf
82108
; dec-0-Ω = by-first <ᵇ-0-Ω
@@ -87,19 +113,14 @@ comparison-interface dec-ψ+-same-index = record
87113
; dec-ψΩ = λ μ<ν by-first (<ᵇ-ψΩ μ<ν)
88114
; dec-ψΩ≤ = λ ν≤μ by-first (<ᵇ-ψΩ≤ ν≤μ)
89115
; dec-Ω+ = cmp-dec-Ω+
90-
; dec-ψ+ = cmp-dec-ψ+ dec-ψ+-same-index
116+
; dec-ψ+ = cmp-dec-ψ+
91117
; dec-+Ω = λ x<Ω by-first (<ᵇ-+Ω x<Ω)
92118
; dec-+ψ = λ x<ψ by-first (<ᵇ-+ψ x<ψ)
93119
; dec-+1 = λ x₁<y₁ by-first (<ᵇ-+1 x₁<y₁)
94-
; dec-ψα = λ α<β by-second ≈ᶜ-ψ α<β
95-
; dec-+2 = λ y₂<z₂ by-second ≈ᶜ-+ y₂<z₂
120+
; dec-ψα = λ α<β by-second ≈ᶜ-ψ (by-payload-ψψ α<β)
121+
; dec-+2 = λ y₂<z₂ by-second ≈ᶜ-+ (by-payload-++ y₂<z₂)
96122
}
97123

98-
core-wf-from-comparison :
99-
(dec-ψ+-same-index :
100-
{ν α β y}
101-
α <ᵇ β
102-
cmp-measure (bpsi ν α) ≺C cmp-measure (bplus (bpsi ν β) y))
103-
WellFounded _<ᵇ_
104-
core-wf-from-comparison dec-ψ+-same-index =
105-
VeblenWFInterface.core-wf (comparison-interface dec-ψ+-same-index)
124+
core-wf-from-comparison : WellFounded _<ᵇ_
125+
core-wf-from-comparison =
126+
VeblenWFInterface.core-wf comparison-interface

proofs/agda/Ordinal/Buchholz/VeblenComparisonTarget.agda

Lines changed: 74 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
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

78
module Ordinal.Buchholz.VeblenComparisonTarget where
89

910
open import Data.Product.Base using (_×_; _,_)
1011
open import Data.Product.Relation.Binary.Lex.Strict using (×-Lex; ×-wellFounded')
1112
open 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)
1417
open import Relation.Binary.Definitions using (_Respectsʳ_)
18+
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl)
1519

1620
open import Ordinal.OmegaMarkers using (OmegaIndex)
1721
open 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
)
2935
open import Ordinal.Buchholz.WellFounded using (wf-<ᵇ)
3036

3137
ComparisonMeasure : 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

3445
infix 4 _≈ᶜ_ _≺C_
46+
infix 4 _≺P_
3547

3648
data _≈ᶜ_ : 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

63120
by-first : {x y α β} x <ᵇ y (x , α) ≺C (y , β)
64121
by-first = inj₁
65122

66-
by-second : {x y α β} x ≈ᶜ y α <ᵇ β (x , α) ≺C (y , β)
123+
by-second : {x y α β} x ≈ᶜ y α ≺P β (x , α) ≺C (y , β)
67124
by-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

Comments
 (0)