Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Four-copy testing for real states

Open
QAlgorithms.Papers.Independent.Extend50.P30.realFourCopyTesting

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

prove2quantum

For a normalized nnn-qubit state with real computational-basis amplitudes, a single Bell measurement on two copies samples directly from pψp_\psipψ​. Following it with the two-copy Weyl verification gives the fixed four-copy test. It is perfectly complete and has the same 1/41/41/4 soundness guarantee as Theorem 3.3.

Pr⁡[Bell outcome a]=pψ(a),paccept≤1−ε2/4.\Pr[\text{Bell outcome }a]=p_\psi(a),\qquad p_{\rm accept}\leq1-\varepsilon^2/4.Pr[Bell outcome a]=pψ​(a),paccept​≤1−ε2/4.

This gives the source's four-copy testing for real states in the fixed computational-basis and phase conventions.

Formalization Note Pure states carry norm one; stabilizer averages use density matrices to discard global phases. All finite tensor indices are explicitly ordered by copy, then physical qudit.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Extend50_P30
Formal statement
noncomputable section

open scoped BigOperators ComplexConjugate Matrix

namespace QAlgorithms.Papers.Independent.Extend50.P30

open QAlgorithms.Papers.Independent.Information100.P63 (tensorPower)

open QAlgorithms.Papers.Independent.Gap20.P06 (ketBra)

attribute [local instance] Classical.propDecidable

/-- PDF p.22, Remark 3.5. The printed reference to Theorem 3.2 means the testing guarantees of 3.3. -/
theorem realFourCopyTesting (n : ℕ) :
    QAlgorithms.IsEffect (realQubitTest n) ∧
    ∀ v : EuclideanSpace ℂ (ResidueRegister 2 n), ‖v‖ = 1 → (∀ x, (v x).im = 0) →
      (∀ a : DiscretePhaseSpace 2 n, QAlgorithms.effectProb (QAlgorithms.pureDensity (weylBellVector n a))
        (Matrix.kronecker (QAlgorithms.pureDensity v) (QAlgorithms.pureDensity v)) = characteristicDistribution v a) ∧
      (IsStabilizer v → QAlgorithms.effectProb (realQubitTest n)
        (tensorPower 4 (QAlgorithms.pureDensity v)) = 1) ∧
      (∀ epsilon : ℝ, FarFromStabilizers v epsilon →
        QAlgorithms.effectProb (realQubitTest n) (tensorPower 4 (QAlgorithms.pureDensity v)) ≤
          1 - epsilon ^ 2 / 4) := by sorry

end QAlgorithms.Papers.Independent.Extend50.P30

end
Source
Schur-Weyl Duality for the Clifford Group with Applications: Property Testing, a Robust Hudson Theorem, and de Finetti Representations, arXiv:1712.08628v3, PDF p. 22, remark-3.5
Read-back

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

For every n∈Nn\in\mathbb Nn∈N, let R=(Z/2Z)nR=(\mathbb Z/2\mathbb Z)^nR=(Z/2Z)n, Z=R×RZ=R\times RZ=R×R, and define Wp,q(a,b)=i−∑jval⁡(pj)val⁡(qj)(−1)∑jval⁡(pj)val⁡(aj)W_{p,q}(a,b)=i^{-\sum_j\operatorname{val}(p_j)\operatorname{val}(q_j)}(-1)^{\sum_j\operatorname{val}(p_j)\operatorname{val}(a_j)}Wp,q​(a,b)=i−∑j​val(pj​)val(qj​)(−1)∑j​val(pj​)val(aj​) when a=b+qa=b+qa=b+q, and zero otherwise. Set Bz(a,b)=2−n/2Wz(a,b)B_z(a,b)=2^{-n/2}W_z(a,b)Bz​(a,b)=2−n/2Wz​(a,b), Pw(a,b)=w(a)w(b)‾P_w(a,b)=w(a)\overline{w(b)}Pw​(a,b)=w(a)w(b)​, and

Fn=12∑a∈ZPBa⊗(I+Wa⊗Wa†).F_n=\frac12\sum_{a\in Z}P_{B_a}\otimes(I+W_a\otimes W_a^\dagger).Fn​=21​a∈Z∑​PBa​​⊗(I+Wa​⊗Wa†​).

The theorem asserts Fn⪰0F_n\succeq0Fn​⪰0 and I−Fn⪰0I-F_n\succeq0I−Fn​⪰0. For every v∈CRv\in\mathbb C^Rv∈CR with ∥v∥=1\|v\|=1∥v∥=1 and Im⁡v(x)=0\operatorname{Im}v(x)=0Imv(x)=0 for every x∈Rx\in Rx∈R, it further asserts, for every a∈Za\in Za∈Z,

Re⁡tr⁡ ⁣(PBa(Pv⊗Pv))=2−n∣⟨v,Wav⟩∣2.\operatorname{Re}\operatorname{tr}\!\left(P_{B_a}(P_v\otimes P_v)\right) =2^{-n}|\langle v,W_av\rangle|^2.Retr(PBa​​(Pv​⊗Pv​))=2−n∣⟨v,Wa​v⟩∣2.

Let Sn\mathcal S_nSn​ consist of the rank-one unit-vector matrices among (tr⁡AG)−1AG(\operatorname{tr}A_G)^{-1}A_G(trAG​)−1AG​, with AG=∣G∣−1∑P∈GPA_G=|G|^{-1}\sum_{P\in G}PAG​=∣G∣−1∑P∈G​P, where G⊆{ihWz:0≤h<4, z∈Z}G\subseteq\{i^hW_z:0\le h<4,\ z\in Z\}G⊆{ihWz​:0≤h<4, z∈Z} contains III, is closed under multiplication and adjoints, and satisfies P=cI⇒c=1P=cI\Rightarrow c=1P=cI⇒c=1. For the same real unit vector vvv, if Pv∈SnP_v\in\mathcal S_nPv​∈Sn​, then Re⁡tr⁡(FnPv⊗4)=1\operatorname{Re}\operatorname{tr}(F_nP_v^{\otimes4})=1Retr(Fn​Pv⊗4​)=1; and for every real ϵ\epsilonϵ, if Re⁡tr⁡(SPv)≤1−ϵ2\operatorname{Re}\operatorname{tr}(SP_v)\le1-\epsilon^2Retr(SPv​)≤1−ϵ2 for all S∈SnS\in\mathcal S_nS∈Sn​, then

Re⁡tr⁡(FnPv⊗4)≤1−ϵ24.\operatorname{Re}\operatorname{tr}(F_nP_v^{\otimes4})\le1-\frac{\epsilon^2}{4}.Retr(Fn​Pv⊗4​)≤1−4ϵ2​.

Tensor-power entries are products over the four copies. The effect assertion does not require a real input vector, whereas all subsequent assertions do. The theorem includes n=0n=0n=0 and places no sign restriction on ϵ\epsilonϵ.

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

    Confirmed by the moderator at approval.

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