Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Three-copy formula for the state-dependent second moment

Open
QAlgorithms.Papers.Independent.Intakethird100.P71.shadowSecondMoment_threeCopies

by Gohan · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Consider the fixed projective experiment on NNN qudits, d≥2d\ge2d≥2, with locally conjugation-invariant prior ν\nuν and invertible channel M\mathcal MM. Let ρ\rhoρ be a density matrix and OOO a traceless Hermitian observable. Put R=M−1(O)R=\mathcal M^{-1}(O)R=M−1(O), o^(S)=Tr⁡(OM−1(S))\hat o(S)=\operatorname{Tr}(O\mathcal M^{-1}(S))o^(S)=Tr(OM−1(S)), and Qρ(O)=ES∣ρo^(S)2Q_\rho(O)=\mathbb E_{S\mid\rho}\hat o(S)^2Qρ​(O)=ES∣ρ​o^(S)2. For g,h∈(S3)Ng,h\in(S_3)^Ng,h∈(S3​)N, let χg\chi_gχg​ permute the three copies independently at each site and Wh(3)=EνTr⁡(S⊗3χh)W_h^{(3)}=\mathbb E_\nu\operatorname{Tr}(S^{\otimes3}\chi_h)Wh(3)​=Eν​Tr(S⊗3χh​). Then

Var⁡o^≤Qρ(O),Qρ(O)=∑g,h∈(S3)NdNTr⁡[(R⊗R⊗ρ)χg] Wgg,hWh(3).\operatorname{Var}\hat o\le Q_\rho(O),\qquad Q_\rho(O)=\sum_{g,h\in(S_3)^N}d^N\operatorname{Tr}[(R\otimes R\otimes\rho)\chi_g]\,\mathrm{Wg}_{g,h}W_h^{(3)}.Varo^≤Qρ​(O),Qρ​(O)=g,h∈(S3​)N∑​dNTr[(R⊗R⊗ρ)χg​]Wgg,h​Wh(3)​.

The Weingarten coefficient is the product of the local three-copy coefficients. At d=2d=2d=2 the usual spectral extension omits the three-row partition instead of inverting a singular Gram matrix. The equality is expressed over C\mathbb CC to retain the individual permutation traces. This is a state-dependent second moment, not a worst-state supremum.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P71
Formal statement
noncomputable section

open MeasureTheory

open scoped Matrix ComplexConjugate ENNReal Matrix.Norms.Elementwise

namespace QAlgorithms.Papers.Independent.Intakethird100.P71

attribute [local instance] Classical.propDecidable

local notation "Config" n:max d:max =>
  QAlgorithms.Papers.Independent.Information100.P21.Config (P := Fin n) (fun _ => d)

local notation "Op" n:max d:max =>
  QAlgorithms.Papers.Independent.Information100.P21.Op (Config n d)

attribute [local instance] QAlgorithms.Papers.Independent.Intakethird100.P71.matrixContinuousENorm

local notation "Unitary" n:max d:max => Matrix.unitaryGroup (Config n d) ℂ

local notation "Local" n:max d:max => Fin n → Matrix.unitaryGroup (Fin d) ℂ

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

/-- PDF pp.4–5 Eqs.(14)–(17): the state-dependent second moment in (S_3)^N.
For qubits wgThree uses its spectral extension at the singular Gram matrix. -/
theorem shadowSecondMoment_threeCopies {n d : ℕ} (hd : 2 ≤ d) (E : ProjectiveEnsemble n d)
    (hls : LocallyScrambled (prior E)) (hc : Complete (prior E))
    (rho O : Op n d) (hrho : IsDensityMatrix rho) (hO : O.IsHermitian) (ht : O.trace = 0) :
    shotVariance (prior E) hc rho O ≤ secondMoment (prior E) hc rho O ∧
    (secondMoment (prior E) hc rho O : ℂ) =
      ∑ g : Permutations n 3, ∑ h : Permutations n 3,
        observableThree (prior E) hc rho O g * (productWgThree d g h : ℂ) *
          featureThree (prior E) h := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P71

end
Source
Classical Shadow Tomography with Locally Scrambled Quantum Dynamics, arXiv:2107.04817v4, PDF p. 4, §II B, Eqs.(14)–(17): state-dependent shadow second moment
Read-back

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

Let n≥0n\ge0n≥0 and d≥2d\ge2d≥2, put X={0,…,d−1}n\mathcal X=\{0,\ldots,d-1\}^nX={0,…,d−1}n and N=dnN=d^nN=dn, and let EEE supply a probability law λ\lambdaλ on global unitary matrices. Define ν=N−1∑b(U↦U†∣b⟩⟨b∣U)∗λ\nu=N^{-1}\sum_b(U\mapsto U^\dagger|b\rangle\langle b|U)_*\lambdaν=N−1∑b​(U↦U†∣b⟩⟨b∣U)∗​λ. Assume that ν\nuν is invariant under S↦LV†SLVS\mapsto L_V^\dagger SL_VS↦LV†​SLV​ for every LV=⨂iViL_V=\bigotimes_iV_iLV​=⨂i​Vi​ with all ViV_iVi​ unitary. Define M(X)ij=∑k,l(∫NSijSlk dν(S))Xkl\mathcal M(X)_{ij}=\sum_{k,l}(\int NS_{ij}S_{lk}\,d\nu(S))X_{kl}M(X)ij​=∑k,l​(∫NSij​Slk​dν(S))Xkl​, assume M\mathcal MM is injective, and write R=M−1\mathcal R=\mathcal M^{-1}R=M−1. Let ρ\rhoρ be positive semidefinite with trace 111, and let OOO be Hermitian with trace exactly 000. Define z(S)=Re⁡tr⁡(OR(S))z(S)=\operatorname{Re}\operatorname{tr}(O\mathcal R(S))z(S)=Retr(OR(S)), dνρ=[NRe⁡tr⁡(Sρ)]+dνd\nu_\rho=[N\operatorname{Re}\operatorname{tr}(S\rho)]_+d\nudνρ​=[NRetr(Sρ)]+​dν,

Q=∫z(S)2 dνρ(S),V=Q−(∫z(S) dνρ(S))2.Q=\int z(S)^2\,d\nu_\rho(S), \qquad V=Q-\left(\int z(S)\,d\nu_\rho(S)\right)^2.Q=∫z(S)2dνρ​(S),V=Q−(∫z(S)dνρ​(S))2.

For g=(gi)i<ng=(g_i)_{i<n}g=(gi​)i<n​ with gig_igi​ permutations of {0,1,2}\{0,1,2\}{0,1,2}, let CgC_gCg​ be the matrix indexed by triples of configurations whose (x,y)(x,y)(x,y)-entry is 111 precisely when xk(i)=ygi(k)(i)x_k(i)=y_{g_i(k)}(i)xk​(i)=ygi​(k)​(i) for every i,ki,ki,k, and is 000 otherwise. For a permutation π\piπ of three elements, put χ(π)=∣{k:π(k)=k}∣−1\chi(\pi)=|\{k:\pi(k)=k\}|-1χ(π)=∣{k:π(k)=k}∣−1 and

wd(π)=16[1d(d+1)(d+2)+2χ(π)d(d+1)(d−1)+{sgn⁡πd(d−1)(d−2),d≥3,0,d=2.].w_d(\pi)=\frac16\left[ \frac1{d(d+1)(d+2)} +\frac{2\chi(\pi)}{d(d+1)(d-1)} +\begin{cases} \dfrac{\operatorname{sgn}\pi}{d(d-1)(d-2)},&d\ge3,\\ 0,&d=2. \end{cases}\right].wd​(π)=61​​d(d+1)(d+2)1​+d(d+1)(d−1)2χ(π)​+⎩⎨⎧​d(d−1)(d−2)sgnπ​,0,​d≥3,d=2.​​.

Define Wd(g,h)=∏iwd(gihi−1)W_d(g,h)=\prod_iw_d(g_i h_i^{-1})Wd​(g,h)=∏i​wd​(gi​hi−1​), F3(h)=∫tr⁡(S⊗3Ch) dν(S)F_3(h)=\int\operatorname{tr}(S^{\otimes3}C_h)\,d\nu(S)F3​(h)=∫tr(S⊗3Ch​)dν(S), and A3(g)=Ntr⁡((R(O)⊗R(O)⊗ρ)Cg)A_3(g)=N\operatorname{tr}((\mathcal R(O)\otimes\mathcal R(O)\otimes\rho)C_g)A3​(g)=Ntr((R(O)⊗R(O)⊗ρ)Cg​), where tensor coordinates list the three copies first. The theorem states

V≤Q,Q=∑g∑hA3(g)Wd(g,h)F3(h),V\le Q, \qquad Q=\sum_g\sum_h A_3(g)W_d(g,h)F_3(h),V≤Q,Q=g∑​h∑​A3​(g)Wd​(g,h)F3​(h),

with the second equality interpreted in C\mathbb CC by embedding the real number QQQ. The case n=0n=0n=0 is included, with empty products equal to 111.

Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Nov 1, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me