Documentation

CslibFrontier.Probability.KWiseIndependent.TugOfWar

Moments of tug-of-war sums #

Let h i : X → Y be a hash family with seed i drawn uniformly, and ε : Y → ℝ a sign of mean zero and square one, so that ε (h i x) is a random sign attached to each point x. For weights f : X → ℝ on a finite set S, the tug-of-war sum Z = ∑ x ∈ S, f x ε (h i x) of Alon, Matias and Szegedy [AMS99] estimates ∑ x ∈ S, f x ²:

These are the two moment computations in the proof of [AlonMatiasSzegedy1999, Theorem 2.2]. The first is an instance of the additivity of second moments under pairwise independence (Cslib.Probability.IsKWiseIndependentHash.expect_sq_sum, in CslibFrontier.Probability.KWiseIndependent.SecondMoment); both expand squares of sums with Finset.sq_sum_eq_sum_sq_add_sum_offDiag.

Main results #

References #

theorem Cslib.Probability.IsKWiseIndependentHash.expect_prod_sign {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ι] [Fintype Y] [DecidableEq Y] {k : ℕ} {h : ι → X → Y} {ε : Y → ℝ} [DecidableEq X] (hh : IsKWiseIndependentHash k h) (hε : ∀ (y : Y), ε y ^ 2 = 1) (hε₀ : (Finset.univ.expect fun (y : Y) => ε y) = 0) {n : ℕ} (t : Fin n → X) (ht : (Finset.image t Finset.univ).card ≤ k) :
(Finset.univ.expect fun (i : ι) => ∏ j : Fin n, ε (h i (t j))) = if ∀ (j : Fin n), Even {j' : Fin n | t j' = t j}.card then 1 else 0

Signs with mean zero and square one: a product of signs at the points of a tuple of at most k distinct points has average one when every point occurs an even number of times, and zero otherwise.

theorem Cslib.Probability.IsKWiseIndependentHash.expect_sign_mul_sign {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ι] [Fintype Y] [DecidableEq Y] {h : ι → X → Y} {ε : Y → ℝ} (hh : IsKWiseIndependentHash 2 h) (hε₀ : (Finset.univ.expect fun (y : Y) => ε y) = 0) {x x' : X} (hx : x ≠ x') :
(Finset.univ.expect fun (i : ι) => ε (h i x) * ε (h i x')) = 0

Signs at two distinct points are uncorrelated.

theorem Cslib.Probability.IsKWiseIndependentHash.expect_sign_mul_sign_mul_sign_mul_sign {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ι] [Fintype Y] [DecidableEq Y] {h : ι → X → Y} {ε : Y → ℝ} [DecidableEq X] (hh : IsKWiseIndependentHash 4 h) (hε : ∀ (y : Y), ε y ^ 2 = 1) (hε₀ : (Finset.univ.expect fun (y : Y) => ε y) = 0) {a b c d : X} (hab : a ≠ b) (hcd : c ≠ d) :
(Finset.univ.expect fun (i : ι) => ε (h i a) * ε (h i b) * (ε (h i c) * ε (h i d))) = if c = a ∧ d = b ∨ c = b ∧ d = a then 1 else 0

The product of the signs at two pairs of distinct points has average one if the pairs agree up to order, and zero otherwise.

theorem Cslib.Probability.IsKWiseIndependentHash.expect_sq_sum_mul_sign {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ι] [Fintype Y] [DecidableEq Y] {h : ι → X → Y} {ε : Y → ℝ} (hh : IsKWiseIndependentHash 2 h) (hε : ∀ (y : Y), ε y ^ 2 = 1) (hε₀ : (Finset.univ.expect fun (y : Y) => ε y) = 0) (S : Finset X) (f : X → ℝ) :
(Finset.univ.expect fun (i : ι) => (∑ x ∈ S, f x * ε (h i x)) ^ 2) = ∑ x ∈ S, f x ^ 2

The tug-of-war estimator is unbiased [AlonMatiasSzegedy1999, Theorem 2.2]: for a pairwise independent family of signs ε (h i x) with mean zero and square one, Z = ∑ x ∈ S, f x ε (h i x) has 𝔼 Z² = ∑ x ∈ S, f x ².

theorem Cslib.Probability.IsKWiseIndependentHash.expect_sq_sum_offDiag_mul_sign_mul_sign {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ι] [Fintype Y] [DecidableEq Y] {h : ι → X → Y} {ε : Y → ℝ} (hh : IsKWiseIndependentHash 4 h) (hε : ∀ (y : Y), ε y ^ 2 = 1) (hε₀ : (Finset.univ.expect fun (y : Y) => ε y) = 0) (S : Finset X) (f g : X → ℝ) :
(Finset.univ.expect fun (i : ι) => (∑ p ∈ S.offDiag, f p.1 * g p.2 * (ε (h i p.1) * ε (h i p.2))) ^ 2) = ∑ p ∈ S.offDiag, (f p.1 ^ 2 * g p.2 ^ 2 + f p.1 * g p.1 * (f p.2 * g p.2))

The second moment of a sum over ordered pairs of signs: for a four-wise independent family of signs of mean zero and square one, W = ∑_{x ≠ y ∈ S} f x g y ε (h i x) ε (h i y) has 𝔼 W² = ∑_{x ≠ y ∈ S} f x g y (f x g y + f y g x), since the products of the signs at two pairs of distinct points average to zero unless the pairs agree up to order. Both the variance of the tug-of-war estimator and that of the join signature reduce to it.

theorem Cslib.Probability.IsKWiseIndependentHash.expect_sq_sum_mul_sign_sub_sq {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ι] [Fintype Y] [DecidableEq Y] {h : ι → X → Y} {ε : Y → ℝ} (hh : IsKWiseIndependentHash 4 h) (hε : ∀ (y : Y), ε y ^ 2 = 1) (hε₀ : (Finset.univ.expect fun (y : Y) => ε y) = 0) (S : Finset X) (f : X → ℝ) :
(Finset.univ.expect fun (i : ι) => ((∑ x ∈ S, f x * ε (h i x)) ^ 2 - ∑ x ∈ S, f x ^ 2) ^ 2) = 2 * ((∑ x ∈ S, f x ^ 2) ^ 2 - ∑ x ∈ S, f x ^ 4)

The variance of the tug-of-war estimator [AlonMatiasSzegedy1999, Theorem 2.2]: for a four-wise independent family of signs, Z = ∑ x ∈ S, f x ε (h i x) has 𝔼 (Z² - ∑ f²)² = 2 ((∑ f²)² - ∑ f⁴).

theorem Cslib.Probability.IsKWiseIndependentHash.expect_sum_mul_sign_pow_four {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ι] [Fintype Y] [DecidableEq Y] {h : ι → X → Y} {ε : Y → ℝ} (hh : IsKWiseIndependentHash 4 h) (hε : ∀ (y : Y), ε y ^ 2 = 1) (hε₀ : (Finset.univ.expect fun (y : Y) => ε y) = 0) (S : Finset X) (f : X → ℝ) :
(Finset.univ.expect fun (i : ι) => (∑ x ∈ S, f x * ε (h i x)) ^ 4) = 3 * (∑ x ∈ S, f x ^ 2) ^ 2 - 2 * ∑ x ∈ S, f x ^ 4

The fourth moment of the tug-of-war sum [AlonMatiasSzegedy1999, Theorem 2.2]: for a four-wise independent family of signs, 𝔼 Z⁴ = 3 (∑ f²)² - 2 ∑ f⁴, that is ∑ f⁴ + 6 ∑_{x < y} f(x)² f(y)².

theorem Cslib.Probability.IsKWiseIndependentHash.expect_sq_sum_mul_sign_sub_sq_le {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ι] [Fintype Y] [DecidableEq Y] {h : ι → X → Y} {ε : Y → ℝ} (hh : IsKWiseIndependentHash 4 h) (hε : ∀ (y : Y), ε y ^ 2 = 1) (hε₀ : (Finset.univ.expect fun (y : Y) => ε y) = 0) (S : Finset X) (f : X → ℝ) :
(Finset.univ.expect fun (i : ι) => ((∑ x ∈ S, f x * ε (h i x)) ^ 2 - ∑ x ∈ S, f x ^ 2) ^ 2) ≤ 2 * (∑ x ∈ S, f x ^ 2) ^ 2

The variance bound for the tug-of-war estimator [AlonMatiasSzegedy1999, Theorem 2.2]: for a four-wise independent family of signs, 𝔼 (Z² - ∑ f²)² ≤ 2 (∑ f²)².