Independent Bernoulli trials, at the Finset level #
Infrastructure for MiscMath.Probability.PoissonTrialsFixedMean, which is where the results
are stated and where the reader should start. This file carries the model — bernWt,
bernExp, tailLe — and the master pair identity every argument in the library rests on.
PoissonTrialsFixedMean.Bridge identifies the model with a product of Mathlib
ProbabilityTheory.bernoulliMeasures.
The model: independent Bernoulli trials, at the Finset level #
The sample space is s.powerset — the possible sets of successful trials — the weight of a
success set A is
bernWt s p A = (∏ i ∈ A, p i) * ∏ i ∈ s \ A, (1 - p i),
and the statistic is S = #A, so that bernExp s p g = E[g S]. Nothing is assumed about
p in the definitions; the range hypotheses 0 ≤ p i ≤ 1 are carried by the theorems that
need them, and where they are not needed this is said.
Everything here is stated for an arbitrary index type, an arbitrary ground set s : Finset ι
and an arbitrary CommRing; the order and the range hypotheses enter only from Theorem 3
onwards. bernExp_eq_integral_pi_bernoulliMeasure, in PoissonTrialsFixedMean.Bridge,
identifies this with a product of Mathlib bernoulliMeasures.
bernExp_pair_sub is the one computation of the development: every inequality in the two
sections that follow is this identity with a sign supplied. It is proved by splitting the
powerset on the two moved coordinates, which is Finset.sum_powerset_insert twice.
The Bernoulli product weight of the success set A among the trials s:
(∏ i ∈ A, p i) * ∏ i ∈ s \ A, (1 - p i). No hypothesis on p.
Equations
- MiscMath.Probability.bernWt s p A = (∏ i ∈ A, p i) * ∏ i ∈ s \ A, (1 - p i)
Instances For
E[g S], where S = #A is the number of successes.
Equations
- MiscMath.Probability.bernExp s p g = ∑ A ∈ s.powerset, MiscMath.Probability.bernWt s p A * g A.card
Instances For
The second difference of g on the integer grid: g (k+2) - 2 g (k+1) + g k.
Grid convexity is 0 ≤ secondDiff g k, strict grid convexity 0 < secondDiff g k.
Instances For
The weights sum to 1. This is Finset.prod_add and nothing else — in
particular it needs no hypothesis on p at all, which is what makes the
necessity witnesses for Theorem 3 possible: outside [0,1] the weights are still
a (signed) unit mass.
Splitting a powerset sum on two distinct elements. Bookkeeping only: four
applications of Finset.sum_powerset_insert.
The powerset sum split on the pair {i, j}: the inner bracket is the
three-point expectation of g given the successes outside the pair.
The master identity. Along any move of the pair (p i, p j) that
preserves the sum, the expectation changes by the change in the product
times a factor that never reads p i or p j. No sign hypothesis, no
convexity, and no range hypothesis.
s peeled at a distinct pair, with the explicit remainder s \ {i,j} — the
form the pair-move argument for Corollary 2.1 needs.
The closed form at a constant vector: the model is the binomial #
At a constant vector the model is the binomial: the powerset sum
collapses to ∑_{k ≤ #s} C(#s,k) P^k (1-P)^{#s-k} g k.
Explicit expansion on a two-element ground set, for the numerical witnesses.
Explicit expansion on a three-element ground set, for the numerical witnesses.
Conditioning on one trial, and the three-valued points #
Conditioning on one trial: E[g S] = (1 - p i) E[g S'] + p i E[g (S'+1)],
with S' the number of successes among the remaining trials.
Peeling a coordinate pinned at 1: it always succeeds, so the count shifts.
All the 1-coordinates peel off at once, shifting g by their number.
The three-valued evaluation. At a point taking only the values 1 (on
O), 0 (on Z) and one repeated x (elsewhere),
E[g S] = ∑_{j ≤ r} C(r,j) x^j (1-x)^{r-j} g (a + j), a = #O, r = #(s \ O \ Z).
This is S = a + Bin(r, x), and it is what makes the extremal shapes of
Corollary 2.1 computable.
The lower tail #
P[S ≤ k], the lower tail of the number of successes, as the expectation of
an indicator.
Equations
- MiscMath.Probability.tailLe s p k = MiscMath.Probability.bernExp s p fun (r : ℕ) => if r ≤ k then 1 else 0
Instances For
The comparator is the model at the constant vector: P[S ≤ k] for #s
identical trials at success probability P is binTail #s P k. Stated
for an arbitrary ground set.
In the degenerate range #s ≤ k the tail is 1: every success set is small
enough. This is sum_bernWt, so it holds for every p whatsoever.
Below the ones the tail vanishes. If fewer than #O successes are
allowed and O is pinned at 1, the event {S ≤ k} is impossible.
The lower tail at a three-valued point is a shifted binomial tail.