AFTD Auto-Formalizing Theoretical Domains

BoolFourier.fourier_coeff_convolution_aux_h_char

theoremverifiedimported Lean

Shift rule for character-weighted sums. Let $f, g : \{0,1\}^n \to \bbr$ be Boolean functions, let $S \subseteq [n]$, and write $\chi_S(x) = \prod_{i \in S}(-1)^{x_i}$ for the associated Walsh character, where $\oplus$ denotes componentwise XOR. Suppose the order of summation may be interchanged in the double sum \[ \sum_{x}\Big(\sum_{y} f(y)\,g(x \oplus y)\Big)\chi_S(x) \;=\; \sum_{y} f(y)\sum_{x} g(x \oplus y)\,\chi_S(x). \] Then for every $y \in \{0,1\}^n$, translating the argument of $g$ by $y$ multiplies the character-weighted sum by the factor $\chi_S(y)$: \[ \sum_{x} g(x \oplus y)\,\chi_S(x) \;=\; \chi_S(y)\sum_{x} g(x)\,\chi_S(x). \]

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open Finset BooleanAnalysis in
lemma BoolFourier.fourier_coeff_convolution_aux_h_char {n : Nat} (f g : BoolFun n) (S : Finset (Fin n))
  (h_fubini : ∑ x, (∑ y, f y * g (xor_vec x y)) * char_S S x = ∑ y, f y * ∑ x, g (xor_vec x y) * char_S S x)
  (y : hypercube n) : ∑ x, g (xor_vec x y) * char_S S x = char_S S y * ∑ x, g x * char_S S x
Source
TCSlib, `BoolFourier.fourier_coeff_convolution_aux_h_char`
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
Classical.choiceQuot.soundpropext
Built on 5
  • BoolFourier.char_SFor a set $S \subseteq [n]$, the Walsh character $\chi_S : \{0,1\}^n \to \mathbb{R}$ is \[ \chi_S(x) = \prod_{i \in S} (-1)^{x_i}, \]…
  • BoolFourier.xor_vecFor $x, y \in \{0,1\}^n$, the vector $\mathrm{xor\_vec}(x,y)_i = x_i \oplus y_i$ is the componentwise XOR, giving the group operation on…
  • BoolFourier.hypercubeThe Boolean hypercube of dimension $n$ is the type $\{0,1\}^n$, defined as an abbreviation for BooleanAnalysis.BoolCube $n$.
  • BoolFourier.fourier_coeff_convolution_aux_h_splitMultiplicative splitting of a Walsh character along XOR. Let $S \subseteq [n]$, let $f, g : \{0,1\}^n \to \bbr$ be Boolean functions, and…
  • 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 1

Lean source view module on GitHub

set_option relaxedAutoImplicit false inset_option autoImplicit false inopen Finset BooleanAnalysis inlemma BoolFourier.fourier_coeff_convolution_aux_h_char {n : Nat} (f g : BoolFun n) (S : Finset (Fin n))  (h_fubini : ∑ x, (∑ y, f y * g (xor_vec x y)) * char_S S x = ∑ y, f y * ∑ x, g (xor_vec x y) * char_S S x)  (y : hypercube n) : ∑ x, g (xor_vec x y) * char_S S x = char_S S y * ∑ x, g x * char_S S x := by  rw [Finset.mul_sum _ _ _]  apply Finset.sum_bij (fun x _ => xor_vec x y)  · exact fun _ _ => Finset.mem_univ _  · unfold xor_vec; simp +decide    exact fun a₁ a₂ h => funext fun i => by      by_cases hi : y i <;> simpa [hi] using (congr_fun h i)  · intro b _    exact ⟨xor_vec b y, Finset.mem_univ _,           funext fun i => by simp [xor_vec]⟩  · exact fun x _ => by rw [(fourier_coeff_convolution_aux_h_split f g S h_fubini y) x]; ring
See it in the graphDiscuss this resultChallenge it