Documentation

CslibFrontier.Foundations.BooleanAnalysis.LowDegree.OrTest

A seeded low-degree test for OR modulo two #

Let F be a vector space over 𝔽₂ with a basis indexed by κ, and give every position w of a finite set A a vector e w ∈ F. The integer function orTest b e A y = 1 - ∏_{j ∈ κ} (1 - ∑_{w ∈ A} [e w]_j y_w), where [·]_j is the j-th coordinate, has degree at most |κ| in the bits y, and modulo 2 it is nonzero exactly when ∑_{w ∈ A, y_w} e w ≠ 0 (Cslib.BitString.orTest_emod_two_ne_zero_iff). That sum is 0 when no bit is true, so orTest computes the OR of the bits of A whenever the vectors of the true bits do not sum to 0.

With F a finite field and e w = r ^ idx w for an injective idx : A → [0, N) and a seed r ∈ F, the sum is the value at r of the nonzero polynomial ∑_{w ∈ A, y_w} X ^ idx w when some bit is true. It has fewer than N roots (Cslib.BitString.card_filter_sum_pow_eq_zero_le), so for any fixed bits all but fewer than N seeds give the OR. This is a seeded form of the probabilistic polynomial for OR of Razborov [Raz87] and Smolensky [Smo87], with seeds from the powering construction of Alon, Goldreich, Håstad and Peralta [AlonGoldreichHastadPeralta1992, §5, Construction 3 and Proposition 3, June 14, 1992, p. 10]. Beigel and Tarui instead isolate a true bit by the Valiant–Vazirani lemma [BeigelTarui1994, Lemma 2.3]. Here the seed is one field element and the test has degree |κ|, its dimension over 𝔽₂.

Main definitions #

Main results #

References #

noncomputable def Cslib.BitString.orTest {F : Type u_1} {κ : Type u_2} {ι : Type u_3} [AddCommGroup F] [Module (ZMod 2) F] [Fintype κ] (b : Module.Basis κ (ZMod 2) F) (e : ι → F) (A : Finset ι) (y : ι → Bool) :

The seeded OR test 1 - ∏_{j ∈ κ} (1 - ∑_{w ∈ A} [e w]_j y_w), where [·]_j is the j-th coordinate in the basis b of F over 𝔽₂, read as 0 or 1.

theorem Cslib.BitString.orTest_congr {F : Type u_1} {κ : Type u_2} {ι : Type u_3} [AddCommGroup F] [Module (ZMod 2) F] [Fintype κ] (b : Module.Basis κ (ZMod 2) F) (e : ι → F) (A : Finset ι) {y y' : ι → Bool} (h : ∀ w ∈ A, y w = y' w) :
orTest b e A y = orTest b e A y'

The OR test reads only the bits of A.

theorem Cslib.BitString.orTest_emod_two_ne_zero_iff {F : Type u_1} {κ : Type u_2} {ι : Type u_3} [AddCommGroup F] [Module (ZMod 2) F] [Fintype κ] (b : Module.Basis κ (ZMod 2) F) (e : ι → F) (A : Finset ι) (y : ι → Bool) :
orTest b e A y % 2 ≠ 0 ↔ ∑ w ∈ A with y w = true, e w ≠ 0

What the OR test computes. Modulo two, orTest b e A y is nonzero exactly when the vectors e w of the true bits w ∈ A do not sum to 0.

theorem Cslib.BitString.orTest_mem_lowDegree {F : Type u_1} {κ : Type u_2} {ι : Type u_3} [AddCommGroup F] [Module (ZMod 2) F] [Fintype κ] {T : Type u_4} (b : Module.Basis κ (ZMod 2) F) (e : ι → F) (A : Finset ι) {g : ι → (T → Bool) → Bool} (hg : ∀ w ∈ A, (fun (v : T → Bool) => bitVal ℤ (g w v)) ∈ lowDegree ℤ T 1) :
(fun (v : T → Bool) => orTest b e A fun (w : ι) => g w v) ∈ lowDegree ℤ T (Fintype.card κ)

The OR test has degree at most the dimension. If each bit g w v is a function of degree at most 1 of v, then orTest b e A (g · v) has degree at most |κ| in v.