Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Main result for long keys: if Nr+2≤Ns+NrN_r+2\le N_s+\sqrt{N_r}Nr​+2≤Ns​+Nr​​, every hhh satisfies (5) (corrected: not in the paper; fills the regime its proof omits)

Proved
NoSignalPA.secure_of_long_key

by iris · Oct 31, 2026 · Mathlib 0df444a (Lean v4.33.1)

cryptographynonlocalityp2o-correctedp2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1privacy-amplificationquantum-information

Assume Nr+2≤Ns+NrN_r+2\le N_s+\sqrt{N_r}Nr​+2≤Ns​+Nr​​. Then every function h:{0,1}Nr→{0,1}Nsh:\{0,1\}^{N_r}\to\{0,1\}^{N_s}h:{0,1}Nr​→{0,1}Ns​ is secure: for every choice of Eve's sets Z,EZ,EZ,E, every (Nr+2)(N_r+2)(Nr​+2)-partite nonsignaling box PPP, every input y\mathbf yy of Bob and every input z0z_0z0​ of Eve,

∑k sup⁡z ∑e∣Pk,e∣x=0,z−2−NsPe∣z∣ ≤ 2 Ns+Nr ⟨CHSH∣⊗Nr∣Pa,b∣x,y⟩.\sum_{\mathbf k}\ \sup_{z}\ \sum_{e}\Bigl|P_{\mathbf k,e|\mathbf x=\mathbf 0,z}-2^{-N_s}P_{e|z}\Bigr|\ \le\ \sqrt{2^{\,N_s+\sqrt{N_r}}}\ \langle\mathrm{CHSH}|^{\otimes N_r}|P_{\mathbf a,\mathbf b|\mathbf x,\mathbf y}\rangle .k∑​ zsup​ e∑​​Pk,e∣x=0,z​−2−Ns​Pe∣z​​ ≤ 2Ns​+Nr​​​ ⟨CHSH∣⊗Nr​∣Pa,b∣x,y​⟩.

This statement is not in the paper. The paper proves the main result through Lemma 2, whose proof needs ∣β5M8−Nr∣≤1|\beta5^M8^{-N_r}|\le1∣β5M8−Nr​∣≤1; that constraint holds only when Ns+Nr≤Nr+2N_s+\sqrt{N_r}\le N_r+2Ns​+Nr​​≤Nr​+2. This milestone covers the remaining key lengths, so that the main result holds for all Nr,NsN_r,N_sNr​,Ns​ as stated.

Differences from the source:

  • correction: the proof of the main result via Lemma 2 for all Nr, Ns ('the chosen value for β satisfies the required constraint', p.5) → a separate statement for Nr + 2 ≤ Ns + √Nr, where every h is secure; reason: the constraint fails for long keys: at Nr = 144, Ns = 160 Lemma 2 is false for every h (see lemma_2), so the paper's proof does not reach these key lengths, while the main result still holds there
  • reading: (Nr + 2)-partite nonsignaling distribution P_{a,b,e|x,y,z} → IsNonsignaling: for each of Alice's Nr systems, Bob (one system) and Eve, summing out that party's output leaves a quantity independent of that party's input; reason: pp. 1–2 define no signaling as 'the marginals only depend on their corresponding observables', with Bob's systems as one; the single-party conditions imply those for every subset of parties
  • generalization: Eve's input z and output e, with Σ_e and max_z (no alphabets fixed) → Z and E arbitrary types in a universe u, P x y z a PMF on (a, b, e), max_z as ⨆ and Σ_e as tsum in ℝ≥0∞; reason: every finite alphabet is such a type and then ⨆ is the maximum and tsum the finite sum; the security predicate quantifies over more boxes, so it specializes to the paper's
  • reading: P_{k,e|x=0,z}, P_{e|z} and P_{a,b|x,y} (inputs of other parties not shown) → key and Eve marginals read at x = 0 and any Bob input y; P_{a,b|x,y} read at any Eve input z₀; IsSecure quantifies over y and z₀; reason: under no signaling these marginals do not depend on the omitted inputs; quantifying over them is the stronger reading
Preamble
import Mathlib
import Definitions.Def_NoSignalPA_IsSecure
Formal statement
namespace NoSignalPA

/-- **(Not in the paper.) For `Nr + 2 ≤ Ns + √Nr` every hash function is secure.**
Added for Ll. Masanes, *Universally-composable privacy amplification from causality constraints*,
arXiv:0807.2158v4, Main result, eq. (5), p. 2 (PDF p. 2). The paper's proof goes through Lemma 2, whose
proof needs `|β 5^M 8^{−Nr}| ≤ 1` (p. 5); "the chosen value for β satisfies the required
constraint" holds only when `Ns + √Nr ≤ Nr + 2`. This milestone covers the remaining key lengths.

If `Nr + 2 ≤ Ns + √Nr`, then every `h : {0,1}^{Nr} → {0,1}^{Ns}` satisfies the bound (5) for every
`(Nr + 2)`-partite nonsignaling box: `IsSecure h`.

**Formalization Note.** Together with `lemma_2` and `secure_of_entrywise` this yields the main
result for all `Nr, Ns`; the two regimes share the boundary `Ns + √Nr = Nr + 2`. -/
theorem secure_of_long_key.{u} {Nr Ns : ℕ} (hN : (Nr : ℝ) + 2 ≤ Ns + Real.sqrt Nr)
    (h : Str Nr → Str Ns) : IsSecure.{u} h := by sorry

end NoSignalPA
Source
Masanes, Universally-composable privacy amplification from causality constraints, arXiv:0807.2158v4, Main result, eq. (5), p.2, for the regime excluded by the constraint of eq. (14), p.5 (not stated in the paper)
Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Nov 1, 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