Documentation

LeanPool.OrderMaintenance.Proof.Word.PeakPhase

Theorem W, option (A), stage A2: the peak of the group drive, from the cost invariants #

ginv_drivePeak: the drive of a splitting group (the context of ginv_driveAgree), whose every step moves an element into a live sibling, of size at most |L| (GInvE.sz): with |L| + 2 ≤ 2^K, every size it writes is below 2^K.

Nothing here is used by Theorems A and B.

theorem OrderMaintenance.Impl.ginv_drivePeak {K KH W : ℕ} {κ : Caps} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) {X Y : Model.Core → Prop} {s : Model.Core} {A : Proof.Abs} {gh : Proof.GGh} {δ : ℕ → ℕ} {p : ℕ} (hI : Proof.INV s A) (hXs : Proof.XSteps X Y A.elist δ p (Proof.gC s p)) (hX : X s) (hG : Proof.GInvE s A.elist gh δ p) (hP : Proof.GParams s.P) (hp : Proof.LiveG s p) (hs : Proof.gSt s p = Model.St.splitting) (hG1 : Proof.G1 s δ p) (hδ : ∀ (z : ℕ), z ≠ Proof.gLl s p → z ≠ p → z ≠ Proof.gRr s p → δ z = 0) (hδs : δ (Proof.gLl s p) + δ p + δ (Proof.gRr s p) ≤ 1) (hδle : δ (Proof.gLl s p) ≤ Proof.gSz s (Proof.gLl s p) ∧ δ p ≤ Proof.gSz s p ∧ δ (Proof.gRr s p) ≤ Proof.gSz s (Proof.gRr s p)) (hXc : ∀ (t : Model.Core), X t → ∀ (g : ℕ), Proof.LiveG t g → Proof.gC t g < t.C.size) (Kc : GCaps κ s) (hlen : A.elist.length + 2 ≤ 2 ^ K) {L : Loc} (hg : L "g" = p) (hGd : Gd K KH κ (ΓK K) s L) :
PKok K KH κ (ΓK K) W driveGroupFromS s L

The drive of a splitting group (the context of ginv_driveAgree).

theorem OrderMaintenance.Impl.driveGroupS_pkok {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) {g : ℕ} (hG : Gd K KH κ (ΓK K) s L) (hgL : L "g" = g) (hD : ∀ (q : ℕ), (s.Gs.getX g).st = Model.St.splitting ∧ q = g ∨ (s.Gs.getX g).st = Model.St.overflow ∧ q = (s.Gs.getX g).src → ∀ (L' : Loc), L' "g" = q → Gd K KH κ (ΓK K) s L' → PKok K KH κ (ΓK K) W driveGroupFromS s L') :
PKok K KH κ (ΓK K) W driveGroupS s L

driveGroup g: the drive of the split g belongs to, if any.

theorem OrderMaintenance.Impl.groupPhasePeak {K KH W : ℕ} {κ : Caps} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) {X Y : Model.Core → Prop} {s : Model.Core} {A : Proof.Abs} {gh : Proof.GGh} {g : ℕ} (hI : Proof.INV s A) (hXg : Proof.XGroup X Y A.elist (Proof.gC s g)) (hX : X s) (hG : Proof.GInv s A.elist gh fun (b : ℕ) => if b = g then 1 else 0) (hP : Proof.GParams s.P) (hg : Proof.LiveG s g) (hpos : 1 ≤ Proof.gSz s g) (hroom : Proof.gSt s g = Model.St.quiet → s.P.G ≤ Proof.gSz s g → Proof.SplitRoom s g) (hXc : ∀ (t : Model.Core), X t → ∀ (g : ℕ), Proof.LiveG t g → Proof.gC t g < t.C.size) (Kc : GCaps κ s) (hG2 : s.Gs.size + 2 ≤ κ.tbl Tbl.G) {s1 : Model.Core} (h1 : EStateM.run (if ((s.Gs.getX g).st == Model.St.quiet && decide ((s.Gs.getX g).size ≥ s.P.G)) = true then Model.startGroupSplit g else pure ()) s = EStateM.Result.ok () s1) (hlen : A.elist.length + 2 ≤ 2 ^ K) {L1 : Loc} (hgL : L1 "g" = g) (hGd : Gd K KH κ (ΓK K) s1 L1) :
PKok K KH κ (ΓK K) W driveGroupS s1 L1

The drive of a group phase (the context of groupPhaseAgree), from the state after the split start, if any.

theorem OrderMaintenance.Impl.cinv_drivePeak {K KH W : ℕ} {κ : Caps} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) {X Y : Model.Core → Prop} {s : Model.Core} {A : Proof.Abs} {gh : Proof.GGh} {δ δu s₀ : ℕ → ℕ} {x : ℕ} (hI : Proof.INV s A) (hG : Proof.GInv s A.elist gh fun (x : ℕ) => 0) (hCi : Proof.CInvE s A.elist δ δu s₀ x) (hC1 : Proof.C1 s δ δu s₀ x) (hXs : Proof.CXSteps X Y A.elist δ δu s₀ x) (hX : X s) (hP : Proof.GParams s.P) (hCP : Proof.CParams s.P) (hxL : Proof.LiveC s x) (hst : Proof.cSt s x = Model.St.splitting) (hδ : ∀ (c : ℕ), c ≠ Proof.cLl s x → c ≠ x → c ≠ Proof.cRr s x → δ c = 0) (hδs : δ (Proof.cLl s x) + δ x + δ (Proof.cRr s x) ≤ 1) (hδle : δ (Proof.cLl s x) ≤ Proof.cSz s (Proof.cLl s x) ∧ δ x ≤ Proof.cSz s x ∧ δ (Proof.cRr s x) ≤ Proof.cSz s (Proof.cRr s x)) (Kc : GCaps κ s) (hXV : ∀ (t : Model.Core), X t → FB K KH κ (Fld.c CF.size) t) (hYV : ∀ (t : Model.Core), Y t → FB K KH κ (Fld.c CF.size) t) {L : Loc} (hgL : L "x" = x) (hGd : Gd K KH κ (ΓK K) s L) :
PKok K KH κ (ΓK K) W driveChunkFromS s L

The drive of a splitting chunk (the context of cinv_driveAgree), with hooks that give the stored-value bound of every state (cxsteps_wb).

theorem OrderMaintenance.Impl.driveChunkS_pkok {K KH W : ℕ} {κ : Caps} {s : Model.Core} {L : Loc} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) {x : ℕ} (hG : Gd K KH κ (ΓK K) s L) (hxL : L "x" = x) (hD : ∀ (q : ℕ), (s.C.getX x).st = Model.St.splitting ∧ q = x ∨ (s.C.getX x).st = Model.St.overflow ∧ q = (s.C.getX x).src → ∀ (L' : Loc), L' "x" = q → Gd K KH κ (ΓK K) s L' → PKok K KH κ (ΓK K) W driveChunkFromS s L') :
PKok K KH κ (ΓK K) W driveChunkS s L

driveChunk x: the drive of the split x belongs to, if any.

theorem OrderMaintenance.Impl.chunkPhasePeak {K KH W : ℕ} {κ : Caps} (hC : CapsW K κ) (hK : 8 ≤ K) (hW : 2 * K + 4 ≤ W) {t : Model.Core} {A : Proof.Abs} {Lg : List ℕ} {gh : Proof.GGh} {s₀ δu : ℕ → ℕ} {c : ℕ} (hI : Proof.INV t A) (hel : A.elist = Lg) (hG : Proof.GInv t Lg gh fun (x : ℕ) => 0) (hCi : Proof.CInv t Lg (Proof.δ1 c) δu s₀) (hLX : Proof.LX s₀ (Proof.δ1 c) δu t) (hGP : Proof.GParams t.P) (hCP : Proof.CParams t.P) (hcL : Proof.LiveC t c) (hcnd : Proof.cSt t c ≠ Model.St.dead) (hcsz : 1 ≤ Proof.cSz t c) (hWB : Proof.Word.WB K t) (hL : Proof.Word.LabRoom K t.P) (hlen : 4 * Lg.length + 1 ≤ 2 ^ K) (Kc : GCaps κ t) {L : Loc} (hxL : L "x" = c) (hGd : Gd K KH κ (ΓK K) t L) :
PKok K KH κ (ΓK K) W driveChunkS t L

The chunk phase (the context of driveChunk_wb): the hooks of option (B) give the stored-value bound of every state of the drive.