Bonami.expect_sq_nonneg_prod
theoremverifiedimported Lean
Nonnegativity of the expectation of a product of squares. For any two Boolean functions $g, h : \{0,1\}^n \to \bbr$, the expectation of the product of their squares under the uniform measure is nonnegative: \[ \E\!\left[\,g^2\, h^2\,\right] \;=\; 2^{-n} \sum_{x \in \{0,1\}^n} g(x)^2\, h(x)^2 \;\ge\; 0. \]
Statement
open BooleanAnalysis in lemma Bonami.expect_sq_nonneg_prod {n : ℕ} (g h : BooleanFunc n) : 0 ≤ expect (fun x => g x ^ 2 * h x ^ 2)
- Source
- TCSlib, `Bonami.expect_sq_nonneg_prod`
- Lean proof
- By 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.Bonami.expect_sq_nonneg_prod← Bonami.expect_sq_nonneg_prod (TCSlib/BooleanAnalysis/Hypercontractivity/Decomposition.lean:234): verbatim
- Verified
- 07 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 2
- BooleanAnalysis.expectThe expectation of $f$ under the uniform measure: \[ \E[f] \;=\; 2^{-n}\sum_{x\in\{0,1\}^n} f(x). \]
- BooleanAnalysis.BooleanFuncA Boolean function of arity $n$ is a function $f : \{0,1\}^n \to \bbr$.
- Used by 2
- Bonami.bonami_expectBonami inequality in expectation form. Let $f : \{0,1\}^n \to \bbr$ be a Boolean function of degree at most $k$, meaning that every…
- Bonami.expect_fourth_nonnegNonnegativity of the fourth moment. Let $f : \{0,1\}^n \to \bbr$ be a Boolean function on the Boolean hypercube. Then its fourth moment…
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
open BooleanAnalysis in/-- Shows that the expectation of a product of squares is nonnegative. **Source:** [OD14, Cor. 9.6 (proof)]. -/lemma Bonami.expect_sq_nonneg_prod {n : ℕ} (g h : BooleanFunc n) : 0 ≤ expect (fun x => g x ^ 2 * h x ^ 2) := by exact mul_nonneg (pow_nonneg (by norm_num) _) (Finset.sum_nonneg fun _ _ => by positivity)