Documentation

CslibFrontier.Probability.PairwiseIndependentHash.Discrepancy

Pairwise-Independent Hash Discrepancy Bounds #

This module provides discrete probabilistic discrepancy bounds for pairwise-independent Boolean hash families:

Main results #

1. Pairwise-Independent Hash Discrepancy (Uniform ≤ t/2 and Weighted ≤ 2/3) #

theorem Cslib.Probability.card_filter_hash_eq {ι : Type u_1} {α : Type u_2} [Fintype ι] {H : ι → α → Bool} (hH : IsPairwiseIndependentHash H) (a : α) (b : Bool) :
↑{i : ι | H i a = b}.card = ↑(Fintype.card ι) / 2

Cardinality of seeds hitting a given bit is |ι| / 2 for a pairwise-independent hash family.

theorem Cslib.Probability.card_filter_hash_pair_eq {ι : Type u_1} {α : Type u_2} [Fintype ι] {H : ι → α → Bool} (hH : IsPairwiseIndependentHash H) {a₁ a₂ : α} (hne_a : a₁ ≠ a₂) (b₁ b₂ : Bool) :
↑{i : ι | H i a₁ = b₁ ∧ H i a₂ = b₂}.card = ↑(Fintype.card ι) / 4

Cardinality of seeds hitting (b₁, b₂) on distinct (a₁, a₂) is |ι| / 4.

theorem Cslib.Probability.expect_sq_weighted_sign_sum {ι : Type u_1} {α : Type u_2} [Fintype ι] [Fintype α] [Nonempty α] {H : ι → α → Bool} (hH : IsPairwiseIndependentHash H) (w : α → ℝ) :
(↑(Fintype.card ι))⁻¹ * ∑ i : ι, (∑ a : α, w a * BitString.signVal (H i a)) ^ 2 = ∑ a : α, w a ^ 2

Exact second moment of a weighted pairwise-independent sign sum: 𝔼_i[(∑ a, w a * BitString.signVal (H i a))²] = ∑ a, (w a)².

theorem Cslib.Probability.weighted_discrepancy_eq_of_ge_half {ι : Type u_1} {α : Type u_2} [Fintype ι] [Fintype α] {H : ι → α → Bool} (hH : IsPairwiseIndependentHash H) {w : α → ℝ} (hw_nn : ∀ (a : α), 0 ≤ w a) (hw_sum : ∑ a : α, w a = 1) {a₁ : α} (ha₁ : 1 / 2 ≤ w a₁) :
(↑(Fintype.card ι))⁻¹ * ∑ i : ι, |∑ a : α, w a * BitString.signVal (H i a)| = w a₁

Exact pairwise-independent discrepancy when a single weight satisfies w a₁ ≥ 1 / 2: 𝔼_i[|∑ a, w a * BitString.signVal (H i a)|] = w a₁.

theorem Cslib.Probability.uniform_discrepancy_le_half {ι : Type u_1} {α : Type u_2} [Fintype ι] {H : ι → α → Bool} (hH : IsPairwiseIndependentHash H) {S : Finset α} (hS : 2 ≤ S.card) :
(↑(Fintype.card ι))⁻¹ * ∑ i : ι, |∑ a ∈ S, BitString.signVal (H i a)| ≤ ↑S.card / 2

Uniform pairwise-independent discrepancy bound: for any subset S : Finset α with 2 ≤ S.card and any pairwise-independent Boolean hash family H, 𝔼_i[|∑_{a ∈ S} BitString.signVal (H i a)|] ≤ |S| / 2.

theorem Cslib.Probability.weighted_discrepancy_le_two_thirds {ι : Type u_1} {α : Type u_2} [Fintype ι] [Fintype α] [Nonempty α] {H : ι → α → Bool} (hH : IsPairwiseIndependentHash H) {w : α → ℝ} (hw_nn : ∀ (a : α), 0 ≤ w a) (hw_sum : ∑ a : α, w a = 1) (hw_max : ∀ (a : α), w a ≤ 2 / 3) :
(↑(Fintype.card ι))⁻¹ * ∑ i : ι, |∑ a : α, w a * BitString.signVal (H i a)| ≤ 2 / 3

Sharp weighted pairwise-independent discrepancy bound: for any probability weights w : α → ℝ (0 ≤ w a, ∑ w = 1, ∀ a, w a ≤ 2 / 3) and any pairwise-independent Boolean hash family H : ι → α → Bool, 𝔼_i[|∑ a, w a * BitString.signVal (H i a)|] ≤ 2 / 3.