The binomial tail, and its derivative in the success probability #
Infrastructure for MiscMath.Probability.PoissonTrialsFixedMean, which is where the results
are stated and where the reader should start. Nothing here is a result on its own: this file
supplies the elementary object binTail and the one calculus fact about it that the argument
for Hoeffding's Theorem 4 needs. PoissonTrialsFixedMean.Bridge identifies binTail with
Mathlib's ProbabilityTheory.binomial.
The binomial tail #
Mathlib has the binomial distribution but no partial sum, tail or cumulative distribution function for it, and no derivative or monotonicity in either parameter. This section supplies the elementary object and the one calculus fact about it that the argument for Theorem 4 needs:
binTail n P k = ∑_{j ≤ k} C(n,j) · P^j · (1-P)^(n-j) ( = P[Bin(n,P) ≤ k] )
and
d/dP binTail n P k = - n · C(n-1,k) · P^k · (1-P)^(n-1-k).
The derivative is proved by telescoping rather than by passing through Polynomial:
differentiating term by term and applying j·C(n,j) = n·C(n-1,j-1) and
(n-j)·C(n,j) = n·C(n-1,j) turns each summand into a difference of consecutive terms, and
Finset.sum_range_sub' collapses the sum.
Every exponent below is the ℕ-truncated one. That is deliberate, and it is where the care
is: at j = 0 and at j > n the truncated powers are wrong, and in each case the
accompanying coefficient (j, or n - j, or C(n,j)) vanishes and kills the term. Stating
the derivative with binShapeD, which has no negative powers anywhere, is what makes the
statement true as written rather than true-up-to-edge-cases.
The binomial tail P[Bin(n,P) ≤ k] = ∑_{j ≤ k} C(n,j) P^j (1-P)^(n-j).
Terms with j > n vanish because C(n,j) = 0, so no truncation guard on k is
needed. See binTail_eq_binomial_real_Iic for the identification with Mathlib's
ProbabilityTheory.binomial.
Equations
Instances For
The derivative of binShape, written with no negative powers: the two
coefficients k and m - k kill the truncated exponents exactly where they
would otherwise be wrong.
Equations
Instances For
The tail is nonnegative in the probability range — it is a probability.
The telescoping identity. Summing the term-by-term derivatives of the
binomial tail collapses to a single term. The two Nat.choose identities
j·C(n,j) = n·C(n-1,j-1) and (n-j)·C(n,j) = n·C(n-1,j) turn each summand into
a difference of consecutive C(m,·)·binShape values.
The derivative of a binomial tail in the success probability.
d/dP ∑_{j ≤ k} C(n,j) P^j (1-P)^(n-j) = - n · C(n-1,k) · P^k (1-P)^(n-1-k),
stated at n = m + 1 so that no ℕ-subtraction appears in the coefficient.