BooleanAnalysis.influence
defimported Lean
The influence of coordinate $i$ on $f$ measures how often flipping bit $i$ changes the output: \[ \mathrm{Inf}_i[f] \;=\; \E\!\left[\frac{(f(x)-f(x^i))^2}{4}\right]. \] For $\pm 1$-valued $f$ this equals $\Pr[f(x)\ne f(x^i)]$.
Statement
set_option maxHeartbeats 400000 in open scoped BigOperators in variable {n : ℕ} in noncomputable def BooleanAnalysis.influence (i : Fin n) (f : BooleanFunc n) : ℝ
- Defined in
- TCSlib, `BooleanAnalysis.influence`
- Lean proof
- By Jingzhen Sha, Allan Li, Hydroxyi, Mina, 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.BooleanAnalysis.influence← BooleanAnalysis.influence (TCSlib/BooleanAnalysis/Basic.lean:522): verbatim
- Verified
- 07 Oct 2026
- Axioms
- none listed
- Built on 3
- BooleanAnalysis.expectThe expectation of $f$ under the uniform measure: \[ \E[f] \;=\; 2^{-n}\sum_{x\in\{0,1\}^n} f(x). \]
- BooleanAnalysis.flipBitThe point $x^i\in\{0,1\}^n$ obtained from $x$ by flipping the $i$-th coordinate.
- BooleanAnalysis.BooleanFuncA Boolean function of arity $n$ is a function $f : \{0,1\}^n \to \bbr$.
- Used by 8
- BooleanAnalysis.max_influence_lower_boundAverage influence lower bound. Let $f:\{0,1\}^n\to\bbr$ be a Boolean function on the hypercube of dimension $n\ge 1$. Then some coordinate…
- KKL.friedgut_juntaFriedgut's junta theorem. Let $f : \{0,1\}^n \to \{-1,1\}$ be a $\pm 1$-valued Boolean function with total influence $I[f]$, and let…
- BooleanAnalysis.influence_eq_sum_fourierInfluence via Fourier coefficients. Let $f:\{0,1\}^n\to\bbr$ be a Boolean function and fix a coordinate $i\in[n]$. Then the influence of…
- KKL.influentialCoordsThe set of $\tau$-influential coordinates of $f$ is the finite set…
- KKL.influential_coords_cardFew influential coordinates. Let $f : \{0,1\}^n \to \bbr$ be a Boolean function and let $\tau > 0$. The number of $\tau$-influential…
- BooleanAnalysis.totalInfluence$I[f] = \sum_{i=1}^n \mathrm{Inf}_i[f]$.
- KKL.lowDegreePart_depends_on_influentialLow-degree part is close to a junta on the influential coordinates. Let $f:\{0,1\}^n\to\bbr$ be a Boolean function, let $k$ be a natural…
- KKL.noisyInfluence_le_influenceNoisy influence is dominated by influence. Let $f:\{0,1\}^n\to\bbr$ be a Boolean function, let $i\in[n]$ be a coordinate, and let…
Lean source view module on GitHub
set_option maxHeartbeats 400000 in open scoped BigOperators in variable {n : ℕ} in /-- The **influence** of coordinate `i` on `f`: `Inf_i[f] = Pr_x[f(x) ≠ f(xⁱ)]` where `xⁱ` denotes `x` with the `i`-th bit flipped. For `{-1,1}`-valued functions this equals `𝔼[(f(x) - f(xⁱ))² / 4]`. **Source:** [OD14, §2.1]. -/ noncomputable def BooleanAnalysis.influence (i : Fin n) (f : BooleanFunc n) : ℝ := expect (fun x ↦ (f x - f (flipBit x i)) ^ 2 / 4)