Documentation

CslibFrontier.Computability.DecisionTree.SwitchingProbability

The switching lemma as a probability bound #

Arora and Barak state Håstad's switching lemma as a probability bound (Lemma 13.2 of the web draft dated 2007-01-08, p. 236/252): if f is expressible as a k-DNF on n variables and ρ is a random restriction that assigns random values to t randomly selected input bits, then for every s ≥ 2, Pr_ρ[f|ρ is not expressible as an s-CNF] ≤ ((n - t) k ^ 10 / n) ^ (s / 2). The draft leaves "verifying the exact bound" from its counting to Exercise 3 of Chapter 13.

This file proves that bound for every k. For k ≠ 1 it is derived from the counting form of the switching lemma (DNF.card_switching_le): at most #R(ℓ - s) (4k)^s restrictions leaving ℓ = n - t variables free leave decision tree complexity at least s, and a decision tree of depth below s gives an s-CNF (DecisionTree.toCNF). The random restriction is a uniform element of PartialAssignment.withFree (Fin n) (n - t), which leaves n - t (truncated subtraction) variables free and so fixes min t n of them: exactly t when t ≤ n, the draft's setting, and all n when t > n (for example, n = 1 and t = 2 fix one bit). The theorem is stated for every t. The ratio #R(ℓ - s) / #R(ℓ) is bounded directly with Nat.choose_sub_mul_pow_le, which gives C(n, ℓ - s) / C(n, ℓ) ≤ (ℓ / (n - ℓ + 1)) ^ s; this is a stronger form of the corrected Exercise 13.3(a) (Nat.choose_add_le_choose_mul_div_pow, which this file does not use). The result is Pr ≤ (8 k (n - t) / (t + 1)) ^ s for t ≤ n, which is at most the draft's bound when (n - t) k ^ 10 < n and k ≥ 2; otherwise the draft's bound is at least 1.

The case k = 1. Here the counting bound has the factor 8 ^ s, which k ^ 10 = 1 does not absorb, and the draft's proof (an encoding into {0, 1, ⋆}^{2ks}) does not give the bound either. A direct argument does. Under a bad restriction of a formula whose terms have at most one literal, every fixed literal of the formula is false (otherwise the restricted function is true), and more than s of its variables stay free (otherwise a decision tree on them gives an s-CNF). Drawing the restriction as a free set J of size u = n - t and a word, the word is forced on the fixed variables of the formula. Weighting J by y ^ (#(J ∩ V) - s - 1) ≥ 1 with y = (n + u) / (2u) and expanding (2y) ^ #(J ∩ V) over the subsets of the variables V of the formula bounds the probability by (2u / (n + u)) ^ (s + 1) (Cslib.sum_powersetCard_ite_half_pow_le), and 2u / (n + u) ≤ √(u / n).

Main results #

References #

Terms of one literal #

theorem Cslib.Logic.PL.DNF.card_filter_not_cnf_div_card_le {n k s t : ℕ} {f : (Fin n → Bool) → Bool} (hf : ∃ (F : DNF (Fin n)), (∀ T ∈ F, List.length T ≤ k) ∧ ∀ (x : Fin n → Bool), eval x F = f x) :
↑{ρ ∈ BitString.PartialAssignment.withFree (Fin n) (n - t) | ¬∃ (G : CNF (Fin n)), (∀ c ∈ G, List.length c ≤ s) ∧ ∀ (x : Fin n → Bool), CNF.eval x G = f (ρ.fill x)}.card / ↑(BitString.PartialAssignment.withFree (Fin n) (n - t)).card ≤ (↑(n - t) * ↑k ^ 10 / ↑n) ^ (↑s / 2)

Arora–Barak, Lemma 13.2 (Håstad's switching lemma; web draft 2007-01-08, p. 236/252). Let f be expressible as a k-DNF on n variables and let ρ be a uniformly random restriction fixing t variables, i.e. a uniform element of PartialAssignment.withFree (Fin n) (n - t): a uniform set of t positions with uniform values (all n positions when t > n). Then the probability that the restricted function x ↦ f (ρ.fill x) is not computed by a CNF with clauses of at most s literals is at most ((n - t) k ^ 10 / n) ^ (s / 2). The draft assumes s ≥ 2; the bound holds for every s.