Documentation

CslibFrontier.DataStructure.BallsToSlots.KickTree

The k-Kick Tree Balls-to-Slots Scheme ([BenderFarachColtonKuszmaulKuszmaulLiu2022]) #

Formalizes the pure k-kick tree balls-to-slots scheme of Bender, Farach-Colton, J. Kuszmaul, W. Kuszmaul, and Liu, Proc. 54th ACM STOC, pp. 1284–1297, 2022 (arXiv:2111.00602v2, 4 Nov 2021) [BFCK+22] (printed p. p = PDF p. p + 1): Section 2.4 (p. 7 / PDF p. 8) iterated-log bridge; Section 3.1 (pp. 8–10 / PDF pp. 9–11) hierarchy, priority kicks with switchingCost ≤ k + 1, and kick-depth invariance; Section 5.1 (p. 27 / PDF p. 28) removal-only deletion (vacating only the deleted ball's slot without moving other balls; Sections 3–3.1 describe insertions only, and state still depends on insertion order so it is not history-independent); and Lemma 1 (pp. 10–11 / PDF pp. 11–12) and Theorems 2–3 (p. 12 / PDF p. 13) 3-wise expectation bounds and 2m-th moment / (1 - δ)-w.h.p. multi-tree concentration.

Namespace Cslib.DataStructure.BallsToSlots (and KickTree) holds this Section 3 pure balls-to-slots model, while Cslib.DataStructure.Dictionary.KickTree holds the quotient permutation layers (QuotientPerm, RoundSeed, SmallUniversePerm) and Section 4–5 metadata and multi-tier cubby saturation pieces (saturation, tail promotion and replacement, and tier-merge capacity arithmetic; dynamic resizing and the full Word-RAM dictionary realization are tracked in #5186). Adaptations: (1) XOR probe deduplication g(x) ^^^ (idx % M) over primary slots; (2) dyadic schedule capExp i = 2 * iterLog (i + 2) M and binExp (i + 1) = 6 * iterLog (i + 2) M (clamped by effectiveDepth), rounding the paper's s_d ≈ (log^(d) n)^6 and Pr[depthCap < i + 1] ≈ (log^(i+1) n)^(-2) to powers of two (where +2 aligns 0-based indexing with Nat.iterLog and Chebyshev's L^4 / L^6 = 1 / L^2 yields a geometric series); (3) 2m-th moment insertion-set snapshot bounds in place of full-independence Chernoff bounds.

Main definitions #

Main results #

References #

Lower bound comparing max (Nat.iterLog 2 n) 1 with Dictionary.Dynamic.logLogFactor n.

Upper bound showing Dictionary.Dynamic.logLogFactor n ≤ 2 * max (Nat.iterLog 2 n) 1.

Parameters for a power-of-two depth-kick tree over 2 ^ slotBits slots.

  • slotBits : ℕ

    Base-2 logarithm of slotCount = 2 ^ slotBits.

  • depth : ℕ

    Maximum kick depth k (tree depths are 0, 1, …, depth).

  • capBits : ℕ

    Bit-width of the auxiliary hash component used for depth-cap sampling.

  • binExp : Fin (self.depth + 1) → ℕ

    Base-2 logarithm of the depth-i bin size 2 ^ binExp i.

  • capExp : Fin self.depth → ℕ

    Negative base-2 logarithm of Pr[depthCap < i + 1] = 2 ^ (- capExp i).

  • binExp_zero : self.binExp ⟨0, ⋯⟩ = self.slotBits

    Depth-0 bin spans all 2 ^ slotBits slots.

  • binExp_antitone : Antitone self.binExp

    Deeper levels have smaller or equal power-of-two bin sizes (s_{i+1} ∣ s_i).

  • capExp_antitone : Antitone self.capExp

    Deeper levels have larger or equal tail probabilities (capExp is antitone).

  • capExp_le_capBits (i : Fin self.depth) : self.capExp i ≤ self.capBits

    Every depth-cap threshold fits within capBits bits.

@[reducible, inline]

Number of primary slots M = 2 ^ P.slotBits.

@[reducible, inline]

Total hash output bit-width P.slotBits + P.capBits.

@[reducible, inline]

Size s_i = 2 ^ P.binExp i of each depth-i bin.

@[reducible, inline]

Canonical bijection splitting a P.hashBits-bit hash value into (preferredSlot, capHash).

Preferred slot g(x) ∈ Fin P.slotCount extracted from the low P.slotBits hash bits.

Auxiliary depth-cap bits extracted from the high P.capBits hash bits.

Slot r belongs to the depth-i bin g_i(x) determined by hash value hx.

Instances For
    @[instance_reducible]
    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.InBin.mono {P : Params} {hx : Fin (2 ^ P.hashBits)} {i j : Fin (P.depth + 1)} {r : Fin P.slotCount} (hij : i ≤ j) (h : P.InBin hx j r) :
    P.InBin hx i r
    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.inBin_iff_of_inBin {P : Params} {hx₁ hx₂ : Fin (2 ^ P.hashBits)} {i : Fin (P.depth + 1)} {r : Fin P.slotCount} (h₁ : P.InBin hx₁ i r) (h₂ : P.InBin hx₂ i r) (r' : Fin P.slotCount) :
    P.InBin hx₁ i r' ↔ P.InBin hx₂ i r'

    Deduplicated XOR probe sequence idx ↦ g(x) ^^^ (idx % M) over Fin P.slotCount.

    Dyadic depth cap s(x) ∈ Fin (P.depth + 1) sampled from P.capHash hx.

    State of a P.depth-kick tree over balls of type α.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.State.ext {P : Params} {α : Type u_1} {x y : State P α} (assignment : x.assignment = y.assignment) (slotDepth : x.slotDepth = y.slotDepth) :
    x = y

    Empty kick-tree state with all P.slotCount slots free.

    Query the slot currently holding ball x (none if absent).

    Priority depth currently associated with ball x (none if x is absent).

    def Cslib.DataStructure.BallsToSlots.KickTree.State.delete {P : Params} {α : Type u_1} [DecidableEq α] (st : State P α) (x : α) :
    State P α

    Removal-only deletion ([BFCK+22], Section 5.1, printed p. 27 / PDF p. 28): vacate x's slot without moving or re-depthing any other ball (the resulting state still depends on insertion order, so it is not history-independent).

    Deleting x leaves the assigned depth of every other ball z ≠ x unchanged.

    def Cslib.DataStructure.BallsToSlots.KickTree.State.put {P : Params} {α : Type u_1} [DecidableEq α] (st : State P α) (r : Fin P.slotCount) (y : α) (d : Fin (P.depth + 1)) :
    State P α

    Place ball y into slot r at priority depth d.

    @[simp]
    theorem Cslib.DataStructure.BallsToSlots.KickTree.State.assignedDepth_put_self {P : Params} {α : Type u_1} [DecidableEq α] (st : State P α) (r : Fin P.slotCount) (y : α) (d : Fin (P.depth + 1)) :
    (st.put r y d).assignedDepth y = some d
    theorem Cslib.DataStructure.BallsToSlots.KickTree.State.assignedDepth_put_of_ne {P : Params} {α : Type u_1} [DecidableEq α] (st : State P α) (r : Fin P.slotCount) (y : α) (d : Fin (P.depth + 1)) {z : α} (hzy : z ≠ y) (hrz : st.assignment.occupant r ≠ some z) :
    (st.put r y d).assignedDepth z = st.assignedDepth z
    structure Cslib.DataStructure.BallsToSlots.KickTree.Params.ValidState {α : Type u_1} (P : Params) (f : α → Fin (2 ^ P.hashBits)) (st : State P α) :

    Structural and depth-cap invariant of a k-kick tree state st with respect to hash f.

    def Cslib.DataStructure.BallsToSlots.KickTree.Params.findFree {α : Type u_1} (P : Params) (st : State P α) (hx : Fin (2 ^ P.hashBits)) (d : Fin (P.depth + 1)) :

    Least free slot inside the depth-d bin of hx, if any.

    def Cslib.DataStructure.BallsToSlots.KickTree.Params.findKick {α : Type u_1} (P : Params) (st : State P α) (hx : Fin (2 ^ P.hashBits)) (d : Fin (P.depth + 1)) :

    Least slot inside the depth-d bin of hx holding a strictly shallower priority < d.

    def Cslib.DataStructure.BallsToSlots.KickTree.Params.binSaturated {α : Type u_1} (P : Params) (st : State P α) (hx : Fin (2 ^ P.hashBits)) (d : Fin (P.depth + 1)) :

    A depth-d bin is saturated iff it has neither a free slot nor an occupant of depth < d.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.binSaturated_eq_true_iff {α : Type u_1} (P : Params) (st : State P α) (hx : Fin (2 ^ P.hashBits)) (d : Fin (P.depth + 1)) :
    P.binSaturated st hx d = true ↔ ∀ (r : Fin P.slotCount), P.InBin hx d r → (st.assignment.occupant r).isSome = true ∧ d ≤ st.slotDepth r

    Largest depth j such that g_0(x), …, g_j(x) are all unsaturated.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.ValidState.delete {α : Type u_1} [DecidableEq α] {P : Params} {f : α → Fin (2 ^ P.hashBits)} {st : State P α} (hst : P.ValidState f st) (x : α) :
    P.ValidState f (st.delete x)

    Deleting any ball preserves ValidState without resampling f.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.ValidState.ballProbeComplexity_le {α : Type u_1} [DecidableEq α] {P : Params} {f : α → Fin (2 ^ P.hashBits)} {st : State P α} (hst : P.ValidState f st) {x : α} {d : Fin (P.depth + 1)} (hd : st.assignedDepth x = some d) :
    def Cslib.DataStructure.BallsToSlots.KickTree.Params.kickPlaceAux {α : Type u_1} [DecidableEq α] (P : Params) (f : α → Fin (2 ^ P.hashBits)) :
    ℕ → State P α → α → Fin (P.depth + 1) → State P α

    Fuel-bounded priority-kick loop placing ball y at depth d.

    def Cslib.DataStructure.BallsToSlots.KickTree.Params.insert {α : Type u_1} [DecidableEq α] (P : Params) (f : α → Fin (2 ^ P.hashBits)) (st : State P α) (x : α) :
    State P α

    Insert ball x into st under hash f via priority kicks.

    def Cslib.DataStructure.BallsToSlots.KickTree.Params.step {α : Type u_1} [DecidableEq α] (P : Params) (f : α → Fin (2 ^ P.hashBits)) (st : State P α) (o : Op α) :

    Single-step execution of a balls-to-slots operation on a k-kick tree.

    def Cslib.DataStructure.BallsToSlots.KickTree.Params.run {α : Type u_1} [DecidableEq α] (P : Params) (f : α → Fin (2 ^ P.hashBits)) (ops : List (Op α)) :
    State P α

    Execute an operation sequence ops from State.empty P α under hash f.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.ValidState.insert {α : Type u_1} [DecidableEq α] {P : Params} {f : α → Fin (2 ^ P.hashBits)} {st : State P α} (hst : P.ValidState f st) (x : α) :
    P.ValidState f (P.insert f st x)

    Priority-kick insertion preserves ValidState.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.assignedDepth_insert_of_mem {α : Type u_1} [DecidableEq α] (P : Params) (f : α → Fin (2 ^ P.hashBits)) {st : State P α} (hst : P.ValidState f st) (x : α) {z : α} (hz : z ∈ st.assignment.present) :

    Kick-depth invariance: inserting x preserves assignedDepth for every present ball.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.switchingCost_insert_le {α : Type u_1} [DecidableEq α] (P : Params) (f : α → Fin (2 ^ P.hashBits)) {st : State P α} (hst : P.ValidState f st) (x : α) :

    Deterministic worst-case switching cost ≤ P.depth + 1 per insertion.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.displacedBalls_insert_le {α : Type u_1} [DecidableEq α] (P : Params) (f : α → Fin (2 ^ P.hashBits)) {st : State P α} (hst : P.ValidState f st) (x : α) :

    Every insertion displaces at most P.depth already-present balls.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.ValidState.step {α : Type u_1} [DecidableEq α] {P : Params} {f : α → Fin (2 ^ P.hashBits)} {st : State P α} (hst : P.ValidState f st) (o : Op α) :
    P.ValidState f (P.step f st o).1
    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.ValidState.run {α : Type u_1} [DecidableEq α] (P : Params) (f : α → Fin (2 ^ P.hashBits)) (ops : List (Op α)) :
    P.ValidState f (P.run f ops)

    Executing any operation sequence from State.empty maintains ValidState.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.present_run {α : Type u_1} [DecidableEq α] (P : Params) (f : α → Fin (2 ^ P.hashBits)) {ops : List (Op α)} (hval : ValidOpSeq P.slotCount ops) :
    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.assignedDepth_run_of_split {α : Type u_1} [DecidableEq α] (P : Params) (f : α → Fin (2 ^ P.hashBits)) {ops pre suf : List (Op α)} {x : α} (heq : ops = pre ++ Op.insert x :: suf) (hpre : ValidOpSeq P.slotCount pre) (hx : x ∉ activeSet pre) (hlt : (activeSet pre).card < P.slotCount) (hsuf : ∀ o ∈ suf, o ≠ Op.delete x) :
    (P.run f ops).assignedDepth x = some (min (P.greedyUnsatDepth (P.run f pre) (f x)) (P.depthCap (f x)))
    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.step_schemeSpec {α : Type u_1} [DecidableEq α] (P : Params) (f : α → Fin (2 ^ P.hashBits)) {st : State P α} (hst : P.ValidState f st) {o : Op α} (hval : ValidOp P.slotCount st.assignment.present o) :
    (schemeSpec α P.slotCount P.slotCount (P.depth + 1) (P.probeSeq f)).step st.assignment o (P.step f st o).1.assignment (P.step f st o).2

    Every admissible step of P.step refines BallsToSlots.schemeSpec with switching cost ≤ P.depth + 1.

    def Cslib.DataStructure.BallsToSlots.KickTree.Params.binLoad {α : Type u_1} (P : Params) (f : α → Fin (2 ^ P.hashBits)) (S : Finset α) (hx : Fin (2 ^ P.hashBits)) (d : Fin (P.depth + 1)) :

    Number of balls in S landing in the depth-d bin of hx with depth cap ≥ d.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.binSize_le_binLoad_of_binSaturated {α : Type u_1} [DecidableEq α] {P : Params} {f : α → Fin (2 ^ P.hashBits)} {st : State P α} (hst : P.ValidState f st) {S : Finset α} (hS : st.assignment.present = S) (hx : Fin (2 ^ P.hashBits)) {d : Fin (P.depth + 1)} (hsat : P.binSaturated st hx d = true) :
    P.binSize d ≤ P.binLoad f S hx d
    def Cslib.DataStructure.BallsToSlots.KickTree.Params.snapshotProbeBound {α : Type u_1} (P : Params) (f : α → Fin (2 ^ P.hashBits)) (S : Finset α) (x : α) :

    Insertion-time active-set upper bound on x's probe complexity: depends only on the hash values on insert x S, independent of slot layout and of later operations not deleting x.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.snapshotProbeBound_congr {α : Type u_1} [DecidableEq α] (P : Params) {f₁ f₂ : α → Fin (2 ^ P.hashBits)} {S : Finset α} {x : α} (heq : ∀ a ∈ Insert.insert x S, f₁ a = f₂ a) :
    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.ballProbeComplexity_le_snapshotProbeBound {α : Type u_1} [DecidableEq α] {P : Params} {f : α → Fin (2 ^ P.hashBits)} {st st' : State P α} (hst : P.ValidState f st) (hst' : P.ValidState f st') {S : Finset α} (hS : st.assignment.present = S) {x : α} (hd : st'.assignedDepth x = some (min (P.greedyUnsatDepth st (f x)) (P.depthCap (f x)))) :
    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.dens_depthCap_lt_succ {ι : Type u_1} {α : Type u_2} [Fintype ι] {k_indep : ℕ} {P : Params} {h : ι → α → Fin (2 ^ P.hashBits)} (hh : Probability.IsKWiseIndependentHash k_indep h) (hk : 1 ≤ k_indep) (x : α) (i : Fin P.depth) :
    ↑{θ : ι | ↑(P.depthCap (h θ x)) < ↑i + 1}.dens = 1 / 2 ^ P.capExp i

    Under 1-wise independence, Pr[depthCap (h θ x) < i + 1] = 1 / 2 ^ P.capExp i.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.dens_binLoad_ge_le_pow {ι : Type u_1} {α : Type u_2} [Fintype ι] {m k_indep : ℕ} (hm : 1 ≤ m) {P : Params} {h : ι → α → Fin (2 ^ P.hashBits)} (hh : Probability.IsKWiseIndependentHash k_indep h) (hk : 2 * m + 1 ≤ k_indep) {S : Finset α} (hS_le : S.card ≤ P.slotCount) {x : α} (hx : x ∉ S) (i : Fin P.depth) :
    ↑{θ : ι | P.binSize i.succ ≤ P.binLoad (h θ) S (h θ x) i.succ}.dens ≤ 2 * (3 * ↑m * 2 ^ (2 * P.capExp i) / ↑(P.binSize i.succ)) ^ m

    Under (2m + 1)-wise independence (1 ≤ m), Pr[binLoad ≥ binSize] at depth i + 1 is at most 2 * (3 * m * 2 ^ (2 * capExp i) / binSize (i + 1)) ^ m.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.Params.dens_binSaturated_le_pow {ι : Type u_1} {α : Type u_2} [Fintype ι] [DecidableEq α] {m k_indep : ℕ} (hm : 1 ≤ m) {P : Params} {h : ι → α → Fin (2 ^ P.hashBits)} (hh : Probability.IsKWiseIndependentHash k_indep h) (hk : 2 * m + 1 ≤ k_indep) {st : ι → State P α} (hst : ∀ (θ : ι), P.ValidState (h θ) (st θ)) {S : Finset α} (hS : ∀ (θ : ι), (st θ).assignment.present = S) {x : α} (hx : x ∉ S) (i : Fin P.depth) :
    ↑{θ : ι | P.binSaturated (st θ) (h θ x) i.succ = true}.dens ≤ 2 * (3 * ↑m * 2 ^ (2 * P.capExp i) / ↑(P.binSize i.succ)) ^ m

    Under (2m + 1)-wise independence (1 ≤ m), Pr[binSaturated (st θ) (h θ x) (i + 1)] is at most 2 * (3 * m * 2 ^ (2 * capExp i) / binSize (i + 1)) ^ m (giving 6 * 2 ^ (2 * capExp i) / binSize (i + 1) under 3-wise independence at m = 1).

    Clamped kick depth ≤ k (0 if m₀ < 32, else min k (floorLogStar (2 ^ m₀) - 1)).

    Canonical k-kick tree parameters ([BFCK+22], §3.1). Rounds the paper's schedule s_d ≈ (log^(d) n)^6 and Pr[depthCap < i + 1] ≈ (log^(i+1) n)^(-2) to powers of two via capExp i = 2 * iterLog (i + 2) (2 ^ m₀) and binExp (i + 1) = 6 * iterLog (i + 2) (2 ^ m₀) (the +2 offset aligns 0-based Fin indexing with Nat.iterLog, where iterLog 1 (2 ^ m₀) = m₀). Under 3-wise independence, the Chebyshev ratio L^4 / L^6 = 1 / L^2 gives a failure bound 6 * 2 ^ (2 * capExp i) / 2 ^ (binExp (i + 1)) = 6 / 2 ^ (2 * iterLog (i + 2) (2 ^ m₀)) that decays geometrically against binExp i ≤ 12 * 2 ^ (iterLog (i + 2) (2 ^ m₀)), preserving the O(max (Nat.iterLog (k + 1) (2 ^ m₀)) 1) bottom-level bound up to an O(1) geometric series.

    def Cslib.DataStructure.BallsToSlots.KickTree.standardInsert {α : Type u_1} [DecidableEq α] (m₀ k : ℕ) (f : α → Fin (2 ^ (standardParams m₀ k).hashBits)) (st : State (standardParams m₀ k) α) (x : α) :
    State (standardParams m₀ k) α

    Insert x under standardParams m₀ k.

    def Cslib.DataStructure.BallsToSlots.KickTree.standardRun {α : Type u_1} [DecidableEq α] (m₀ k : ℕ) (f : α → Fin (2 ^ (standardParams m₀ k).hashBits)) (ops : List (Op α)) :
    State (standardParams m₀ k) α

    Execute ops from empty state under standardParams m₀ k.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.switchingCost_standardInsert_le {α : Type u_1} [DecidableEq α] (m₀ k : ℕ) (f : α → Fin (2 ^ (standardParams m₀ k).hashBits)) {st : State (standardParams m₀ k) α} (hst : (standardParams m₀ k).ValidState f st) (x : α) :

    Worst-case switching cost of standardInsert m₀ k is at most k + 1.

    Schedule inequality on standardParams m₀ k ([BFCK+22] §3.1, printed p. 9 / PDF p. 10): effectiveDepth m₀ k - d ≤ binExp d.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.expect_snapshotProbeBound_standardParams_le {ι : Type u_1} {α : Type u_2} [Fintype ι] {k_indep : ℕ} (m₀ k : ℕ) {h : ι → α → Fin (2 ^ (standardParams m₀ k).hashBits)} (hh : Probability.IsKWiseIndependentHash k_indep h) (hk : 3 ≤ k_indep) {S : Finset α} (hS_le : S.card ≤ 2 ^ m₀) {x : α} (hx : x ∉ S) :
    (Finset.univ.expect fun (θ : ι) => ↑((standardParams m₀ k).snapshotProbeBound (h θ) S x)) ≤ 96 * max (↑((k + 1).iterLog (2 ^ m₀))) 1
    theorem Cslib.DataStructure.BallsToSlots.KickTree.expect_ballProbeComplexity_standardInsert_le {ι : Type u_1} {α : Type u_2} [Fintype ι] [DecidableEq α] {k_indep : ℕ} (m₀ k : ℕ) {h : ι → α → Fin (2 ^ (standardParams m₀ k).hashBits)} (hh : Probability.IsKWiseIndependentHash k_indep h) (hk : 3 ≤ k_indep) {st : ι → State (standardParams m₀ k) α} (hst : ∀ (θ : ι), (standardParams m₀ k).ValidState (h θ) (st θ)) {S : Finset α} (hS : ∀ (θ : ι), (st θ).assignment.present = S) {x : α} (hx : x ∉ S) (hlt : S.card < 2 ^ m₀) :
    (Finset.univ.expect fun (θ : ι) => ↑(ballProbeComplexity ((standardParams m₀ k).probeSeq (h θ)) (standardInsert m₀ k (h θ) (st θ) x).assignment x)) ≤ 96 * max (↑((k + 1).iterLog (2 ^ m₀))) 1

    Lemma 1 of [BFCK+22] (Section 3.1, printed pp. 10–11 / PDF pp. 11–12), proved under 3-wise independence.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.expect_totalProbeComplexity_standardRun_le {ι : Type u_1} {α : Type u_2} [Fintype ι] [DecidableEq α] {k_indep : ℕ} (m₀ k : ℕ) {h : ι → α → Fin (2 ^ (standardParams m₀ k).hashBits)} (hh : Probability.IsKWiseIndependentHash k_indep h) (hk : 3 ≤ k_indep) {ops : List (Op α)} (hval : ValidOpSeq (2 ^ m₀) ops) :
    (Finset.univ.expect fun (θ : ι) => ↑(totalProbeComplexity ((standardParams m₀ k).probeSeq (h θ)) (standardRun m₀ k (h θ) ops).assignment)) ≤ 96 * ↑(activeSet ops).card * max (↑((k + 1).iterLog (2 ^ m₀))) 1

    Theorem 2 of [BFCK+22] (Section 3.1, printed p. 12 / PDF p. 13), proved under 3-wise independence over arbitrary-length histories ops.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.dens_sum_totalProbeComplexity_standardRun_gt_le {ι : Type u_1} {α : Type u_2} {β : Type u_3} [Fintype ι] [DecidableEq α] {m k_indep : ℕ} (hm : 1 ≤ m) (m₀ k : ℕ) {h : ι → α → Fin (2 ^ (standardParams m₀ k).hashBits)} (hh : Probability.IsKWiseIndependentHash k_indep h) (hk : max 3 (2 * m * 2 ^ (2 * m₀)) ≤ k_indep) (R : Finset β) (ops : β → List (Op α)) (hval : ∀ b ∈ R, ValidOpSeq (2 ^ m₀) (ops b)) (hdisj : (↑R).Pairwise fun (b₁ b₂ : β) => Disjoint (opsBalls (ops b₁)) (opsBalls (ops b₂))) {μ Δ : ℝ} (hμ : (96 * ∑ b ∈ R, ↑(activeSet (ops b)).card) * max (↑((k + 1).iterLog (2 ^ m₀))) 1 ≤ μ) (hmμ : 2 * ↑m * 2 ^ m₀ * (1 + ↑m₀) ≤ 3 * μ) (hΔ : 0 < Δ) :
    ↑{θ : ι | μ + Δ ≤ ∑ b ∈ R, ↑(totalProbeComplexity ((standardParams m₀ k).probeSeq (h θ)) (standardRun m₀ k (h θ) (ops b)).assignment)}.dens ≤ 2 * (3 * ↑m * 2 ^ m₀ * (1 + ↑m₀) * μ / Δ ^ 2) ^ m

    2m-th moment concentration across partitioned k-kick trees over arbitrary-length operation histories, adapting [BFCK+22] Theorem 3 (Section 3.1, printed p. 12 / PDF p. 13) with four explicit deviations: (a) the partition into disjoint-footprint sub-histories R is assumed as an explicit hypothesis; (b) there are no special slots in this pure primary-slot model; (c) the tail bound is polynomial (2m-th moment Markov) rather than an exponential Chernoff bound; and (d) it assumes max 3 (2 * m * 4 ^ m₀)-wise (max 3 (2 * m * 2 ^ (2 * m₀))-wise) independence rather than full independence.

    theorem Cslib.DataStructure.BallsToSlots.KickTree.dens_sum_totalProbeComplexity_standardRun_gt_le_of_whp {ι₁ : Type u_1} {ι₂ : Type u_2} {α : Type u_3} {β : Type u_4} [Fintype ι₁] [Nonempty ι₁] [Fintype ι₂] [DecidableEq α] {m k_indep : ℕ} (hm : 1 ≤ m) (m₀ k : ℕ) {h : ι₁ × ι₂ → α → Fin (2 ^ (standardParams m₀ k).hashBits)} (Good : Set ι₁) [DecidablePred fun (x : ι₁) => x ∈ Good] {δ : ℝ} (hbad : ↑{θ₁ : ι₁ | θ₁ ∉ Good}.dens ≤ δ) (hgood : ∀ θ₁ ∈ Good, Probability.IsKWiseIndependentHash k_indep fun (θ₂ : ι₂) (x : α) => h (θ₁, θ₂) x) (hk : max 3 (2 * m * 2 ^ (2 * m₀)) ≤ k_indep) (R : Finset β) (ops : β → List (Op α)) (hval : ∀ b ∈ R, ValidOpSeq (2 ^ m₀) (ops b)) (hdisj : (↑R).Pairwise fun (b₁ b₂ : β) => Disjoint (opsBalls (ops b₁)) (opsBalls (ops b₂))) {μ Δ : ℝ} (hμ : (96 * ∑ b ∈ R, ↑(activeSet (ops b)).card) * max (↑((k + 1).iterLog (2 ^ m₀))) 1 ≤ μ) (hmμ : 2 * ↑m * 2 ^ m₀ * (1 + ↑m₀) ≤ 3 * μ) (hΔ : 0 < Δ) :
    ↑{s : ι₁ × ι₂ | μ + Δ ≤ ∑ b ∈ R, ↑(totalProbeComplexity ((standardParams m₀ k).probeSeq (h s)) (standardRun m₀ k (h s) (ops b)).assignment)}.dens ≤ δ + 2 * (3 * ↑m * 2 ^ m₀ * (1 + ↑m₀) * μ / Δ ^ 2) ^ m

    (1 - δ)-w.h.p. multi-tree probe-complexity concentration for two-stage hash families h : ι₁ × ι₂ → … whose top seed θ₁ is good outside an event of density ≤ δ.