Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Lemma 3: security implies both secrecy and correctness

Open
QAlgorithms.Papers.Independent.Intakethird100.P22.security_secrecy_correctness

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 every ε≥0\varepsilon\ge0ε≥0,

k≤ε⟹c≤εands≤ε.k\le\varepsilon\quad\Longrightarrow\quad c\le\varepsilon\quad\text{and}\quad s\le\varepsilon.k≤ε⟹c≤εands≤ε.

Security controls both individual errors with constant one.

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.33–36, Lemma 3, (116),(146): both conclusions have constant one. -/
theorem security_secrecy_correctness {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) (e : ℝ) (he : 0 ≤ e)
    (h : securityError r ≤ e) :
    correctnessError r z ≤ e ∧ cdSecrecyError r ≤ e := 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. 33, Lemma 3 / equation (116)
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 consist of α∈[0,1]\alpha\in[0,1]α∈[0,1] and pass and abort arrays P,QP,QP,Q, both nonnegative and normalized over a,b,t,ea,b,t,ea,b,t,e for every zzz, with their marginals after summing over eee independent of zzz. Set

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, let d(R,S)d(R,S)d(R,S) be 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 with ∑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 ε≥0\varepsilon\ge0ε≥0, the hypothesis (1−α)d(P,I)≤ε(1-\alpha)d(P,I)\le\varepsilon(1−α)d(P,I)≤ε implies both

(1−α)∑a,ba≠b∑t,ePz0(a,b,t,e)≤εand(1−α)d(PA,IA)≤ε.(1-\alpha)\sum_{\substack{a,b\\a\ne b}}\sum_{t,e}P_{z_0}(a,b,t,e)\le\varepsilon \quad\text{and}\quad (1-\alpha)d(P^A,I^A)\le\varepsilon.(1−α)a,ba=b​∑​t,e∑​Pz0​​(a,b,t,e)≤εand(1−α)d(PA,IA)≤ε.

The distance uses C=K×K×TC=K\times K\times TC=K×K×T in the hypothesis and C=K×TC=K\times TC=K×T in the second conclusion.

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