Bernoulli coordinate sampling and transference #
A Boolean mask selected : ι → Bool is a set of coordinates. Selecting each coordinate
independently with probability p gives it the weight bernoulliWeight p selected, and
bernoulliAverage p f is the expectation of f over the random mask, a finite sum. The coordinates
of the random mask are independent (bernoulliAverage_prod), the union of independent masks of
rates p and q has rate p + q - p q (bernoulliAverage_union), and increasing the rate
decreases the expectation of an antitone function
(bernoulliAverage_le_bernoulliAverage_of_antitone).
The union of h independent masks of rate p lies in a lower set A only if each of them does.
So when h p ≤ q, the probability of A at rate q is at most its probability at rate p to the
power h (bernoulliAverage_lowerSet_pow_le). This transference principle appears in Section 2 of
[Kor26] (Lemma 3) and again in Section 4; Korten attributes it to
Zhao, Lemma 4.3.7. Its form at small rates, with a real exponent, is
BitString.bernoulliAverage_lowerSet_transfer.
Main definitions #
Cslib.BitString.bernoulliWeight: the probability of a mask.Cslib.BitString.bernoulliAverage: the expectation over a random mask.
Main results #
Cslib.BitString.bernoulliAverage_prod: the coordinates of a random mask are independent.Cslib.BitString.bernoulliAverage_eq_bernoulliAverage_update: conditioning on one coordinate, an instance ofCslib.BitString.sum_prod_erase_mul_ite_mul_eq_bernoulliAverage, which reweights one coordinate.Cslib.BitString.bernoulliAverage_sub_bernoulliAverage_mul_sub_bernoulliAverage,Cslib.BitString.bernoulliAverage_sub_bernoulliAverage_sq: covariance and variance as𝔼[f g] - 𝔼[f] 𝔼[g]and𝔼[f²] - 𝔼[f]².Cslib.BitString.bernoulliAverage_reindex,Cslib.BitString.bernoulliAverage_sumElim,Cslib.BitString.bernoulliAverage_restrict: reindexing, splitting over a disjoint union, and restricting the coordinates of a random mask.Cslib.BitString.bernoulliAverage_zero,Cslib.BitString.bernoulliWeight_one_half,Cslib.BitString.bernoulliAverage_one_half: sampling at rates0and1 / 2.Cslib.BitString.expect_fin_lt_eq_bernoulliAverage: a mask of rational ratea / qfrom uniform digits inFin q.Cslib.BitString.bernoulliAverage_one_sub: complementing the mask exchanges the ratespand1 - p.Cslib.BitString.bernoulliAverage_coordinate,Cslib.BitString.bernoulliAverage_nonempty,Cslib.BitString.bernoulliAverage_hits,Cslib.BitString.bernoulliAverage_weight: the probability that a coordinate is selected, that some coordinate is, that some coordinate of a given set is, and the expected number of selected coordinates.Cslib.BitString.bernoulliWeight_eq_pow_mul_pow,Cslib.BitString.bernoulliAverage_comp_weight,Cslib.BitString.bernoulliAverage_lt_weight: the weight of a random mask is binomially distributed, with upper tail∑_{r < k ≤ n} C(n, k) p ^ k (1 - p) ^ (n - k).Cslib.BitString.bernoulliAverage_bernoulliAverage_eq_sum: the law of a coordinatewise image of two independent masks.Cslib.BitString.bernoulliAverage_union: unions of independent masks.Cslib.BitString.bernoulliAverage_le_bernoulliAverage_of_antitone: antitone functions have smaller expectations at larger rates.Cslib.BitString.bernoulliAverage_lowerSet_union,Cslib.BitString.bernoulliAverage_lowerSet_pow_le: transference for lower sets.
References #
The expectation of f over a random mask selecting each coordinate independently with
probability p. It is a probability expectation when 0 ≤ p ≤ 1.
Reindexing and splitting the coordinates #
An equivalence of coordinate types preserves Bernoulli expectations.
Random masks on a disjoint union of coordinates are pairs of independent masks: the
expectation over a mask on ι ⊕ κ is the iterated expectation over a mask on ι and one on
κ.
Linearity and positivity #
At a rate strictly between 0 and 1, every mask has positive probability.
The weights of the masks sum to one, so constants are their own expectations. This holds for
every p; the weights are nonnegative when p ∈ [0, 1].
Bernoulli expectation is additive.
Bernoulli expectation commutes with subtraction.
Bernoulli expectation commutes with multiplication by a constant.
Bernoulli expectation commutes with finite sums.
The covariance under Bernoulli expectation is the mean of the product minus the product of
the means, for every p, since the weights sum to one.
The variance under Bernoulli expectation is the second moment minus the squared mean, for
every p, since the weights sum to one.
Bernoulli expectation commutes with finite averages.
The probability of a set of masks is between zero and one.
Independence of the coordinates #
The coordinates of a random mask are independent: the average of a product of functions of the separate coordinates is the product of their averages.
Restricting a Bernoulli mask to fixed coordinates preserves its product law.
Sampling at rate zero selects the empty coordinate set.
At rate 1 / 2, every mask has weight (1 / 2) ^ |ι|.
At rate 1 / 2, the Bernoulli expectation is the uniform expectation on the cube.
A mask of rational rate from uniform digits: selecting each coordinate i exactly when an
independent uniformly random digit m i ∈ Fin q is below a ≤ q gives a random mask of rate
a / q.
Complementing the mask exchanges the rates p and 1 - p: the expectation of f at
rate 1 - p is the expectation of f of the complemented mask at rate p.
Reweighting one coordinate: weighting g by the mass ∏_{j ≠ i} π_q(x j) of the
coordinates other than i, and by a or b according as bit i is false or true, gives the
q-biased expectation of a g(x^{i ↦ false}) + b g(x^{i ↦ true}), for every q, a and b.
With a = 1 - q and b = q the left side is the expectation of g
(bernoulliAverage_eq_bernoulliAverage_update); with a = -1 and b = 1 it is the term of bit i
in the derivative in q of that expectation (hasDerivAt_bernoulliAverage of
CslibFrontier.Foundations.BooleanAnalysis.MargulisRusso).
Conditioning on one coordinate: the expectation of g is the expectation of its average
over bit i, which is false with probability 1 - p and true with probability p.
A coordinate is selected with probability p.
A mask is nonempty with probability 1 - (1 - p) ^ |ι|.
A mask of rate p has |ι| p coordinates on average.
The weight of a mask of rate p is binomially distributed: the expectation of a function of
the weight is its average against C(n, k) p ^ k (1 - p) ^ (n - k), where n = |ι|.
A mask of rate p has more than r coordinates with probability
∑_{r < k ≤ n} C(n, k) p ^ k (1 - p) ^ (n - k), the upper tail of the binomial distribution.
A mask of rate p meets the coordinates selected by s with probability
1 - (1 - p) ^ |s|.
Unions of independent masks #
Coordinatewise images of two independent masks: the expectation of f at the image
i ↦ φ (P i) (Q i) of independent masks P and Q of rates p and q is the sum of its values
against a product weight, in which each coordinate takes the value b with weight
`(1 - p) (1 - q) [φ false false = b] + (1 - p) q [φ false true = b] + p (1 - q) [φ true false = b]
- p q [φ true true = b]`.
The union of independent masks of rates p and q has rate p + q - p * q.
Transference for lower sets #
The union of independent masks of rates p and q lies in a lower set only if both masks do,
so the probability of a lower set at rate p + q - p q is at most the product of its
probabilities at rates p and q.
Transference for lower sets, with an integer number of repetitions: if h independent
masks of rate p have a union of rate at most q (h p ≤ q), then the probability of a lower set
at rate q is at most the h-th power of its probability at rate p.