Documentation

CslibFrontier.Foundations.BooleanAnalysis.MeanWeight

Independent bits with given means #

Draw each bit a i of a string a : ι → Bool independently so that its sign signVal (a i) has mean μ i ∈ [-1, 1], that is a i = true (the sign -1) with probability (1 - μ i) / 2. The string a then has probability ∏ i, (1 + signVal (a i) μ i) / 2 (BitString.meanWeight), nonnegative for means in [-1, 1] (BitString.meanWeight_nonneg), and the total probability is one (BitString.sum_meanWeight). At the signs of a string x this is the point mass at x (BitString.meanWeight_signVal). With every mean 1 - 2 p it is the Bernoulli mask of rate p (BitString.meanWeight_const). In the coordinates (1 - μ i) / 2, the probabilities that the bits are true, it is the indicator polynomial of a (BitString.meanWeight_eq_eval_indicatorPoly), so the expectation of f is its multilinear extension BitString.multilinearExtension at that point (BitString.sum_meanWeight_mul_eq_eval_multilinearExtension).

The character of S has expectation ∏_{i ∈ S} μ i (BitString.sum_meanWeight_mul_chi), so the expectation of any real function f is its Fourier expansion ∑_S f̂(S) ∏_{i ∈ S} μ i evaluated at the point μ (BitString.sum_meanWeight_mul_eq_sum_fourierCoeff) O'Donnell, Exercise 1.4. This is how O'Donnell, Exercise 7.20(c) evaluates a constraint at a randomized assignment.

Usage #

Open Cslib.BitString. The means are a function μ : ι → ℝ; for concrete means on Fin n write them as a vector such as ![1 / 2, -1 / 3]. To evaluate a weight, rewrite with BitString.meanWeight_def and expand the product (Fin.prod_univ_two). The identities BitString.sum_meanWeight, BitString.sum_meanWeight_mul_chi and BitString.sum_meanWeight_mul_eq_sum_fourierCoeff hold for every real μ; only BitString.meanWeight_nonneg needs |μ i| ≤ 1. A sum ∑ a, meanWeight μ a * f a is then computed from the Fourier coefficients of f, or, through BitString.sum_meanWeight_mul_eq_eval_multilinearExtension, from its multilinear extension in the {0, 1} coordinates. The checked clients in CslibFrontierTests/BooleanAnalysisHastadTest.lean evaluate a weight at means 1/2, 0, the point mass at signs, the Bernoulli mask at equal means, Exercise 1.4 for the parity of two bits, and the indicator polynomial and multilinear extension at the matching {0, 1} point.

Main definitions #

Main results #

References #

noncomputable def Cslib.BitString.meanWeight {ι : Type u_1} [Fintype ι] (μ : ι → ℝ) (a : ι → Bool) :

The probability of the string a when its bits are independent and the sign of bit i has mean μ i: bit i is true, the sign -1, with probability (1 - μ i) / 2. The weights are nonnegative when every |μ i| ≤ 1.

theorem Cslib.BitString.meanWeight_def {ι : Type u_1} [Fintype ι] (μ : ι → ℝ) (a : ι → Bool) :
meanWeight μ a = ∏ i : ι, (1 + signVal (a i) * μ i) / 2

The defining formula of meanWeight.

theorem Cslib.BitString.meanWeight_nonneg {ι : Type u_1} [Fintype ι] {μ : ι → ℝ} (hμ : ∀ (i : ι), |μ i| ≤ 1) (a : ι → Bool) :

For means in [-1, 1] the weights are nonnegative.

theorem Cslib.BitString.meanWeight_const {ι : Type u_1} [Fintype ι] (p : ℝ) (a : ι → Bool) :
meanWeight (fun (x : ι) => 1 - 2 * p) a = bernoulliWeight p a

With every mean 1 - 2 p, the weights are those of the Bernoulli mask of rate p.

theorem Cslib.BitString.meanWeight_eq_eval_indicatorPoly {ι : Type u_1} [Fintype ι] (μ : ι → ℝ) (a : ι → Bool) :
meanWeight μ a = (MvPolynomial.eval fun (i : ι) => (1 - μ i) / 2) (indicatorPoly a)

In the coordinates (1 - μ i) / 2, the probabilities that the bits are true, the weight of a is the value of its indicator polynomial.

theorem Cslib.BitString.sum_meanWeight_mul_eq_eval_multilinearExtension {ι : Type u_1} [Fintype ι] [DecidableEq ι] (μ : ι → ℝ) (f : (ι → Bool) → ℝ) :
∑ a : ι → Bool, meanWeight μ a * f a = (MvPolynomial.eval fun (i : ι) => (1 - μ i) / 2) (multilinearExtension f)

The expectation of a function under independent bits with means μ is the value of its multilinear extension at the point (1 - μ i) / 2 of the probabilities that the bits are true.

theorem Cslib.BitString.sum_meanWeight_mul_chi {ι : Type u_1} [Fintype ι] [DecidableEq ι] (μ : ι → ℝ) (S : Finset ι) :
∑ a : ι → Bool, meanWeight μ a * chi ℝ S a = ∏ i ∈ S, μ i

The expectation of a character under independent bits with means μ is ∏_{i ∈ S} μ i.

theorem Cslib.BitString.sum_meanWeight {ι : Type u_1} [Fintype ι] [DecidableEq ι] (μ : ι → ℝ) :
∑ a : ι → Bool, meanWeight μ a = 1

The weights of independent bits with means μ sum to one.

theorem Cslib.BitString.sum_meanWeight_mul_eq_sum_fourierCoeff {ι : Type u_1} [Fintype ι] [DecidableEq ι] (μ : ι → ℝ) (f : (ι → Bool) → ℝ) :
∑ a : ι → Bool, meanWeight μ a * f a = ∑ S : Finset ι, fourierCoeff f S * ∏ i ∈ S, μ i

The expectation of a function under independent bits with means μ is its Fourier expansion ∑_S f̂(S) ∏_{i ∈ S} μ i, the multilinear extension of f at the point μ O'Donnell, Exercise 1.4.

theorem Cslib.BitString.meanWeight_signVal {ι : Type u_1} [Fintype ι] (x a : ι → Bool) :
meanWeight (fun (i : ι) => signVal (x i)) a = if a = x then 1 else 0

At the signs of a string x, the bits are x itself: the weights are the point mass at x.