Documentation

CslibFrontier.Computability.Communication.Nondeterministic.Basic

Nondeterministic communication complexity #

Nondeterministic communication complexity for the answer z : Bool is defined by covers Kushilevitz and Nisan, Definition 2.3, p. 18. For a relation R : X → Y → Bool → Prop, a z-cover of R on A × B is a family of rectangles, indexed by any type, such that z is an acceptable answer on the part of each rectangle inside A × B, and every pair of A × B on which !z is not acceptable lies in some rectangle (Nondeterministic.IsCover). A cover by 2 ^ k rectangles is one indexed by the k-bit guesses (Nondeterministic.HasCover). The complexity Nondeterministic.ecomplexity z R A B is the least such k, or ⊤ if there is none; in particular it is ⊤ if no answer is acceptable on some pair of A × B, as for Protocol.ecomplexity. For a function f : X → Y → Bool, Nondeterministic.ecomplexityFun z f A B is the complexity of the relation f x y = b; its z-covers are families of rectangles on which f is z inside A × B that contain every pair of A × B on which f is z (Nondeterministic.isCover_fun_iff). Thus ecomplexityFun true f and ecomplexityFun false f are ⌈log₂ C^z(f)⌉, where C^z(f) is the least number of rectangles in a z-cover Kushilevitz and Nisan, Definition 2.1(4), p. 17 (and 0 when f never takes the value z on A × B).

Kushilevitz and Nisan define N^z(f) = log₂ C^z(f) for a Boolean function f on all of X × Y, without rounding. So for such f, ecomplexityFun z f Set.univ Set.univ is their N^z(f) rounded up to an integer, and for n ≥ 1 a lower bound n ≤ ecomplexityFun z f Set.univ Set.univ says C^z(f) > 2 ^ (n - 1), that is, N^z(f) > n - 1 in their convention.

The model here lies between the total Boolean functions of their Definition 2.1 and the relations with arbitrary answers of Kushilevitz and Nisan, Chapter 5: it covers partial Boolean functions, which are relations with Boolean answers. For these it is the model NP of Göös, Pitassi and Watson, Definition B.1 (author copy, p. 44): a collection of 2 ^ k rectangles indexed by k-bit witnesses, whose output is 1 exactly on their union, correct on the domain of the function, of cost k; co-classes are defined by negating the function. A partial function is a function together with the sets A and B, or, when its domain is not a rectangle, a relation that accepts both answers outside its domain; its values there do not matter, and rectangles are not required to lie inside the domain. Kushilevitz and Nisan remark after Definition 5.2 that for relations, measures such as N¹(R) are less interesting, since the answer 1 has no special role; with Boolean answers, N⁰ and N¹ keep their meaning.

A relation R : X → Y → Bool → Prop is their relation R ⊆ X × Y × Z with Z = Bool Kushilevitz and Nisan, Definition 5.1, p. 71: R x y b holds exactly when (x, y, b) ∈ R. A partial Boolean function f with domain D is the relation fun x y b => (x, y) ∈ D → f x y = b. Kushilevitz and Nisan require a protocol for a relation to be correct only on legal inputs, those with some acceptable answer, and define the other measures for relations "in a similar manner" Kushilevitz and Nisan, Definition 5.2, p. 71. Here, as for Protocol.ecomplexity, which is stated for relations, every pair of A × B must get an acceptable answer, so a pair of A × B with no acceptable answer makes the complexity ⊤. Just before Definition 5.2 they note the alternative of extending a relation to allow every answer on its illegal pairs; their convention for R is this one for that extension, which is no harder than R (Nondeterministic.ecomplexity_le_of_imp).

Covers and protocols #

Covers count rectangles; no bits are spent announcing the answer. Protocols must announce it, and conventions differ on who must learn it. In Protocol the answer is a function of the transcript, so both players know it; for instance, equality on v-bit strings has deterministic complexity v + 1 for v ≥ 1 (Cslib.Communication.ecomplexityFun_equality). For nondeterministic protocols in the same convention, where the guessed bits count towards the cost and at the end both players know whether to accept, the two notions differ by at most two bits:

So ecomplexity z R A B ≤ k gives a protocol of cost k + 2, and a protocol of cost c, once converted to a cover, gives ecomplexity z R A B ≤ c (Nondeterministic.ecomplexity_le_iff). Deterministic protocols give covers directly (Nondeterministic.ecomplexity_le_protocol).

Main definitions #

Main results #

References #

def Cslib.Communication.Nondeterministic.IsCover {X : Type u_1} {Y : Type u_2} (z : Bool) (R : X → Y → Bool → Prop) (A : Set X) (B : Set Y) {κ : Type u_3} (C : κ → Set X × Set Y) :

C is a z-cover of the relation R on A × B by rectangles indexed by κ: z is an acceptable answer on the part of each rectangle inside A × B, and every pair of A × B on which !z is not acceptable lies in some rectangle. For nondeterministic protocols κ is BitString k, the guesses of k bits (Nondeterministic.HasCover).

def Cslib.Communication.Nondeterministic.HasCover {X : Type u_1} {Y : Type u_2} (z : Bool) (R : X → Y → Bool → Prop) (A : Set X) (B : Set Y) (k : ℕ) :

The relation R has a z-cover on A × B by 2 ^ k rectangles.

noncomputable def Cslib.Communication.Nondeterministic.ecomplexity {X : Type u_1} {Y : Type u_2} (z : Bool) (R : X → Y → Bool → Prop) (A : Set X) (B : Set Y) :

The nondeterministic communication complexity of the relation R on A × B for the answer z: the least k such that R has a z-cover on A × B by 2 ^ k rectangles, or ⊤ if there is none.

noncomputable def Cslib.Communication.Nondeterministic.ecomplexityFun {X : Type u_1} {Y : Type u_2} (z : Bool) (f : X → Y → Bool) (A : Set X) (B : Set Y) :

The nondeterministic communication complexity of f on A × B for the value z: ecomplexity of the relation f x y = b. N¹ is z = true, and N⁰ is z = false.

theorem Cslib.Communication.Nondeterministic.isCover_fun_iff {X : Type u_1} {Y : Type u_2} {f : X → Y → Bool} {z : Bool} {A : Set X} {B : Set Y} {κ : Type u_3} {C : κ → Set X × Set Y} :
IsCover z (fun (x : X) (y : Y) (b : Bool) => f x y = b) A B C ↔ (∀ (w : κ), ∀ x ∈ A, x ∈ (C w).1 → ∀ y ∈ B, y ∈ (C w).2 → f x y = z) ∧ ∀ x ∈ A, ∀ y ∈ B, f x y = z → ∃ (w : κ), x ∈ (C w).1 ∧ y ∈ (C w).2

A z-cover of a function: f is z on the part of each rectangle inside A × B, and every pair of A × B on which f is z lies in some rectangle.

Upper and lower bounds #

theorem Cslib.Communication.Nondeterministic.HasCover.ecomplexity_le {X : Type u_1} {Y : Type u_2} {R : X → Y → Bool → Prop} {z : Bool} {A : Set X} {B : Set Y} {k : ℕ} (h : HasCover z R A B k) :
ecomplexity z R A B ≤ ↑k

A cover by 2 ^ k rectangles bounds the complexity by k.

theorem Cslib.Communication.Nondeterministic.HasCover.mono_bits {X : Type u_1} {Y : Type u_2} {R : X → Y → Bool → Prop} {z : Bool} {A : Set X} {B : Set Y} {j k : ℕ} (hjk : j ≤ k) (h : HasCover z R A B j) :
HasCover z R A B k

A cover by 2 ^ j rectangles gives one by 2 ^ k rectangles for j ≤ k: ignore the extra guessed bits.

theorem Cslib.Communication.Nondeterministic.le_ecomplexity_iff {X : Type u_1} {Y : Type u_2} {R : X → Y → Bool → Prop} {z : Bool} {A : Set X} {B : Set Y} {c : ℕ∞} :
c ≤ ecomplexity z R A B ↔ ∀ (k : ℕ), HasCover z R A B k → c ≤ ↑k

Lower bounds on nondeterministic complexity are lower bounds on the number of guessed bits of every cover.

theorem Cslib.Communication.Nondeterministic.ecomplexity_le_iff {X : Type u_1} {Y : Type u_2} {R : X → Y → Bool → Prop} {z : Bool} {A : Set X} {B : Set Y} {k : ℕ} :
ecomplexity z R A B ≤ ↑k ↔ HasCover z R A B k

R has nondeterministic complexity at most k exactly when it has a z-cover by 2 ^ k rectangles.

theorem Cslib.Communication.Nondeterministic.ecomplexityFun_le_iff {X : Type u_1} {Y : Type u_2} {f : X → Y → Bool} {z : Bool} {A : Set X} {B : Set Y} {k : ℕ} :
ecomplexityFun z f A B ≤ ↑k ↔ HasCover z (fun (x : X) (y : Y) (b : Bool) => f x y = b) A B k

ecomplexity_le_iff for functions.

theorem Cslib.Communication.Nondeterministic.le_ecomplexityFun_iff {X : Type u_1} {Y : Type u_2} {f : X → Y → Bool} {z : Bool} {A : Set X} {B : Set Y} {c : ℕ∞} :
c ≤ ecomplexityFun z f A B ↔ ∀ (k : ℕ), HasCover z (fun (x : X) (y : Y) (b : Bool) => f x y = b) A B k → c ≤ ↑k

le_ecomplexity_iff for functions.

Monotonicity #

theorem Cslib.Communication.Nondeterministic.HasCover.mono {X : Type u_1} {Y : Type u_2} {R : X → Y → Bool → Prop} {z : Bool} {A A' : Set X} {B B' : Set Y} {k : ℕ} (hA : A' ⊆ A) (hB : B' ⊆ B) (h : HasCover z R A B k) :
HasCover z R A' B' k

A cover on A × B is a cover on any smaller domain.

theorem Cslib.Communication.Nondeterministic.HasCover.of_imp {X : Type u_1} {Y : Type u_2} {R R' : X → Y → Bool → Prop} {z : Bool} {A : Set X} {B : Set Y} {k : ℕ} (hR : ∀ (x : X) (y : Y) (b : Bool), R x y b → R' x y b) (h : HasCover z R A B k) :
HasCover z R' A B k

A cover of R is a cover of every weaker relation.

theorem Cslib.Communication.Nondeterministic.ecomplexity_mono {X : Type u_1} {Y : Type u_2} {R : X → Y → Bool → Prop} {z : Bool} {A A' : Set X} {B B' : Set Y} (hA : A' ⊆ A) (hB : B' ⊆ B) :
ecomplexity z R A' B' ≤ ecomplexity z R A B

Nondeterministic complexity is monotone in the domain.

theorem Cslib.Communication.Nondeterministic.ecomplexityFun_mono {X : Type u_1} {Y : Type u_2} {f : X → Y → Bool} {z : Bool} {A A' : Set X} {B B' : Set Y} (hA : A' ⊆ A) (hB : B' ⊆ B) :

ecomplexity_mono for functions.

theorem Cslib.Communication.Nondeterministic.ecomplexity_le_of_imp {X : Type u_1} {Y : Type u_2} {R R' : X → Y → Bool → Prop} {z : Bool} {A : Set X} {B : Set Y} (hR : ∀ (x : X) (y : Y) (b : Bool), R x y b → R' x y b) :
ecomplexity z R' A B ≤ ecomplexity z R A B

A weaker relation is no harder.

Negation #

theorem Cslib.Communication.Nondeterministic.ecomplexity_not {X : Type u_1} {Y : Type u_2} {R : X → Y → Bool → Prop} {z : Bool} {A : Set X} {B : Set Y} :
ecomplexity z (fun (x : X) (y : Y) (b : Bool) => R x y !b) A B = ecomplexity (!z) R A B

Exchanging the answers exchanges N⁰ and N¹.

@[simp]
theorem Cslib.Communication.Nondeterministic.ecomplexityFun_not {X : Type u_1} {Y : Type u_2} {f : X → Y → Bool} {z : Bool} {A : Set X} {B : Set Y} :
ecomplexityFun z (fun (x : X) (y : Y) => !f x y) A B = ecomplexityFun (!z) f A B

N⁰ of f is N¹ of its negation, and conversely.

Lower bounds #

theorem Cslib.Communication.Nondeterministic.IsCover.card_le {X : Type u_1} {Y : Type u_2} {f : X → Y → Bool} {z : Bool} {A : Set X} {B : Set Y} {κ : Type u_3} [Fintype κ] {C : κ → Set X × Set Y} {S : Finset (X × Y)} (hS : IsFoolingSet f z S) (hSAB : ∀ q ∈ S, q.1 ∈ A ∧ q.2 ∈ B) (hC : IsCover z (fun (x : X) (y : Y) (b : Bool) => f x y = b) A B C) :

The fooling-set bound, for covers indexed by a finite type. A fooling set for f with value z inside A × B has at most |κ| pairs if C : κ → Set X × Set Y is a z-cover of f on A × B: no rectangle contains two of its pairs.

theorem Cslib.Communication.Nondeterministic.HasCover.card_le {X : Type u_1} {Y : Type u_2} {f : X → Y → Bool} {z : Bool} {A : Set X} {B : Set Y} {k : ℕ} {S : Finset (X × Y)} (hS : IsFoolingSet f z S) (hSAB : ∀ q ∈ S, q.1 ∈ A ∧ q.2 ∈ B) (h : HasCover z (fun (x : X) (y : Y) (b : Bool) => f x y = b) A B k) :
S.card ≤ 2 ^ k

The fooling-set bound, for covers. A fooling set for f with value z inside A × B has at most 2 ^ k pairs if f has a z-cover on A × B by 2 ^ k rectangles: no rectangle contains two of its pairs.

theorem Cslib.Communication.Nondeterministic.le_ecomplexityFun_of_isFoolingSet {X : Type u_1} {Y : Type u_2} {f : X → Y → Bool} {z : Bool} {A : Set X} {B : Set Y} {S : Finset (X × Y)} (hS : IsFoolingSet f z S) (hSAB : ∀ q ∈ S, q.1 ∈ A ∧ q.2 ∈ B) {n : ℕ} (hn : 2 ^ n ≤ S.card) :
↑n ≤ ecomplexityFun z f A B

The fooling-set bound on nondeterministic complexity. A fooling set of at least 2 ^ n pairs for f with value z inside A × B forces n.

theorem Cslib.Communication.Nondeterministic.HasCover.card_le_two_pow_mul {X : Type u_1} {Y : Type u_2} {f : X → Y → Bool} {z : Bool} {k : ℕ} {s : Finset X} {t : Finset Y} {K : ℕ} (hK : ∀ S ⊆ s, ∀ T ⊆ t, (∀ x ∈ S, ∀ y ∈ T, f x y = z) → S.card * T.card ≤ K) (h : HasCover z (fun (x : X) (y : Y) (b : Bool) => f x y = b) (↑s) (↑t) k) :
{q ∈ s ×ˢ t | f q.1 q.2 = z}.card ≤ 2 ^ k * K

The rectangle-size bound. Let s and t be finite. If every rectangle inside s × t on which f is constantly z has at most K pairs, then a z-cover of f on s × t by 2 ^ k rectangles covers at most 2 ^ k * K pairs, so f is z on at most 2 ^ k * K pairs of s × t.

Comparison with deterministic complexity #

theorem Cslib.Communication.Protocol.Solves.hasCover {X : Type u_1} {Y : Type u_2} {R : X → Y → Bool → Prop} {A : Set X} {B : Set Y} {p : Protocol X Y Bool} (hp : p.Solves R A B) (z : Bool) :

The leaves with output z of a deterministic protocol solving R on A × B form a z-cover of R by 2 ^ depth rectangles.

theorem Cslib.Communication.Nondeterministic.ecomplexity_le_protocol {X : Type u_1} {Y : Type u_2} {R : X → Y → Bool → Prop} {A : Set X} {B : Set Y} (z : Bool) :

Nondeterministic complexity is at most deterministic complexity.