Documentation

LeanPool.OrderMaintenance.Proof.Top.PresWalk

M5: walk steps that start no drain #

At node v the walk adds 2 to the stored weight. If v is a target of a running drain, the job then funds that drain with up to s sweep steps (fundLoop), else it moves up.

theorem OrderMaintenance.Proof.Top.Shape.of_frame {s s' : TS} {cl : List ℕ} {ord : ℕ → List ℕ} (S : Shape s cl ord) (T : SameTree s s') (hpath : s'.path = s.path) (htag : s'.tag = s.tag) (hfirst : ∀ (u : ℕ), (nd s' u).first = (nd s u).first) (hlast : ∀ (u : ℕ), (nd s' u).last = (nd s u).last) :
Shape s' cl ord

The order invariant reads neither stored weights nor the running job.

The walk's chain #

theorem OrderMaintenance.Proof.Top.Shape.upChain_succ {s : TS} {cl : List ℕ} {ord : ℕ → List ℕ} (S : Shape s cl ord) (f u : ℕ) :
liveN s u → s.P.H + 1 - ht s u ≤ f → upChain s (f + 1) u = upChain s f u

Enough fuel: the chain reaches the root.

Adding 2 to a stored weight #

The walk's weight update at v.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem OrderMaintenance.Proof.Top.wiC_weight (s : Model.Core) (v u : ℕ) (hv : v < s.nodes.size) :
    (nd (ts (wiC s v)) u).weight = if u = v then (nd (ts s) u).weight + 2 else (nd (ts s) u).weight
    theorem OrderMaintenance.Proof.Top.wiC_first (s : Model.Core) (v u : ℕ) :
    (nd (ts (wiC s v)) u).first = (nd (ts s) u).first
    theorem OrderMaintenance.Proof.Top.wiC_last (s : Model.Core) (v u : ℕ) :
    (nd (ts (wiC s v)) u).last = (nd (ts s) u).last

    The job after the walk visits v and starts no drain.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem OrderMaintenance.Proof.Top.inv_winc {s : Model.Core} {cl : List ℕ} {ord : ℕ → List ℕ} {dr n0 : ℕ → ℕ} {j : Model.Job} {v : ℕ} (hpc : j.pc = Model.JobPc.walk (some v)) (hv0 : v ≠ Model.NIL) (hI : InvJ (ts s) cl ord dr n0 (some j)) (hno : ¬((nd (ts s) v).livePar ≠ Model.NIL ∧ (nd (ts s) v).draining = false ∧ (nd (ts s) v).overflowOf = Model.NIL ∧ Wd s.P (ht (ts s) v) < (nd (ts s) v).weight + 2)) :
      InvJ (ts (wiC s v)) cl ord dr n0 (some (walkNext (ts s) j v))

      The weight update keeps the invariant, when v does not start a drain.