Bonami.expect_sq_nonneg
theoremverifiedimported Lean
Nonnegativity of the mean square. For every Boolean function $f : \{0,1\}^n \to \bbr$, the expectation of $f^2$ under the uniform measure is nonnegative: $0 \le \E[f^2]$, where $\E[f^2] = 2^{-n}\sum_{x\in\{0,1\}^n} f(x)^2$.
Statement
open BooleanAnalysis in lemma Bonami.expect_sq_nonneg {n : ℕ} (f : BooleanFunc n) : 0 ≤ expect (fun x => f x ^ 2)
- Source
- TCSlib, `Bonami.expect_sq_nonneg`
- 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← Bonami.expect_sq_nonneg (TCSlib/BooleanAnalysis/Hypercontractivity/Decomposition.lean:226): 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 1
- 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…
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 square is nonnegative. **Source:** [OD14, Cor. 9.6 (proof)]. -/lemma Bonami.expect_sq_nonneg {n : ℕ} (f : BooleanFunc n) : 0 ≤ expect (fun x => f x ^ 2) := by exact mul_nonneg (pow_nonneg (by norm_num) _) (Finset.sum_nonneg fun _ _ => sq_nonneg _)