Documentation

CslibFrontier.Probability.KWiseIndependent.VarianceTail

Variance-Aware 2m-th Moment and Collision-Concentration Bounds for k-Wise Independence #

This module provides two high-probability concentration tools for k-wise independent hash families (Cslib.Probability.IsKWiseIndependentHash):

  1. Heterogeneous variance-aware 2 m-th moment and tail bounds (expect_sum_pow_le_of_sq_le, dens_filter_le_abs_sum_of_sq_le, dens_filter_le_abs_sum_sub_expect_of_Icc): Refines IsKWiseIndependentHash.expect_sum_pow_le when centered terms Z x (|Z x| โ‰ค 1) satisfy per-coordinate second-moment bounds ๐”ผ y, (Z x y) ^ 2 โ‰ค v x (0 โ‰ค v x). Replacing #S with max (โˆ‘ x โˆˆ S, v x) 1 gives tail density m * (m ^ 2 * max (โˆ‘ x โˆˆ S, v x) 1 / a ^ 2) ^ m, yielding polynomial 1 - n ^ (-c) concentration under O(c log n)-wise independence whenever a ^ 2 โ‰ฅ ฮฉ(m ^ 2 * max (โˆ‘ x โˆˆ S, v x) 1) (because sum_prod_image_eq_card_le drops the 1 / r! symmetry factor, leaving m ^ 2 rather than m in the numerator). Compare CslibFrontier.Probability.KWiseIndependent.Concentration (expect_sum_sub_expect_pow_le, dens_abs_sum_sub_expect_le), which retains 1 / r! for [0, 1]-valued variables under the lower-mean regime 2 * m โ‰ค 3 * ฮผ to obtain 2 * (3 * m * ฮผ / a ^ 2) ^ m (supporting O(c log n / log log n)-wise unit-mean balls-into-bins bounds when 2 * m โ‰ค 3 * ฮผ), whereas the bounds here apply to general centered [-1, 1] variables and arbitrary โˆ‘ x โˆˆ S, v x without requiring 2 * m โ‰ค 3 * โˆ‘ x โˆˆ S, v x.
  2. Multi-salt collision-freedom and batch collision-count tail bounds (dens_forall_salt_exists_collision_le, dens_card_salt_colliding_ge_le): Bounds the probability that all s_max salts collide on a bucket under 2 * s_max-wise independence, and bounds via greedy independent-witness extraction the probability that at least 2 * r keys in a batch Q_set collide with a window W_set across s_max salts under 2 * r-wise independence.

Main results #

References #

Section 1: Heterogeneous variance-aware 2 m-th moment bound #

theorem Cslib.Probability.IsKWiseIndependentHash.expect_sum_pow_le_of_sq_le {ฮน : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ฮน] [Fintype Y] [DecidableEq Y] {h : ฮน โ†’ X โ†’ Y} {m : โ„•} (hm : 1 โ‰ค m) (hh : IsKWiseIndependentHash (2 * m) h) (S : Finset X) (Z : X โ†’ Y โ†’ โ„) (v : X โ†’ โ„) (hv : โˆ€ x โˆˆ S, 0 โ‰ค v x) (hZ : โˆ€ x โˆˆ S, (Finset.univ.expect fun (y : Y) => Z x y) = 0) (hZโ‚ : โˆ€ x โˆˆ S, โˆ€ (y : Y), |Z x y| โ‰ค 1) (hZโ‚‚ : โˆ€ x โˆˆ S, (Finset.univ.expect fun (y : Y) => Z x y ^ 2) โ‰ค v x) :
(Finset.univ.expect fun (i : ฮน) => (โˆ‘ x โˆˆ S, Z x (h i x)) ^ (2 * m)) โ‰ค โ†‘m * โ†‘m ^ (2 * m) * max (โˆ‘ x โˆˆ S, v x) 1 ^ m

Heterogeneous variance-aware 2 m-th moment bound for limited independence: For 1 โ‰ค m, a 2 * m-wise independent family h : ฮน โ†’ X โ†’ Y, a finite set S : Finset X, and centered scores Z : X โ†’ Y โ†’ โ„ with |Z x y| โ‰ค 1 and ๐”ผ y, (Z x y) ^ 2 โ‰ค v x (0 โ‰ค v x), ๐”ผ i, (โˆ‘ x โˆˆ S, Z x (h i x)) ^ (2 * m) โ‰ค m * m ^ (2 * m) * max (โˆ‘ x โˆˆ S, v x) 1 ^ m.

theorem Cslib.Probability.IsKWiseIndependentHash.dens_filter_le_abs_sum_of_sq_le {ฮน : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ฮน] [Fintype Y] [DecidableEq Y] {h : ฮน โ†’ X โ†’ Y} {m : โ„•} (hm : 1 โ‰ค m) (hh : IsKWiseIndependentHash (2 * m) h) (S : Finset X) (Z : X โ†’ Y โ†’ โ„) (v : X โ†’ โ„) (hv : โˆ€ x โˆˆ S, 0 โ‰ค v x) (hZ : โˆ€ x โˆˆ S, (Finset.univ.expect fun (y : Y) => Z x y) = 0) (hZโ‚ : โˆ€ x โˆˆ S, โˆ€ (y : Y), |Z x y| โ‰ค 1) (hZโ‚‚ : โˆ€ x โˆˆ S, (Finset.univ.expect fun (y : Y) => Z x y ^ 2) โ‰ค v x) {a : โ„} (ha : 0 < a) :
โ†‘{i : ฮน | a โ‰ค |โˆ‘ x โˆˆ S, Z x (h i x)|}.dens โ‰ค โ†‘m * (โ†‘m ^ 2 * max (โˆ‘ x โˆˆ S, v x) 1 / a ^ 2) ^ m

Two-sided variance-aware tail bound for limited independence: For 1 โ‰ค m, 0 < a, and 2 * m-wise independent centered sums bounded in [-1, 1] with per-coordinate variance โ‰ค v x (0 โ‰ค v x), dens {i | a โ‰ค |โˆ‘ x โˆˆ S, Z x (h i x)|} โ‰ค m * (m ^ 2 * max (โˆ‘ x โˆˆ S, v x) 1 / a ^ 2) ^ m.

theorem Cslib.Probability.IsKWiseIndependentHash.dens_filter_le_abs_sum_sub_expect_of_Icc {ฮน : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ฮน] [Fintype Y] [DecidableEq Y] {h : ฮน โ†’ X โ†’ Y} {m : โ„•} (hm : 1 โ‰ค m) (hh : IsKWiseIndependentHash (2 * m) h) (S : Finset X) (g : X โ†’ Y โ†’ โ„) (hg : โˆ€ x โˆˆ S, โˆ€ (y : Y), g x y โˆˆ Set.Icc 0 1) {a : โ„} (ha : 0 < a) :
โ†‘{i : ฮน | a โ‰ค |โˆ‘ x โˆˆ S, (g x (h i x) - Finset.univ.expect fun (y : Y) => g x y)|}.dens โ‰ค โ†‘m * (โ†‘m ^ 2 * max (โˆ‘ x โˆˆ S, Finset.univ.expect fun (y : Y) => g x y) 1 / a ^ 2) ^ m

Variance-aware tail bound for [0, 1]-valued scores: For g x : Y โ†’ [0, 1], each centered variable Z x y = g x y - ๐”ผ y', g x y' automatically satisfies |Z x y| โ‰ค 1 and ๐”ผ y, (Z x y) ^ 2 โ‰ค ๐”ผ y, g x y, yielding concentration in terms of the mean sum ฮผ = โˆ‘ x โˆˆ S, ๐”ผ y, g x y rather than #S.

Section 2: Multi-salt collision-freedom and batch collision-count tail bounds #

theorem Cslib.Probability.IsKWiseIndependentHash.dens_fresh_pair_collisions_le {ฮน : Type u_1} {Y : Type u_3} [Fintype ฮน] [Fintype Y] [DecidableEq Y] {Z : Type u_4} {r : โ„•} {H : ฮน โ†’ Z โ†’ Y} (hh : IsKWiseIndependentHash (2 * r) H) (a b : Fin r โ†’ Z) (hne : โˆ€ (k : Fin r), a k โ‰  b k) (hfresh : โˆ€ (j k : Fin r), j < k โ†’ a k โ‰  a j โˆง a k โ‰  b j) :
โ†‘{i : ฮน | โˆ€ (k : Fin r), H i (a k) = H i (b k)}.dens โ‰ค (โ†‘(Fintype.card Y))โปยน ^ r

Fresh-endpoint pair-collision bound under 2 * r-wise independence: Suppose a, b : Fin r โ†’ Z satisfy โˆ€ k, a k โ‰  b k and โˆ€ j < k, a k โ‰  a j โˆง a k โ‰  b j (each a k is distinct from its partner b k and all earlier endpoints a j, b j for j < k). Then for any 2 * r-wise independent family H : ฮน โ†’ Z โ†’ Y, dens {i | โˆ€ k, H i (a k) = H i (b k)} โ‰ค (|Y|โปยน) ^ r.

theorem Cslib.Probability.IsKWiseIndependentHash.dens_forall_salt_exists_collision_le {ฮน : Type u_1} {Y : Type u_3} [Fintype ฮน] [Fintype Y] [DecidableEq Y] {s_max : โ„•} {Q : Type u_5} [DecidableEq Q] {H : ฮน โ†’ Fin s_max ร— Q โ†’ Y} (hh : IsKWiseIndependentHash (2 * s_max) H) (S_b : Finset Q) :
โ†‘{i : ฮน | โˆ€ (s : Fin s_max), โˆƒ u โˆˆ S_b, โˆƒ v โˆˆ S_b, u โ‰  v โˆง H i (s, u) = H i (s, v)}.dens โ‰ค (โ†‘S_b.card ^ 2 / โ†‘(Fintype.card Y)) ^ s_max

Multi-salt intra-bucket collision-freedom bound: Under a 2 * s_max-wise independent family H : ฮน โ†’ Fin s_max ร— Q โ†’ Y, the fraction of seeds i for which every salt s : Fin s_max has a colliding pair u โ‰  v inside S_b : Finset Q is at most (#S_b ^ 2 / |Y|) ^ s_max.

theorem Cslib.Probability.IsKWiseIndependentHash.dens_card_local_salt_colliding_ge_le {ฮน : Type u_1} {Y : Type u_3} [Fintype ฮน] [Fintype Y] [DecidableEq Y] {r s_max w_cap : โ„•} {Q : Type u_5} [DecidableEq Q] {H : ฮน โ†’ Fin s_max ร— Q โ†’ Y} (hh : IsKWiseIndependentHash (2 * r) H) (Q_set : Finset Q) (W_of : Q โ†’ Finset Q) (hw_cap : โˆ€ u โˆˆ Q_set, (W_of u).card โ‰ค w_cap) :
โ†‘{i : ฮน | 2 * r โ‰ค {u โˆˆ Q_set | โˆƒ v โˆˆ W_of u, u โ‰  v โˆง โˆƒ (s : Fin s_max), H i (s, u) = H i (s, v)}.card}.dens โ‰ค (โ†‘(Q_set.card * w_cap * s_max) / โ†‘(Fintype.card Y)) ^ r

Per-key neighborhood salt-collision count tail bound: Under a 2 * r-wise independent family H : ฮน โ†’ Fin s_max ร— Q โ†’ Y, given a batch Q_set : Finset Q and per-key candidate collision sets W_of : Q โ†’ Finset Q with โˆ€ u โˆˆ Q_set, #(W_of u) โ‰ค w_cap, the fraction of seeds i for which at least 2 * r keys u โˆˆ Q_set collide with some v โˆˆ W_of u \ {u} under some salt s : Fin s_max is at most (((#Q_set * w_cap * s_max) / |Y|) ^ r).

theorem Cslib.Probability.IsKWiseIndependentHash.dens_card_salt_colliding_ge_le {ฮน : Type u_1} {Y : Type u_3} [Fintype ฮน] [Fintype Y] [DecidableEq Y] {r s_max : โ„•} {Q : Type u_5} [DecidableEq Q] {H : ฮน โ†’ Fin s_max ร— Q โ†’ Y} (hh : IsKWiseIndependentHash (2 * r) H) (Q_set W_set : Finset Q) :
โ†‘{i : ฮน | 2 * r โ‰ค {u โˆˆ Q_set | โˆƒ v โˆˆ W_set, u โ‰  v โˆง โˆƒ (s : Fin s_max), H i (s, u) = H i (s, v)}.card}.dens โ‰ค (โ†‘(Q_set.card * W_set.card * s_max) / โ†‘(Fintype.card Y)) ^ r

Batch salt-collision count tail bound: Under a 2 * r-wise independent family H : ฮน โ†’ Fin s_max ร— Q โ†’ Y, given a batch Q_set : Finset Q and a window W_set : Finset Q, the fraction of seeds i for which at least 2 * r keys u โˆˆ Q_set collide with some v โˆˆ W_set \ {u} under some salt s : Fin s_max is at most ((#Q_set * #W_set * s_max) / |Y|) ^ r.