Pseudorandomness via the discrete Fourier transform

Parikshit Gopalan, Daniel Kane, Raghu Meka

Introduction

A central goal of computational complexity is to understand the power that randomness adds to efficient computation. The main questions in this area are whether BPP=P{\mathsf{BPP}}={\mathsf{P}} and RL=L{\mathsf{RL}}={\mathsf{L}}, which respectively assert that randomness can be eliminated from efficient computation, at the price of a polynomial slowdown in time, and a constant blowup in space. It is known that proving BPP=P{\mathsf{BPP}}={\mathsf{P}} will imply strong circuit lower bounds that seem out of reach of current techniques. In contrast, proving RL=L{\mathsf{RL}}={\mathsf{L}}, could well be within reach. Indeed, bounded-space algorithms are a natural computational model for which we know how to construct strong pseudo-random generators, PRG{\mathsf{PRG}}s, unconditionally.

Let RL{\mathsf{RL}} denote the class of randomized algorithms with O(log⁡n)O(\log n) work space which can access the random bits in a read-once pre-specified order. Nisan [Nis92] devised a PRG{\mathsf{PRG}} of seed length O(log⁡2(n/ε))O(\log^{2}(n/\varepsilon)) that fools RL{\mathsf{RL}} with error ε\varepsilon. This generator was subsequently used by Nisan [Nis94] to show that RL⊆SC{\mathsf{RL}}\subseteq\mathsf{SC} and by Saks and Zhou [SZ99] to prove that RL{\mathsf{RL}} can be simulated in space O(log⁡3/2n)O(\log^{3/2}n). Constructing PRG{\mathsf{PRG}}s with the optimal O(log⁡(n/ε))O(\log(n/\varepsilon)) seed length for this class and showing that RL=L{\mathsf{RL}}={\mathsf{L}} is arguably the outstanding open problem in derandomization (which might not require a breakthrough in lower bounds). Despite much progress in this area [INW94, NZ96, RR99, Rei08, RTV06, BRRY14, BV10, KNP11, De11, GMR+12], there are few cases where we can improve on Nisan’s twenty year old bound of O(log⁡2(n/ε))O(\log^{2}(n/\varepsilon)) [Nis92].

We motivate the problem of constructing PRG{\mathsf{PRG}}s for Fourier shapes by discussing how they capture a variety of well-studied classes like halfspaces (over general domains), combinatorial rectangles, modular tests and combinatorial shapes.

Halfspaces are functions h:{0,1}n→{0,1}h:\{0,1\}^{n}\to\{0,1\} that can be represented as

We show that a PRG{\mathsf{PRG}} for (2,n)(2,n)-Fourier shapes with error ε/n2\varepsilon/n^{2} also fools halfspaces with error ε\varepsilon. In particular, PRG{\mathsf{PRG}}s fooling Fourier shapes with polynomially small error also fool halfspaces with small error.

PRG{\mathsf{PRG}}s for (m,n)(m,n)-Fourier shapes give us PRG{\mathsf{PRG}}s for halfspaces not just for the uniform distribution over the hypercube, but for a large class of distributions that have been studied in the literature. We can derive these results in a unified manner by considering the class of generalized halfspaces.

A generalized halfspace over [m]n[m]^{n} is a function g:[m]n→{0,1}g:[m]^{n}\to\{0,1\} that can be represented as

A consequence of fooling generalized halfspaces is to derandomize Chernoff-Hoeffding type bounds for sums of independent random variables which are ubiquitous in the analysis of randomized algorithms. We state our result in the language of “randomness-efficient samplers” (cf. [Zuc97]). Let X1,…,XnX_{1},\ldots,X_{n} be independent random variables over a domain [m][m] and let g1,…,gn:[m]→g_{1},\ldots,g_{n}:[m]\to be arbitrary bounded functions. The classical Chernoff-Hoeffding bounds [Hoe63] say that

Combinatorial shapes were introduced in the work of [GMRZ13] as a generalization of combinatorial rectangles and to address fooling linear sums in statistical distance. These are functions f:[m]n→{0,1}f:[m]^{n}\to\{0,1\} of the form

for functions gi:[m]→{0,1}g_{i}:[m]\to\{0,1\} and a function h:{0,…,n}→{0,1}h:\{0,\ldots,n\}\to\{0,1\}. The best previous generators of [GMRZ13] and [De14] for combinatorial shapes achieve a seed-length of O(log⁡(mn)+log⁡2(1/ε))O(\log(mn)+\log^{2}(1/\varepsilon)), O(log⁡m+log⁡(n/ε)3/2)O(\log m+\log(n/\varepsilon)^{3/2}); in particular, the best previous seed-length for polynomially small error was O(log⁡3/2(n))O(\log^{3/2}(n)). PRG{\mathsf{PRG}}s for (m,n)(m,n)-Fourier shapes with error ε/n\varepsilon/n imply PRG{\mathsf{PRG}}s for combinatorial shapes.

Combinatorial rectangles are a well-studied subset of combinatorial shapes [EGL+98, ASWZ96, LLSZ97, Lu02]. They are functions that can be written as f(x)=∏j\mathds1(xj∈Aj)f(x)=\prod_{j}\mathds{1}(x_{j}\in A_{j}) for some arbitrary subsets Aj⊆[m]A_{j}\subseteq[m]. The best known PRG{\mathsf{PRG}} due to [GMR+12, GY14] gives a seed-length of O(log⁡(mn/ε)log⁡log⁡(mn/ε))O(\log(mn/\varepsilon)\log\log(mn/\varepsilon)). Combinatorial rectangles are special cases of Fourier shapes so our PRG{\mathsf{PRG}} for (m,n)(m,n)-Fourier shapes also fools combinatorial rectangles, but requires a slightly longer seed. The alphabet-reduction step in our construction is inspired by the generator of [GMR+12, GY14].

1.2 Achieving optimal error dependence via Fourier shapes.

We briefly explain why previous techniques based on limit theorems were unable to achieve polynomially small error with optimal seed-length, by considering the setting of halfspaces under the uniform distribution on {0,1}n\{0,1\}^{n}. Fooling halfspaces is equivalent to fooling all linear functions L(x)=∑iwixiL(x)=\sum_{i}w_{i}x_{i} in Kolmogorov or cdf distance. Previous work on fooling halfspaces [DGJ+09, MZ13] relies on the Berry-Esséen theorem, a quantiative form of the central limit theorem, to show that the cdf of regular linear functions is close to that of the Gaussian distribution, both under the uniform distribution and under the pseudorandom distribution. However, even for the majority function (which is the most regular linear function), the discreteness of ∑ixi\sum_{i}x_{i} means that the Kolmogorov distance from the Gaussian distribution is 1/n1/\sqrt{n}, even when xx is uniformly random. Approaches that show closeness in cdf distance by comparison to the Gaussian distribution seem unlikely to give polynomially small error with optimal seed-length.

We depart from the derandomized limit theorem approach taken by several previous works [DGJ+09, DKN10, GOWZ10, HKM12, GMRZ13, MZ13] and work directly with the Fourier transform. A crucial insight (that is formalized in Lemma 9.2) is that fooling the Fourier transform of linear forms to within polynomially small error implies polynomially small Kolmogorov distance.

2 Our results

There is an explicit generator G:{0,1}r→[m]n\mathcal{G}:\{0,1\}^{r}\to[m]^{n} that fools all (m,n)(m,n)-Fourier shapes with error ε\varepsilon, and has seed-length r=O(log⁡(mn/ε)⋅(log⁡log⁡(mn/ε))2)r=O(\log(mn/\varepsilon)\cdot(\log\log(mn/\varepsilon))^{2}).

We now state various corollaries of our main result starting with fooling halfspaces.

There is an explicit generator G:{0,1}r→{0,1}n\mathcal{G}:\{0,1\}^{r}\to\{0,1\}^{n} that fools halfspaces over {0,1}n\{0,1\}^{n} under the uniform distribution with error ε\varepsilon, and has seed-length r=O(log⁡(n/ε)(log⁡log⁡(n/ε))2)r=O(\log(n/\varepsilon)(\log\log(n/\varepsilon))^{2}).

The best previous generator due to [MZ13] had a seed-length of O(log⁡n+log⁡2(1/ε))O(\log n+\log^{2}(1/\varepsilon)), which is O(log⁡2n)O(\log^{2}n) for polynomially small error ε\varepsilon.

We also get a PRG{\mathsf{PRG}} with similar parameters for generalized halfspaces.

There is an explicit generator G:{0,1}r→[m]n\mathcal{G}:\{0,1\}^{r}\to[m]^{n} that ε\varepsilon-fools generalized halfspaces over [m]n[m]^{n}, and has seed-length r=O(log⁡(mn/ε)⋅(log⁡log⁡(mn/ε))2)r=O(\log(mn/\varepsilon)\cdot(\log\log(mn/\varepsilon))^{2}).

The generator GG has seed-length r=O(log⁡(nC/ε)(log⁡log⁡(nC/ε))2)r=O(\log(nC/\varepsilon)(\log\log(nC/\varepsilon))^{2}).

This improves on the result of [GOWZ10] who obtained seedlength O(log⁡(nC/ε)log⁡(C/ε)O(\log(nC/\varepsilon)\log(C/\varepsilon) for this setting via a suitable modification of the generator from [MZ13].

The next corollary is a near-optimal derandomization of the Chernoff-Hoeffding bounds. To get a similar guarantee, the best known seed-length that follows from previous work [SSS95, MZ13, GOWZ10] was O(log⁡(mn)+log⁡2(1/ε))O(\log(mn)+\log^{2}(1/\varepsilon)).

Let X1,…,XnX_{1},\ldots,X_{n} be independent random variables over the domain [m][m]. Let g1,…,gn:[m]→g_{1},\ldots,g_{n}:[m]\to be arbitrary bounded functions. There exists an explicit generator G:{0,1}r→[m]nG:\{0,1\}^{r}\to[m]^{n} such that if (Y1,…,Yn)=G(z)(Y_{1},\ldots,Y_{n})=G(z) where z∈u{0,1}rz\in_{u}\{0,1\}^{r}, then YiY_{i} is distributed identically to XiX_{i} and

GG has seed-length r=O(log⁡(mn/ε)(log⁡log⁡(mn/ε))2)r=O(\log(mn/\varepsilon)(\log\log(mn/\varepsilon))^{2}).

There is an explicit generator G:{0,1}r→{0,1}n\mathcal{G}:\{0,1\}^{r}\to\{0,1\}^{n} that fools all linear tests modulo mm for all m≤Mm\leq M with error ε\varepsilon, and has seed-length r=O(log⁡(Mn/ε)⋅(log⁡log⁡(Mn/ε))2)r=O(\log(Mn/\varepsilon)\cdot(\log\log(Mn/\varepsilon))^{2}).

Finally, we get a generator with near-logarithmic seedlength for fooling combinatorial shapes. [GMRZ13] gave a PRG{\mathsf{PRG}} for combinatorial shapes with a seed-length of O(log⁡(mn)+log⁡2(1/ε))O(\log(mn)+\log^{2}(1/\varepsilon)). This was improved recently by De [De14] who gave a PRG{\mathsf{PRG}} with seed-length O(log⁡m+log⁡(n/ε)3/2)O(\log m+\log(n/\varepsilon)^{3/2}); in particular, the best previous seed-length for polynomially small error was O((log⁡(n)3/2)O((\log(n)^{3/2}).

There is an explicit generator G:{0,1}r→[m]n\mathcal{G}:\{0,1\}^{r}\to[m]^{n} that fools (m,n)(m,n)-combinatorial shapes to error ε\varepsilon and has seed-length r=O(log⁡(mn/ε)(log⁡log⁡(mn/ε))2)r=O(\log(mn/\varepsilon)(\log\log(mn/\varepsilon))^{2}).

3 Other related work

Starting with the work of Diakonikolas et al. [DGJ+09], there has been a lot of interest in constructing PRG{\mathsf{PRG}}s for halfspaces and related classes such as intersections of halfspaces and polynomial threshold functions over the domain {±1}n\{\pm 1\}^{n} [DKN10, GOWZ10, HKM12, MZ13, Kan11b, Kan11a, Kan14]. Rabani and Shpilka [RS10] construct optimal hitting set generators for halfspaces over {±1}n\{\pm 1\}^{n}; hitting set generators are weaker than PRG{\mathsf{PRG}}s.

Another line of work gives PRG{\mathsf{PRG}}s for halfspaces for the uniform distribution over the sphere (spherical caps) or the Gaussian distribution. For spherical caps, Karnin, Rabani and Shpilka [KRS12] gave a PRG{\mathsf{PRG}} with a seed-length of O(log⁡n+log⁡2(1/ε))O(\log n+\log^{2}(1/\varepsilon)). For the Gaussian distribution, [Kan14] gave a PRG{\mathsf{PRG}} which achieves a seed-length of O(log⁡n+log⁡3/2(1/ε))O(\log n+\log^{3/2}(1/\varepsilon)). Recently, [KM15] gave the first PRG{\mathsf{PRG}}s for these settings with seedlength O((log⁡(n/ε))(log⁡log⁡(n/ε)))O((\log(n/\varepsilon))(\log\log(n/\varepsilon))). Fooling halfspaces over the hypercube is known to be harder than the Gaussian setting or the uniform distribution on the sphere; hence our result gives a construction with similar parameters up to a O(log⁡log⁡n)O(\log\log n) factor. At a high level, [KM15] also uses a iterative dimension reduction approach like in [KMN11, CRSW13, GMR+12]; however, the final construction and its analysis are significantly different from ours.

Gopalan et al. [GOWZ10] gave a generator fooling halfspaces under product distributions with bounded fourth moments, whose seed-length is O(log⁡(n/ε)log⁡(1/ε))O(\log(n/\varepsilon)\log(1/\varepsilon)).

The present work completely subsumes a manuscript of the authors which essentially solved the special-case of derandomizing Chernoff bounds and a special class of halfspaces [GKM14].

Proof overview

We describe our PRG{\mathsf{PRG}} for Fourier shapes as in Theorem 1.1. The various corollaries are derived from this Theorem using properties of the discrete Fourier transform of integer-valued random variables.

Let us first consider a very simple PRG{\mathsf{PRG}}: O(1)O(1)-wise independent distributions over [m]n[m]^{n}. At a glance, it appears to do very poorly as it is easy to express the parity of a subset of bits as a Fourier shape and parities are not fooled even by (n−1)(n-1)-wise independence. The starting point for our construction is that bounded independence does fool a special but important class of Fourier shapes, namely those with polynomially small total variance.

For a complex valued random variable ZZ, define the variance of ZZ as

To gain some intuition for why this is a natural quantity, note that Tvar(f)\mathsf{Tvar}(f) gives an easy upper bound on the expectation of a Fourier shape:

To complement the above, we show that if the total-variance Tvar(f)\mathsf{Tvar}(f) is very small, then generators based on limited independence do fairly well. Concretely, our main technical lemma says that limited independence fools products of bounded (complex-valued) random variables, provided that the sum of their variances is small.

On the other hand, if Tvar(f)≤1/(mn)c\mathsf{Tvar}(f)\leq 1/(mn)^{c} for a fixed constant cc, then choosing k=O(log⁡(1/ε)/(log⁡mn))k=O(\log(1/\varepsilon)/(\log mn))-wise independence is enough to get error ε\varepsilon while also achieving seed-length O(klog⁡(mn))=O(log⁡(1/ε))O(k\log(mn))=O(\log(1/\varepsilon)) as desired. We exploit this observation by combining the use of limited independence with the recent iterative-dimension-reduction paradigm of [KMN11, CRSW13, GMR+12]. Our construction reduces the problem of fooling Fourier shapes with Tvar(f)≤O(log⁡(1/ε))\mathsf{Tvar}(f)\leq O(\log(1/\varepsilon)) through a sequence of iterations to fooling Fourier shapes where the total variance is polynomially small in m,nm,n in each iteration and then uses limited independence in each iteration.

We construct a PRG{\mathsf{PRG}} with seed-length O(log⁡(mn/ε)log⁡log⁡(1/ε))O(\log(mn/\varepsilon)\log\log(1/\varepsilon)) which ε\varepsilon-fools (m,n)(m,n)-Fourier shapes ff when Tvar(f)≥(log⁡(1/ε))C\mathsf{Tvar}(f)\geq(\log(1/\varepsilon))^{C} for some sufficiently large constant CC. We build the generator in two steps.

In the first step, we build a PRG{\mathsf{PRG}} with seed-length O(log⁡(mn))O(\log(mn)) which achieves constant error for (m,n)(m,n)-Fourier shapes ff with Tvar(f)≥1\mathsf{Tvar}(f)\geq 1. In the second step, we drive the error down to ε\varepsilon as follows. We hash the coordinates into roughly (log⁡(1/ε))O(1)(\log(1/\varepsilon))^{O(1)} buckets, so that for at least Ω(log⁡(1/ε))\Omega(\log(1/\varepsilon)) buckets, ff restricted to the coordinates within the bucket has total-variance at least 11. We use the PRG{\mathsf{PRG}} with constant error within each bucket, while the seeds across buckets are recycled using a PRG{\mathsf{PRG}} for small-space algorithms. This construction is inspired by the construction of small-bias spaces due to Naor and Naor [NN93]; the difference being that we use generators for space bounded algorithms for amplification, as opposed to expander random walks as done in [NN93].

2 Alphabet-reduction

The next building block in our construction is alphabet-reduction which helps us assume without loss of generality that the alphabet-size mm is polynomially bounded in terms of the dimension nn. This is motivated by the construction of [GMR+12].

Concretely, we show that constructing an ε\varepsilon-PRG{\mathsf{PRG}} for (m,n)(m,n)-Fourier shapes can be reduced to that of constructing an ε′\varepsilon^{\prime}-PRG{\mathsf{PRG}} for (n4,n)(n^{4},n)-Fourier shapes for ε′≈ε/(log⁡m)\varepsilon^{\prime}\approx\varepsilon/(\log m). The alphabet-reduction step consists of (log⁡log⁡m)(\log\log m) steps where in each step we reduce fooling (m,n)(m,n)-Fourier shapes for m>n4m>n^{4}, to that of fooling (m,n)(\sqrt{m},n)-Fourier shapes, at the cost of O(log⁡(m/ε))O(\log(m/\varepsilon)) random bits.

We now describe a single step that reduces the alphabet from mm to m\sqrt{m}. Consider the following procedure for generating a uniformly random element in [m]n[m]^{n}:

For D≈mD\approx\sqrt{m}, sample uniformly random subsets

Sample Y=(Y1,…,Yn)Y=(Y_{1},\ldots,Y_{n}) uniformly at random from [D]n[D]^{n}.

Output (Z1,…,Zn)(Z_{1},\ldots,Z_{n}), where Zj=X[Yj,j]Z_{j}=X[Y_{j},j].

Our goal is to derandomize this procedure. The key observation is that once the subsets S1,…,SnS_{1},\ldots,S_{n} are chosen, we are left with a (D,n)(D,n)-Fourier shape as a function of YY. So the choice of YY can be derandomized using a PRG{\mathsf{PRG}} for Fourier shapes with alphabet [D][D], and it suffices to derandomize the choice of the XX’s. A calculation shows that (because the YY’s are uniformly random), derandomizing the choice of the XX’s reduces to that of fooling a Fourier shape of total-variance 1/mΩ(1)1/m^{\Omega(1)}. Lemma 2.1 implies that this can be done with limited independence.

3 Dimension-reduction for low-variance Fourier shapes

We first hash the coordinates into roughly n\sqrt{n} buckets using a kk-wise independent hash function h∈uH={h:[n]←[n]}h\in_{u}\mathcal{H}=\{h:[n]\leftarrow[\sqrt{n}]\} for k≈O(log⁡(n/ε)/log⁡n)k\approx O(\log(n/\varepsilon)/\log n). Note that this only requires O(log⁡(n/ε))O(\log(n/\varepsilon)) random bits.

For the coordinates within each bucket we use a k′k^{\prime}-wise independent string in [m]n[m]^{n} for k′≈O(log⁡(n/ε)/log⁡n)k^{\prime}\approx O(\log(n/\varepsilon)/\log n). We use true independence across buckets. Note that this requires n\sqrt{n} independent seeds of length r=O(log⁡(n/ε))r=O(\log(n/\varepsilon)).

4 Main Technical Lemma

The lemma can be seen as a generalization of a similar result proved for real-valued random variables in [GY14](who also have an additional restriction on the means of the random variables YjY_{j}). However, the generalization to complex-valued variables is substantial and seems to require different proof techniques.

We then argue that exp⁡(∑jWj)\exp(\sum_{j}W_{j}) can be approximated by a polynomial P(W1,…,Wn)P(W_{1},\ldots,W_{n}) of degree less than kk with small expected error. The polynomial PP is obtained by truncating the Taylor series expansion of the exp⁡(  )\exp(\;) function. Once, we have such a low-degree polynomial approximator, the claim follows as limited independence fools low-degree polynomials.

To handle the general case where ZjZ_{j}’s are not necessarily bounded, we use an inclusion-exclusion argument and exploit the fact that with high probability, not many of the ZjZ_{j}’s (say more than k/2k/2) will deviate too much from their expectation. We leave the details to the actual proof.

Preliminaries

For a complex valued random variable ZZ,

Unless otherwise stated c,Cc,C denote universal constants.

Throughout we assume that nn is sufficiently large and that δ,ε>0\delta,\varepsilon>0 are sufficiently small.

For positive functions f,g,hf,g,h we write f=g+O(h)f=g+O(h) when ∣f−g∣=O(h)|f-g|=O(h).

For n,m,δ>0n,m,\delta>0 we say that a family of hash functions H={h:[n]→[m]}\mathcal{H}=\{h:[n]\to[m]\} is δ\delta-biased if for any r≤nr\leq n distinct indices i1,i2,…,ir∈[n]i_{1},i_{2},\ldots,i_{r}\in[n] and j1,…,jr∈[m]j_{1},\ldots,j_{r}\in[m],

We say that such a family is kk-wise independent if the above holds with δ=0\delta=0 for all r≤kr\leq k.

We say that a distribution over {±1}n\{\pm 1\}^{n} is δ\delta-biased or kk-wise independent if the corresponding family of functions h:[n]→h:[n]\to is.

Such families of functions can be generated efficiently using small seeds.

For n,m,k,δ>0n,m,k,\delta>0, there exist explicit δ\delta-biased families of hash functions H={h:[n]→[m]}\mathcal{H}=\{h:[n]\to[m]\} that can be generated efficiently from a seed of length s=O(log⁡(n/δ))s=O(\log(n/\delta)). There are also, explicit kk-wise independent families that can be generated efficiently from a seed of length s=O(klog⁡(nm))s=O(k\log(nm)).

Taking the pointwise sum of such generators modulo mm gives a family of hash functions that is both δ\delta-biased and kk-wise independent generated from a seed of length s=O(log⁡(n/δ)+klog⁡(nm))s=O(\log(n/\delta)+k\log(nm)).

We start with the simple observation that to δ\delta-fool an (m,n)(m,n)-Fourier shape ff, we can assume the functions in ff have bit-precision 2log⁡2(n/δ)2\log_{2}(n/\delta). This observation will be useful when we use PRGs for small-space machines to fool Fourier shapes in certain parameter regimes.

If a PRG{\mathsf{PRG}} G:{0,1}r→[m]n\mathcal{G}:\{0,1\}^{r}\to[m]^{n} δ\delta-fools (m,n)(m,n)-Fourier shapes f=∏jfjf=\prod_{j}f_{j} when log⁡(fj)\log(f_{j})’s have bit precision 2log⁡2(n/δ)2\log_{2}(n/\delta), then G\mathcal{G} fools all (m,n)(m,n)-Fourier shapes with error at most 2δ2\delta.

We collect some known results about pseudorandomness and prove some other technical results that will be used later.

We shall use PRG{\mathsf{PRG}}s for small-space machines or read-once branching programs (ROBP) of Nisan [Nis92], [NZ96] and Impagliazzo, Nisan and Wigderson [INW94]. We extend the usual definitions of read-once branching programs to compute complex-valued functions; the results of [Nis92], [NZ96], [INW94] apply to this extended model readilyThis is because these results in fact give guarantees in terms of statistical distance..

An (S,D,T)(S,D,T)-ROBP MM is a layered directed graph with T+1T+1 layers and 2S2^{S} vertices per layer with the following properties.

A vertex vv in layer ii, 0≤i<T0\leq i<T has 2D2^{D} edges to layer i+1i+1 each labeled with an element of {0,1}D\{0,1\}^{D}.

There exists an explicit PRG{\mathsf{PRG}} GINW:{0,1}r→({0,1}D)T\mathcal{G}^{INW}:\{0,1\}^{r}\to\left(\{0,1\}^{D}\right)^{T} which ε\varepsilon-fools (S,D,T)(S,D,T)-branching programs and has seed-length r=O(D+Slog⁡T+log⁡(T/δ)⋅(log⁡T))r=O(D+S\log T+\log(T/\delta)\cdot(\log T)).

For all C>1C>1 and 0<c<10<c<1, there exists an explicit PRG{\mathsf{PRG}} GNZ:{0,1}r→({0,1}D)T\mathcal{G}^{NZ}:\{0,1\}^{r}\to\left(\{0,1\}^{D}\right)^{T} which ε\varepsilon-fools (S,S,SC)(S,S,S^{C})-branching programs for ε=2−log⁡1−cS\varepsilon=2^{-\log^{1-c}S} and has seed-length r=O(S)r=O(S).

Fooling products of low-variance random variables

We now show one of our main technical claims that products of complex-valued random variables are fooled by limited independence if the sum of variances of the random variables is small. The lemma is essentially equivalent to saying that limited independence fools low-variance Fourier shapes.

We start with the following standard bound on moments of bounded random variables whose proof is deferred to appendix B.

We also use some elementary properties of the (complex-valued) log and exponential functions:

Claims (1), (2) follow from the Taylor series expansions for the complex-valued log and exponential functions.

We prove Lemma 4.1 or equivalently, Equation (3) by proving a sequence of increasingly stronger claims. We begin by proving that Equation (3) holds if XjX_{j}’s have small absolute deviation, i.e., lie in a disk of small radius about a fixed point.

Therefore, by Lemma 4.2, the expression in (4) is at most

Next, we relax the conditions to handle the case where we only require the means of the XjX_{j}’s be far from zero.

We assume throughout that σ/k\sigma/\sqrt{k} is less than a sufficiently small constant; otherwise, there is nothing to prove. Further, note that there can be at most kk different indices j∈[n]j\in[n] where σj≥σ/k\sigma_{j}\geq\sigma/\sqrt{k}. As even after conditioning on the values of the corresponding YY’s, the remaining YjY_{j}’s are (C−1)k(C-1)k-independent, it suffices to prove the lemma when σj≤σ/k\sigma_{j}\leq\sigma/\sqrt{k} for all jj.

To apply Lemma 4.4, we consider a truncation of our random variables: define

We truncate the above expansion to only include terms corresponding to sets SS with ∣S∣<m|S|<m for m=O(k)m=O(k) to be chosen later. Let

Note that the expectation above is the same as what it would be if the YiY_{i}’s were fully independent, in which case it is at most

Therefore, CkCk-wise independence fools PmP_{m} to error 2O(k)⋅(σ/k)k2^{O(k)}\cdot(\sigma/\sqrt{k})^{k}.

On the other hand, the expectation of (Nm)\binom{N}{m} is

Taking m=3k/2m=3k/2 yields a final error of exp⁡(O(k))⋅(σ/k)k\exp(O(k))\cdot(\sigma/\sqrt{k})^{k}. This completes our proof. ∎

Finally, we can extend our proof to cover the general case.

Note that it suffices to prove that Equation (3) holds. As before, it suffices to assume that σ/k≪1\sigma/\sqrt{k}\ll 1 and that σi≤σ/k\sigma_{i}\leq\sigma/\sqrt{k} for all ii.

On the one hand if m≤6km\leq 6k, we note that for CC sufficiently large, the values of Y1,…,YmY_{1},\ldots,Y_{m} are independent of each other, and even after conditioning on them, the remaining YiY_{i}’s are still C′kC^{\prime}k-wise independent. Thus, applying Lemma 4.5 to the expectation of the product of the remaining YiY_{i} we find that the difference between the expectation of the product of XX’s and product of YY’s is as desired.

Notice that so long as at least 3k3k of Y1,…,YmY_{1},\ldots,Y_{m} have absolute value less than 2(σ/k)1/32(\sigma/\sqrt{k})^{1/3}, then

Therefore, it suffices to show that this occurs except with probability at most O(σ/k)kO(\sigma/\sqrt{k})^{k}. Let NN be the number of 1≤i≤m1\leq i\leq m so that ∣Yi∣≥2(σ/k)1/3.|Y_{i}|\geq 2(\sigma/\sqrt{k})^{1/3}. Note that

A Generator for high-variance Fourier shapes

In this section, we construct a generator that fools Fourier shapes with high variance.

We start with the simple but crucial observation that Fourier shapes with large variance have small expectation.

We build the generator in two steps. We first build a generator with seed-length O(log⁡n)O(\log n) which achieves constant error for all ff with Tvar(f)≥1\mathsf{Tvar}(f)\geq 1. In the second step, we reduce the error down to δ\delta. This construction is inspired by a construction of Naor and Naor [NN93] of small-bias spaces.

Our goal in this subsection is get a generator with constant error for Fourier shapes where Tvar(f)=Ω(1)\mathsf{Tvar}(f)=\Omega(1). We start by showing that when Tvar(f)=Θ(1)\mathsf{Tvar}(f)=\Theta(1) (instead of just Ω(1)\Omega(1)), O(1)O(1)-wise independence is enough to fool ff.

Let f=∏jfjf=\prod_{j}f_{j}, X∈u[m]nX\in_{u}[m]^{n}. Now, by Lemma 4.1 applied to Yj=fj(Zj)Y_{j}=f_{j}(Z_{j}), we have,

Note that by taking pp to be a sufficiently large constant compared to c2c_{2}, we can make the last bound arbitrary small.

for pp sufficiently large constant and some constant 0<c′<10<c^{\prime}<1. ∎

We reduce the general case of Tvar(f)∈[1,n]\mathsf{Tvar}(f)\in[1,n] to the case above where Tvar(f)=Θ(1)\mathsf{Tvar}(f)=\Theta(1) by using the Valiant-Vazirani technique of sub-sampling. For B⊆[n]B\subseteq[n] let Tvar(fB)=∑i∈Bσi2\mathsf{Tvar}(f_{B})=\sum_{i\in B}\sigma_{i}^{2}. If we sample a random subset B⊆[n]B\subseteq[n] with ∣B∣≈n/Tvar(f)|B|\approx n/\mathsf{Tvar}(f) in a pairwise independent manner, we will get Tvar(fB)=Θ(1)\mathsf{Tvar}(f_{B})=\Theta(1) with Ω(1)\Omega(1) probability. Since we do not know Tvar(f)\mathsf{Tvar}(f), we sample log⁡(n)\log(n) subsets whose cardinalities are geometrically increasing; one of them is likely to satisfy the desired bound.

We set up some notation that will be used in the remainder of this section.

The proof of this lemma is standard and is deferred to Appendix C.

This naturally suggests using an O(1)O(1)-wise independent distribution within each bucket. But using independent strings across the log⁡(n)\log(n) buckets would require a seed of length O(log⁡(mn)⋅(log⁡n))O(\log(mn)\cdot(\log n)). We analyze our generator assuming independence across distinct buckets, but then recycle the seeds using PRG{\mathsf{PRG}}s for space bounded computation to keep the seed-length down to O(log⁡(mn))O(\log(mn)) (rather than O(log⁡2(n))O(\log^{2}(n))).

We now prove the main claim of this subsection.

Let π∈uΠ\pi\in_{u}\Pi and let Zj∼[m]2jZ^{j}\sim[m]^{2^{j}} be an independent pp-wise independent string for a parameter p=O(1)p=O(1) to be chosen later. Define

In other words, the generator applies the string ZjZ^{j} to the coordinates in bucket BjB_{j}.

Observe that f(Y)=∏j=0log⁡(n)−1fj(Zj)f(Y)=\prod_{j=0}^{\log(n)-1}f^{j}(Z^{j}). Since the ZjZ^{j}’s are independent of each other

We next improve the seed-length of G1′\mathcal{G}_{1}^{\prime} using the PRG{\mathsf{PRG}} for ROBPs of Theorem 3.4. To this end, note that by Lemma 3.2 we can assume that every log⁡(fi(xi))\log(f_{i}(x_{i})), and hence every log⁡(fj(xj))\log(f^{j}(x^{j})), has bit precision at most O(log⁡n)O(\log n) bits (since our goal is to get error δ=O(1)\delta=O(1)). Further, each ZjZ^{j} can be generated efficiently with O(log⁡(mn))O(\log(mn)) random bits.

Thus, for a fixed permutation π\pi, the computation of f(G′(π,Z1,…,ZT))f(\mathcal{G}^{\prime}(\pi,Z^{1},\ldots,Z^{T})) can be done by a (S,D,T)(S,D,T)-ROBP where S,TS,T are O(log⁡n)O(\log n) and D=O(log⁡(mn))D=O(\log(mn)): for j∈{1,…,T}j\in\{1,\ldots,T\}, the ROBP computes fj(Zj)f^{j}(Z^{j}) and multiplies it to the product computed so far, which can be done using O(log⁡n)O(\log n) bits of space. Let GNZ:{0,1}r→({0,1}D)T\mathcal{G}^{NZ}:\{0,1\}^{r}\to\left(\{0,1\}^{D}\right)^{T} be the generator in Theorem 3.4 fooling (S,D,T)(S,D,T)-ROBPs as above with error δ<(1−c′′)/2\delta<(1-c^{\prime\prime})/2. GNZ\mathcal{G}^{NZ} has seedlength O(log⁡(mn))O(\log(mn)). Let

2 Reducing the error

Our generator will partition [n][n] into m=O((log⁡(1/δ))5)m=O((\log(1/\delta))^{5}) buckets B1,…,BmB_{1},\ldots,B_{m}, using a family of hash functions with the following spreading property:

We start by showing that the desired hash functions can be generated from a small-bias family of hash functions. We show that it satisfies the conditions of the lemma by standard moment bounds. The proof is in Appendix C

For all constants C1C_{1}, there exist constants C2,C3C_{2},C_{3} such that following holds. For all δ≥0\delta\geq 0, there exists an explicit hash family H={h:[n]→[T]}\mathcal{H}=\{h:[n]\to[T]\}, where T=C2log⁡5(1/δ))T=C_{2}\log^{5}(1/\delta)) which is (C3log⁡5(1/δ),C1log⁡(1/δ),δ)(C_{3}\log^{5}(1/\delta),C_{1}\log(1/\delta),\delta)-spreading and h∈uHh\in_{u}\mathcal{H} can be sampled efficiently with O(log⁡(n/δ))O(\log(n/\delta)) bits.

where c<1c<1 is the constant from Lemma 5.3. By the spreading property of H\mathcal{H}, with probability at least 1−δ1-\delta, ∣I∣≥Clog⁡(1/δ)|I|\geq C\log(1/\delta). Therefore, for CC sufficiently large,

As in Lemma 5.5, we recycle the seeds for the various buckets using the PRGs for ROBPs. By Lemma 3.2, we may assume that fjf^{j} has bit precision at most O(log⁡(n/δ))O(\log(n/\delta)) bits. Further note that

For a fixed hash function h∈Hh\in\mathcal{H}, this can be computed by a (S,D,T)(S,D,T)-ROBP where S=O(log⁡(n/δ))S=O(\log(n/\delta)) and D=O(log⁡(mn))D=O(\log(mn)), corresponding to the various possible seeds for G1\mathcal{G}_{1}. Let GINW:{0,1}r→({0,1}D)T\mathcal{G}^{INW}:\{0,1\}^{r}\to\left(\{0,1\}^{D}\right)^{T} be a generator fooling (S,D,T)(S,D,T)-ROBPs as in Theorem 3.3 with error δ\delta and define

The seed-length is dominated by the seed-length of GINW\mathcal{G}^{INW}, which is

Alphabet reduction for Fourier shapes

In this section, we describe our alphabet-reduction procedure, which reduces the general problem of constructing an ε\varepsilon-PRG for (m,n)(m,n)-Fourier shapes where mm could be much larger than nn, to that of constructing an ε/log⁡(m)\varepsilon/\log(m)-PRG for (n4,n)(n^{4},n)-Fourier shapes. This reduction is composed of O(log⁡log⁡m)O(\log\log m) steps where in each step we reduce fooling (m,n)(m,n)-Fourier shapes to fooling (m,n)(\sqrt{m},n)-Fourier shapes. Each of these steps in turn will cost O(log⁡(m/ε))O(\log(m/\varepsilon)) random bits, so that the overall cost is O(log⁡(m/ε)⋅(log⁡log⁡m))O(\log(m/\varepsilon)\cdot(\log\log m)). Concretely, we show the following:

Let n,δ>0n,\delta>0 and suppose that for some r′=r′(n,δ′)r^{\prime}=r^{\prime}(n,\delta^{\prime}), for all m′≤n4m^{\prime}\leq n^{4} there exists an explicit generator Gm′:{0,1}r1→[m′]n\mathcal{G}_{m^{\prime}}:\{0,1\}^{r_{1}}\to[m^{\prime}]^{n} which δ′\delta^{\prime}-fools (m′,n)(m^{\prime},n)-Fourier shapes. For all mm, there exists an explicit generator Gm:{0,1}r→[m]n\mathcal{G}_{m}:\{0,1\}^{r}\to[m]^{n} which (δ′+δ)(\delta^{\prime}+\delta)-fools (m,n)(m,n)-Fourier shapes with seed-length r=r′+O(log⁡(m/δ)log⁡log⁡(m))r=r^{\prime}+O(\log(m/\delta)\log\log(m)).

We prove the claim by showing that for m>n4m>n^{4}, we can reduce (δ+δ′)(\delta+\delta^{\prime})-fooling (m,n)(m,n)-Fourier shapes to that of δ′\delta^{\prime}-fooling (m,n)(\sqrt{m},n)-Fourier shapes with O(log⁡(m/δ))O(\log(m/\delta)) additional random bits. The theorem follows by applying the claim log⁡log⁡(m)\log\log(m) until the alphabet size drops below n4n^{4} when we can use Gm′\mathcal{G}_{m^{\prime}}. This costs a total of r′+O(log⁡(m/δ)log⁡log⁡(m))r^{\prime}+O(\log(m/\delta)\log\log(m)) random bits, and gives error δ′+log⁡log⁡(m)δ\delta^{\prime}+\log\log(m)\delta. The claim follows by replacing δ\delta with δ/log⁡log⁡(m)\delta/\log\log(m).

Thus, suppose that m>n4m>n^{4} and for D=⌊m⌋D=\left\lfloor\sqrt{m}\right\rfloor, we have a generator GD:{0,1}rD→[D]n\mathcal{G}_{D}:\{0,1\}^{r_{D}}\to[D]^{n} which δ′\delta^{\prime}-fools (D,n)(D,n)-Fourier shapes. The generator Gm\mathcal{G}_{m} works as follows:

Generate a matrix X∈[m]D×nX\in[m]^{D\times n} where

Each column of XX is from a pairwise independent distribution over [m]D[m]^{D}.

The different columns are kk-wise independent for k=Clog⁡(1/δ)/log⁡(m)k=C\log(1/\delta)/\log(m) for some sufficiently large constant CC.

Generate Y=(Y1,…,Yn)=GD(z)∈[D]nY=(Y_{1},\ldots,Y_{n})=\mathcal{G}_{D}(z)\in[D]^{n} for z∈u{0,1}rDz\in_{u}\{0,1\}^{r_{D}}.

Gm\mathcal{G}_{m} outputs Z=(Z1,…,Zn)∈[m]nZ=(Z_{1},\ldots,Z_{n})\in[m]^{n} where Zj=X[Yj,j]Z_{j}=X[Y_{j},j] for j∈[n]j\in[n].

Each column of XX can be generated using a seed of length 2log⁡m2\log m. By using seeds for various columns that are kk-wise independent, generating XX requires seedlength O(klog⁡m)=O(log⁡(1/δ))O(k\log m)=O(\log(1/\delta)) (as m>n2m>n^{2}), while the number of bits needed to generate ZZ is rD+O(log⁡(1/δ))r_{D}+O(\log(1/\delta)).

Let X′,Y′X^{\prime},Y^{\prime} be random variables distributed uniformly over [m]D×n[m]^{D\times n} and [D]n[D]^{n} respectively. Let Zj′=X′[Yj′,j]Z^{\prime}_{j}=X^{\prime}[Y^{\prime}_{j},j] for j∈[n]j\in[n], so that Z′Z^{\prime} is uniform over [m]n[m]^{n} and f(Z′)=fX′(Y′)f(Z^{\prime})=f^{X^{\prime}}(Y^{\prime}). Our goal is to show that f(Z′)f(Z^{\prime}) and f(Z)f(Z) are close in expectation. We do this by replacing X′X^{\prime} and Y′Y^{\prime} by XX and YY respectively.

That we can replace Y′Y^{\prime} with YY follows from the pseudorandomness of GD\mathcal{G}_{D}. For any fixed x∈[m]nx\in[m]^{n}, as GD\mathcal{G}_{D} fools (D,n)(D,n)-Fourier shapes,

We now show that for truly random Y′Y^{\prime}, one can replace XX by X′X^{\prime}. Note that

The random variables A1,…,AnA_{1},\ldots,A_{n} are kk-wise independent. Further, we have

where the second to last inequality follows becase n≤m1/4n\leq m^{1/4} and D≥m/2D\geq\sqrt{m}/2, and the last holds for k=Clog⁡(1/δ)/log⁡(m)k=C\log(1/\delta)/\log(m) for a sufficiently big constant CC. Equation 9 now follows from Equations (11) and (10).

Dimension reduction for low-variance Fourier shapes

We next describe our dimension reduction step for low-variance Fourier shapes. We start with an (m,n)(m,n)-Fourier shape where m≤n4m\leq n^{4} and Tvar(f)≤log⁡(n/δ)c\mathsf{Tvar}(f)\leq\log(n/\delta)^{c}. We show how one can reduce the dimension to t=nt=\sqrt{n}, at a price of a blowup in the alphabet size m′m^{\prime} which now becomes (n/δ)c(n/\delta)^{c} for some (large) constant cc.

Let δ>0\delta>0, n>0n>0 and t=⌈n⌉t=\lceil\sqrt{n}\rceil. There is a constant cc and m′≤(n/δ)cm^{\prime}\leq(n/\delta)^{c} such that the following holds: if there exists an explicit PRG{\mathsf{PRG}} G′:{0,1}r′→[m′]t\mathcal{G}^{\prime}:\{0,1\}^{r^{\prime}}\to[m^{\prime}]^{t} with seed-length r′=r′(n,δ′)r^{\prime}=r^{\prime}(n,\delta^{\prime}) which δ′\delta^{\prime}-fools (m′,t)(m^{\prime},t)-Fourier shapes, then there exists an explicit generator G:{0,1}r→[m]n\mathcal{G}:\{0,1\}^{r}\to[m]^{n} with seed-length r=r′+O(log⁡(n/δ))r=r^{\prime}+O(\log(n/\delta)) which (δ+δ′)(\delta+\delta^{\prime})-fools (m,n)(m,n)-Fourier shapes ff with m≤n4m\leq n^{4} and Tvar(f)≤n1/9\mathsf{Tvar}(f)\leq n^{1/9}.

We start by constructing an easy to analyze generator G1G_{1} which hashes co-ordinates into buckets using kk-wise independence and then uses independent kk-wise independent strings within a bucket. Let

where CC will is a sufficiently large constant. Let H:{[n]→t}\mathcal{H}:\{[n]\to t\} be a kk-wise independent family of hash functions. Let G0:{0,1}r0→[m]nG_{0}:\{0,1\}^{r_{0}}\to[m]^{n} be a kk-wise independent generator over [m]n[m]^{n}. Define a new generator G1:H×({0,1}r0)t→[m]nG_{1}:\mathcal{H}\times(\{0,1\}^{r_{0}})^{t}\to[m]^{n} as:

We argue that G1G_{1} fools (m,n)(m,n)-Fourier shapes with small total variance as in the theorem. Our analysis proceeds as follows:

With high probability over h∈uHh\in_{u}\mathcal{H}, each of the fjf^{j}’s has low variance except for a few heavy co-ordinates (roughly Tvar(f)/t\mathsf{Tvar}(f)/t after dropping k/2k/2 heavy coordinates).

Within each bin we have kk-wise independence, whereas the distributions across bins are independent. So even conditioned on the heavy co-ordinates in a bin, the remaining distribution in the bin is k/2k/2-wise independent. Hence each fjf^{j} is fooled by Lemma 4.1.

For α>0\alpha>0, to be chosen later, let L={j∈[n]:σ2(fj)≥α}L=\{j\in[n]:\sigma^{2}(f_{j})\geq\alpha\} denote the α\alpha-large indices and S=[n]∖LS=[n]\setminus L denote the small indices. We call a hash function h∈Hh\in\mathcal{H} (α,β)(\alpha,\beta)-good if the following two conditions hold for every bin h−1(j)h^{-1}(j) where j∈[t]j\in[t]:

The bin does not have too many large indices: ∣h−1(j)∩L∣≤k/2|h^{-1}(j)\cap L|\leq k/2.

The small indices in the bin have small total variance:

Using standard moment bounds for kk-wise independent hash functions one can show that h∈uHh\in_{u}\mathcal{H} is (α,β)(\alpha,\beta)-good with probability at least 1−n−Ω(k)1-n^{-\Omega(k)} for α=n−Ω(1)\alpha=n^{-\Omega(1)} and β=n−Ω(1)\beta=n^{-\Omega(1)}. We defer the proof of the following Lemma to Appendix D.

Let Tvar(f)≤n1/9\mathsf{Tvar}(f)\leq n^{1/9} and let H={h:[n]→[t]}\mathcal{H}=\{h:[n]\to[t]\} be a kk-wise independent family of hash functions for t=Θ(n)t=\Theta(\sqrt{n}). Then h∈Hh\in\mathcal{H} is (n−1/3,n−1/36)(n^{-1/3},n^{-1/36})-good with probability 1−O(k)k/2n−Ω(k)1-O(k)^{k/2}n^{-\Omega(k)}.

We next argue that if h∈Hh\in\mathcal{H} is (α,β)(\alpha,\beta)-good then, kk-wise independence is sufficient to fool fjf^{j} for each j∈[t]j\in[t].

Let h∈Hh\in\mathcal{H} be (α,β)(\alpha,\beta)-good, and let j∈[t]j\in[t]. For Z′∼[m]nZ^{\prime}\sim[m]^{n} kk-wise independent, and Z′′∈u[m]nZ^{\prime\prime}\in_{u}[m]^{n},

Fix j∈[t]j\in[t]. By relabelling coordinates, let us assume that h−1(j)={1,…,nj}h^{-1}(j)=\{1,\ldots,n_{j}\} and L∩h−1(j)={1,…,r}L\cap h^{-1}(j)=\{1,\ldots,r\}, where r≤k/2r\leq k/2. As Z′Z^{\prime} is kk-wise independent, (Z1′,…,Zr′)(Z^{\prime}_{1},\ldots,Z^{\prime}_{r}) is uniformly distributed over [m]r[m]^{r}. We couple Z′Z^{\prime} and Z′′Z^{\prime\prime} by taking Zi′=Zi′′Z^{\prime}_{i}=Z^{\prime\prime}_{i} for i≤ri\leq r. Even after conditioning on these values, Zr+1′,…,Znj′Z^{\prime}_{r+1},\ldots,Z^{\prime}_{n_{j}} are k/2k/2-wise independent.

We use these lemmas to prove Theorem 7.1.

Recall that G1(h,z1,…,zt)=ZG_{1}(h,z_{1},\ldots,z_{t})=Z where Zj=G0(zj)Z^{j}=G_{0}(z_{j}) for j∈[t]j\in[t]. Since the zjz_{j}s are independent, so are the ZjZ^{j}’s. Hence,

By Lemma 7.3, for (n−1/3,n−1/36)(n^{-1/3},n^{-1/36})-good hh, if Y∈u[m]nY\in_{u}[m]^{n}, then

Combining the above equations we get that for Y∈u[m]nY\in_{u}[m]^{n},

where the last inequality holds by taking CC in Equation (12) to be a sufficiently large constant.

We next derandomize the choice of the zjz^{j}’s by using a PRG for appropriate Fourier shapes. Let r0r_{0} be the seed-length of the generator G0G_{0} obtained by setting k=Clog⁡(n/δ)/(log⁡n)k=C\log(n/\delta)/(\log n) as above, and let cc be such that r0≤clog⁡(n/δ)r_{0}\leq c\log(n/\delta). Let

respectively. Observe that fˉ\bar{f} is a Fourier shape, and

By assumption, we have an explicit generator G′:{0,1}r′→[m′]t\mathcal{G}^{\prime}:\{0,1\}^{r^{\prime}}\to[m^{\prime}]^{t} which δ′\delta^{\prime}-fools (m′,t)(m^{\prime},t)-Fourier shapes. We claim that G:H×{0,1}r′→[m]n\mathcal{G}:\mathcal{H}\times\{0,1\}^{r^{\prime}}\to[m]^{n} defined as

(δ′+δ)(\delta^{\prime}+\delta) fools small-variance (m,n)(m,n)-Fourier shapes.

Since G′\mathcal{G}^{\prime} fools (m′,t)(m^{\prime},t)-Fourier shapes,

By Equation (16), whenever Tvar(f)≤log⁡(n/δ)C\mathsf{Tvar}(f)\leq\log(n/\delta)^{C},

The seed-length required for Gs\mathcal{G}_{s} is O(log⁡(n/δ))O(\log(n/\delta)) for hh and r′r^{\prime} for ww. ∎

Putting things together

We put the pieces together and prove our main theorem, Theorem 1.1. We show the following lemma which allows simultaneous reduction in both the alphabet and the dimension, going from fooling (m,n)(m,n)-Fourier shapes to fooling (n2,⌈n⌉)(n^{2},\lceil\sqrt{n}\rceil)-Fourier shapes.

Let δ>0\delta>0, n>log⁡C(1/δ)n>\log^{C}(1/\delta) for some sufficiently large constant CC, and t=⌈n⌉t=\lceil\sqrt{n}\rceil. If there exists an explicit PRG{\mathsf{PRG}} G′′:{0,1}r′′→[m′′]t\mathcal{G}^{\prime\prime}:\{0,1\}^{r^{\prime\prime}}\to[m^{\prime\prime}]^{t} with seed-length r′′=r′′(n,δ)r^{\prime\prime}=r^{\prime\prime}(n,\delta) which δ\delta-fools (m′′,t)(m^{\prime\prime},t)-Fourier shapes for all m′′≤n2m^{\prime\prime}\leq n^{2}, then there exists an explicit generator G:{0,1}r→[m]n\mathcal{G}:\{0,1\}^{r}\to[m]^{n} with seed-length r=r′′+O(log⁡(mn/δ)log⁡log⁡(mn))r=r^{\prime\prime}+O(\log(mn/\delta)\log\log(mn)) which 4δ4\delta-fools (m,n)(m,n)-Fourier shapes.Comparing this to Theorem 7.1, the main difference is that we do not assume that Tvar(f)\mathsf{Tvar}(f) is small. Further, the generator G′′\mathcal{G}^{\prime\prime} for small dimensions requires m′′≤n2m^{\prime\prime}\leq n^{2}, and our goal is to fool Fourier shapes in nn dimensions with arbitrary alphabet size mm.

For any z∈[m]nz\in[m]^{n}, define a new Fourier shape fz(y)=f(y⊕z)f_{z}(y)=f(y\oplus z). Then, for any fixed zz, YY δ\delta-fools fzf_{z} as Tvar(fz)=Tvar(f)≥Clog⁡(1/δ)5\mathsf{Tvar}(f_{z})=\mathsf{Tvar}(f)\geq C\log(1/\delta)^{5}. Therefore,

Consider a fixing yy of YY and define fy(Z)=f(y⊕Z)f_{y}(Z)=f(y\oplus Z). Then, for any fixed yy, ZZ 3δ3\delta-fools fyf_{y} as Tvar(fy)≤n1/9\mathsf{Tvar}(f_{y})\leq n^{1/9}. Therefore,

We prove Theorem 1.1 by repeated applications of this lemma.

Assume that the final error desired is δ′\delta^{\prime}. Let δ=δ′/4log⁡log⁡(n)\delta=\delta^{\prime}/4\log\log(n). Applying Lemma 8.1, by using O(log⁡(mn/δ′)log⁡log⁡(mn/δ′))O(\log(mn/\delta^{\prime})\log\log(mn/\delta^{\prime})) random bits we reduce fooling (m,n)(m,n)-Fourier shapes to fooling (m′,⌈n⌉)(m^{\prime},\lceil\sqrt{n}\rceil)-Fourier shapes for m′≤n2m^{\prime}\leq n^{2}.

We now apply the lemma O(log⁡log⁡n)O(\log\log n) times to reduce to the case of fooling (log⁡C(1/δ),log⁡C(1/δ))(\log^{C}(1/\delta),\log^{C}(1/\delta))-Fourier shapes. This can be done by noting that by Lemma 3.2 it suffices to fool Fourier shapes with log⁡(fi)\log(f_{i}) having O(log⁡(1/δ))O(\log(1/\delta)) bits of precision. Such Fourier shapes can be computed by width-O(log⁡(1/δ))O(\log(1/\delta)) ROBPs, and thus using the generator from Theorem 3.3, we can fool this case with seed length O(log⁡(1/δ)log⁡log⁡(1/δ))O(\log(1/\delta)\log\log(1/\delta)) bits. Since each step requires O(log⁡(n/δ)log⁡log⁡(n/δ)O(\log(n/\delta)\log\log(n/\delta) random bits, the overall seedlength is bounded by

Applications of 𝖯𝖱𝖦𝖯𝖱𝖦{\mathsf{PRG}}s for Fourier shapes

In this Section, we show how Theorem 1.1 implies near optimal PRG{\mathsf{PRG}}s for halfspaces, modular tests and combinatorial shapes. We first prove two technical lemmas relating closeness between Fourier transforms of integer valued random variables to closeness under other metrics. We define the Fourier distance, statistical distance and Kolmogorov distance between two integer-valued random variables respectively as

The first standard claim relates closeness in statistical distance and Fourier distance for bounded integer valued random variables.

Let Z1,Z2Z_{1},Z_{2} be two integer-valued random variables supported on [0,N][0,N]. Then,

Note that the distribution Z1−Z2Z_{1}-Z_{2} is supported on at most 4N+14N+1 points. Therefore,

On the other hand, the Plancherel identity implies that

The second claim relates closeness in Kolmogorov distance to closeness in Fourier distance. The key is that unlike in Lemma 9.1, the dependence on NN is logarithmic. This difference is crucial to fooling halfspaces with polynomially small error (since there NN can exponential in the dimension nn).

Let Z1,Z2Z_{1},Z_{2} be two integer-valued random variables supported on [−N,N][-N,N]. Then,

It is clear that ∣s(k,N,α)∣≤2N|s(k,N,\alpha)|\leq 2N. Further,

where [α][\alpha] is the distance between α\alpha and the nearest integer. Therefore, we have

We combine Lemma 9.2 with Theorem 1.1 to derive Corollary 1.2, which gives PRG{\mathsf{PRG}}s for halfspaces with polynomially small error from PRG{\mathsf{PRG}}s for (2,n)(2,n)-Fourier shapes.

Let G:{0,1}r→{±1}n\mathcal{G}:\{0,1\}^{r}\to\{\pm 1\}^{n} be a PRG{\mathsf{PRG}} which δ\delta-fools (2,n)(2,n)-Fourier shapes (here we identify $withwith\{\pm 1\}arbitrarily).Weclaimthatarbitrarily). We claim that\mathcal{G}alsofoolsallhalfspaceswitherroratmostalso fools all halfspaces with error at most\varepsilon=O(n\log(n)\delta)$.

Let h:{±1}n→{±1}h:\{\pm 1\}^{n}\to\{\pm 1\} be a halfspace given by h(x)=\mathds1+(⟨w,x⟩−θ)h(x)=\mathds{1}^{+}(\langle w,x\rangle-\theta). It is well known that we can assume the weights and the threshold θ\theta to be integers bounded in the range [−N,N][-N,N] for N=2O(nlog⁡n)N=2^{O(n\log n)} (cf. [LC67]). Let X∈u{±1}nX\in_{u}\{\pm 1\}^{n} and Y=G(y)Y=\mathcal{G}(y) for y∈u{0,1}ry\in_{u}\{0,1\}^{r} and Z1=⟨w,X⟩Z_{1}=\langle w,X\rangle, Z2=⟨w,Y⟩Z_{2}=\langle w,Y\rangle. Note that Z1,Z2Z_{1},Z_{2} are bounded in the range [−n⋅N,n⋅N][-n\cdot N,n\cdot N].

then fαf_{\alpha} is a (2,n)(2,n)-Fourier shape. Hence,

Therefore, by Lemma 9.2 applied to Z1Z_{1}, Z2Z_{2}, dK(Z1,Z2)≤O(nlog⁡n)δd_{K}(Z_{1},Z_{2})\leq O(n\log n)\delta. Finally, note that

The corollary now follows by picking a generator as in Theorem 1.1 for m=2m=2 with error δ=ε/(Cnlog⁡n)\delta=\varepsilon/(Cn\log n) for sufficiently big CC. ∎

To prove Corollary 1.3, we need the following lemma about generalized halfspaces.

In Definition 3, we may assume that each gi(j)g_{i}(j) is an integer of absolute value (mn)O(mn)(mn)^{O(mn)}.

Let g:[m]n→{0,1}g:[m]^{n}\to\{0,1\} be a generalized halfspace where the gig_{i}s are arbitrary. Embed [m]n[m]^{n} into {0,1}mn\{0,1\}^{mn} by sending each xi∈[m]x_{i}\in[m] to (yi,1,…,yi,m)(y_{i,1},\ldots,y_{i,m}) where yi,j=1y_{i,j}=1 if xi=jx_{i}=j and yi,j=0y_{i,j}=0 otherwise. Note that

over the domain {0,1}mn\{0,1\}^{mn} has a representation where the weights gi′(j)g^{\prime}_{i}(j) and θ′\theta^{\prime} are integers of size at most (mn)O(mn)(mn)^{O(mn)}. Hence we can replace each gi(j)g_{i}(j) in the defintion of gg with gi′(j)g_{i}^{\prime}(j) without changing its value at any point in [m]n[m]^{n}. ∎

We now prove Corollary 1.3 giving PRG{\mathsf{PRG}}s for generalized halfspaces over [m]n[m]^{n}.

Letting X∈u[m]nX\in_{u}[m]^{n} and letting X′X^{\prime} be obtained from a PRG for (m,n)(m,n)-Fourier shapes with error at most ε\varepsilon, we let Z1=∑igi(Xi)Z_{1}=\sum_{i}g_{i}(X_{i}) and Z2=∑igi(Xi′)Z_{2}=\sum_{i}g_{i}(X_{i}^{\prime}). By Lemma 9.2 that dK(Z1,Z2)≤O(εnmlog⁡(nm))d_{K}(Z_{1},Z_{2})\leq O(\varepsilon nm\log(nm)). Picking ε\varepsilon sufficiently small gives our generator for generalized halfspaces. ∎

Then there exists a discrete product distribution YY such that for every halfspace hh,

Further, each YiY_{i} can be sampled using log⁡(n,1/ε,C)\log(n,1/\varepsilon,C) random bits.

Note that the first and second moment conditions on XX can be obtained for any product distribution by an affine transformation. Hence we get Corollary 1.4 from combining Lemma 9.4 with Corollary 1.3. In particular, there exist generators that fool all halfspaces with error ε\varepsilon under the Gaussian distribution with seed-length r=O(log⁡(n/ε)(log⁡log⁡(n/ε))2)r=O(\log(n/\varepsilon)(\log\log(n/\varepsilon))^{2}). This nearly matches the recent result of [KM15] upto a log⁡log⁡\log\log factor. Further, it is known (see e.g [GOWZ10, Lemma 11.1]) that PRG{\mathsf{PRG}}s for halfspaces under the Gaussian distribution imply PRG{\mathsf{PRG}}s for halfspaces over the sphere.

We next prove Corollary 1.5 which derandomizes the Chernoff bound.

First note that we can assume without loss of generality that each XiX_{i} can be sampled with rx=O(log⁡(mn/ε))r_{x}=O(\log(mn/\varepsilon)) bits (by ignoring elements which happen with smaller probability). In particular, let each XiX_{i} have the same distribution as hi(Z)h_{i}(Z) for Z∈u[m′]Z\in_{u}[m^{\prime}] where m′=2rxm^{\prime}=2^{r_{x}} (here we identify [m′][m^{\prime}] with {0,1}rx\{0,1\}^{r_{x}}) and some function hi:[m′]→[m]h_{i}:[m^{\prime}]\to[m]. Let G:{0,1}r→[m′]n\mathcal{G}:\{0,1\}^{r}\to[m^{\prime}]^{n} be a PRG which (ε/2)(\varepsilon/2)-fools (m′,n)(m^{\prime},n)-generalized halfspaces. Now, let Y=(h1(Z1),h2(Z2),…,hn(Zn))Y=(h_{1}(Z_{1}),h_{2}(Z_{2}),\ldots,h_{n}(Z_{n})), where (Z1,…,Zn)=G(w)(Z_{1},\ldots,Z_{n})=\mathcal{G}(w) for w∈u{0,1}rw\in_{u}\{0,1\}^{r}.

Note that YY can be sampled with O(log⁡(mn/ε)⋅(log⁡log⁡2(mn/ε)))O(\log(mn/\varepsilon)\cdot(\log\log^{2}(mn/\varepsilon))) random bits. We claim that YY satisfies the required guarantees. To see this, define the generalized halfspaces

From the Chernoff-Hoeffding bound [Hoe63], we have

We next prove Corollary 1.6 about fooling modular tests.

Let G:{0,1}r→{0,1}n\mathcal{G}:\{0,1\}^{r}\to\{0,1\}^{n} be a PRG{\mathsf{PRG}} which fools (2,n)(2,n)-Fourier shapes with error ε/Mn\varepsilon/\sqrt{Mn}. We claim that G\mathcal{G} fools modular tests with error at most ε\varepsilon.

Let g(x)=\mathds1(∑iaiximod  M∈S)g(x)=\mathds{1}(\sum_{i}a_{i}x_{i}\mod M\in S) be a modular test, let X∈u{0,1}nX\in_{u}\{0,1\}^{n} and Y=G(y)Y=\mathcal{G}(y) for y∈u{0,1}ry\in_{u}\{0,1\}^{r}. In order to fools modular tests, it suffices that

On the other hand, since both these random variables are bounded in the range {0,Mn}\{0,Mn\}, by Lemma 9.1

where the last inequality uses the fact that the Fourier transforms of both random variables are (2,n)(2,n)-Fourier shapes by Equation (20). ∎

Next we prove Corollary 1.7 giving PRG{\mathsf{PRG}}s from combinatorial shapes.

Recall that a combinatorial shape f:[m]n→{0,1}f:[m]^{n}\to\{0,1\} is a function

where gi:[m]→{0,1}g_{i}:[m]\to\{0,1\} and h:{0,…,n}→{0,1}h:\{0,\ldots,n\}\to\{0,1\}. Since ∑igi(xi)∈{0,…,n}\sum_{i}g_{i}(x_{i})\in\{0,\ldots,n\}, it suffices to fool the generalized halfspaces

for θ∈{0,…,n}\theta\in\{0,\ldots,n\} each with error ε/n\varepsilon/n. Hence the claim follows from Corollary 1.3 about fooling generalized halfspaces. ∎

References

Appendix A Proofs from Section 3

Let Ii,kI_{i,k} be the indicator function of the event that h(i)=kh(i)=k. Note that h(v)=∑i,j,kIi,kIj,kvi2vj2.h(v)=\sum_{i,j,k}I_{i,k}I_{j,k}v_{i}^{2}v_{j}^{2}. Therefore,

Let R(it,jt,kt)R(i_{t},j_{t},k_{t}) be if for some t,t′t,t^{\prime} kt≠kt′k_{t}\neq k_{t}^{\prime} but one of iti_{t} or jtj_{t} equals it′i_{t^{\prime}} or jt′j_{t^{\prime}} and otherwise be equal to m−Tm^{-T} where TT is the number of distinct values taken by iti_{t} or jtj_{t}. Notice that by the δ\delta-biasedness of hh that

for fixed values of i1,…,ip,j1,…,jpi_{1},\ldots,i_{p},j_{1},\ldots,j_{p}. We claim that it is at most m−S/2m^{-S/2} where SS is again the number of distinct elements of the form iti_{t} or jtj_{t} that appear in this way an odd number of times. Letting TT be the number of distinct elements of the form iti_{t} or jtj_{t}, the expression in question is m−Tm^{-T} times the number of choices of ktk_{t} so that each value of iti_{t} or jtj_{t} appears with only one value of ktk_{t}. In other words this is m−Tm^{-T} times the number of functions f:{it,jt}→[m]f:\{i_{t},j_{t}\}\rightarrow[m] so that f(it)=f(jt)f(i_{t})=f(j_{t}) for all tt. This last relation splits {it,jt}\{i_{t},j_{t}\} into equivalence classes given by the transitive closure of the operation that x∼yx\sim y if x=itx=i_{t} and y=jty=j_{t} for some tt. We note that any xx that appears an odd number of times as an iti_{t} or jtj_{t} must be in an equivalence class of size at least 22 because it must appear at least once with some other element. Therefore, the number of equivalence classes, EE is at least T−S/2T-S/2. Thus, the sum in question is at most m−TmE≤m−S/2m^{-T}m^{E}\leq m^{-S/2}. Therefore, we have that

Note that the second line above comes from taking MM to be the multiset

Let XiX_{i} denote the indicator random variable which is 11 if h(i)=jh(i)=j and otherwise. Let Z=∑iviXiZ=\sum_{i}v_{i}X_{i}. Now, if hh were a truly random hash function, then, by Hoeffding’s inequality,

Therefore, for a truly random hash function and even integer p≥2p\geq 2, ∥Z∥p=O(∥v∥2)p\left\|Z\right\|_{p}=O(\left\|v\right\|_{2})\sqrt{p}. Therefore, for a δ\delta-biased hash family, we get ∥Z∥pp≤O(p)p/2∥v∥2p+∥v∥1pδ\left\|Z\right\|_{p}^{p}\leq O(p)^{p/2}\left\|v\right\|_{2}^{p}+\left\|v\right\|_{1}^{p}\delta. Hence, by Markov’s inequality, for any t>0t>0,

Appendix B Proofs from Section 4

First we note that since for any complex random variable, ZZ, that

and Var(Z)=Var(ℜ(Z))+Var(ℑ(Z))\textrm{Var}(Z)=\textrm{Var}(\Re(Z))+\textrm{Var}(\Im(Z)), it suffices to prove our lemma when ZZ is a real-valued random variable.

We can now compute the expectation of (∑iZi)k\left(\sum_{i}Z_{i}\right)^{k} by expanding out the polynomial in question and computing the expectation of each term individually. In particular, we have that

Next we group the terms above by the set SS of indices that occur as iji_{j} for some jj. Thus, we get

We note that the expectation in question is 0 unless for each j∈Sj\in S, ZjZ_{j} occurs at least twice in the product. Therefore, the expectation is 0 unless m≤k/2m\leq k/2 and overall is at most Bk−2m∏j∈SVar(Zj)B^{k-2m}\prod_{j\in S}\textrm{Var}(Z_{j}). Thus, the expectation in question is at most

Next, note that by expanding out (∑iVar(Zi))m\left(\sum_{i}\textrm{Var}(Z_{i})\right)^{m} we find that σ2m≥m!∑∣S∣=m∏j∈SVar(Zj).\sigma^{2m}\geq m!\sum_{|S|=m}\prod_{j\in S}\textrm{Var}(Z_{j}). Therefore, the expectation in question is at most

Appendix C Proofs from Section 5

By the pairwise independence of σ\sigma,

In particular, with probability at least 7/167/16, V=∥vt∥22∈[1/6,4/3]V=\left\|v^{t}\right\|_{2}^{2}\in[1/6,4/3]. ∎

for a suitable choice of the constant cc and δ′=exp⁡(−Clog⁡(1/δ))\delta^{\prime}=\exp(-C\log(1/\delta)).

Appendix D Proofs from Section 7

Note that ∣L∣≤Tvar(f)/α≤n2/9|L|\leq\mathsf{Tvar}(f)/\alpha\leq n^{2/9}. Since h∈uHh\in_{u}\mathcal{H} is kk-wise independent, for any index j∈[t]j\in[t],

By Lemma 3.6 applied to vv, we get that for any j∈[t]j\in[t],