Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proposition 1: covariance of every (n,k,α)-code

Proved
QAlgorithms.Papers.Independent.Extend50.P03.code_covariant

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

prove2quantum

A code encodes kkk logical qubits in nnn physical qubits, with 0≤k≤n0\le k\le n0≤k≤n, by appending a fixed normalized (n−k)(n-k)(n−k)-qubit eigenvector ψα\psi_\alphaψα​ of the Hamming-weight charge Q(n−k)Q^{(n-k)}Q(n−k) with eigenvalue 0≤α≤n−k0\le\alpha\le n-k0≤α≤n−k, then applying UUU. Thus EU(ρ)=U(ρ⊗∣ψα⟩⟨ψα∣)U†\mathcal E_U(\rho)=U(\rho\otimes|\psi_\alpha\rangle\langle\psi_\alpha|)U^\daggerEU​(ρ)=U(ρ⊗∣ψα​⟩⟨ψα​∣)U†. The ancilla is chosen independently of UUU. The law H×H_\timesH×​ is probability Haar on the full charge centralizer, including every sector phase. Erasure of a set SSS of t≤nt\le nt≤n wires gives its complement to the decoder. Fidelity FFF means root fidelity and P=1−F2P=\sqrt{1-F^2}P=1−F2​. The optimized Choi error uses normalized kkk EPR pairs; the optimized worst error chooses one CPTP decoder before all normalized joint logical/reference states over every finite reference dimension. For every charge-commuting unitary UUU, every real θ\thetaθ, and every logical density matrix ρ\rhoρ,

EU(eiθQ(k)ρe−iθQ(k))=eiθQ(n)EU(ρ)e−iθQ(n).\mathcal E_U(e^{i\theta Q^{(k)}}\rho e^{-i\theta Q^{(k)}})=e^{i\theta Q^{(n)}}\mathcal E_U(\rho)e^{-i\theta Q^{(n)}}.EU​(eiθQ(k)ρe−iθQ(k))=eiθQ(n)EU​(ρ)e−iθQ(n).

This exact channel covariance holds for every sample of the random-code construction. The ancilla phase eiθαe^{i\theta\alpha}eiθα cancels at the density-matrix level.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Extend50_P03
Formal statement
noncomputable section

open MeasureTheory Filter

open scoped Matrix ComplexConjugate ComplexOrder ENNReal Matrix.Norms.Elementwise

namespace QAlgorithms.Papers.Independent.Extend50.P03

open QAlgorithms.Papers.Independent.Support50.P23 (minEntropy)

attribute [local instance] Classical.propDecidable

attribute [local instance] QAlgorithms.Papers.Independent.Extend50.P03.matrixContinuousENorm

/-- Proposition 1, PDF p.7: every constructed code is channel-covariant;
no false phase-free vector intertwining is required. -/
theorem code_covariant {n k alpha : ℕ} (A : Ancilla n k alpha)
    (U : (Matrix.unitaryGroup (Qubits n) ℂ)) (hU : Conserves U) : U1ChargeCovariant (chargeEncoder A U) := by sorry

end QAlgorithms.Papers.Independent.Extend50.P03

end
Source
Charge-conserving unitaries typically generate optimal covariant quantum error-correcting codes, arXiv:2102.11835v1, PDF p. 7, Proposition 1: covariance of every (n,k,α)-code
Read-back

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

For all natural numbers n,k,αn,k,\alphan,k,α, suppose k≤nk\leq nk≤n, α≤n−k\alpha\leq n-kα≤n−k, and an ancilla vector ψ∈CQn−k\psi\in\mathbb C^{Q_{n-k}}ψ∈CQn−k​ has norm 111 and satisfies Hn−kψ=αψH_{n-k}\psi=\alpha\psiHn−k​ψ=αψ, where Qs={0,1}sQ_s=\{0,1\}^sQs​={0,1}s and HsH_sHs​ is diagonal with entry equal to the number of true bits of its index. For every unitary UUU on CQn\mathbb C^{Q_n}CQn​ satisfying UHn=HnUUH_n=H_nUUHn​=Hn​U, the map

C(X)=U(X⊗∣ψ⟩⟨ψ∣)U†,\mathcal C(X)=U\bigl(X\otimes|\psi\rangle\langle\psi|\bigr)U^\dagger,C(X)=U(X⊗∣ψ⟩⟨ψ∣)U†,

using the first kkk qubits for XXX and the remaining n−kn-kn−k for ψ\psiψ, obeys

C ⁣(Rk(θ)ρRk(θ)†)=Rn(θ)C(ρ)Rn(θ)†\mathcal C\!\left(R_k(\theta)\rho R_k(\theta)^\dagger\right) =R_n(\theta)\mathcal C(\rho)R_n(\theta)^\daggerC(Rk​(θ)ρRk​(θ)†)=Rn​(θ)C(ρ)Rn​(θ)†

for every real θ\thetaθ and every positive semidefinite matrix ρ\rhoρ of trace 111 on QkQ_kQk​, where Rs(θ)R_s(\theta)Rs​(θ) is diagonal with entry eiθ∣x∣e^{i\theta|x|}eiθ∣x∣ at x∈Qsx\in Q_sx∈Qs​. Zero values of n,k,αn,k,\alphan,k,α are included whenever the stated ancilla conditions hold.

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