|
| 1 | +{-# OPTIONS --safe --without-K #-} |
| 2 | + |
| 3 | +-- One-level lift of the closed comparison wrapper. |
| 4 | +-- |
| 5 | +-- `_<ᵇ⁺_` is too weak to be stable under the recursive same-binder |
| 6 | +-- lifts needed for a self-contained surface recursion. This module |
| 7 | +-- records the next honest step: lift those same-binder moves from the |
| 8 | +-- current wrapper into a new well-founded wrapper one level up. |
| 9 | + |
| 10 | +module Ordinal.Buchholz.LiftedExtendedOrder where |
| 11 | + |
| 12 | +open import Data.Product.Base using (_×_; _,_) |
| 13 | +open import Data.Product.Relation.Binary.Lex.Strict using (×-Lex; ×-wellFounded; ×-wellFounded') |
| 14 | +open import Data.Sum.Base using (inj₁; inj₂) |
| 15 | +open import Function.Base using (_on_) |
| 16 | +open import Induction.WellFounded using (WellFounded; wf⇒asym; module Subrelation) |
| 17 | +open import Relation.Nullary using (¬_) |
| 18 | +open import Relation.Binary.Core using (Rel; _⇒_) |
| 19 | +open import Relation.Binary.Construct.On as On using (wellFounded) |
| 20 | +open import Relation.Binary.Definitions using (Transitive) |
| 21 | +open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) |
| 22 | + |
| 23 | +open import Ordinal.Buchholz.Syntax using (BT; bzero; bplus; bpsi) |
| 24 | +open import Ordinal.Buchholz.Order using (_<ᵇ_; <ᵇ-trans) |
| 25 | +open import Ordinal.Buchholz.WellFounded using (wf-<ᵇ) |
| 26 | +open import Ordinal.Buchholz.ExtendedOrder using |
| 27 | + ( _<ᵇ⁺_ |
| 28 | + ; <ᵇ⇒<ᵇ⁺ |
| 29 | + ; <ᵇ⁺-+2 |
| 30 | + ; <ᵇ⁺-trans |
| 31 | + ; wf-<ᵇ⁺ |
| 32 | + ) |
| 33 | +open import Ordinal.Buchholz.VeblenComparisonTarget using |
| 34 | + ( Payload |
| 35 | + ; payload-neutral |
| 36 | + ; payload-psi |
| 37 | + ; payload-plus |
| 38 | + ; _≈ᶜ_ |
| 39 | + ; _≺P_ |
| 40 | + ; pPsiPsi |
| 41 | + ; pPsiPlus |
| 42 | + ; pPlusPlus |
| 43 | + ; ≈ᶜ-+ |
| 44 | + ; ≈ᶜ-ψ |
| 45 | + ; ≈ᶜ-trans |
| 46 | + ; <ᵇ-respʳ-≈ᶜ |
| 47 | + ; <ᵇ-chain-≈ᶜ |
| 48 | + ) |
| 49 | +open import Ordinal.Buchholz.VeblenComparisonModel using (cmp-measure) |
| 50 | + |
| 51 | +infix 4 _≺P⁺¹_ _≺C⁺¹_ _<ᵇ⁺¹_ |
| 52 | + |
| 53 | +data _≺P⁺¹_ : Payload → Payload → Set where |
| 54 | + pPsiPsi⁺¹ : ∀ {α β} → α <ᵇ⁺ β → payload-psi α ≺P⁺¹ payload-psi β |
| 55 | + pPsiPlus⁺¹ : ∀ {α β y} → α <ᵇ⁺ β → payload-psi α ≺P⁺¹ payload-plus β y |
| 56 | + pPlusPlus⁺¹ : ∀ {a y z} → y <ᵇ⁺ z → payload-plus a y ≺P⁺¹ payload-plus a z |
| 57 | + |
| 58 | +payload-rank : Payload → BT × BT |
| 59 | +payload-rank payload-neutral = bzero , bzero |
| 60 | +payload-rank (payload-psi α) = α , bzero |
| 61 | +payload-rank (payload-plus a y) = a , y |
| 62 | + |
| 63 | +_≺PL⁺¹_ : Rel (BT × BT) _ |
| 64 | +_≺PL⁺¹_ = ×-Lex _≡_ _<ᵇ⁺_ _<ᵇ⁺_ |
| 65 | + |
| 66 | +payload-embed⁺¹ : _≺P⁺¹_ ⇒ (_≺PL⁺¹_ on payload-rank) |
| 67 | +payload-embed⁺¹ (pPsiPsi⁺¹ α<β) = inj₁ α<β |
| 68 | +payload-embed⁺¹ (pPsiPlus⁺¹ α<β) = inj₁ α<β |
| 69 | +payload-embed⁺¹ (pPlusPlus⁺¹ y<z) = inj₂ (refl , y<z) |
| 70 | + |
| 71 | +≺PL⁺¹-wf : WellFounded _≺PL⁺¹_ |
| 72 | +≺PL⁺¹-wf = ×-wellFounded wf-<ᵇ⁺ wf-<ᵇ⁺ |
| 73 | + |
| 74 | +≺P⁺¹-wf : WellFounded _≺P⁺¹_ |
| 75 | +≺P⁺¹-wf = |
| 76 | + let module SR = Subrelation payload-embed⁺¹ |
| 77 | + in SR.wellFounded (wellFounded payload-rank ≺PL⁺¹-wf) |
| 78 | + |
| 79 | +≺P⁺¹-trans : Transitive _≺P⁺¹_ |
| 80 | +≺P⁺¹-trans (pPsiPsi⁺¹ α<β) (pPsiPsi⁺¹ β<γ) = pPsiPsi⁺¹ (<ᵇ⁺-trans α<β β<γ) |
| 81 | +≺P⁺¹-trans (pPsiPsi⁺¹ α<β) (pPsiPlus⁺¹ β<γ) = pPsiPlus⁺¹ (<ᵇ⁺-trans α<β β<γ) |
| 82 | +≺P⁺¹-trans (pPsiPlus⁺¹ α<β) (pPlusPlus⁺¹ _) = pPsiPlus⁺¹ α<β |
| 83 | +≺P⁺¹-trans (pPlusPlus⁺¹ y<z) (pPlusPlus⁺¹ z<w) = pPlusPlus⁺¹ (<ᵇ⁺-trans y<z z<w) |
| 84 | + |
| 85 | +_≺C⁺¹_ : Rel (BT × Payload) _ |
| 86 | +_≺C⁺¹_ = ×-Lex _≈ᶜ_ _<ᵇ_ _≺P⁺¹_ |
| 87 | + |
| 88 | +≺C⁺¹-trans : Transitive _≺C⁺¹_ |
| 89 | +≺C⁺¹-trans (inj₁ x<y) (inj₁ y<z) = inj₁ (<ᵇ-trans x<y y<z) |
| 90 | +≺C⁺¹-trans (inj₁ x<y) (inj₂ (y≈z , _)) = inj₁ (<ᵇ-respʳ-≈ᶜ y≈z x<y) |
| 91 | +≺C⁺¹-trans (inj₂ (x≈y , _)) (inj₁ y<z) = inj₁ (<ᵇ-chain-≈ᶜ x≈y y<z) |
| 92 | +≺C⁺¹-trans (inj₂ (x≈y , px<qy)) (inj₂ (y≈z , qy<rz)) = |
| 93 | + inj₂ (≈ᶜ-trans x≈y y≈z , ≺P⁺¹-trans px<qy qy<rz) |
| 94 | + |
| 95 | +≺C⁺¹-wf : WellFounded _≺C⁺¹_ |
| 96 | +≺C⁺¹-wf = ×-wellFounded' ≈ᶜ-trans <ᵇ-respʳ-≈ᶜ wf-<ᵇ ≺P⁺¹-wf |
| 97 | + |
| 98 | +_<ᵇ⁺¹_ : Rel BT _ |
| 99 | +_<ᵇ⁺¹_ = _≺C⁺¹_ on cmp-measure |
| 100 | + |
| 101 | +payload-lift⁺¹ : _≺P_ ⇒ _≺P⁺¹_ |
| 102 | +payload-lift⁺¹ (pPsiPsi α<β) = pPsiPsi⁺¹ (<ᵇ⇒<ᵇ⁺ α<β) |
| 103 | +payload-lift⁺¹ (pPsiPlus α<β) = pPsiPlus⁺¹ (<ᵇ⇒<ᵇ⁺ α<β) |
| 104 | +payload-lift⁺¹ (pPlusPlus y<z) = pPlusPlus⁺¹ (<ᵇ⇒<ᵇ⁺ y<z) |
| 105 | + |
| 106 | +<ᵇ⁺⇒<ᵇ⁺¹ : _<ᵇ⁺_ ⇒ _<ᵇ⁺¹_ |
| 107 | +<ᵇ⁺⇒<ᵇ⁺¹ (inj₁ x<y) = inj₁ x<y |
| 108 | +<ᵇ⁺⇒<ᵇ⁺¹ (inj₂ (x≈y , p)) = inj₂ (x≈y , payload-lift⁺¹ p) |
| 109 | + |
| 110 | +<ᵇ⁺¹-ψα : ∀ {ν α β} → α <ᵇ⁺ β → bpsi ν α <ᵇ⁺¹ bpsi ν β |
| 111 | +<ᵇ⁺¹-ψα α<β = inj₂ (≈ᶜ-ψ , pPsiPsi⁺¹ α<β) |
| 112 | + |
| 113 | +<ᵇ⁺¹-+2 : ∀ {x y z} → y <ᵇ⁺ z → bplus x y <ᵇ⁺¹ bplus x z |
| 114 | +<ᵇ⁺¹-+2 y<z = inj₂ (≈ᶜ-+ , pPlusPlus⁺¹ y<z) |
| 115 | + |
| 116 | +<ᵇ⁺¹-ψ+2 : ∀ {ν x y z} → y <ᵇ z → bpsi ν (bplus x y) <ᵇ⁺¹ bpsi ν (bplus x z) |
| 117 | +<ᵇ⁺¹-ψ+2 y<z = <ᵇ⁺¹-ψα (<ᵇ⁺-+2 y<z) |
| 118 | + |
| 119 | +wf-<ᵇ⁺¹ : WellFounded _<ᵇ⁺¹_ |
| 120 | +wf-<ᵇ⁺¹ = On.wellFounded cmp-measure ≺C⁺¹-wf |
| 121 | + |
| 122 | +<ᵇ⁺¹-irreflexive : ∀ {x} → ¬ (x <ᵇ⁺¹ x) |
| 123 | +<ᵇ⁺¹-irreflexive {x} x<x = wf⇒asym wf-<ᵇ⁺¹ x<x x<x |
0 commit comments