Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Appendix B, (31): second moment of a random normalized code projector

Open
QAlgorithms.Papers.Independent.Advance50.P29.normalizedProjectionMoment

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

prove2quantum

Let QQQ and Q′Q^{\prime}Q′ be finite complex Hilbert spaces of positive dimensions MMM and DDD. A density operator is positive semidefinite with trace one. All logarithms and entropies are in bits. Write π=IQ/M\pi=I_Q/Mπ=IQ​/M. For a nonzero code subspace C⊂QC\subset QC⊂Q of dimension KKK, let πC=ΠC/K\pi_C=\Pi_C/KπC​=ΠC​/K. Write Fe(C,N)=max⁡RFe(πC,R∘N)F_e(C,\mathcal N)=\max_{\mathcal R}F_e(\pi_C,\mathcal R\circ\mathcal N)Fe​(C,N)=maxR​Fe​(πC​,R∘N), where R:B(Q′)→B(Q)\mathcal R:B(Q^{\prime})\to B(Q)R:B(Q′)→B(Q) ranges over all CPTP recovery maps and state entanglement fidelity is squared and unconditional. Fix any KKK-dimensional seed code C0C_0C0​ and average C=UC0C=UC_0C=UC0​ over normalized Haar measure on the entire unitary group of QQQ; denote this expectation by [ ⋅ ]K[\,\cdot\,]_K[⋅]K​. All displayed Haar integrands are integrable. For any fixed unit vector ∣ψ⟩∈Q|\psi\rangle\in Q∣ψ⟩∈Q,

[∣⟨ψ∣πC∣ψ⟩∣2]K=1+K−1M2+M.[|\langle\psi|\pi_C|\psi\rangle|^2]_K=\frac{1+K^{-1}}{M^2+M}.[∣⟨ψ∣πC​∣ψ⟩∣2]K​=M2+M1+K−1​.

This exact normalized-projector moment is independent of the chosen unit vector and seed code.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Advance50_P29
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Advance50.P29

open QAlgorithms MeasureTheory Filter

open QAlgorithms.Papers.Independent.Information100.P22
  (densityPurification coherentInformation singleUseInformation mixed)

open QAlgorithms.Papers.Independent.Information100.P27 (shannon)

open QAlgorithms.Papers.Independent.Dependency50.P48 (wordProbability)

open QAlgorithms.Papers.Independent.Bridge50.P43 (tensorDensity)

open scoped Matrix ComplexConjugate ComplexOrder Topology

attribute [local instance] Classical.propDecidable

variable {I J E L : Type} [Fintype I] [DecidableEq I]

variable [Fintype J] [DecidableEq J] [Fintype E] [DecidableEq E]

variable [Fintype L] [DecidableEq L]

/-- PDF pp.20–21, (31): exact second moment of a normalized random code projection. -/
theorem normalizedProjectionMoment [Nonempty I] (C : CodeProjection I)
    (psi : EuclideanSpace ℂ I) (hpsi : ‖psi‖ = 1) :
    Integrable (fun U => Complex.normSq ((pureDensity psi * rotatedDensity C U).trace))
      (Schur.unitaryHaar (Fintype.card I)) ∧
    codeAverage C (fun rho => Complex.normSq ((pureDensity psi * rho).trace)) =
      (1 + (C.dimension : ℝ)⁻¹) /
        ((Fintype.card I : ℝ) ^ 2 + (Fintype.card I : ℝ)) := by sorry

end QAlgorithms.Papers.Independent.Advance50.P29

end
Source
A random-coding based proof for the quantum coding theorem, arXiv:0712.2558v1, PDF p. 20, Appendix B, (31): second moment of a random normalized code projector
Read-back

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

Let III be a nonempty finite type with decidable equality, write D=∣I∣D=|I|D=∣I∣, and let CCC consist of an integer KKK and a matrix PCP_CPC​ satisfying 1≤K≤D1\le K\le D1≤K≤D, PC†=PCP_C^\dagger=P_CPC†​=PC​, PC2=PCP_C^2=P_CPC2​=PC​, and tr⁡PC=K\operatorname{tr}P_C=KtrPC​=K. Let ψ∈CI\psi\in\mathbb C^Iψ∈CI satisfy ∥ψ∥=1\|\psi\|=1∥ψ∥=1, and put ρC=PC/K\rho_C=P_C/KρC​=PC​/K. For U∈U(D)U\in U(D)U∈U(D), use the chosen finite enumeration e:I→{0,…,D−1}e:I\to\{0,\ldots,D-1\}e:I→{0,…,D−1} to define U^ij=Ue(i),e(j)\widehat U_{ij}=U_{e(i),e(j)}Uij​=Ue(i),e(j)​, and set ρU=U^ρCU^†\rho_U=\widehat U\rho_C\widehat U^\daggerρU​=UρC​U†. With normalized Haar probability measure on U(D)U(D)U(D), the real function U↦∣tr⁡(∣ψ⟩⟨ψ∣ρU)∣2U\mapsto|\operatorname{tr}(|\psi\rangle\langle\psi|\rho_U)|^2U↦∣tr(∣ψ⟩⟨ψ∣ρU​)∣2, where (∣ψ⟩⟨ψ∣)ij=ψiψj‾(|\psi\rangle\langle\psi|)_{ij}=\psi_i\overline{\psi_j}(∣ψ⟩⟨ψ∣)ij​=ψi​ψj​​, is integrable and satisfies

∫U(D)∣tr⁡(∣ψ⟩⟨ψ∣ρU)∣2 dU=1+K−1D2+D.\int_{U(D)}|\operatorname{tr}(|\psi\rangle\langle\psi|\rho_U)|^2\,dU =\frac{1+K^{-1}}{D^2+D}.∫U(D)​∣tr(∣ψ⟩⟨ψ∣ρU​)∣2dU=D2+D1+K−1​.

The allowed dimensions include K=1K=1K=1, K=DK=DK=D, and D=1D=1D=1.

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