|
| 1 | +{-# OPTIONS --safe --without-K #-} |
| 2 | + |
| 3 | +-- Systematic finite iteration of the comparison-induced wrapper. |
| 4 | +-- |
| 5 | +-- The self-lift theorem for `_<ᵇ⁺_` is false, but the wrapper pattern |
| 6 | +-- itself survives finite iteration. This module packages that pattern |
| 7 | +-- through an explicit step operator on closed wrappers and a finite |
| 8 | +-- depth family of surface derivations embedding into the iterated |
| 9 | +-- wrappers. |
| 10 | + |
| 11 | +module Ordinal.Buchholz.IteratedExtendedOrder where |
| 12 | + |
| 13 | +open import Data.Nat.Base using (ℕ; zero; suc) |
| 14 | +open import Data.Product.Base using (_×_; _,_) |
| 15 | +open import Data.Product.Relation.Binary.Lex.Strict using (×-Lex; ×-wellFounded; ×-wellFounded') |
| 16 | +open import Data.Sum.Base using (inj₁; inj₂) |
| 17 | +open import Function.Base using (_on_) |
| 18 | +open import Induction.WellFounded using (WellFounded; wf⇒asym; module Subrelation) |
| 19 | +open import Relation.Binary.Construct.On as On using (wellFounded) |
| 20 | +open import Relation.Binary.Core using (Rel; _⇒_) |
| 21 | +open import Relation.Binary.Definitions using (Transitive) |
| 22 | +open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl) |
| 23 | +open import Relation.Nullary using (¬_) |
| 24 | + |
| 25 | +open import Ordinal.Buchholz.Syntax using (BT; bzero; bplus; bpsi) |
| 26 | +open import Ordinal.Buchholz.Order using (_<ᵇ_; <ᵇ-trans) |
| 27 | +open import Ordinal.Buchholz.WellFounded using (wf-<ᵇ) |
| 28 | +open import Ordinal.Buchholz.VeblenComparisonTarget using |
| 29 | + ( Payload |
| 30 | + ; payload-neutral |
| 31 | + ; payload-psi |
| 32 | + ; payload-plus |
| 33 | + ; _≈ᶜ_ |
| 34 | + ; ≈ᶜ-+ |
| 35 | + ; ≈ᶜ-ψ |
| 36 | + ; ≈ᶜ-trans |
| 37 | + ; <ᵇ-respʳ-≈ᶜ |
| 38 | + ; <ᵇ-chain-≈ᶜ |
| 39 | + ) |
| 40 | +open import Ordinal.Buchholz.VeblenComparisonModel using (cmp-measure) |
| 41 | + |
| 42 | +record Wrapper : Set₁ where |
| 43 | + field |
| 44 | + rel : Rel BT _ |
| 45 | + wf : WellFounded rel |
| 46 | + trans : Transitive rel |
| 47 | + |
| 48 | +open Wrapper |
| 49 | + |
| 50 | +coreWrapper : Wrapper |
| 51 | +coreWrapper = record |
| 52 | + { rel = _<ᵇ_ |
| 53 | + ; wf = wf-<ᵇ |
| 54 | + ; trans = <ᵇ-trans |
| 55 | + } |
| 56 | + |
| 57 | +module Step (W : Wrapper) where |
| 58 | + open Wrapper W renaming (rel to _<W_; wf to wfW; trans to transW) |
| 59 | + |
| 60 | + data PayloadOrder : Payload → Payload → Set where |
| 61 | + pPsiPsi : ∀ {α β} → α <W β → PayloadOrder (payload-psi α) (payload-psi β) |
| 62 | + pPsiPlus : ∀ {α β y} → α <W β → PayloadOrder (payload-psi α) (payload-plus β y) |
| 63 | + pPlusPlus : ∀ {a y z} → y <W z → PayloadOrder (payload-plus a y) (payload-plus a z) |
| 64 | + |
| 65 | + payload-rank : Payload → BT × BT |
| 66 | + payload-rank payload-neutral = bzero , bzero |
| 67 | + payload-rank (payload-psi α) = α , bzero |
| 68 | + payload-rank (payload-plus a y) = a , y |
| 69 | + |
| 70 | + PayloadRankOrder : Rel (BT × BT) _ |
| 71 | + PayloadRankOrder = ×-Lex _≡_ _<W_ _<W_ |
| 72 | + |
| 73 | + payload-embed : PayloadOrder ⇒ (PayloadRankOrder on payload-rank) |
| 74 | + payload-embed (pPsiPsi α<β) = inj₁ α<β |
| 75 | + payload-embed (pPsiPlus α<β) = inj₁ α<β |
| 76 | + payload-embed (pPlusPlus y<z) = inj₂ (refl , y<z) |
| 77 | + |
| 78 | + payload-wf : WellFounded PayloadOrder |
| 79 | + payload-wf = |
| 80 | + let module SR = Subrelation payload-embed |
| 81 | + in SR.wellFounded (wellFounded payload-rank (×-wellFounded wfW wfW)) |
| 82 | + |
| 83 | + payload-trans : Transitive PayloadOrder |
| 84 | + payload-trans (pPsiPsi α<β) (pPsiPsi β<γ) = pPsiPsi (transW α<β β<γ) |
| 85 | + payload-trans (pPsiPsi α<β) (pPsiPlus β<γ) = pPsiPlus (transW α<β β<γ) |
| 86 | + payload-trans (pPsiPlus α<β) (pPlusPlus _) = pPsiPlus α<β |
| 87 | + payload-trans (pPlusPlus y<z) (pPlusPlus z<w) = pPlusPlus (transW y<z z<w) |
| 88 | + |
| 89 | + ComparisonOrder : Rel (BT × Payload) _ |
| 90 | + ComparisonOrder = ×-Lex _≈ᶜ_ _<ᵇ_ PayloadOrder |
| 91 | + |
| 92 | + comparison-trans : Transitive ComparisonOrder |
| 93 | + comparison-trans (inj₁ x<y) (inj₁ y<z) = inj₁ (<ᵇ-trans x<y y<z) |
| 94 | + comparison-trans (inj₁ x<y) (inj₂ (y≈z , _)) = inj₁ (<ᵇ-respʳ-≈ᶜ y≈z x<y) |
| 95 | + comparison-trans (inj₂ (x≈y , _)) (inj₁ y<z) = inj₁ (<ᵇ-chain-≈ᶜ x≈y y<z) |
| 96 | + comparison-trans (inj₂ (x≈y , px<qy)) (inj₂ (y≈z , qy<rz)) = |
| 97 | + inj₂ (≈ᶜ-trans x≈y y≈z , payload-trans px<qy qy<rz) |
| 98 | + |
| 99 | + comparison-wf : WellFounded ComparisonOrder |
| 100 | + comparison-wf = ×-wellFounded' ≈ᶜ-trans <ᵇ-respʳ-≈ᶜ wf-<ᵇ payload-wf |
| 101 | + |
| 102 | + _<step_ : Rel BT _ |
| 103 | + _<step_ = ComparisonOrder on cmp-measure |
| 104 | + |
| 105 | + wf-step : WellFounded _<step_ |
| 106 | + wf-step = On.wellFounded cmp-measure comparison-wf |
| 107 | + |
| 108 | + ψ-step : ∀ {ν α β} → α <W β → bpsi ν α <step bpsi ν β |
| 109 | + ψ-step α<β = inj₂ (≈ᶜ-ψ , pPsiPsi α<β) |
| 110 | + |
| 111 | + +2-step : ∀ {x y z} → y <W z → bplus x y <step bplus x z |
| 112 | + +2-step y<z = inj₂ (≈ᶜ-+ , pPlusPlus y<z) |
| 113 | + |
| 114 | +stepWrapper : Wrapper → Wrapper |
| 115 | +stepWrapper W = |
| 116 | + let module S = Step W |
| 117 | + in record |
| 118 | + { rel = S._<step_ |
| 119 | + ; wf = S.wf-step |
| 120 | + ; trans = S.comparison-trans |
| 121 | + } |
| 122 | + |
| 123 | +IterWrapper : ℕ → Wrapper |
| 124 | +IterWrapper zero = coreWrapper |
| 125 | +IterWrapper (suc n) = stepWrapper (IterWrapper n) |
| 126 | + |
| 127 | +LiftedOrder : ℕ → Rel BT _ |
| 128 | +LiftedOrder n = rel (IterWrapper n) |
| 129 | + |
| 130 | +LiftedOrder-wf : (n : ℕ) → WellFounded (LiftedOrder n) |
| 131 | +LiftedOrder-wf n = wf (IterWrapper n) |
| 132 | + |
| 133 | +LiftedOrder-trans : (n : ℕ) → Transitive (LiftedOrder n) |
| 134 | +LiftedOrder-trans n = trans (IterWrapper n) |
| 135 | + |
| 136 | +mutual |
| 137 | + |
| 138 | + payload-lift |
| 139 | + : (n : ℕ) |
| 140 | + → ∀ {p q} |
| 141 | + → Step.PayloadOrder (IterWrapper n) p q |
| 142 | + → Step.PayloadOrder (IterWrapper (suc n)) p q |
| 143 | + payload-lift n (Step.pPsiPsi α<β) = Step.pPsiPsi (LiftedOrder-lift n α<β) |
| 144 | + payload-lift n (Step.pPsiPlus α<β) = Step.pPsiPlus (LiftedOrder-lift n α<β) |
| 145 | + payload-lift n (Step.pPlusPlus y<z) = Step.pPlusPlus (LiftedOrder-lift n y<z) |
| 146 | + |
| 147 | + LiftedOrder-lift : (n : ℕ) → LiftedOrder n ⇒ LiftedOrder (suc n) |
| 148 | + LiftedOrder-lift zero x<y = inj₁ x<y |
| 149 | + LiftedOrder-lift (suc n) (inj₁ x<y) = inj₁ x<y |
| 150 | + LiftedOrder-lift (suc n) (inj₂ (x≈y , p)) = inj₂ (x≈y , payload-lift n p) |
| 151 | + |
| 152 | +lift-ψα : (n : ℕ) → ∀ {ν α β} → LiftedOrder n α β → LiftedOrder (suc n) (bpsi ν α) (bpsi ν β) |
| 153 | +lift-ψα n α<β = |
| 154 | + let module S = Step (IterWrapper n) |
| 155 | + in S.ψ-step α<β |
| 156 | + |
| 157 | +lift-+2 : (n : ℕ) → ∀ {x y z} → LiftedOrder n y z → LiftedOrder (suc n) (bplus x y) (bplus x z) |
| 158 | +lift-+2 n y<z = |
| 159 | + let module S = Step (IterWrapper n) |
| 160 | + in S.+2-step y<z |
| 161 | + |
| 162 | +lift-ψ+2 : (n : ℕ) → ∀ {ν x y z} → LiftedOrder n y z → LiftedOrder (suc (suc n)) (bpsi ν (bplus x y)) (bpsi ν (bplus x z)) |
| 163 | +lift-ψ+2 n y<z = lift-ψα (suc n) (lift-+2 n y<z) |
| 164 | + |
| 165 | +LiftedOrder-irreflexive : (n : ℕ) → ∀ {x} → ¬ (LiftedOrder n x x) |
| 166 | +LiftedOrder-irreflexive n {x} x<x = wf⇒asym (LiftedOrder-wf n) x<x x<x |
| 167 | + |
| 168 | +-- Exact same-binder depth, measured above the current Buchholz core. |
| 169 | +data SurfaceDepth : ℕ → BT → BT → Set where |
| 170 | + surf-core : ∀ {x y} → x <ᵇ y → SurfaceDepth zero x y |
| 171 | + surf-ψα : ∀ {n ν α β} → SurfaceDepth n α β → SurfaceDepth (suc n) (bpsi ν α) (bpsi ν β) |
| 172 | + surf-+2 : ∀ {n x y z} → SurfaceDepth n y z → SurfaceDepth (suc n) (bplus x y) (bplus x z) |
| 173 | + |
| 174 | +surface⇒lifted : ∀ {n x y} → SurfaceDepth n x y → LiftedOrder (suc n) x y |
| 175 | +surface⇒lifted (surf-core x<y) = LiftedOrder-lift zero x<y |
| 176 | +surface⇒lifted {n = suc n} (surf-ψα p) = lift-ψα (suc n) (surface⇒lifted p) |
| 177 | +surface⇒lifted {n = suc n} (surf-+2 p) = lift-+2 (suc n) (surface⇒lifted p) |
| 178 | + |
| 179 | +SurfaceDepth-irreflexive : ∀ {n x} → ¬ (SurfaceDepth n x x) |
| 180 | +SurfaceDepth-irreflexive {n} {x} p = LiftedOrder-irreflexive (suc n) (surface⇒lifted p) |
0 commit comments