Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§II (12)–(17): general finite shift-resistant code

Open
QAlgorithms.Papers.Independent.Intakenext100.P12.finite_general_perfect

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

prove2quantum

Let r1,r2,nr_1,r_2,nr1​,r2​,n be positive integers and d=r1r2nd=r_1r_2nd=r1​r2​n with n<dn<dn<d. Define

J∣j⟩=1r2∑k=0r2−1∣r1(j+nk)⟩,0≤j<n.J|j\rangle=\frac1{\sqrt{r_2}}\sum_{k=0}^{r_2-1}|r_1(j+nk)\rangle,\qquad0\le j<n.J∣j⟩=r2​​1​k=0∑r2​−1​∣r1​(j+nk)⟩,0≤j<n.

Then JJJ is an isometry onto the common +1+1+1 eigenspace of Xr1n,Zr2nX^{r_1n},Z^{r_2n}Xr1​n,Zr2​n. The operators Xr1,Zr2X^{r_1},Z^{r_2}Xr1​,Zr2​ implement the logical cyclic shift and clock. The r1r2r_1r_2r1​r2​ half-open syndrome sectors are orthonormal copies of the logical space and exhaust the ambient space. One CPTP recovery corrects every operator in the span of XaZbX^aZ^bXaZb with ∣a∣<r1/2|a|<r_1/2∣a∣<r1​/2, ∣b∣<r2/2|b|<r_2/2∣b∣<r2​/2, with the exact KL inner products stated explicitly.

This separates perfection of the full syndrome partition from the potentially smaller strict central correction window.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P12
Formal statement
noncomputable section

open scoped BigOperators

open MeasureTheory Matrix ComplexConjugate

open QAlgorithms.Papers.Independent.Dependency50.P10 (Phase sigma)

namespace QAlgorithms.Papers.Independent.Intakenext100.P12

/-- Section II (12)–(17), PDF pp.3–4: the general finite shift-resistant code.
All syndrome sectors partition the space; the strict central window need not be complete.
The source explicitly considers a proper encoding n<d (PDF p.3). -/
theorem finite_general_perfect (d r1 r2 n : ℕ) [NeZero d]
    (hr1 : 0 < r1) (hr2 : 0 < r2) (hn : 0 < n) (hd : d = r1 * r2 * n)
    (hproper : n < d) :
    FiniteCodeConclusion d r1 r2 n := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P12

end
Source
Encoding a qubit in an oscillator, arXiv:quant-ph/0008040v3, PDF p. 3, §II (12)–(17): general finite shift-resistant code
Read-back

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

Let d,r1,r2,nd,r_1,r_2,nd,r1​,r2​,n be natural numbers with d≠0d\ne0d=0, r1>0r_1>0r1​>0, r2>0r_2>0r2​>0, n>0n>0n>0, d=r1r2nd=r_1r_2nd=r1​r2​n, and n<dn<dn<d. Write Zd=Z/dZ\mathbb Z_d=\mathbb Z/d\mathbb ZZd​=Z/dZ, and let [x]∈{0,…,d−1}[x]\in\{0,\ldots,d-1\}[x]∈{0,…,d−1} denote the representative of x∈Zdx\in\mathbb Z_dx∈Zd​. For 0≤j<n0\le j<n0≤j<n, define

wj(x)=1r2∑k=0r2−11{x=r1(j+nk) in Zd},V(c)=∑j=0n−1cjwj.w_j(x)=\frac1{\sqrt{r_2}}\sum_{k=0}^{r_2-1} \mathbf1_{\{x=r_1(j+nk)\text{ in }\mathbb Z_d\}}, \qquad V(c)=\sum_{j=0}^{n-1}c_jw_j.wj​(x)=r2​​1​k=0∑r2​−1​1{x=r1​(j+nk) in Zd​}​,V(c)=j=0∑n−1​cj​wj​.

For integers a,ba,ba,b, define the operator

(Ea,bψ)(x)=exp⁡ ⁣(2πi b[x−a]d)ψ(x−a),(E_{a,b}\psi)(x)= \exp\!\left(\frac{2\pi i\,b[x-a]}d\right)\psi(x-a),(Ea,b​ψ)(x)=exp(d2πib[x−a]​)ψ(x−a),

whose matrix has entry exp⁡(2πi b[y]/d)\exp(2\pi i\,b[y]/d)exp(2πib[y]/d) at (x,y)(x,y)(x,y) when x=y+ax=y+ax=y+a in Zd\mathbb Z_dZd​, and entry zero otherwise. Let C⊆CZdC\subseteq\mathbb C^{\mathbb Z_d}C⊆CZd​ be the complex linear span of the wjw_jwj​, and let E\mathcal EE be the complex linear span of all matrices Ea,bE_{a,b}Ea,b​ with ∣a∣<r1/2|a|<r_1/2∣a∣<r1​/2 and ∣b∣<r2/2|b|<r_2/2∣b∣<r2​/2. Using the inner products ⟨u,v⟩=∑xu(x)‾v(x)\langle u,v\rangle=\sum_x\overline{u(x)}v(x)⟨u,v⟩=∑x​u(x)​v(x), the conclusion asserts all of the following: for every function ψ:Zd→C\psi:\mathbb Z_d\to\mathbb Cψ:Zd​→C, the two equalities Er1n,0ψ=ψE_{r_1n,0}\psi=\psiEr1​n,0​ψ=ψ and E0,r2nψ=ψE_{0,r_2n}\psi=\psiE0,r2​n​ψ=ψ hold if and only if ψ=V(c)\psi=V(c)ψ=V(c) for some c:{0,…,n−1}→Cc:\{0,\ldots,n-1\}\to\mathbb Cc:{0,…,n−1}→C; for all coefficient vectors c,c′c,c'c,c′, ⟨V(c),V(c′)⟩=⟨c,c′⟩\langle V(c),V(c')\rangle=\langle c,c'\rangle⟨V(c),V(c′)⟩=⟨c,c′⟩; there exists a recovery map RRR admitting a finite Kraus representation R(X)=∑ℓ=0m−1KℓXKℓ∗R(X)=\sum_{\ell=0}^{m-1}K_\ell X K_\ell^*R(X)=∑ℓ=0m−1​Kℓ​XKℓ∗​ with ∑ℓKℓ∗Kℓ=I\sum_\ell K_\ell^*K_\ell=I∑ℓ​Kℓ∗​Kℓ​=I, such that for every E∈EE\in\mathcal EE∈E and every unit vector ψ∈C\psi\in Cψ∈C,

R((Eψ)(Eψ)∗)=∥Eψ∥2ψψ∗;R\bigl((E\psi)(E\psi)^*\bigr)=\|E\psi\|^2\psi\psi^*;R((Eψ)(Eψ)∗)=∥Eψ∥2ψψ∗;

each wjw_jwj​ is fixed by Er1n,0E_{r_1n,0}Er1​n,0​ and E0,r2nE_{0,r_2n}E0,r2​n​; for every 0≤j<n0\le j<n0≤j<n,

Er1,0wj=w(j+1) mod n,(E0,r2wj)(x)=e2πij/nwj(x)for every x∈Zd;E_{r_1,0}w_j=w_{(j+1)\bmod n}, \qquad (E_{0,r_2}w_j)(x)=e^{2\pi i j/n}w_j(x) \quad\text{for every }x\in\mathbb Z_d;Er1​,0​wj​=w(j+1)modn​,(E0,r2​​wj​)(x)=e2πij/nwj​(x)for every x∈Zd​;

the functions su,v,j=Eu,vwjs_{u,v,j}=E_{u,v}w_jsu,v,j​=Eu,v​wj​, indexed by 0≤u<r10\le u<r_10≤u<r1​, 0≤v<r20\le v<r_20≤v<r2​, and 0≤j<n0\le j<n0≤j<n, satisfy ⟨se,sf⟩=1\langle s_e,s_f\rangle=1⟨se​,sf​⟩=1 when their entire index triples agree and 000 otherwise, and their complex linear span is all of CZd\mathbb C^{\mathbb Z_d}CZd​; and for every two integer pairs (a,b),(a′,b′)(a,b),(a',b')(a,b),(a′,b′) satisfying the strict window inequalities ∣a∣,∣a′∣<r1/2|a|,|a'|<r_1/2∣a∣,∣a′∣<r1​/2 and ∣b∣,∣b′∣<r2/2|b|,|b'|<r_2/2∣b∣,∣b′∣<r2​/2, and every c,c′c,c'c,c′,

⟨Ea,bV(c),Ea′,b′V(c′)⟩={⟨c,c′⟩,(a,b)=(a′,b′),0,(a,b)≠(a′,b′).\langle E_{a,b}V(c),E_{a',b'}V(c')\rangle = \begin{cases} \langle c,c'\rangle,&(a,b)=(a',b'),\\ 0,&(a,b)\ne(a',b'). \end{cases}⟨Ea,b​V(c),Ea′,b′​V(c′)⟩={⟨c,c′⟩,0,​(a,b)=(a′,b′),(a,b)=(a′,b′).​

Here vv∗vv^*vv∗ denotes the matrix with entries v(x)v(y)‾v(x)\overline{v(y)}v(x)v(y)​; neither the arbitrary functions in the fixed-point characterization nor the coefficient vectors are required to be normalized.

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

    Confirmed by the moderator at approval.

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