Documentation

CslibFrontier.Computability.Communication.NOF.Protocol

Number-on-forehead protocols #

In the number-on-forehead (NOF) model of multiparty communication, introduced by Chandra, Furst and Lipton [CFL83], players indexed by ι jointly hold an input x : ∀ i, X i, and player i sees every part of the input except their own part x i, which is written on their forehead Jukna, Section 5.4, p. 140. What player i sees is NOF.view i x : NOF.View X i, the input restricted to the other players. The players write bits on a shared blackboard.

A deterministic NOF protocol (NOF.Protocol) is a binary tree whose inner nodes are owned by a player i, who writes a bit computed from what they see (a function of NOF.View X i), and whose leaves are labelled by outputs (NOF.Protocol.run). Since the bit at a node of player i is a function of NOF.view i x, it cannot depend on x i (NOF.view_update_self). The depth of the tree bounds the number of bits written on any input. A protocol solves a relation R on a set A of inputs when its output on every input of A is related to it (NOF.Protocol.Solves); the communication complexity of R on A is the least depth of a protocol solving it, or ⊤ if there is none (NOF.Protocol.ecomplexity), and the communication complexity of computing f is that of the relation f x = z on all inputs (NOF.Protocol.ecomplexityFun). With two players each player sees exactly the other player's input, so two-party protocols (Cslib.Communication.Protocol) run as two-player NOF protocols of the same depth.

Player i can write n bits computed from what they see (NOF.Protocol.sendBits). So when player i's input is determined by n bits that another player j ≠ i sees, every Boolean function has a protocol with n + 1 bits: j writes those bits, after which i knows the whole input and announces the value (NOF.Protocol.ecomplexityFun_le_succ).

Main definitions #

Main results #

References #

@[reducible, inline]
abbrev Cslib.Communication.NOF.View {ι : Type u} (X : ι → Type v) (i : ι) :
Type (max u v)

What player i sees: the parts of the input held on the other players' foreheads.

def Cslib.Communication.NOF.view {ι : Type u} {X : ι → Type v} (i : ι) (x : (j : ι) → X j) :
View X i

The part of the input x that player i sees.

@[simp]
theorem Cslib.Communication.NOF.view_apply {ι : Type u} {X : ι → Type v} (i : ι) (x : (j : ι) → X j) (j : { j : ι // j ≠ i }) :
view i x j = x ↑j
theorem Cslib.Communication.NOF.view_update_self {ι : Type u} {X : ι → Type v} [DecidableEq ι] (i : ι) (x : (j : ι) → X j) (a : X i) :
view i (Function.update x i a) = view i x

A player does not see their own input: changing x i does not change what player i sees.

inductive Cslib.Communication.NOF.Protocol {ι : Type u} (X : ι → Type v) (Z : Type w) :
Type (max u v w)

A deterministic number-on-forehead protocol with output in Z: a leaf labelled by an output, or a node at which player i writes the bit send (view i x), computed from what they see, and the protocol continues with ifFalse or ifTrue.

  • output {ι : Type u} {X : ι → Type v} {Z : Type w} (z : Z) : Protocol X Z

    The protocol ends with output z.

  • speak {ι : Type u} {X : ι → Type v} {Z : Type w} (i : ι) (send : View X i → Bool) (ifFalse ifTrue : Protocol X Z) : Protocol X Z

    Player i writes the bit send (view i x) and the protocol continues accordingly.

def Cslib.Communication.NOF.Protocol.run {ι : Type u} {X : ι → Type v} {Z : Type w} :
Protocol X Z → ((i : ι) → X i) → Z

The output of the protocol on the input x.

def Cslib.Communication.NOF.Protocol.depth {ι : Type u} {X : ι → Type v} {Z : Type w} :
Protocol X Z → ℕ

The number of bits written in the worst case: the depth of the tree.

@[simp]
theorem Cslib.Communication.NOF.Protocol.run_output {ι : Type u} {X : ι → Type v} {Z : Type w} (z : Z) (x : (i : ι) → X i) :
(output z).run x = z
@[simp]
theorem Cslib.Communication.NOF.Protocol.run_speak {ι : Type u} {X : ι → Type v} {Z : Type w} (i : ι) (send : View X i → Bool) (p₀ p₁ : Protocol X Z) (x : (i : ι) → X i) :
(speak i send p₀ p₁).run x = bif send (view i x) then p₁.run x else p₀.run x
@[simp]
theorem Cslib.Communication.NOF.Protocol.depth_output {ι : Type u} {X : ι → Type v} {Z : Type w} (z : Z) :
(output z).depth = 0
@[simp]
theorem Cslib.Communication.NOF.Protocol.depth_speak {ι : Type u} {X : ι → Type v} {Z : Type w} (i : ι) (send : View X i → Bool) (p₀ p₁ : Protocol X Z) :
(speak i send p₀ p₁).depth = max p₀.depth p₁.depth + 1

Solving relations and communication complexity #

def Cslib.Communication.NOF.Protocol.Solves {ι : Type u} {X : ι → Type v} {Z : Type w} (p : Protocol X Z) (R : ((i : ι) → X i) → Z → Prop) (A : Set ((i : ι) → X i)) :

A protocol solves the relation R on the set A of inputs when its output on every input of A is related to it.

theorem Cslib.Communication.NOF.Protocol.Solves.mono {ι : Type u} {X : ι → Type v} {Z : Type w} {p : Protocol X Z} {R : ((i : ι) → X i) → Z → Prop} {A A' : Set ((i : ι) → X i)} (h : p.Solves R A) (hA : A' ⊆ A) :
p.Solves R A'
theorem Cslib.Communication.NOF.Protocol.Solves.of_imp {ι : Type u} {X : ι → Type v} {Z : Type w} {p : Protocol X Z} {R R' : ((i : ι) → X i) → Z → Prop} {A : Set ((i : ι) → X i)} (h : p.Solves R A) (hR : ∀ (x : (i : ι) → X i) (z : Z), R x z → R' x z) :
p.Solves R' A
noncomputable def Cslib.Communication.NOF.Protocol.ecomplexity {ι : Type u} {X : ι → Type v} {Z : Type w} (R : ((i : ι) → X i) → Z → Prop) (A : Set ((i : ι) → X i)) :

The communication complexity of R on A: the least depth of a protocol solving it, or ⊤ if there is none.

theorem Cslib.Communication.NOF.Protocol.ecomplexity_le_depth {ι : Type u} {X : ι → Type v} {Z : Type w} {p : Protocol X Z} {R : ((i : ι) → X i) → Z → Prop} {A : Set ((i : ι) → X i)} (hp : p.Solves R A) :
theorem Cslib.Communication.NOF.Protocol.ecomplexity_ne_top_iff {ι : Type u} {X : ι → Type v} {Z : Type w} {R : ((i : ι) → X i) → Z → Prop} {A : Set ((i : ι) → X i)} :
ecomplexity R A ≠ ⊤ ↔ ∃ (p : Protocol X Z), p.Solves R A
theorem Cslib.Communication.NOF.Protocol.exists_solves_depth_eq_ecomplexity {ι : Type u} {X : ι → Type v} {Z : Type w} {R : ((i : ι) → X i) → Z → Prop} {A : Set ((i : ι) → X i)} (h : ∃ (p : Protocol X Z), p.Solves R A) :
∃ (p : Protocol X Z), p.Solves R A ∧ ↑p.depth = ecomplexity R A

When some protocol solves R, the least depth is attained.

theorem Cslib.Communication.NOF.Protocol.ecomplexity_le_iff {ι : Type u} {X : ι → Type v} {Z : Type w} {R : ((i : ι) → X i) → Z → Prop} {A : Set ((i : ι) → X i)} {k : ℕ} :
ecomplexity R A ≤ ↑k ↔ ∃ (p : Protocol X Z), p.Solves R A ∧ p.depth ≤ k

Upper bounds on communication complexity: R has communication complexity at most k on A exactly when some protocol of depth at most k solves it.

theorem Cslib.Communication.NOF.Protocol.le_ecomplexity_iff {ι : Type u} {X : ι → Type v} {Z : Type w} {R : ((i : ι) → X i) → Z → Prop} {A : Set ((i : ι) → X i)} {k : ℕ∞} :
k ≤ ecomplexity R A ↔ ∀ (p : Protocol X Z), p.Solves R A → k ≤ ↑p.depth

Lower bounds on communication complexity are lower bounds on the depth of every protocol solving the relation, including when there is none.

theorem Cslib.Communication.NOF.Protocol.ecomplexity_mono {ι : Type u} {X : ι → Type v} {Z : Type w} {R : ((i : ι) → X i) → Z → Prop} {A A' : Set ((i : ι) → X i)} (hA : A' ⊆ A) :

Solving a relation on a larger set is harder.

noncomputable def Cslib.Communication.NOF.Protocol.ecomplexityFun {ι : Type u} {X : ι → Type v} {Z : Type w} (f : ((i : ι) → X i) → Z) :

The communication complexity of computing f on all inputs: ecomplexity of the relation f x = z on all inputs.

theorem Cslib.Communication.NOF.Protocol.solves_univ_iff {ι : Type u} {X : ι → Type v} {Z : Type w} {p : Protocol X Z} {f : ((i : ι) → X i) → Z} :
p.Solves (fun (x : (i : ι) → X i) (z : Z) => f x = z) Set.univ ↔ p.run = f

A protocol solves the relation f x = z on all inputs when it computes f.

theorem Cslib.Communication.NOF.Protocol.ecomplexityFun_le_depth {ι : Type u} {X : ι → Type v} {Z : Type w} {p : Protocol X Z} {f : ((i : ι) → X i) → Z} (hp : p.run = f) :
theorem Cslib.Communication.NOF.Protocol.ecomplexityFun_le_iff {ι : Type u} {X : ι → Type v} {Z : Type w} {f : ((i : ι) → X i) → Z} {k : ℕ} :
ecomplexityFun f ≤ ↑k ↔ ∃ (p : Protocol X Z), p.run = f ∧ p.depth ≤ k

Computing f has communication complexity at most k exactly when some protocol of depth at most k computes f.

theorem Cslib.Communication.NOF.Protocol.le_ecomplexityFun_iff {ι : Type u} {X : ι → Type v} {Z : Type w} {f : ((i : ι) → X i) → Z} {k : ℕ∞} :
k ≤ ecomplexityFun f ↔ ∀ (p : Protocol X Z), p.run = f → k ≤ ↑p.depth

Lower bounds on the communication complexity of f are lower bounds on the depth of every protocol computing f, including when there is none.

Writing a bit string #

def Cslib.Communication.NOF.Protocol.sendBits {ι : Type u} {X : ι → Type v} {Z : Type w} (i : ι) (n : ℕ) :
(View X i → BitString n) → (BitString n → Protocol X Z) → Protocol X Z

Player i writes the n bits of msg (view i x), first bit first, after which the protocol continues with cont of the bits written.

@[simp]
theorem Cslib.Communication.NOF.Protocol.run_sendBits {ι : Type u} {X : ι → Type v} {Z : Type w} (i : ι) (n : ℕ) (msg : View X i → BitString n) (cont : BitString n → Protocol X Z) (x : (i : ι) → X i) :
(sendBits i n msg cont).run x = (cont (msg (view i x))).run x
theorem Cslib.Communication.NOF.Protocol.depth_sendBits_le {ι : Type u} {X : ι → Type v} {Z : Type w} {i : ι} {n d : ℕ} {msg : View X i → BitString n} {cont : BitString n → Protocol X Z} (h : ∀ (m : BitString n), (cont m).depth ≤ d) :
(sendBits i n msg cont).depth ≤ n + d

Writing n bits adds at most n to the depth.

def Cslib.Communication.NOF.Protocol.sendEach {ι : Type u} {X : ι → Type v} {Z : Type w} (m : ℕ) (who : Fin m → ι) (bit : (t : Fin m) → View X (who t) → Bool) :
(BitString m → Protocol X Z) → Protocol X Z

Players who 0, …, who (m - 1) write one bit each, in this order, player who t writing bit t of what they see, after which the protocol continues with cont of the bits written.

@[simp]
theorem Cslib.Communication.NOF.Protocol.run_sendEach {ι : Type u} {X : ι → Type v} {Z : Type w} (m : ℕ) (who : Fin m → ι) (bit : (t : Fin m) → View X (who t) → Bool) (cont : BitString m → Protocol X Z) (x : (i : ι) → X i) :
(sendEach m who bit cont).run x = (cont fun (t : Fin m) => bit t (view (who t) x)).run x
theorem Cslib.Communication.NOF.Protocol.depth_sendEach_le {ι : Type u} {X : ι → Type v} {Z : Type w} {m d : ℕ} {who : Fin m → ι} {bit : (t : Fin m) → View X (who t) → Bool} {cont : BitString m → Protocol X Z} (h : ∀ (b : BitString m), (cont b).depth ≤ d) :
(sendEach m who bit cont).depth ≤ m + d

m players writing a bit each add at most m to the depth.

theorem Cslib.Communication.NOF.Protocol.ecomplexityFun_le_succ {ι : Type u} {X : ι → Type v} {i j : ι} (hij : i ≠ j) {n : ℕ} (encode : View X j → BitString n) (decode : BitString n → X i) (hdecode : ∀ (x : (k : ι) → X k), decode (encode (view j x)) = x i) (f : ((k : ι) → X k) → Bool) :

The trivial protocol. If player i's input is recovered by decode from n bits encode that player j ≠ i computes from what they see, then every Boolean function has a protocol with n + 1 bits: player j writes the n bits, after which player i knows the whole input and announces the value.

Sequencing protocols #

def Cslib.Communication.NOF.Protocol.bind {ι : Type u} {X : ι → Type v} {Z : Type w} {Z' : Type u_1} :
Protocol X Z → (Z → Protocol X Z') → Protocol X Z'

Run p, then the protocol q z chosen by the output z of p: each leaf of p labelled z is replaced by q z.

@[simp]
theorem Cslib.Communication.NOF.Protocol.run_bind {ι : Type u} {X : ι → Type v} {Z : Type w} {Z' : Type u_1} (p : Protocol X Z) (q : Z → Protocol X Z') (x : (i : ι) → X i) :
(p.bind q).run x = (q (p.run x)).run x
theorem Cslib.Communication.NOF.Protocol.depth_bind_le {ι : Type u} {X : ι → Type v} {Z : Type w} {Z' : Type u_1} {p : Protocol X Z} {q : Z → Protocol X Z'} {d : ℕ} (hq : ∀ (z : Z), (q z).depth ≤ d) :
(p.bind q).depth ≤ p.depth + d

Sequencing writes at most the bits of the first protocol and then those of the second.

def Cslib.Communication.NOF.Protocol.runAll {ι : Type u} {X : ι → Type v} {Z : Type w} {Z' : Type u_1} {k : ℕ} :
(Fin k → Protocol X Z) → ((Fin k → Z) → Z') → Protocol X Z'

Run the protocols ps 0, …, ps (k - 1) one after another and output g of their outputs.

@[simp]
theorem Cslib.Communication.NOF.Protocol.run_runAll {ι : Type u} {X : ι → Type v} {Z : Type w} {Z' : Type u_1} {k : ℕ} (ps : Fin k → Protocol X Z) (g : (Fin k → Z) → Z') (x : (i : ι) → X i) :
(runAll ps g).run x = g fun (t : Fin k) => (ps t).run x
theorem Cslib.Communication.NOF.Protocol.depth_runAll_le {ι : Type u} {X : ι → Type v} {Z : Type w} {Z' : Type u_1} {k : ℕ} {ps : Fin k → Protocol X Z} {g : (Fin k → Z) → Z'} {d : ℕ} (hps : ∀ (t : Fin k), (ps t).depth ≤ d) :
(runAll ps g).depth ≤ k * d

Running k protocols of depth at most d one after another writes at most k d bits.