Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proposition 2 (Twirling formula [41])

Open
QAlgorithms.Papers.Independent.Extend50.P01.finite_twirl_projection

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

prove2quantum

Let SSS be a finite group with unitary representation UUU on nnn qubits. For every complex operator XXX, define T(X)=∣S∣−1∑sUsXUs†T(X)=|S|^{-1}\sum_sU_sXU_s^\daggerT(X)=∣S∣−1∑s​Us​XUs†​. This map is complex-linear and satisfies

T2=T,range⁡T={X:[X,Us]=0 for every s},T(X)=X  ⟺  ∀s, [X,Us]=0.T^2=T,\qquad\operatorname{range}T=\{X:[X,U_s]=0\text{ for every }s\},\qquad T(X)=X\iff\forall s,\ [X,U_s]=0.T2=T,rangeT={X:[X,Us​]=0 for every s},T(X)=X⟺∀s, [X,Us​]=0.

In particular T(X)T(X)T(X) always commutes with every represented symmetry. These conclusions specify a projection onto the whole commutant, including the pointwise fixed property, for arbitrary operators rather than only Hermitian inputs.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Extend50_P01
Formal statement
noncomputable section

open scoped Matrix Kronecker ComplexConjugate Matrix.Norms.L2Operator Manifold ContDiff

open MeasureTheory

namespace QAlgorithms.Papers.Independent.Extend50.P01

attribute [local instance] Classical.propDecidable Classical.decEq

-- PDF pp.3,8: reuse the accepted operator type, exp(-itH), and A X A†.
-- Notation specializes the imported interfaces without introducing duplicate declarations.

local notation "Op" => (fun n : ℕ => QAlgorithms.Papers.Independent.Information100.P21.Op (Qubits n))

local notation "evolve" => QAlgorithms.Papers.Independent.Information100.P32.evolution

local notation "conjugate" => QAlgorithms.conjSuperop

-- PDF pp.3,10–11: the imported quadratic form is Re(psi† A psi).

local notation "expectation" => QAlgorithms.Papers.Independent.Information100.P21.quad

-- PDF pp.5,16–19: accepted active-wire operator, with identities on all spectators.

local notation "onWire" => QAlgorithms.Papers.Independent.Advance50.P49.onWire

-- PDF p.5: the imported phase-free Pauli tensor uses 0=I,1=X,2=Y,3=Z.

local notation "pauliWord" => QAlgorithms.Papers.Independent.Gap48.P33.pauliWord

/-- PDF p.8, Proposition 2: complex-linear idempotent with exact range and fixed points. -/
theorem finite_twirl_projection {S : Type*} [Group S] [Fintype S]
    (n : ℕ) (U : S →* Op n) (hU : ∀ s, U s ∈ Matrix.unitaryGroup (Qubits n) ℂ) :
    (∀ X Y, finiteTwirl U (X + Y) = finiteTwirl U X + finiteTwirl U Y) ∧
    (∀ (c : ℂ) X, finiteTwirl U (c • X) = c • finiteTwirl U X) ∧
    (∀ X, finiteTwirl U (finiteTwirl U X) = finiteTwirl U X) ∧
    Set.range (finiteTwirl U) = {X | ∀ s, Commute X (U s)} ∧
    (∀ X, finiteTwirl U X = X ↔ ∀ s, Commute X (U s)) ∧
    (∀ X s, Commute (finiteTwirl U X) (U s)) := by sorry

end QAlgorithms.Papers.Independent.Extend50.P01

end
Source
Exploiting symmetry in variational quantum machine learning, arXiv:2205.06217v1, PDF p. 8, Proposition 2 (Twirling formula [41])
Read-back

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

For every finite group SSS, every natural number nnn, and every multiplicative map U:S→M{0,1}n(C)U:S\to M_{\{0,1\}^n}(\mathbb C)U:S→M{0,1}n​(C) satisfying U(1)=IU(1)=IU(1)=I, U(st)=U(s)U(t)U(st)=U(s)U(t)U(st)=U(s)U(t), and unitarity of every U(s)U(s)U(s), define

T(X)=1∣S∣∑s∈SU(s)XU(s)†.\mathcal T(X)=\frac1{|S|}\sum_{s\in S}U(s)XU(s)^\dagger.T(X)=∣S∣1​s∈S∑​U(s)XU(s)†.

Then for all complex matrices X,YX,YX,Y indexed by nnn-bit strings and all c∈Cc\in\mathbb Cc∈C, T(X+Y)=T(X)+T(Y)\mathcal T(X+Y)=\mathcal T(X)+\mathcal T(Y)T(X+Y)=T(X)+T(Y), T(cX)=cT(X)\mathcal T(cX)=c\mathcal T(X)T(cX)=cT(X), and T(T(X))=T(X)\mathcal T(\mathcal T(X))=\mathcal T(X)T(T(X))=T(X). Its range is exactly {X:∀s, XU(s)=U(s)X}\{X:\forall s,\ XU(s)=U(s)X\}{X:∀s, XU(s)=U(s)X}; for every XXX, T(X)=X\mathcal T(X)=XT(X)=X if and only if XXX commutes with every U(s)U(s)U(s); and every T(X)\mathcal T(X)T(X) commutes with every U(s)U(s)U(s). The group is necessarily nonempty, so ∣S∣>0|S|>0∣S∣>0; n=0n=0n=0 is allowed.

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

    Confirmed by the moderator at approval.

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