Identity testing by reduction to uniformity #
Testing identity to a fixed distribution q on a finite type of size n reduces to testing
uniformity on 4 n points, with the same number of samples and a third of the proximity. This is
Goldreich's theorem that the uniform distribution is complete for testing identity
Goldreich.
The reduction passes each sample through a randomized map, Goldreich's kernel
(identityKernel q). The kernel first replaces the sample by a uniform draw with probability
1 / 2. This lifts every mass of the target to at least 1 / (2 n). It then spreads the result
over a domain of 4 n cells (IdentityDomain q):
- an element
aowns a block of⌊2 n q(a)⌋ + 2cells (identityBlock); - one leftover block of
2 n - ∑ a, ⌊2 n q(a)⌋cells absorbs the rounding.
The kernel sends q exactly to the uniform distribution on these cells
(bind_identityKernel_self). It shrinks statistical distance by at most a factor 3
(dist_le_three_mul_dist_bind_identityKernel), because each block size is at least two thirds of
4 n times the mixed mass, that is, of 2 n q(a) + 2. Hence a uniformity tester with proximity
ε / 3 on the cells, run on the mapped samples, tests identity to q with proximity ε
(isTester_identity_of_uniform).
With the collision tester this gives an explicit identity tester (identityTester) whenever
720 √n ≤ (k - 1) ε² (isTester_identityTester), so k = O(√n / ε²) samples suffice for every
fixed q. The block structure follows Goldreich's construction. The grain 1 / (4 n) and the
constants 3 and 720 are the ones this proof gives; they are not taken from the source.
Main definitions #
Cslib.DistributionTesting.identityGrain,identityBlock: the block sizes.Cslib.DistributionTesting.IdentityDomain: the4 ncells.Cslib.DistributionTesting.identityKernel: Goldreich's kernel.Cslib.DistributionTesting.identityTester: the collision tester run through the kernel.
Main results #
Cslib.DistributionTesting.card_identityDomain: there are4 ncells.Cslib.DistributionTesting.bind_identityKernel_self: the kernel mapsqto uniform.Cslib.DistributionTesting.dist_le_three_mul_dist_bind_identityKernel: distances shrink by at most a factor3.Cslib.DistributionTesting.isTester_identity_of_uniform,exists_isTester_identity_of_uniform: uniformity testing on4 npoints gives identity testing with the same sample size.Cslib.DistributionTesting.isTester_identityTester: identity testing withk = O(√n / ε²).
References #
The grain of a: ⌊2 n q(a)⌋, where n is the size of the domain. Element a owns
identityGrain q a + 2 cells.
The grains sum to at most 2 n.
The cells of Goldreich's kernel: a block of identityBlock q (some a) cells for each element
a and a leftover block of identityBlock q none cells.
Instances For
There are 4 n cells.
Goldreich's kernel for identity testing to q. It keeps the sample with probability
1 / 2 and replaces it by a uniform draw otherwise. An element a then goes to a uniformly random
cell of its own block with probability (⌊2 n q(a)⌋ + 2) / (2 n q(a) + 2), and to a uniformly
random leftover cell otherwise.
Through Goldreich's kernel, p gives each cell of the block of b the probability
(p(b) / 2 + 1 / (2 n)) / (2 n q(b) + 2).
Completeness of the reduction: Goldreich's kernel maps q to the uniform distribution on
the cells.
Soundness of the reduction: Goldreich's kernel shrinks the statistical distance from q by
at most a factor 3.
The uniform distribution is complete for identity testing
Goldreich: a k-sample uniformity tester on the 4 n cells with
proximity ε / 3, run on samples passed through Goldreich's kernel, is a k-sample tester for
identity to q with proximity ε.
The reduction for uniformity testers on any domain of size 4 n: a k-sample uniformity
tester with proximity ε / 3 there yields a k-sample tester for identity to q with proximity
ε.
Identity testing with O(√n / ε²) samples: for every fixed distribution q on a domain of
size n, identityTester q k ε tests identity to q with proximity ε whenever
720 √n ≤ (k - 1) ε².