Documentation

CslibFrontier.DataStructure.Dictionary.SuccinctWhpProb

High-Probability Seed Events and Tail Bounds for the WHP Succinct Dictionary #

This module defines the static hash-seed pair SeedWhp c U n_max = BktSeed × FpSeed (combining two independent universe-reduced salted general-q double-tabulation seeds from BitPackedDoubleTabulation), the concrete per-state and trailing-window deterministic seed conditions (GoodSeedOnState and GoodSeedOnWindow), and proves the per-operation failure probability bound:

For every exponent c ≥ 1, every capacity whpThreshold c ≤ n_max, every key universe n_max ≤ U, and every admissible oblivious operation prefix ops : List (Dynamic.Op U), (seedLawWhp c U n_max).toOuterMeasure {θ | ¬ GoodSeedOnWindow c U n_max ops θ} ≤ (max n_max 1 : ℝ≥0∞)⁻¹ ^ c.

Main definitions #

Main results #

References #

Section 1: Static seed pair and pure hash evaluation wrappers #

@[reducible, inline]

Static seed type for the Feistel quotient bucket hash (M_out = bWhp n_max).

@[reducible, inline]

Static seed type for the salted fingerprint hash (M_out = fpBitsWhp n_max).

@[reducible, inline]

Combined static seed pair (θ_bkt, θ_fp) sampled once during initSetup.

@[reducible, inline]
noncomputable abbrev Cslib.DataStructure.Dictionary.SuccinctWhp.seedLawWhp (c U n_max : ℕ) :
PMF (SeedWhp c U n_max)

Uniform probability distribution over SeedWhp c U n_max.

def Cslib.DataStructure.Dictionary.SuccinctWhp.bktHash (c U n_max : ℕ) (θ₁ : BktSeed c U n_max) (q : ℕ) :

Pure Feistel bucket hash ℕ → ℕ induced by θ_bkt, mapping quotients q < U into < 2 ^ bWhp n_max = numBucketsWhp n_max via salt 0.

theorem Cslib.DataStructure.Dictionary.SuccinctWhp.bktHash_lt (c U n_max : ℕ) (θ₁ : BktSeed c U n_max) (q : ℕ) :
bktHash c U n_max θ₁ q < numBucketsWhp n_max
def Cslib.DataStructure.Dictionary.SuccinctWhp.fpReducedKey (c U n_max : ℕ) (θ₂ : FpSeed c U n_max) (u : Fin U) :

Stage-1 reduced key fpReducedKey c U n_max θ₂ u < 2 ^ rRedWhp c n_max used for both Stage-2 salted fingerprint hashing and constant-depth BufTrie indexing.

theorem Cslib.DataStructure.Dictionary.SuccinctWhp.fpReducedKey_lt (c U n_max : ℕ) (θ₂ : FpSeed c U n_max) (u : Fin U) :
fpReducedKey c U n_max θ₂ u < 2 ^ (cTabWhp c * bCharWhp n_max)
def Cslib.DataStructure.Dictionary.SuccinctWhp.fpHash (c U n_max : ℕ) (θ₂ : FpSeed c U n_max) (s : Fin (sMaxWhp c n_max)) (u : Fin U) :

Salted fingerprint hash (s, u) ↦ fp < 2 ^ fpBitsWhp n_max induced by θ₂.

theorem Cslib.DataStructure.Dictionary.SuccinctWhp.fpHash_lt (c U n_max : ℕ) (θ₂ : FpSeed c U n_max) (s : Fin (sMaxWhp c n_max)) (u : Fin U) :
fpHash c U n_max θ₂ s u < 2 ^ fpBitsWhp n_max

Section 2: Trailing window, BalancedBuckets, GoodSeedOnState, and GoodSeedOnWindow #

theorem Cslib.DataStructure.Dictionary.SuccinctWhp.spec_run_fst_irrel {U V₁ n₁ V₂ n₂ : ℕ} (s : State U) (ops : List (Dynamic.Op U)) :
((Dynamic.spec U V₁ n₁).run s ops).1 = ((Dynamic.spec U V₂ n₂).run s ops).1

(Dynamic.spec U V n_max).run produces a post-state independent of (V, n_max).

theorem Cslib.DataStructure.Dictionary.SuccinctWhp.spec_run_fst_append {U V n_max : ℕ} (s : State U) (l₁ l₂ : List (Dynamic.Op U)) :
((Dynamic.spec U V n_max).run s (l₁ ++ l₂)).1 = ((Dynamic.spec U V n_max).run ((Dynamic.spec U V n_max).run s l₁).1 l₂).1

Append law for ((Dynamic.spec U V n_max).run s (l₁ ++ l₂)).1.

List of all intermediate states [s₀, s₁, ..., s_k] visited along ops from s₀.

Finset of all keys occurring in .insert u v operations in ops.

theorem Cslib.DataStructure.Dictionary.SuccinctWhp.dom_subset_union_opInsKeys {U : ℕ} (s₀ : State U) (ops : List (Dynamic.Op U)) (s : State U) :
s ∈ stateSeq s₀ ops → dom s ⊆ dom s₀ ∪ opInsKeys ops

Every state visited along ops from s₀ has domain contained in dom s₀ ∪ opInsKeys ops.

theorem Cslib.DataStructure.Dictionary.SuccinctWhp.card_dom_le_of_validHistory {U V n_max : ℕ} {s₀ : State U} (hc₀ : (dom s₀).card ≤ n_max) {ops : List (Dynamic.Op U)} (hv : (Dynamic.spec U V n_max).ValidHistory s₀ ops) (s : State U) :
s ∈ stateSeq s₀ ops → (dom s).card ≤ n_max

Trailing window length 2 * qEpochWhp n_max + 2 covering two full epochs plus transitions.

State at the start of the trailing windowLenWhp n_max operations of ops.

Trailing ≤ windowLenWhp n_max operations of ops.

Single-bucket load-balance condition |X_b - #S / M| ≤ deltaWhp n_max at bucket b.

Multiplicative bucket-balance condition |X_b - #S / M| ≤ deltaWhp n_max matching sum_sub_capFront_le_poolSize.

Concrete single-state fast-mode eligibility condition on (θ, s) checked during self-healing from fallbackMode to fastMode:

  1. fpReducedKey is injective on dom s;
  2. feistelBucket satisfies BalancedBuckets on dom s;
  3. Every bucket b of dom s admits at least one collision-free salt < sMaxWhp c n_max.

Trailing-window good-seed event for operation history ops:

  1. Stage-1 fpReducedKey is injective on W_keys = dom s_start ∪ opInsKeys suf;
  2. BalancedBuckets holds on dom s for every state s ∈ stateSeq s_start suf;
  3. BalancedBuckets holds on W_ins = opInsKeys suf;
  4. Every window bucket W_bkt(b) admits a collision-free salt < sMaxWhp c n_max;
  5. Fewer than 2 * sMaxWhp c n_max inserted keys in W_ins ever collide with another key in their window bucket under any salt < sMaxWhp c n_max.
theorem Cslib.DataStructure.Dictionary.SuccinctWhp.GoodSeedOnWindow.goodSeedOnState_of_mem {c U n_max : ℕ} {ops : List (Dynamic.Op U)} {θ : SeedWhp c U n_max} (hg : GoodSeedOnWindow c U n_max ops θ) {s : State U} (hs : s ∈ stateSeq (windowStartState U n_max ops) (windowSuffix U n_max ops)) :
GoodSeedOnState c U n_max θ s

GoodSeedOnWindow implies GoodSeedOnState on every state along the trailing window (including the final state ((Dynamic.spec U 0 0).run (empty U) ops).1).

Section 3: Density-to-PMF bridges and numerical n_max ^ (-c) tail lemmas #

Fundamental logarithmic scale inequality: Nat.log 2 n_max ≤ slabScale n_max.

When whpThreshold c ≤ n_max, 6553600 ≤ slabScale n_max and cEff c + 4 ≤ slabScale n_max.

Section 4: Window bucket caps, Feistel load balance, salt bounds, and main theorem #

theorem Cslib.DataStructure.Dictionary.SuccinctWhp.toOuterMeasure_not_goodSeedOnWindow_le {c U V n_max : ℕ} (hth : whpThreshold c ≤ n_max) {ops : List (Dynamic.Op U)} (hv : (Dynamic.spec U V n_max).ValidHistory (empty U) ops) :
(seedLawWhp c U n_max).toOuterMeasure {θ : SeedWhp c U n_max | ¬GoodSeedOnWindow c U n_max ops θ} ≤ (max (↑n_max) 1)⁻¹ ^ c

Master per-operation bad-seed probability bound: For every capacity whpThreshold c ≤ n_max, exponent c : ℕ, and admissible oblivious operation sequence ops : List (Dynamic.Op U) ((Dynamic.spec U V n_max).ValidHistory (Dictionary.empty U) ops), (seedLawWhp c U n_max).toOuterMeasure {θ | ¬ GoodSeedOnWindow c U n_max ops θ} ≤ (max n_max 1 : ℝ≥0∞)⁻¹ ^ c.