Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§7: Bell measurement from CX and local X/Z measurements

Proved
QAlgorithms.Papers.Independent.Intakenext100.P52.bell_measurement_from_local_measurements

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

prove2quantum

Use ∣Bcd⟩=(ZcXd⊗I)(∣00⟩+∣11⟩)/2|B_{cd}\rangle=(Z^cX^d\otimes I)(|00\rangle+|11\rangle)/\sqrt2∣Bcd​⟩=(ZcXd⊗I)(∣00⟩+∣11⟩)/2​ and ∣xc⟩=(∣0⟩+(−1)c∣1⟩)/2|x_c\rangle=(|0\rangle+(-1)^c|1\rangle)/\sqrt2∣xc​⟩=(∣0⟩+(−1)c∣1⟩)/2​. Then

CX∣Bcd⟩=∣xc⟩∣d⟩.CX|B_{cd}\rangle=|x_c\rangle|d\rangle.CX∣Bcd​⟩=∣xc​⟩∣d⟩.

Consequently destructive Bell measurement, even with an arbitrary reference system, is exactly CXCXCX followed by X1,Z2X_1,Z_2X1​,Z2​ measurement with outcome labels c,dc,dc,d. For Figure 12 start from ∣ψ⟩1∣0⟩2∣+⟩3|\psi\rangle_1|0\rangle_2|+\rangle_3∣ψ⟩1​∣0⟩2​∣+⟩3​, apply CX3→2CX_{3\to2}CX3→2​ and CX1→2CX_{1\to2}CX1→2​, then measure X1,Z2X_1,Z_2X1​,Z2​. The two entangling gates commute, and for every normalized input its output branch is XdZc∣ψ⟩/2X^dZ^c|\psi\rangle/2XdZc∣ψ⟩/2, with probability 1/41/41/4. Source correction: the displayed intermediate labels on p.15 are interchanged relative to the p.2 Bell definition.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P52
Formal statement
noncomputable section

open scoped Matrix ComplexConjugate

namespace QAlgorithms.Papers.Independent.Intakenext100.P52

open QAlgorithms.Papers.Independent.Information100.P21 (Vec)

open QAlgorithms.Papers.Independent.Gap20.P01 (applyRect)

/-- Bell measurement decomposition, PDF pp.15–16. Printed CX B_ij label map
is interchanged; changed to CX B_cd=|(-1)^c> |d>, consistent with p.2.
The bra identity holds with any reference, hence gives the full destructive
measurement instrument. Fig.12's two CXs share a target and commute. -/
theorem bell_measurement_from_local_measurements :
    (∀ c d : Bool, act cnot (sourceBellBasis c d) =
      tensorVec (equatorial 0 c) (ket d)) ∧
    (∀ (R : Type) [Fintype R] [DecidableEq R] (psi : Vec (QubitPair × R)) (c d : Bool),
      pairBra (sourceBellBasis c d) psi = localBellAnalysis c d psi) ∧
    cxWires (0 : Fin 3) 1 * cxWires (2 : Fin 3) 1 =
      cxWires (2 : Fin 3) 1 * cxWires (0 : Fin 3) 1 ∧
    (∀ (psi : Vec Bool), IsState psi → ∀ c d : Bool,
      figure12Branch c d psi =
        teleportContraction psi (finiteMaxEntangled Bool) (sourceBellBasis c d) ∧
      figure12Branch c d psi = (1 / 2 : ℂ) • act (pauliByproduct d c) psi ∧
      ‖figure12Branch c d psi‖ ^ 2 = (1 / 4 : ℝ)) := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P52

end
Source
An introduction to measurement based quantum computation, arXiv:quant-ph/0508124v2, PDF p. 15, §7: Bell measurement from CX and local X/Z measurements
Read-back

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

Identify bits with 0,10,10,1, let X∣a⟩=∣a⊕1⟩X|a\rangle=|a\oplus1\rangleX∣a⟩=∣a⊕1⟩, Z∣a⟩=(−1)a∣a⟩Z|a\rangle=(-1)^a|a\rangleZ∣a⟩=(−1)a∣a⟩, and let C∣a,b⟩=∣a,b⊕a⟩C|a,b\rangle=|a,b\oplus a\rangleC∣a,b⟩=∣a,b⊕a⟩. Define Φ=(∣0,0⟩+∣1,1⟩)/2\Phi=(|0,0\rangle+|1,1\rangle)/\sqrt2Φ=(∣0,0⟩+∣1,1⟩)/2​, Bcd=(ZcXd⊗I)ΦB_{cd}=(Z^cX^d\otimes I)\PhiBcd​=(ZcXd⊗I)Φ, and ec=(∣0⟩+(−1)c∣1⟩)/2e_c=(|0\rangle+(-1)^c|1\rangle)/\sqrt2ec​=(∣0⟩+(−1)c∣1⟩)/2​. The theorem asserts all of the following jointly: for every pair of bits c,dc,dc,d, CBcd=ec⊗∣d⟩CB_{cd}=e_c\otimes|d\rangleCBcd​=ec​⊗∣d⟩; for every finite type RRR with decidable equality, every complex vector Ψ\PsiΨ indexed by ({0,1}2)×R(\{0,1\}^2)\times R({0,1}2)×R, and every c,dc,dc,d, the vectors indexed by RRR satisfy

(∑a,bBcd(a,b)‾ Ψ((a,b),r))r=(∑aec(a)‾ ((C⊗IR)Ψ)((a,d),r))r;\left(\sum_{a,b}\overline{B_{cd}(a,b)}\,\Psi((a,b),r)\right)_r = \left(\sum_a\overline{e_c(a)}\,((C\otimes I_R)\Psi)((a,d),r)\right)_r;​a,b∑​Bcd​(a,b)​Ψ((a,b),r)​r​=(a∑​ec​(a)​((C⊗IR​)Ψ)((a,d),r))r​;

the three-bit permutation matrices C0→1C_{0\to1}C0→1​ and C2→1C_{2\to1}C2→1​, which exclusive-or their control bit into bit 111, commute; and, for every ψ∈C{0,1}\psi\in\mathbb C^{\{0,1\}}ψ∈C{0,1} with ∥ψ∥=1\|\psi\|=1∥ψ∥=1 and every c,dc,dc,d, putting Fψ(a,t,b)=ψ(a)1{t=0}/2F_\psi(a,t,b)=\psi(a)\mathbf1_{\{t=0\}}/\sqrt2Fψ​(a,t,b)=ψ(a)1{t=0}​/2​ and qb=∑aec(a)‾(C0→1C2→1Fψ)(a,d,b)q_b=\sum_a\overline{e_c(a)}(C_{0\to1}C_{2\to1}F_\psi)(a,d,b)qb​=∑a​ec​(a)​(C0→1​C2→1​Fψ​)(a,d,b) gives

qk=∑i,jBcd(i,j)‾ ψi Φ(j,k),q=12XdZcψ,∥q∥2=14.q_k=\sum_{i,j}\overline{B_{cd}(i,j)}\,\psi_i\,\Phi(j,k), \qquad q=\frac12X^dZ^c\psi, \qquad \|q\|^2=\frac14.qk​=i,j∑​Bcd​(i,j)​ψi​Φ(j,k),q=21​XdZcψ,∥q∥2=41​.

The vector Ψ\PsiΨ in the second assertion need not be normalized, and RRR is allowed to be empty.

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