Lower bounds on the residue probabilities of sampleModNat #
sampleModNat w m reduces a number written with w fair coins modulo m. Each residue i < m
is hit by at least ⌊2 ^ w / m⌋ of the 2 ^ w coin outcomes, so its probability is at least
(1 - m / 2 ^ w) / m, that is, 1 / m - 1 / 2 ^ w. The bound holds for every w; it is vacuous
when 2 ^ w ≤ m. When m divides 2 ^ w, the residue distribution is exact (Pr[i] ≥ 1 / m).
Main results #
Cslib.ProbComp.le_eval_sampleModNat_toReal: every residue belowmhas probability at least(1 - m / 2 ^ w) / m, inℝ.Cslib.ProbComp.one_le_mul_eval_sampleModNat_add: the same bound inℝ≥0∞, without subtraction:1 ≤ m * Pr[i] + m / 2 ^ w.Cslib.ProbComp.one_le_mul_eval_sampleModNat_of_dvd: whenm ∣ 2 ^ w,1 ≤ m * Pr[i]inℝ≥0∞without an additive error term.
theorem Cslib.ProbComp.one_le_mul_eval_sampleModNat_of_dvd {w m i : ℕ} (hi : i < m) (hdvd : m ∣ 2 ^ w) :
Exact divisibility lower bound on sampleModNat w m in ℝ≥0∞: when m divides 2 ^ w, every
residue i < m has probability at least 1 / m (1 ≤ m * Pr[i]) without bias.