AFTD Auto-Formalizing Theoretical Domains

BooleanAnalysis.sum_prod_subset_eq_prod_one_add

theoremverifiedimported Lean

Sum over subsets equals a product of one plus each term. For any real numbers $c_0,\dots,c_{n-1}$, indexed by $i \in \mathrm{Fin}\,n$, \[ \sum_{S \subseteq \{0,\dots,n-1\}} \; \prod_{i \in S} c_i \;=\; \prod_{i=0}^{n-1} (1 + c_i), \] where the sum ranges over all subsets $S$ of the index set (with the empty product equal to $1$).

Statement

set_option maxHeartbeats 400000 in
open scoped BigOperators in
variable {n : ℕ} in
lemma BooleanAnalysis.sum_prod_subset_eq_prod_one_add (c : Fin n → ℝ) :
    ∑ S : Finset (Fin n), ∏ i ∈ S, c i =
    ∏ i : Fin n, (1 + c i)
Source
TCSlib, `BooleanAnalysis.sum_prod_subset_eq_prod_one_add`
Lean proof
By Jingzhen Sha, Allan Li, Hydroxyi, Mina, Owen McGinty (from the file's git history), from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1
  • BooleanAnalysis.sum_chiS_mul_eqCompleteness kernel for the Walsh basis. Let $x, y \in \{0,1\}^n$ be points of the Boolean hypercube. Then the sum of the products of…

Lean source view module on GitHub

set_option maxHeartbeats 400000 inopen scoped BigOperators invariable {n : ℕ} in/-- Key identity: `∑_{S ⊆ [n]} ∏_{i∈S} c_i = ∏_i (1 + c_i)`. Used via `Finset.prod_one_add`. -/lemma BooleanAnalysis.sum_prod_subset_eq_prod_one_add (c : Fin n → ℝ) :    ∑ S : Finset (Fin n), ∏ i ∈ S, c i =    ∏ i : Fin n, (1 + c i) := by  -- Use Finset.prod_one_add: ∏_{i∈s} (1 + f i) = ∑_{t∈s.powerset} ∏_{i∈t} f i  rw [Finset.prod_one_add Finset.univ]  -- Now RHS = ∑ t ∈ Finset.univ.powerset, ∏ i ∈ t, c i  -- Reindex: Finset.univ.powerset ≅ all Finset (Fin n) via id  apply Finset.sum_nbij id  · intro t _; exact Finset.mem_powerset.mpr (Finset.subset_univ t)  · intro t₁ _ t₂ _ h; exact h  · intro t ht; exact ⟨t, Finset.mem_univ t, rfl⟩  · intro t _; rfl
See it in the graphDiscuss this resultChallenge it