Documentation

LeanPool.OrderMaintenance.Proof.Top.Inv

M5: the top structure's invariant TopInv #

Constants (docs/PROOF.md §4.5.2), for h ≥ 1: W_h = 2aʰ, K_h = ⌊(W_h+2)/(s-2)⌋ + 1, Π_h = W_h + 2 + 2K_h, τ_1 = a + 1, τ_h = aʰ + 1 + Π_{h-1}, λ_1 = a, λ_h = aʰ + 1 - Π_{h-1}, γ_h = W_h + 1 - τ_h.

Constants #

Weight threshold for starting a drain at the given height.

Equations
Instances For

    Number of drain steps allowed by the height-dependent sweep budget.

    Equations
    Instances For

      Potential allowance for insertions during a node drain.

      Equations
      Instances For

        Upper weight threshold for a live node at the given height.

        Equations
        Instances For

          Lower weight threshold for a released drain target.

          Equations
          Instances For

            Weight slack freed by completing a drain at the given height.

            Equations
            Instances For

              Entries of a fresh table of height h: children plus the ghosts between them (T4's counting).

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Insertion events a table of height h can see (from the potential of Room).

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  Conditions on the parameters #

                  What the top structure's timing and label room need of the parameters (docs/PROOF.md §4.5.3–4.5.5); topParams_proof checks them for the proof parameters.

                  • s3 : 3 ≤ P.s
                  • lamK (h : ℕ) : 1 ≤ h → 2 + 2 * Kd P h ≤ lamd P h

                    A released target fits under the drain threshold (I6, in the form λ_h ≥ 2 + 2K_h).

                  • room (h : ℕ) : 1 ≤ h → 2 ^ Dmax P h * (n0max P h + 1) ≤ 2 ^ P.beta

                    Labels have room for every insertion event (our form of I7).

                  • piW (h : ℕ) : 2 ≤ h → Pid P (h - 1) ≤ Wd P h

                    A drain's targets weigh less than a node about to drain at the height above (Π_{h-1} ≤ W_h).

                  • gam1 (h : ℕ) : 1 ≤ h → 1 ≤ gamd P h

                    Draining one level down frees room: γ_h ≥ 1.

                  • tab (h : ℕ) : 1 ≤ h → n0max P h + 2 * Dmax P h ≤ 160

                    Tables stay short: at most 160 entries (the machine's per-node list capacity).

                  Instances For

                    The copy phase #

                    One step of the path copy (jobStep, .copy l), as a state update.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      @[irreducible]

                      The state after the remaining copy steps l, l+1, …, H.

                      Equations
                      Instances For

                        The state with the path copy of the running job oj completed.

                        Equations
                        Instances For

                          The running job #

                          Where the job's weight increments resume.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            Live nodes whose stored weight lags its true weight by 2, when job oj runs.

                            Equations
                            Instances For

                              Ghost v is funded by the running job: a target of v is on the job's path.

                              Equations
                              Instances For
                                @[instance_reducible]
                                Equations
                                • One or more equations did not get rendered due to their size.

                                The lowest height at which the running job has sweeps left (H + 1: none).

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  The sweeps the running job still owes ghost v.

                                  Equations
                                  Instances For

                                    Weights and drain timing #

                                    w(v⁻) + w(v⁺) for a ghost, w(v) for a live node: the weight the table of v serves.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      Funding jobs of ghost v so far.

                                      Equations
                                      Instances For

                                        Weight and progress inequalities ensuring scheduled drains finish in time.

                                        Instances For

                                          Label room #

                                          The gap bound of a table created with n entries after d insertion events.

                                          Equations
                                          Instances For

                                            Live entries of X created after X (X < e), and their growth beyond τ.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For

                                              Live entries of X present when X was created (e < X).

                                              Equations
                                              Instances For
                                                structure OrderMaintenance.Proof.Top.Room (s : TS) (cl : List ℕ) (dr n0 : ℕ → ℕ) :

                                                Label-gap potential sufficient for every insertion before a table is replaced.

                                                Instances For

                                                  Table lengths. A table holds at most two entries per insertion event beyond its initial ones, and so does its side list; and n0 + 2·dr ≤ 160 (so every table and side list, dead ones included, has at most 160 entries: the machine's per-node list capacity).

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    theorem OrderMaintenance.Proof.Top.TabLen.mono {s s' : TS} {dr n0 : ℕ → ℕ} (h : TabLen s dr n0) (hl : ∀ (X : ℕ), (order s' X).length ≤ (order s X).length ∧ (nd s' X).side.length ≤ (nd s X).side.length) :
                                                    TabLen s' dr n0

                                                    Lists that do not grow keep the bound (with the same dr, n0).

                                                    theorem OrderMaintenance.Proof.Top.TabLen.congr {s s' : TS} {dr n0 : ℕ → ℕ} (h : TabLen s dr n0) (hl : ∀ (X : ℕ), order s' X = order s X ∧ (nd s' X).side = (nd s X).side) :
                                                    TabLen s' dr n0

                                                    The running job's position #

                                                    Where the running job is, in the state with its path copied.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For

                                                      Consistency of the suspended reservation job with its copied paths and weight walk.

                                                      Instances For

                                                        The invariant #

                                                        structure OrderMaintenance.Proof.Top.InvJ (s : TS) (cl : List ℕ) (ord : ℕ → List ℕ) (dr n0 : ℕ → ℕ) (oj : Option Model.Job) :

                                                        The invariant of a top structure running job oj, whose path copy is complete.

                                                        Instances For

                                                          The top structure's invariant (M5's TI).

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For

                                                            The job measure #

                                                            Steps left for a walk that has heights h, h+1, …, H to visit.

                                                            Equations
                                                            Instances For

                                                              Steps left in job j.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For