AFTD Auto-Formalizing Theoretical Domains

Bonami.avgLast

defimported Lean

The average $\mathrm{avgLast}\,f$ of $f$ over its last coordinate is the function on $n$ variables given by $\tfrac12\bigl(\mathrm{restrictLast}\,f\,\mathrm{false} + \mathrm{restrictLast}\,f\,\mathrm{true}\bigr)$.

Statement

open BooleanAnalysis in
noncomputable def Bonami.avgLast {n : ℕ} (f : BooleanFunc (n + 1)) : BooleanFunc n
Defined in
TCSlib, `Bonami.avgLast`
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
none listed
Built on 2
  • 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$…
  • BooleanAnalysis.BooleanFuncA Boolean function of arity $n$ is a function $f : \{0,1\}^n \to \bbr$.
Used by 5
  • Bonami.degree_avgLastAveraging over a coordinate preserves the degree bound. Let $f\colon\{0,1\}^{n+1}\to\bbr$ be a Boolean function on $n+1$ variables, and…
  • Bonami.second_moment_decompSecond-moment decomposition over the last coordinate. Let $f : \{0,1\}^{n+1} \to \bbr$ be a Boolean function on $n+1$ variables. Define…
  • 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.restrictLast_true_eqRecovering the true-restriction from average and half-difference. Let $f : \{0,1\}^{n+1} \to \bbr$ be a Boolean function on $n+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

open BooleanAnalysis in
/-- Defines the average of a Boolean function over its final coordinate. **Source:** [OD14, Cor. 9.6 (proof)]. -/
noncomputable def Bonami.avgLast {n : ℕ} (f : BooleanFunc (n + 1)) : BooleanFunc n :=
  fun x => (restrictLast f false x + restrictLast f true x) / 2
See it in the graphDiscuss this resultChallenge it