Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Claim 5.3, p. 34:37 — for b ≠ b′, Pr_g[Σ b_ig_i = Σ b′_ig_i] = 1/|G|

Proved
RegevLWE.SubsetSum.collision_prob

by mikedeng1 · Oct 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

collision-probabilityfinite-abelian-groupleftover-hash-lemmap2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Let GGG be a finite abelian group and l≥0l \ge 0l≥0. For any two distinct vectors b≠b′b \neq b'b=b′ in {0,1}l\{0,1\}^l{0,1}l, over a uniform choice of g=(g1,…,gl)∈Glg = (g_1, \dots, g_l) \in G^lg=(g1​,…,gl​)∈Gl,

Pr⁡g[∑ibigi=∑ibi′gi]=1∣G∣.\Pr_g\Bigl[\sum_i b_i g_i = \sum_i b'_i g_i\Bigr] = \frac{1}{|G|}.gPr​[i∑​bi​gi​=i∑​bi′​gi​]=∣G∣1​.

This fact is what makes the expected ℓ2\ell_2ℓ2​ norm of PgP_gPg​ small: two different subsets of uniformly random group elements have equal sums only with probability 1/∣G∣1/|G|1/∣G∣.

Formalization Note The probability is the number of tuples g∈Glg \in G^lg∈Gl with ∑ibigi=∑ibi′gi\sum_i b_i g_i = \sum_i b'_i g_i∑i​bi​gi​=∑i​bi′​gi​ divided by ∣G∣l|G|^l∣G∣l. The hypothesis b≠b′b \neq b'b=b′ forces l≥1l \ge 1l≥1.

Preamble
import Mathlib
import Definitions.Def_RegevLWE_SubsetSum_Basic

open Finset
Formal statement
namespace RegevLWE.SubsetSum

/-- Proof of Claim 5.3 (Regev, J. ACM 2009, p. 34:37, first sentence): for any `b ≠ b'` in
`{0,1}^l`, over a uniform choice of `g = (g₁, …, g_l) ∈ G^l`,
`Pr_g[∑ bᵢgᵢ = ∑ b'ᵢgᵢ] = 1/|G|`. The probability is the number of tuples `g` with
`∑ bᵢgᵢ = ∑ b'ᵢgᵢ` divided by `|G|^l`. -/
theorem collision_prob {G : Type*} [AddCommGroup G] [Fintype G] [DecidableEq G] {l : ℕ}
    (b b' : Fin l → Bool) (hb : b ≠ b') :
    ((univ.filter fun g : Fin l → G => subsetSum g b = subsetSum g b').card : ℝ) /
        (Fintype.card G : ℝ) ^ l = 1 / (Fintype.card G : ℝ) := by sorry

end RegevLWE.SubsetSum
Source
Regev, On Lattices, Learning with Errors, Random Linear Codes, and Cryptography, J. ACM 56(6) (2009), Article 34, p. 34:37, proof of Claim 5.3, first sentence
Human review
  • Endorsed by Shuze Chen · Oct 7, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 7, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me