Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Supplementary Note 6: classical reduction for BB84 sample errors

Open
QAlgorithms.Papers.Independent.Intakenext100.P87.bb84_coarse_reduction

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

prove2quantum

In the perfect single-photon qubit model, let ρ\rhoρ be any normalized state of NNN pairs. Fix any m≤Nm\le Nm≤N distinct tested positions and any choice of the two matching BB84 bases x,zx,zx,z. Let ooo record whether each pair's outcomes are parallel or antiparallel, and let DBell\mathcal D_{\rm Bell}DBell​ be the complete nonselective NNN-Bell measurement. Then

Pr⁡DBell(ρ)[o]=Pr⁡ρ[o].\Pr_{\mathcal D_{\rm Bell}(\rho)}[o]=\Pr_\rho[o].DBell​(ρ)Pr​[o]=ρPr​[o].

The equality holds jointly for all tested coarse outcomes, and hence also after averaging over independent random samples and bases. It does not claim preservation of the fine-grained polarization records.

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.21, second example: Bell premeasurement preserves the joint coarse error law
in the two matching BB84 bases, for every possible fixed test sample.
Averaging over an independent random test sample therefore preserves its law as well. -/
theorem bb84_coarse_reduction (N m : ℕ) (hm : m ≤ N)
    (rho : Matrix (PairRegister N) (PairRegister N) ℂ) (hrho : IsDensityMatrix rho)
    (s : Fin m ↪ Fin N) (axes : Fin m → Fin 3)
    (haxes : ∀ j, axes j = 0 ∨ axes j = 2) (anti : Qubits m) :
    pairAxisSampleLaw (bellPinch rho) s axes anti = pairAxisSampleLaw rho s axes anti := 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. 21, Supplementary Note 6: classical reduction for BB84 sample errors
Read-back

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

For all natural numbers N,mN,mN,m satisfying m≤Nm\leq Nm≤N, every positive semidefinite complex matrix ρ\rhoρ indexed by ΩN={0,1}N×{0,1}N\Omega_N=\{0,1\}^N\times\{0,1\}^NΩN​={0,1}N×{0,1}N with trace 111, every injection s:{0,…,m−1}↪{0,…,N−1}s:\{0,\ldots,m-1\}\hookrightarrow\{0,\ldots,N-1\}s:{0,…,m−1}↪{0,…,N−1}, every function a:{0,…,m−1}→{0,1,2}a:\{0,\ldots,m-1\}\to\{0,1,2\}a:{0,…,m−1}→{0,1,2} satisfying aj=0a_j=0aj​=0 or aj=2a_j=2aj​=2 for every jjj, and every Boolean string b∈{0,1}mb\in\{0,1\}^mb∈{0,1}m, the theorem asserts

Re⁡tr⁡ ⁣(KB(ρ)K†)=Re⁡tr⁡(KρK†).\operatorname{Re}\operatorname{tr}\!\left(K\mathcal B(\rho)K^\dagger\right) = \operatorname{Re}\operatorname{tr}(K\rho K^\dagger).Retr(KB(ρ)K†)=Retr(KρK†).

Here K=Es(m−1)(Pa(m−1),b(m−1))⋯Es(0)(Pa(0),b(0))K=E_{s(m-1)}(P_{a(m-1),b(m-1)})\cdots E_{s(0)}(P_{a(0),b(0)})K=Es(m−1)​(Pa(m−1),b(m−1)​)⋯Es(0)​(Pa(0),b(0)​), where Pk,c=12(I4+(−1)1{c=true}Ak⊗Ak)P_{k,c}=\tfrac12(I_4+(-1)^{\mathbf1_{\{c=\mathrm{true}\}}}A_k\otimes A_k)Pk,c​=21​(I4​+(−1)1{c=true}​Ak​⊗Ak​), A0=X=(0110)A_0=X=\left(\begin{smallmatrix}0&1\\1&0\end{smallmatrix}\right)A0​=X=(01​10​), and A2=Z=(100−1)A_2=Z=\left(\begin{smallmatrix}1&0\\0&-1\end{smallmatrix}\right)A2​=Z=(10​0−1​). The matrix Ei(P)E_i(P)Ei​(P) uses PPP on the iii-th pair of bits, with entries zero unless the row and column agree in both strings at all other positions. The matrix B(ρ)\mathcal B(\rho)B(ρ) is ∑u,w∈{0,1}NBu,wρBu,w\sum_{u,w\in\{0,1\}^N}B_{u,w}\rho B_{u,w}∑u,w∈{0,1}N​Bu,w​ρBu,w​, where Bu,w=∣βu,w⟩⟨βu,w∣B_{u,w}=|\beta_{u,w}\rangle\langle\beta_{u,w}|Bu,w​=∣βu,w​⟩⟨βu,w​∣ and ∣βu,w⟩=(I⊗⨂iRui,wi) 2−N/2∑z∣z,z⟩|\beta_{u,w}\rangle=(I\otimes\bigotimes_iR_{u_i,w_i})\,2^{-N/2}\sum_z|z,z\rangle∣βu,w​⟩=(I⊗⨂i​Rui​,wi​​)2−N/2∑z​∣z,z⟩, with R0,0=I2R_{0,0}=I_2R0,0​=I2​, R0,1=XR_{0,1}=XR0,1​=X, R1,0=ZR_{1,0}=ZR1,0​=Z, and R1,1=(0−ii0)R_{1,1}=\left(\begin{smallmatrix}0&-\mathrm i\\\mathrm i&0\end{smallmatrix}\right)R1,1​=(0i​−i0​). The case m=0m=0m=0, including N=0N=0N=0, is allowed: the axis condition is then vacuous and KKK is the identity.

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