Documentation

CslibFrontier.Computability.Communication.NOF.Grolmusz

Grolmusz's protocol for the generalized inner product #

The Babai–Nisan–Szegedy bound (NOF.Protocol.two_mul_le_four_pow_mul_of_ecomplexityFun_gip_le) says that k players need Ω(n / 4 ^ k) bits to compute the generalized inner product of n-bit strings. Grolmusz [Gro94] showed that the exponential decay in k is real: there is a deterministic number-on-forehead protocol with O(k n / 2 ^ k) bits. We formalize such a protocol for the players Fin (k + 1), writing x i r for the r-th bit of player i.

One block of columns. Think of the input as a (k + 1) × n matrix with columns x · r, and suppose fewer than 2 ^ k columns. Player 0 sees rows 1, …, k, so it can name a pattern z ∈ {0, 1} ^ k that no column shows on these rows. Let w t be the pattern that is 1 on rows 1, …, t and agrees with z on the others (NOF.Grolmusz.chain), so w 0 = z and w k is all ones. For t < k, player t + 1 (who sees every row but row t + 1) writes the parity of the number of columns that are 1 on row 0 and agree with w t on all rows but t + 1, or 0 if z already has a 1 on row t + 1. A column with x 0 r = 1 is counted by player t + 1 exactly when it agrees with exactly one of w t and w (t + 1), so the k bits add up to [column = (1, z)] + [column = all ones] for each column (NOF.Grolmusz.sum_chainTerm). No column equals (1, z), so the bits add up to the generalized inner product.

Many blocks. Split the columns into B blocks of fewer than 2 ^ k columns. Player 0 names a pattern for every block, k B bits, and then each player t + 1 writes a single bit, the sum over all blocks of its bits above. This is k (B + 1) bits (NOF.Grolmusz.ecomplexityFun_gip_le_of_block), and with n ≤ B (2 ^ k - 1) blocks of consecutive columns, k (n / (2 ^ k - 1) + 2) bits (NOF.Grolmusz.ecomplexityFun_gip_le). This is O(k n / 2 ^ k + k), against the lower bound 2 n ≤ 4 ^ (k + 1) c.

We could not consult the original paper, so we do not claim that its protocol or constant is exactly the one formalized here. What we prove is the bound stated above, which has the O(k n / 2 ^ k) form that Grolmusz's result is cited for.

Main definitions #

Main results #

References #

One column #

def Cslib.Communication.NOF.Grolmusz.chain {k : ℕ} (z : Fin k → Bool) (t : ℕ) (l : Fin k) :

The pattern w t on rows 1, …, k (indexed by Fin k): 1 on the first t rows, z on the others.

def Cslib.Communication.NOF.Grolmusz.chainTerm {k : ℕ} (z : Fin k → Bool) (c₀ : Bool) (c : Fin k → Bool) (t : Fin k) :

What player t + 1 counts for a column (c₀, c): whether z t = 0, c₀ = 1 and c agrees with chain z t off row t.

theorem Cslib.Communication.NOF.Grolmusz.chainTerm_eq {k : ℕ} (z : Fin k → Bool) (c₀ : Bool) (c : Fin k → Bool) (t : Fin k) :
chainTerm z c₀ c t = (c₀ && decide (c = chain z ↑t)) + (c₀ && decide (c = chain z (↑t + 1)))

One step of the chain: player t + 1 counts a column exactly when it agrees with exactly one of w t and w (t + 1).

theorem Cslib.Communication.NOF.Grolmusz.sum_chainTerm {k : ℕ} (z : Fin k → Bool) (c₀ : Bool) (c : Fin k → Bool) (hc : c ≠ z) :
∑ t : Fin k, chainTerm z c₀ c t = c₀ * ∏ l : Fin k, c l

The chain telescopes: for a column (c₀, c) that is not (1, z), the bits of the players 1, …, k add up to whether the column is all ones.

Player 0's patterns #

noncomputable def Cslib.Communication.NOF.Grolmusz.missing {k n : ℕ} (y : Fin k → BitString n) (S : Finset (Fin n)) :
Fin k → Bool

A pattern on rows 1, …, k that no column of S shows, if there is one: what player 0 names for a block S of columns, seeing the rows y : Fin k → BitString n.

theorem Cslib.Communication.NOF.Grolmusz.missing_spec {k n : ℕ} (y : Fin k → BitString n) {S : Finset (Fin n)} (hS : S.card < 2 ^ k) (r : Fin n) :
r ∈ S → (fun (l : Fin k) => y l r) ≠ missing y S

A block of fewer than 2 ^ k columns misses a pattern.

The protocol #

def Cslib.Communication.NOF.Grolmusz.chainBit {k n B : ℕ} (blk : Fin n → Fin B) (pat : Fin B → Fin k → Bool) (t : Fin k) (v : View (fun (x : Fin (k + 1)) => BitString n) t.succ) :

Player t + 1's bit, seeing v, when player 0 named the patterns pat: the sum over the columns r of chainTerm (pat (blk r)) (x 0 r) (x · r) t, where player t + 1 reads x 0 r and x (l + 1) r for l ≠ t from v, and the row x (t + 1) it does not see does not matter.

noncomputable def Cslib.Communication.NOF.Protocol.grolmusz {k n B : ℕ} (blk : Fin n → Fin B) :
Protocol (fun (x : Fin (k + 1)) => BitString n) Bool

Grolmusz's protocol for the generalized inner product, for an assignment blk of the columns to B blocks. Player 0 writes, for every block, a pattern (Grolmusz.missing) that no column of the block shows on rows 1, …, k, in k B bits. Then each player t + 1 writes the bit Grolmusz.chainBit, and the output is the sum of these k bits.

theorem Cslib.Communication.NOF.Grolmusz.run_grolmusz {k n B : ℕ} (blk : Fin n → Fin B) (hblk : ∀ (b : Fin B), {x : Fin n | blk x = b}.card < 2 ^ k) :

Grolmusz's protocol is correct when every block has fewer than 2 ^ k columns.

Grolmusz's protocol writes k B bits for the patterns and k bits for the chain.

theorem Cslib.Communication.NOF.Grolmusz.ecomplexityFun_gip_le_of_block {k n B : ℕ} (blk : Fin n → Fin B) (hblk : ∀ (b : Fin B), {x : Fin n | blk x = b}.card < 2 ^ k) :

Grolmusz's upper bound, block form [Gro94]: if the n columns are split into B blocks of fewer than 2 ^ k columns each, then k + 1 players compute the generalized inner product of n-bit strings with k (B + 1) bits.

Grolmusz's upper bound [Gro94]: if n ≤ B (2 ^ k - 1), then k + 1 players compute the generalized inner product of n-bit strings with k (B + 1) bits. The blocks are runs of 2 ^ k - 1 consecutive columns.

Grolmusz's upper bound, explicit form [Gro94]: for k ≥ 1, k + 1 players compute the generalized inner product of n-bit strings with k (n / (2 ^ k - 1) + 2) bits, O(k n / 2 ^ k + k).