Documentation

LeanPool.OrderMaintenance.Proof.Cost.GSteps

Group steps, field by field #

What startGroupSplit, a split move and group removal do to the group records, in a form that the cost invariants (groups here, chunks later) can use directly.

Starting a split #

The two groups a split start allocates.

Equations
Instances For

    The state after a split start with labels labL, labR.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem OrderMaintenance.Proof.linkGroupPair_gSz {s : Model.Core} {g gl gr labL labR : ℕ} (z : ℕ) :
      gSz (Model.linkGroupPair s g gl gr labL labR) z = gSz s z
      theorem OrderMaintenance.Proof.LinkOK.field {s : Model.Core} {g gl gr labL labR : ℕ} {β : Type} (h : LinkOK s g gl gr) (F : Model.Group → β) (z : ℕ) (hn : ∀ (X : Model.Group) (v : ℕ), F { next := v, prev := X.prev, first := X.first, last := X.last, chk := X.chk, lab := X.lab, size := X.size, st := X.st, src := X.src, l := X.l, r := X.r, alive := X.alive } = F X) (hp : ∀ (X : Model.Group) (v : ℕ), F { next := X.next, prev := v, first := X.first, last := X.last, chk := X.chk, lab := X.lab, size := X.size, st := X.st, src := X.src, l := X.l, r := X.r, alive := X.alive } = F X) :
      F ((Model.linkGroupPair s g gl gr labL labR).Gs.getX z) = if z = g then F (have __src := s.Gs.getX g; { next := gr, prev := gl, first := __src.first, last := __src.last, chk := __src.chk, lab := __src.lab, size := __src.size, st := Model.St.splitting, src := __src.src, l := gl, r := gr, alive := __src.alive }) else if z = gl then F (have __src := s.Gs.getX gl; { next := g, prev := gP s g, first := __src.first, last := __src.last, chk := __src.chk, lab := labL, size := __src.size, st := Model.St.overflow, src := g, l := __src.l, r := __src.r, alive := __src.alive }) else if z = gr then F (have __src := s.Gs.getX gr; { next := gN s g, prev := g, first := __src.first, last := __src.last, chk := __src.chk, lab := labR, size := __src.size, st := Model.St.overflow, src := g, l := __src.l, r := __src.r, alive := __src.alive }) else F (s.Gs.getX z)

      A field that linkGroupPair sets only at g, gl and gr.

      structure OrderMaintenance.Proof.SplitSpec (s s' : Model.Core) (g gl gr labL labR : ℕ) :

      The group records after a split start.

      Instances For
        theorem OrderMaintenance.Proof.splitSpec {s : Model.Core} {A : Abs} (hI : INV s A) {g : ℕ} (hg : g ∈ A.glist) (labL labR : ℕ) :
        SplitSpec s (splitState s g labL labR) g (splitL s g) (splitR s g) labL labR

        Neighbours in the group list #

        theorem OrderMaintenance.Proof.INV.gN_gP {s : Model.Core} {A : Abs} (hI : INV s A) {g : ℕ} (hg : g ∈ A.glist) (hp : gP s g ≠ Model.NIL) :
        gN s (gP s g) = g
        theorem OrderMaintenance.Proof.INV.gP_gN {s : Model.Core} {A : Abs} (hI : INV s A) {g : ℕ} (hg : g ∈ A.glist) (hn : gN s g ≠ Model.NIL) :
        gP s (gN s g) = g
        theorem OrderMaintenance.Proof.INV.runOf_dead {s : Model.Core} {A : Abs} (hI : INV s A) {g : ℕ} (hg : ¬LiveG s g) :
        runOf s A.elist g = []

        GInv across a split start #

        Fresh ghost counters for the two new groups.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem OrderMaintenance.Proof.SplitSpec.group_fields_of_ne {s s' : Model.Core} {g gl gr labL labR z : ℕ} (S : SplitSpec s s' g gl gr labL labR) (hz : LiveG s z) (hzg : z ≠ g) :
          gSt s' z = gSt s z ∧ gSrc s' z = gSrc s z ∧ gLl s' z = gLl s z ∧ gRr s' z = gRr s z ∧ gSz s' z = gSz s z ∧ gC s' z = gC s z

          A split leaves the records of every other live group unchanged.

          theorem OrderMaintenance.Proof.SplitSpec.runOf_eq {s s' : Model.Core} {g gl gr labL labR : ℕ} (S : SplitSpec s s' g gl gr labL labR) (elements : List ℕ) (z : ℕ) :
          runOf s' elements z = runOf s elements z

          A split preserves the element run of every group.

          theorem OrderMaintenance.Proof.ginv_splitStart {s : Model.Core} {A : Abs} {gh : GGh} {g : ℕ} (hI : INV s A) (hG : GInv s A.elist gh fun (b : ℕ) => if b = g then 1 else 0) (hg : LiveG s g) (hq : gSt s g = Model.St.quiet) (hsz : s.P.G ≤ gSz s g) (labL labR : ℕ) :
          GInv (splitState s g labL labR) A.elist (gh.reset (splitL s g) (splitR s g)) fun (x : ℕ) => 0