AFTD Auto-Formalizing Theoretical Domains

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.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
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

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)
See it in the graphDiscuss this resultChallenge it