The Fourier spectrum of the inner product modulo two #
The sign of the inner product of two n-bit strings has every Fourier coefficient equal to
±2⁻ⁿ: it is a bent function. Here the two strings are the two halves of one 2n-bit input,
using BitString.fstBits, BitString.sndBits, and the Boolean-ring inner product ⬝ᵥ.
The sign of the coefficient at a Fourier mask is the inner product of the mask's two halves.
Plancherel's identity then bounds correlation with an arbitrary real function g by 2⁻ⁿ times
the spectral norm of g. Keeping the products on a set S of coordinate pairs gives correlation
exactly 2 ^ |S| / 2 ^ n with the full inner product. In particular, this includes the empty set
and all coordinate pairs. The formulas are proved directly in the library's existing Fourier
normalization.
Main results #
Cslib.BitString.fourierCoeff_signVal_dotProduct_fstBits_sndBits: the exact spectrum.Cslib.BitString.abs_fourierCoeff_signVal_dotProduct_fstBits_sndBits: flatness of the spectrum.Cslib.BitString.abs_expect_signVal_dotProduct_mul_le: correlation is bounded by the spectral norm divided by2 ^ n.Cslib.BitString.expect_signVal_dotProduct_mul_signVal_sum: the exact correlation obtained by keeping an arbitrary set of coordinate pairs.
The Fourier coefficient of the sign of the inner product is 2⁻ⁿ, with sign given by the
inner product of the Fourier mask's two halves.
All Fourier coefficients of the sign of the n-pair inner product have magnitude 2⁻ⁿ.
The case n = 0 is included.
Correlation with the inner product is at most the spectral norm divided by 2 ^ n.
This applies to arbitrary real functions, with no boundedness assumption.
Keeping the products on S gives correlation exactly 2 ^ |S| / 2 ^ n with the full
inner product. In particular, retaining no pairs gives 2⁻ⁿ and retaining every pair gives one.