Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eq.(35): averaged single-site impurity

Open
QAlgorithms.Papers.Independent.Advance50.P50.global_impurity

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]. Let ρ=∣ψ⟩⟨ψ∣\rho=|\psi\rangle\langle\psi|ρ=∣ψ⟩⟨ψ∣ be a pure nnn-qubit density matrix with ∥ψ∥=1\|\psi\|=1∥ψ∥=1, and let ρQ=Tr⁡S∖Qρ\rho_Q=\operatorname{Tr}_{S\setminus Q}\rhoρQ​=TrS∖Q​ρ for S={1,…,n}S=\{1,\ldots,n\}S={1,…,n}. For two copies, SQS_QSQ​ swaps the copies at precisely the sites in QQQ and acts as identity elsewhere. Assume n≥1n\ge1n≥1 and O~=(2/n)∑j∈S(I−S{j})\widetilde O=(2/n)\sum_{j\in S}(I-S_{\{j\}})O=(2/n)∑j∈S​(I−S{j}​). Then

h(ρ)=2n∑j∈S(1−Tr⁡(ρ{j}2)).h(\rho)=\frac2n\sum_{j\in S}\bigl(1-\operatorname{Tr}(\rho_{\{j\}}^2)\bigr).h(ρ)=n2​j∈S∑​(1−Tr(ρ{j}2​)).

This response is zero exactly when ρ\rhoρ is fully product and strictly positive otherwise. It detects every nonproduct pure state, including states that factor across some nontrivial bipartition; no constant response on an arbitrary fixed-EEE class is asserted.

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.13–14, Eq.(35): averaged impurity, zero exactly on fully product
pure states and positive on every other pure state (including biseparable states). -/
theorem global_impurity {n : ℕ} (hn : 1 ≤ n) (M : ExpectationModel (Qubits n) 2)
    (hobs : M.effective = globalImpurityObservable n)
    (rho : Mat (Qubits n)) (hpure : IsPure rho) :
    M.response rho = (2 / (n : ℝ)) * ∑ j : Fin n, (1 - purity (subsystemReduction (fun _ => Bool) rho {j})) ∧
    (M.response rho = 0 ↔ FullyProduct rho) ∧
    (¬ FullyProduct rho → 0 < M.response rho) := by sorry

end QAlgorithms.Papers.Independent.Advance50.P50

end
Source
Group-Invariant Quantum Machine Learning, arXiv:2205.02261v2, PDF p. 13, Eq.(35): averaged single-site impurity
Read-back

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

Let n≥1n\ge1n≥1 be an integer, and let MMM consist of a unitary UUU and a Hermitian observable OOO on two nnn-qubit copies, with

U†OU=2n∑j<n(I−S{j}),U^\dagger OU=\frac2n\sum_{j<n}(I-S_{\{j\}}),U†OU=n2​j<n∑​(I−S{j}​),

where S{j}S_{\{j\}}S{j}​ exchanges the two copies’ bits at site jjj. For every pure matrix ρ=∣ψ⟩⟨ψ∣\rho=|\psi\rangle\langle\psi|ρ=∣ψ⟩⟨ψ∣ with ∥ψ∥=1\|\psi\|=1∥ψ∥=1, define h(ρ)=Re⁡tr⁡(U(ρ⊗ρ)U†O)h(\rho)=\operatorname{Re}\operatorname{tr}(U(\rho\otimes\rho)U^\dagger O)h(ρ)=Retr(U(ρ⊗ρ)U†O). Then

h(ρ)=2n∑j<n(1−Re⁡tr⁡(ρ{j}2)).h(\rho)=\frac2n\sum_{j<n}\left(1-\operatorname{Re}\operatorname{tr}(\rho_{\{j\}}^2)\right).h(ρ)=n2​j<n∑​(1−Retr(ρ{j}2​)).

Each ρ{j}\rho_{\{j\}}ρ{j}​ is obtained by summing matrix entries over matching assignments on all sites other than jjj. Moreover, h(ρ)=0h(\rho)=0h(ρ)=0 if and only if there exist unit single-qubit vectors ϕj\phi_jϕj​ such that ρ=∣⨂j<nϕj⟩⟨⨂j<nϕj∣\rho=|\bigotimes_{j<n}\phi_j\rangle\langle\bigotimes_{j<n}\phi_j|ρ=∣⨂j<n​ϕj​⟩⟨⨂j<n​ϕj​∣, and failure of this product representation implies 0<h(ρ)0<h(\rho)0<h(ρ). The hypothesis n≥1n\ge1n≥1 excludes division by zero.

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