Abstract 1 Introduction 2 Preliminaries 3 The Diamond Test 4 The Affine on Subcube Test 5 Reconstruction for Direct Sums References

New Direct Sum Tests

Alek Westover ORCID MIT, Cambridge, MA, USA Edward Yu ORCID MIT, Cambridge, MA, USA Kai Zhe Zheng ORCID MIT, Cambridge, MA, USA
Abstract

A function f:[n]d𝔽2 is a direct sum if there are functions Li:[n]𝔽2 such that f(x)=iLi(xi). In this work we give multiple results related to the property testing of direct sums.

Our first result concerns a test proposed by Dinur and Golubev in [13]. We call their test the Diamond test and show that it is indeed a direct sum tester. More specifically, we show that if a function f is ε-far from being a direct sum function, then the Diamond test rejects f with probability at least Ωn,ε(1). Even in the case of n=2, the Diamond test is, to the best of our knowledge, novel and yields a new tester for the classic property of affinity.

Apart from the Diamond test, we also analyze a broad family of direct sum tests, which at a high level, run an arbitrary affinity test on the restriction of f to a random hypercube inside of [n]d. This family of tests includes the direct sum test analyzed in [13], but does not include the Diamond test. As an application of our result, we obtain a direct sum test which works in the online adversary model of [20].

Finally, we also discuss a Fourier analytic interpretation of the diamond tester in the n=2 case, as well as prove local correction results for direct sum as conjectured by [13].

Keywords and phrases:
Linearity testing, Direct sum, Grids
Funding:
Alek Westover: Supported by MIT SPUR.
Edward Yu: Supported by MIT SPUR.
Kai Zhe Zheng: Department of Mathematics, Massachusetts Institute of Technology, Cambridge, USA. Supported by the NSF GRFP DGE-2141064.
Copyright and License:
[Uncaptioned image] © Alek Westover, Edward Yu, and Kai Zhe Zheng; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational complexity and cryptography
Related Version:
arXiv Version: https://arxiv.org/abs/2408.16092
Editors:
Raghu Meka

1 Introduction

In property testing, one is given query access to a function over a large, typically multidimensional domain, say f:i=1dSiT. The goal is to determine whether or not f satisfies some property, 𝒫, using as few queries to f as possible. Here, a property 𝒫 can be any subset of functions. It is not hard to see that distinguishing between f𝒫 and f𝒫 requires querying the entire domain for any nontrivial property 𝒫, and so we typically settle for an algorithm with a weaker guarantee, typically called a property tester. A tester for 𝒫 is a randomized algorithm, which given input function f, makes queries to f and satisfies the following two properties:

  • Completeness: If f𝒫, the tester accepts with probability 1.

  • Soundness: If f is δ-far from 𝒫, the tester rejects with probability s(δ).

We say that f is δ-far from 𝒫, if the minimal fractional hamming distance between f and any g𝒫 is at least δ. The function s(δ) is referred to as the soundness of the tester and oftentimes one repeats the tester in s(δ)1 times to reject with probability 2/3 in the soundness case. It is clear that for any property, there is a trivial algorithm that queries f on its entire domain, so oftentimes the goal is to design testers whose query complexity is sublinear in the domain size or even independent of the dimension d.

In this paper we consider two property testing questions related to functions known as direct sums. A function f is called a direct sum if it can be written as a sum of functions on the individual coordinates, that is

f(x1,,xd)=i=1dLi(xi),

for some functions Li:SiT. Direct sums are a natural property to consider in the context of property testing. Indeed, when one takes f:𝔽2d𝔽2, then the direct sum property is equivalent to the classic property of affinity (being a linear function plus a constant) considered by Blum, Luby, and Rubinfeld’s seminal work [8]. Property testing of more general versions of direct sums, called low junta-degree functions, has also been considered before in the works of [5, 3]. A junta-degree t function is one that can be written as the sum of t-juntas. Thus, direct sums are junta-degree 1 functions, and direct sum testing is a specialization of the low junta-degree testing problem that appears in [5, 3].

In addition to being a natural property to study, motivation for direct sum testing also comes from its relation to the more widely known direct product testing problem. Historically, direct product testing was first introduced by Goldreich and Safra in [17] due to its potential for application as a hardness amplification step in more efficient PCP constructions [15, 12, 14, 18, 4]. More recently, the related problem of direct sum testing was considered, first by [10] and later by [13]. The motivation for considering direct sums stems in part from the fact that direct sums are similar to direct products in that they can be used to amplify hardness, but with the advantage that the output is a single value, as opposed to an entire tuple. This seems to make direct sum testing more difficult, but has the potential for leading to even more efficient PCPs (in particular, in improving a parameter known as the alphabet size). Analysis of a type of direct sum test is a key piece of Chan’s elegant PCP construction in [9].

Direct Sum Testing.

In [13], Dinur and Golubev give and analyze a direct sum tester which they call the Square in a Cube test. They propose an additional test which they refer to as the diamond test, but leave its analysis for future work. We call this second test the Diamond Test, and describe both of these tests below.

Let the domain be an arbitrary grid [n¯;d]=i=1d[ni] where each [ni]={1,,ni}. We will let the output be 𝔽2 so that our input function is

f:[n¯;d]𝔽2.

Given two points a,b[n¯;d] and x{0,1}d, let interpolation ϕx(a,b) to be the vector obtained by taking ai whenever xi=0 and bi whenever xi=1. The Square in a Cube test proceeds as follows.

Test 1 (Square in a Cube).

Sample random a,b[n¯;d] and x,y{0,1}d. Accept if and only if

f(a)+f(ϕx(a,b))+f(ϕy(a,b))+f(ϕx+y(a,b))=0.

The Diamond Test proceeds in a slightly different manner, which essentially fixes x+y=(1,,1).

Test 2 (Diamond).

Sample random a,b[n¯;d],x{0,1}d. Accept iff

f(a)+f(ϕx(a,b))+f(ϕx(b,a))+f(b)=0.

In addition to the Diamond test, we also consider a family of tests that generalizes the Square in a Cube test. We call this test the Affine on Subcube test.

Test 3 (Affine on Subcube).

Sample a,b[n]d and run an affinity test on the function xf(ϕx(a,b)).

Note that the affinity test can be any arbitrary affinity test for functions 𝔽2d𝔽2. The Square in a Cube test is a special case of the above with the classic BLR affinity test as the affinity test. The Diamond Test, however, is not a specialization of the above.

As is usual in property testing, it is clear that both the Diamond and Affine on Subcube test satisfy completeness, so our main interest is with regards to their soundness.

1.1 Main Results

We now describe our main results. Our first result establishes soundness for the Diamond test. As the completeness is clear, this shows that the Diamond test is indeed a Direct Sum tester.

Theorem 4.

Suppose f:[n]d𝔽2 passes the Diamond test with probability 1ε. Then, f is Cnε-close to a direct sum, for some constant Cn independent of d.

We remark that the theorem above incurs a dependence on n. In contrast, [13] shows a version of the above result with Cn replaced by an absolute constant, C, independent of n. For n=O(1), the soundness we show for the Diamond Test is comparable to what is known for the Square in a Cube test, but for larger n the soundness analysis becomes weaker. This dependence on n in the soundness is not so uncommon in property testing results however. It is comparable to the dependence on field size in the low degree testing results of [2, 21], or on grid size in the junta degree testing results of [5, 3]. We leave it to future work to remove the dependence on n in the soundness.

Our next result is a reformulation of Theorem 4 in the n=2 case. Here the Diamond Test is, to the best of our knowledge, a novel affinity tester. Moreover, we observe that the soundness of the n=2 Diamond Test is equivalent to a succinct Fourier analytic fact regarding a function’s distance to affinity, or equivalently its maximum magnitude Fourier coefficient. Interestingly, we were unable to show this fact without appealing to the soundness of the Diamond test. Intuitively, the Fourier analytic fact says “f is close to affine if and only if when you randomly fix or don’t fix each coordinate of f to a random value, f becomes close to an even or odd function”. Formally, the result is:

Theorem 5.

For f:𝔽2d𝔽2, define (f) to be a random restriction of f obtained as follows: for each i[d] independently, with probability 1/4 restrict xi to 0, with probability 1/4 restrict xi to 1, and with probability 1/2 do not restrict xi. Then, letting 𝖤𝗏𝖾𝗇𝖮𝗋𝖮𝖽𝖽 denote the set of functions that are either even or odd, we have:

𝖽𝗂𝗌𝗍(f,𝖺𝖿𝖿𝗂𝗇𝖾)=Θ(𝔼[𝖽𝗂𝗌𝗍((f),𝖤𝗏𝖾𝗇𝖮𝗋𝖮𝖽𝖽)]).

Along with the Diamond Test, we also describe and analyze a family of testers for direct sum which we call the Affine on Subcube test (3).

Theorem 6.

Fix f:[n]d𝔽2,ε0 and an affinity test T. If f passes the Affine on Subcube test (instantiated with T) with probability 1ε, then f is Cε-close to a direct sum, for some constant C independent of n,d.

By using a suitable erasure-resilient tester as the inner affinity tester in 3, we use Theorem 36 obtain direct sum testers in the online-erasure model recently introduced by [20]. We discuss this result as well as the online-erasure model in more detail in Section 4.2.

Finally, we address a second question posed in [13] regarding reconstructing functions which are close to direct sums. They ask if a test that they call the Shapka test can be used to reconstruct, via a “voting scheme”, a direct sum given query access to its corrupted version. We show that this is indeed the case, and also give an improved reconstruction method that uses fewer queries.

Proposition 7.

Let f:[n]d𝔽2 be ε close to a direct sum L, with (n+1)ε<1/4. Then L can be reconstructed using a voting scheme on f using n queries to f.

We also give lower bounds on the query complexity needed and show that our improved method is asymptotically optimal (up to constant factors) in terms of both query complexity and the fraction of corruptions it can tolerate.

Proof Overview.

We give an overview of the proof of Theorem 4. Our analysis here diverges significantly from that of Dinur and Golubev for the Square in a Cube Test. Before discussing our analysis, we first summarize their approach and where it fails for the Diamond Test.

The underlying idea behind the Square in a Cube Test is that after choosing two points a,b[n]d, any direct sum restricted to the hypercube-like domain i=1d{ai,bi} must be an affine function (i.e multivariate polynomial of degree 1). This idea gives way to a natural interpretation of the Square in a Cube Test

  • Choose two points a,b[n]d randomly and view the domain i=1d{ai,bi} as a hypercube of the appropriate dimension d. Here d is the number of coordinates on which a and b differ.

  • Define the function fa,b:{0,1}d𝔽2 by fa,b(x)=f(ϕx(a,b)).

  • Perform the BLR affinity test on fa,b. That is, choose x,y,z{0,1}d and accept if and only if

    fa,b(x)+fa,b(x+y)+fa,b(x+z)+fa,b(x+y+z)=0.

From here, the analysis of [13] has two parts. First, they apply BLR to show that if the overall Square in a Cube test passes with high probability, then for many a,b, the function fa,b is close to an affine function (or direct sum), say Fa,b, on the hypercube i=1d{ai,bi}. These Fa,b can be thought of as local direct sums that agree with f locally on hypercubes inside of [n]d. The second step is to show that many of these Fa,b are actually consistent with each other and apply a direct product testing result of [16] to conclude that there is in fact a global direct sum F consistent with many Fa,b’s. As the Fa,b’s are in turn largely consistent with f, we get that F is a direct sum close to f, concluding the proof of soundness.

Our analysis of the soundness of the Diamond test, however, requires a different approach. Let us first see what happens when we try to naively adapt the above strategy. After choosing a,b[n]d, instead of applying BLR, the Diamond test performs the following test on fa,b:{0,1}d𝔽2.

Choose x{0,1}d and accept if and only if fa,b(0)+fa,b(x)+fa,b(x+𝟙)+fa,b(𝟙)=0.

There is an issue though: the above is not an affinity tester! Indeed one can check that if fa,b(0)+fa,b(𝟙)=0, resp. 1, then any even, resp. odd, function passes the above test with probability 1. Thus, we would only get that many fa,b are close to even or odd functions, and from here it is not clear how to make the second part of the analysis go through.

We instead combine ideas from the soundness analyses of [10, 7, 3], which use induction. Suppose f:[n]d𝔽2 is ε-far from a direct sum. We wish to show that the Diamond Test rejects f with some non-trivial probability that is independent of d. The inductive approach of both of the mentioned works consist of three main steps: 1) Restate the test on f as choosing a random subdomain that is one dimension and performing the test on f restricted to this subdomain, 2) analyze the soundness in the ε very small case, 3) on the other hand, show that if ε is large then show that f must also be far from a direct sum on many subdomains.

To execute all of the above steps, we have to draw on ideas from all of the mentioned works. For step 1), we take inspiration from [10] and instead analyze a four-function version of the Diamond Test. The reason is that there is no clear way to view the Diamond Test in the manner described above. It is tempting to describe the Diamond Test as choosing a random coordinate, say i=1, and a random value in [n], say 1, and then performing a d1-dimensional version of the Diamond Test on the function f(1,x2,,xd). Unfortunately this does not work as one has to change the distribution that the points in the d1-dimensional grid are chosen. Indeed, if one chooses the points a,b[n]d1 of the one dimension down Diamond Test uniformly at random, then the final d-dimensional points output would agree on 1+(d1)/n coordinates in expectation instead of d/n.

For the small distance case in step 2), we rely on the a hypercontractivity theorem over grids. However, since we are now working with a four-function version of the Diamond Test some additional care is needed in this analysis.

Finally for step 3), we use techniques from agreement testing in the PCP literature [25, 23]. From [25] we borrow their transitive-consistency graph technique used to analyze the so-called Plane versus Plane test and from [23] we show a version of their hyperplane sampling lemma for (d1)-dimensional grids in [n]d.

Paper Outline.

In Section 3 we present and analyze our novel affinity tester (the Diamond test). In Section 4 we give a new class of direct sum tests. In Section 5 we consider the problem of obtaining “corrected” samples from corrupted direct sums.

2 Preliminaries

We now introduce some notations that will be used throughout the paper. We let [n] denote {1,2,,n}. Let [n;d] denote a product space [n1]××[nd]. For a set or event X, we write X¯ to denote the complement of X.

The notion of distance that we use is fractional hamming distance. That is, given two functions f:ST and g:ST, the distance between them is the fraction of entries on which they differ:

𝖽𝗂𝗌𝗍(f,g)=PrxS[f(x)g(x)].

Given a property 𝒫{g:ST}, the distance from f to the property 𝒫 is defined as

𝖽𝗂𝗌𝗍(f,𝒫)=ming𝒫𝖽𝗂𝗌𝗍(f,g).

We say that f is δ-far from 𝒫 if 𝖽𝗂𝗌𝗍(f,𝒫)δ.

Finally, if we do not explicitly specify the distribution a random variable is drawn from is a probability, then the random variable is meant to be drawn uniformly from the appropriate space (which will be clear from context). The constants hidden in our O-notation are never allowed to depend on d. If there is a parameter k that we think of as constant, we will sometimes use the notation Ok() to emphasize that the constant hidden by the O is allowed to depend on k.

Boolean Functions.

Define the interpolation ϕx(a,b) to be the vector obtained by taking ai whenever xi=0 and bi whenever xi=1. A frequently useful property of interpolations is:

Fact 8.

ϕx(a,b)=ϕx+𝟙(b,a).

Given xiSi and p[0,1], let y𝖳p(x) denote a vector in iSi, with each yi sampled independently as follows: set yi=xi with probability p, and otherwise sample yi uniformly from Si; 𝖳p is called the noise operator. Given p[1,0] and x𝔽2d, we define the distribution y𝖳p(x) as: yi=xi+1 with probability p and yi is sampled uniformly from {0,1} otherwise. For a boolean function f:𝔽2d𝔽2 we will use μ(f) to denote the fractional size of the support of f (i.e., the fraction of 𝔽2d on which f outputs 1). We use 𝟙 to denote the all ones vector, and sometimes use 0 to denote the zero-vector (the dimension will be clear from context). For v,w𝔽2d we write v,w to denote iviwi. For boolean functions f,g:𝔽2d𝔽2 we write f,g to denote 𝔼x[f(x)g(x)].

When discussing functions f:[n]d𝔽2 we will always assume n>1.

3 The Diamond Test

We restate the Diamond test, initially proposed by Dinur and Golubev in [13] (recall from Section 2 that ϕx is the interpolation function)

Test 9 (Diamond).

Sample random a,b[n]d,x𝔽2d. Accept iff

f(a)+f(b)=f(ϕx(a,b))+f(ϕx(b,a)).

We will show that 9 is a valid tester for direct sum. First, we analyze the case that the test passes with probability 1.

Lemma 10.

The function f:[n]d𝔽2 is a direct sum if and only if f passes the Diamond test with probability 1.

Proof.

If f is a direct sum then we can write f(x)=iLi(xi). It follows that for any a,b[n]d,

f(a)+f(b)=i(Li(ai)+Li(bi))=f(ϕx(a,b))+f(ϕx(b,a)).

For the other direction, suppose f passes the Diamond test with probability 1. Then, for all x𝔽2d,a[n]d we have

f(a)=f(𝟙)+f(ϕx(𝟙,a))+f(ϕx(a,𝟙)). (1)

Let ei,j[n]d denote a vector which is 1 at all coordinates except coordinate i, where it has value j. Then, repeated application of Equation 1 lets us decompose f(a) as

f(a)=f(𝟙)+i=1d(f(ei,ai)+f(𝟙)).

Thus, f is a direct sum. As a simple corollary of Lemma 10 we have:

Corollary 11.

If f is ε-close to a direct sum, then f passes the Diamond test with probability at least 14ε.

Proof.

Let g be a direct sum with 𝖽𝗂𝗌𝗍(f,g)ε. By a union bound, f and g agree on all 4 points queried by the test (because each query is marginally uniformly distributed), in which case the Diamond test accepts.

With completeness done, the remainder of this section is focused on showing the Diamond test’s soundness as stated in Theorem 4. We restate the theorem below.

Theorem 12.

Suppose f:[n]d𝔽2 passes the Diamond test with probability 1ε. Then, f is Cnε-close to a direct sum, for some constant Cn independent of d.

We sketch the ideas used in the analysis. First, we will generalize to a “4-function” version of the test, which is more amenable to induction. Then, we use hypercontractivity ([1, 19, 3]) to prove Theorem 17, which establishes a dichotomy for 4-tuples of functions that pass the test with probability 1ε: if (f,g,k,h) passes the test with probability ε, then either f (and g,h,k as well) is 2ε-close to a direct sum, or f is Ωn(1)-far from a direct sum. Next, we will relate the pass probability of (f,g,h,k) to the pass probability of 1-variable restrictions of f,g,k,h. This allows us to go down one dimension and apply induction. Crucially, the dichotomy theorem allows us to avoid our closeness factor deteriorating at each step of the induction, which would result in a dependence on the dimension in our result. This dichotomy based approach is inspired by the work of [7, 10], but the details of establishing the dichotomy and performing the induction are quite different.

3.1 The Four Function Diamond Test

In order to facilitate our inductive approach we define a four function version of the diamond test.

Test 13 (4-Function Diamond).

Sample x𝔽2d and a,b[n]d. Accept iff

f(a)+g(ϕx(a,b))+h(ϕx(b,a))+k(b)=0.

The following lemma characterizes what happens when four functions pass with probability 1. It will be used later to establish the base case (in constant dimensions) of our inductive analysis.

Lemma 14.

Suppose (f,g,h,k) passes the 4-function Diamond test with probability 1. Then f,g,k,h are direct sums.

Proof.

If (f,g,h,k) passes the 4-function Diamond test with probability 1 then for all a,x,b we have:

f(a)+g(ϕx(a,b))+h(ϕx(b,a))+k(b)=0=f(b)+g(ϕx+𝟙(b,a))+h(ϕx+𝟙(a,b))+k(a).

Using 8 to simplify we get that for all a,b,

f(a)+k(a)=f(b)+k(b).

Again using the fact that (f,g,h,k) passes the test with probability 1 we have that for all a,x,b:

f(a)+g(ϕx(a,b))+h(ϕx(b,a))+k(b)=0=f(a)+g(ϕx+𝟙(a,b))+h(ϕx+𝟙(b,a))+k(b).

By 8 this implies

g(ϕx(a,b))+g(ϕx(b,a))=h(ϕx(a,b))+h(ϕx(b,a)).

Letting c=ϕx(a,b),d=ϕx(b,a), and noting that c,d can be arbitrary (unrelated) elements of [n]d, we have that for all c,d.

g(c)+g(d)=h(c)+h(d).

Combining our observations so far we conclude that there exist constants α,β such that for all a[n]d we have

f(a)=k(a)+α,g(a)=h(a)+β.

Thus, for all a,b we have

f(a)+f(b)=g(ϕx(a,b))+g(ϕx(b,a))+α+β.

Taking x=0 we conclude

f(a)+f(b)=g(a)+g(b)+α+β.

Thus, there exists γ such that for all a we have

f(a)=g(a)+γ.

In summary, we have shown that for all a,b,x, we have

f(a)+f(b)=f(ϕx(a,b))+f(ϕx(b,a))+α+β.

Setting x=0 again shows that α+β=0. Thus, we have that f passes the (1-function) Diamond test with probability 1. By Lemma 10 this implies that f is a direct sum. Finally, recall that we have shown in the course of our proof that g,h,k all differ from f by a constant. This concludes the proof.

3.2 A Dichotomy for Functions Passing the Diamond Test

We are now prepared to show Theorem 17, which states that if the 4-function Diamond test accepts (f,g,h,k) with probability exactly 1ε then f is either 2ε-close to a direct sum, or Ωn(1)-far from being a direct sum. To this end, we first establish two lemmas which will useful in the proof.

Lemma 15.

Fix d and functions f,g,h:[n]d𝔽2. Suppose f,g,h have

Pra,b[n]d,x𝔽2d[f(a)+g(ϕx(a,b))+h(ϕx(b,a))=1]<ε.

Then, f,g,h are 3ε-close to constants.

Proof.

Fix f,g,h as in the theorem. Performing a union bound and using 8 we have

Pra,b,x[f(a)+g(ϕx(a,b))+h(ϕx(b,a))=f(b)+g(ϕx(a,b))+h(ϕx(b,a))]>12ε.

Thus, f is 2ε-close to a constant α. Then, by a union bound we have

Pra,b,x[g(ϕx(a,b))+h(ϕx(b,a))=α+1]>13ε.

Of course, the distribution of (ϕx(a,b),ϕx(b,a)) is the same as the distribution of (a,b). Thus, we have

Pra,b[g(a)+h(b)=α+1]>13ε.

By the probabilistic method this implies that g,h are each 3ε-close to constants.

We will also need the following lemma, which is an extension of the classic small set expansion property of the noisy hypercube (see [24]) to grids.

Fact 16 ([24]).

Fix n. There exists λn>0 such that for any d, and any set S[n]d we have

Pra[n]d,b𝖳1/2(a)[aSbS]2μ(S)1+λn.

Now we are ready to establish the dichotomy theorem.

Theorem 17.

Fix n. There exists a constant cn>0 such that the following is true for any d and any functions f,g,h,k:[n]d𝔽2. Suppose k has 𝖽𝗂𝗌𝗍(k,𝖽𝗂𝗋𝖾𝖼𝗍𝗌𝗎𝗆)<cn. Then, the 4-function Diamond test rejects (f,g,h,k) with probability at least 𝖽𝗂𝗌𝗍(k,𝖽𝗂𝗋𝖾𝖼𝗍𝗌𝗎𝗆)/2.

Proof.

Fix f,g,k,h as described in the theorem statement. Let χ be the closest direct sum to k. Then,

χ(a)+χ(b)=χ(ϕx(a,b))+χ(ϕx(b,a)).

Thus, our goal is equivalent to showing that

Pra,x,b[(χ+f)(a)+(χ+g)(ϕx(a,b))+(χ+h)(ϕx(b,a))(χ+k)(b)]𝖽𝗂𝗌𝗍(k,𝖽𝗂𝗋𝖾𝖼𝗍𝗌𝗎𝗆)/2.

Thus, it suffices to consider the case that the closest direct sum to k is the zero function. We assume this for the remainder of the proof. Then, 𝖽𝗂𝗌𝗍(k,𝖽𝗂𝗋𝖾𝖼𝗍𝗌𝗎𝗆)=μ(k). We are already done unless

Pra,x,b[f(a)+g(ϕx(a,b))+h(ϕx(b,a))=1]2μ(k). (2)

Thus, we may assume that Equation 2 is true. Now, by Lemma 15 we have that f,g,h are 6μ(k)-close to constants. Without loss of generality we may assume g,h are both closer to 0 than to 1; otherwise we can add 1 to both g,h, which does not affect the sum g(ϕx(a,b))+h(ϕx(b,a)). If f were closer to 1 than to 0 then we would have

Pr(a,x,b)[f(a)=1,g(ϕx(a,b))=h(ϕx(b,a))=0]118μ(k)>2μ(k),

with the final inequality holding by our assumption that μ(k)<cn (we will choose cn<.001); but this would contradict Equation 2, so it cannot happen. Thus, f,g,h are all 6μ(k)-close to 0.

Now, we return to analyzing the probability that the 4-function Diamond test rejects (f,g,h,k); we write Pr[𝗋𝖾𝗃] to denote the probability. Then,

Pr[𝗋𝖾𝗃] Pra,x,b[k(b)=1f(a)=g(ϕx(a,b))=h(ϕx(b,a))=0]
μ(k)Pra,b[k(b)=f(a)=1]Pra,x,b[k(b)=g(ϕx(a,b))=1]Pra,x,b[k(b)=h(ϕx(b,a))=1]
μ(k)μ(k)μ(f)Pra,b𝖳1/2(a)[k(b)=g(a)=1]Pra,b𝖳1/2(a)[k(b)=h(a)=1].

Then, using 16 we have

Pr[𝗋𝖾𝗃]μ(k)(1μ(f))(μ(k)+μ(g))1+λn(μ(k)+μ(h))1+λn),

where λn>0 is the constant from 16. Recalling that μ(f),μ(g),μ(h)6μ(k) we have:

Pr[𝗋𝖾𝗃]μ(k)(1μ(k)100μ(k)λn).

Thus, there is some constant cn (dependent only on n) such that if μ(k)cn then the rejection probability in is at least μ(k)/2, as desired.

3.3 A Lemma Concerning Restrictions

To complete our analysis of the Diamond test, we will relate the Diamond test to lower dimensional Diamond tests, and argue inductively. The Dichotomy lemma just established will be the key to ensuring that our soundness parameter does not deteriorate as we perform the induction. First, we need a lemma that controls the restrictions of a function which is far from a direct sum; namely, we show that a function which is far from a direct sum cannot have too many restrictions which are close to direct sums.

For some set R[n]d, we let f|R denote the restriction of f to R, so that f|R:S𝔽2 is given by f|R(x)=f(x) for all xR. We will specifically be considering restrictions where R is of the form R={x[n]d|xi=j} for some 1id and some j[n]. We call such R, one-variable restrictions. Throughout this subsection we use 𝟙 to denote the indicator of an event. The goal of this subsection is to establish the following Lemma.

Lemma 18.

Suppose there are 100n2/ε one-variable restrictions R such that f|R is ε-close to a direct sum on R. Then, f is O(ε)-close to a direct sum.

We will need Dinur and Golubev’s result regarding the soundness of the square in the cube test, which we state below.

Theorem 19 ([13]).

Let f:[n]d𝔽2 satisfy,

Pra,b[n]d,x,y,z{0,1}d[f(a)+f(ϕx(a,b))+f(ϕy(a,b))+f(ϕx+y(a,b))=0]1ε.

Then f is O(ε)-close to a direct sum.

At a high level our proof of Lemma 18 follows the strategy of the plane versus point analysis of [25]. Suppose that there are many restrictions Ri with local direct sums fi:Ri𝔽2 such that fi and f are close. We will first show that many – in fact at least a constant fraction – of these fi’s are actually consistent with each other. Using these consistent fi’s we can then define a function F on the whole space and argue that 1) F is close to f and 2) F passes the square in the cube test with high probability and is thus close to a direct sum. For both 1) and 2) we are crucially using the fact that F is defined using many consistent direct sums, so for nearly every point x in the domain, there are in fact many of these local direct sums defined on x.

3.3.1 A Sampling Lemma

In order to carry out the mentioned strategy, we must first show a sampling lemma. This lemma roughly states that given a large enough set of restrictions Ri, the measure on [n]d produced by first choosing a random Ri and then choosing a random xRi is nearly equal to the uniform measure up to constant factors (which will be negligible).

Let be a set of one variable restrictions and let M=||. Define the measure ν on points [n]d via the following sampling procedure:

  • Choose R.

  • Choose xR.

Letting N(x)=|{R|Rx}|, it is clear that,

ν(x)=N(x)M1nd1.

For a subset of points S[n]d, we define

ν(S)=xSν(x).

We also let μ denote the standard uniform measure on [n]d, so for a set of points S[n]d, we have μ(S)=|S|nd. At times we will also use μ to denote the uniform measure over grids of dimension other than d. It will be clear from context when this is the case and we remark that one should think of the dimension in this subsection as being arbitrary.

Lemma 20.

Let be a set of one-variable restrictions of size M. Then,

𝔼x[N(x)]=Mnand𝖵𝖺𝗋(N(x))Mn.
Proof.

For the first part, we have, by linearity of expectation:

𝔼x[N]=R𝔼x[𝟙(xR)]=Mn.

Towards the second part, we write

𝔼[N2] =R1,R2𝔼x[𝟙(xR1)𝟙(xR2)]
=R𝔼x[𝟙(xR)]+R1R2𝔼x[𝟙(xR1)𝟙(xR2)]
Mn+M2n2.

It follows that,

Var(N)=(𝔼x[N])2𝔼[N2]Mn.

Applying Chebyshev’s inequality, we get the following.

Lemma 21.

For any c>0, it holds that

Prx[|N(x)Mn|cMn]nc2M.
Proof.

This lemma follows from a direct application of Chebyshev’s inequality combined with the variance bound in Lemma 20.

Lemma 22.

For any set of points S[n]d and any set of one-variable restrictions of size M, we have

12(μ(S)4nM)ν(S)2μ(S)+5nM.
Proof.

For each integer i, let

mi=|{x[n]d| 2iMnN(x)<2i+1Mn}|.

By Lemma 20 we get that

mind1(2i1)2M/n.

Towards the upper bound, we expand ν(S) and perform a dyadic partitioning:

ν(S)=xSν(x)=xSN(x)Mnd11Mnd1(2Mn|S|+i=1mi2i+1Mn).

The first term in the parenthesis contributes 2μ(𝒮), whereas the contribution of the second summand can be upper bounded by

1ndi=1mi2i+1nMi=12i+1(2i1)25nM

For the lower bound, we have

ν(S)=xSν(x)xS,NM/(2n)ν(x)|{xS|N(x)M/(2n)}|12nd.

To lower bound the last term above, we use Lemma 21 to get

Prx[N(x)<M2n]4nM.

It follows that

|{xS|N(x)M/(2n)}|nd((μ(S)4nM).

Putting everything together, we get the desired lower bound:

ν(S)12(μ(S)4nM).

3.3.2 Proof of Lemma 18

Suppose ={R1,,RM} is the set of one-variable restrictions on which f is ε-close to a direct sum. For each Ri, let fi be this direct sum, so

𝖽𝗂𝗌𝗍(fi,f|Ri)ε,

for each 1iM. By assumption M100n2/ε. Note that if ε is large – say ε1100 – then the result is trivial, so for the remainder of the proof we suppose ε<1100.

As a useful fact, we show that the set of direct sum functions has minimum distance 1n.

Lemma 23.

For any two distinct direct sums f and g, we have

𝖽𝗂𝗌𝗍(f,g)1n.
Proof.

Write f(x)=i=1dLi(xi) and g(x)=i=1dLi(xi). First suppose for each i, LiLi is constant, then since f(x)g(x), we have δ(f,g)=1 and we are done.

Suppose that there is some i such that LiLi is not the constant function and without loss of generality, let this i be 1. Then,

Prx[n]d[f(x)g(x)]=𝔼x2,,xd[Prx1[L1(x)L1(x)i=2dLi(xi)Li(xi)]].

To conclude, note that for any x2,,xd, the inner probability on the right hand side above is at least 1/n since L1L1 is not the constant function.

We now construct the following graph G=(V,E). The vertex set is V={1,,M} while the set of edges E consists of all pairs (i,j) such that the functions fi and fj are consistent:

fi|RiRj=fj|RiRj.

If RiRj is empty, then we also consider fi and fj consistent and have (i,j)E. We will first show that G contains a large clique. Call a graph is transitive if it is an edge disjoint union of cliques. Also define

β(G)=max(i,j)EPrkV[(i,k),(j,k)E].

Note that G is transitive if and only if β(G)=0. The following lemma from [25] gives a sort of approximate version of this fact and states that if β(G) is small then G is almost a transitive graph.

Lemma 24.

The graph G can be made transitive by removing at most 3β(G)|V|2 edges.

In our next two lemmas we show that G has many edges, and then bound β(G). This will establish that G contains a large clique, which corresponds to many local direct sums fi that are consistent with one another.

Lemma 25.

The graph G has at least 0.9M2 edges.

Proof.

For each Ri, let SiRi be the set of points on which fi and f differ. We have that

|Si||Ri|ε,

by assumption.

Now fix an Ri. We will apply Lemma 22 inside of Ri, which is isomorphic to the grid [n]d1. For each j, let Rj=RiRj. Let ={Rj|RjSiRj3ε}, and let M=||. Now consider the size of Si inside of Ri under the measure ν. We have,

ν(Si)3ε.

By Lemma 22

3ενR(Si)2ε+5n/M.

It follows that,

M5nε.

Thus,

PrRi,Rj[|RiRjSi||RiRj|3ε]5nεM.

By a union bound, it follows that with probability at least 110nεM, we have that both

|RjRiSi||RjRi|3εand|RjRiSj||RjRi|3ε.

For such i,j, we get that

PrxRiRj[fi(x)=fj(x)]1PrxRiRj[xSiSj]16ε>1n,

and fi|RiRj=fj|RiRj by Lemma 23. Thus choosing i,j randomly, we get that they are adjacent in G with probability at least 110nεM0.9.

Lemma 26.

Suppose Ri,Rj are distinct one-variable restrictions such that fi|RiRjfj|RiRj. Then,

PrRk[fi|RiRjRk=fj|RiRjRk]5n2Mε20.
Proof.

Let W=RiRj. For each k let Rk=RkW, let fi=fi|W, and let fj=fj|W.

Throughout the proof we will consider W as our ambient space and we will apply Lemma 22 inside of W. Note that we may do so because W is isomorphic to the grid [n]d2. Define the following set of one-variable restrictions inside W:

={WRk|Rk,fi|Rk=fj|Rk}.

We will show that || cannot be too large. Indeed, let M denote its size and let SW be

S={xW|fi(x)fj(x)}.

We have that |S||W|1n. On the other hand, by definition of , we have that νR(S)=0. Therefore by Lemma 22:

012(1n4nM).

It follows that

M4n2.

Finally there can be up to 2n additional restrictions Rk such that RkRi= or RkRj=. The result follows.

Combining Lemma 25 and Lemma 26, we get that G contains a transitive subgraph with at least 0.8M2 edges. Let 𝒞1,,𝒞J be the edge disjoint union cliques of this transitive subgraph and say 𝒞1 is the largest one. It follows that,

0.8M2I=1J|𝒞i|2|𝒞1|M,

and G contains a clique of size M1=0.8M. From now we let 𝒞 denote this clique and let 𝒞={1,,M1}. We define the following function F using the functions f1,,fM1: set F(x)=fj(x) if there is some j𝒞1 such that xRj, and F(x)=0 otherwise.

To conclude, we will show that F is close to f and F is close to a direct sum. This will establish that f is close to a direct sum.

Lemma 27.

F is 3ε-close to f.

Proof.

Let S={x[n]d|f(x)F(x)}. Since f is ε-close to F on the restrictions Ri for all i𝒞, we have

ν𝒞(S)ε.

By Lemma 22, it follows that,

ε12(μ(S)4n0.8M),

and

μ(S)3ε.

Lemma 28.

F is O(ε)-close to a direct sum.

Proof.

We will show that F passes the square in a cube test with high probability. Recall this test operates by choosing a,b[n]d, x,y{0,1}d and checking if F satisfies,

F(a)+F(ϕx(a,b))+F(ϕy(a,b))+F(ϕx+y(a,b))=0.

Note that F passes if there is some i𝒞 such that a,bRi. Indeed, in this case all of the queried points are in Ri, so F and the direct sum fi agree on all of the queried points and

F(a)+F(ϕx(a,b))+F(ϕy(a,b))+F(ϕx+y(a,b))=fi(a)+fi(ϕx(a,b))+fi(ϕy(a,b))+fi(ϕx+y(a,b))=0.

To bound the probability that i𝒞 such that a,bRi, let N(x)=|{i𝒞|xRi}|. By Lemma 21,

Pra[N(a)M1.6n]5nM.

Now condition on a satisfying N(a)M1.6n and let 𝒞′′={i𝒞|aRi}. We label 𝒞′′={1,,M′′} where M′′M1.6n and let N′′(x)=|{i𝒞′′|xRi}|. Then by Lemma 21 again,

Prb[N′′(b)0]nM′′1.6n2M.

By a union bound, with probability at least 17n2M we have that a and b are both contained in some Ri with i𝒞. It follows that F passes the square in a cube test with probability at least 17n2M. By Theorem 19, F is O(n2M)=O(ε)-close to a direct sum.

Proof of Lemma 18.

The result follows by combining Lemma 27, Lemma 28 and using the triangle inequality.

3.4 Soundness of the Diamond Test

Equipped with Theorem 17 we complete the proof of Theorem 4. Ultimately, we wish to conclude that if the 4-function Diamond test rejects (f,g,h,k) with probability exactly ε, then f,g,h,k are all O(ε)-close to direct sums. However, what we have thus far only allows us to to conclude that f,g,k,h are each either cn-far from being a direct sum, or 2ε-close to a direct sum. Our next theorem rules out the former possibility.

Theorem 29.

Fix n. Let cn be the constant from Theorem 17. There is a constant δn such that the following holds. Fix d, and functions f,g,h,k:[n]d𝔽2. Suppose f is cn-far from being a direct sum. Then, the 4-function Diamond test rejects (f,g,h,k) with probability at least δn.

Proof.

By Lemma 18 there exists a constant Kn such that if f has at least 100n2/cn restrictions which are cn/Kn-close to affine, then f is cn-close to affine. Define Nn=100n2/cn+1 and δn=min(cn/(2Kn),n3Nn). We will prove the theorem by induction on the dimension d.

The base case is dNn. If dNn then by Lemma 10 the 4-function Diamond test rejects (f,g,h,k) with non-zero probability since f is not a direct sum. But, any non-zero probability over events determined by a,b,x is at least 1/n3Nnδn.

Now, fix d>Nn, and assume the theorem for functions on 𝔽2d1. Let fi,σ:[n]d1𝔽2 denote the function obtained by taking f and fixing xi=σ. Then, there is some i[d] such for all σ[n] the restriction fi,σ is cn/Kn-far from a direct sum. To analyze the probability that the 4-function Diamond test rejects (f,g,h,k), we consider a partition of the probability space into 2n2 disjoint events. The events are the value in [n]2×𝔽2 that our sampled (ai,bi,xi) takes. Now, consider the probability that the 4-function Diamond test rejects (f,g,h,k), conditional on (ai,bi,xi)=(α,β,ξ) for some α,β,ξ. Conditional on this event, we will sample a,b[n]d1,x𝔽2d1 and check:

fi,α(a)+gi,ϕξ(α,β)(ϕx(a,b))=hi,ϕξ(β,α)(ϕx(b,a))+ki,β(b).

This is precisely a 4-function Diamond test on (d1)-dimensional functions. Now we consider two cases.

Case 1: 𝒇𝒊,𝜶 is 𝒄𝒏-far from being a direct sum.

Then by the inductive hypothesis this (d1)-dimension test will reject with probability at least δn.

Case 2: 𝗱𝗶𝘀𝘁(𝒇𝒊,𝜶,𝗱𝗶𝗿𝗲𝗰𝘁𝘀𝘂𝗺)[𝒄𝒏/𝑲𝒏,𝒄𝒏].

Then, by Theorem 17 this (d1)-dimensional test rejects with probability at least cn/(2Kn)δn.

We have seen that in all cases, the lower dimensional 4-function Diamond tests reject with probability at least δn. Thus, the actual 4-function Diamond test rejects with probability δn as well.

Combining Theorem 17 and Theorem 29 we have get the following corollary and conclude the proof of Theorem 4.

Corollary 30.

If (f,g,h,k) passes the 4-function Diamond test with probability 1ε, then f,g,h,k are each On(ε)-close to direct sums.

Proof.

The result follows immediately from Theorem 17 and Theorem 29. We can now conclude the proof of Theorem 4 and establish soundness for the Diamond test.

Proof of Theorem 4.

The result follows from Corollary 30 by setting f=g=h=k.

3.5 The Fourier Analytic Interpretation of the Diamond Test

In this section, we give a Fourier analytic interpretation of the Diamond test. Let 𝖤𝗏𝖾𝗇 denote the class of functions f:𝔽2d𝔽2 satisfying f(x+𝟙)=f(x) and let 𝖮𝖽𝖽 denote the class of functions f:𝔽2d𝔽2 satisfying f(x+𝟙)=f(x)+1. Let 𝖤𝗏𝖾𝗇𝖮𝗋𝖮𝖽𝖽=𝖤𝗏𝖾𝗇𝖮𝖽𝖽. We note that 𝖤𝗏𝖾𝗇𝖮𝗋𝖮𝖽𝖽 has a nice Fourier analytic interpretation: f𝖤𝗏𝖾𝗇𝖮𝗋𝖮𝖽𝖽 implies that (1)f has either all its Fourier-mass on even-sized characters, or all of its Fourier-mass on odd-sized characters. Given a function f:𝔽2d𝔽2, define random variable (f) to be a random restriction of f obtained as follows: for each i[d] independently, with probability 1/4 restrict xi to 0, with probability 1/4 restrict xi to 1, and with probability 1/2 do not restrict xi. We now show that the Diamond test’s correctness is equivalent to the following Fourier analytic fact

Theorem 31.
𝖽𝗂𝗌𝗍(f,𝖺𝖿𝖿𝗂𝗇𝖾)O(𝔼[𝖽𝗂𝗌𝗍((f),𝖤𝗏𝖾𝗇𝖮𝗋𝖮𝖽𝖽)])

In fact, we show something stronger: there is a very tight quantitative relationship between

𝔼[𝖽𝗂𝗌𝗍((f),𝖤𝗏𝖾𝗇𝖮𝗋𝖮𝖽𝖽)]

and the probability that the Diamond test rejects f.

Lemma 32.

Fix f. Let ε be the probability that the Diamond test rejects f, and let

δ=𝔼[𝖽𝗂𝗌𝗍((f),𝖤𝗏𝖾𝗇𝖮𝗋𝖮𝖽𝖽)].

Then,

2δε4δ.
Proof.

Fix f,ε,δ as in the lemma statement. Given a,b define Ca,b={ϕx(a,b)x𝔽2d} and fa,b(x)=f(ϕx(a,b)). We have:

ε=Pra,b,x[fa,b(x)+fa,b(x+𝟙)fa,b(0)+fa,b(𝟙)]. (3)
Claim 33.

ε4δ.

Let δa,b=𝖽𝗂𝗌𝗍(fa,b,𝖤𝗏𝖾𝗇𝖮𝗋𝖮𝖽𝖽) . By a union bound we have

Prz,x[fa,b(x+𝟙)+fa,b(x)fa,b(z+𝟙)+fa,b(z)]4δa,b.

By averaging, δ=𝔼a,b[δa,b]. Thus,

Pra,b,z,x[fa,b(x+𝟙)+fa,b(x)fa,b(z+𝟙)+fa,b(z)]4δ. (4)

Now, observe that for random a,b,z,x the following two distributions are the same:

  1. 1.

    (ϕx(a,b),ϕx(b,a),a,b)

  2. 2.

    (ϕx(a,b),ϕx(b,a),ϕz(a,b),ϕz(b,a)).

Thus Equation 4 implies ε4δ.

Claim 34.

ε2δ.

For any function g,

Prx[g(x)g(x+𝟙)]=2𝖽𝗂𝗌𝗍(g,𝖤𝗏𝖾𝗇),
Prx[g(x)=g(x+𝟙)]=2𝖽𝗂𝗌𝗍(g,𝖮𝖽𝖽).

Thus, for any a,b we have

Prx[fa,b(x)+fa,b(x+𝟙)fa,b(0)+fa,b(𝟙)]2𝖽𝗂𝗌𝗍(fa,b,𝖤𝗏𝖾𝗇𝖮𝗋𝖮𝖽𝖽).

Averaging over a,b on both sides gives ε2δ.

Proof of Theorem 31.

The result follows from the soundness of the Diamond Test, Theorem 4

4 The Affine on Subcube Test

In this section we consider a class of direct sum tests that generalizes the Square in Cube test of [13]. We call these tests Affine on Subcube tests. Indeed, the Square in Cube test can be viewed as performing the BLR affinity test inside of a random induced hypercube inside of [n]d. We show that in fact testing for affinity on a random subcube with any affinity tester also works as a direct sum test.

Test 35 (Affine on Subcube).

Sample a,b[n]d and run an affinity test that has soundness function s(δ)=Ω(δ) on the function xf(ϕx(a,b)).

The flexibility of being able to use any affinity tester also enables us to obtain a direct sum test with additional properties such as erasure resiliency, which we discuss further in Section 4.2, and less use of randomness, which we discuss in Section 4.1. Furthermore, we believe that our analysis for going from local direct sums to a global direct sum is simpler than that of [13] and thus noteworthy on its own.

One final benefit of our analysis is that it fixes an error in [13]’s analysis. Specifically, they establish that a function f passing the Square in Cube test with probability 1ε is locally close to a direct sum (this is basically Lemma 39 in our presentation), but they do not show how to combine these local direct sums into a global direct sum.

We now show that the Affine on Subcube test is a valid direct sum tester. Once again, completeness is clear. If f is a direct sum, then the Affine on Subcube test passes with probability 1. Our focus is then on showing soundness.

Theorem 36.

Fix f:[n]d𝔽2,ε0 and an affinity test T. If f passes the Affine on Subcube test (instantiated with T) with probability 1ε, then f is Cε-close to a direct sum, for some constant C independent of n,d.

Proof.

Fix f as in the theorem statement. That is, satisfying

𝔼a,b[n]d[𝖽𝗂𝗌𝗍(xf(ϕx(a,b)),𝖺𝖿𝖿𝗂𝗇𝖾)]O(ε). (5)

We re-interpret Equation 5 in three steps. First, observe that Equation 5 is equivalent to

𝔼a,b[n]d,z𝔽2d[𝖽𝗂𝗌𝗍(xf(ϕz(a,b))+f(ϕx+z(a,b)),𝗅𝗂𝗇𝖾𝖺𝗋)]O(ε). (6)

Next, observe that we can rewrite ϕx+z(a,b) as follows:

ϕx+z(a,b)=ϕx(ϕz(a,b),ϕz(b,a)).

In light of this observation, Equation 6 is equivalent to

𝔼a,b[n]d,z𝔽2d[𝖽𝗂𝗌𝗍(xf(ϕz(a,b))+f(ϕx(ϕz(a,b),ϕz(b,a))),𝗅𝗂𝗇𝖾𝖺𝗋)]O(ε). (7)

Of course, the distribution of (ϕz(a,b),ϕz(b,a)) is the same as the distribution of (a,b). So, we can rewrite Equation 7 as:

𝔼a,b[n]d[𝖽𝗂𝗌𝗍(xf(a)+f(ϕx(a,b)),𝗅𝗂𝗇𝖾𝖺𝗋)]O(ε). (8)

This interpretation of the test is more convenient to work with.

For each a,b define fab to be the function xf(a)+f(ϕx(a,b)), and let εab be the probability that fab fails the linearity test. Clearly 𝔼[εab]=𝔼[εa]O(ε). Because fab passes the linearity test with probability 1εab, there is vector Fa(b)𝔽2d such that

Prx[fab(x)=Fa(b),x]>1O(εab), (9)

where v,w=iviwi. We will now show that bFa(b) is close to a direct product, by proving that this function passes a certain direct product test. Dinur and Golubev [13] give the following direct product test (which is slightly more convenient here than the original direct product test of [16]):

Test 37 (Direct Product Test).

Sample x[n]d. Sample a set A by including each i[d] in A with probability 3/4. Sample y by setting yi=xi if iA, and otherwise sampling yi uniformly from [ni]. Accept iff f(x)i=f(y)i for all iA.

Using [11], Dinur and Golubev show

Fact 38.

If f passes 37 with probability 1ε, then f is O(ε)-close to a direct product.

Now, we use 38 to show that bFa(b) is close to a direct product.

Lemma 39.

bFa(b) is O(εa)-close to a direct product.

Proof.

Given b,b define 𝒟bb on 𝔽2d as follows. If x𝒟bb then for each i[d] independently, xi is determined as follows:

If bibi, then xi=0. If bi=bi, then xi=1 with probability 2/3 and 0 otherwise.

Define 𝖾𝗊3/4=𝖳(3n/41)/(n1). If b𝖾𝗊3/4(b), then for each i independently, bi=bi with probability 3/4. Now, observe that if we sample b𝖾𝗊3/4(b) and x𝒟bb, then the values xi are independent uniformly random bits. However, if we choose b,x in this manner, then the joint distribution of (b,b,x) satisfies

ϕx(a,b)=ϕx(a,b).

This is because we select ai whenever bibi. Then, performing a union bound on Equation 9 (and averaging away the dependence on b) we have that

Prb[n]d,b𝖾𝗊3/4(b),x𝒟bb[Fa(b),x=fab(x)=fab(x)=Fa(b),x]>1O(εa). (10)

For each a,b,b, define

δabb=Prx𝒟bb[Fa(b)+Fa(b),x0].

By Equation 10, 𝔼b[n]d,b𝖾𝗊3/4(b)[δabb]<O(εa). Intuitively, if δabb is small then Fa(b),Fa(b) must have some “agreement”. More precisely we have:

Claim 40.

If δabb<1/3 , then for all i where bi=bi we have Fa(b)i=Fa(b)i

Proof.

Suppose to the contrary that there is some i[d] with bi=bi but Fa(b)iFa(b)i. If x𝒟bb then there is a 1/3 chance of xi=0 and a 2/3 chance of xi=1, and this is independent of the values of xj for ji. This means that Fa(b)+Fa(b),x takes on either value in 𝔽2 with probability at least 1/3, implying that δabb1/3. Now, by Markov’s Inequality we have

Prb[n]d,b𝖾𝗊3/4(b)[δabb1/3]3𝔼b,b[δabb]<O(εa). (11)

Given b,b let Δ¯(b,b) denote the set of coordinates i where bi=bi. By Equation 11 we have

Prb[n]d,b𝖾𝗊3/4(b)[Fa(b)i=Fa(b)iiΔ¯(b,b)]>1O(εa).

By 38 we conclude that Fa(b) is O(εa)-close to a direct product.

Now we conclude the proof of Theorem 36. For each a, let (g1(a,b1),,gd(a,bd)) be a direct product that is close O(εa)-close to Fa(b); the existence of these direct products was shown in Lemma 39. Then,

Pra,x,b[fab(x)=igi(a,bi)xi]>1O(ε). (12)

Observe that ϕx(a,b)=ϕ𝟙+x(b,a). Thus, by Equation 12 and a union bound we have

Pra,b,x[igi(a,bi)xi+f(a)=fab(x)=fba(x+𝟙)=f(b)+igi(b,ai)(1+xi)]>1O(ε). (13)

For each a,b, define

λab=Prx[i(gi(a,bi)+gi(b,ai))xiigi(b,ai)+f(a)+f(b)].

By Equation 13, 𝔼ab[λab]O(ε). If λab<1/2 then we must have

igi(b,ai)=f(a)+f(b).

By Markov’s inequality:

Pra,b[λab1/2]2𝔼a,b[λab]O(ε).

Thus, we have:

Pra,b[f(a)=f(b)+igi(b,ai)]>1O(ε).

Then, by the probabilistic method there exists β such that

Pra[f(a)=f(β)+igi(β,ai)]>1O(ε).

That is, f is O(ε)-close to the direct sum af(β)+igi(β,ai).

4.1 Derandomization

In this section we show how to use Theorem 36 to obtain a more randomness-efficient direct sum tester than the Square in Cube test or Diamond test. In particular, we define the Diamond in Cube test as follows: run the Diamond test on the restriction of f to a random subcube (i.e., f(ϕx(a,b))).

We now show that the Direct-Sum Diamond test is more randomness-efficient than the Square in Cube test and the Diamond in Cube test for some parameter regimes. In the following discussion we assume that n is a power of two for convenience.

In the statement of tests like the Square in Cube test we say “sample a,b[n]d,x,y𝔽2”. This would seem to indicate that the test requires (2+2log2n)d bits of randomness. However, if we look inside the Square in Cube test, we see that this is not the case. The Square in Cube test actually requires sampling from the following distribution:

(ϕ0(a,b),ϕx(a,b),ϕy(a,b),ϕx+y(a,b)),

where a,b[n]d and x𝔽2d. However, sampling from this distribution does not actually require sampling a,b,x,y fully. Instead, we can sample from the distribution as follows. First, sample a[n]d,x,y𝔽2d. Then we partially sample b. Note that we don’t need to sample bi if xi=yi=0, because in this case the value of bi will not be needed in any of the query points. Thus, the average number of random bits required to create a sample for the Square in Cube test is only (2+1.75log2n)d.

On the surface the Diamond test might appear to be more efficient. Rather than sampling a,b,x,y it only needs to sample a,b,x. However, the Diamond test actually requires more random bits than the Square in Cube test if n20. The number of random bits required to sample from the Diamond in Cube’s distribution is (2log2n+(11/n))d.

Now, we claim that the Diamond in Cube test is more randomness-efficient than both the Diamond test and the Square in Cube test, at least for large n. A simple computation shows that we can obtain samples from the Diamond in Cube test’s sample distribution using only (2.5+1.5log2n)d random bits, vindicating this claim.

4.2 Direct Sum Testing in the Online Adversary Model

In this section we show that an immediate application of the Affine on Subcube test from Theorem 36 yields direct sum testers that are online erasure-resilient. The t-online erasure model was first considered by Kalemaj, Raskhodnikova, and Varma in [20] and was further studied in [22, 6]. The properties that these works consider include linearity, low degree, and various properties of sequences. Let us now describe the model.

We are once again given query access to a function f:[n]d𝔽2, and the goal is the same as in direct sum testing – to distinguish whether f is a direct sum, or far from a direct sum. The twist is that in the t-online erasure model, there is an adversary who is allowed to erase any t entries of f after each query that the property testing algorithm makes. If a point is queried after it is erased, then the oracle will return instead of the actual value f(x). It is not hard to see that neither the Diamond test that we analyze nor the Square in the Cube test of [13] is erasure resilient. The reason is that in both tests, after the first three queries are made, the adversary knows what the fourth query will be and can erase f at that point.

However, by using the Affine on Subcube test with an erasure resilient affinity tester, we obtain an erasure resilient direct sum tester.

Theorem 41.

Fix a distance parameter δ>0 and erasure parameter t, and take d sufficiently large relative to n,δ,t. Then there is a direct sum tester for f:[n]d𝔽2 that makes O(max(1/ε,logt))-queries in the t-online erasure model that satisfies:

  • Completeness: If f is a direct sum, the tester accepts with probability 1.

  • Soundness: If f is δ-far from being a direct sum, then the tester rejects with probability 2/3.

Proof.

The result follows by combining Theorem 36 with Theorem 1.1 of [6]. Specifically we use the Affine on Subcube test where the inner affinity tester is the erasure resilient one of [6]. Technically, Theorem 1.1 of [6] is stated for linearity testing, but it is straightforward to modify their result to obtain an affinity tester.

5 Reconstruction for Direct Sums

In this section we address another question raised in [13] on whether a test, which they call the Shapka Test can be used to reconstruct the underlying direct sum. We show that the this is indeed the case in some parameter regimes (i.e with the input function being sufficiently close to a direct sum), and then we give an alternate method for obtaining corrected versions of the direct sum, that is both more query efficient and more error tolerant than the Shapka test. We also give upper bounds that match up to a constant for the fraction of errors that can be tolerated when reconstructing the direct sum. This shows that the new reconstruction method we propose is essentially optimal: it works for essentially the entire range of ε where recovery is information theoretically possible, and there is no asymptotically more query-efficient correction method.

We start with our lower bounds.

Proposition 42.

Fix an even n, arbitrary integer d, and some ϵ>0 such that nε>1/2. There exist distinct direct sums L,Z:[n]d𝔽2, and a function f:[n]d𝔽2 such that 𝖽𝗂𝗌𝗍(f,L)=𝖽𝗂𝗌𝗍(f,Z)ε.

Proof.

Let Z be the zero function, and let L be the indicator of xd=1. Let f be any function which is zero if xd1, and for inputs with xd=1, f is zero half the time. Then, 𝖽𝗂𝗌𝗍(f,L)=𝖽𝗂𝗌𝗍(f,Z)=1/(2n)ε. In other words, there is no unique closest direct sum to f, so decoding f(𝟙) is undefined.

Proposition 43.

Fix an n divisible by 4, an arbitrary integer d, and ϵ>0 such that (0.7)d/n<ε,nε<1/2. Then there is a set of functions f:[n]d𝔽2, such that using fewer than n/4 queries it is impossible to determine the value of L(𝟙) with probability greater than 1/2, where L is the closest direct sum to f.

Proof.

Call a point x[n]d heavy if more than 2d/n coordinates i[d] have xi=1. By a Chernoff bound, the fraction of points in [n]d which are heavy is less than (0.7)d/n. Let L be a uniformly random direct sum. Define to be the class of all functions which agree with L on non-heavy inputs. Then, querying f on a heavy point is useless, because it outputs an arbitrary value unrelated to L. By our assumption that (0.7)d/n<ε we have that any f is ε-close to L. Now we argue that n/4 non-heavy queries do not suffice to determine L(𝟙) with non-trivial probability. Indeed, there will be a coordinate i[d] such that among the n/4 non-heavy queries, no queried point x has xi=1. Thus, we cannot hope to distinguish between the equally likely cases Li(1)=0 and Li(1)=1, and thus cannot predict L(𝟙) with non-trivial probability.

Now we give algorithms for reconstructing values from the closest direct sum to a function f. Let us start with the Shapka Test of [13] which we now describe. This test is slightly different for odd and even d; for simplicity we only consider the case of odd d. Let ei{0,1}d denote a vector with zeros except at the i-th coordinate. We describe how the Shapka Test can be used to reconstruct a direct sum.

Test 44 (Shapka [13]).

Sample a,b[n]d. Accept iff

f(b)=i=1df(ϕei(a,b)). (14)

Thus, to reconstruct a direct sum from a corrupted version, f, we can define,

f𝗌𝗁𝖺𝗉𝗄𝖺(b)=𝗆𝖺𝗃a[n]di=1df(ϕei(a,b)).

Dinur and Golubev show that if f passes the Shapka test with probability ε, then f is O(nε)-close to a direct sum. Now, instead of checking Equation 14, we use the expression on the right hand side of Equation 14 as our guess for the value of f(b), and take the most common value at each b to define the reconstructed function f𝗌𝗁𝖺𝗉𝗄𝖺. We show that if f is close enough to a direct sum, then f𝗌𝗁𝖺𝗉𝗄𝖺 is in fact this direct sum:

Proposition 45.

Fix ε>0,n, and d odd with nεd<1/4. Suppose f:[n]d𝔽2 is ε-close to the direct sum L=iLi. Then, for any b,

Pra[n]d[f(b)=L(b)]34.

It follows that f𝗌𝗁𝖺𝗉𝗄𝖺=L.

Proof.

We say that a query f(x) succeeds if f(x)=L(x). Let

εi=Prx[f(x)L(x)xi=bi].

By a union bound, the Shapka test succeeds with probability at least 1iεi. For each i,

ε=Pr[f(x)L(x)]Pr[f(x)L(x)xi=bi]=εi/n.

Thus, iεinεd1/4, so the Shapka test produces the correct value with probability at least 3/4.

Now we give a more query efficient method for reconstructing a direct sum. Our method has asymptotically optimal query complexity (by Proposition 43), and still works at essentially all possible values of ε for which the function is guaranteed to be information theoretically recoverable (by Proposition 42). We reconstruct the direct sum via the following voting scheme, where we call the reconstructed function f𝗋𝖾𝖼𝗈𝗇. To make things more convenient, we assume that d is odd. Set

f𝗋𝖾𝖼𝗈𝗇(x)=𝗆𝖺𝗃x(1),,x(n)i=1nx(i),

where the set of queried points x(1),,x(n) is weighted in the majority according to the following distribution.

  • Randomly partition [d] into n parts, S1Sn=[d], by choosing putting each i[d] independently and uniformly at random in a part Si.

  • Sample R uniformly from ([n]{1})d.

  • For i[n], form query point x(i)[n]d by setting xj(i)=1 for each jSi, and setting xj(i)=Rj otherwise.

For even, n, we require n+1 queries, and use the following voting scheme.

f𝗋𝖾𝖼𝗈𝗇(x)=𝗆𝖺𝗃x(1),,x(n)i=1nx(i),

where the set of queried points x(1),,x(n+1) is weighted in the majority according to the following distribution.

  • Randomly partition [d] into n+1 parts, S1Sn+1=[d], by choosing putting each i[d] independently and uniformly at random in a part Si.

  • Sample R[n]d as follows: for each i independently, set Ri=1 with probability 1/n2 and otherwise sample Ri uniformly from [n]{1}.

  • For i[n+1], form query point x(i)[n]d by setting xj(i)=1 for each jSi, and setting xj(i)=Rj otherwise.

We prove that the scheme above correctly reconstructs the underlying direct sum for the case where n is odd, as the case where n is even is similar.

Proposition 46.

Fix n,d,ε. Let f:[n]d𝔽2 be ε close to a direct sum L, with (n+1)ε<1/4. Then for any point x

Prx(1),,x(n)[i=1nf(x(i))=L(x)]34.

It follows that f𝗋𝖾𝖼𝗈𝗇=L.

Proof.

Without loss of generality, let us assume that x=𝟙 – the all ones vector. We again say that a query f(x) succeeds if f(x)=L(x).

We claim that x(1),,x(n) are uniformly random points in [n]d. Fix i[n]. For each j[d], xj(i) has a 1/n chance of being a 1, and a 1/n chance of being j for any j[n]{1}. Furthermore, the value of xj(i) is independent of the value of xj(i) for jj. Thus, the probability that all n queries all succeed is at least 1nε3/4 by a union bound. If the queries all succeed, then because d is odd, we have:

if(x(i))=iL(x(i))=(d1)L(R)+L(𝟙)=L(𝟙).

References

  • [1] Rudolf Ahlswede and Peter Gács. Spreading of sets in product spaces and hypercontraction of the markov operator. The annals of probability, pages 925–939, 1976.
  • [2] Noga Alon, Tali Kaufman, Michael Krivelevich, Simon Litsyn, and Dana Ron. Testing low-degree polynomials over gf (2). In International Workshop on Randomization and Approximation Techniques in Computer Science, pages 188–199. Springer, 2003. doi:10.1007/978-3-540-45198-3_17.
  • [3] Prashanth Amireddy, Srikanth Srinivasan, and Madhu Sudan. Low-degree testing over grids. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM 2023). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPIcs.APPROX/RANDOM.2023.41.
  • [4] Mitali Bafna, Dor Minzer, and Nikhil Vyas. Quasi-linear size pcps with small soundness from HDX. CoRR, abs/2407.12762, 2024. doi:10.48550/arXiv.2407.12762.
  • [5] Mitali Bafna, Srikanth Srinivasan, and Madhu Sudan. Local decoding and testing of polynomials over grids. Random Struct. Algorithms, 57(3):658–694, 2020. doi:10.1002/RSA.20933.
  • [6] Omri Ben-Eliezer, Esty Kelman, Uri Meir, and Sofya Raskhodnikova. Property testing with online adversaries. In Venkatesan Guruswami, editor, 15th Innovations in Theoretical Computer Science Conference, ITCS 2024, January 30 to February 2, 2024, Berkeley, CA, USA, volume 287 of LIPIcs, pages 11:1–11:25. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.ITCS.2024.11.
  • [7] Arnab Bhattacharyya, Swastik Kopparty, Grant Schoenebeck, Madhu Sudan, and David Zuckerman. Optimal testing of reed-muller codes. In 2010 IEEE 51st Annual Symposium on Foundations of Computer Science, pages 488–497. IEEE, 2010. doi:10.1109/FOCS.2010.54.
  • [8] Manuel Blum, Michael Luby, and Ronitt Rubinfeld. Self-testing/correcting with applications to numerical problems. In Proceedings of the twenty-second annual ACM symposium on Theory of computing, pages 73–83, 1990. doi:10.1145/100216.100225.
  • [9] Siu On Chan. Approximation resistance from pairwise-independent subgroups. J. ACM, 63(3):27:1–27:32, 2016. doi:10.1145/2873054.
  • [10] Roee David, Irit Dinur, Elazar Goldenberg, Guy Kindler, and Igor Shinkar. Direct sum testing. In Proceedings of the 2015 Conference on innovations in theoretical computer science, pages 327–336, 2015. doi:10.1145/2688073.2688078.
  • [11] Yotam Dikstein and Irit Dinur. Agreement testing theorems on layered set systems. In 2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS), pages 1495–1524. IEEE, 2019. doi:10.1109/FOCS.2019.00088.
  • [12] Irit Dinur. The PCP theorem by gap amplification. J. ACM, 54(3):12, 2007. doi:10.1145/1236457.1236459.
  • [13] Irit Dinur and Konstantin Golubev. Direct Sum Testing: The General Case. In Dimitris Achlioptas and László A. Végh, editors, Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM 2019), volume 145 of Leibniz International Proceedings in Informatics (LIPIcs), pages 40:1–40:11, Dagstuhl, Germany, 2019. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.APPROX-RANDOM.2019.40.
  • [14] Irit Dinur and Or Meir. Derandomized parallel repetition via structured pcps. Electron. Colloquium Comput. Complex., TR10-107, 2010. URL: https://eccc.weizmann.ac.il/report/2010/107, arXiv:TR10-107.
  • [15] Irit Dinur and Omer Reingold. Assignment testers: Towards a combinatorial proof of the pcp-theorem. In 45th Symposium on Foundations of Computer Science (FOCS 2004), 17-19 October 2004, Rome, Italy, Proceedings, pages 155–164. IEEE Computer Society, 2004. doi:10.1109/FOCS.2004.16.
  • [16] Irit Dinur and David Steurer. Direct product testing. In 2014 IEEE 29th Conference on Computational Complexity (CCC), pages 188–196. IEEE, 2014. doi:10.1109/CCC.2014.27.
  • [17] Oded Goldreich and Shmuel Safra. A combinatorial consistency lemma with application to proving the PCP theorem. SIAM J. Comput., 29(4):1132–1154, 2000. doi:10.1137/S0097539797315744.
  • [18] Russell Impagliazzo, Valentine Kabanets, and Avi Wigderson. New direct-product testers and 2-query pcps. SIAM J. Comput., 41(6):1722–1768, 2012. doi:10.1137/09077299X.
  • [19] Jeff Kahn, Gil Kalai, and Nathan Linial. The influence of variables on Boolean functions. Institute for Mathematical Studies in the Social Sciences, 1989.
  • [20] Iden Kalemaj, Sofya Raskhodnikova, and Nithin Varma. Sublinear-time computation in the presence of online erasures. In Mark Braverman, editor, 13th Innovations in Theoretical Computer Science Conference, ITCS 2022, January 31 - February 3, 2022, Berkeley, CA, USA, volume 215 of LIPIcs, pages 90:1–90:25. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi:10.4230/LIPICS.ITCS.2022.90.
  • [21] Tali Kaufman and Madhu Sudan. Algebraic property testing: the role of invariance. In Proceedings of the fortieth annual ACM symposium on Theory of computing, pages 403–412, 2008. doi:10.1145/1374376.1374434.
  • [22] Dor Minzer and Kai Zhe Zheng. Adversarial low degree testing. In David P. Woodruff, editor, Proceedings of the 2024 ACM-SIAM Symposium on Discrete Algorithms, SODA 2024, Alexandria, VA, USA, January 7-10, 2024, pages 4395–4409. SIAM, 2024. doi:10.1137/1.9781611977912.154.
  • [23] Dor Minzer and Kai Zhe Zheng. Near optimal alphabet-soundness tradeoff pcps. In Bojan Mohar, Igor Shinkar, and Ryan O’Donnell, editors, Proceedings of the 56th Annual ACM Symposium on Theory of Computing, STOC 2024, Vancouver, BC, Canada, June 24-28, 2024, pages 15–23. ACM, 2024. doi:10.1145/3618260.3649606.
  • [24] Ryan O’Donnell. Analysis of boolean functions, 2021. arXiv:2105.10386.
  • [25] Ran Raz and Shmuel Safra. A sub-constant error-probability low-degree test, and a sub-constant error-probability PCP characterization of NP. In Frank Thomson Leighton and Peter W. Shor, editors, Proceedings of the Twenty-Ninth Annual ACM Symposium on the Theory of Computing, El Paso, Texas, USA, May 4-6, 1997, pages 475–484. ACM, 1997. doi:10.1145/258533.258641.