Groups: Lemmas G1, G2 and G4 (docs/PROOF.md §4.2) #
The group-level cost invariant GInv, between operations and inside one, and its preservation
by every step that touches groups or elements. It gives:
- G1/G2 (sizes): a splitting group
gwith siblingsl,rsatisfies|g| + (groupBudget − 1)(t − G) ≤ Gand||l| − |r|| ≤ 1, wheret = |l| + |g| + |r| ≥ G; quiet groups have fewer thanGelements, and at leastg_min = ⌊(G−2)/2⌋unless they hold the sentinel. - G4 (element labels): with ghost counters per group (halvings
hv, pushespb/pf), every gap within a group is at least⌊elementSpacing / 2^hv⌋, and labels stay withinpf/pbpushes of the centre. The counters are bounded through the group's life, so no element-label guard fails.
Ghost counters are not part of the model: the invariant holds for some ghost state.
Undriven insertions. Inside an operation, the insertion precedes the drive of its family.
δ g is the number of insertions into g not yet followed by a drive (0 or 1); the size
conditions are stated for the sizes before those insertions.
Accessors and constants #
The element count stored in a group.
Equations
- OrderMaintenance.Proof.gSz s g = (s.Gs.getX g).size
Instances For
The current split state of a group.
Equations
- OrderMaintenance.Proof.gSt s g = (s.Gs.getX g).st
Instances For
The source group recorded by an overflow group.
Equations
- OrderMaintenance.Proof.gSrc s g = (s.Gs.getX g).src
Instances For
The left sibling recorded by a splitting group.
Equations
- OrderMaintenance.Proof.gLl s g = (s.Gs.getX g).l
Instances For
The right sibling recorded by a splitting group.
Equations
- OrderMaintenance.Proof.gRr s g = (s.Gs.getX g).r
Instances For
A live group: in the group list (INV.mem_glist_iff).
Equations
- OrderMaintenance.Proof.LiveG s g = (g ≠ OrderMaintenance.Model.NIL ∧ g < s.Gs.size ∧ OrderMaintenance.Proof.gA s g = true)
Instances For
The size of the family of a splitting group.
Equations
Instances For
k_G: insertions into a family until its split ends (floor form of PROOF.md's k_G).
Equations
- OrderMaintenance.Proof.kG P = P.G / (P.groupBudget - 1) + 1
Instances For
The least size of a freshly quiet group, ⌈(G−3)/2⌉.
Equations
- OrderMaintenance.Proof.gmin P = (P.G - 2) / 2
Instances For
The centre of the element label range.
Equations
- OrderMaintenance.Proof.cE P = 1 <<< (P.elementBits - 1)
Instances For
Halvings a group sees in its life, at most.
Equations
Instances For
The parameter conditions for the group level (I1, I2).
Instances For
Ghost state #
Ghost counters per group: halvings, pushes at the back and at the front.
The number of label halvings charged to each group.
The number of label pushes at the back of each group.
The number of label pushes at the front of each group.
Instances For
The invariant #
The family of a splitting group g: its siblings are live, adjacent, overflow nodes with
source g, in g's chunk (invariant F).
Instances For
Lemma G1's invariant for the family of g, at the sizes before the undriven insertions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
G1 bounds the excess family size by the quotient of its split budget.
The common size and balance bounds used by every group-drive simulation.
The group-level invariant, exempting the size conditions of the family of x (a family
being driven).
- notDead (g : ℕ) : LiveG s g → gSt s g ≠ Model.St.dead
Instances For
The group-level invariant, with no family exempt.
Equations
- OrderMaintenance.Proof.GInv s L gh δ = OrderMaintenance.Proof.GInvE s L gh δ OrderMaintenance.Model.NIL
Instances For
Bounds between operations #
Transfer of the link structure #
Element insertion #
The ghost update of an insertion into group g: one more halving or push.
Instances For
Linking a new element keeps GInv, given its label's gaps and range.
Lemma G4 for insertions. Between operations, element insertion passes its label guard;
the new state satisfies GInv with one undriven insertion in x's group.