TCSLib

74 Boolean Analysis — Bool BLR

74.1 Overview

This module develops the Blum–Luby–Rubinfeld (BLR) linearity test for Boolean functions \(f : \{ 0,1\} ^n \to \{ 0,1\} \). It establishes that a function is linear (i.e. satisfies \(f(x \oplus y) = f(x) \oplus f(y)\)) if and only if its \(\pm 1\) lift equals some Fourier character \(\chi _S\), and proves both completeness (a linear function passes BLR with probability \(1\)) and soundness (a function \(\varepsilon \)-far from every linear function passes BLR with probability at most \(1-\varepsilon \)), with the soundness bound derived via a Fourier-analytic argument using Parseval’s identity.

74.2 Declarations

Definition 74.1 Linearity of a Boolean function
#

A function \(f : \{ 0,1\} ^n \to \{ 0,1\} \) is linear if for all \(x, y \in \{ 0,1\} ^n\) we have

\[ f(x \oplus y) = f(x) \oplus f(y), \]

where \(\oplus \) denotes bitwise XOR (i.e. Bool.xor).

Definition 74.2 \(\pm 1\) lift of a Boolean function

Given \(f : \{ 0,1\} ^n \to \{ 0,1\} \), its \(\pm 1\) lift \(\texttt{BoolBLR.lift\_ pm1}\, f : \{ 0,1\} ^n \to \mathbb {R}\) is defined by \(x \mapsto (-1)^{f(x)}\), converting each Boolean output to a real sign via BoolToPM1.

Definition 74.3 Boolean distance
#

The distance between two Boolean functions \(f, g : \{ 0,1\} ^n \to \{ 0,1\} \) is

\[ \operatorname{dist}(f, g) \; =\; \Pr _{x \sim \{ 0,1\} ^n}[f(x) \ne g(x)], \]

computed as the uniform expectation of the indicator \(\mathbf{1}[f(x) \ne g(x)]\).

Definition 74.4 \(\varepsilon \)-far from linear

A function \(f : \{ 0,1\} ^n \to \{ 0,1\} \) is \(\varepsilon \)-far from linear if \(0 \le \varepsilon \le 1\) and for every linear function \(g : \{ 0,1\} ^n \to \{ 0,1\} \) we have \(\operatorname{dist}(f, g) \ge \varepsilon \).

A Boolean function \(f : \{ 0,1\} ^n \to \{ 0,1\} \) is linear if and only if there exists a set \(S \subseteq [n]\) such that the \(\pm 1\) lift \(\texttt{BoolBLR.lift\_ pm1}\, f\) equals the Fourier character \(\chi _S\).

Definition 74.6 BLR acceptance probability

The BLR acceptance probability of \(f : \{ 0,1\} ^n \to \{ 0,1\} \) is

\[ \Pr _{x,y}[\text{BLR accepts}] \; =\; \mathbb {E}_{x}\! \left[\mathbb {E}_{y}\! \left[ \mathbf{1}\! \left[ \texttt{BoolBLR.lift\_ pm1}\, f(x \oplus y) = \texttt{BoolBLR.lift\_ pm1}\, f(x)\cdot \texttt{BoolBLR.lift\_ pm1}\, f(y) \right] \right]\right], \]

where \(x, y\) are drawn uniformly from \(\{ 0,1\} ^n\).

Lemma 74.7 BLR acceptance in \(\pm 1\) form

For any \(f : \{ 0,1\} ^n \to \{ 0,1\} \),

\[ \Pr [\text{BLR accepts}] \; =\; \frac{1 + \mathbb {E}_x\! \left[\mathbb {E}_y\! \left[ \texttt{BoolBLR.lift\_ pm1}\, f(x)\cdot \texttt{BoolBLR.lift\_ pm1}\, f(y)\cdot \texttt{BoolBLR.lift\_ pm1}\, f(x \oplus y) \right]\right]}{2}. \]
Lemma 74.8 Triple expectation as convolution

For any \(f : \{ 0,1\} ^n \to \mathbb {R}\),

\[ \mathbb {E}_x\! \left[\mathbb {E}_y\! \left[f(x)\, f(y)\, f(x \oplus y)\right]\right] \; =\; \mathbb {E}_x\! \left[f(x)\cdot \mathbb {E}_y\! \left[f(y)\, f(x \oplus y)\right]\right]. \]
Lemma 74.9 Triple expectation equals sum of cubed Fourier coefficients

For any \(f : \{ 0,1\} ^n \to \{ 0,1\} \), letting \(\hat{g}(S)\) denote the Fourier coefficient of \(g = \texttt{BoolBLR.lift\_ pm1}\, f\),

\[ \mathbb {E}_x\! \left[\mathbb {E}_y\! \left[g(x)\, g(y)\, g(x \oplus y)\right]\right] \; =\; \sum _{S \subseteq [n]} \hat{g}(S)^3. \]

Let \(f, g : \{ 0,1\} ^n \to \{ 0,1\} \), let \(S \subseteq [n]\), and suppose \(\texttt{BoolBLR.lift\_ pm1}\, g = \chi _S\) and \(\operatorname{dist}(f, g) \ge \varepsilon \). Then the Fourier coefficient of \(\texttt{BoolBLR.lift\_ pm1}\, f\) at \(S\) satisfies \(\widehat{\texttt{BoolBLR.lift\_ pm1}\, f}(S) \le 1 - 2\varepsilon \).

Lemma 74.11 Fourier coefficient bound when \(\varepsilon \)-far from linear

If \(f : \{ 0,1\} ^n \to \{ 0,1\} \) is \(\varepsilon \)-far from linear, then for every \(S \subseteq [n]\),

\[ \widehat{\texttt{BoolBLR.lift\_ pm1}\, f}(S) \; \le \; 1 - 2\varepsilon . \]

If \(f : \{ 0,1\} ^n \to \{ 0,1\} \) is \(\varepsilon \)-far from linear, then the sum of cubed Fourier coefficients of \(\texttt{BoolBLR.lift\_ pm1}\, f\) satisfies

\[ \sum _{S \subseteq [n]} \widehat{\texttt{BoolBLR.lift\_ pm1}\, f}(S)^3 \; \le \; 1 - 2\varepsilon . \]

This follows by combining the per-coefficient bound \(\hat{f}(S) \le 1-2\varepsilon \) with the Parseval identity \(\sum _S \hat{f}(S)^2 = 1\).

If \(f : \{ 0,1\} ^n \to \{ 0,1\} \) is linear, then \(\texttt{BoolBLR.BLR\_ accept\_ prob}\, f = 1\); that is, the BLR test accepts every linear function with probability \(1\).

Lemma 74.14 BLR soundness

If \(f : \{ 0,1\} ^n \to \{ 0,1\} \) is \(\varepsilon \)-far from linear, then

\[ \texttt{BoolBLR.BLR\_ accept\_ prob}\, f \; \le \; 1 - \varepsilon . \]

That is, a function that is \(\varepsilon \)-far from every linear function causes the BLR test to reject with probability at least \(\varepsilon \).

74.3 Additional declarations

Lemma 74.15 Value of a linear function on an indicator vector

Let \(f : \{ 0,1\} ^n \to \{ 0,1\} \) be linear. Then for every \(s \subseteq [n]\), writing \(\mathbf{1}_s\) for the indicator vector of \(s\) and \(e_i\) for the \(i\)-th basis vector, the value \(f(\mathbf{1}_s)\) is false when

\[ \sum _{i \in s} \mathbf{1}[f(e_i) = \texttt{true}] \equiv 0 \pmod2 \]

and true otherwise; that is, \(f(\mathbf{1}_s)\) is the parity of the number of \(i \in s\) with \(f(e_i) = \texttt{true}\).

Lemma 74.16 Value of a linear function via its support

Specialization of the previous lemma to the support of an arbitrary point: if \(f : \{ 0,1\} ^n \to \{ 0,1\} \) is linear, then for every \(x \in \{ 0,1\} ^n\) the value \(f(x)\) is the parity of the number of coordinates \(i\) with \(x_i = \texttt{true}\) and \(f(e_i) = \texttt{true}\).

Lemma 74.17 Multiplicativity of the Fourier characters

For every \(S \subseteq [n]\) and all \(x, y \in \{ 0,1\} ^n\),

\[ \chi _S(x \oplus y) \; =\; \chi _S(x)\, \chi _S(y). \]
Lemma 74.18 \(\pm 1\) lift of a character is XOR-additive

Let \(f : \{ 0,1\} ^n \to \{ 0,1\} \) satisfy \(\texttt{BoolBLR.lift\_ pm1}\, f = \chi _S\) for some \(S \subseteq [n]\), and let \(x, y \in \{ 0,1\} ^n\). Assuming the multiplicativity identity \(\chi _S(x \oplus y) = \chi _S(x)\chi _S(y)\), one has

\[ (-1)^{f(x \oplus y)} \; =\; (-1)^{f(x) \oplus f(y)}. \]
Lemma 74.19 Value of a linear function via its support, restated

Restatement of the support formula in the exact form used inside the proof of the character criterion: for linear \(f\) and any \(x \in \{ 0,1\} ^n\), \(f(x)\) is the parity of the number of coordinates \(i\) with \(x_i = \texttt{true}\) and \(f(e_i) = \texttt{true}\).

Lemma 74.20 XOR-additivity of a function whose lift is a character

If \(\texttt{BoolBLR.lift\_ pm1}\, f = \chi _S\) for some \(S \subseteq [n]\), then for all \(x, y \in \{ 0,1\} ^n\),

\[ (-1)^{f(x \oplus y)} \; =\; (-1)^{f(x) \oplus f(y)}. \]

This is the previous lemma with the multiplicativity hypothesis discharged.

Lemma 74.21 Pointwise \(\pm 1\) form of the BLR indicator

Write \(g = \texttt{BoolBLR.lift\_ pm1}\, f\). For all \(x, y \in \{ 0,1\} ^n\),

\[ \mathbf{1}\! \left[g(x \oplus y) = g(x)\, g(y)\right] \; =\; \frac{1 + g(x)\, g(y)\, g(x \oplus y)}{2}. \]

Write \(g = \texttt{BoolBLR.lift\_ pm1}\, f\). For every \(x \in \{ 0,1\} ^n\),

\[ (g * g)(x) \; =\; \sum _{S \subseteq [n]} \hat{g}(S)^2\, \chi _S(x), \]

i.e. the self-convolution of \(g\) has Fourier coefficients \(\hat{g}(S)^2\).

Lemma 74.23 Substituting the convolution expansion into the expectation

Write \(g = \texttt{BoolBLR.lift\_ pm1}\, f\) and assume \((g * g)(x) = \sum _S \hat{g}(S)^2 \chi _S(x)\) for all \(x\). Then

\[ \mathbb {E}_x\! \left[g(x)\, (g * g)(x)\right] \; =\; \sum _{S \subseteq [n]} \hat{g}(S)^2\, \mathbb {E}_x\! \left[g(x)\, \chi _S(x)\right]. \]
Lemma 74.24 Product of \(\pm 1\) lifts as a disagreement indicator

For all \(f, g : \{ 0,1\} ^n \to \{ 0,1\} \) and every \(x \in \{ 0,1\} ^n\),

\[ (-1)^{f(x)}\, (-1)^{g(x)} \; =\; 1 - 2\cdot \mathbf{1}\! \left[f(x) \ne g(x)\right]. \]

For every \(f : \{ 0,1\} ^n \to \{ 0,1\} \), the \(\pm 1\) lift \(g = \texttt{BoolBLR.lift\_ pm1}\, f\) has unit Fourier mass:

\[ \sum _{S \subseteq [n]} \hat{g}(S)^2 \; =\; 1. \]
Lemma 74.26 Per-coefficient cube bound for \(\varepsilon \)-far functions

Let \(f : \{ 0,1\} ^n \to \{ 0,1\} \) be \(\varepsilon \)-far from linear and write \(g = \texttt{BoolBLR.lift\_ pm1}\, f\). Then for every \(S \subseteq [n]\),

\[ \hat{g}(S)^3 \; \le \; \hat{g}(S)^2\, (1 - 2\varepsilon ). \]
Lemma 74.27 Unfolded form of Boolean linearity

If \(f : \{ 0,1\} ^n \to \{ 0,1\} \) is linear, then \(f(x \oplus y) = f(x) \oplus f(y)\) for all \(x, y \in \{ 0,1\} ^n\).

Lemma 74.28 Multiplicativity of the lift of a linear function

Let \(f : \{ 0,1\} ^n \to \{ 0,1\} \) satisfy \(f(x \oplus y) = f(x) \oplus f(y)\) for all \(x, y\), and write \(g = \texttt{BoolBLR.lift\_ pm1}\, f\). Then \(g\) is multiplicative on XOR:

\[ g(x \oplus y) \; =\; g(x)\, g(y) \qquad \text{for all } x, y \in \{ 0,1\} ^n. \]