Documentation

LeanPool.OrderMaintenance.Proof.Cost.Pop

The pop: queue, game and the rest #

Popping chunk c takes it out of the queue; starting its split makes it splitting and adds two overflow chunks. So the queue invariant holds again, and the game's new round starts by zeroing a largest value.

theorem OrderMaintenance.Proof.pqsame_split {s s2 : Model.Core} {x : ℕ} {job : Model.Job} (hT : TopRel (Model.linkChunkPair (push2 s) x s.C.size (s.C.size + 1)) s2) :
PQSame s (markState s2 x s.C.size (s.C.size + 1) job)

Starting a chunk split leaves the queue's fields alone.

theorem OrderMaintenance.Proof.pqc_pop {t t2 : Model.Core} {c : ℕ} {bl : ℕ → List ℕ} {nb : List ℕ} (hQ : QRep t (cSz t) (inQC t) bl nb) (hc : inQC t c = true) (R : ResSpec (delSt t c) t2 c) (hS : PQSame (delSt t c) t2) :
PQC t2

The queue invariant after a pop and the split start.

theorem OrderMaintenance.Proof.gval_pop {t t2 : Model.Core} {c : ℕ} (R : ResSpec (delSt t c) t2 c) (d : ℕ) :
gval t2 d ≤ if d = c then 0 else gval t d

The game after a pop and the split start: the popped value is zeroed, nothing grows.

theorem OrderMaintenance.Proof.gval_max {t : Model.Core} {c : ℕ} (hc : inQC t c = true) (hmax : ∀ (d : ℕ), inQC t d = true → cSz t d ≤ cSz t c) (d : ℕ) :
gval t d ≤ gval t c

A queued chunk has the largest game value.