Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Regular covariance update and complex signed trace identities

Open
QAlgorithms.Papers.Independent.Intake100.P22.covariance_and_trace

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

prove2quantum

Fix a finite number n≥0n\ge0n≥0 of fermionic modes. Let C2n=End⁡(C2n)\mathcal C_{2n}=\operatorname{End}(\mathbb C^{2^n})C2n​=End(C2n) have Hermitian Majorana generators cac_aca​ satisfying cacb+cbca=2δabIc_ac_b+c_bc_a=2\delta_{ab}Ica​cb​+cb​ca​=2δab​I. The symbol map ω\omegaω sends each ordered Majorana monomial linearly to the corresponding ordered Grassmann monomial; it is not multiplicative. Gaussian states, operators, and maps have the meanings of Definitions 1–3 of the paper. All maps act on the full complex operator algebra, including its odd sector.

Let EEE have kernel parameters (A,B,D,C)(A,B,D,C)(A,B,D,C) and let XXX be a regular Gaussian operator with complex skew covariance MMM and Tr⁡X≠0\operatorname{Tr}X\ne0TrX=0. Then, without any inverse assumption,

Tr⁡(E(X))2=C2det⁡(I+MD)Tr⁡(X)2.\operatorname{Tr}(E(X))^2=C^2\det(I+MD)\operatorname{Tr}(X)^2.Tr(E(X))2=C2det(I+MD)Tr(X)2.

If det⁡M≠0\det M\ne0detM=0, the signed trace is

Tr⁡(E(X))=C(−1)nPf⁡(M)Pf⁡(M−1+D)Tr⁡(X).\operatorname{Tr}(E(X))=C(-1)^n\operatorname{Pf}(M)\operatorname{Pf}(M^{-1}+D)\operatorname{Tr}(X).Tr(E(X))=C(−1)nPf(M)Pf(M−1+D)Tr(X).

Independently of whether MMM is invertible, if det⁡(I+MD)≠0\det(I+MD)\ne0det(I+MD)=0 and C≠0C\ne0C=0, the output is regular with covariance

M′=B(I+MD)−1MBT+A.M'=B(I+MD)^{-1}MB^T+A.M′=B(I+MD)−1MBT+A.

On the further domain det⁡M≠0\det M\ne0detM=0, this also equals B(M−1+D)−1BT+AB(M^{-1}+D)^{-1}B^T+AB(M−1+D)−1BT+A. Covariance of a regular YYY means iTr⁡(Y[ca,cb])/(2Tr⁡Y)i\operatorname{Tr}(Y[c_a,c_b])/(2\operatorname{Tr}Y)iTr(Y[ca​,cb​])/(2TrY). All traces and squares here are complex algebraic quantities. These identities keep both output shape and its signed normalization.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intake100_P22
Formal statement
noncomputable section

open scoped BigOperators Matrix ComplexConjugate ComplexOrder

namespace QAlgorithms.Papers.Independent.Intake100.P22

open QAlgorithms.Papers.Independent.Advance50.P19
  (CARSystem Major monomial wick totalFermionParity)

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

attribute [local instance] Classical.propDecidable Classical.decEq

/-- PDF p.9, Eqs.(45)-(47): complex algebraic trace square, signed trace, and
regular covariance update. The two inverse domains are guarded separately.
C=0 is allowed in both trace identities but excluded for a regular output. -/
theorem covariance_and_trace {n : ℕ} (s : CARSystem n)
    (E : Superop (Qubits n) (Qubits n)) (K : GrassmannKernel n) (hE : HasGrassmannKernel s E K)
    (X : Op (Qubits n)) (M : Matrix (Major n) (Major n) ℂ) (hX : RegularWith s X M) :
    (E X).trace ^ 2 = K.C ^ 2 * (1 + M * K.D).det * X.trace ^ 2 ∧
    (M.det ≠ 0 → (E X).trace =
      K.C * (-1 : ℂ) ^ n * pfaffian M * pfaffian (M⁻¹ + K.D) * X.trace) ∧
    ((1 + M * K.D).det ≠ 0 → K.C ≠ 0 →
      RegularWith s (E X) (K.B * (1 + M * K.D)⁻¹ * M * K.B.transpose + K.A) ∧
      regularCorrelation s (E X) = K.B * (1 + M * K.D)⁻¹ * M * K.B.transpose + K.A ∧
      (M.det ≠ 0 →
        K.B * (M⁻¹ + K.D)⁻¹ * K.B.transpose + K.A =
          K.B * (1 + M * K.D)⁻¹ * M * K.B.transpose + K.A)) := by sorry

end QAlgorithms.Papers.Independent.Intake100.P22

end
Source
Lagrangian representation for fermionic linear optics, arXiv:quant-ph/0404180v2, PDF p. 9, §VI, Eqs.(45)–(47): covariance update and signed normalization
Read-back

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

For every natural number nnn, including 000, put Q={0,1}nQ=\{0,1\}^nQ={0,1}n and J={0,…,2n−1}J=\{0,\ldots,2n-1\}J={0,…,2n−1}. Let sss consist of Hermitian complex matrices cac_aca​, indexed by a∈Ja\in Ja∈J, acting on CQ\mathbb C^QCQ, with cacb+cbca=2δabIc_ac_b+c_bc_a=2\delta_{ab}Ica​cb​+cb​ca​=2δab​I. For S⊆JS\subseteq JS⊆J, let cSc_ScS​ be the product of its generators in increasing order, with c∅=Ic_\varnothing=Ic∅​=I, and define the Grassmann symbol of a matrix ZZZ by Z^=∑S⊆J2−ntr⁡(cS†Z)θS\widehat Z=\sum_{S\subseteq J}2^{-n}\operatorname{tr}(c_S^\dagger Z)\theta_SZ=∑S⊆J​2−ntr(cS†​Z)θS​. Here θS\theta_SθS​ is the increasing product of exterior generators; their multiplication has θUθV=0\theta_U\theta_V=0θU​θV​=0 when U∩V≠∅U\cap V\ne\varnothingU∩V=∅, and otherwise equals (−1)∣{(u,v)∈U×V:v<u}∣θU∪V(-1)^{|\{(u,v)\in U\times V:v<u\}|}\theta_{U\cup V}(−1)∣{(u,v)∈U×V:v<u}∣θU∪V​. In an exterior algebra on rrr generators, write exp⁡∧,r(q)=∑k=0rqk/k!\exp_{\wedge,r}(q)=\sum_{k=0}^{r}q^k/k!exp∧,r​(q)=∑k=0r​qk/k!. Let EEE be any map from complex Q×QQ\times QQ×Q matrices to themselves, and let K=(AK,BK,DK,CK)K=(A_K,B_K,D_K,C_K)K=(AK​,BK​,DK​,CK​), where AK,BK,DKA_K,B_K,D_KAK​,BK​,DK​ are complex J×JJ\times JJ×J matrices, AKT=−AKA_K^{\mathsf T}=-A_KAKT​=−AK​, DKT=−DKD_K^{\mathsf T}=-D_KDKT​=−DK​, and CK∈CC_K\in\mathbb CCK​∈C. Assume EEE is complex linear and, for every ZZZ, E(Z)^=TK(Z^)\widehat{E(Z)}=\mathcal T_K(\widehat Z)E(Z)​=TK​(Z), where, in three consecutively ordered blocks θ,η,ξ\theta,\eta,\xiθ,η,ξ, each indexed by JJJ,

TK(f)=CK[ηJξJ](exp⁡∧,6n ⁣(i2∑a,b(AK)abθaθb+i∑a,b(BK)abθaηb+i2∑a,b(DK)abηaηb+i∑aηaξa)f(ξ));\mathcal T_K(f) =C_K[\eta_J\xi_J]\left( \exp_{\wedge,6n}\!\left( \frac{i}{2}\sum_{a,b}(A_K)_{ab}\theta_a\theta_b +i\sum_{a,b}(B_K)_{ab}\theta_a\eta_b +\frac{i}{2}\sum_{a,b}(D_K)_{ab}\eta_a\eta_b +i\sum_a\eta_a\xi_a\right)f(\xi)\right);TK​(f)=CK​[ηJ​ξJ​]​exp∧,6n​​2i​a,b∑​(AK​)ab​θa​θb​+ia,b∑​(BK​)ab​θa​ηb​+2i​a,b∑​(DK​)ab​ηa​ηb​+ia∑​ηa​ξa​​f(ξ)​;

the bracket retains the coefficient of the product of all η\etaη- and ξ\xiξ-generators, leaving a polynomial in θ\thetaθ. Let XXX be any complex Q×QQ\times QQ×Q matrix and MMM any complex J×JJ\times JJ×J matrix satisfying

tr⁡X≠0,MT=−M,X^=tr⁡X2nexp⁡∧,2n ⁣(i2∑a,bMabθaθb).\operatorname{tr}X\ne0,\qquad M^{\mathsf T}=-M,\qquad \widehat X=\frac{\operatorname{tr}X}{2^n} \exp_{\wedge,2n}\!\left(\frac{i}{2}\sum_{a,b}M_{ab}\theta_a\theta_b\right).trX=0,MT=−M,X=2ntrX​exp∧,2n​​2i​a,b∑​Mab​θa​θb​​.

Then the following complex trace identities and conditional conclusions hold:

(tr⁡E(X))2=CK2det⁡(I+MDK)(tr⁡X)2,det⁡M≠0⟹tr⁡E(X)=CK(−1)npf⁡(M)pf⁡(M−1+DK)tr⁡X.\begin{aligned} (\operatorname{tr}E(X))^2 &=C_K^2\det(I+MD_K)(\operatorname{tr}X)^2,\\ \det M\ne0\quad&\Longrightarrow\quad \operatorname{tr}E(X) =C_K(-1)^n\operatorname{pf}(M)\operatorname{pf}(M^{-1}+D_K)\operatorname{tr}X. \end{aligned}(trE(X))2detM=0​=CK2​det(I+MDK​)(trX)2,⟹trE(X)=CK​(−1)npf(M)pf(M−1+DK​)trX.​

The squares here are ordinary complex squares, not squared absolute values. The Pfaffian is the alternating pairing expression: its value on the empty index list is 111, and on a list (a,b0,…,br−1)(a,b_0,\ldots,b_{r-1})(a,b0​,…,br−1​) it is ∑j=0r−1(−1)jMabj\sum_{j=0}^{r-1}(-1)^jM_{a b_j}∑j=0r−1​(−1)jMabj​​ times the corresponding expression after deleting a,bja,b_ja,bj​. If det⁡(I+MDK)≠0\det(I+MD_K)\ne0det(I+MDK​)=0 and CK≠0C_K\ne0CK​=0, put N=BK(I+MDK)−1MBKT+AKN=B_K(I+MD_K)^{-1}MB_K^{\mathsf T}+A_KN=BK​(I+MDK​)−1MBKT​+AK​; then tr⁡E(X)≠0\operatorname{tr}E(X)\ne0trE(X)=0, NT=−NN^{\mathsf T}=-NNT=−N, E(X)^=(tr⁡E(X)/2n)exp⁡∧,2n(i2∑a,bNabθaθb)\widehat{E(X)}=(\operatorname{tr}E(X)/2^n)\exp_{\wedge,2n}(\frac{i}{2}\sum_{a,b}N_{ab}\theta_a\theta_b)E(X)​=(trE(X)/2n)exp∧,2n​(2i​∑a,b​Nab​θa​θb​), and

i2tr⁡E(X)tr⁡ ⁣(E(X)(cacb−cbca))=Nab(a,b∈J).\frac{i}{2\operatorname{tr}E(X)} \operatorname{tr}\!\left(E(X)(c_ac_b-c_bc_a)\right)=N_{ab} \quad(a,b\in J).2trE(X)i​tr(E(X)(ca​cb​−cb​ca​))=Nab​(a,b∈J).

Under these same two conditions, det⁡M≠0\det M\ne0detM=0 additionally implies BK(M−1+DK)−1BKT+AK=NB_K(M^{-1}+D_K)^{-1}B_K^{\mathsf T}+A_K=NBK​(M−1+DK​)−1BKT​+AK​=N. No positivity or normalization of XXX is assumed. For n=0n=0n=0, the matrices indexed by JJJ are empty, their determinants and Pfaffians are 111, and the exterior products are empty products.

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