Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Phase and bit error gap for a balanced attack

Open
QAlgorithms.Papers.Independent.Intake100.P99.balanced_attack_phase_bit_gap

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

prove2quantum

Let 0≤Δ≤120\leq\Delta\leq\tfrac120≤Δ≤21​ and let ρn\rho_nρn​ be a normalized joint state of nnn Alice--Bob qubit pairs and nnn virtual basis coins after the complete attack and before the final coin-controlled bilateral Hadamards. Suppose that measuring the coins at this point in the XXX basis gives NX<nΔN_X<n\DeltaNX​<nΔ except with exponentially small probability. After the controlled Hadamards, let δ~\widetilde\deltaδ and δ~p\widetilde\delta_pδp​ be the bit and phase error fractions in a joint Bell measurement of the pairs. With the nonnegative entropy-gap branch fff defined by H2(12−f(Δ))+H2(Δ)=1H_2(\tfrac12-f(\Delta))+H_2(\Delta)=1H2​(21​−f(Δ))+H2​(Δ)=1, for every ε>0\varepsilon>0ε>0,

Pr⁡ ⁣[∣δ~p−δ~∣≥2(f(Δ)+ε)]≤e−Cn(n≥n0)\Pr\!\left[|\widetilde\delta_p-\widetilde\delta|\geq2(f(\Delta)+\varepsilon)\right]\leq e^{-Cn}\qquad(n\geq n_0)Pr[∣δp​−δ∣≥2(f(Δ)+ε)]≤e−Cn(n≥n0​)

for some C>0C>0C>0 and n0n_0n0​. The claim allows arbitrary correlations across pairs and coins. It is the concentration estimate that connects weak basis dependence to phase error inference; it is not a statement about mean error rates.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intake100_P99
Formal statement
noncomputable section

open scoped Matrix ComplexConjugate BigOperators

namespace QAlgorithms.Papers.Independent.Intake100.P99

attribute [local instance] Classical.propDecidable Classical.decEq

open QAlgorithms

open QAlgorithms.Papers.Independent.Information100.P69 (diamond)

open QAlgorithms.Papers.Independent.Dependency50.P48 (IsDilation receiver)

/-- arXiv:quant-ph/0212066v3, PDF pp.10--11, Lemma 2, (13),(24).
The state is the full postattack state before the final controlled Hadamards;
no independence across pairs or coins is assumed. -/
theorem balanced_attack_phase_bit_gap
    (delta : ℝ) (hdelta : 0 ≤ delta ∧ delta ≤ 1 / 2)
    (rho : (n : ℕ) → Matrix (PairCoinBits n) (PairCoinBits n) ℂ)
    (hstate : ∀ n, IsDensityMatrix (rho n))
    (hbalanced : ExponentiallySmall
      (fun n => coinXFailure (traceLeft (rho n)) delta)) :
    ∀ epsilon : ℝ, 0 < epsilon →
      ExponentiallySmall (fun n => phaseBitGapFailure (rho n) delta epsilon) := by sorry

end QAlgorithms.Papers.Independent.Intake100.P99

end
Source
Security of quantum key distribution with imperfect devices, arXiv:quant-ph/0212066v3, PDF p. 11, Lemma 2: phase/bit error gap for a balanced attack
Read-back

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

Let δ∈[0,12]\delta\in[0,\tfrac12]δ∈[0,21​], and for every natural number nnn, including zero, let ρn\rho_nρn​ be a positive semidefinite complex matrix of trace one indexed by (Qn×Qn)×Qn(Q_n\times Q_n)\times Q_n(Qn​×Qn​)×Qn​, where Qn={0,1}nQ_n=\{0,1\}^nQn​={0,1}n. Write ∣x∣|x|∣x∣ for Hamming weight, let (Hn)y,x=2−n/2(−1)∑ixiyi(H_n)_{y,x}=2^{-n/2}(-1)^{\sum_i x_i y_i}(Hn​)y,x​=2−n/2(−1)∑i​xi​yi​, and define g(δ)g(\delta)g(δ) as the real infimum of the f∈[0,12]f\in[0,\tfrac12]f∈[0,21​] satisfying h2(12−f)+h2(δ)=1h_2(\tfrac12-f)+h_2(\delta)=1h2​(21​−f)+h2​(δ)=1, where h2(p)=[−plog⁡p−(1−p)log⁡(1−p)]/log⁡2h_2(p)=[-p\log p-(1-p)\log(1-p)]/\log2h2​(p)=[−plogp−(1−p)log(1−p)]/log2. Let the last-register marginal be (σn)c,d=∑u,v∈Qn(ρn)((u,v),c),((u,v),d)(\sigma_n)_{c,d}=\sum_{u,v\in Q_n}(\rho_n)_{((u,v),c),((u,v),d)}(σn​)c,d​=∑u,v∈Qn​​(ρn​)((u,v),c),((u,v),d)​. Assume there exist C>0C>0C>0 and n0∈Nn_0\in\mathbb Nn0​∈N such that, for all n≥n0n\ge n_0n≥n0​,

∑x∈Qnnδ≤∣x∣Re⁡(HnσnHn†)x,x≤e−Cn.\sum_{\substack{x\in Q_n\\n\delta\le |x|}} \operatorname{Re}(H_n\sigma_nH_n^\dagger)_{x,x}\le e^{-Cn}.x∈Qn​nδ≤∣x∣​∑​Re(Hn​σn​Hn†​)x,x​≤e−Cn.

Define JnJ_nJn​, indexed by Qn×QnQ_n\times Q_nQn​×Qn​, by

(Jn)(u,v),(b,p)=∏i{2−1/2(−1)uipi,vi=ui⊕bi,0,otherwise,(J_n)_{(u,v),(b,p)} =\prod_i \begin{cases} 2^{-1/2}(-1)^{u_i p_i},&v_i=u_i\mathbin{\oplus}b_i,\\ 0,&\text{otherwise}, \end{cases}(Jn​)(u,v),(b,p)​=i∏​{2−1/2(−1)ui​pi​,0,​vi​=ui​⊕bi​,otherwise,​

and define CnC_nCn​ on (Qn×Qn)×Qn(Q_n\times Q_n)\times Q_n(Qn​×Qn​)×Qn​ to preserve the last register and, conditional on its bit cic_ici​, apply H1H_1H1​ to each of the two corresponding bits when ci=1c_i=1ci​=1, and the identity when ci=0c_i=0ci​=0. Put Bn=Jn⊗IB_n=J_n\otimes IBn​=Jn​⊗I and ρ~n=Bn†CnρnCn†Bn\widetilde\rho_n=B_n^\dagger C_n\rho_nC_n^\dagger B_nρ​n​=Bn†​Cn​ρn​Cn†​Bn​. Then, for every real ϵ>0\epsilon>0ϵ>0, there exist Cϵ>0C_\epsilon>0Cϵ​>0 and Nϵ∈NN_\epsilon\in\mathbb NNϵ​∈N such that, for every n≥Nϵn\ge N_\epsilonn≥Nϵ​,

∑b,p,c∈Qn2(g(δ)+ϵ)≤∣∣p∣/n−∣b∣/n∣Re⁡(ρ~n)((b,p),c),((b,p),c)≤e−Cϵn.\sum_{\substack{b,p,c\in Q_n\\ 2(g(\delta)+\epsilon)\le \left||p|/n-|b|/n\right|}} \operatorname{Re}(\widetilde\rho_n)_{((b,p),c),((b,p),c)} \le e^{-C_\epsilon n}.b,p,c∈Qn​2(g(δ)+ϵ)≤∣∣p∣/n−∣b∣/n∣​∑​Re(ρ​n​)((b,p),c),((b,p),c)​≤e−Cϵ​n.

The comparisons include equality; at n=0n=0n=0, both fractions in the event are zero by total real division. At δ=0\delta=0δ=0, the assumed event has probability one for every nnn, so the exponential-smallness hypothesis cannot hold.

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