Documentation

LeanPool.OrderMaintenance.Proof.Cost.BgParts

Parts of the background work #

Closing Lemma C3's undriven counts; the inserted element stays in its chunk through the group phase; the chunk count through the chunk drive.

theorem OrderMaintenance.Proof.LInv.close {s : Model.Core} {lg : LGh} {s₀ δ δu : ℕ → ℕ} (hL : LInv s lg s₀ δ δu) (hδu : ∀ (c : ℕ), δu c ≤ δ c) :
LInv s lg s₀ (fun (x : ℕ) => 0) fun (x : ℕ) => 0

Undriven insertions can always be forgotten in Lemma C3 (they only gave slack).

theorem OrderMaintenance.Proof.LX.close {s : Model.Core} {s₀ δ δu : ℕ → ℕ} (h : LX s₀ δ δu s) (hδu : ∀ (c : ℕ), δu c ≤ δ c) :
LX s₀ (fun (x : ℕ) => 0) (fun (x : ℕ) => 0) s
theorem OrderMaintenance.Proof.xgroup_track {L : List ℕ} {c' : ℕ} (y c : ℕ) (hy : y ∈ L) :
XGroup (fun (t : Model.Core) => gC t (eG t y) = c) (fun (t : Model.Core) => gC t (eG t y) = c) L c'

The inserted element stays in its chunk through the group phase.

theorem OrderMaintenance.Proof.cmoveL_qsame {s : Model.Core} {x : ℕ} {u labs : List ℕ} (hxy : x ≠ cLl s x) (hx : x < s.C.size) (hy : cLl s x < s.C.size) (hxs : cSt s x = Model.St.splitting) (hys : cSt s (cLl s x) = Model.St.overflow) :
QSame s (cmoveLState s x u labs)
theorem OrderMaintenance.Proof.cmoveR_qsame {s : Model.Core} {x : ℕ} {u labs : List ℕ} (hxz : x ≠ cRr s x) (hx : x < s.C.size) (hz : cRr s x < s.C.size) (hxs : cSt s x = Model.St.splitting) (hzs : cSt s (cRr s x) = Model.St.overflow) :
QSame s (cmoveRState s x u labs)
theorem OrderMaintenance.Proof.cxsteps_count {X Y : Model.Core → Prop} {L : List ℕ} {δ δu s₀ : ℕ → ℕ} {x : ℕ} (h : CXSteps X Y L δ δu s₀ x) :
CXSteps (fun (t : Model.Core) => X t ∧ ∃ (e : ℕ → ℕ) (pops : ℕ), CountInv t e pops) (fun (t : Model.Core) => Y t ∧ ∃ (e : ℕ → ℕ) (pops : ℕ), CountInv t e pops) L δ δu s₀ x

The chunk count through the chunk drive.

structure OrderMaintenance.Proof.CPost (L : List ℕ) (s₀ : ℕ → ℕ) (t3 t4 : Model.Core) :

What the chunk phase leaves.

Instances For
    theorem OrderMaintenance.Proof.CPost.reservation_invariant {TI : Model.Core → Prop} {μ : Model.Core → ℕ} {J k n R : ℕ} {cap : Model.Params → ℕ} {L : List ℕ} {s₀ : ℕ → ℕ} {s0 s2 s3 t4 : Model.Core} {g c : ℕ} (hCP : CPost L s₀ s3 t4) (hTC : TopContract TI μ J cap) (hPost : InsPost TI k J n R μ L s0 g c s2) (hD : DFrame s2 t4) :
    ResInv TI k J n R μ L t4 0 t4

    The chunk phase's lower invariant and frame initialize the common reservation invariant.

    theorem OrderMaintenance.Proof.driveChunk_ok {t : Model.Core} {A : Abs} {L : List ℕ} {gh : GGh} {s₀ δu e : ℕ → ℕ} {pops c : ℕ} (hI : INV t A) (hel : A.elist = L) (hG : GInv t L gh fun (x : ℕ) => 0) (hC : CInv t L (δ1 c) δu s₀) (hLX : LX s₀ (δ1 c) δu t) (hN : CountInv t e pops) (hGP : GParams t.P) (hCP : CParams t.P) (hcL : LiveC t c) (hcnd : cSt t c ≠ Model.St.dead) (hcsz : 1 ≤ cSz t c) :

    The chunk phase after an insertion into chunk c.