Documentation

CslibFrontier.Computability.Streaming.Communication

Streaming algorithms give one-way protocols #

A streaming algorithm with b bits of memory turns into a one-way protocol: Alice runs it on her part u x of the stream and sends the b-bit encoding of the memory state, and Bob decodes the state, runs the algorithm on his part v y and announces the answer (Cslib.Streaming.Algorithm.toProtocol). So if the answer on u x ++ v y determines f x y, then f has communication complexity at most b + 1, deterministically (Cslib.Streaming.Algorithm.ecomplexityFun_le_of_spaceLE) and, for randomized streaming algorithms, with public coins and the same error (Cslib.Streaming.Randomized.ecomplexityFun_le_of_spaceLE). This is the reduction behind the streaming lower bounds of Alon, Matias and Szegedy [AlonMatiasSzegedy1999, Section 3]. Only the memory reachable on Alice's streams needs an encoding; Bob's decoder inverts it on these states.

Main definitions #

Main results #

References #

noncomputable def Cslib.Streaming.Algorithm.toProtocol {σ : Type u_1} {α : Type u_2} {β : Type u_3} {X : Type u_4} {Y : Type u_5} (A : Algorithm σ α β) (m b : ℕ) (enc : σ → BitString b) (u : X → List α) (v : Y → List α) (d : β → Bool) :

The one-way protocol in which Alice runs A on the stream u x, sends the b-bit encoding of its memory state, and Bob decodes it, continues the run on v y and announces d of the answer. Bob decodes by inverting enc on the states reachable on streams of at most m items.

theorem Cslib.Streaming.Algorithm.depth_toProtocol_le {σ : Type u_1} {α : Type u_2} {β : Type u_3} {X : Type u_4} {Y : Type u_5} (A : Algorithm σ α β) (m b : ℕ) (enc : σ → BitString b) (u : X → List α) (v : Y → List α) (d : β → Bool) :
(A.toProtocol m b enc u v d).depth ≤ b + 1

The simulating protocol sends b + 1 bits.

theorem Cslib.Streaming.Algorithm.run_toProtocol {σ : Type u_1} {α : Type u_2} {β : Type u_3} {X : Type u_4} {Y : Type u_5} (A : Algorithm σ α β) {m b : ℕ} {enc : σ → BitString b} (henc : Set.InjOn enc (A.reachable m)) (u : X → List α) (v : Y → List α) (d : β → Bool) {x : X} (hx : (u x).length ≤ m) (y : Y) :
(A.toProtocol m b enc u v d).run x y = d (A.run (u x ++ v y))

When enc is injective on the states reachable on streams of at most m items and Alice's stream has at most m items, the simulating protocol answers as the streaming algorithm on the concatenated stream.

theorem Cslib.Streaming.Algorithm.ecomplexityFun_le_of_spaceLE {σ : Type u_1} {α : Type u_2} {β : Type u_3} {X : Type u_4} {Y : Type u_5} (A : Algorithm σ α β) {m b : ℕ} (hA : A.SpaceLE m b) (u : X → List α) (v : Y → List α) (hu : ∀ (x : X), (u x).length ≤ m) (d : β → Bool) (f : X → Y → Bool) (hf : ∀ (x : X) (y : Y), d (A.run (u x ++ v y)) = f x y) :

Streaming space bounds communication (deterministic): if a streaming algorithm with b bits of memory on streams of length at most m decides f x y from its answer on the stream u x ++ v y, whenever u x has length at most m, then f has a deterministic protocol with b + 1 bits.

theorem Cslib.Streaming.Randomized.ecomplexityFun_le_of_spaceLE {σ : Type u_1} {α : Type u_2} {β : Type u_3} {X : Type u_4} {Y : Type u_5} (μ : Randomized σ α β) {m b : ℕ} (hμ : μ.SpaceLE m b) (u : X → List α) (v : Y → List α) (hu : ∀ (x : X), (u x).length ≤ m) (d : β → Bool) (f : X → Y → Bool) {ε : ℝ} (hf : ∀ (x : X) (y : Y), ((PMF.toOuterMeasure μ) {A : Algorithm σ α β | d (A.run (u x ++ v y)) ≠ f x y}).toReal ≤ ε) :

Streaming space bounds communication (public coins): if a randomized streaming algorithm μ whose algorithms use at most b bits of memory on streams of length at most m decides f x y with error ε from its answer on u x ++ v y, whenever u x has length at most m, then f has a public-coin protocol with error ε and b + 1 bits.