Small-bias sample spaces and balanced linear codes #
A sample space G : σ → ι → Bool (for a generator, σ is the set of seeds and G s the output
on the seed s) has a binary linear code Cslib.BitString.sampleCode G, which encodes a message
v : ι → Bool as the word s ↦ v ⬝ᵥ G s indexed by the seeds. Bit s of the codeword of the
i-th unit vector is bit i of G s (Cslib.BitString.sampleCode_single), and every
Bool-linear map (ι → Bool) → (σ → Bool) is the code of exactly one sample space
(Cslib.BitString.sampleCode_injective, Cslib.BitString.sampleCode_ofCode).
The distance between the codewords of u ≠ v is the number of seeds at which the parity on the
nonempty set {i | u i ≠ v i} is odd, and the bias of G on that set is one minus twice its
fraction. So G, with a uniform seed, is ε-biased exactly when the codewords of every two
distinct messages are at distance between (1 - ε) |σ| / 2 and (1 + ε) |σ| / 2
(Cslib.BitString.isSmallBias_map_iff_hammingDist_sampleCode). With the seeds σ = {0,1}^k and
messages of ℓ bits, this is the correspondence of Goldreich, Exercise 8.41
between ε-bias generators of stretch ℓ and binary linear codes from ℓ-bit strings to
2^k-bit strings whose codewords are pairwise at distance (1 ± ε) 2^(k-1).
Main definitions #
Cslib.BitString.sampleCode: the linear code of a sample space.
Main results #
Cslib.BitString.sampleCode_single: the codeword of a unit vector lists one output bit per seed.Cslib.BitString.sampleCode_ofCode,Cslib.BitString.sampleCode_injective: sample spaces and binary linear codes correspond one to one.Cslib.BitString.isSmallBias_map_iff_hammingDist_sampleCode: small bias is the distance condition on the code.
References #
Bit s of the codeword of the i-th unit vector is bit i of the sample G s
Goldreich, guideline to Exercise 8.41.
Every binary linear code is the code of a sample space: the one whose sample at s lists the
bits at s of the codewords of the unit vectors.
Distinct sample spaces have distinct codes.
Small-bias generators are balanced linear codes Goldreich, Exercise
8.41: a sample space G, with a uniform seed, is ε-biased exactly when
the codewords of any two distinct messages under its linear code sampleCode G are at Hamming
distance between (1 - ε) |σ| / 2 and (1 + ε) |σ| / 2. For σ = {0,1}^k these bounds are
(1 ± ε) 2^(k-1).