AFTD Auto-Formalizing Theoretical Domains

KKL.low_plus_high_eq

theoremverifiedimported Lean

Low and high degree parts reconstruct the function. Let $f : \{0,1\}^n \to \bbr$ be a Boolean function and let $k \in \bbn$ be a threshold level. Then for every point $x \in \{0,1\}^n$ of the cube, \[ f_{\le k}(x) + f_{>k}(x) = f(x), \] where $f_{\le k}(x) = \sum_{\abs{S}\le k}\hat f(S)\,\chi_S(x)$ and $f_{>k}(x) = \sum_{\abs{S} > k}\hat f(S)\,\chi_S(x)$ are the low- and high-degree parts of $f$ at level $k$. That is, splitting the Fourier–Walsh expansion of $f$ into frequencies of degree at most $k$ and degree greater than $k$ recovers $f$ exactly.

Statement

set_option maxHeartbeats 800000 in
open scoped BigOperators in
open BooleanAnalysis in
variable {n : ℕ} in
open Classical in
lemma KKL.low_plus_high_eq (f : BooleanFunc n) (k : ℕ) (x : BoolCube n) :
    lowDegreePart f k x + highDegreePart f k x = f x
Source
TCSlib, `KKL.low_plus_high_eq`
Lean proof
By Mina, Owen McGinty, Hydroxyi (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 7
  • BooleanAnalysis.walsh_expansionWalsh–Fourier expansion of a Boolean function. Let $f:\{0,1\}^n\to\bbr$ be a Boolean function of arity $n$. Then at every point…
  • KKL.lowDegreePartThe low-degree part of $f$ at level $k$ keeps only the Fourier coefficients of degree at most $k$:…
  • BooleanAnalysis.fourierCoeffThe Fourier--Walsh coefficient of $f$ at frequency $S$ is…
  • BooleanAnalysis.BoolCubeThe Boolean hypercube of dimension $n$ is $\{0,1\}^n$, represented as the function type $\mathrm{Fin}\,n \to \mathrm{Bool}$.
  • KKL.highDegreePartThe high-degree part of $f$ at level $k$ keeps only the Fourier coefficients of degree strictly greater than $k$:…
  • BooleanAnalysis.chiSThe Walsh--Fourier character associated to $S\subseteq[n]$ is…
  • BooleanAnalysis.BooleanFuncA Boolean function of arity $n$ is a function $f : \{0,1\}^n \to \bbr$.
Used by 1
  • KKL.lowDegree_l2_error$L^2$ error of the low-degree truncation. Let $f : \{0,1\}^n \to \bbr$ be a Boolean function, and for a natural number $k$ let…

Lean source view module on GitHub

set_option maxHeartbeats 800000 inopen scoped BigOperators inopen BooleanAnalysis invariable {n : ℕ} inopen Classical inlemma KKL.low_plus_high_eq (f : BooleanFunc n) (k : ℕ) (x : BoolCube n) :    lowDegreePart f k x + highDegreePart f k x = f x := by  simp only [lowDegreePart, highDegreePart]  rw [← Finset.sum_add_distrib]  have : ∀ S ∈ (Finset.univ : Finset (Finset (Fin n))),      (if S.card ≤ k then fourierCoeff f S * chiS S x else 0) +      (if k < S.card then fourierCoeff f S * chiS S x else 0) =      fourierCoeff f S * chiS S x := by    intro S _    by_cases h : S.card ≤ k    · simp [h, Nat.not_lt.mpr h]    · simp [h, Nat.lt_of_not_le h]  rw [Finset.sum_congr rfl this]  exact (walsh_expansion f x).symm-- Step 07: The Fourier coefficient of lowDegreePart is the truncated coefficient.
See it in the graphDiscuss this resultChallenge it