Documentation

CslibFrontier.Probability.Fooling.DecisionTree

Adaptive tests of t-wise independence #

A test that inspects bits of its input adaptively is a decision tree (Cslib.DecisionTree), and the bits it inspects on an input z are t.queries z. The input reaches the leaf it reaches exactly on the subcube of inputs that agree with z on those bits (DecisionTree.eval_eq_of_forall_mem_queries). Summing over the leaves therefore turns a bound on subcubes into a bound on trees: if a signed weight d on the cube has total weight at most ε in absolute value on every subcube spanned by an admissible set of coordinates, and every query set of the tree is admissible, then |∑ z, d z * g (t.eval z)| ≤ 2 ^ k * C * ε, where every input makes at most k queries and |g| ≤ C at the outputs (Cslib.DecisionTree.abs_sum_mul_eval_le). The proof is an induction over the tree that keeps the partial assignment fixed by the queries so far; a query whose answer is already fixed follows a single branch, so repeated queries cost nothing.

With d the difference of a distribution and the uniform distribution, this gives the bounds in Exercises 8.29 and 8.32(2) of the March 2007 draft [Gol07c]:

The companion separation module proves that adaptive tests can detect distributions whose fixed-coordinate marginals are close to uniform.

Main results #

References #

theorem Cslib.DecisionTree.abs_sum_mul_eval_le {ι : Type u_1} {β : Type u_2} [Fintype ι] [DecidableEq ι] (A : Finset ι → Prop) (d : (ι → Bool) → ℝ) {ε : ℝ} (hd : ∀ (P : Finset ι), A P → ∀ (a : ι → Bool), |∑ z : ι → Bool with ∀ i ∈ P, z i = a i, d z| ≤ ε) (t : DecisionTree ι β) (hA : ∀ (z : ι → Bool), A (t.queries z)) {k : ℕ} (hk : ∀ (z : ι → Bool), (t.queries z).card ≤ k) (g : β → ℝ) {C : ℝ} (hg : ∀ (z : ι → Bool), |g (t.eval z)| ≤ C) :
|∑ z : ι → Bool, d z * g (t.eval z)| ≤ 2 ^ k * (C * ε)

Bounds on subcubes bound decision trees. Let d be a signed weight on the cube whose total on every subcube spanned by an admissible set P of coordinates, {z | ∀ i ∈ P, z i = a i}, is at most ε in absolute value. If a decision tree t makes at most k queries on every input, its query sets are all admissible, and |g| ≤ C on its outputs, then the d-weighted sum of g (t.eval z) is at most 2 ^ k * (C * ε) in absolute value.

theorem Cslib.DecisionTree.abs_map_eval_apply_sub_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] {X : PMF (ι → Bool)} {t : ℕ} {ε : ℝ} (ht : t ≤ Fintype.card ι) (hX : ∀ (S : Finset ι), S.card = t → dist (PMF.map S.restrict X) (Probability.PMF.uniformOfFintype (↥S → Bool)) ≤ ε) (T : DecisionTree ι Bool) (hT : ∀ (z : ι → Bool), (T.queries z).card ≤ t) :

Adaptive tests of almost t-wise independence, deterministic case. If the marginal of X on every t coordinates is ε-close to uniform, a decision tree that inspects at most t coordinates on every input accepts X and the uniform distribution with probabilities that differ by at most 2 ^ t ε. The randomized form is abs_bind_map_eval_apply_sub_le Goldreich, Exercise 8.32(2).

theorem Cslib.DecisionTree.abs_bind_map_eval_apply_sub_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] {R : Type u_3} [Finite R] {X : PMF (ι → Bool)} {t : ℕ} {ε : ℝ} (ht : t ≤ Fintype.card ι) (hX : ∀ (S : Finset ι), S.card = t → dist (PMF.map S.restrict X) (Probability.PMF.uniformOfFintype (↥S → Bool)) ≤ ε) (ρ : PMF R) (T : R → DecisionTree ι Bool) (hT : ∀ (r : R) (z : ι → Bool), ((T r).queries z).card ≤ t) :
|((ρ.bind fun (r : R) => PMF.map (T r).eval X) true).toReal - ((ρ.bind fun (r : R) => PMF.map (T r).eval (Probability.PMF.uniformOfFintype (ι → Bool))) true).toReal| ≤ 2 ^ t * ε

Adaptive tests of almost t-wise independence [Goldreich, Exercise 8.32(2)] [Gol07c]. If every t fixed positions of X are ε-close to uniform, then every randomized test that inspects t positions adaptively distinguishes X from the uniform distribution with gap at most 2 ^ t ε. The test draws coins r from ρ on a finite type and runs the decision tree T r, which inspects at most t positions on every input. Its gap is the absolute difference of its acceptance probabilities. The source leaves the string length n ≥ t implicit. It appears here as t ≤ Fintype.card ι.

theorem Cslib.Probability.IsKWiseIndependentHash.map_eval_eq {Seed : Type u_1} {Pos : Type u_2} {κ : Type u_3} {β : Type u_4} [Fintype Seed] [Nonempty Seed] [Fintype Pos] [DecidableEq Pos] [Fintype κ] [DecidableEq κ] {t : ℕ} {G : Seed → Pos → κ → Bool} (hG : IsKWiseIndependentHash t G) (T : DecisionTree (Pos × κ) β) (hT : ∀ (z : Pos × κ → Bool), (Finset.image Prod.fst (T.queries z)).card ≤ t) :
PMF.map (fun (s : Seed) => T.eval (Function.uncurry (G s))) (PMF.uniformOfFintype Seed) = PMF.map T.eval (PMF.uniformOfFintype (Pos × κ → Bool))

t-wise independent generators fool adaptive block tests, deterministic case. If G is a t-wise independent family of block sequences, then a decision tree on the bits (p, j) of the blocks that reads bits of at most t blocks on every input has the same output distribution on G with a uniform seed as on uniform bits. The randomized form is bind_map_eval_eq Goldreich, Exercise 8.29.

theorem Cslib.Probability.IsKWiseIndependentHash.bind_map_eval_eq {Seed : Type u_1} {Pos : Type u_2} {κ : Type u_3} {β : Type u_4} [Fintype Seed] [Nonempty Seed] [Fintype Pos] [DecidableEq Pos] [Fintype κ] [DecidableEq κ] {t : ℕ} {G : Seed → Pos → κ → Bool} (hG : IsKWiseIndependentHash t G) {R : Type u_5} (ρ : PMF R) (T : R → DecisionTree (Pos × κ) β) (hT : ∀ (r : R) (z : Pos × κ → Bool), (Finset.image Prod.fst ((T r).queries z)).card ≤ t) :
(ρ.bind fun (r : R) => PMF.map (fun (s : Seed) => (T r).eval (Function.uncurry (G s))) (PMF.uniformOfFintype Seed)) = ρ.bind fun (r : R) => PMF.map (T r).eval (PMF.uniformOfFintype (Pos × κ → Bool))

t-wise independent generators fool adaptive tests of t blocks Goldreich, Exercise 8.29. Let G be a t-wise independent generator: for a uniform seed s, the blocks G s p : κ → Bool at any t positions p are independent and uniform (IsKWiseIndependentHash t G; Goldreich's blocks are b(k)-bit strings, κ = Fin (b k)). A randomized test draws coins r from ρ and runs the decision tree T r on the output bits (p, j), reading bits of at most t blocks on every input. Its output distribution on G with a uniform seed equals that on uniform bits, so the output of G is perfectly indistinguishable from uniform by it. A test that reads whole blocks, choosing the next block from the contents of those already read, is such a tree; trees may also read parts of blocks.