Documentation

LeanPool.OrderMaintenance.Proof.Cost.LPop

Lemma C3 at the reservation pop #

Popping chunk x starts its split: two empty chunks y = |C|, z = |C| + 1 are allocated as its siblings, and x turns from quiet to splitting. The ghost state of the new chunks starts at 0, and s₀ x becomes the size of x.

Fields read from the groups only #

theorem OrderMaintenance.Proof.liveG_of_Gs {s s' : Model.Core} (h : s'.Gs = s.Gs) (g : ℕ) :
LiveG s' g ↔ LiveG s g
theorem OrderMaintenance.Proof.GrpsC_of_Gs {s s' : Model.Core} (h : s'.Gs = s.Gs) (c : ℕ) :
GrpsC s' c = GrpsC s c
theorem OrderMaintenance.Proof.units_of_Gs {s s' : Model.Core} (h : s'.Gs = s.Gs) (c : ℕ) :
units s' c = units s c
theorem OrderMaintenance.Proof.pending_of_Gs {s s' : Model.Core} (h : s'.Gs = s.Gs) (lg : LGh) (c : ℕ) :
pending s' lg c = pending s lg c
theorem OrderMaintenance.Proof.charge_of_Gs {s s' : Model.Core} (h : s'.Gs = s.Gs) (hP : s'.P = s.P) (lg : LGh) (c : ℕ) :
charge s' lg c = charge s lg c

The pop #

What starting the split of x changes for the label invariant.

Instances For

    … and the chunk list's links.

    Instances For

      Fresh ghost counters for the chunks y and z.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem OrderMaintenance.Proof.ResSpec.liveC {s s' : Model.Core} {x : ℕ} (R : ResSpec s s' x) (hxL : LiveC s x) (c : ℕ) :
        LiveC s' c ↔ LiveC s c ∨ c = s.C.size ∨ c = s.C.size + 1

        Reserving two chunks adds exactly their two fresh indices to the live chunks.

        theorem OrderMaintenance.Proof.CInvE.family_avoids_quiet {s : Model.Core} {L : List ℕ} {δ δu s₀ : ℕ → ℕ} {ex x : ℕ} (hC : CInvE s L δ δu s₀ ex) (hxq : cSt s x = Model.St.quiet) (x' : ℕ) :
        LiveC s x' → cSt s x' = Model.St.splitting → x' ≠ x ∧ cLl s x' ≠ x ∧ cRr s x' ≠ x ∧ cLl s x' < s.C.size ∧ cRr s x' < s.C.size

        A splitting family avoids every quiet chunk and has allocated siblings.

        theorem OrderMaintenance.Proof.linv_pop {s s' : Model.Core} {A : Abs} {lg : LGh} {s₀ : ℕ → ℕ} {x : ℕ} (R : ResSpec s s' x) (hC : CInv s A.elist (fun (x : ℕ) => 0) (fun (x : ℕ) => 0) s₀) (hL : LInv s lg s₀ (fun (x : ℕ) => 0) fun (x : ℕ) => 0) (hxL : LiveC s x) (hxq : cSt s x = Model.St.quiet) (hun : units s x ≤ unitsOf s.P (cSz s x)) :
        LInv s' (lg.fresh s.C.size (s.C.size + 1)) (Function.update s₀ x (cSz s x)) (fun (x : ℕ) => 0) fun (x : ℕ) => 0

        Lemma C3 at the reservation pop.

        Steps that change nothing the label invariant reads #

        The fields LInv reads are equal.

        Instances For
          theorem OrderMaintenance.Proof.LInv.transfer {s s' : Model.Core} {lg : LGh} {s₀ δ δu : ℕ → ℕ} (S : LSame s s') (hL : LInv s lg s₀ δ δu) :
          LInv s' lg s₀ δ δu

          The top structure's steps change nothing the label invariant reads.

          theorem OrderMaintenance.Proof.LSame.trans {a b c : Model.Core} (h1 : LSame a b) (h2 : LSame b c) :
          LSame a c
          theorem OrderMaintenance.Proof.INV.cN_cP {s : Model.Core} {A : Abs} (hI : INV s A) {x : ℕ} (hx : x ∈ A.chunks) (hp : cP s x ≠ Model.NIL) :
          cN s (cP s x) = x
          theorem OrderMaintenance.Proof.linkCOK_push2 {s : Model.Core} {A : Abs} (hI : INV s A) {x : ℕ} (hx : x ∈ A.chunks) :
          LinkCOK (push2 s) x s.C.size (s.C.size + 1)

          The linking of two new chunks around x does what it should.

          theorem OrderMaintenance.Proof.resSpec_run_core {s s2 : Model.Core} {x : ℕ} {job : Model.Job} (hxs : x < s.C.size) (hT : TopRel (Model.linkChunkPair (push2 s) x s.C.size (s.C.size + 1)) s2) :
          ResSpec' s (markState s2 x s.C.size (s.C.size + 1) job) x

          The state after starting the split of x, from the run of splitChunkStart: the fields other than the chunk links.

          theorem OrderMaintenance.Proof.resSpec_run {s s2 : Model.Core} {A : Abs} {x : ℕ} {job : Model.Job} (hI : INV s A) (hxA : x ∈ A.chunks) (hT : TopRel (Model.linkChunkPair (push2 s) x s.C.size (s.C.size + 1)) s2) :
          ResSpec s (markState s2 x s.C.size (s.C.size + 1) job) x

          Units of a chunk, at most #

          theorem OrderMaintenance.Proof.cSz_eq_sum {s : Model.Core} {A : Abs} {gh : GGh} {δg δ δu s₀ : ℕ → ℕ} {ex ex' : ℕ} (hI : INV s A) (hG : GInvE s A.elist gh δg ex) (hC : CInvE s A.elist δ δu s₀ ex') {x : ℕ} (hx : LiveC s x) :
          cSz s x = ∑ h ∈ GrpsC s x, gSz s h

          A chunk's size is the sum of its groups' sizes.

          theorem OrderMaintenance.Proof.units_le {s : Model.Core} {A : Abs} {gh : GGh} {δg δ δu s₀ : ℕ → ℕ} {ex' : ℕ} (hI : INV s A) (hG : GInv s A.elist gh δg) (hC : CInvE s A.elist δ δu s₀ ex') {x : ℕ} (hx : LiveC s x) :
          units s x * gmin s.P ≤ cSz s x + gmin s.P

          Units at most size / g_min + 1: every unit but the one holding the sentinel has at least g_min elements.

          theorem OrderMaintenance.Proof.units_le_unitsOf {s : Model.Core} {A : Abs} {gh : GGh} {δg δ δu s₀ : ℕ → ℕ} {ex' : ℕ} (hI : INV s A) (hG : GInv s A.elist gh δg) (hC : CInvE s A.elist δ δu s₀ ex') (hP : GParams s.P) {x : ℕ} (hx : LiveC s x) :
          units s x ≤ unitsOf s.P (cSz s x)

          The insertion's state #

          The chunk-size update of an insertion.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem OrderMaintenance.Proof.cinv_ins {s s2 : Model.Core} {A : Abs} {δ δu s₀ : ℕ → ℕ} {ex x lab hh : ℕ} (hI : INV s A) (hC : CInvE s A.elist δ δu s₀ ex) (hx : x ∈ A.elist) (S : InsSpec s s2 (eG s x)) (hE : ∀ (e : ℕ), eG s2 e = eG (Model.linkElem s x s.E.size lab hh) e) :
            CInvE s2 (Spec.insertAfterL x s.E.size A.elist) (Function.update δ (gC s (eG s x)) (δ (gC s (eG s x)) + 1)) δu s₀ ex

            The chunk invariant across an insertion: the chunk's size grows with one more undriven insertion.

            theorem OrderMaintenance.Proof.cinv_pop {s s' : Model.Core} {A : Abs} {s₀ : ℕ → ℕ} {x : ℕ} (hI : INV s A) (R : ResSpec s s' x) (hE : s'.E = s.E) (hC : CInv s A.elist (fun (x : ℕ) => 0) (fun (x : ℕ) => 0) s₀) (hxL : LiveC s x) (hxq : cSt s x = Model.St.quiet) (hT : cSz s x ≤ s.P.T) (hun : units s x ≤ unitsOf s.P (cSz s x)) :
            CInv s' A.elist (fun (x : ℕ) => 0) (fun (x : ℕ) => 0) (Function.update s₀ x (cSz s x))

            The chunk invariant at the pop: C1 starts for the new family of x, with s₀ x the size of x.