Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 2: two-copy invariant purity classifier

Proved
QAlgorithms.Papers.Independent.Advance50.P50.theorem2

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

prove2quantum

An nnn-qubit input ρ\rhoρ is a positive semidefinite, trace-one matrix on the fixed computational basis, of dimension d=2nd=2^nd=2n. A kkk-copy model has a fixed input-independent unitary UUU, a Hermitian observable OOO, effective observable O~=U†OU\widetilde O=U^\dagger O UO=U†OU, and exact response h(ρ)=Tr⁡[Uρ⊗kU†O]h(\rho)=\operatorname{Tr}[U\rho^{\otimes k}U^\dagger O]h(ρ)=Tr[Uρ⊗kU†O]. Fix n≥1n\ge1n≥1, d=2nd=2^nd=2n, and 1/d≤b<11/d\le b<11/d≤b<1, with nonempty classes of purity 111 and bbb. Write RbR_bRb​ for their union and p(ρ)=Tr⁡(ρ2)p(\rho)=\operatorname{Tr}(\rho^2)p(ρ)=Tr(ρ2). For every pair of fixed real numbers a,sa,sa,s, there exists a two-copy model satisfying

O~=aI+s SWAP,h(ρ)=a+sTr⁡(ρ2).\widetilde O=aI+s\,\mathrm{SWAP},\qquad h(\rho)=a+s\operatorname{Tr}(\rho^2).O=aI+sSWAP,h(ρ)=a+sTr(ρ2).

It is U(d)U(d)U(d)-invariant on all density matrices. If s≠0s\ne0s=0, its exact output sets for the two purity classes are disjoint. The choice (a,s)=(0,1)(a,s)=(0,1)(a,s)=(0,1) returns purity exactly. There is no gate-count or finite-shot claim.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Advance50_P50
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Advance50.P50

open MeasureTheory ProbabilityTheory

open scoped ComplexConjugate ENNReal

-- Exact accepted primitives; no paper-local redeclarations.

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

open QAlgorithms.Papers.Independent.Gap48.P20 (Copies)

open QAlgorithms.Papers.Independent.Gap48.P38 (subsystemReduction)

open QAlgorithms.Papers.Independent.Information100.P32 (purity)

open QAlgorithms.Papers.Independent.Information100.P08 (IsPure)

-- Matrices carry the associative commutator bracket X*Y-Y*X.

attribute [local instance 100] LieRing.ofAssociativeRing

/-- PDF pp.7–8, Theorem 2 and Eq.(15): all real affine combinations are
realizable, invariant, and separating when the swap coefficient is nonzero.
The coefficient choice (0,1) gives purity exactly. -/
theorem theorem2 {n : ℕ} (hn : 1 ≤ n) (b : ℝ)
    (hb : 1 / (2 : ℝ) ^ n ≤ b ∧ b < 1)
    (hpure : ∃ rho : Mat (Qubits n), IsDensityMatrix rho ∧ purity rho = 1)
    (hmixed : ∃ rho : Mat (Qubits n), IsDensityMatrix rho ∧ purity rho = b) :
    ∀ a s : ℝ, ∃ M : ExpectationModel (Qubits n) 2,
      M.effective = (a : ℂ) • 1 + (s : ℂ) • copySwap (Qubits n) ∧
      DomainInvariant (Matrix.unitaryGroup (Qubits n) ℂ : Set (Mat (Qubits n)))
        {rho | IsDensityMatrix rho} M.response ∧
      (∀ rho, IsDensityMatrix rho → M.response rho = a + s * purity rho) ∧
      (s ≠ 0 → SeparatesPurity b M.response) := by sorry

end QAlgorithms.Papers.Independent.Advance50.P50

end
Source
Group-Invariant Quantum Machine Learning, arXiv:2205.02261v2, PDF p. 7, Theorem 2: two-copy invariant purity classifier
Read-back

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

For every integer n≥1n\ge1n≥1 and real bbb with 2−n≤b<12^{-n}\le b<12−n≤b<1, assume there exist positive semidefinite trace-one matrices of purity 111 and of purity bbb, respectively, where purity means Re⁡tr⁡(ρ2)\operatorname{Re}\operatorname{tr}(\rho^2)Retr(ρ2). For every pair of real numbers a,sa,sa,s, there exist a unitary UUU and a Hermitian observable OOO on two copies of the nnn-qubit space such that

U†OU=aI+sS,U^\dagger OU=aI+sS,U†OU=aI+sS,

where S∣x0,x1⟩=∣x1,x0⟩S|x_0,x_1\rangle=|x_1,x_0\rangleS∣x0​,x1​⟩=∣x1​,x0​⟩ exchanges the two copies. Their response h(ρ)=Re⁡tr⁡(U(ρ⊗ρ)U†O)h(\rho)=\operatorname{Re}\operatorname{tr}(U(\rho\otimes\rho)U^\dagger O)h(ρ)=Retr(U(ρ⊗ρ)U†O) satisfies h(VρV†)=h(ρ)h(V\rho V^\dagger)=h(\rho)h(VρV†)=h(ρ) for every unitary VVV and every positive semidefinite trace-one ρ\rhoρ, and satisfies h(ρ)=a+s Re⁡tr⁡(ρ2)h(\rho)=a+s\,\operatorname{Re}\operatorname{tr}(\rho^2)h(ρ)=a+sRetr(ρ2) for every such ρ\rhoρ. If s≠0s\ne0s=0, then h(ρ)≠h(σ)h(\rho)\ne h(\sigma)h(ρ)=h(σ) for every pair of positive semidefinite trace-one matrices with purities 111 and bbb, respectively. The existence and response assertions also apply when s=0s=0s=0; only the final separation assertion is conditional on s≠0s\ne0s=0.

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

    Confirmed by the moderator at approval.

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