Fourier analysis on the Boolean cube #
The character of a set S of coordinates is χ_S x = ∏_{i ∈ S} (-1) ^ (x i)
(BitString.chi), the sign of the parity of the bits of x : ι → Bool in S
(BitString.chi_eq_neg_one_pow_parityOn), with values in any commutative ring R; Fourier
analysis takes R = ℝ, where the sign of a bit is BitString.signVal. Bit strings add
coordinatewise modulo two, (x + y) i = (x i ^^ y i), through Mathlib's Boolean ring structure on
Bool, and the characters turn sums into products (BitString.chi_add): they are additive
characters of the cube (BitString.chiChar), whose sums are Mathlib's AddChar.sum_eq_ite. The
characters are orthonormal for the uniform expectation (BitString.expect_chi_mul_chi), and every
real function on the cube is the sum of its Fourier expansion f = ∑_S f̂(S) χ_S, with the
Fourier coefficients f̂(S) = 𝔼_x f x χ_S x (BitString.fourierCoeff,
BitString.sum_fourierCoeff_mul_chi), which are unique
(BitString.fourierCoeff_sum_mul_chi), so the Fourier transform is a linear equivalence
(BitString.fourierTransform). The expectation of a product is the sum of products of
coefficients (Plancherel, BitString.expect_mul_eq_sum_fourierCoeff_mul), so the squared
coefficients of a function with values ±1 sum to one (BitString.sum_fourierCoeff_sq_signVal).
For Boolean functions read as signs, correlation is one minus twice the relative Hamming distance
(BitString.expect_signVal_mul_signVal), so the coefficient on S measures the distance to the
parity on S (BitString.fourierCoeff_signVal) O'Donnell, Chapter 1.
The coefficients are named BitString.fourierCoeff; Mathlib's root fourierCoeff is the Fourier
coefficient on the circle, so the name is meant to be used qualified.
Main definitions #
Cslib.BitString.chi: the character of a set of coordinates, with values in a commutative ring, andCslib.BitString.chiCharthe same as an additive character.Cslib.BitString.fourierCoeff: the Fourier coefficient of a real function on the cube, andCslib.BitString.fourierCoeffₗthe same as a linear map.Cslib.BitString.fourierTransform: the Fourier transform, as a linear equivalence.
Main results #
Cslib.BitString.expect_chi_mul_chi: the characters are orthonormal.Cslib.BitString.chi_add,Cslib.BitString.chi_mul_chi: the characters are multiplicative, in the input and in the set.Cslib.BitString.sum_fourierCoeff_mul_chi: the Fourier expansion.Cslib.BitString.fourierCoeff_sum_mul_chi,Cslib.BitString.fourierCoeff_injective: uniqueness of the Fourier coefficients.Cslib.BitString.expect_mul_eq_sum_fourierCoeff_mul: Plancherel's identity.Cslib.BitString.sum_fourierCoeff_sq_signVal: Parseval's identity for functions with values±1; so their coefficients have square and absolute value at most one (Cslib.BitString.fourierCoeff_sq_signVal_le_one,Cslib.BitString.abs_fourierCoeff_signVal_le_one) and their spectral norm is at least one (Cslib.BitString.one_le_sum_abs_fourierCoeff_signVal).Cslib.BitString.expect_signVal_mul_signVal,Cslib.BitString.fourierCoeff_signVal: the correlation of two Boolean functions is one minus twice their relative Hamming distance.
References #
The character of a set S of coordinates, with values in a commutative ring R: the product
of the signs (-1) ^ xᵢ over S, the sign of the parity of the bits in S
(chi_eq_neg_one_pow_parityOn). The Fourier analysis of real functions uses chi ℝ.
Instances For
Changing a bit outside S leaves the character of S unchanged.
Setting a bit in S to b splits off the sign (-1) ^ b from the character of S.
The Fourier coefficient of f on S: the correlation of f with the character of S.
Instances For
The Fourier coefficient as a normalised sum.
The Fourier coefficients are additive.
The Fourier coefficients commute with subtraction.
The Fourier coefficients commute with scaling.
Multiplying by a character shifts the coefficients by the symmetric difference.
A constant has all its weight on the empty set.
A parity, read as ±1, is the character of its set, so all its weight is on that set.
The coefficient on the empty set is the expectation.
The Fourier expansion: every function is the sum of its characters weighted by its Fourier coefficients.
The Fourier coefficients are unique: a combination of characters has its weights as coefficients.
A function is determined by its Fourier coefficients.
The linear map fourierCoeffₗ S sends f to its Fourier coefficient on S.
The Fourier transform sends a function to its Fourier coefficients.
The inverse Fourier transform sends weights c to the combination ∑ S, c S * χ_S.
Plancherel's identity: the expectation of a product is the sum of the products of the Fourier coefficients.
Parseval's identity.
Parseval's identity for functions with values ±1: the squared Fourier coefficients sum
to one.
A Fourier coefficient of a Boolean function, read as signs, has square at most one.
A Fourier coefficient of a Boolean function, read as signs, has absolute value at most one.
A Boolean function, read as signs, has spectral norm ∑_S |f̂(S)| at least one.
Distance and correlation #
Correlation is one minus twice the distance: the correlation of two Boolean functions, read as signs, is one minus twice the fraction of the inputs on which they differ O'Donnell, Section 1.4.
The Fourier coefficient on S of a Boolean function read as signs is one minus twice the
relative Hamming distance from the function to the parity on S.
Character sums for the inner product #
Character orthogonality for the inner product, over any ring: the signs (-1) ^ (w ⬝ᵥ y)
cancel over all bit strings y unless w = 0, since flipping a bit i with w i = true
negates them. Over ℝ this is sum_chi for the set of positions where w is true.