Abstract 1 Introduction 2 Techniques 3 Preliminaries References

Relative-Error Unateness Testing

Xi Chen ORCID Columbia University, New York, NY, USA    Diptaksho Palit ORCID Boston University, MA, USA    Kabir Peshawaria ORCID Boston University, MA, USA    William Pires ORCID Columbia University, New York, NY, USA    Rocco A. Servedio ORCID Columbia University, New York, NY, USA    Yiding Zhang ORCID Boston University, MA, USA
Abstract

The model of relative-error property testing of Boolean functions has been the subject of significant recent research effort [6, 10, 11]. In this paper we consider the problem of relative-error testing an unknown and arbitrary f:{0,1}n{0,1} for the property of being a unate function, i.e. a function that is either monotone non-increasing or monotone non-decreasing in each of the n input variables.

Our first result is a one-sided non-adaptive algorithm for this problem that makes O~(log(N)/ε) samples and queries, where N=|f1(1)| is the number of satisfying assignments of the function that is being tested and the value of N is given as an input parameter to the algorithm. Building on this algorithm, we next give a one-sided adaptive algorithm for this problem that does not need to be given the value of N and with high probability makes O~(log(N)/ε) samples and queries.

We also give lower bounds for both adaptive and non-adaptive two-sided algorithms that are given the value of N up to a constant multiplicative factor. In the non-adaptive case, our lower bounds essentially match the complexity of the algorithm that we provide.

Keywords and phrases:
Property Testing, Relative Error
Category:
Track A: Algorithms, Complexity and Games
Funding:
Xi Chen: X.C. is funded by NSF CCF-2106429, CCF-2107187, and OpenAI through the UK AI Security Institute’s Alignment Project.
Diptaksho Palit: D.P. is funded by NSF DMS-2022446.
William Pires: W.P. is funded by NSF CCF-2106429 and CCF-2107187.
Rocco A. Servedio: R.A.S. is funded by NSF CCF-2211238, NSF CCF-2106429, and OpenAI through the UK AI Security Institute’s Alignment Project.
Yiding Zhang: Y.Z. is funded by NSF GCR-2428487.
Copyright and License:
[Uncaptioned image] © Xi Chen, Diptaksho Palit, Kabir Peshawaria, William Pires, Rocco A. Servedio, and
Yiding Zhang; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Streaming, sublinear and near linear time algorithms
Related Version:
Full Version: https://arxiv.org/abs/2510.21589 [9]
Acknowledgements:
D.P., K.P., and Y.Z. started working on this project for a course on Sublinear Algorithms taught by Sofya Raskhodnikova [19]. Part of this work was carried out while visiting the Simons Institute for the Theory of Computing at UC Berkeley.
Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis

1 Introduction

A Boolean function f:{0,1}n{0,1} is said to be unate if for each of the n individual input variables, f is either monotone non-decreasing or monotone non-increasing in that variable. (An alternate equivalent characterization is that f is unate if there is an n-bit string s{0,1}n such that g(x)=f(xs) is monotone, where denotes bitwise exclusive-OR.) Together with monotonicity, unateness has been intensively investigated from the vantage point of property testing. Indeed, unateness testing was already studied in the influential early work of Goldreich et al. that set the stage for much contemporary research on Boolean function property testing [15], and it has since been studied in many other papers including [4, 3, 17, 1, 13, 14, 18, 12, 2, 7].

For the case of Boolean-valued functions f:{0,1}n{0,1} over the Boolean hypercube, the state-of the-art upper and lower bounds on the query complexity of testing unateness in the standard property testing model111Recall that in the standard model, an ε-testing algorithm is given query access to an unknown and arbitrary f:{0,1}n{0,1}. The algorithm must accept with high probability if f has the property of interest and must reject with high probability if for every function g with the property, f and g disagree on at least an ε-fraction of all points in {0,1}n. were given in [2, 13, 12]. In [2] Baleshzar et al. gave a O~(n/ε)-query one-sided222In the standard Boolean function property testing model, an algorithm has one-sided error if it accepts with probability 1 whenever the function being tested has the desired property. A testing algorithm which need not satisfy this guarantee is said to have two-sided error., non-adaptive333A testing algorithm in the standard model is non-adaptive if its choice of the (i+1)-st point to query does not depend on the results of the first i queries, i.e. such an algorithm may “make all of its queries at once.” ε-tester for unateness of n-variable Boolean functions. In [13], Chen, Waingarten and Xie gave a Ω~(n) lower bound for any one-sided, non-adaptive algorithm that tests unateness to a certain constant error parameter ε>0, and additionally gave a Ω~(n2/3) query lower bound for any two-sided adaptive algorithm. In [12] Chen and Waingarten gave a one-sided, adaptive algorithm that ε-tests an arbitrary Boolean function for unateness using O~(n2/3/ε2) queries. Taken together these results provide essentially matching upper and lower bounds both for adaptive and non-adaptive unateness testing.

Given that unateness testing is quite well-understood in the standard property testing model, it is natural that researchers have turned to study unateness testing in more challenging extensions of the basic model. For example, the works [18, 7] have studied the problem of unateness in the tolerant testing model.

This work: Relative-error unateness testing.

. In this paper, we consider the problem of unateness testing in a different extension of the standard Boolean function property testing model, namely the recently-introduced model of relative-error property testing. The relative-error model was introduced by Chen et al. [6], motivated by the fact that the standard Boolean function property testing model is not well suited for testing sparse Boolean functions (functions with very few satisfying assignments); this is simply because any function f:{0,1}n{0,1} with less than an ε fraction of satisfying assignments will trivially be ε-close, in the standard model, to the constant-0 function. To circumvent this, in the relative-error Boolean function property testing model introduced by [6] the distance between the function f:{0,1}n{0,1} that is being tested and a function g:{0,1}n{0,1} is defined to be

rel-dist(f,g):=|f1(1)g1(1)||f1(1)|.

Hence relative distance is measured “at the scale” of the function f that is being tested, i.e. |f1(1)|, rather than at the “absolute scale” of 2n= |{0,1}n| that is used in the standard model; note that the relative-error way of measuring the distance between f and g makes sense even for very sparse functions f. The model also allows the testing algorithm to obtain i.i.d. uniform elements of f1(1) by calling a “random sample” oracle; this is because if, as in the standard model, only black-box queries were allowed, then for very sparse f a very large number of queries would be required to obtain any information about f at all. See Section 3.2 for a more detailed description of the relative-error model.

The original work of Chen et al. [6] showed, roughly speaking, that relative-error testing can never be easier than standard-model testing, and that for some (artificial) classes of functions it can be much harder, requiring 2Ω(n) queries even though these classes can be tested with O(1) queries in the standard model (see [6] for details). It is natural then to ask, for various properties of interest that are known to have efficient standard-model testing algorithms, how hard they are to test in the relative-error model. Several recent papers have shown that for some highly structured “syntactic” properties, such as being a Boolean conjunction or decision list [10] or being a k-junta [11], the query complexity of relative-error testing is essentially no larger than the complexity of standard-model testing. A more subtle and interesting phenomenon, though, was evident in the results obtained for relative-error monotonicity testing in the original [6] paper; we turn to this next.

The main results of [6] for relative-error monotonicity testing were upper and lower bounds on the query complexity444For simplicity of exposition, we refer to the total number of random samples plus black-box queries made by a relative-error testing algorithm as its “query complexity.” of relative-error monotonicity testing that depended on the sparsity N=|f1(1)| of the function f being tested. The main positive result of [6] is a one-sided adaptive algorithm which is an ε-relative-error tester for monotonicity, and with high probability makes at most O(log(N)/ε) queries, even when the value of N is not known to the testing algorithm. Note that while this bound is O(n/ε) if N=2Θ(n), it can be much smaller if N is small. On the lower bound side, [6] showed that there is a constant ε=Θ(1) such that for any constant c<1, any two-sided non-adaptive555See Section 3.2 for the formal definition of non-adaptive algorithms under the relative-error model. ε-relative-error tester for monotonicity must make Ω~(logN) queries even if N is given to the algorithm provided that N<2cn, and that any two-sided adaptive algorithm must make Ω~((logN)2/3) queries. Thus, unlike the “syntactic” properties of being a conjunction, decision list, or junta, for the property of monotonicity the sparsity of the function plays an essential role in the relative-error testing complexity.

In summary, given the relative-error testing results for monotonicity and other properties described above, the important role that unateness has played in standard-model property testing, and the fact that we understand standard-model unateness testing quite well (as described earlier), it is natural to consider the complexity of relative-error unateness testing. This is the subject of the current paper; we turn to describe our results below.

1.1 Our results

Upper bounds.

We first give a one-sided, non-adaptive algorithm which takes as input the value of N=|f1(1)|:

Theorem 1 (One-sided non-adaptive algorithm, known N, informal version of Theorem 24 in the full version [9]).

There is a one-sided, non-adaptive algorithm, Unateness-Tester-Known-N, for ε-relative-error testing of unateness of an unknown and arbitrary function f:{0,1}n{0,1}. The Unateness-Tester-Known-N algorithm is given as input the value of N, and makes O~(log(N)/ε) samples and queries.

Our second and main algorithm does not need to be given the value of N:

Theorem 2 (One-sided adaptive algorithm, unknown N, informal version of Theorem 30 in the full version [9]).

There is a one-sided, adaptive algorithm, Unateness-Tester-Unknown-N, for ε-relative-error testing of unateness of an unknown and arbitrary function f:{0,1}n{0,1}. With high probability the Unateness-Tester-Unknown-N algorithm makes O~(log(N)/ε) samples and queries (and is not given as input the value of N).

Lower bounds.

Our first lower bound holds for non-adaptive relative-error unateness testing algorithms, and applies even when the value of N=|f1(1)| is given up to a constant multiplicative factor. This result is as follows:

Theorem 3 (Non-adaptive lower bound).

For any constant α0<1, there exists a constant ε0>0 such that any two-sided, non-adaptive algorithm for testing whether a function f with |f1(1)|=Θ(N) for some given parameter N2α0n is unate or has relative distance at least ε0 from unate must make Ω~(logN) queries.

Theorem 3 shows that the complexity of the Unateness-Tester-Known-N algorithm is essentially best possible, even if two-sided error is allowed.

For our second lower bound, as we explain in Section 2.2, an easy argument based on prior results shows that Ω~((logN)2/3) queries are needed for adaptive algorithms:

Theorem 4 (Adaptive lower bound).

For any constant α0<1, there exists a constant ε0>0 such that any two-sided, adaptive algorithm for testing whether a function f with |f1(1)|=Θ(N) for some given parameter N2α0n is unate or has relative distance at least ε0 from unate must make Ω~((logN)2/3) queries.

1.2 Discussion

Taken together, our positive and negative results give a fairly complete picture of the abilities and limitations of relative-error algorithms for testing unateness. It is interesting to compare our results for relative-error unateness testing with the known results for unateness testing in the standard model [5, 13, 12]. Recall that in the standard model, essentially tight upper and lower bounds are known both for one-sided non-adaptive algorithms (Θ~(n) queries) and for two-sided adaptive algorithms (Θ~(n2/3) queries). In contrast, in the relative-error setting we give essentially tight upper and lower bounds of Θ~(logN) queries for one-sided non-adaptive algorithms (in fact our lower bound holds even for two-sided non-adaptive algorithms), but our upper bound for two-sided adaptive algorithms is O~(logN) queries whereas our lower bound is Ω~((logN)2/3) queries. Roughly speaking, the reason for this disparity with what can be proved in the standard model is as follows: The O~(n2/3)-query standard-model unateness testing algorithm of [12] crucially employs a novel use of binary search over long random paths in the Boolean hypercube {0,1}n. As demonstrated by our lower bound constructions, though, in the relative-error setting “all of the action” may take place over just two adjacent layers of the hypercube, which precludes an analysis using long paths in the hypercube. Thus, it is not clear how to use techniques inspired by [12] to obtain an improved algorithmic result in the relative-error setting. An interesting direction for future work is to close the gap left open by our results for adaptive relative-error unateness testing: is the right answer closer to (logN)2/3, or to logN?

It is also interesting to consider our result for relative-error unateness testing in the context of the [6] results for relative-error monotonicity testing. In both cases, the query complexity of relative-error testing depends on the sparsity N=|f1(1)| of the function being tested; as discussed earlier, this is provably different from what happens for other properties such as conjunctions, decision lists, and juntas [10, 11]. We note that those other properties are most naturally defined using a “syntactic” description of how the relevant functions can be represented in various models, while in contrast monotonicity and unateness are most naturally viewed as “semantic” properties which are defined in terms of the behavior of the function’s output values rather than in terms of a particular syntactic representation. An interesting possible direction for future research would be to study other “semantic” Boolean function properties: will it turn out that for them too, the complexity of relative-error testing is determined by the sparsity N=|f1(1)|? Some possible properties to investigate in this context are union-closedness and intersectingness, which have been studied in the standard property testing model in recent work [8, 16].

2 Techniques

2.1 Upper bounds

We present two unateness testers in the relative-error model. The first tester needs to be given the sparsity N as an input, while the second does not. As a starting point, we first introduce two related procedures from prior work that our algorithms will build on. In each case, the brief description given below is a simplified version of the actual procedure given in the relevant paper.

  1. 1.

    Relative-Error Monotonicity Testing, from [6]. This procedure repeatedly draws samples from the Samp(f) oracle. For each sample 𝒛f1(1), it draws an index 𝒊 uniformly from {i[n]𝒛i=0}, and queries f(𝒛e𝒊). If the result is 0, the procedure rejects. This test is one-sided, non-adaptive, and has query complexity O(log(N)/ε); it is the inspiration for the BiasedTest subroutine in the full version of this paper [9].

  2. 2.

    Standard-Model Unateness Testing, from [2]. The idea of this procedure is to find both a strictly monotone and a strictly anti-monotone edge along the same coordinate i, which directly witnesses a violation of unateness. The procedure can be thought of as interpolating between two extreme cases. First, when violations are concentrated entirely along one coordinate, we choose to sample many coordinates. However, for each coordinate that is sampled, we check only a few edges in that dimension. Second, when violations are spread equally across all coordinates, we choose to sample very few coordinates but for each chosen coordinate, we check more edges in that dimension. This test is one-sided, non-adaptive, and has query complexity O~(n/ε); it is the inspiration for the UnbiasedTest subroutine in the full version of this paper [9].

Of course, if n=O(logN), then we could directly use the standard-model unateness tester. However, the interesting case for relative-error testing is when nlogN. Recall that a function f is unate if and only if it is monotone along some direction d{0,1}n. To make use of the relative-error monotonicity tester, we would need to provide some direction d~. Unfortunately, it is not clear how to choose a suitable direction d~; indeed, if the relative-error monotonicity tester reports that the function f is not monotone along some specific direction d~, we cannot obviously conclude that f is not unate – perhaps f is unate by virtue of being monotone along some other direction dd~. Ideally, we would like to identify a direction d~{0,1}n such that if f is unate, then (with high probability) it is monotone along direction d~.

This goal is too optimistic because we cannot be confident in the setting of all n coordinates. However, we can confidently set many coordinates of d~, as we now explain. For any unate function f, if the value of the i-th coordinate of a uniform sample drawn from f1(1) is 1 (resp. 0) with probability pi>0.5, then f must be monotone (resp. anti-monotone) along dimension i. This notion is formalized in Observation 9. Thus, a natural approach is to draw some samples from f1(1), use them to obtain an estimate pi^ of the above probabilities pi for each coordinate i[n], and choose directions for the subset of coordinates i where pi^ is either close to 0 or close to 1 (see Phase 1 of the Unateness-Tester-Known-N algorithm in the full version). We call such coordinates fixed (since we fix the direction along these coordinates). For these fixed coordinates, if we see a bichromatic edge along a coordinate i that “runs counter to pi^” (for example, an anti-monotone edge along a coordinate i such that pi^ is close to 1), we can be “quite confident” that f is not unate.

At a high level, the strategy of our algorithm is to run (a variant of) the relative-error monotonicity tester along the fixed coordinates and to run (a variant of) the standard-model unateness tester along the unfixed coordinates (see Phase 3 of the Unateness-Tester-Known-N algorithm in the full version [9]). Both testers are slightly modified to search for violations only on the coordinates provided.666This modification is easy, because both subroutines are edge-testers; we provide the relevant set of coordinates as input to the procedure, and we have the procedure only perform edge-tests along the coordinates provided in the input set.

For this to succeed, there are two technical challenges that must be overcome. First, in order to fix n directions such that with constant probability we fix all of them correctly, Ω(logn) samples are required. For very sparse functions, such that logN=o(logn), this is an unacceptably high number of samples. Second, our modified standard-model unateness tester has query complexity which is quasilinear in the number of unfixed coordinates. Thus, we must ensure that we fix all but O(logN) coordinates.

The known-𝑵 algorithm

When the sparsity N is known, we solve both these issues by using an explicit truncation 777See Section 3.4 for the formal definition of truncation.. As we argue in Lemma 12, if a function f:{0,1}n{0,1} is unate, then all x,yf1(1) have Hamming distance at most 2logN from each other. So prior to running the relative-error monotonicity and standard-model unateness testers, our procedure draws O(logN) samples from f1(1) and rejects if any of the received samples are too far (Hamming distance more than 2logN) from the first sample a{0,1}n (see Phase 1 of the Unateness-Tester-Known-N algorithm in the full version). Conditioned on not rejecting, we can now assume that we are estimating directions for a function f such that all points in f1(1) lie within a Hamming ball of radius 2logN around a.

We prove that for these truncated functions, there can be at most O(logN) coordinates whose true bias pi (as defined above) is close to 0.5. In order to claim that O(logN) samples suffices to estimate the directions of the nO(logN) remaining coordinates, our analysis distinguishes between trivial and non-trivial coordinates. Trivial coordinates are ones for which pi is either exactly 0 or exactly 1. Notably, our estimates for trivial coordinates cannot be wrong. For truncated functions, all but poly(N) coordinates are trivial, so O(logN) samples suffices to correctly estimate the orientations of the non-trivial coordinates.

The unknown-𝑵 algorithm

When the sparsity N is unknown, we have to do more work. For one thing, since N is unknown we cannot simply draw O(logN) samples and use them (as was described earlier for Phase 1 of the Unateness-Tester-Known-N algorithm) to restrict our attention to a truncation of f to a Hamming ball of radius 2logN. Despite this, it turns out that we are able to effectively work with a truncation to a Hamming ball of radius O(N). This is accomplished using a procedure, which we call CheckSamples (see Phase 0 of the Unateness-Tester-Unknown-N algorithm in the full version [9]) which has only constant query complexity, yet allows us to effectively ensure that we are working with a radius-O(N) truncation of f. Since there are only poly(N) coordinates where such a truncation is non-trivial, it is possible to get good estimates p^i for these coordinates using only O(logN) samples.

While at this point only O(logN) samples would suffice to get good estimates pi^ for the required coordinates i, we still do not know N so a naive approach will not work. Instead, to estimate the pi’s, we use a delicate iterative procedure called IterativeBias (see Phase 1 of Unateness-Tester-Unknown-N in the full version). This procedure draws larger and larger sets of samples, until the estimates for the pi’s converge. We are able to argue that this process halts after using roughly logN samples. Furthermore, we are able to argue that when this process halts, our estimates are “good” and moreover only O(logN) coordinates have estimates pi^ that are close to 0.5.

With these estimates in hand, we are able to get a better truncation of f. In particular, the next stage of our algorithm (see the Preprocessing procedure carried out in Phase 2 of Unateness-Tester-Unknown-N) enables us to effectively restrict f to a Hamming Ball of radius O(log(N)). We can now run our modified standard-model tester and relative error monotonicity tester on this restriction (see Phase 3 of the Unateness-Tester-Unknown-N algorithm in the full version), while staying within our O(log(N)) query complexity budget.

We remark that the above discussion glosses over some subtleties which arise in our actual algorithms and analyses. One of these is the following: in order to obtain algorithms with the one-sided error guarantees that we achieve, it is not okay to reject if we see a violation of monotonicity along a fixed coordinate of the “bias vector” d~ that our algorithm constructs. This is because each fixed coordinate i of d~ is fixed because of “statistical evidence” that the function is monotone (or anti-monotone) in direction i, but this statistical evidence does not constitute an incontrovertible witness of monotonicity (or anti-monotonicity) in that direction – for a one-sided error testing algorithm, it is not enough to be “quite confident” as mentioned earlier. So when the algorithm sees a violation of monotonicity (or anti-monotonicity) along a fixed coordinate of d~, it must do some more work to actually obtain a violating edge for the other direction to establish for sure that the function is neither monotone nor anti-monotone along coordinate i. (This is why our algorithm uses the ConfirmDirection procedure in various places.)

Overview of both algorithms

We close this subsection with a more detailed overview of the structure that is common to both our known-N and unknown-N algorithms.

  • In Phase 1, the algorithm derives a bias vector 𝐛~{0,1,}n based on the estimates {pi^}i[n], while ensuring (with high probability) that the number of unfixed coordinates is at most O(logN) and for each fixed coordinate i, the true bias pi is indeed close to the value of 𝐛~i{0,1}.

  • In Phase 2, the algorithm determines the value of the radius parameter 𝐌, which informs the query complexity of BiasedTest, and guarantees (with high probability) that 𝐌=O(logN).

  • In Phase 3, the algorithm runs BiasedTest and UnbiasedTest given the parameters 𝐛~ and 𝐌, where BiasedTest takes as input 𝐌 and the fixed coordinates of 𝐛~, and UnbiasedTest takes as input the unfixed coordinates of 𝐛~.

2.2 Lower bounds

Our non-adaptive lower bound, Theorem 3, is obtained via a modification of the lower bound arguments from [6]. As in that work, our lower bound construction uses functions which are only nontrivial on two adjacent layers of the Boolean hypercube; we call these two-layer functions (see Section 7.1.1 in the full version [9]). More precisely, a function f is a two-layer function if it is only nontrivial on points in layers 3n/4 and 3n/4+1: every point with weight <3n/4 is set to 0 and every point with weight >3n/4+1 is set to 1. (We use the constant 3/4 just to make the presentation more concrete; it can be replaced by any constant strictly between 1/2 and 1).

Our “yes-functions” are the same as the “yes-functions” of [6], which are monotone (and hence unate) functions. However, we modify the “no-functions” of [6] since the analysis of [6] does not establish that the “no-functions” that were used in that work, to give lower bounds on relative-error monotonicity testing, are far from unate. In Section 7 of the full version we give a detailed description of a new distribution of “no-functions” and prove that they are indeed suitably far from unate. Given these no-functions, our lower bounds follow from relatively simple modifications of the [6] lower bound arguments; we describe the necessary modifications in Section 7 of the full version.

Our adaptive lower bound (Theorem 4) is obtained by a simple reduction to the Ω~(d2/3)-query standard-model two-sided adaptive unateness testing lower bound given by [13] for functions f:{0,1}d{0,1}. This is done by “scaling down” both the yes- and no- distributions used in that lower bound so that the functions involved are contained in a subcube of {0,1}n of dimension dlogN; this can be done by simply defining the functions over {0,1}n to output 0 if any of the last nd input coordinates take value 1. For such functions, the uniform random satisfying assignments that a relative-error testing algorithm may ask for can easily be obtained by a standard-model algorithm for unateness testing over {0,1}d, by simply drawing uniform random assignments from {0,1}d0nd until a satisfying assignment is received. It follows that the Ω~(d2/3) standard-model lower bound of [13] directly yields a Ω~((logN)2/3) lower bound for two-sided adaptive unateness testing with relative error. (We mention that it is easily verified that in the [13] construction, for both the distribution 𝒟yes of yes-functions and the distribution 𝒟no of no-functions, with very high probability the number of satisfying assignments of a random function drawn from either distribution is tightly concentrated around the same particular value. This is why the lower bound of Theorem 4 holds even when N is given to the testing algorithm.)

We remark that an alternate route to obtaining a Ω~((logN)2/3)-query two-sided adaptive lower bound for relative-error unateness testing is to proceed in analogy with our proof of Theorem 3, i.e. to modify the “no-functions” used in the two-sided adaptive lower bound for relative-error monotonicity testing of [6]. Given suitably modified “no-functions” that are far from unate in relative error, the Ω~((logN)2/3) lower bound argument of [6] for monotonicity adapts to give a Ω~((logN)2/3) lower bound for two-sided adaptive relative-error unateness testing, matching the parameters of Theorem 4. Since this construction and argument have many more details than the simple reduction sketched in the previous paragraph, though, we omit them.

3 Preliminaries

3.1 Notation

Strings

For x,b{0,1}n we write xb to denote the bitwise-XOR of x and b, i.e. the string in {0,1}n that has xibi as its i-th coordinate. We also write x(i) to denote xei for convenience. For b{0,1} and i[n] we write xib to denote the n-bit string obtained from x by fixing the i-th bit to b. Given a partial string d{0,1,}n, we write 𝖥𝗂𝗑𝖾𝖽(d):={i[n]di{0,1}} and 𝖴𝗇𝖿𝗂𝗑𝖾𝖽(d):={i[n]di=} to denote the set of indices i where di is fixed or unfixed respectively. For partial strings x,y{0,1,}n, we denote their symmetric difference as

xΔy:={i𝖥𝗂𝗑𝖾𝖽(x)𝖥𝗂𝗑𝖾𝖽(y)xiyi}.

Edges

Given i[n], the set of edges in the i-th direction is the set of (unordered) pairs

Edgei={{xi0,xi1}:x{0,1}n}.

We say an edge {x,y}Edgei is monochromatic if f(x)=f(y) and bichromatic otherwise. Given f:{0,1}n{0,1} and i[n] we say an edge {x,y}Edgei is strictly 1-monotone in f if f(x)=xi and f(y)=yi, and we say it is strictly 0-monotone in f if f(x)=1xi and f(y)=1yi. We let Edgeib(f) denote the set of all edges in Edgei that are strictly b-monotone in f:

Edgeib(f)={{x,x(i)}{x,x(i)} is strictly b-monotone}.

Distances

We use Δ(x,y) to denote the Hamming distance between two strings x,y{0,1,}n, where Δ(x,y)=|xΔy|. We also use Δ(f,g) to denote the Hamming distance between two Boolean functions f,g:{0,1}n{0,1}. That, is

Δ(f,g):=|{x{0,1}nf(x)g(x)}|.

We write dist(f,g) to denote the normalized Hamming distance between two Boolean functions f,g:{0,1}n{0,1},

dist(f,g):=Δ(f,g)2n.

For a class 𝒞 of Boolean functions, we write dist(f,𝒞) to denote ming𝒞dist(f,g), the minimum distance between f and any function g𝒞. We sometimes say that f is ε-far from g (from 𝒞, respectively) if dist(f,g)>ε (dist(f,𝒞)>ε, respectively). In the standard model of property testing, an ε-tester for a property is required to determine whether f𝒞 or dist(f,𝒞)ε (i.e., accept with probability 2/3 if f𝒞 and reject with probability 2/3 if dist(f,𝒫)ε).

3.2 Relative-error testing of Boolean functions

The relative-error property testing model.

As defined in [6], a relative-error testing algorithm for a class 𝒞 of Boolean functions has oracle access to MQ(f) and also has access to a Samp(f) oracle which, when called, returns a uniform random element 𝒙f1(1). A relative-error testing algorithm for 𝒞 must output “yes” with high probability (say at least 2/3; this can be easily amplified) if f𝒞 and must output “no” with high probability (again, say at least 2/3) if rel-dist(f,𝒞)ε, where

rel-dist(f,𝒞):=ming𝒞rel-dist(f,g)andrel-dist(f,g):=|f1(1)Δg1(1)||f1(1)|.

We say that a relative-error testing algorithm is “non-adaptive” if after receiving the results of all of its calls to the sampling oracle, it makes one parallel round of queries to the black-box oracle (so these queries can depend on the result of the calls to the sampling oracle, but the choice of the i-th query point for the black-box oracle does not depend on the responses received to queries 1,,i1).

We sometimes say that f is ε-far from g (from 𝒞, respectively) in relative distance if rel-dist(f,g)>ε (rel-dist(f,𝒞)>ε, respectively). Throughout this writeup we denote

N:=|f1(1)| (1)

where f:{0,1}n{0,1} is the function that is being tested for unateness. We will use the following simple “approximate triangle inequality” for relative distance:

Lemma 5 (Approximate triangle inequality for relative distance, Lemma 5 of [10]).

Let f,g,h:{0,1}n{0,1} be such that rel-dist(f,g)ε and rel-dist(g,h)ε. Then rel-dist(f,h)ε+(1+ε)ε.

3.3 Monotonicity and unateness

For i[n], we say a function f:{0,1}n{0,1} is 1-monotone in the i-th direction if every {xi0,xi1}Edgei satisfies f(xi0)f(xi1). Similarly, we say a function f is 0-monotone in the i-th direction if every {xi0,xi1}Edgei satisfies f(xi0)f(xi1). We say f is unate if it is either 1-monotone or 0-monotone in the i-th direction for every i[n].

Definition 6.

Given f:{0,1}n{0,1}, we define the bias vector df{0,1,}n of f as follows:

dif={1if 𝐏𝐫𝒛f1(1)[𝒛i=1]>0.60if 𝐏𝐫𝒛f1(1)[𝒛i=0]>0.6otherwise ,for each i[n].

We will often consider vectors d~{0,1,}n as estimations of df and compare the coordinates of such vectors to those of df. We say that d~{0,1,}n is consistent with df{0,1,}n if d~i=dif for every i[n] with d~i.

The following is an immediate consequence of the definition of df:

Observation 7.

Let f:{0,1}n{0,1} be a function with bias vector df{0,1,}n. For any i[n] with dif, we have

𝐏𝐫𝒛f1(1)[𝒛i=dif]1/2.

We also have the following useful lemma, whose proof can be found in the full version [9], which roughly shows that it is easy to find a bichromatic edge in a biased direction given a uniformly random preimage of f1(1):

Lemma 8.

Let f:{0,1}n{0,1} be a function with bias vector df{0,1,}n. For any i[n] with dif we have that

𝐏𝐫𝒛f1(1)[f(𝒛(i))=1dif] 1/5and (2)
𝐏𝐫𝒛f1(1)[{𝒛i0,𝒛i1}Edgeidif(f)] 1/5. (3)

Our algorithms will reject if they find an i[n] along with a pair of edges eEdgei0(f) and eEdgei1(f). It is easy to see that when f is unate, this can never happen:

Observation 9.

If f:{0,1}n{0,1} is unate, then for any i[n] we have

Edgei1dif(f)=.

We will need the following theorem which relates the distance to unateness and the number of edges violating b-monotonicity:

Theorem 10 (Theorem 1.3 of [5]).

If f:{0,1}n{0,1} is ε-far from unate, then we have

i[n]min(|Edgei0(f),Edgei1(f)|)ε82n.

Recalling that N=f1(1), where f is the function being tested for unateness we have:

Corollary 11.

If f:{0,1}n{0,1} is ε-far from unate in relative distance, then we have

i[n]|Edgei1di(f)|εN8,for every vector d{0,1}n.

We will also use the following simple lemma, which shows that if f is unate then the distance between any two points in f1(1) is at most O(logN):

Lemma 12.

If f:{0,1}n{0,1} is unate, then Δ(z,z)2logN for all z,zf1(1).

Proof.

Assume for contradiction there exists z,zf1(1) with Δ(z,z)>2log(N). Since f is unate, there exists r{0,1}n such that g(x)=f(xr) is monotone.

Let x=zr, x=zr. We have g(x)=g(x). Because Δ(z,z)=Δ(x,x)>2log(N), either Δ(x,1n)>log(N) or Δ(x,1n)>log(N). Without loss of generality, assume Δ(x,1n)>log(N). Since g is monotone, every point yx must have g(y)=1. But there are more than 2log(N)=N such points y, contradicting the fact that |g1(1)|=|f1(1)|=N.

3.4 Truncated functions

Given a positive integer r and d~{0,1,}n, we say a function h:{0,1}n{0,1} is (r,d~)-truncated if every xh1(1) satisfies Δ(x,d~)r.

Given r and d~, an (r,d~)-truncated function h=fr,d~ is naturally obtained from f, the function being tested, as follows:

fr,d~(x):={f(x)if Δ(x,d~)r,0otherwise. (4)
Observation 13.

Directly from Lemma 12, we observe that for unate function f:{0,1}n{0,1}, input af1(1), and radius r2logN where N:=|f1(1)|, the function f is equivalent to its (r,a)-truncation, i.e. ffr,a.

The proof of the following lemma can be found in the full version [9].

Lemma 14.

For any Boolean function f:{0,1}n{0,1} with radius 0rn and input a{0,1}n such that the truncation h:=fr,a satisfies 𝗋𝖾𝗅𝖽𝗂𝗌𝗍(f,h)0.05, the following is true for all indices i[n]:

|𝐏𝐫𝒛f1(1)[𝒛i=1]𝐏𝐫𝒛h1(1)[𝒛i=1]|0.05.
Definition 15.

Fix Boolean function f:{0,1}n{0,1}. We say that i[n] is a nontrivial coordinate if

𝐏𝐫𝒛f1(1)[𝒛i=1]{0,1}.
Claim 16.

Fix Boolean function f:{0,1}n{0,1}, input af1(1), and radius r2logN where N:=|f1(1)|. We have fr,a1(1)f1(1) and the number of nontrivial coordinates of fr,a is at most rN.

Proof.

The statement that fr,a1(1)f1(1) follows directly from the definition of truncation.

Given zfr,a1(1), there are at most r coordinates where ziai. Furthermore, since fr,a1(1)f1(1) we have |fr,a1(1)|N. So there can be at most rN coordinates i[n] for which there exists some zfr,a1(1) with ziai.

3.5 Setup for Algorithms and Analysis

We present a key lemma that is central to the analysis of our main algorithms. The lemma roughly states that given any function h:{0,1}n{0,1} that is far from unate (in 𝗋𝖾𝗅𝖽𝗂𝗌𝗍), there are many violations on at least one of two index sets which partition [n].

Claim 17.

Let d~ be an arbitrary vector in {0,1,}n and let h:{0,1}n{0,1} be an arbitrary function. If rel-dist(h,𝖴𝗇𝖺𝗍𝖾)ε/2, then at least one of Equation 5 or Equation 6 holds:

i𝖥𝗂𝗑𝖾𝖽(d~)|Edgei1d~i(h)| ε32|h1(1)|, (5)
i𝖴𝗇𝖿𝗂𝗑𝖾𝖽(d~)min(|Edgei0(h)|,|Edgei1(h)|) ε32|h1(1)|. (6)
Proof.

Since rel-dist(h,𝖴𝗇𝖺𝗍𝖾)ε/2, we have

dist(h,𝖴𝗇𝖺𝗍𝖾)ε|h1(1)|2n+1.

By Theorem 10,

i[n]min(|Edgei0(h)|,|Edgei1(h)|)ε16|h1(1)|.

Since 𝖥𝗂𝗑𝖾𝖽(d~) and 𝖴𝗇𝖿𝗂𝗑𝖾𝖽(d~) partition [n], it must be that at least one of Equations 5 and 6 holds.

Lemma 18.

Assume 𝗋𝖾𝗅𝖽𝗂𝗌𝗍(f,𝖴𝗇𝖺𝗍𝖾)ε. Let M0 and let d~{0,1,}n. If 𝗋𝖾𝗅𝖽𝗂𝗌𝗍(f,fM,d~)ε/10 then at least one of Equation 7 or Equation 8 holds:

i𝖥𝗂𝗑𝖾𝖽(d~)|Edgei1d~i(fM,d~)|ε64|f1(1)|, (7)
i𝖴𝗇𝖿𝗂𝗑𝖾𝖽(d~)min(|Edgei0(f)|,|Edgei1(f)|)ε64|f1(1)|, (8)
Proof.

For brevity, denote fM,d~ by h. Since rel-dist(f,h)ε/10, we must have |h1(1)||f1(1)|/2. Furthermore by Lemma 5, we have rel-dist(h,𝖴𝗇𝖺𝗍𝖾)ε/2. So, by Claim 17 at least one of Equation 5 or Equation 6 holds for h.

First, consider the case where Equation 5 holds. Then Equation 7 holds as follows.

i𝖥𝗂𝗑𝖾𝖽(d~)|Edgei1d~i(h)|ε32|h1(1)|ε64|f1(1)|.

Now, consider the case where Equation 6 holds. We will show Equation 8 holds for f. Fix i𝖴𝗇𝖿𝗂𝗑𝖾𝖽(d~) and b{0,1}. Consider any edge {x,x(i)}Edgeib(h); we claim that {x,x(i)}Edgeib(f). From this it follows that:

i𝖴𝗇𝖿𝗂𝗑𝖾𝖽(d~)min(|Edgei0(f)|,|Edgei1(f)|) i𝖴𝗇𝖿𝗂𝗑𝖾𝖽(d~)min(|Edgei0(h)|,|Edgei1(h)|)
ε64|h1(1)|.

To argue that {x,x(i)}Edgeib(f), without loss of generality assume b=0. And let {x,x(i)}Edgeib(h) where xi=0, h(x)=1 and h(x(i))=0. Since i𝖴𝗇𝖿𝗂𝗑𝖾𝖽(d~), we must have that Δ(x,d~)=Δ(x(i),d~). Since h(x)=1, these distances must be less than M. Hence f(x)=h(x)=1 and f(x(i))=h(x(i))=0, implying {x,x(i)}Edgei0(f).

References

  • [1] Roksana Baleshzar, Deeparnab Chakrabarty, Ramesh Krishnan S. Pallavoor, Sofya Raskhodnikova, and C. Seshadhri. A lower bound for nonadaptive, one-sided error testing of unateness of boolean functions over the hypercube. abs/1706.00053, 2017.
  • [2] Roksana Baleshzar, Deeparnab Chakrabarty, Ramesh Krishnan S. Pallavoor, Sofya Raskhodnikova, and C. Seshadhri. Optimal unateness testers for real-valued functions: Adaptivity helps. Theory of Computing, 16(3):1–36, 2020. doi:10.4086/toc.2020.v016a003.
  • [3] Roksana Baleshzar, Meiram Murzabulatov, Ramesh Krishnan S. Pallavoor, and Sofya Raskhodnikova. Testing unateness of real-valued functions. CoRR, abs/1608.07652, 2016. arXiv:1608.07652.
  • [4] Deeparnab Chakrabarty and C. Seshadhri. A o(n) monotonicity tester for boolean functions over the hypercube. In Proceedings of the 45th ACM Symposium on Theory of Computing, pages 411–418, 2013. doi:10.1145/2488608.2488660.
  • [5] Deeparnab Chakrabarty and C. Seshadhri. A O~(n) non-adaptive tester for unateness. CoRR, abs/1608.06980, 2016. arXiv:1608.06980.
  • [6] X. Chen, A. De, Y. Huang, S. Nadimpalli, R. Servedio, and T. Yang. Relative error monotonicity testing. In Proc. ACM-SIAM Symposium on Discrete Algorithms (SODA), 2025.
  • [7] Xi Chen, Anindya De, Yuhao Li, Shivam Nadimpalli, and Rocco Servedio. Mildly Exponential Lower Bounds on Tolerant Testers for Monotonicity, Unateness, and Juntas. In SODA 2024, 2024.
  • [8] Xi Chen, Anindya De, Yuhao Li, Shivam Nadimpalli, and Rocco A. Servedio. Testing intersecting and union-closed families. In Proceedings of the 15th Innovations in Theoretical Computer Science Conference (ITCS), 2024.
  • [9] Xi Chen, Diptaksho Palit, Kabir Peshawaria, William Pires, Rocco A. Servedio, and Yiding Zhang. Relative-error unateness testing, 2025. doi:10.48550/arXiv.2510.21589.
  • [10] Xi Chen, William Pires, Toniann Pitassi, and Rocco A. Servedio. Relative-Error Testing of Conjunctions and Decision Lists. In 52nd International Colloquium on Automata, Languages, and Programming (ICALP 2025), pages 52:1–52:18, 2025. doi:10.4230/LIPIcs.ICALP.2025.52.
  • [11] Xi Chen, William Pires, Toniann Pitassi, and Rocco A. Servedio. Testing Juntas and Junta Subclasses with Relative Error. In Proc. 38th Annual Conference on Learning Theory (COLT 2025), 2025.
  • [12] Xi Chen and Erik Waingarten. Testing unateness nearly optimally. In Proceedings of the 51th ACM Symposium on Theory of Computing, 2019.
  • [13] Xi Chen, Erik Waingarten, and Jinyu Xie. Beyond Talagrand functions: new lower bounds for testing monotonicity and unateness. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 523–536, 2017. doi:10.1145/3055399.3055461.
  • [14] Xi Chen, Erik Waingarten, and Jinyu Xie. Boolean unateness testing with O~(n3/4) adaptive queries. In Proceedings of the 58th Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 868–879, 2017. doi:10.1109/FOCS.2017.85.
  • [15] Oded Goldreich, Shafi Goldwasser, Eric Lehman, Dana Ron, and Alex Samordinsky. Testing monotonicity. Combinatorica, 20(3):301–337, 2000. doi:10.1007/S004930070011.
  • [16] Ishay Haviv and Michal Parnas. Testing intersectingness of uniform families. In Proceedings of RANDOM 2024, volume 317 of LIPIcs, pages 35:1–35:15. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.APPROX/RANDOM.2024.35.
  • [17] Subhash Khot and Igor Shinkar. An ~o(n) queries adaptive tester for unateness. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM), pages 37:1–37:7, 2016. doi:10.4230/LIPIcs.APPROX-RANDOM.2016.37.
  • [18] Amit Levi and Erik Waingarten. Lower bounds for tolerant junta and unateness testing via rejection sampling of graphs. abs/1805.01074, 2018. arXiv:1805.01074.
  • [19] Sofya Raskhodnikova. CS 599: Sublinear Algorithms (Spring 2025). https://cs-people.bu.edu/sofya/sublinear-course/, 2025. Retrieved on 10 October, 2025. URL: https://cs-people.bu.edu/sofya/sublinear-course/.