Documentation

LeanPool.OrderMaintenance.Proof.Cost.Sched

Scheduling: the priority queue and the zeroing game #

The queue holds exactly the quiet chunks above θ, keyed by their sizes (PQC). So pqPopMax returns a chunk of largest game value, and pqEmpty says that every value is 0. Every step but the insertion's size update and the pop leaves the queue, and the quiet sizes it reads, alone.

The queue's own fields.

Instances For
    theorem OrderMaintenance.Proof.QRep.congr {s s' : Model.Core} {k k' : ℕ → ℕ} {inQ inQ' : ℕ → Bool} {bl : ℕ → List ℕ} {nb : List ℕ} (hQ : QRep s k inQ bl nb) (S : PQSame s s') (hin : ∀ (c : ℕ), inQ' c = inQ c) (hk : ∀ (c : ℕ), inQ c = true → k' c = k c) :
    QRep s' k' inQ' bl nb
    theorem OrderMaintenance.Proof.QInv.congr {s s' : Model.Core} {k k' : ℕ → ℕ} {inQ inQ' : ℕ → Bool} (hQ : QInv s k inQ) (S : PQSame s s') (hin : ∀ (c : ℕ), inQ' c = inQ c) (hk : ∀ (c : ℕ), inQ c = true → k' c = k c) :
    QInv s' k' inQ'
    theorem OrderMaintenance.Proof.PQSame.trans {a b c : Model.Core} (h1 : PQSame a b) (h2 : PQSame b c) :
    PQSame a c
    theorem OrderMaintenance.Proof.PQC.frame {s s' : Model.Core} (h : PQC s) (S : PQSame s s') (hin : ∀ (c : ℕ), inQC s' c = inQC s c) (hk : ∀ (c : ℕ), inQC s c = true → cSz s' c = cSz s c) :
    PQC s'

    A frame for the queue invariant: the queue's fields are unchanged, and so are the queued chunks and their sizes.

    What PQC and the game read of the chunks.

    Instances For
      theorem OrderMaintenance.Proof.PQC.qsame {s s' : Model.Core} (h : PQC s) (S : PQSame s s') (Q : QSame s s') :
      PQC s'
      theorem OrderMaintenance.Proof.QSame.gval {s s' : Model.Core} (h : QSame s s') (c : ℕ) :

      The game values agree when the quiet sizes do.

      theorem OrderMaintenance.Proof.QSame.trans {a b c : Model.Core} (h1 : QSame a b) (h2 : QSame b c) :
      QSame a c

      What the group phase leaves alone #

      Chunk fields other than first/last, the queue and the top structure are unchanged.

      Instances For
        theorem OrderMaintenance.Proof.CFrame.trans {a b c : Model.Core} (h1 : CFrame a b) (h2 : CFrame b c) :
        CFrame a c
        theorem OrderMaintenance.Proof.CFrame.of_C {s s' : Model.Core} (hC : s'.C = s.C) (hP : s'.P = s.P) (hq : PQSame s s') (ht : s'.nodes = s.nodes ∧ s'.path = s.path ∧ s'.cin = s.cin ∧ s'.lpar = s.lpar ∧ s'.resJob = s.resJob ∧ s'.prep = s.prep ∧ s'.ready = s.ready ∧ s'.firstChunk = s.firstChunk) (hcnt : s'.count = s.count) :
        CFrame s s'

        A frame from equal chunk arrays.

        theorem OrderMaintenance.Proof.linkGroupPair_frame (t : Model.Core) (g gl gr labL labR : ℕ) :
        PQSame t (Model.linkGroupPair t g gl gr labL labR) ∧ (Model.linkGroupPair t g gl gr labL labR).nodes = t.nodes ∧ (Model.linkGroupPair t g gl gr labL labR).path = t.path ∧ (Model.linkGroupPair t g gl gr labL labR).cin = t.cin ∧ (Model.linkGroupPair t g gl gr labL labR).lpar = t.lpar ∧ (Model.linkGroupPair t g gl gr labL labR).resJob = t.resJob ∧ (Model.linkGroupPair t g gl gr labL labR).prep = t.prep ∧ (Model.linkGroupPair t g gl gr labL labR).ready = t.ready ∧ (Model.linkGroupPair t g gl gr labL labR).firstChunk = t.firstChunk ∧ (Model.linkGroupPair t g gl gr labL labR).count = t.count
        theorem OrderMaintenance.Proof.cframe_split {s : Model.Core} {A : Abs} {g labL labR : ℕ} (hI : INV s A) (hg : LiveG s g) :
        CFrame s (splitState s g labL labR)
        theorem OrderMaintenance.Proof.xgroup_frame {L : List ℕ} {c : ℕ} (s₀ : Model.Core) :
        XGroup (CFrame s₀) (CFrame s₀) L c

        The group phase leaves the chunk fields, the queue and the top structure alone.

        What the chunk drive leaves alone #

        The queue, the top structure and the chunk list are unchanged, and so are the queued chunks, their sizes and the game values.

        Instances For
          theorem OrderMaintenance.Proof.DFrame.trans {a b c : Model.Core} (h1 : DFrame a b) (h2 : DFrame b c) :
          DFrame a c
          theorem OrderMaintenance.Proof.PQC.dframe {s s' : Model.Core} (h : PQC s) (D : DFrame s s') :
          PQC s'
          theorem OrderMaintenance.Proof.DFrame.of_qsame {s s' : Model.Core} (Q : QSame s s') (hq : PQSame s s') (ht : s'.nodes = s.nodes ∧ s'.path = s.path ∧ s'.cin = s.cin ∧ s'.lpar = s.lpar ∧ s'.resJob = s.resJob ∧ s'.prep = s.prep ∧ s'.ready = s.ready ∧ s'.firstChunk = s.firstChunk) (hl : ∀ (c : ℕ), cN s' c = cN s c ∧ cP s' c = cP s c ∧ cT s' c = cT s c) (hcnt : s'.count = s.count) :
          DFrame s s'

          A frame from equal quiet sizes and states.

          theorem OrderMaintenance.Proof.cmoveL_dframe {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) :
          DFrame s (cmoveLState s x u labs)

          A chunk-split move leaves the quiet chunks alone.

          theorem OrderMaintenance.Proof.cmoveR_dframe {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) :
          DFrame s (cmoveRState s x u labs)
          theorem OrderMaintenance.Proof.cremove_dframe {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) (hxs : cSt s x = Model.St.splitting) (hls : cSt s (cLl s x) = Model.St.overflow) (hrs : cSt s (cRr s x) = Model.St.overflow) (hszl : cSz s (cLl s x) ≤ s.P.theta) (hszr : cSz s (cRr s x) ≤ s.P.theta) :

          A chunk removal: the siblings turn quiet at sizes at most θ, so no game value changes and the queue stays as it is.

          theorem OrderMaintenance.Proof.cxsteps_dframe {X Y : Model.Core → Prop} {L : List ℕ} {δ δu s₀ : ℕ → ℕ} {x : ℕ} (h : CXSteps X Y L δ δu s₀ x) (t₀ : Model.Core) (hcθ : cmax t₀.P ≤ t₀.P.theta) :
          CXSteps (fun (t : Model.Core) => X t ∧ DFrame t₀ t) (fun (t : Model.Core) => Y t ∧ DFrame t₀ t) L δ δu s₀ x

          The chunk drive leaves the queue, the game and the top structure alone, threaded next to an invariant X.