8. Query Composition Theorems

The composition of two functions f:{0,1}n{0,1} and g:{0,1}m{0,1} is the function fg:{0,1}n×m{0,1} defined by

fg(x)=f(g(x1),g(x2),,g(xn))

for all x=(xji)i[n],j[m]. The same definition can also be extended to partial functions.

The composition of Boolean function comes up in the definition of some functions we have already seen (such as the recursive NAND function) and in the study of hardness amplification. It’s also one of the most basic operations we can apply to Boolean functions. So it’s natural to ask how randomized query complexity behaves with respect to composition.

Towards a Composition Conjecture

In the deterministic setting, query complexity behaves multiplicatively under the composition of Boolean functions:

Theorem. For every total or partial Boolean functions f and g,

D(fg)=D(f)D(g).

The upper bound is obtained with the natural approach: if we have a decision tree Tf that computes f and a decision tree Tg that computes g, we can obtain a decision tree that computes fg by constructing a tree where we replace each node of Tf querying the ith bit of its input into a copy of Tg that computes the value of g(xi).

If we try to use the same type of construction in the randomized setting, we cannot use randomized decision trees that err with probability 13 for both f and g (unless we have additional robustness promises on the tree for f). As a result, the simple upper bound for composition that we obtain from the natural construction is the following.

Proposition. For every total or partial Boolean functions f and g,

R13(fg)=R16(f)R16R1/6(f)(g)=O(R13(f)logR13(f)R13(g)).

But the additional logarithmic term is not necessary for all choices of f or g. When g is the parity function, for example, then Rϵ(Paritym)=Ω(m) for every ϵ1/3, so in this case

R13(fParitym)=O(R13(f)R13(Paritym)).

Is it possible to obtain even smaller bounds on the randomized query complexity of composed function? For total functions, this is an open problem.

Conjecture. For every pair of total functions f and g,

R13(fg)=Ω(R13(f)R13(g)).

For partial functions, the analogous conjecture is false: there are functions for which randomized query complexity behaves sub-multiplicatively under function composition.

A Composition Counter-Example

We can show the following counter-example to the extension of the conjecture above to partial functions:

Theorem. There exist partial functions f and g for which

R13(fg)=O((R13(f)R13(g))2/3).

Proof idea. We want two ingredients to prove the theorem:

We have already seen a good choice for g in the last lecture: the gap majority function, which can be computed to bias 1/n with only 1 query.

Now what about a function f that can use small-bias queries to its bits to obtain its value with bounded error? In this case, another variant of the Index function can be designed when we have partial functions. Define the ApproxIndex function to be like the original Index function along with the extra promise that all the bits of the input whose indices are close to the true address all have the same value.

Note that the counter-example in the proof sketch has very low query complexity. As a result, it’s possible that the sublinear behaviour of randomized query complexity with respect to composition is only logarithmic in the domain size of f.

Question. Does every partial function f:X{0,1}, X{0,1}n and every partial function g satisfy

R13(fg)=Ω(R13(f)R13(g))logn)?

A Composition Theorem

The counter-example for composition shows that there are functions like ApproxIndex that can be computed more efficiently if they can (cheaply) obtain small-bias queries of some of their bits instead of relying only on (full price) standard queries. So a natural conjecture for composition is that, to make the playing field more even, we should compare R(fg) not with the product of the standard randomized query complexities of f and g but instead replace R(f) to a smaller measure that allows for “partial queries” to be made to f’s inputs.

We can formalize the idea above using the notion of noisy queries. In a noisy decision tree, each internal node of the tree specifies the index i[n] of one of the bits of the input and a bias measure γ. The oracle being queried knows the true value of the queried bit xi, but instead of returning it directly, it generates a random bit

b={xiwith probability 1+γ21xiwith probability 1γ2.

The noisy decision tree follows the edge labelled with b and continues this process until it reaches a leaf. The random variables generated for each query are independent from each other. So in general a noisy decision tree may choose to query the same bit xi and apply success amplification to determine its value with greater accuracy.

Finally, the cost of noisy queries needs to be defined in a non-trivial way. One natural choice is to set the cost of a γ-biased query to be γ2. This is the model we fix. The overall cost of a noisy decision tree is the expected sum of the cost of its queries. And this notion lets us define a new measure of randomized query complexity. Let

noisyRϵ(f)

denote the minimum cost of a randomized decision tree that computes f with error at most ϵ.

Every function f satisfies noisyRϵ(f)Rϵ(f). For some functions, like the parity and gap majority functions, the two measures are equal. And for others, like the approximate index function, the noisy complexity can be much smaller than the standard complexity.

Theorem. For every pair of partial functions f and g,

R(fg)=Ω(noisyR(f)R(g)).

The proof of the theorem is obtained by re-arranging the target inequality as an upper bound. We want to show that

noisyR(f)=O(R(fg)R(g)).

We can establish this upper bound by showing how an algorithm B for the composed function fg can be simulated efficiently to obtain a randomized noisy decision tree for f. That is, on input xX in the domain of f, we want to generate an input y=(y1,,yn) to fg such that for each i[n], g(yi)=xi. If we can do this, simulating B on y gives the value of f(x) that we want to compute.

The problem, of course, is that we don’t know x so we don’t know explicitly what string y to simulate B on. A naive solution to this problem is to build y “on demand”: whenever B queries a bit of yi, we start by querying xi, then choose some yig1(xi) and use this string to answer B’s query. This approach guarantees correctness, but in the worst case we query one bit of x for each query of B to y, so it only gives the trivial bound

R(f)R(fg).

But we can also hope to answer some of B’s queries without querying the corresponding bit of x. Let μ0 and μ1 be hard distributions for g that are supported on g1(0) and g1(1), respectively. And let’s say that the first bit that B queries in the ith input yi has hte same marginal distribution under both μ0 and μ1. In this case, we can answer the query without knowing the value of xi: just output a bit with the bias of that common distribution on the queried bit!

This approach also works when the marginal distributions of μ0 and μ1 are close but not identical. Let’s say the bit has value 1 with probability p0 when yiμ0 and p1 when yiμ1. Assume that p1p0. We can draw a random bit a uniformly at random from [0,1] and do the following:

This procedure generates a random bit with bias pxi, but it queries the value of xi itself with probability only p1p0. This savings is enough to obtain a composition theorem. By introducing the notion of max conflict complexity, Gavinsky, Lee, Santha, and Sanyal (2019) show that this approach gives the upper bound

R(f)O(R(fg)R(g)).

The heart of the proof of the theorem above is the observation that if we have access to noisy queries, we can do better. Instead of having expected query cost |p1p0| when querying a bit with biases p0 and p1 under μ0 and μ1, we can have a noisy query with expected cost (p1p0)2/(p1+p0). For example, when p0=1γ2 and p1=1+γ2, a single γ-biased noisy query with cost γ2 suffices to generate a bit with the appropraite bit, whereas the approach listed above has expected cost γ for simulating the query.

To see all the remaining of the proof of the theorem, see this paper with Shalev Ben-David (2020). And for another incomparable composition theorem, see also this paper with Shalev Ben-David, Mika Göös, and Gilbert Maystre (2022).