Documentation

CslibFrontier.Computability.PropertyTesting.Monotonicity.EdgeTester

The edge tester for monotone Boolean functions #

The edge tester of Goldreich, Goldwasser, Lehman, Ron and Samorodnitsky picks a uniformly random edge of the cube, reads f at both endpoints, and rejects when f decreases along the edge. Here it is the two-query local test BitString.edgeTest ι, in the format of PCP.LocalTest used for the BLR test in CslibFrontier.Computability.PropertyTesting.Linearity: on the random string (i, x) it reads f at update x i false and at update x i true and accepts when the first value is at most the second. The bit x i is ignored, so a uniform random string selects a uniform direction and a uniform edge in it, as in the source's choice of i and x_{-i} Roughgarden, §8.3.1.

One trial rejects with probability exactly the fraction of violated edges (BitString.one_sub_acceptProb_edgeTest). So it accepts monotone functions with probability one (BitString.acceptProb_edgeTest_of_monotone), and by the analysis in CslibFrontier.Computability.PropertyTesting.Monotonicity.Basic it rejects every function ε-far from monotone with probability at least ε / n (BitString.acceptProb_edgeTest_le), where n is the number of coordinates. k independent trials (LocalTest.repeatAll) run as a decision tree make at most 2 k queries (BitString.depth_decisionTree_repeatAll_edgeTest_le), non-adaptively. They accept monotone functions with probability one and functions ε-far from monotone with probability at most (1 - ε / n) ^ k (BitString.acceptProb_repeatAll_edgeTest_le), hence at most 1 / 3 as soon as 2 n ≤ ε k (BitString.acceptProb_repeatAll_edgeTest_le_one_third). With k = ⌈2 n / ε⌉ this is a one-sided tester making 2 ⌈2 n / ε⌉ = O(n / ε) queries (BitString.acceptProb_repeatAll_edgeTest_ceil_le_one_third). This is the upper bound of Roughgarden, Theorem 8.2, with explicit constants; the theorem takes Θ(n / ε) trials, and nothing is claimed here about fewer.

ε-far means ε ≤ relDistMonotone f: every monotone function differs from f on at least ε 2 ^ n points. Completeness needs ι nonempty: the cube of dimension 0 has no edges, and the acceptance probability over an empty set of random strings is 0 by convention. These are query bounds in the decision-tree model; no running time is claimed.

Main definitions #

Main results #

References #

def Cslib.BitString.edgeTest (ι : Type u_1) [DecidableEq ι] :
PCP.LocalTest (ι → Bool) (ι × (ι → Bool)) (Fin 2) Bool

One trial of the edge tester: on the random string (i, x), read f at the endpoints update x i false and update x i true of the edge in direction i through x, and accept when f does not decrease along it.

@[instance_reducible]
@[simp]
theorem Cslib.BitString.passes_edgeTest {ι : Type u_1} [DecidableEq ι] {f : (ι → Bool) → Bool} {i : ι} {x : ι → Bool} :

The edge test passes on (i, x) when f does not decrease along the edge in direction i through x.

One trial of the edge tester rejects with probability exactly the fraction of violated edges.

theorem Cslib.BitString.acceptProb_edgeTest_of_monotone {ι : Type u_1} [DecidableEq ι] [Fintype ι] [Nonempty ι] {f : (ι → Bool) → Bool} (hf : Monotone f) :

Completeness: one trial accepts a monotone function with probability one.

theorem Cslib.BitString.acceptProb_edgeTest_le {ι : Type u_1} [DecidableEq ι] [Fintype ι] {f : (ι → Bool) → Bool} {ε : ℝ} (hε : ε ≤ relDistMonotone f) :
(edgeTest ι).acceptProb f ≤ 1 - ε / ↑(Fintype.card ι)

Soundness of one trial: a function ε-far from monotone is rejected with probability at least ε / n.

theorem Cslib.BitString.depth_decisionTree_repeatAll_edgeTest_le {ι : Type u_1} [DecidableEq ι] [Fintype ι] (k : ℕ) (r : Fin k → ι × (ι → Bool)) :

k trials of the edge tester, run as a decision tree, make at most 2 k queries on every random string; the queries are fixed by the random string, so the tester is non-adaptive.

theorem Cslib.BitString.acceptProb_repeatAll_edgeTest_of_monotone {ι : Type u_1} [DecidableEq ι] [Fintype ι] [Nonempty ι] (k : ℕ) {f : (ι → Bool) → Bool} (hf : Monotone f) :

One-sided completeness of k trials: monotone functions are always accepted.

theorem Cslib.BitString.acceptProb_repeatAll_edgeTest_le {ι : Type u_1} [DecidableEq ι] [Fintype ι] {f : (ι → Bool) → Bool} {ε : ℝ} (hε : ε ≤ relDistMonotone f) (k : ℕ) :
((edgeTest ι).repeatAll k).acceptProb f ≤ (1 - ε / ↑(Fintype.card ι)) ^ k

Soundness of k trials: a function ε-far from monotone is accepted with probability at most (1 - ε / n) ^ k.

theorem Cslib.BitString.acceptProb_repeatAll_edgeTest_le_one_third {ι : Type u_1} [DecidableEq ι] [Fintype ι] {f : (ι → Bool) → Bool} {ε : ℝ} (hε0 : 0 < ε) (hε : ε ≤ relDistMonotone f) {k : ℕ} (hk : 2 * ↑(Fintype.card ι) ≤ ε * ↑k) :
((edgeTest ι).repeatAll k).acceptProb f ≤ 1 / 3

The edge tester (upper bound of Roughgarden, Theorem 8.2): once 2 n ≤ ε k, k trials accept a function ε-far from monotone with probability at most 1 / 3.

theorem Cslib.BitString.acceptProb_repeatAll_edgeTest_ceil_le_one_third {ι : Type u_1} [DecidableEq ι] [Fintype ι] {f : (ι → Bool) → Bool} {ε : ℝ} (hε0 : 0 < ε) (hε : ε ≤ relDistMonotone f) :

The edge tester with O(n / ε) queries: ⌈2 n / ε⌉ trials, making at most 2 ⌈2 n / ε⌉ queries (depth_decisionTree_repeatAll_edgeTest_le), accept a function ε-far from monotone with probability at most 1 / 3.