Room for group labels (from Lemma C3) #
A group split start needs a label on each side of the splitting group; a chunk-split move needs
room for the pushed labels (proved with the move, push_room). Both follow from the label
invariant, given that the chunk's arrivals stay within 3·M_u and its insertions within I_C.
theorem
OrderMaintenance.Proof.labBefore_ok
{s : Model.Core}
{g : ℕ}
(h1 : g = cF s (gC s g) → s.P.groupSpacing ≤ gL s g ∧ s.P.groupSpacing ≠ 0)
(h2 : g ≠ cF s (gC s g) → gL s (gP s g) + 1 < gL s g)
:
∃ (lab : ℕ), EStateM.run (Model.labBefore g) s = EStateM.Result.ok lab s
theorem
OrderMaintenance.Proof.labAfter_ok
{s : Model.Core}
{g : ℕ}
(h1 : g = cLs s (gC s g) → gL s g + s.P.groupSpacing < 1 <<< s.P.groupBits ∧ s.P.groupSpacing ≠ 0)
(h2 : g ≠ cLs s (gC s g) → gL s g + 1 < gL s (gN s g))
:
∃ (lab : ℕ), EStateM.run (Model.labAfter g) s = EStateM.Result.ok lab s
theorem
OrderMaintenance.Proof.chTerm_le_charge
{s : Model.Core}
{lg : LGh}
{c g : ℕ}
(hg : g ∈ GrpsC s c)
:
A single charge term is at most the chunk's charge.
theorem
OrderMaintenance.Proof.split_room
{s : Model.Core}
{A : Abs}
{lg : LGh}
{s₀ δ δu : ℕ → ℕ}
(hI : INV s A)
(hL : LInv s lg s₀ δ δu)
(hLP : LParams s.P)
(hP : GParams s.P)
{g : ℕ}
(hg : LiveG s g)
(hq : gSt s g = Model.St.quiet)
(hsz : gSz s g = s.P.G)
(hcL : LiveC s (gC s g))
(harr : lg.arB (gC s g) + lg.arF (gC s g) ≤ 3 * Mu s.P)
(hins : lg.ins (gC s g) ≤ IC s.P)
:
SplitRoom s g
Room for a group split start, from Lemma C3.