AFTD Auto-Formalizing Theoretical Domains

BoolFourier.L2_norm_sq

defimported Lean

The squared $L^2$ norm of $f : \{0,1\}^n \to \mathbb{R}$ is \[ \|f\|_2^2 = \mathbb{E}[f^2] = \frac{1}{2^n}\sum_{x} f(x)^2. \]

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open Finset BooleanAnalysis in
noncomputable def BoolFourier.L2_norm_sq {n : ℕ} (f : BoolFun n) : ℝ
Defined in
TCSlib, `BoolFourier.L2_norm_sq`
Lean proof
By Prastik Mohanraj, from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Copyright (c) 2026 Prastik Mohanraj. All rights reserved, 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
  • BoolFourier.expectationFor $f : \{0,1\}^n \to \mathbb{R}$, the uniform expectation is \[ \mathbb{E}[f] = \frac{1}{2^n} \sum_{x \in \{0,1\}^n} f(x). \]
  • BoolFourier.BoolFunA Boolean function of arity $n$ is an element of type $\{0,1\}^n \to \mathbb{R}$, defined as an abbreviation for…
Used by 3

Lean source view module on GitHub

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open Finset BooleanAnalysis in
/-- Defines the squared `L²` norm on the Boolean cube. **Source:** [OD14, §1.3]. -/
noncomputable def BoolFourier.L2_norm_sq {n : ℕ} (f : BoolFun n) : ℝ :=
  expectation (fun x => f x ^ 2)
See it in the graphDiscuss this resultChallenge it