AFTD Auto-Formalizing Theoretical Domains

KKL.l2DistSq

defimported Lean

The squared $L^2$ distance between two Boolean functions is $\E\big[(f(x) - g(x))^2\big]$ under the uniform measure on the cube.

Statement

set_option maxHeartbeats 800000 in
open scoped BigOperators in
open BooleanAnalysis in
variable {n : ℕ} in
open Classical in
noncomputable def KKL.l2DistSq (f g : BooleanFunc n) : ℝ
Defined in
TCSlib, `KKL.l2DistSq`
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
none listed
Built on 2
Used by 4
  • 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…
  • 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…
  • 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.lowDegree_approxLow-degree approximation error bound. Let $f\colon\{0,1\}^n\to\bbr$ be a Boolean function and let $k\ge 1$ be an integer. Writing…

Lean source view module on GitHub

set_option maxHeartbeats 800000 in
open scoped BigOperators in
open BooleanAnalysis in
variable {n : ℕ} in
open Classical in
/-- Defines the squared `L²` distance between two Boolean functions. **Source:** [OD14, Ch. 10]. -/
noncomputable def KKL.l2DistSq (f g : BooleanFunc n) : ℝ :=
  expect (fun x => (f x - g x) ^ 2)
See it in the graphDiscuss this resultChallenge it