Documentation

CslibFrontier.Computability.Communication.BinarySearch

Binary search for a coordinate where a sum drops #

Alice holds x and Bob holds y, and each index i of a list carries Alice's integer f x i and Bob's integer g y i. If Bob's sum is smaller than Alice's, some index has g y i < f x i, and the players find one by binary search: they compare the sums over the first half of the list, recurse into the first half if Bob's sum is smaller there and into the second half otherwise. If comparing the sums over a sublist takes c bits, finding the index takes ⌈log₂ |l|⌉ · c bits (Cslib.Communication.Protocol.exists_search_lt).

This is the search step in the proof of Krajíček's interpolation theorem for cutting planes Krajíček, Theorem 6.4, where f x i and g y i are the contributions aᵢ uᵢ and aᵢ vᵢ of a shared variable to a linear inequality, and the comparison costs ⌈log₂ (2 M n + 1)⌉ + 1 bits for coefficients at most M in absolute value.

Main results #

References #

theorem Cslib.Communication.Protocol.exists_search_lt {X : Type u_1} {Y : Type u_2} {ι : Type u_3} (f : X → ι → ℤ) (g : Y → ι → ℤ) (L c : ℕ) (hcmp : ∀ (l : List ι), l.length ≤ L → ∃ (p : Protocol X Y Bool), p.depth ≤ c ∧ ∀ (x : X) (y : Y), p.run x y = true ↔ (List.map (g y) l).sum < (List.map (f x) l).sum) (l : List ι) (hl : l.length ≤ L) :
∃ (p : Protocol X Y (Option ι)), p.depth ≤ Nat.clog 2 l.length * c ∧ ∀ (x : X) (y : Y), (List.map (g y) l).sum < (List.map (f x) l).sum → ∃ i ∈ p.run x y, g y i < f x i

Binary search for a coordinate where a sum drops. Suppose that for every list of at most L indices, Alice holding x and Bob holding y can decide with c bits whether ∑ g y < ∑ f x over the list. Then for every list l of at most L indices they can find, with ⌈log₂ |l|⌉ · c bits, an index i with g y i < f x i whenever ∑ g y < ∑ f x over l.