Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Lemma 2: secrecy plus correctness implies security

Open
QAlgorithms.Papers.Independent.Intakethird100.P22.secrecy_correctness_security

by Gohan · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let PSASBTE∣ZpassP^{\rm pass}_{S_A S_B T E\mid Z}PSA​SB​TE∣Zpass​ be a normalized classical-device law with a common finite nonempty key alphabet K\mathcal KK and finite nonempty transcript, Eve-output and Eve-input alphabets. The (SA,SB,T)(S_A,S_B,T)(SA​,SB​,T) marginal is independent of ZZZ. The ideal pass law replaces the keys by a uniform perfectly correlated pair, independent of the actual (T,E∣Z)(T,E\mid Z)(T,E∣Z) marginal. The intermediate law copies Alice's key into Bob's register and preserves (SA,T,E∣Z)(S_A,T,E\mid Z)(SA​,T,E∣Z). Let r∈[0,1]r\in[0,1]r∈[0,1] be the abort probability, with an identical normalized abort branch in all three systems. Write dNSd_{\rm NS}dNS​ for the operational NS distance, and s,c,ks,c,ks,c,k for the pass-weighted secrecy, disagreement and security errors, respectively. Thus s=(1−r)dNS(PSATE∣Zpass,PSATE∣Zideal,pass)s=(1-r)d_{\rm NS}(P_{S_A T E\mid Z}^{\rm pass},P_{S_A T E\mid Z}^{\rm ideal,pass})s=(1−r)dNS​(PSA​TE∣Zpass​,PSA​TE∣Zideal,pass​), c=(1−r)Pr⁡[SA≠SB∣pass]c=(1-r)\Pr[S_A\ne S_B\mid\mathrm{pass}]c=(1−r)Pr[SA​=SB​∣pass], and k=(1−r)dNS(Ppass,Pideal,pass)k=(1-r)d_{\rm NS}(P^{\rm pass},P^{\rm ideal,pass})k=(1−r)dNS​(Ppass,Pideal,pass).

For any nonnegative error budgets εsec\varepsilon_{\rm sec}εsec​ and εcor\varepsilon_{\rm cor}εcor​,

s≤εsecandc≤εcor⟹k≤εsec+εcor.s\le\varepsilon_{\rm sec}\quad\text{and}\quad c\le\varepsilon_{\rm cor}\quad\Longrightarrow\quad k\le\varepsilon_{\rm sec}+\varepsilon_{\rm cor}.s≤εsec​andc≤εcor​⟹k≤εsec​+εcor​.

Separate secrecy and correctness estimates therefore imply security.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P22
Formal statement
noncomputable section

open scoped BigOperators

namespace QAlgorithms.Papers.Independent.Intakethird100.P22

attribute [local instance] Classical.propDecidable Classical.decEq

open QAlgorithms.Papers.Independent.Advance50.P47
  (Box IsCorrelation IsNoSignaling HasLocalModel correlationMixture prBox)

open QAlgorithms.Papers.Independent.Information100.P56 (IsLaw)

open QAlgorithms.Papers.Independent.Information100.P27 (shannon)

open QAlgorithms.Papers.Independent.Gap48.P25 (classicalMI)

/-- PDF pp.32–33, Lemma 2, (105)–(112): the comma in (105) means subtraction,
as made explicit in (106),(112). Both error budgets are nonnegative. -/
theorem secrecy_correctness_security {K T E Z : Type}
    [Fintype K] [Fintype T] [Fintype E] [Fintype Z]
    [Nonempty K] [Nonempty T] [Nonempty E] [Nonempty Z]
    (r : KeyOutput K T E Z) (z : Z) (es ec : ℝ) (hes : 0 ≤ es) (hec : 0 ≤ ec)
    (hs : cdSecrecyError r ≤ es) (hc : correctnessError r z ≤ ec) :
    securityError r ≤ es + ec := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P22

end
Source
Limitations on device independent key secure against non signaling adversary via the squashed non-locality, arXiv:1903.12154v7, PDF p. 32, Lemma 2 / equation (105)
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

For finite nonempty types K,T,E,ZK,T,E,ZK,T,E,Z, let rrr have abort probability α∈[0,1]\alpha\in[0,1]α∈[0,1] and pass and abort arrays P,QP,QP,Q, each nonnegative, normalized over a,b,t,ea,b,t,ea,b,t,e at every zzz, and with ∑eRz(a,b,t,e)\sum_eR_z(a,b,t,e)∑e​Rz​(a,b,t,e) independent of zzz. Define

Iz(a,b,t,e)=1{a=b}∑u,vPz(u,v,t,e)∣K∣,PzA(a,t,e)=∑bPz(a,b,t,e),IzA(a,t,e)=∑bIz(a,b,t,e).I_z(a,b,t,e)=\mathbf1_{\{a=b\}}\frac{\sum_{u,v}P_z(u,v,t,e)}{|K|}, \qquad P^A_z(a,t,e)=\sum_bP_z(a,b,t,e), \qquad I^A_z(a,t,e)=\sum_bI_z(a,b,t,e).Iz​(a,b,t,e)=1{a=b}​∣K∣∑u,v​Pz​(u,v,t,e)​,PzA​(a,t,e)=b∑​Pz​(a,b,t,e),IzA​(a,t,e)=b∑​Iz​(a,b,t,e).

For arrays on Z×C×EZ\times C\times EZ×C×E, define d(R,S)d(R,S)d(R,S) as the supremum of

12∑j=0m−1∣∑c,z,eu(c,z)(Rz(c,e)−Sz(c,e))v(c,z,e,j)∣\frac12\sum_{j=0}^{m-1} \left|\sum_{c,z,e}u(c,z)(R_z(c,e)-S_z(c,e))v(c,z,e,j)\right|21​j=0∑m−1​​c,z,e∑​u(c,z)(Rz​(c,e)−Sz​(c,e))v(c,z,e,j)​

over positive integers mmm and nonnegative kernels u,vu,vu,v satisfying ∑zu(c,z)=1\sum_z u(c,z)=1∑z​u(c,z)=1 and ∑jv(c,z,e,j)=1\sum_jv(c,z,e,j)=1∑j​v(c,z,e,j)=1. For every z0∈Zz_0\in Zz0​∈Z and real numbers εs,εc≥0\varepsilon_s,\varepsilon_c\ge0εs​,εc​≥0, if

(1−α)d(PA,IA)≤εs,(1−α)∑a,ba≠b∑t,ePz0(a,b,t,e)≤εc,(1-\alpha)d(P^A,I^A)\le\varepsilon_s,\qquad (1-\alpha)\sum_{\substack{a,b\\a\ne b}}\sum_{t,e}P_{z_0}(a,b,t,e)\le\varepsilon_c,(1−α)d(PA,IA)≤εs​,(1−α)a,ba=b​∑​t,e∑​Pz0​​(a,b,t,e)≤εc​,

then

(1−α)d(P,I)≤εs+εc.(1-\alpha)d(P,I)\le\varepsilon_s+\varepsilon_c.(1−α)d(P,I)≤εs​+εc​.

Here C=K×TC=K\times TC=K×T for the first distance and C=K×K×TC=K\times K\times TC=K×K×T for the second.

Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me