Documentation

LeanPool.OrderMaintenance.Proof.Cost.CMove

The invariants across a chunk-split move and a chunk removal #

Counting #

theorem OrderMaintenance.Proof.length_filter_split {α : Type} (L : List α) (q P : α → Bool) (h : ∀ a ∈ L, P a = true → q a = true) :
(List.filter (fun (a : α) => q a && !P a) L).length + (List.filter P L).length = (List.filter q L).length
theorem OrderMaintenance.Proof.length_filter_or {α : Type} (L : List α) (q P : α → Bool) (h : ∀ a ∈ L, P a = true → q a = false) :
(List.filter (fun (a : α) => q a || P a) L).length = (List.filter q L).length + (List.filter P L).length
theorem OrderMaintenance.Proof.length_filter_mem (s : Model.Core) (L u : List ℕ) (hnd : u.Nodup) :
(List.filter (fun (e : ℕ) => decide (eG s e ∈ u)) L).length = (List.map (fun (g : ℕ) => (runOf s L g).length) u).sum

The elements in a set of groups, counted group by group.

The group invariant across a chunk-split move (invariant F) #

theorem OrderMaintenance.Proof.CMoveSpec.gfields {s s' : Model.Core} {x dst : ℕ} {u labs : List ℕ} (M : CMoveSpec s s' x dst u labs) (g : ℕ) :
gSz s' g = gSz s g ∧ gSt s' g = gSt s g ∧ gSrc s' g = gSrc s g ∧ gLl s' g = gLl s g ∧ gRr s' g = gRr s g ∧ gN s' g = gN s g ∧ gA s' g = gA s g ∧ gP s' g = gP s g ∧ gF s' g = gF s g ∧ gLs s' g = gLs s g ∧ gC s' g = if g ∈ u then dst else gC s g
theorem OrderMaintenance.Proof.CMoveSpec.liveG {s s' : Model.Core} {x dst : ℕ} {u labs : List ℕ} (M : CMoveSpec s s' x dst u labs) (g : ℕ) :
LiveG s' g ↔ LiveG s g
theorem OrderMaintenance.Proof.CMoveSpec.runOf {s s' : Model.Core} {x dst : ℕ} {u labs : List ℕ} (M : CMoveSpec s s' x dst u labs) (L : List ℕ) (g : ℕ) :
theorem OrderMaintenance.Proof.CMoveSpec.eL {s s' : Model.Core} {x dst : ℕ} {u labs : List ℕ} (M : CMoveSpec s s' x dst u labs) :

A set of groups closed under families.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem OrderMaintenance.Proof.ginv_cmove {s s' : Model.Core} {L : List ℕ} {gh : GGh} {δ : ℕ → ℕ} {ex x dst : ℕ} {u labs : List ℕ} (hG : GInvE s L gh δ ex) (M : CMoveSpec s s' x dst u labs) (hcl : FamClosed s u) :
    GInvE s' L gh δ ex

    The chunk invariant across a chunk-split move #

    theorem OrderMaintenance.Proof.units_erase1 {s s' : Model.Core} {c c' a : ℕ} (ha : UnitG s c a) (ha' : ¬UnitG s' c' a) (h : ∀ (g : ℕ), g ≠ a → (UnitG s' c' g ↔ UnitG s c g)) :
    units s' c' + 1 = units s c
    theorem OrderMaintenance.Proof.CFamOK.disjoint {s : Model.Core} {x x' : ℕ} (F : CFamOK s x) (F' : CFamOK s x') (hxx : x ≠ x') (hs : cSt s x = Model.St.splitting) (hs' : cSt s x' = Model.St.splitting) :
    x' ≠ cLl s x ∧ x' ≠ cRr s x ∧ cLl s x' ≠ x ∧ cRr s x' ≠ x ∧ cLl s x' ≠ cLl s x ∧ cLl s x' ≠ cRr s x ∧ cRr s x' ≠ cLl s x ∧ cRr s x' ≠ cRr s x
    theorem OrderMaintenance.Proof.cinv_cmove {s s' : Model.Core} {A : Abs} {gh : GGh} {δ δu s₀ : ℕ → ℕ} {x dst : ℕ} {u labs : List ℕ} (hG : GInv s A.elist gh fun (x : ℕ) => 0) (hC : CInvE s A.elist δ δu s₀ x) (M : CMoveSpec s s' x dst u labs) (hxL : LiveC s x) (hst : cSt s x = Model.St.splitting) (hdst : dst = cLl s x ∨ dst = cRr s x) (hxd : x ≠ dst) (hu : ∀ g ∈ u, LiveG s g ∧ gC s g = x) (hnd : u.Nodup) (hone : ∃ um ∈ u, UnitG s x um ∧ ∀ g ∈ u, g ≠ um → gSt s g = Model.St.overflow) :
    CInvE s' A.elist δ δu s₀ x ∧ units s' x + 1 = units s x ∧ (List.map (fun (g : ℕ) => gSz s g) u).sum ≤ cSz s x

    Chunk removal #

    theorem OrderMaintenance.Proof.cremoveState_C {s : Model.Core} {x : ℕ} (hx : x < s.C.size) (hl : cLl s x < s.C.size) (hr : cRr s x < s.C.size) (hlx : cLl s x ≠ x) (hrx : cRr s x ≠ x) (c : ℕ) :
    (cremoveState s x).C.getX c = if c = x then deadC (s.C.getX c) else if c = cLl s x ∨ c = cRr s x then quietC (s.C.getX c) else s.C.getX c
    theorem OrderMaintenance.Proof.cinv_cremove {s : Model.Core} {A : Abs} {δ δu s₀ : ℕ → ℕ} {x : ℕ} (hI : INV s A) (hC : CInvE s A.elist δ δu s₀ x) (hxL : LiveC s x) (hst : cSt s x = Model.St.splitting) (he : cF s x = Model.NIL) (hδ : ∀ (c : ℕ), c ≠ cLl s x → c ≠ x → c ≠ cRr s x → δ c = 0) :
    CInv (cremoveState s x) A.elist (fun (x : ℕ) => 0) (fun (x : ℕ) => 0) s₀