9.2 A Lower Bound for Testing Bipartiteness of Constant Degree Graphs
10.1.2 Testing Monotonicity in Higher Dimensions
For a function f : [n]m→ R (where, as before, the range R is a fully ordered set), we say that f is monotone if f (x)≤ f(y) for every x, y such that x ≺ y, where ≺ denotes the natural partial order over strings (that is, x1. . . xm ≺ y1. . . ym if xi ≤ yi for every i∈ [m], and xi < yi for at least one i∈ [m]). Let ǫM(f ) denote the distance of f from the closest monotone function (with the same domain and range).
Batu et al. [BRW05] extended the algorithm of [EKK+00] to higher dimensions, at an expo-nential cost in the dimension m. The complexity of their algorithm is O((2 log n)mǫ−1). Halevy and Kushilevitz [HK03] reduced the complexity (for sufficiently large n) to O(m4mlog nǫ−1), and Ailon and Chazelle [AC06] further improved this bound to O(m2mlog nǫ−1).
Dodis et al. [DGL+99] showed that it is possible to obtain a linear dependence on m at a cost of a logarithmic dependence on log|R|, where the dependence on log |R| can be replaced by m log n. An outline of the algorithm (Algorithm 10.2) is given in Figure 21. The complexity of
Algorithm 10.2: (Outline of ) Testing Monotonicity for f : [n]m→ R 1. Repeat the following t(m, ǫ, n) times:
(a) Uniformly select i∈ [m], α ∈ [n]i−1 and β ∈ [n]m−i.
(b) Perform a test on the one-dimensional function fi,α,β : [n] → R that is defined by fi,α,β(x) = f (αxβ).
2. If no test caused rejection then accept.
Figure 21: Monotonicity testing algorithm (outline) for f : [n]m→ R.
Algorithm 10.2 depends on the complexity of the test performed in Step 1b and on the probability that it rejects a uniformly selected fi,α,β, which is then used to set t(m, ǫ, n).
We note that the high level structure of the algorithm is reminiscent of the algorithm of [RS96]
for testing multivariate polynomials over large fields (shortly discussed in Subsection 3.2). Recall that their algorithm considers restrictions of the tested function f to random lines, and checks that each restriction is a univariate polynomial of bounded degree.
We first consider in more detail the case of testing monotonicity of Boolean functions over m bit strings (that is, over the m-dimensional Boolean hypercube), and later talk about the general case. That is, we consider testing a function f : {0, 1}m → {0, 1} (which is equivalent to testing f : [n]m → R for n = 2 and any R such that |R| = 2). Observe that in this case, since the size of the domain of each fi,α,β is 2, the one-dimensional test in Step 1b of Algorithm 10.2 simply checks whether f (i, α, β)(0) ≤ f(i, α, β)(1), or equivalently, whether f(α0β) ≤ f(α1β) (as must be the case if the function is monotone).
Thus, similarly to the tests for linearity and low-degree polynomials, we consider a characteriza-tion of monotone funccharacteriza-tions and show that it is robust (though less robust than the characterizacharacteriza-tion
we had for linear functions). The characterization is that a function f is monotone if and only if for every pair x, y∈ {0, 1}m that differ only on the ith bit for some 1≤ i ≤ m, where xi = 0 and yi = 1 (so that x≺ y), it holds that f(x) ≤ f(y). Clearly, if f is monotone, then the above holds, and the other direction is also easy to verify.12 Algorithm 10.2 for the special case of f :{0, 1}m → {0, 1}
thus becomes the algorithm given in Figure 22.
Algorithm 10.3: Testing Monotonicity for f : {0, 1}m→ {0, 1}
1. Repeat the following Θ(m/ǫ) times:
(a) Uniformly select i∈ [m] and x ∈ {0, 1}m such that xi= 0.
(b) Let y = x1. . . xi−11 xi+1. . . xm (that is, y is obtained by flipping the ith bit of x).
(c) If f (x) > f (y) then reject (and exit).
2. If no test caused rejection then accept.
Figure 22: Monotonicity testing algorithm for f :{0, 1}m→ {0, 1}.
As noted before, if f is monotone then the algorithm accepts with probability 1. We would like to show that if ǫM(f ) > ǫ then the algorithm rejects with probability at least 2/3. To this end we define:
U def= {(x, y) : x and y differ on a single bit and x ≺ y} , (47) as the set of all neighboring pairs on the m-dimensional hypercube (where|U| = 2m−1· m),
V (f )def= {(x, y) ∈ U : f(x) > f(y)} (48) as the set of all violating neighboring pairs, and
η(f )def= |V (f)|
|U| = Pr(x,y)∈U[f (y) < f (x)] (49)
as the probability that a neighboring pair is violating. The main lemma is:
Lemma 10.3 For every f :{0, 1}m→ {0, 1}, η(f) ≥ ǫMm(f ).
The correctness of the algorithm directly follows from Lemma 10.3, since the algorithm uniformly selects Θ(n/ǫ) = Ω(1/η(f )) (assuming ǫM(f ) > ǫ) pairs (x, y) ∈ U and checks whether (x, y) ∈ V (f ). We will sketch how f can be turned into a monotone function by performing at most m· η(f) · 2m modifications. Since ǫM(f )· 2m is the minimum number of modifications required to make f monotone, Lemma 10.3 follows. We first add a few more notations and definitions.
Definition 10.1 For any i ∈ [m], we say that a function h : {0, 1}m → {0, 1} is monotone in dimension i, if for every α∈ {0, 1}i−1 and β∈ {0, 1}m−i, h(α 0 β)≤ h(α 1 β). For a set of indices T ⊆ [m], we say that h is monotone in dimensions T , if for every i ∈ T , the function h is monotone in dimension i.
12Given x ≺ y that differ on more than one bit, consider a sequence of intermediate points between x and y (according to the partial order) where every two consecutive points in this sequence differ on a single bit.
We next define a switch operator, Si that transforms any function h to a function Si(h) that is monotone in dimension i.
Definition 10.2 Let h :{0, 1}m → {0, 1}. For every i ∈ [m], the function Si(h) :{0, 1}m→ {0, 1}
is defined as follows: For every α∈ {0, 1}i−1 and every β ∈ {0, 1}m−i, if h(α 0 β) > h(α 1 β) then Si(h)(α 0 β) = h(α 1 β), and Si(h)(α 1 β) = h(α 0 β). Otherwise, Si(h) is defined as equal to h on the strings α 0 β and α 1 β.
Let
Di(f )def= |{x : Si(f )(x)6= f(x)}| (50) so that Di(f ) is twice the number of pairs in V (f ) that differ on the i’th bit (and Pn
i=1Di(f ) = 2· |V (f)|).
Lemma 10.4 For every h :{0, 1}m → {0, 1} and for every i, j ∈ [m], Di(Sj(h))≤ Di(h).
As a direct corollary of Lemma 10.4 (applying it to the special case that Di(h) = 0 for every i in a subset T ) we get:
Corollary 10.5 For every h : {0, 1}m → {0, 1} and j ∈ [m], if h is monotone in dimensions T ⊆ [m], then Sj(h) is monotone in dimensions T ∪ {j}.
We won’t prove Lemma 10.4 here but we shall show how Lemma 10.3 (and hence the correctness of the algorithm) follows. Let g = Sn(Sn−1(· · · (S1(f ))· · · ). By the definition of g,
dist(f, g) ≤ 1 2m ·
Xm i=1
Di(Si−1(· · · (S1(f ))· · · ) . (51) By successive applications of Lemma 10.4,
Di(Si−1(· · · (S1(f ))· · · ) ≤ Di(Si−2(· · · (S1(f ))· · · ) ≤ · · · ≤ Di(f ) , (52) and so (by combining Equations (51) and (52)),
dist(f, g) ≤ 1 2m ·
Xm i=1
Di(f ) . (53)
By successive application of Corollary 10.5, the function g is monotone, and hence dist(f, g) ≥ ǫM(f ). Therefore,
Xm i=1
Di(f )≥ dist(f, g) · 2m≥ ǫM(f )· 2m. (54) On the other hand, by definition of Di(f ),
Xm i=1
Di(f ) = 2· |V (f)| = 2 · η(f) · |U| = η(f) · 2m· m . (55)
Lemma 10.3 follows by combining Equations (54) and (55).
Extending the Result to f : [n]m → {0, 1} for n > 2. In this case it is possible to define 1-dimensional tests (for Step 1b in Algorithm 10.2) that select a pair of points σ < τ in [n] according to particular distributions and check whether fi,α,β(σ)≤ fi,α,β(τ ). By extending the analysis from the case n = 2, and in particular modifying the switching operator Si(·) to a sorting operator, it can be shown that for some distributions, Θ(m(log n)ǫ−1) such tests suffice (and for another distribution, Θ((m/ǫ)2) tests suffice (the latter is for the uniform distribution on pairs)).
Extending the Result to f : [n]m → R for n ≥ 2 and R > 2. By performing a range reduction, it is shown in [DGL+99] that O(m log n log|R|ǫ−1) queries suffice.
General Posets. Fischer et al. [FLN+02] consider the more general case in which the domain is any poset (and not necessary [n]m). They show that testing monotonicity of Boolean functions over general posets is equivalent to the problem of testing 2CNF assignments (namely, testing whether a given assignment satisfies a fixed 2CNF formula or is far from any such assignment). They also show that for every poset it is possible to test monotonicity over the poset with a number of queries that is sublinear in the size of the domain poset; specifically, the complexity grows like a square root of the size of the poset. Finally, they give some efficient algorithms for several special classes of posets (e.g., posets that are defined by trees).