Documentation

CslibFrontier.Probability.PairwiseIndependentHash.Mixing

The hash mixing lemma #

Let h i : X → X be a pairwise independent family of functions of a finite set X to itself and let A and B be subsets of X, of densities α and β. For a uniformly random seed i, the density of {x ∈ A | h i x ∈ B} has mean α β, the density of A × B, and variance exactly α β (1 - β) / |X| (IsPairwiseIndependentHash.expect_dens_filter_apply_mem_sub_sq). Hence its mean absolute deviation from α β is at most √(α β / |X|) (IsPairwiseIndependentHash.expect_abs_dens_filter_apply_mem_sub_le): a random member of the family mixes every rectangle A × B up to an error that is small when |X| is large. This is the hash mixing lemma of Nisan's generator for space-bounded computation [Nis92], in expectation form. Its proof rescales the variance of the number of retained points (IsPairwiseIndependentHash.expect_card_filter_apply_mem_sub_sq).

Main results #

References #

theorem Cslib.Probability.IsPairwiseIndependentHash.expect_dens_filter_apply_mem_sub_sq {ι : Type u_1} {X : Type u_2} [Fintype ι] [Fintype X] [DecidableEq X] {h : ι → X → X} (hh : IsPairwiseIndependentHash h) (A B : Finset X) :
(Finset.univ.expect fun (i : ι) => (↑{x ∈ A | h i x ∈ B}.dens - ↑A.dens * ↑B.dens) ^ 2) = ↑A.dens * ↑B.dens * (1 - ↑B.dens) / ↑(Fintype.card X)

The variance of a hashed rectangle: for a pairwise independent family h i : X → X, the density of {x ∈ A | h i x ∈ B} has variance α β (1 - β) / |X| about α β, where α and β are the densities of A and B.

theorem Cslib.Probability.IsPairwiseIndependentHash.expect_abs_dens_filter_apply_mem_sub_le {ι : Type u_1} {X : Type u_2} [Fintype ι] [Fintype X] [DecidableEq X] {h : ι → X → X} (hh : IsPairwiseIndependentHash h) (A B : Finset X) :
(Finset.univ.expect fun (i : ι) => |↑{x ∈ A | h i x ∈ B}.dens - ↑A.dens * ↑B.dens|) ≤ √(↑A.dens * ↑B.dens / ↑(Fintype.card X))

The hash mixing lemma [Nis92]: for a pairwise independent family h i : X → X and sets A and B of densities α and β, the density of {x ∈ A | h i x ∈ B} differs from α β on average by at most √(α β / |X|).