Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Local-state averaged second moment from second entanglement features

Open
QAlgorithms.Papers.Independent.Intakethird100.P71.averagedSecondMoment_entanglementFeatures

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

prove2quantum

Let ν\nuν be the locally scrambled prior of a complete projective experiment on NNN qudits, d≥2d\ge2d≥2, with reconstruction coefficients rrr solving Eq. (12). Fix a density matrix ρ\rhoρ and a traceless Hermitian OOO. Let HHH be normalized Haar measure on U(d)NU(d)^NU(d)N, WC=EνTr⁡[(Tr⁡CˉS)2]W_C=\mathbb E_\nu\operatorname{Tr}[(\operatorname{Tr}_{\bar C}S)^2]WC​=Eν​Tr[(TrCˉ​S)2], and WO,D=EV∼HTr⁡[(Tr⁡Dˉ(V†OV))2]W_{O,D}=\mathbb E_{V\sim H}\operatorname{Tr}[(\operatorname{Tr}_{\bar D}(V^\dagger OV))^2]WO,D​=EV∼H​Tr[(TrDˉ​(V†OV))2]. The local-state average Qav(O)=EV∼HQV†ρV(O)Q_{\mathrm{av}}(O)=\mathbb E_{V\sim H}Q_{V^\dagger\rho V}(O)Qav​(O)=EV∼H​QV†ρV​(O) equals the prior second moment of the prediction and satisfies

Qav(O)=∑A,B,C,DvA,B,C,DWA∩B∩CWO,D,Q_{\mathrm{av}}(O)=\sum_{A,B,C,D}v_{A,B,C,D}W_{A\cap B\cap C}W_{O,D},Qav​(O)=A,B,C,D∑​vA,B,C,D​WA∩B∩C​WO,D​, vA,B,C,D=rArB(d2d2−1)Nd∣A∩B∩C∣d∣C∣(−1d)∣C△D∣.v_{A,B,C,D}=r_A r_B\left(\frac{d^2}{d^2-1}\right)^N\frac{d^{|A\cap B\cap C|}}{d^{|C|}}\left(-\frac1d\right)^{|C\triangle D|}.vA,B,C,D​=rA​rB​(d2−1d2​)Nd∣C∣d∣A∩B∩C∣​(−d1​)∣C△D∣.

All indices are arbitrary regions, including empty and full regions. Observable partial traces are unnormalized. This formula removes the input-state dependence by averaging; it gives no pointwise bound for each ρ\rhoρ.

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 p.5 Eqs.(20)–(22), Appendix B pp.18–19: local-state averaged Q in
second EFs. The signed power is multiplicative. This is an average, not a
pointwise-in-rho variance bound. -/
theorem averagedSecondMoment_entanglementFeatures {n d : ℕ} (hd : 2 ≤ d)
    (E : ProjectiveEnsemble n d) (hls : LocallyScrambled (prior E)) (hc : Complete (prior E))
    (H : Measure (Local n d)) [IsProbabilityMeasure H] [H.IsMulLeftInvariant]
    (rho O : Op n d) (hrho : IsDensityMatrix rho) (hO : O.IsHermitian) (ht : O.trace = 0)
    (r : Finset (Fin n) → ℝ) (hr : CoefficientSystem (prior E) r) :
    averagedSecondMoment H (prior E) hc rho O =
      (∫ S, shadowEstimate (prior E) hc O S ^ 2 ∂prior E) ∧
    averagedSecondMoment H (prior E) hc rho O =
      ∑ A : Finset (Fin n), ∑ B : Finset (Fin n), ∑ C : Finset (Fin n), ∑ D : Finset (Fin n),
        varianceCoefficient d r A B C D * feature (prior E) (A ∩ B ∩ C) *
          observableFeature H O D := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P71

end
Source
Classical Shadow Tomography with Locally Scrambled Quantum Dynamics, arXiv:2107.04817v4, PDF p. 5, §II B / Appendix B: state-averaged second moment in entanglement features
Read-back

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

Let n≥0n\ge0n≥0, d≥2d\ge2d≥2, X={0,…,d−1}n\mathcal X=\{0,\ldots,d-1\}^nX={0,…,d−1}n, and N=dnN=d^nN=dn. Let EEE supply a probability law λ\lambdaλ on global unitary matrices and set ν=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)∗​λ. For local unitary families V=(Vi)i<nV=(V_i)_{i<n}V=(Vi​)i<n​, put LV=⨂iViL_V=\bigotimes_iV_iLV​=⨂i​Vi​, assume (S↦LV†SLV)∗ν=ν(S\mapsto L_V^\dagger SL_V)_*\nu=\nu(S↦LV†​SLV​)∗​ν=ν for every VVV, and let HHH be a probability measure on these families invariant under multiplication on the left by every fixed family. 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 of trace 111, and let OOO be Hermitian of trace 000. For any matrix σ\sigmaσ, set dνσ(S)=[NRe⁡tr⁡(Sσ)]+dν(S)d\nu_\sigma(S)=[N\operatorname{Re}\operatorname{tr}(S\sigma)]_+d\nu(S)dνσ​(S)=[NRetr(Sσ)]+​dν(S), and put z(S)=Re⁡tr⁡(OR(S))z(S)=\operatorname{Re}\operatorname{tr}(O\mathcal R(S))z(S)=Retr(OR(S)) and

Q‾=∫(∫z(S)2 dνLV†ρLV(S))dH(V).\overline Q=\int\left(\int z(S)^2\,d\nu_{L_V^\dagger\rho L_V}(S)\right)dH(V).Q​=∫(∫z(S)2dνLV†​ρLV​​(S))dH(V).

For subsets AAA of the sites, let Tr⁡AcX\operatorname{Tr}_{A^c}XTrAc​X be the matrix with entries ∑zX(x,z),(y,z)\sum_zX_{(x,z),(y,z)}∑z​X(x,z),(y,z)​, summing over configurations on the complement, and define

f(A)=∫Re⁡tr⁡((Tr⁡AcS)2) dν(S),o(A)=∫Re⁡tr⁡((Tr⁡Ac(LV†OLV))2) dH(V).f(A)=\int\operatorname{Re}\operatorname{tr}((\operatorname{Tr}_{A^c}S)^2)\,d\nu(S), \qquad o(A)=\int\operatorname{Re}\operatorname{tr}((\operatorname{Tr}_{A^c}(L_V^\dagger OL_V))^2)\,dH(V).f(A)=∫Retr((TrAc​S)2)dν(S),o(A)=∫Retr((TrAc​(LV†​OLV​))2)dH(V).

Let rrr be any real function on site subsets satisfying, for every BBB,

∑A,Cr(A)(d3d2−1)n(∑DB=A∩Dd−∣D∣(−1/d)∣C△D∣)f(C)=1{B={0,…,n−1}}.\sum_{A,C}r(A) \left(\frac{d^3}{d^2-1}\right)^n \left(\sum_{\substack{D\\B=A\cap D}}d^{-|D|}(-1/d)^{|C\triangle D|}\right) f(C)=\mathbf1_{\{B=\{0,\ldots,n-1\}\}}.A,C∑​r(A)(d2−1d3​)n​DB=A∩D​∑​d−∣D∣(−1/d)∣C△D∣​f(C)=1{B={0,…,n−1}}​.

Then the theorem asserts both

Q‾=∫z(S)2 dν(S)\overline Q=\int z(S)^2\,d\nu(S)Q​=∫z(S)2dν(S)

and

Q‾=∑A,B,C,Dr(A)r(B)(d2d2−1)nd∣A∩B∩C∣d∣C∣(−1/d)∣C△D∣f(A∩B∩C) o(D).\overline Q= \sum_{A,B,C,D} r(A)r(B)\left(\frac{d^2}{d^2-1}\right)^n \frac{d^{|A\cap B\cap C|}}{d^{|C|}} (-1/d)^{|C\triangle D|} f(A\cap B\cap C)\,o(D).Q​=A,B,C,D∑​r(A)r(B)(d2−1d2​)nd∣C∣d∣A∩B∩C∣​(−1/d)∣C△D∣f(A∩B∩C)o(D).

Every subset sum includes the empty subset; n=0n=0n=0 is included.

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