Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The ideal relinearization decoder succeeds with probability at least 1−E1-E1−E

Proved
OPI.DecProb.decode_prob_ge

by sragavan · Nov 11, 2026 · Mathlib 0df444a (Lean v4.33.1)

lean-formalizationquantum-algorithmstwo-fold-opi-construction

Let KKK be a finite field with q≥2q\ge2q≥2 elements, D⊆KmD\subseteq K^mD⊆Km a linear code spanned by vectors bDb_DbD​, and D∗2D^{*2}D∗2 its Schur square (the span of coordinatewise products), spanned by bWb_WbW​. Let

E(D)=∑c∈D∖{0}qdim⁡D∗2[Z(c)](q−1)wt(c),E(D)=\sum_{c\in D\setminus\{0\}}\frac{q^{\dim D^{*2}[Z(c)]}}{(q-1)^{\mathrm{wt}(c)}},E(D)=c∈D∖{0}∑​(q−1)wt(c)qdimD∗2[Z(c)]​,

where Z(c)Z(c)Z(c) is the zero set of ccc and W[S]W[S]W[S] denotes shortening on SSS.

For c∈Kc\in Kc∈K, wc(x,y)w_c(x,y)wc​(x,y) is the probability of observing the ordered pair (x,y)(x,y)(x,y) when measuring ∣ψc⟩=(2(q−1))−1/2∑a(∣c,a⟩−∣a,c⟩)|\psi_c\rangle=(2(q-1))^{-1/2}\sum_{a}(|c,a\rangle-|a,c\rangle)∣ψc​⟩=(2(q−1))−1/2∑a​(∣c,a⟩−∣a,c⟩) in the computational basis: wc(x,y)=1/(2(q−1))w_c(x,y)=1/(2(q-1))wc​(x,y)=1/(2(q−1)) if exactly one of x,yx,yx,y equals ccc, and 000 otherwise. The decoder decode(s,t)\mathrm{decode}(s,t)decode(s,t) uses Gauss–Jordan elimination to find a solution (v,w)(v,w)(v,w), v∈span⁡bDv\in\operatorname{span}b_Dv∈spanbD​, w∈span⁡bWw\in\operatorname{span}b_Ww∈spanbW​, of the relinearized system w−s∘v+t=0w-s\circ v+t=0w−s∘v+t=0, and returns vvv.

Statement. For every d∈Dd\in Dd∈D,

1−E(D) ≤ ∑z∈(K×K)m ∏i=1mwdi(zi)⋅[decode(x+y, x∘y)=d],1-E(D)\ \le\ \sum_{z\in(K\times K)^m}\ \prod_{i=1}^m w_{d_i}(z_i)\cdot\big[\mathrm{decode}(x+y,\ x\circ y)=d\big],1−E(D) ≤ z∈(K×K)m∑​ i=1∏m​wdi​​(zi​)⋅[decode(x+y, x∘y)=d],

where zi=(xi,yi)z_i=(x_i,y_i)zi​=(xi​,yi​). That is, measuring ⨂i∣ψdi⟩\bigotimes_i|\psi_{d_i}\rangle⨂i​∣ψdi​​⟩ and decoding the symmetric functions s=x+ys=x+ys=x+y, t=xyt=xyt=xy recovers ddd with probability at least 1−E1-E1−E. This is the ideal decoding guarantee that the real decoder's analysis perturbs.

Preamble
import Definitions.Def_TwoFoldOPI_CL_Part01
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Circuit
import Definitions.Def_QAlgorithms_Defs_GradientMethods
import Definitions.Def_QAlgorithms_Defs_OPIOraclePrograms
import Definitions.Def_QAlgorithms_Defs_OPIUniformity
import Definitions.Def_QAlgorithms_Defs_Fourier
import Definitions.Def_TwoFoldOPI_elemBits
import Definitions.Def_TwoFoldOPI_schurSquare
import Definitions.Def_TwoFoldOPI_schurFailureSum
import Definitions.Def_CodingTheory
import Definitions.Def_OAIThreeMachineSched01
import Definitions.Def_CookLevin_Cost
import Definitions.Def_TwoFoldOPI_codeOf
import Definitions.Def_TwoFoldOPI_solves
import Definitions.Def_TwoFoldOPI_Input
import Definitions.Def_TwoFoldOPI_CLSerializableF
open OPI OPI.DecProb
open TwoFoldOPI
variable {K : Type*} [Field K] [Fintype K] [DecidableEq K] {m : ℕ}
Formal statement
theorem OPI.DecProb.decode_prob_ge (hK : 2 ≤ Fintype.card K) {k k2 : ℕ} (bD : Fin k → Fin m → K)
    (bW : Fin k2 → Fin m → K) {D : Submodule K (Fin m → K)}
    (hD : Submodule.span K (Set.range bD) = D) (hW : Submodule.span K (Set.range bW) = schurSquare D)
    (d : Fin m → K) (hd : d ∈ D) :
    1 - schurFailureSum D ≤
      ∑ z : Fin m → K × K, (∏ i, wPair (d i) (z i)) *
        (if Relin.decode bD bW (fun i => (z i).1 + (z i).2) (fun i => (z i).1 * (z i).2) = d
          then 1 else 0) := by sorry
Source
Formalization of Theorem 7.4 (algorithmic part), repository https://github.com/sragavan99/lean-prove2me-fills/blob/db81d0d4e3fa008609ed37789a2eb2f6f08ee48d/WorkInProgress/QuantumOPIVariants/OPI/DecProb.lean#L129-L180

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