Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Appendix D: averaged basis outputs and worst averaged-state error

Open
QAlgorithms.Papers.Independent.Extend50.P03.average_worst_state

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. The actual integrable Haar average of EU(∣x⟩⟨y∣)\mathcal E_U(|x\rangle\langle y|)EU​(∣x⟩⟨y∣) is zero for x≠yx\ne yx=y and Π∣x∣+α(n)/(n∣x∣+α)\Pi_{|x|+\alpha}^{(n)}/\binom n{|x|+\alpha}Π∣x∣+α(n)​/(∣x∣+αn​) for x=yx=yx=y. Its first-ttt-wire marginal is ρavgx,x=∑i=0tΠi(t)(n−t∣x∣+α−i)/(n∣x∣+α)\rho_{\rm avg}^{x,x}=\sum_{i=0}^t\Pi_i^{(t)}\binom{n-t}{|x|+\alpha-i}/\binom n{|x|+\alpha}ρavgx,x​=∑i=0t​Πi(t)​(∣x∣+α−in−t​)/(∣x∣+αn​). Let ζ=∑iβiΠi(t)\zeta=\sum_i\beta_i\Pi_i^{(t)}ζ=∑i​βi​Πi(t)​, where βi\beta_iβi​ is the Eq.(27) coefficient, independent of xxx. Then

F(ρavgx,x,ζ)=∑i=0t(ti)βi(n−t∣x∣+α−i)(n∣x∣+α).F(\rho_{\rm avg}^{x,x},\zeta)=\sum_{i=0}^t\binom ti\sqrt{\beta_i\frac{\binom{n-t}{|x|+\alpha-i}}{\binom n{|x|+\alpha}}}.F(ρavgx,x​,ζ)=i=0∑t​(it​)βi​(∣x∣+αn​)(∣x∣+α−in−t​)​​.

For fixed a∈(0,1)a\in(0,1)a∈(0,1), exact α=an\alpha=anα=an, and kt2/n→0kt^2/n\to0kt2/n→0 with k,t≥1k,t\ge1k,t≥1, uniformly eventually ∣max⁡xP(ρavgx,x,ζ)/(kt/(4na(1−a)))−1∣≤Ckt2/n\left|\max_xP(\rho_{\rm avg}^{x,x},\zeta)/(k\sqrt t/(4n\sqrt{a(1-a)}))-1\right|\le Ckt^2/n​maxx​P(ρavgx,x​,ζ)/(kt​/(4na(1−a)​))−1​≤Ckt2/n. This is an auxiliary averaged-basis error, distinct from reference-assisted channel worst error.

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

/-- Appendix D, PDF p.25: actual averaged basis matrix units, exact root
fidelity, and the auxiliary worst averaged-state expansion. The last printed
'1+(kt^2/n)' is changed to 1+O(kt^2/n): the cited Eq.(29)
has an asymptotic remainder and does not imply a finite exact coefficient. -/
theorem average_worst_state :
    (∀ n k alpha t : ℕ, ∀ A : Ancilla n k alpha, ∀ ht : t ≤ n,
      ∀ mu : Measure ((Matrix.unitaryGroup (Qubits n) ℂ)), ChargeHaar n mu → ∀ x y : Qubits k,
      let full := fun U => chargeEncoder A U (Matrix.single x y 1)
      let f := fun U => firstTrace n t ht (full U)
      Integrable full mu ∧ (∫ U, full U ∂mu) = averageEncodedUnit n alpha x y ∧
      Integrable f mu ∧ (∫ U, f U ∂mu) = averageMatrixUnit n alpha t x y) ∧
    (∀ n k alpha t : ℕ, k ≤ n → alpha ≤ n-k → t ≤ n → ∀ x : Qubits k,
      rootFidelity (averageBasis n alpha t x) (averageZeta n k alpha t) =
        ∑ i ∈ Finset.range (t+1), (t.choose i : ℝ) *
          Real.sqrt (averageSectorWeight n k alpha t i * chooseZ (n-t) ((hammingWeight x : ℤ)+alpha-i) /
            chooseZ n ((hammingWeight x : ℤ)+alpha))) ∧
    AverageWorstExpansion := 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. 25, Appendix D: averaged basis outputs and worst averaged-state error
Read-back

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

The declaration asserts the conjunction of three statements. To specify them, write Bj={0,1}j\mathcal B_j=\{0,1\}^jBj​={0,1}j, let ∣x∣|x|∣x∣ denote Hamming weight, let Qj,qQ_{j,q}Qj,q​ be the diagonal matrix on Bj\mathcal B_jBj​ whose diagonal entry at zzz is 111 if ∣z∣=q|z|=q∣z∣=q and 000 otherwise, and let (jq)0\binom jq_0(qj​)0​ equal the usual binomial coefficient for integer 0≤q≤j0\le q\le j0≤q≤j and 000 otherwise. For admissible k≤nk\le nk≤n, α≤n−k\alpha\le n-kα≤n−k, and t≤nt\le nt≤n, define

Bx=∑i=0t(n−t∣x∣+α−i)0(n∣x∣+α)0 Qt,i,wi=2−k∑j=0k(kj)(n−tj+α−i)0(nj+α)0,Z=∑i=0twiQt,i.B_x=\sum_{i=0}^{t} \frac{\binom{n-t}{|x|+\alpha-i}_0}{\binom n{|x|+\alpha}_0}\,Q_{t,i}, \qquad w_i=2^{-k}\sum_{j=0}^{k}\binom kj \frac{\binom{n-t}{j+\alpha-i}_0}{\binom n{j+\alpha}_0}, \qquad Z=\sum_{i=0}^{t}w_iQ_{t,i}.Bx​=i=0∑t​(∣x∣+αn​)0​(∣x∣+α−in−t​)0​​Qt,i​,wi​=2−kj=0∑k​(jk​)(j+αn​)0​(j+α−in−t​)0​​,Z=i=0∑t​wi​Qt,i​.

First, for all natural numbers n,k,α,tn,k,\alpha,tn,k,α,t, every vector AAA on Bn−k\mathcal B_{n-k}Bn−k​ with k≤nk\le nk≤n, α≤n−k\alpha\le n-kα≤n−k, ∑z∣Az∣2=1\sum_z|A_z|^2=1∑z​∣Az​∣2=1, and ∣z∣Az=αAz|z|A_z=\alpha A_z∣z∣Az​=αAz​, every specified proof that t≤nt\le nt≤n, and every measure μ\muμ on the unitary matrices on Bn\mathcal B_nBn​, equipped with their Borel measurable structure, assume that μ\muμ is a probability measure, that almost every UUU commutes with the diagonal matrix diag⁡(∣z∣)\operatorname{diag}(|z|)diag(∣z∣), and that multiplying UUU on the left by any unitary commuting with that diagonal matrix leaves μ\muμ unchanged. For every x,y∈Bkx,y\in\mathcal B_kx,y∈Bk​, split an nnn-bit string zzz into its first kkk bits zLz_LzL​ and remaining bits zAz_AzA​, define VA(z,x)=1{zL=x}AzAV_A(z,x)=\mathbf1_{\{z_L=x\}}A_{z_A}VA​(z,x)=1{zL​=x}​AzA​​, and set Fxy(U)=UVA∣x⟩⟨y∣VA†U†F_{xy}(U)=UV_A|x\rangle\langle y|V_A^\dagger U^\daggerFxy​(U)=UVA​∣x⟩⟨y∣VA†​U†. Both FxyF_{xy}Fxy​ and its partial trace over the final n−tn-tn−t bits are integrable, and

∫Fxy(U) dμ(U)={(n∣x∣+α)0−1Qn,∣x∣+α,x=y,0,x≠y,∫Tr⁡n−tFxy(U) dμ(U)={Bx,x=y,0,x≠y.\int F_{xy}(U)\,d\mu(U)= \begin{cases} \binom n{|x|+\alpha}_0^{-1}Q_{n,|x|+\alpha},&x=y,\\ 0,&x\ne y, \end{cases} \qquad \int\operatorname{Tr}_{n-t}F_{xy}(U)\,d\mu(U)= \begin{cases}B_x,&x=y,\\0,&x\ne y.\end{cases}∫Fxy​(U)dμ(U)={(∣x∣+αn​)0−1​Qn,∣x∣+α​,0,​x=y,x=y,​∫Trn−t​Fxy​(U)dμ(U)={Bx​,0,​x=y,x=y.​

These quantifiers include n=0n=0n=0, k=0k=0k=0, and t=0t=0t=0 whenever the stated bounds permit them. Second, for all natural n,k,α,tn,k,\alpha,tn,k,α,t satisfying k≤nk\le nk≤n, α≤n−k\alpha\le n-kα≤n−k, and t≤nt\le nt≤n, and every x∈Bkx\in\mathcal B_kx∈Bk​, the root fidelity, defined by Fr(M,N)=Re⁡tr⁡M NMF_{\mathrm r}(M,N)=\operatorname{Re}\operatorname{tr}\sqrt{\sqrt M\,N\sqrt M}Fr​(M,N)=RetrM​NM​​, satisfies

Fr(Bx,Z)=∑i=0t(ti)wi (n−t∣x∣+α−i)0(n∣x∣+α)0.F_{\mathrm r}(B_x,Z)= \sum_{i=0}^{t}\binom ti \sqrt{w_i\, \frac{\binom{n-t}{|x|+\alpha-i}_0}{\binom n{|x|+\alpha}_0}}.Fr​(Bx​,Z)=i=0∑t​(it​)wi​(∣x∣+αn​)0​(∣x∣+α−in−t​)0​​​.

Third, for every real aaa with 0<a<10<a<10<a<1, there exists C>0C>0C>0 such that the following holds for every sequence of natural-number parameters dj=(nj,kj,αj,tj)d_j=(n_j,k_j,\alpha_j,t_j)dj​=(nj​,kj​,αj​,tj​): assume nj→∞n_j\to\inftynj​→∞, and, for every jjj, 1≤kj≤nj1\le k_j\le n_j1≤kj​≤nj​, αj≤nj−kj\alpha_j\le n_j-k_jαj​≤nj​−kj​, 1≤tj≤nj1\le t_j\le n_j1≤tj​≤nj​, and the exact equality αj=anj\alpha_j=a n_jαj​=anj​; also assume kjtj2/nj→0k_jt_j^2/n_j\to0kj​tj2​/nj​→0. Then there exists N∈NN\in\mathbb NN∈N such that, for every j≥Nj\ge Nj≥N, using Bx,ZB_x,ZBx​,Z above with these parameters,

∣sup⁡x∈Bkj1−Fr(Bx,Z)2kjtj/(4nja(1−a))−1∣≤C kjtj2nj.\left| \frac{\displaystyle\sup_{x\in\mathcal B_{k_j}} \sqrt{1-F_{\mathrm r}(B_x,Z)^2}} {\displaystyle k_j\sqrt{t_j}/\bigl(4n_j\sqrt{a(1-a)}\bigr)} -1\right| \le C\,\frac{k_jt_j^2}{n_j}.​kj​tj​​/(4nj​a(1−a)​)x∈Bkj​​sup​1−Fr​(Bx​,Z)2​​−1​≤Cnj​kj​tj2​​.

The exact integer equality αj=anj\alpha_j=a n_jαj​=anj​ is required at every index; in particular, no such sequence exists for irrational aaa.

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