Exact sum over all fixed-cardinality Bernoulli grid patterns equals the binomial mass
ProvedAvramDividend.Classical.bv_binomial_pattern_sum_ws01bavram-dividend-classicalbinomialcombinatoricsgrid-patternpowersetcardws01b
For every natural grid length n, count k and real-valued active/inactive cell masses p and q, the sum of the two-valued product over every k-element subset of the n cells equals choose(n,k) times p^k times q^(n-k). The theorem handles all edge cases, including k>n, with no probability-process assumptions.
Preamble
import Mathlib open Finset open scoped BigOperators /-- Summing every fixed-size active-cell Bernoulli product gives the exact binomial mass, with the finite grid partition handled by powersetCard. -/
Formal statement
theorem AvramDividend.Classical.bv_binomial_pattern_sum_ws01b
(n k : ℕ) (p q : ℝ) :
(∑ S ∈ Finset.powersetCard k (Finset.range n),
∏ i ∈ Finset.range n, if i ∈ S then p else q) =
(Nat.choose n k : ℝ) * p ^ k * q ^ (n - k) := by sorrySource
Remote-compiler-validated Lean proof in the pinned Prove2Me environment on 28 October 2026, using Finset.prod_ite, Finset.card_sdiff_of_subset, Finset.card_powersetCard and exact finite-set product and sum manipulation. This is the combinatorial coefficient component required to turn the genuine original-process grid pattern theorem into a finite-grid binomial law.