Documentation

LeanPool.OrderMaintenance.Proof.Cost.ResStep

The reservation, one iteration at a time #

The lower invariants (LowInv: INV-S, Lemmas G and C1–C3, the queue, the chunk count) survive the top structure's steps, which change only top-structure fields and chunk tags.

The invariants below the top structure, with no undriven insertion.

Instances For

    The fields below the top structure, but for chunk tags and the queue.

    Instances For
      theorem OrderMaintenance.Proof.LowInv.transfer {s s' : Model.Core} {L : List ℕ} (h : LowInv s L) (hS : LowSame s s') (hI : ∃ (A : Abs), INV s' A ∧ A.elist = L) (hpq : PQC s') :
      LowInv s' L

      The lower invariants across a step below the top structure that changes only tags and the queue, given the queue invariant after it.

      theorem OrderMaintenance.Proof.LowInv.top {s s' : Model.Core} {L : List ℕ} (h : LowInv s L) (hT : TopRel s s') (hI : ∃ (A : Abs), INV s' A ∧ A.elist = L) :
      LowInv s' L

      The lower invariants across a top-structure step.

      theorem OrderMaintenance.Proof.gval_zero_of_empty {s : Model.Core} (h : PQC s) (h0 : s.pqHi = 0) (c : ℕ) :
      gval s c = 0

      With an empty queue, every game value is 0.

      theorem OrderMaintenance.Proof.split_rest {s s2 : Model.Core} {x : ℕ} {job : Model.Job} (hT : TopRel (Model.linkChunkPair (push2 s) x s.C.size (s.C.size + 1)) s2) :
      (markState s2 x s.C.size (s.C.size + 1) job).E = s.E ∧ (markState s2 x s.C.size (s.C.size + 1) job).count = s.count ∧ (markState s2 x s.C.size (s.C.size + 1) job).head = s.head ∧ (markState s2 x s.C.size (s.C.size + 1) job).P = s.P

      The fields a chunk split start keeps.

      theorem OrderMaintenance.Proof.GSame.of_eq {s s' : Model.Core} (hG : s'.Gs = s.Gs) (hE : s'.E = s.E) (hh : s'.head = s.head) (hP : s'.P = s.P) :
      GSame s s'
      theorem OrderMaintenance.Proof.lowinv_pop {t s2 : Model.Core} {L : List ℕ} {c : ℕ} {job : Model.Job} (h : LowInv t L) (hGP : GParams t.P) (hc : inQC t c = true) (hT5 : cSz t c ≤ t.P.T) (hs2 : TopRel (Model.linkChunkPair (push2 (delSt t c)) c (delSt t c).C.size ((delSt t c).C.size + 1)) s2) (hrun : EStateM.run (Model.splitChunkStart c) (delSt t c) = EStateM.Result.ok () (markState s2 c (delSt t c).C.size ((delSt t c).C.size + 1) job)) :
      LowInv (markState s2 c (delSt t c).C.size ((delSt t c).C.size + 1) job) L

      The lower invariants after a pop and the split start.