258 16 The Complexity of Boolean Functions
follows if for each gate along this path there is exactly one bit of communica-
tion.
Alice and Bob want to select their path in such a way that they only reach
gates G that compute a function g with g(a)=1andg(b) = 0. This is initially
true at the gate computing f since by assumption f(a)=1=0=f(b). At
gate G we let g
1
and g
2
denote the functions computed by its two inputs.
There are two cases, depending on whether G is an AND-gate or an OR-gate.
For an AND-gate, g = g
1
g
2
,sog
1
(a)=1andg
2
(a) = 1. On the other hand,
at least one of g
1
(b)andg
2
(b) must be 0. Bob can compute which of the two
cases has occurred and communicate this to Alice with one bit. In this way
Bob and Alice agree on an immediate predecessor G
∗
, such that g
∗
(a)=1
and g
∗
(b) = 0. The case for OR-gates is dual to this. Now g = g
1
+ g
2
,
g
1
(b)=0,g
2
(b) = 0, and at least one of g
1
(a)andg
2
(a)is1.Thistime
Alice can determine the appropriate predecessor and communicate this to
Bob. This discussion makes it clear that when they reach an input, it cannot
be a constant. If the input is x
i
,thena
i
= 1 and b
i
=0;for
x
i
, a
i
= 0 and
b
i
= 1. In either case Alice and Bob have fulfilled their task.
The proof of the other direction is more complicated, although in a certain
sense it is just a reversal of the proof just given. We start with an optimal
protocol tree for R
f
and transform it into a formula for f. Internal vertices at
which Alice sends Bob a bit will become OR-gates and vertices at which Bob
sends Alice a bit will become AND-gates. Leaves of the protocol tree with
the answer i ∈{1,...,n} are replaced by x
i
or
x
i
. The result is a formula
with the same depth as the protocol tree, but we still need to decide which
of the variables should be negated and to show that the resulting formula
computes f.
Consider a leaf of the protocol tree with label i. From Section 15.2 we
know that the set of inputs (a, b) that reach this leaf forms a rectangle A × B.
For all (a, b) ∈ A × B, a
i
= b
i
.Bytherectanglestructure,eithera
i
= 1 and
b
i
=0foralla ∈ A and b ∈ B,ora
i
= 0 and b
i
=1foralla ∈ A and b ∈ B.
Once again we see how useful it is to know that the inputs that reach a vertex
in a protocol tree always form a rectangle. In the first case the leaf is labeled
with x
i
and in the second case with
x
i
. This completes the description of the
formula.
To show that this formula computes f, we will actually prove a stronger
result. For each vertex v of the formula, let A
v
×B
v
be the rectangle of inputs
(a, b)thatreachv. We will show that if g
v
is the function computed at v,
then g
v
(a)=1fora ∈ A
v
,andg
v
(b)=0forb ∈ B
v
. The rectangle at the
root r is f
−1
(1) × f
−1
(0), so this will prove that g
r
(a)=1fora ∈ f
−1
(1) and
g
r
(b)=0forb ∈ f
−1
(0), so g
r
= f .
The claim is proven by structural induction from the leaves of the formula
to the root. At the leaves, the claim is true since we selected the literal at
each leaf to make this work. Now consider an OR-vertex v and the rectangle
A
v
× B
v
. For the predecessors v
1
and v
2
we have g
v
= g
v
1
+ g
v
2
. Since Alice
sent a bit to Bob at vertex v, A
v
1
and A
v
2
form a partition of A
v
and B
v
=