Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§IV (19)–(20): rotor code

Open
QAlgorithms.Papers.Independent.Intakenext100.P12.rotor_exact_correction

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

prove2quantum

Let n,rn,rn,r be positive integers and m=nrm=nrm=nr. Represent rotor distributions by their integer-angular-momentum Fourier coefficients. The explicit encoder has coefficients n−1/21r∣L∑jcje−2πiLj/mn^{-1/2}\mathbf1_{r\mid L}\sum_j c_j e^{-2\pi iLj/m}n−1/21r∣L​∑j​cj​e−2πiLj/m. It is injective and its image is exactly the common +1+1+1 eigenspace of multiplication by eimθe^{im\theta}eimθ and rotation by 2πn/m2\pi n/m2πn/m. Its coefficient sequences are bounded; they are not asserted to be in ℓ2(Z)\ell^2(\mathbb Z)ℓ2(Z). The logical rotation by 2π/m2\pi/m2π/m is XXX, and multiplication by eirθe^{ir\theta}eirθ is ZZZ. One algebraic syndrome decoder separates all errors in the strict window

∣Δθ∣<πm,∣ΔL∣<r2=m2n,ΔL∈Z.|\Delta\theta|<\frac\pi m,\qquad |\Delta L|<\frac r2=\frac m{2n},\quad\Delta L\in\mathbb Z.∣Δθ∣<mπ​,∣ΔL∣<2r​=2nm​,ΔL∈Z.

Angles use the central representative of their circular displacement. The common linear decoder also preserves finite coherent sums of these ideal errors.

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 IV (19)–(20), PDF p.4: the rotor code, its logical operations and a common
ideal syndrome decoder. The missing absolute-value bars in the angular prose are read as
shift magnitude, consistently with the preceding finite correction argument. -/
theorem rotor_exact_correction (n r : ℕ) (hn : 0 < n) (hr : 0 < r) :
    Function.Injective (rotorEncode n r) ∧
    (∀ psi : ℤ → ℂ, IsRotorStabilized n r psi ↔ ∃ c, rotorEncode n r c = psi) ∧
    (∀ c : Fin n → ℂ, ∃ C : ℝ, 0 ≤ C ∧ ∀ L : ℤ, ‖rotorEncode n r c L‖ ≤ C) ∧
    (∀ c : Fin n → ℂ,
      rotorError (2 * Real.pi / (n * r)) 0 (rotorEncode n r c) =
        rotorEncode n r (logicalCycle n c) ∧
      rotorError 0 r (rotorEncode n r c) = rotorEncode n r (logicalClock n c)) ∧
    (∃ R : (ℤ → ℂ) →ₗ[ℂ] ({e // e ∈ rotorCell n r} → Fin n → ℂ),
      ∀ (e : {e // e ∈ rotorCell n r}) (c : Fin n → ℂ),
        R (rotorError e.val.1 e.val.2 (rotorEncode n r c)) = fun s => if s = e then c else 0) := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P12

end
Source
Encoding a qubit in an oscillator, arXiv:quant-ph/0008040v3, PDF p. 4, §IV (19)–(20): rotor code
Read-back

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

For every pair of positive natural numbers n,rn,rn,r, define, for c:{0,…,n−1}→Cc:\{0,\ldots,n-1\}\to\mathbb Cc:{0,…,n−1}→C, the sequence E(c)(L)=n−1/2∑j=0n−1cje−i2πLj/(nr)E(c)(L)=n^{-1/2}\sum_{j=0}^{n-1}c_j e^{-i2\pi Lj/(nr)}E(c)(L)=n−1/2∑j=0n−1​cj​e−i2πLj/(nr) when the integer remainder L mod rL\bmod rLmodr is zero, and E(c)(L)=0E(c)(L)=0E(c)(L)=0 otherwise; also define (Eθ,bψ)(L)=e−iLθψ(L−b)(\mathcal E_{\theta,b}\psi)(L)=e^{-iL\theta}\psi(L-b)(Eθ,b​ψ)(L)=e−iLθψ(L−b) for real θ\thetaθ, integer bbb, and arbitrary ψ:Z→C\psi:\mathbb Z\to\mathbb Cψ:Z→C. The assertion is the conjunction of these statements: EEE is injective; an arbitrary sequence ψ\psiψ has the form E(c)E(c)E(c) for some coefficient vector ccc if and only if, for every integer LLL, ψ(L−nr)=ψ(L)\psi(L-nr)=\psi(L)ψ(L−nr)=ψ(L) and e−i2πL/rψ(L)=ψ(L)e^{-i2\pi L/r}\psi(L)=\psi(L)e−i2πL/rψ(L)=ψ(L); for each ccc there is a real C≥0C\ge0C≥0 such that ∣E(c)(L)∣≤C|E(c)(L)|\le C∣E(c)(L)∣≤C for every integer LLL; for every ccc, E2π/(nr),0E(c)=E(Cycle⁡nc)\mathcal E_{2\pi/(nr),0}E(c)=E(\operatorname{Cycle}_n c)E2π/(nr),0​E(c)=E(Cyclen​c) and E0,rE(c)=E(Clock⁡nc)\mathcal E_{0,r}E(c)=E(\operatorname{Clock}_n c)E0,r​E(c)=E(Clockn​c), where (Cycle⁡nc)j=∑k=0n−11{j=(k+1) mod n}ck(\operatorname{Cycle}_n c)_j=\sum_{k=0}^{n-1}\mathbf 1_{\{j=(k+1)\bmod n\}}c_k(Cyclen​c)j​=∑k=0n−1​1{j=(k+1)modn}​ck​ and (Clock⁡nc)j=ei2πj/ncj(\operatorname{Clock}_n c)_j=e^{i2\pi j/n}c_j(Clockn​c)j​=ei2πj/ncj​; and, writing C={(θ,b)∈R×Z:∣θ∣<π/(nr), ∣b∣<r/2}\mathcal C=\{(\theta,b)\in\mathbb R\times\mathbb Z:|\theta|<\pi/(nr),\ |b|<r/2\}C={(θ,b)∈R×Z:∣θ∣<π/(nr), ∣b∣<r/2}, there exists a complex-linear map RRR from all complex sequences on Z\mathbb ZZ to functions from C\mathcal CC to coefficient vectors such that, for every e=(θ,b)∈Ce=(\theta,b)\in\mathcal Ce=(θ,b)∈C and every ccc, R(Eθ,bE(c))(s)=cR(\mathcal E_{\theta,b}E(c))(s)=cR(Eθ,b​E(c))(s)=c if s=es=es=e and is the zero vector otherwise, for every s∈Cs\in\mathcal Cs∈C. The coefficient vectors are arbitrary, including zero, and no normalization is required.

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