Documentation

LeanPool.OrderMaintenance.Proof.Cost.CPhase

The chunk invariant through the group phase #

A split start and a split move change no chunk's elements or units; a group removal adds one unit to its chunk (a family becomes two quiet groups). This is the extra invariant that the group phase carries (XGroup).

The chunk fields CInvE reads are equal.

Instances For
    theorem OrderMaintenance.Proof.CSame.liveC {s s' : Model.Core} (h : CSame s s') (c : ℕ) :
    LiveC s' c ↔ LiveC s c
    theorem OrderMaintenance.Proof.CSame.cfam {s s' : Model.Core} (h : CSame s s') {x : ℕ} (hf : CFamOK s x) :
    CFamOK s' x
    theorem OrderMaintenance.Proof.CSame.c1 {s s' : Model.Core} (h : CSame s s') {δ δu s₀ : ℕ → ℕ} {x : ℕ} (hu : units s' x = units s x) (hc : C1 s δ δu s₀ x) :
    C1 s' δ δu s₀ x
    theorem OrderMaintenance.Proof.CInvE.transfer {s s' : Model.Core} {L : List ℕ} {δ δu δu' s₀ : ℕ → ℕ} {ex : ℕ} (hC : CInvE s L δ δu s₀ ex) (h : CSame s s') (hel : ∀ (c : ℕ), celts s' L c = celts s L c) (hu : ∀ (c : ℕ), units s' c - δu' c = units s c - δu c) (hδu : ∀ (c : ℕ), δu' c ≤ δ c) (hg : ∀ (g : ℕ), LiveG s' g → LiveC s (gC s' g) ∧ cSt s (gC s' g) ≠ Model.St.dead) :
    CInvE s' L δ δu' s₀ ex

    Transfer of CInvE when the chunk records are the same, the elements' chunks are the same, the unit counts change as δu does, and live groups keep live chunks.

    Split start #

    theorem OrderMaintenance.Proof.cinv_splitStart {s : Model.Core} {A : Abs} {δ δu s₀ : ℕ → ℕ} {ex g labL labR : ℕ} (hI : INV s A) (hC : CInvE s A.elist δ δu s₀ ex) (hg : LiveG s g) (hq : gSt s g = Model.St.quiet) :
    CInvE (splitState s g labL labR) A.elist δ δu s₀ ex

    Split moves #

    theorem OrderMaintenance.Proof.cinv_move {s s' : Model.Core} {A : Abs} {δ δu s₀ : ℕ → ℕ} {ex src dst e lab : ℕ} (hC : CInvE s A.elist δ δu s₀ ex) (M : MoveSpec s s' src dst e lab) (he : eG s e = src) (hchk : gC s dst = gC s src) :
    CInvE s' A.elist δ δu s₀ ex

    Group removal #

    theorem OrderMaintenance.Proof.cinv_remove {s : Model.Core} {A : Abs} {gh : GGh} {δg δ δu s₀ : ℕ → ℕ} {ex p : ℕ} (hI : INV s A) (hG : GInvE s A.elist gh δg p) (hC : CInvE s A.elist δ δu s₀ ex) (hp : LiveG s p) (hs : gSt s p = Model.St.splitting) (hδ : δu (gC s p) + 1 ≤ δ (gC s p)) :
    CInvE (removeState s p) A.elist δ (Function.update δu (gC s p) (δu (gC s p) + 1)) s₀ ex

    The group phase's extra invariant #

    theorem OrderMaintenance.Proof.xgroup_cinv {L : List ℕ} {δ δu s₀ : ℕ → ℕ} {c : ℕ} (hδ : δu c + 1 ≤ δ c) :
    XGroup (fun (t : Model.Core) => CInv t L δ δu s₀) (fun (t : Model.Core) => CInv t L δ (Function.update δu c (δu c + 1)) s₀) L c

    Before any removal: the chunk invariant with δu. After the removal in chunk c: with one more unit in c.