TCSLib

77 Boolean Analysis — Zk BLR

77.1 Overview

This module formalizes the Blum–Luby–Rubinfeld (BLR) linearity test over \(\mathbb {Z}_k^n\). A function \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is linear if \(f(x+y)=f(x)+f(y)\) for all \(x,y\), or equivalently if it is a dot-product character \(x \mapsto s \cdot x\) for some coefficient vector \(s\). The module proves completeness (linear functions are always accepted) and soundness bounds: if \(f\) is \(\varepsilon \)-far from every linear function, the acceptance probability is at most \(1 - \tfrac {\varphi (k)}{k}(1-\cos (2\pi /k))\varepsilon \), specialising for prime \(p\) to \(1 - \tfrac {p-1}{p}(1-\cos (2\pi /p))\varepsilon \).

77.2 Declarations

Definition 77.1 Linearity predicate
#

A function \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is linear if \(f(x+y) = f(x)+f(y)\) for all \(x, y \in \mathbb {Z}_k^n\).

Definition 77.2 Lift to roots of unity

Given \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\), the lifted function \(\widetilde{f} : \mathbb {Z}_k^n \to \mathbb {C}\) is defined by \(\widetilde{f}(x) = \omega _k^{f(x)}\), where \(\omega _k = e^{2\pi i/k}\).

Definition 77.3 Hamming distance between functions
#

The distance between \(f, g : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is the fraction of inputs on which they disagree:

\[ \mathrm{dist}(f,g) \; =\; \Pr _{x}[f(x) \ne g(x)] \; =\; \frac{1}{k^n}\# \{ x : f(x)\ne g(x)\} . \]
Definition 77.4 \(\varepsilon \)-far from linear

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

Lemma 77.5 Linear iff dot-product character

A function \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is linear if and only if there exists \(s \in \mathbb {Z}_k^n\) such that \(f(x) = s \cdot x\) for all \(x\), where \(s \cdot x = \sum _i s_i x_i\) denotes the dot product in \(\mathbb {Z}_k\).

Definition 77.6 Canonical linear character
#

For \(s \in \mathbb {Z}_k^n\), the linear character \(\chi _s : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is the dot-product function \(\chi _s(x) = s \cdot x\).

Definition 77.7 Normalized function
#

A function \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is normalized if \(f(0) = 0\). Every linear function is automatically normalized.

Definition 77.8 Normalization operator
#

The normalization of \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is the function \((\mathrm{normalize}\, f)(x) = f(x) - f(0)\), which satisfies \((\mathrm{normalize}\, f)(0) = 0\).

Lemma 77.9 Normalization vanishes at origin
#

For any \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\), \((\mathrm{normalize}\, f)(0) = 0\).

Lemma 77.10 Linear functions are normalized

If \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is linear, then \(f(0) = 0\), i.e. \(f\) is normalized.

Definition 77.11 \(\varepsilon \)-far from linear, normalized version

A function \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) satisfies ZkBLR.epsilon_far_from_linear_normalized with parameter \(\varepsilon \) if \(f\) is normalized (\(f(0)=0\)), \(0\le \varepsilon \le 1\), and \(\mathrm{dist}(f,g)\ge \varepsilon \) for every linear \(g\).

Lemma 77.12 Real part of root of unity bounded by \(\cos (2\pi /k)\)

For \(k \ge 2\) and any nonzero \(a \in \mathbb {Z}_k\), \(\operatorname {Re}(\omega _k^a) \le \cos (2\pi /k)\).

For \(k \ge 2\) and \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\), the real part of the \(s\)-th Fourier coefficient of the lifted function \(\widetilde{f}\) satisfies

\[ \operatorname {Re}\bigl[\widehat{\widetilde{f}}(s)\bigr] \; \le \; 1 - \bigl(1 - \cos (2\pi /k)\bigr)\cdot \mathrm{dist}(f,\chi _s). \]
Lemma 77.14 Fourier bound from \(\varepsilon \)-far hypothesis

If \(k \ge 2\) and \(f\) is \(\varepsilon \)-far from linear (in the normalized sense), then for every \(s \in \mathbb {Z}_k^n\),

\[ \operatorname {Re}\bigl[\widehat{\widetilde{f}}(s)\bigr] \; \le \; 1 - \bigl(1-\cos (2\pi /k)\bigr)\varepsilon . \]
Definition 77.15 \(j\)-twisted lift to roots of unity

For \(j \in \mathbb {Z}_k\), the \(j\)-twisted lift of \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is \(\widetilde{f}_j(x) = \omega _k^{j \cdot f(x)}\). The case \(j=1\) recovers ZkBLR.lift_omega; the case \(j=0\) gives the constant function \(1\).

Definition 77.16 BLR acceptance probability
#

The BLR acceptance probability of \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is

\[ \Pr _{x,y}\bigl[f(x+y) = f(x)+f(y)\bigr] \; =\; \frac{1}{k^{2n}} \sum _{x,y\in \mathbb {Z}_k^n} \mathbf{1}\bigl[f(x+y)=f(x)+f(y)\bigr]. \]
Lemma 77.17 BLR completeness

If \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is linear, then \(\Pr [{\rm BLR\ accepts}\ f] = 1\).

Lemma 77.18 Geometric sum of twisted roots of unity
#

For any \(a \in \mathbb {Z}_k\),

\[ \sum _{j \in \mathbb {Z}_k} \omega _k^{ja} \; =\; \begin{cases} k & \text{if } a = 0, \\ 0 & \text{otherwise.} \end{cases} \]
Lemma 77.19 Indicator as character sum

For any \(a \in \mathbb {Z}_k\),

\[ \mathbf{1}[a=0] \; =\; \frac{1}{k}\, \operatorname {Re}\! \left[\sum _{j\in \mathbb {Z}_k}\omega _k^{ja}\right]. \]
Lemma 77.20 Parseval identity for \(j\)-twisted lift

For any \(j \in \mathbb {Z}_k\) and \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\),

\[ \sum _{s \in \mathbb {Z}_k^n} \bigl\| \widehat{(\widetilde{f}_j)}(s)\bigr\| ^2 = 1. \]

For \(j \in \mathbb {Z}_k\) and \(F = \widetilde{f}_j\), the triple-product expectation satisfies

\[ \mathbb {E}_x\! \left[\mathbb {E}_y\! \left[ F(x{+}y)\, \overline{F(x)}\, \overline{F(y)} \right]\right] = \sum _{s\in \mathbb {Z}_k^n} \| \widehat{F}(s)\| ^2\, \overline{\widehat{F}(s)}. \]

The BLR acceptance probability admits the Fourier representation

\[ \Pr [{\rm accept}] = \frac{1}{k} \sum _{j\in \mathbb {Z}_k} \sum _{s\in \mathbb {Z}_k^n} \bigl\| \widehat{(\widetilde{f}_j)}(s)\bigr\| ^2 \operatorname {Re}\! \left[\widehat{(\widetilde{f}_j)}(s)\right]. \]

For any \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\), the \(j=0\) term of the Fourier sum evaluates to \(1\):

\[ \sum _{s\in \mathbb {Z}_k^n} \bigl\| \widehat{(\widetilde{f}_0)}(s)\bigr\| ^2\, \operatorname {Re}\! \left[\widehat{(\widetilde{f}_0)}(s)\right] = 1. \]
Lemma 77.24 Weighted Fourier sum at most one

For any \(j \in \mathbb {Z}_k\) and \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\),

\[ \sum _{s\in \mathbb {Z}_k^n} \bigl\| \widehat{(\widetilde{f}_j)}(s)\bigr\| ^2\, \operatorname {Re}\! \left[\widehat{(\widetilde{f}_j)}(s)\right] \; \le \; 1. \]
Lemma 77.25 Cube-sum bounded by max times square-sum

If \(\| \widehat{\widetilde{f}}(s)\| \le A\) for all \(s \in \mathbb {Z}_p^n\), then

\[ \sum _{s\in \mathbb {Z}_p^n} \bigl\| \widehat{\widetilde{f}}(s)\bigr\| ^3 \; \le \; A \cdot \sum _{s\in \mathbb {Z}_p^n} \bigl\| \widehat{\widetilde{f}}(s)\bigr\| ^2. \]
Lemma 77.26 Parseval identity for lift_omega

For \(f : \mathbb {Z}_p^n \to \mathbb {Z}_p\),

\[ \sum _{s\in \mathbb {Z}_p^n} \bigl\| \widehat{\widetilde{f}}(s)\bigr\| ^2 = 1. \]
Lemma 77.27 Weighted Fourier sum bounded by \(\varepsilon \)-far condition

If \(f : \mathbb {Z}_p^n \to \mathbb {Z}_p\) is \(\varepsilon \)-far from linear (normalized), then

\[ \sum _{s\in \mathbb {Z}_p^n} \bigl\| \widehat{\widetilde{f}}(s)\bigr\| ^2\, \operatorname {Re}\! \left[\widehat{\widetilde{f}}(s)\right] \; \le \; 1 - \bigl(1-\cos (2\pi /p)\bigr)\varepsilon . \]
Lemma 77.28 Fourier coefficient real-part bound for \(j\)-twisted lift

If \(f : \mathbb {Z}_p^n \to \mathbb {Z}_p\) is \(\varepsilon \)-far from linear (normalized), \(j \ne 0\), and \(s \in \mathbb {Z}_p^n\), then

\[ \operatorname {Re}\! \left[\widehat{(\widetilde{f}_j)}(s)\right] \; \le \; 1 - \bigl(1-\cos (2\pi /p)\bigr)\varepsilon . \]
Lemma 77.29 Weighted sum bound for \(j\)-twisted lift

If \(f : \mathbb {Z}_p^n \to \mathbb {Z}_p\) is \(\varepsilon \)-far from linear (normalized) and \(j \ne 0\), then

\[ \sum _{s\in \mathbb {Z}_p^n} \bigl\| \widehat{(\widetilde{f}_j)}(s)\bigr\| ^2\, \operatorname {Re}\! \left[\widehat{(\widetilde{f}_j)}(s)\right] \; \le \; 1 - \bigl(1-\cos (2\pi /p)\bigr)\varepsilon . \]
Lemma 77.30 BLR soundness for prime fields

If \(f : \mathbb {Z}_p^n \to \mathbb {Z}_p\) is \(\varepsilon \)-far from linear (normalized), then

\[ \Pr [{\rm BLR\ accepts}\ f] \; \le \; 1 - \frac{p-1}{p}\bigl(1-\cos (2\pi /p)\bigr)\varepsilon . \]
Lemma 77.31 \(\varepsilon \)-farness preserved under unit scaling

If \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is \(\varepsilon \)-far from linear (normalized) and \(j \in \mathbb {Z}_k^\times \) is a unit, then the scaled function \(x \mapsto j \cdot f(x)\) is also \(\varepsilon \)-far from linear (normalized).

Lemma 77.32 Real-part bound for unit-twisted lift

If \(k \ge 2\), \(f\) is \(\varepsilon \)-far from linear (normalized), \(j \in \mathbb {Z}_k^\times \), and \(s \in \mathbb {Z}_k^n\), then

\[ \operatorname {Re}\! \left[\widehat{(\widetilde{f}_j)}(s)\right] \; \le \; 1 - \bigl(1-\cos (2\pi /k)\bigr)\varepsilon . \]
Lemma 77.33 Weighted sum bound for unit-twisted lift

If \(k \ge 2\), \(f\) is \(\varepsilon \)-far from linear (normalized), and \(j \in \mathbb {Z}_k^\times \), then

\[ \sum _{s\in \mathbb {Z}_k^n} \bigl\| \widehat{(\widetilde{f}_j)}(s)\bigr\| ^2\, \operatorname {Re}\! \left[\widehat{(\widetilde{f}_j)}(s)\right] \; \le \; 1 - \bigl(1-\cos (2\pi /k)\bigr)\varepsilon . \]

For \(k \ge 2\), if \(f : \mathbb {Z}_k^n \to \mathbb {Z}_k\) is \(\varepsilon \)-far from linear (normalized), then

\[ \Pr [{\rm BLR\ accepts}\ f] \; \le \; 1 - \frac{\varphi (k)}{k}\bigl(1-\cos (2\pi /k)\bigr)\varepsilon , \]

where \(\varphi (k)\) denotes Euler’s totient function.

Lemma 77.35 BLR soundness for prime modulus

If \(p\) is prime and \(f : \mathbb {Z}_p^n \to \mathbb {Z}_p\) is \(\varepsilon \)-far from linear (normalized), then

\[ \Pr [{\rm BLR\ accepts}\ f] \; \le \; 1 - \frac{p-1}{p}\bigl(1-\cos (2\pi /p)\bigr)\varepsilon , \]

recovering the prime-field soundness bound as a corollary of the general result (using \(\varphi (p)=p-1\)).