Claim 5.3, p. 34:36 — a random subset sum of l uniform elements of G is on average within √(|G|/2^l) of uniform
ProvedRegevLWE.SubsetSum.claim_5_3Let be a finite abelian group and an integer. For let
be the distribution of the sum of a uniformly random subset of , and let be its statistical distance from the uniform distribution on . Choose uniformly and independently. Then
- the expected statistical distance is at most :
- the probability that the statistical distance is more than is at most :
This is the special case of the leftover hash lemma of Impagliazzo and Zuckerman (1989) that Regev uses to prove the semantic security of his LWE-based public-key cryptosystem: once is much larger than , a random subset sum of a random public key is close to uniform for almost every key.
Formalization Note and are exact averages over all tuples (the probability is the number of tuples with divided by ). The statistical distance has no factor . The fourth root is written Real.sqrt (Real.sqrt x). No hypothesis is added: holds for every group, and is allowed.
import Mathlib import Definitions.Def_RegevLWE_SubsetSum_Basic open Finset
namespace RegevLWE.SubsetSum
/-- Claim 5.3 (Regev, J. ACM 2009, p. 34:36). Let `G` be a finite abelian group and `l ≥ 0`. For
`g = (g₁, …, g_l) ∈ G^l` let `P_g` be the distribution of the sum of a uniformly random subset of
`g₁, …, g_l`, and `Δ(g) = ∑_h |P_g(h) − 1/|G||` its statistical distance from uniform. Over a uniform
choice of `g ∈ G^l`:
1. `Exp_g[Δ(g)] ≤ √(|G|/2^l)`;
2. `Pr_g[Δ(g) > ⁴√(|G|/2^l)] ≤ ⁴√(|G|/2^l)`,
with the fourth root written `√(√·)`. -/
theorem claim_5_3 {G : Type*} [AddCommGroup G] [Fintype G] [DecidableEq G] (l : ℕ) :
expectG (fun g : Fin l → G => statDistUniform g) ≤
Real.sqrt ((Fintype.card G : ℝ) / 2 ^ l) ∧
((univ.filter fun g : Fin l → G =>
Real.sqrt (Real.sqrt ((Fintype.card G : ℝ) / 2 ^ l)) < statDistUniform g).card : ℝ) /
(Fintype.card G : ℝ) ^ l ≤
Real.sqrt (Real.sqrt ((Fintype.card G : ℝ) / 2 ^ l)) := by sorry
end RegevLWE.SubsetSum
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.