Skip to content

Commit f9cf0c4

Browse files
committed
agda: add budgeted recursive Buchholz surface
1 parent 7363006 commit f9cf0c4

3 files changed

Lines changed: 78 additions & 0 deletions

File tree

proofs/agda/All.agda

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ open import Ordinal.Buchholz.ExtendedOrder
4949
open import Ordinal.Buchholz.LiftedExtendedOrder
5050
open import Ordinal.Buchholz.IteratedExtendedOrder
5151
open import Ordinal.Buchholz.RecursiveSurfaceOrder
52+
open import Ordinal.Buchholz.RecursiveSurfaceBudget
5253
open import Ordinal.Buchholz.SurfaceOrder
5354
open import Ordinal.Buchholz.VeblenObligations
5455
open import Ordinal.Buchholz.Smoke
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{-# OPTIONS --safe --without-K #-}
2+
3+
-- Budgeted recursive-surface descent.
4+
--
5+
-- Each recursive same-binder step consumes a finite amount of budget
6+
-- determined by the depth of the direct recursive derivation. This
7+
-- exposes a well-founded carrier for the recursive surface route even
8+
-- before the final unbudgeted well-foundedness theorem is available.
9+
10+
module Ordinal.Buchholz.RecursiveSurfaceBudget where
11+
12+
open import Data.Nat.Base using (ℕ; zero; suc; _+_; _<_)
13+
open import Data.Nat.Induction as NatInd using (<-wellFounded)
14+
open import Data.Nat.Properties using (+-suc; m≤m+n)
15+
open import Data.Product.Base using (_×_; _,_; proj₁; proj₂)
16+
open import Function.Base using (_on_)
17+
open import Induction.WellFounded using (WellFounded; wf⇒asym; module Subrelation)
18+
open import Relation.Binary.Construct.On as On using (wellFounded)
19+
open import Relation.Binary.Core using (Rel; _⇒_)
20+
open import Relation.Binary.PropositionalEquality using (subst)
21+
open import Relation.Nullary using (¬_)
22+
23+
open import Ordinal.Buchholz.Syntax using (BT)
24+
open import Ordinal.Buchholz.IteratedExtendedOrder using
25+
( LiftedOrder
26+
; LiftedOrder-lift
27+
)
28+
open import Ordinal.Buchholz.RecursiveSurfaceOrder using
29+
( _<ᵇʳᶠ_
30+
; <ᵇʳᶠ-depth
31+
; <ᵇʳᶠ⇒lifted
32+
)
33+
34+
BudgetedBT : Set
35+
BudgetedBT = ℕ × BT
36+
37+
infix 4 _<ᵇʳᶠᵇ_
38+
39+
data _<ᵇʳᶠᵇ_ : BudgetedBT BudgetedBT Set where
40+
spend : {n x y} (p : x <ᵇʳᶠ y) (n , x) <ᵇʳᶠᵇ (suc (n + <ᵇʳᶠ-depth p) , y)
41+
42+
BudgetOrder : Rel BudgetedBT _
43+
BudgetOrder = _<_ on proj₁
44+
45+
<ᵇʳᶠᵇ⇒budget : _<ᵇʳᶠᵇ_ ⇒ BudgetOrder
46+
<ᵇʳᶠᵇ⇒budget (spend {n} p) = m≤m+n (suc n) (<ᵇʳᶠ-depth p)
47+
48+
wf-<ᵇʳᶠᵇ : WellFounded _<ᵇʳᶠᵇ_
49+
wf-<ᵇʳᶠᵇ =
50+
let module SR = Subrelation <ᵇʳᶠᵇ⇒budget
51+
in SR.wellFounded (On.wellFounded proj₁ NatInd.<-wellFounded)
52+
53+
<ᵇʳᶠᵇ-irreflexive : {s} ¬ (s <ᵇʳᶠᵇ s)
54+
<ᵇʳᶠᵇ-irreflexive {s} p = wf⇒asym wf-<ᵇʳᶠᵇ p p
55+
56+
LiftedOrder-raise-by
57+
: (k : ℕ) {n x y}
58+
LiftedOrder n x y
59+
LiftedOrder (k + n) x y
60+
LiftedOrder-raise-by zero p = p
61+
LiftedOrder-raise-by (suc k) {n} p =
62+
LiftedOrder-lift (k + n) (LiftedOrder-raise-by k p)
63+
64+
<ᵇʳᶠᵇ⇒lifted : {sx sy} sx <ᵇʳᶠᵇ sy LiftedOrder (proj₁ sy) (proj₂ sx) (proj₂ sy)
65+
<ᵇʳᶠᵇ⇒lifted {sx = n , x} {sy = .(suc (n + <ᵇʳᶠ-depth p)) , y} (spend {n} {x} {y} p) =
66+
subst (λ t LiftedOrder t x y)
67+
(+-suc n (<ᵇʳᶠ-depth p))
68+
(LiftedOrder-raise-by n (<ᵇʳᶠ⇒lifted p))

proofs/agda/Ordinal/Buchholz/Smoke.agda

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,15 @@ open import Ordinal.Buchholz.RecursiveSurfaceOrder using
218218
; <ᵇʳᶠ-irreflexive
219219
)
220220

221+
open import Ordinal.Buchholz.RecursiveSurfaceBudget using
222+
( BudgetedBT
223+
; _<ᵇʳᶠᵇ_
224+
; spend
225+
; wf-<ᵇʳᶠᵇ
226+
; <ᵇʳᶠᵇ-irreflexive
227+
; <ᵇʳᶠᵇ⇒lifted
228+
)
229+
221230
open import Ordinal.Buchholz.SurfaceOrder using
222231
( _<ᵇˢ_
223232
; <ᵇˢ-core

0 commit comments

Comments
 (0)