Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Stabilizer testing from three copies

Open
QAlgorithms.Papers.Independent.Extend50.P30.threeCopyStabilizerTesting

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

prove2quantum

For any d≥2d\geq2d≥2 with d≡1d\equiv1d≡1 or 5(mod6)5\pmod65(mod6) and any nnn, Πaccept=(I+V)/2\Pi_{\rm accept}=(I+V)/2Πaccept​=(I+V)/2 is a valid effect on three copies. It accepts every pure stabilizer with certainty. For every normalized input whose stabilizer fidelities are all at most 1−ε21-\varepsilon^21−ε2, it obeys the following soundness bound, without a primality hypothesis.

paccept≤1−ε216d2.p_{\rm accept}\leq1-\frac{\varepsilon^2}{16d^2}.paccept​≤1−16d2ε2​.

This gives the source's stabilizer testing from three copies 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.62, Theorem 8.6: exact denominator 16*d^2, including composite dimensions in this regime. -/
theorem threeCopyStabilizerTesting (d n : ℕ) [NeZero d] (hd : 2 ≤ d)
    (hmod : d % 6 = 1 ∨ d % 6 = 5) :
    QAlgorithms.IsEffect (threeCopyTest d n) ∧
    ∀ v : EuclideanSpace ℂ (ResidueRegister d n), ‖v‖ = 1 →
      (IsStabilizer v → QAlgorithms.effectProb (threeCopyTest d n)
        (tensorPower 3 (QAlgorithms.pureDensity v)) = 1) ∧
      (∀ epsilon : ℝ, FarFromStabilizers v epsilon →
        QAlgorithms.effectProb (threeCopyTest d n) (tensorPower 3 (QAlgorithms.pureDensity v)) ≤
          1 - epsilon ^ 2 / (16 * (d : ℝ) ^ 2)) := 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. 62, theorem-8.6
Read-back

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

For all natural numbers d,nd,nd,n, with d≠0d\ne0d=0, d≥2d\ge2d≥2, and d mod 6∈{1,5}d\bmod6\in\{1,5\}dmod6∈{1,5}, put R=(Z/dZ)nR=(\mathbb Z/d\mathbb Z)^nR=(Z/dZ)n, V=R×RV=R\times RV=R×R, ω=e2πi/d\omega=e^{2\pi i/d}ω=e2πi/d, and τ=(−1)deπi/d\tau=(-1)^de^{\pi i/d}τ=(−1)deπi/d. Define

(Wp,q)a,b=1{a=b+q}τ−∑jpˉjqˉjω∑jpˉjaˉj,[u,w]=∑j(u1jw2j−u2jw1j),Ax=d−n∑y∈Vω−[x,y]‾Wy†,T=12(I+d−n∑x∈VAx⊗3),(W_{p,q})_{a,b}=\mathbf1_{\{a=b+q\}}\tau^{-\sum_j\bar p_j\bar q_j}\omega^{\sum_j\bar p_j\bar a_j}, \quad [u,w]=\sum_j(u_{1j}w_{2j}-u_{2j}w_{1j}), \quad A_x=d^{-n}\sum_{y\in V}\omega^{-\overline{[x,y]}}W_y^\dagger, \quad T=\frac12\left(I+d^{-n}\sum_{x\in V}A_x^{\otimes3}\right),(Wp,q​)a,b​=1{a=b+q}​τ−∑j​pˉ​j​qˉ​j​ω∑j​pˉ​j​aˉj​,[u,w]=j∑​(u1j​w2j​−u2j​w1j​),Ax​=d−ny∈V∑​ω−[x,y]​Wy†​,T=21​(I+d−nx∈V∑​Ax⊗3​),

using standard nonnegative residue representatives and tensor powers with entries given by products over the three copies. Let S\mathcal SS be constructed as follows: take P={τhWp,q:0≤h<d, p,q∈R}\mathcal P=\{\tau^hW_{p,q}:0\le h<d,\ p,q\in R\}P={τhWp,q​:0≤h<d, p,q∈R}; for every G⊆PG\subseteq\mathcal PG⊆P containing the identity, closed under multiplication and adjoints, and satisfying A=cI, A∈G⇒c=1A=cI,\ A\in G\Rightarrow c=1A=cI, A∈G⇒c=1, form PG=∣G∣−1∑P∈GPP_G=|G|^{-1}\sum_{P\in G}PPG​=∣G∣−1∑P∈G​P and SG=(tr⁡PG)−1PGS_G=(\operatorname{tr}P_G)^{-1}P_GSG​=(trPG​)−1PG​; retain precisely those SGS_GSG​ equal to uu†uu^\daggeruu† for some unit vector uuu. Then TTT and I−TI-TI−T are positive semidefinite, and every unit vector v∈CRv\in\mathbb C^Rv∈CR satisfies both implications: if vv†∈Svv^\dagger\in\mathcal Svv†∈S, then Re⁡tr⁡(T(vv†)⊗3)=1\operatorname{Re}\operatorname{tr}(T(vv^\dagger)^{\otimes3})=1Retr(T(vv†)⊗3)=1; and, for every real ϵ\epsilonϵ, if Re⁡tr⁡(Svv†)≤1−ϵ2\operatorname{Re}\operatorname{tr}(Svv^\dagger)\le1-\epsilon^2Retr(Svv†)≤1−ϵ2 for every S∈SS\in\mathcal SS∈S, then

Re⁡tr⁡(T(vv†)⊗3)≤1−ϵ216d2.\operatorname{Re}\operatorname{tr}(T(vv^\dagger)^{\otimes3}) \le1-\frac{\epsilon^2}{16d^2}.Retr(T(vv†)⊗3)≤1−16d2ϵ2​.

The parameter ϵ\epsilonϵ has no sign or interval restriction; its hypothesis is required even for values for which it cannot be satisfied. Inverses use 0−1=00^{-1}=00−1=0, ddd need not be prime, and n=0n=0n=0 is included.

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