Documentation

CslibFrontier.Computability.PropertyTesting.Distribution.UniformityLowerBound

Paninski's lower bound for uniformity testing #

On a domain of even size n, every k-sample uniformity tester with proximity δ ≤ 1 / 2 in statistical distance satisfies n ≤ 52 k² δ⁴ (card_le_of_isTester_uniform), so k = Ω(√n / δ²) samples are necessary Paninski. For such δ and n this matches the collision tester (Cslib.DistributionTesting.isTester_collisionTester) up to the constant. At δ = 1 / 2 it is the birthday bound 4 n ≤ 13 k² (four_mul_card_le_of_isTester_uniform).

The hard instances live on Fin m × Bool. For a sign vector σ : Fin m → Bool, Paninski's distribution paninski hε σ puts mass (1 ± ε) / (2 m) on (i, b), with the plus sign when b = σ i; it is at distance |ε| / 2 from uniform (dist_paninski_uniform). The mixture paninskiMixture m hε k draws σ uniformly and then k samples from paninski hε σ. Its collision probability satisfies the second-moment bound (2 m)^k ‖Q‖₂² ≤ cosh(k ε² / m)^m ≤ exp(k² ε⁴ / (2 m)) (collisionProbability_paninskiMixture_le), so it is close to k uniform samples (dist_paninskiMixture_sq_le). Le Cam's method (Cslib.DistributionTesting.one_third_le_dist_iid_bind) then bounds k. At ε = 1 each paninski hε σ is uniform on a subset of half the domain, the instance of the birthday argument. The constants 52 and 13 are the ones this proof gives; they are not optimized.

Main definitions #

Main results #

References #

noncomputable def Cslib.DistributionTesting.paninskiWeight {m : ℕ} (ε : ℝ) (σ : Fin m → Bool) (y : Fin m × Bool) :

Paninski's perturbation of the uniform distribution on Fin m × Bool: the point (i, b) receives mass (1 + ε) / (2 m) when b = σ i and (1 - ε) / (2 m) otherwise.

theorem Cslib.DistributionTesting.paninskiWeight_nonneg {m : ℕ} {ε : ℝ} (hε : |ε| ≤ 1) (σ : Fin m → Bool) (y : Fin m × Bool) :

Paninski weights are nonnegative for |ε| ≤ 1.

theorem Cslib.DistributionTesting.sum_paninskiWeight {m : ℕ} [NeZero m] (ε : ℝ) (σ : Fin m → Bool) :
∑ y : Fin m × Bool, paninskiWeight ε σ y = 1

Paninski weights sum to one.

noncomputable def Cslib.DistributionTesting.paninski {m : ℕ} [NeZero m] {ε : ℝ} (hε : |ε| ≤ 1) (σ : Fin m → Bool) :

Paninski's distribution on Fin m × Bool with bias ε along the sign vector σ.

theorem Cslib.DistributionTesting.paninski_apply_toReal {m : ℕ} [NeZero m] {ε : ℝ} (hε : |ε| ≤ 1) (σ : Fin m → Bool) (y : Fin m × Bool) :
((paninski hε σ) y).toReal = paninskiWeight ε σ y

The masses of Paninski's distribution are its weights.

theorem Cslib.DistributionTesting.dist_paninski_uniform {m : ℕ} [NeZero m] {ε : ℝ} (hε : |ε| ≤ 1) (σ : Fin m → Bool) :

Every Paninski distribution is at statistical distance |ε| / 2 from uniform.

noncomputable def Cslib.DistributionTesting.paninskiMixture (m : ℕ) [NeZero m] {ε : ℝ} (hε : |ε| ≤ 1) (k : ℕ) :
PMF (Fin k → Fin m × Bool)

Paninski's mixture: draw a uniformly random sign vector σ, then k independent samples from paninski hε σ.

theorem Cslib.DistributionTesting.sum_paninskiWeight_mul {m : ℕ} [NeZero m] (ε : ℝ) (σ τ : Fin m → Bool) :
∑ y : Fin m × Bool, paninskiWeight ε σ y * paninskiWeight ε τ y = (1 + ε ^ 2 / ↑m * ∑ i : Fin m, if σ i = τ i then 1 else -1) / (2 * ↑m)

The inner product of two Paninski weight vectors.

theorem Cslib.DistributionTesting.paninskiMixture_apply_toReal {m : ℕ} [NeZero m] {ε : ℝ} (hε : |ε| ≤ 1) {k : ℕ} (x : Fin k → Fin m × Bool) :
((paninskiMixture m hε k) x).toReal = ∑ σ : Fin m → Bool, (2 ^ m)⁻¹ * ∏ j : Fin k, paninskiWeight ε σ (x j)

The mass of a sample tuple under Paninski's mixture is the average over sign vectors of the product of the weights.

theorem Cslib.DistributionTesting.collisionProbability_paninskiMixture {m : ℕ} [NeZero m] {ε : ℝ} (hε : |ε| ≤ 1) (k : ℕ) :
Probability.PMF.collisionProbability (paninskiMixture m hε k) = (4 ^ m)⁻¹ * ∑ σ : Fin m → Bool, ∑ τ : Fin m → Bool, (∑ y : Fin m × Bool, paninskiWeight ε σ y * paninskiWeight ε τ y) ^ k

The collision probability of Paninski's mixture as an average over pairs of sign vectors of the k-th powers of the inner products of their weight vectors.

theorem Cslib.DistributionTesting.collisionProbability_paninskiMixture_le {m : ℕ} [NeZero m] {ε : ℝ} (hε : |ε| ≤ 1) (k : ℕ) :
(2 * ↑m) ^ k * Probability.PMF.collisionProbability (paninskiMixture m hε k) ≤ Real.exp (↑k ^ 2 * ε ^ 4 / (2 * ↑m))

The second-moment bound for Paninski's mixture: (2m)^k ‖Q‖₂² ≤ exp(k² ε⁴ / (2m)).

theorem Cslib.DistributionTesting.dist_paninskiMixture_sq_le {m : ℕ} [NeZero m] {ε : ℝ} (hε : |ε| ≤ 1) (k : ℕ) :

Paninski's mixture is close to k uniform samples when k² ε⁴ ≪ m.

theorem Cslib.DistributionTesting.two_mul_le_of_isTester_uniform_prod {m : ℕ} [NeZero m] {k : ℕ} {T : (Fin k → Fin m × Bool) → PMF Bool} {δ : ℝ} (hT : IsTester T {Probability.PMF.uniformOfFintype (Fin m × Bool)} δ) (hδ : δ ≤ 1 / 2) :
2 * ↑m ≤ 52 * ↑k ^ 2 * δ ^ 4

Paninski's lower bound on Fin m × Bool: every k-sample uniformity tester with proximity δ ≤ 1 / 2 satisfies 2 m ≤ 52 k² δ⁴.

theorem Cslib.DistributionTesting.card_le_of_isTester_uniform {α : Type u_1} [Fintype α] [Nonempty α] (hα : Even (Fintype.card α)) {k : ℕ} {T : (Fin k → α) → PMF Bool} {δ : ℝ} (hT : IsTester T {Probability.PMF.uniformOfFintype α} δ) (hδ : δ ≤ 1 / 2) :
↑(Fintype.card α) ≤ 52 * ↑k ^ 2 * δ ^ 4

Paninski's lower bound for uniformity testing: on a domain of even size n, every k-sample uniformity tester with proximity δ ≤ 1 / 2 satisfies n ≤ 52 k² δ⁴.

theorem Cslib.DistributionTesting.four_mul_card_le_of_isTester_uniform {α : Type u_1} [Fintype α] [Nonempty α] (hα : Even (Fintype.card α)) {k : ℕ} {T : (Fin k → α) → PMF Bool} (hT : IsTester T {Probability.PMF.uniformOfFintype α} (1 / 2)) :
4 * Fintype.card α ≤ 13 * k ^ 2

Birthday lower bound: distinguishing uniform from distributions at distance 1 / 2 (such as uniform distributions on half of the domain) requires 4 n ≤ 13 k² samples.