Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Recovery from a distinguisher with advantage 1/W1/W1/W succeeds with probability ≥1/(4W)\ge 1/(4W)≥1/(4W)

Proved
CityLWE.recovery_bound

by axhoover · Nov 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

cryptographylattice-cryptographylearning-with-errors

Let qqq be a prime, and let n,m,T,Lb,Qs,W,Ptotn,m,T,L_b,Q_s,W,P_{\mathrm{tot}}n,m,T,Lb​,Qs​,W,Ptot​ be natural numbers satisfying

  • q≤Qsq\le Q_sq≤Qs​ and W≥1W\ge1W≥1;
  • 16 Wmq≤2Lb16\,W m q\le 2^{L_b}16Wmq≤2Lb​;
  • 128 (nq+1) W2≤T128\,(nq+1)\,W^2\le T128(nq+1)W2≤T;
  • (nQs+1) T (mLb+pD(n))≤Ptot(nQ_s+1)\,T\,(mL_b+p_D(n))\le P_{\mathrm{tot}}(nQs​+1)T(mLb​+pD​(n))≤Ptot​.

Let χ\chiχ be any law on Zq\mathbb Z_qZq​, and let DDD be any distinguisher, with pD(n)p_D(n)pD​(n) coins per activation. Suppose its decision advantage on mmm samples at dimension and parameter nnn is at least 1/W1/W1/W:

∣Pr⁡[D(A, A⊤s+e)=1]−Pr⁡[D(A,u)=1]∣ ≥ 1W.\Bigl|\Pr[D(A,\,A^{\top}s+e)=1]-\Pr[D(A,u)=1]\Bigr|\ \ge\ \frac1W .​Pr[D(A,A⊤s+e)=1]−Pr[D(A,u)=1]​ ≥ W1​.

Here A∈Zqn×mA\in\mathbb Z_q^{n\times m}A∈Zqn×m​, s∈Zqns\in\mathbb Z_q^ns∈Zqn​ and u∈Zqmu\in\mathbb Z_q^mu∈Zqm​ are uniform, and e∼χme\sim\chi^me∼χm. Then the coordinate-guessing recovery algorithm (recoverProb), given T⋅mT\cdot mT⋅m LWE samples with errors χ\chiχ and PtotP_{\mathrm{tot}}Ptot​ fair coins, outputs the secret with probability

Pr⁡[recovery] ≥ 14W.\Pr[\text{recovery}]\ \ge\ \frac{1}{4W}.Pr[recovery] ≥ 4W1​.

This is the probabilistic part of the search-to-decision reduction for prime moduli with an arbitrary error law. No polynomial-time requirement is involved: the statement holds for every step function of DDD.

Preamble
import Definitions.Def_CityLWE_RecoveryTest
open QAlgorithms.Complexity PPSLattice
Formal statement
namespace CityLWE
theorem recovery_bound (q n m T Lb Qs W Ptot : ℕ) (hq : q.Prime) (hQs : q ≤ Qs) (hW : 1 ≤ W)
    (hLb : 16 * W * m * q ≤ 2 ^ Lb) (hT : 128 * (n * q + 1) * W ^ 2 ≤ T)
    (χ : PMF (ZMod q)) (D : RestrictedDec.Adversary)
    (hP : (n * Qs + 1) * T * (m * Lb + D.p.eval n) ≤ Ptot)
    (hadv : 1 / (W : ℝ) ≤ decisionAdvantage q n m n χ D) :
    1 / (4 * (W : ℝ)) ≤ recoverProb q n m T Lb Qs W D Ptot χ := by sorry
end CityLWE
Source
Oded Regev, On Lattices, Learning with Errors, Random Linear Codes, and Cryptography, JACM 56(6), 2009, Lemma 4.2. https://cims.nyu.edu/~regev/papers/qcrypto.pdf Child of CityLWE.searchHard_implies_decisionHard (mission Cryptology City I).

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