AFTD Auto-Formalizing Theoretical Domains

Bonami.expect_succ_eq

theoremverifiedimported Lean

Expectation splits over the last coordinate. Let $\varphi : \{0,1\}^{n+1} \to \bbr$ be a Boolean function on $n+1$ variables, and for a bit $b \in \{0,1\}$ let $\varphi_b : \{0,1\}^n \to \bbr$, $\varphi_b(x) = \varphi(x, b)$, be its restriction obtained by fixing the last coordinate to $b$. Then the expectation of $\varphi$ under the uniform measure on $\{0,1\}^{n+1}$ is the average of the expectations of its two restrictions: \[ \E[\varphi] \;=\; \frac{\E[\varphi_{0}] + \E[\varphi_{1}]}{2}. \]

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open BooleanAnalysis in
lemma Bonami.expect_succ_eq {n : ℕ} (φ : BooleanFunc (n + 1)) :
    expect φ = (expect (restrictLast φ false) + expect (restrictLast φ true)) / 2
Source
TCSlib, `Bonami.expect_succ_eq`
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 5
  • BooleanAnalysis.expectThe expectation of $f$ under the uniform measure: \[ \E[f] \;=\; 2^{-n}\sum_{x\in\{0,1\}^n} f(x). \]
  • Bonami.uniformWeight_succUniform weight halves with each added coordinate. For every natural number $n$, the uniform weight $2^{-n}$ assigned to each point of…
  • Bonami.restrictLastGiven a Boolean function $f$ on $n+1$ variables and a bit $b$, the restriction $\mathrm{restrictLast}\,f\,b$ is the function on $n$…
  • Bonami.sum_boolCube_succSplitting a sum over the hypercube on its last coordinate. Let $n$ be a natural number and let $\varphi \colon \{0,1\}^{n+1} \to \bbr$ be…
  • BooleanAnalysis.BooleanFuncA Boolean function of arity $n$ is a function $f : \{0,1\}^n \to \bbr$.
Used by 1
  • Bonami.fourth_moment_decompFourth-moment decomposition over the last coordinate. Let $f : \{0,1\}^{n+1} \to \bbr$ be a Boolean function on $n+1$ variables, and let…

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true inopen BooleanAnalysis in/-- Expresses expectation on an `(n + 1)`-cube as the average over the two restrictions. **Source:** [OD14, Cor. 9.6 (proof)]. -/lemma Bonami.expect_succ_eq {n : ℕ} (φ : BooleanFunc (n + 1)) :    expect φ = (expect (restrictLast φ false) + expect (restrictLast φ true)) / 2 := by  unfold expect restrictLast  rw [sum_boolCube_succ, uniformWeight_succ]  ring
See it in the graphDiscuss this resultChallenge it