Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Z2 analytic symmetry example

Proved
QAlgorithms.Papers.Independent.Extend50.P47.z2_example

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

prove2quantum

Every register has a fixed finite nonempty computational basis. States are positive semidefinite trace-one matrices, and pure vectors have norm one. Write F(ρ,σ)=∥ρσ∥12F(\rho,\sigma)=\|\sqrt\rho\sqrt\sigma\|_1^2F(ρ,σ)=∥ρ​σ​∥12​ for squared fidelity. Here GGG is a finite group and UUU denotes its specified unitary representation. Raw Bose averages Π=∣G∣−1∑gU(g)\Pi=|G|^{-1}\sum_gU(g)Π=∣G∣−1∑g​U(g) use an ordinary representation; conjugation symmetry permits a projective representation.

For U(e)=I,U(g)=Pauli Z on one qubit, Π=|0⟩⟨0|; Bose symmetry means ρ=|0⟩⟨0|, while conjugation symmetry means ρ is diagonal in the computational basis.

Π=I+Z2=∣0⟩⟨0∣,pacc(ρ)=ρ00,ρ∈B ⁣-Sym  ⟺  ρ=∣0⟩⟨0∣.\Pi=\frac{I+Z}{2}=|0\rangle\langle0|,\qquad p_{\rm acc}(\rho)=\rho_{00},\qquad\rho\in\mathrm{B\!\text{-}Sym}\iff\rho=|0\rangle\langle0|.Π=2I+Z​=∣0⟩⟨0∣,pacc​(ρ)=ρ00​,ρ∈B-Sym⟺ρ=∣0⟩⟨0∣.

The formula gives the exact characterization or operational specialization described in the cited result.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Extend50_P47
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Extend50.P47

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

open MeasureTheory

open QAlgorithms.Papers.Independent.Information100.P60 (Mat)

open QAlgorithms.Papers.Independent.Information100.P56 (normalizedChoi)

variable {G S R P T A B C D R2 S2 : Type*}

variable [Fintype G] [Group G] [DecidableEq G]

variable [Fintype S] [DecidableEq S] [Nonempty S]

variable [Fintype R] [DecidableEq R] [Nonempty R]

variable [Fintype P] [DecidableEq P] [Nonempty P]

variable [Fintype T] [DecidableEq T] [Nonempty T]

variable [Fintype A] [DecidableEq A] [Nonempty A]

variable [Fintype B] [DecidableEq B] [Nonempty B]

variable [Fintype C] [DecidableEq C] [Nonempty C]

variable [Fintype D] [DecidableEq D] [Nonempty D]

variable [Fintype R2] [DecidableEq R2] [Nonempty R2]

variable [Fintype S2] [DecidableEq S2] [Nonempty S2]

/-- PDF p.20, Z2 example: the analytic projector and its exact test. -/
theorem z2_example :
    ((1 / 2 : ℂ) • ((1 : Mat Bool) + pauliZ)) = Matrix.single false false 1 ∧
    ∀ rho : Mat Bool, IsDensityMatrix rho →
      controlReturnProbability ((1 / 2 : ℂ) • ((1 : Mat Bool) + pauliZ)) rho = (rho false false).re ∧
      (Bose ((1 / 2 : ℂ) • ((1 : Mat Bool) + pauliZ)) rho ↔
        rho = Matrix.single false false 1) ∧
      (Sym (fun g : Bool => if g then pauliZ else 1) rho ↔
        ∀ i j, i ≠ j → rho i j = 0) := by sorry

end QAlgorithms.Papers.Independent.Extend50.P47

end
Source
Testing symmetry on quantum computers, arXiv:2105.12758v3, PDF p. 20, Z2 analytic symmetry example
Read-back

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

On the two-dimensional space indexed by {false,true}\{\mathrm{false},\mathrm{true}\}{false,true}, let Z=diag⁡(1,−1)Z=\operatorname{diag}(1,-1)Z=diag(1,−1) and Q=(I+Z)/2Q=(I+Z)/2Q=(I+Z)/2. Then Q=∣false⟩⟨false∣Q=|\mathrm{false}\rangle\langle\mathrm{false}|Q=∣false⟩⟨false∣, the matrix whose only nonzero entry is a one at (false,false)(\mathrm{false},\mathrm{false})(false,false). For every positive semidefinite complex matrix ρ\rhoρ of trace one,

Re⁡tr⁡(Q†Qρ)=Re⁡ρfalse,false.\operatorname{Re}\operatorname{tr}(Q^\dagger Q\rho) =\operatorname{Re}\rho_{\mathrm{false},\mathrm{false}}.Retr(Q†Qρ)=Reρfalse,false​.

Moreover, the conjunction that ρ\rhoρ is a density matrix and ρ=QρQ\rho=Q\rho Qρ=QρQ holds if and only if ρ=∣false⟩⟨false∣\rho=|\mathrm{false}\rangle\langle\mathrm{false}|ρ=∣false⟩⟨false∣; and the conjunction that ρ\rhoρ is a density matrix and ρ=UgρUg†\rho=U_g\rho U_g^\daggerρ=Ug​ρUg†​ for both Boolean values ggg, where Ufalse=IU_{\mathrm{false}}=IUfalse​=I and Utrue=ZU_{\mathrm{true}}=ZUtrue​=Z, holds if and only if every off-diagonal entry of ρ\rhoρ is zero.

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