TCSLib

52 Communication Complexity — Subprotocol

52.1 Overview

This module develops the theory of subprotocol embeddings for deterministic communication protocols. It introduces an inductive predicate IsSubprotocol asserting that one protocol tree is a rooted subtree of another, proves that every protocol with more than one leaf contains a balanced subprotocol (with a \(\frac{1}{3}\)–\(\frac{2}{3}\) fraction of the leaves), and provides operations for erasing, pruning, and routing inputs through subprotocols, culminating in the two-bit testSubprotocol construction.

52.2 Declarations

Definition 52.1 Subprotocol predicate

The inductive proposition \(\texttt{IsSubprotocol}\; s\; p\) asserts that protocol \(s\) is a rooted subtree of protocol \(p\). It is generated by: reflexivity (\(s\) is a subtree of itself), and three step cases recording that \(s\) is a subtree of one of the two children of an Alice-node or the false-child of a Bob-node, and hence a subtree of the parent.

Lemma 52.2 Transitivity of subprotocol

If \(s\) is a subprotocol of \(t\) and \(t\) is a subprotocol of \(u\), then \(s\) is a subprotocol of \(u\). That is, the subprotocol relation is transitive.

Given a protocol \(p\) with \(3 \cdot p.\mathrm{numLeaves} \ge 2n\) and \(n \gt 1\), there exists a subprotocol \(s\) of \(p\) satisfying \(n \le 3 \cdot s.\mathrm{numLeaves} \lt 2n\). This is the inductive step used to prove the balanced subprotocol theorem.

If a protocol \(p\) has more than one leaf (i.e. \(p.\mathrm{numLeaves} \gt 1\)), then there exists a subprotocol \(s\) of \(p\) satisfying

\[ p.\mathrm{numLeaves} \; \le \; 3\cdot s.\mathrm{numLeaves} \; \lt \; 2\cdot p.\mathrm{numLeaves}. \]

In other words, \(s\) contains between one-third and two-thirds of \(p\)’s leaves.

Definition 52.5 Subprotocol path witness

The inductive type \(\texttt{SubprotocolPath}\; s\; p\) is a data-carrying witness that \(s\) is a rooted subtree of \(p\), recording the sequence of left/right choices made from the root of \(p\) down to the root of \(s\). It mirrors the constructors of IsSubprotocol but lives in Type rather than Prop, enabling structural recursion over the path.

Definition 52.6 Path to subprotocol proof

Every SubprotocolPath \(s\; p\) can be mapped to a proof that \(s\) is a subprotocol of \(p\): the function SubprotocolPath.toIsSubprotocol performs this conversion by structural recursion on the path.

If \(s\) is a subprotocol of \(p\) (i.e. IsSubprotocol \(s\; p\) holds), then the type CommunicationComplexity.Deterministic.Protocol.SubprotocolPath \(s\; p\) is nonempty. That is, every propositional subprotocol embedding has at least one data-carrying path witness.

Definition 52.8 Classical choice of a subprotocol path

Given a proof that \(s\) is a subprotocol of \(p\), choosePath uses classical choice to extract a definite SubprotocolPath \(s\; p\) witness. The resulting function is noncomputable.

Lemma 52.9 Subprotocol has at most as many leaves

If hsp is a SubprotocolPath from \(s\) to \(p\), then \(s.\mathrm{numLeaves} \le p.\mathrm{numLeaves}\). A subtree cannot have more leaves than its parent.

Definition 52.10 Reachable Alice inputs along a path

Given a subprotocol path hsp from \(s\) to \(p\), reachXPath hsp is the set of Alice’s inputs \(x \in X\) that are consistent with all of Alice’s choices along the path from the root of \(p\) to the root of \(s\).

Definition 52.11 Reachable Bob inputs along a path

Given a subprotocol path hsp from \(s\) to \(p\), reachYPath hsp is the set of Bob’s inputs \(y \in Y\) that are consistent with all of Bob’s choices along the path from the root of \(p\) to the root of \(s\).

Definition 52.12 Inputs that reach a subprotocol path

\(\texttt{reachesPath}\; \texttt{hsp}\; x\; y\) is the proposition that the input pair \((x, y)\) causes protocol \(p\) to reach the subprotocol \(s\) indicated by the path hsp; that is, \(x \in \texttt{reachXPath}\; \texttt{hsp}\) and \(y \in \texttt{reachYPath}\; \texttt{hsp}\).

Definition 52.13 Alice’s reach set for a subprotocol

Given a proof hsp that \(s\) is a subprotocol of \(p\), reachX hsp is the set of Alice’s inputs that reach the subprotocol, defined by applying reachXPath to the classically chosen path.

Definition 52.14 Bob’s reach set for a subprotocol

Given a proof hsp that \(s\) is a subprotocol of \(p\), reachY hsp is the set of Bob’s inputs that reach the subprotocol, defined by applying reachYPath to the classically chosen path.

Definition 52.15 Inputs that reach a subprotocol

\(\texttt{reaches}\; \texttt{hsp}\; x\; y\) is the proposition that input \((x, y)\) causes \(p\) to reach the subprotocol \(s\); equivalently, \(x \in \texttt{reachX}\; \texttt{hsp}\) and \(y \in \texttt{reachY}\; \texttt{hsp}\).

Lemma 52.16 Subprotocol and parent agree on reached inputs (path version)

If the input pair \((x, y)\) reaches the subprotocol \(s\) of \(p\) via path hsp, then running \(p\) and running \(s\) on \((x, y)\) produce the same output: \(p.\texttt{run}\; x\; y = s.\texttt{run}\; x\; y\).

If hsp witnesses that \(s\) is a subprotocol of \(p\) and \((x, y)\) reaches \(s\), then \(p.\texttt{run}\; x\; y = s.\texttt{run}\; x\; y\).

Definition 52.18 Canonical output of a protocol

chooseOutput p returns a canonical output value from protocol \(p\) by always following the false (left) branch at every Alice-node; it yields the value at the leftmost leaf.

Definition 52.19 Erase a subprotocol path

Given a subprotocol path hsp from \(s\) to \(p\), erasePath hsp produces a new protocol that is \(p\) with the subtree \(s\) collapsed to a single leaf whose value is \(\texttt{chooseOutput}\; s\) (the leftmost leaf of \(s\)).

After erasing subprotocol \(s\) from \(p\) via path hsp, the resulting protocol has \(p.\mathrm{numLeaves} - s.\mathrm{numLeaves} + 1\) leaves.

If \((x, y)\) does not reach the subprotocol path hsp, then running the erased protocol erasePath hsp on \((x, y)\) gives the same output as running \(p\).

Definition 52.22 Erase a subprotocol (propositional version)

The noncomputable variant of erasePath that takes an IsSubprotocol proof instead of a path: erase hsp applies erasePath to the classically chosen path for hsp.

If hsp witnesses that \(s\) is a subprotocol of \(p\), then \((\texttt{erase}\; \texttt{hsp}).\mathrm{numLeaves} = p.\mathrm{numLeaves} - s.\mathrm{numLeaves} + 1\).

If \((x, y)\) does not reach the subprotocol \(s\) of \(p\), then \((\texttt{erase}\; \texttt{hsp}).\texttt{run}\; x\; y = p.\texttt{run}\; x\; y\).

Definition 52.25 Delete a subprotocol path by splicing

deletePath hsp removes the subtree \(s\) from \(p\) by splicing out the branch leading to \(s\); the result is none if \(s = p\) (the root case) and some q otherwise, where \(q\) is \(p\) with the branch to \(s\) deleted.

Lemma 52.26 Delete is non-none when subprotocol is proper

If \(s.\mathrm{numLeaves} \lt p.\mathrm{numLeaves}\) (i.e. \(s\) is a proper subtree), then \(\texttt{deletePath}\; \texttt{hsp} \ne \texttt{none}\).

Lemma 52.27 Delete yields a protocol when subprotocol is proper

If \(s.\mathrm{numLeaves} \lt p.\mathrm{numLeaves}\), then there exists a protocol \(q\) such that \(\texttt{deletePath}\; \texttt{hsp} = \texttt{some}\; q\).

Definition 52.28 Prune a subprotocol path

Given a path hsp from \(s\) to \(p\) with \(s.\mathrm{numLeaves} \lt p.\mathrm{numLeaves}\), prunePath hsp hlt is the protocol obtained by classically extracting the some value from deletePath hsp.

Under the hypothesis \(s.\mathrm{numLeaves} \lt p.\mathrm{numLeaves}\), we have \(\texttt{deletePath}\; \texttt{hsp} = \texttt{some}\; (\texttt{prunePath}\; \texttt{hsp}\; \texttt{hlt})\).

Lemma 52.30 Delete none implies subprotocol equals parent

If \(\texttt{deletePath}\; \texttt{hsp} = \texttt{none}\), then \(s = p\). That is, deletion returns none only when \(s\) is the entire protocol \(p\).

If \(\texttt{deletePath}\; \texttt{hsp} = \texttt{some}\; q\), then \(q.\mathrm{numLeaves} = p.\mathrm{numLeaves} - s.\mathrm{numLeaves}\).

If \(s.\mathrm{numLeaves} \lt p.\mathrm{numLeaves}\), then \((\texttt{prunePath}\; \texttt{hsp}\; \texttt{hlt}).\mathrm{numLeaves} = p.\mathrm{numLeaves} - s.\mathrm{numLeaves}\).

If \(\texttt{deletePath}\; \texttt{hsp} = \texttt{none}\) (meaning \(s = p\)), then every input pair \((x, y)\) satisfies \(\texttt{reachesPath}\; \texttt{hsp}\; x\; y\).

If \(\texttt{deletePath}\; \texttt{hsp} = \texttt{some}\; q\) and \((x, y)\) does not reach the subprotocol path, then \(q.\texttt{run}\; x\; y = p.\texttt{run}\; x\; y\).

If \(s.\mathrm{numLeaves} \lt p.\mathrm{numLeaves}\) and \((x, y)\) does not reach the path, then \((\texttt{prunePath}\; \texttt{hsp}\; \texttt{hlt}).\texttt{run}\; x\; y = p.\texttt{run}\; x\; y\).

Definition 52.36 Prune a subprotocol (propositional version)

The noncomputable variant of prunePath taking an IsSubprotocol proof: prune hsp hlt applies CommunicationComplexity.Deterministic.Protocol.prunePath to the classically chosen path for hsp, given the strictness condition \(s.\mathrm{numLeaves} \lt p.\mathrm{numLeaves}\).

If \(s.\mathrm{numLeaves} \lt p.\mathrm{numLeaves}\), then \((\texttt{prune}\; \texttt{hsp}\; \texttt{hlt}).\mathrm{numLeaves} = p.\mathrm{numLeaves} - s.\mathrm{numLeaves}\).

If \(s.\mathrm{numLeaves} \lt p.\mathrm{numLeaves}\) and \((x, y)\) does not reach \(s\), then \((\texttt{prune}\; \texttt{hsp}\; \texttt{hlt}).\texttt{run}\; x\; y = p.\texttt{run}\; x\; y\).

Definition 52.39 Test subprotocol construction

Given that \(s\) is a subprotocol of \(p\) and two protocols qIn and qOut, testSubprotocol hsp qIn qOut is a noncomputable protocol that uses two bits of communication to determine whether the input reaches \(s\), then routes to qIn if it does and to qOut otherwise.

Lemma 52.40 Complexity of the test subprotocol

The communication complexity of testSubprotocol hsp qIn qOut equals \(2 + \max (\texttt{qIn}.\texttt{complexity},\; \texttt{qOut}.\texttt{complexity})\).

If \((x, y)\) reaches the subprotocol \(s\) of \(p\), then \((\texttt{testSubprotocol}\; \texttt{hsp}\; \texttt{qIn}\; \texttt{qOut}).\texttt{run}\; x\; y = \texttt{qIn}.\texttt{run}\; x\; y\).

If \((x, y)\) does not reach the subprotocol \(s\) of \(p\), then \((\texttt{testSubprotocol}\; \texttt{hsp}\; \texttt{qIn}\; \texttt{qOut}).\texttt{run}\; x\; y = \texttt{qOut}.\texttt{run}\; x\; y\).