Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Exact singlets yield a uniform secret shared key

Open
QAlgorithms.Papers.Independent.Intakenext100.P87.ideal_singlet_key

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

prove2quantum

Let R≥0R\ge0R≥0 and let ρABE\rho_{ABE}ρABE​ be any normalized joint state whose ABABAB marginal is the product of RRR singlets. The finite reference EEE has arbitrary dimension. Alice and Bob measure each corresponding qubit along the same arbitrary axis. For any strings a,b∈{0,1}Ra,b\in\{0,1\}^Ra,b∈{0,1}R and any measurable event SSS of any measurement on Eve's reference,

Pr⁡[A=a,B=b,E∈S]=2−R1b=a‾Pr⁡[E∈S].\Pr[A=a,B=b,E\in S]=2^{-R}\mathbf1_{b=\overline a}\Pr[E\in S].Pr[A=a,B=b,E∈S]=2−R1b=a​Pr[E∈S].

Consequently Alice's key is uniform, Bob obtains the same key by complementing his outcomes, and Eve's outcomes are independent of the key. The formula includes the empty key.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P87
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intakenext100.P87

open scoped Matrix ComplexConjugate

open QAlgorithms.Measurements

/-- PDF p.4: exact singlets give a uniform shared key after Bob complements his bits,
independent of every measurement on an arbitrary finite reference. The empty key is included. -/
theorem ideal_singlet_key {E Y : Type*} [Fintype E] [DecidableEq E]
    [MeasurableSpace Y] (R : ℕ)
    (rho : Matrix (PairRegister R × E) (PairRegister R × E) ℂ)
    (hrho : IsDensityMatrix rho) (hAB : traceRight rho = pureDensity (singletKet R))
    (U : Matrix.unitaryGroup Bool ℂ) (Q : OperatorPOVM E Y)
    (a b : Qubits R) (S : Set Y) (hS : MeasurableSet S) :
    idealKeyLaw rho U Q a b S =
      if b = (fun i => !(a i)) then
        (2 : ℝ)⁻¹ ^ R * effectProb (Q.operator S) (traceLeft rho) else 0 := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P87

end
Source
Unconditional Security Of Quantum Key Distribution Over Arbitrarily Long Distances, arXiv:quant-ph/9803006v5, PDF p. 4, Exact singlets yield a uniform secret shared key
Read-back

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

Let EEE be a finite type with decidable equality, let YYY be a measurable space, and let R≥0R\geq0R≥0 be an integer. Put BR={false,true}R\mathcal B_R=\{\mathrm{false},\mathrm{true}\}^RBR​={false,true}R, and define the vector sR∈CBR×BRs_R\in\mathbb C^{\mathcal B_R\times\mathcal B_R}sR​∈CBR​×BR​ by sR(u,v)=2−R/2(−1)∣{i:ui=true}∣s_R(u,v)=2^{-R/2}(-1)^{|\{i:u_i=\mathrm{true}\}|}sR​(u,v)=2−R/2(−1)∣{i:ui​=true}∣ when vi=¬uiv_i=\neg u_ivi​=¬ui​ for every iii, and sR(u,v)=0s_R(u,v)=0sR​(u,v)=0 otherwise. Suppose ρ\rhoρ, indexed by (BR×BR)×E(\mathcal B_R\times\mathcal B_R)\times E(BR​×BR​)×E, is positive semidefinite with trace 111, and its partial trace over EEE equals sRsR†s_Rs_R^\daggersR​sR†​; explicitly, ∑eρ(w,e),(w′,e)=sR(w)sR(w′)‾\sum_e\rho_{(w,e),(w',e)}=s_R(w)\overline{s_R(w')}∑e​ρ(w,e),(w′,e)​=sR​(w)sR​(w′)​. For every Boolean-indexed unitary UUU, every operator-valued measure QQQ on YYY acting on CE\mathbb C^ECE, every a,b∈BRa,b\in\mathcal B_Ra,b∈BR​, and every measurable S⊆YS\subseteq YS⊆Y,

Re⁡tr⁡ ⁣[(ER,U,a⊗ER,U,b⊗Q(S))ρ]={2−RRe⁡tr⁡(Q(S)ρE),bi=¬ai for every i,0,otherwise,\operatorname{Re}\operatorname{tr}\!\left[ (E_{R,U,a}\otimes E_{R,U,b}\otimes Q(S))\rho \right] = \begin{cases} 2^{-R}\operatorname{Re}\operatorname{tr}(Q(S)\rho_E),& b_i=\neg a_i\text{ for every }i,\\ 0,&\text{otherwise}, \end{cases}Retr[(ER,U,a​⊗ER,U,b​⊗Q(S))ρ]={2−RRetr(Q(S)ρE​),0,​bi​=¬ai​ for every i,otherwise,​

where (ER,U,c)x,y=∏iUxi,ciUyi,ci‾(E_{R,U,c})_{x,y}=\prod_iU_{x_i,c_i}\overline{U_{y_i,c_i}}(ER,U,c​)x,y​=∏i​Uxi​,ci​​Uyi​,ci​​​ and (ρE)e,e′=∑wρ(w,e),(w,e′)(\rho_E)_{e,e'}=\sum_w\rho_{(w,e),(w,e')}(ρE​)e,e′​=∑w​ρ(w,e),(w,e′)​. The assumptions on QQQ mean Q(∅)=0Q(\varnothing)=0Q(∅)=0, Q(Y)=IQ(Y)=IQ(Y)=I, positivity on measurable sets, and countable additivity on disjoint measurable sets. The case R=0R=0R=0 is included: both strings are empty, the complement condition holds, and 2−R=12^{-R}=12−R=1.

Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 31, 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