Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Lemma 5.1 (Correctness), p. 34:35 — if Pr_{χ^⋆k}[|e| < ⌊p/2⌋/2] > 1 − δ for all k ≤ m, decryption is correct with probability ≥ 1 − δ

Proved
RegevLWE.Correctness.lemma_5_1

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

decryption-errorlattice-cryptographylearning-with-errorsp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1public-key-encryption

Let p≥2p \ge 2p≥2 and n,m≥0n, m \ge 0n,m≥0 be integers, let χ\chiχ be a probability distribution on Zp\mathbb Z_pZp​, and let δ>0\delta > 0δ>0. For a∈Zpa \in \mathbb Z_pa∈Zp​ let ∣a∣|a|∣a∣ be its distance from 000 modulo ppp, and let χ⋆k\chi^{\star k}χ⋆k be the distribution of the sum of kkk independent samples from χ\chiχ (χ⋆0\chi^{\star 0}χ⋆0 the point mass at 000). Assume that for every k∈{0,1,…,m}k \in \{0, 1, \dots, m\}k∈{0,1,…,m},

Pr⁡e∼χ⋆k[ ∣e∣<⌊p2⌋/2 ]>1−δ.\Pr_{e \sim \chi^{\star k}}\Bigl[\,|e| < \Bigl\lfloor \frac p2 \Bigr\rfloor \Big/ 2\,\Bigr] > 1 - \delta .e∼χ⋆kPr​[∣e∣<⌊2p​⌋/2]>1−δ.

Then the probability of decryption error of Regev's cryptosystem with parameters n,m,p,χn, m, p, \chin,m,p,χ is at most δ\deltaδ: for each bit c∈{0,1}c \in \{0, 1\}c∈{0,1}, if the private key sss is chosen uniformly in Zpn\mathbb Z_p^nZpn​, the public key (ai,⟨ai,s⟩+ei)i=1m(a_i, \langle a_i, s\rangle + e_i)_{i=1}^m(ai​,⟨ai​,s⟩+ei​)i=1m​ is formed with aia_iai​ independent and uniform in Zpn\mathbb Z_p^nZpn​ and eie_iei​ independent with law χ\chiχ, ccc is encrypted with a uniformly random subset S⊆[m]S \subseteq [m]S⊆[m], and the result is decrypted with sss, then

Pr⁡[outcome=c]≥1−δ,\Pr[\text{outcome} = c] \ge 1 - \delta ,Pr[outcome=c]≥1−δ,

the probability being over all of sss, a1,…,ama_1, \dots, a_ma1​,…,am​, e1,…,eme_1, \dots, e_me1​,…,em​ and SSS.

This is the correctness half of Regev's LWE-based public-key cryptosystem: it turns a tail bound on the noise distribution into a bound on the decryption error. For the paper's parameters, Claim 5.2 supplies the hypothesis with a negligible δ\deltaδ.

Formalization Note The hypothesis and conclusion are stated in R\mathbb RR, with probabilities taken as toReal of PMF masses (exact, since they are at most 111). An R≥0∞\mathbb R_{\ge 0}^{\infty}R≥0∞​ form with ENNReal.ofReal (1 − δ) < was rejected: for δ≥1\delta \ge 1δ≥1 it would demand a positive probability, a hypothesis the page does not make. p≥2p \ge 2p≥2 is the paper's standing range for Zp\mathbb Z_pZp​ (p. 34:14); primality, which the paper's parameter choice includes, is not assumed, since the lemma does not use it. ⌊p/2⌋/2\lfloor p/2\rfloor/2⌊p/2⌋/2 is a real number.

Preamble
import Mathlib
import Definitions.Def_RegevLWE_Correctness_Cryptosystem

open Matrix
Formal statement
namespace RegevLWE.Correctness

/-- Lemma 5.1 (Correctness), Regev, J. ACM 2009, p. 34:35. Let `p ≥ 2`, `n, m ≥ 0`, `χ` a
probability distribution on `ℤ_p` and `δ > 0`. Assume that for every `k ∈ {0, 1, …, m}`,
`Pr_{e∼χ^⋆k}[|e| < ⌊p/2⌋/2] > 1 − δ`. Then for any bit `c ∈ {0, 1}`, if the private key, the
public key and the subset `S` are chosen as in the protocol, `c` is encrypted and the result
decrypted, the outcome is `c` with probability at least `1 − δ`. The probability is over all of
the protocol's randomness: `s`, `a₁, …, a_m`, `e₁, …, e_m` and `S`. -/
theorem lemma_5_1 {p : ℕ} [NeZero p] (hp : 2 ≤ p) (n m : ℕ) (χ : PMF (ZMod p)) (δ : ℝ)
    (hδ : 0 < δ)
    (hχ : ∀ k ≤ m, 1 - δ <
      ((convPow χ k).toOuterMeasure {e | (absZ e : ℝ) < ((p / 2 : ℕ) : ℝ) / 2}).toReal)
    (c : Fin 2) :
    1 - δ ≤ (outcome n m χ c c).toReal := by sorry

end RegevLWE.Correctness
Source
Regev, On Lattices, Learning with Errors, Random Linear Codes, and Cryptography, J. ACM 56(6) (2009), Article 34, p. 34:35, Lemma 5.1 (Correctness); protocol on p. 34:35; ℤ_p for p ≥ 2 on p. 34:14
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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me