Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

One coordinate of the real decoder is within ε(2+ε)\varepsilon(2+\varepsilon)ε(2+ε) of the ideal one

Proved
OPI.SymEnc.step_close

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

lean-formalizationquantum-algorithmstwo-fold-opi-construction

Let F=Fp[x]/(f)F=\mathbb F_p[x]/(f)F=Fp​[x]/(f) be a presented field (p>0p>0p>0) and fix a real decoder layout: for each coordinate iii of mmm, the gadgets PβP_{\beta}Pβ​ (y↦β−yy\mapsto\beta-yy↦β−y on SiS_iSi​) and EEE (antisymmetrization of Si,TiS_i,T_iSi​,Ti​), and two QFTq\mathrm{QFT}_qQFTq​ gadgets acting on SiS_iSi​ and TiT_iTi​. Each QFTq\mathrm{QFT}_qQFTq​ gadget is catalysed by a bbb-qubit gradient register, uses phase estimation with t≥1t\ge1t≥1 bits, and consumes resource states ∣up⟩|u_p\rangle∣up​⟩ prepared on dedicated resource registers. For a list LLL of resources, ResL⊗g\mathrm{Res}_L\otimes gResL​⊗g denotes ggg with those resource states attached. Let Resi\mathrm{Res}_iResi​ be the resources of coordinate iii, and ε=deg⁡f (2π/2b+2p/2t)\varepsilon=\deg f\,\big(2\pi/2^b+2p/\sqrt{2^t}\big)ε=degf(2π/2b+2p/2t​) the error bound of one QFTq\mathrm{QFT}_qQFTq​ gadget.

The real operator of coordinate iii is Ai=UQ,TiUQ,SiUEUPA_i=U_{Q,T_i}U_{Q,S_i}U_EU_PAi​=UQ,Ti​​UQ,Si​​UE​UP​. The ideal operator CiC_iCi​ replaces the two gadgets by the exact Fourier transform QqQ_qQq​ over FFF on SiS_iSi​ and TiT_iTi​.

Statement. Let ooo be a list of coordinates not containing iii, FnF_nFn​ a symbol-level amplitude, and assume UEUP J(Fn)=J(F1)U_EU_P\,J(F_n)=J(F_1)UE​UP​J(Fn​)=J(F1​) for some symbol-level F1F_1F1​. Then

∥Ai(Res{i}∪o⊗J(Fn))−Reso⊗Ci J(Fn)∥ ≤ ε(2+ε) ∥J(Fn)∥.\big\|A_i\big(\mathrm{Res}_{\{i\}\cup o}\otimes J(F_n)\big)-\mathrm{Res}_{o}\otimes C_i\,J(F_n)\big\|\ \le\ \varepsilon(2+\varepsilon)\,\|J(F_n)\|.​Ai​(Res{i}∪o​⊗J(Fn​))−Reso​⊗Ci​J(Fn​)​ ≤ ε(2+ε)∥J(Fn​)∥.

So the real coordinate step uses up the resources of coordinate iii, leaves the others untouched, and is close to the ideal step. Summing over coordinates gives real_close, the bound mε(2+ε)m\varepsilon(2+\varepsilon)mε(2+ε) for the whole real decoder.

Preamble
import Definitions.Def_TwoFoldOPI_CL_Part02
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.SymEnc
open QAlgorithms TwoFoldOPI Matrix
variable (F : AvgCaseTI.FieldPres) {n b t m : ℕ}
variable {F}
variable {reg : Fin m × Bool × Fin (bitsPerSymbol F) ↪ Fin n} (D : RealDec F reg b t)
variable {D}
Formal statement
theorem OPI.SymEnc.step_close (hp : 0 < F.p) (ht : 1 ≤ t) (i : Fin m) (β : F.F) (os : List (Fin m)) (hos : i ∉ os)
    (Fn F1 : (Fin m → F.F × F.F) → ℂ)
    (hY1 : (Circuit.unitary (eGad (reg := reg) i (D.W i).ZE (D.W i).asE (D.W i).aE (D.W i).fE)).mulVec
      ((Circuit.unitary (revCirc (pGad reg (elemBits F) i (D.W i).ZP (D.W i).asP (D.W i).fP
        (fun x => β - x)))).mulVec (J reg (elemBits F) Fn)) = J reg (elemBits F) F1) :
    vnorm ((actC D i β).mulVec (bfacL (resC D i ++ os.flatMap (resC D)) (J reg (elemBits F) Fn)) -
      bfacL (os.flatMap (resC D)) ((cOp (D.W i) β).mulVec (J reg (elemBits F) Fn))) ≤
      epsQ F b t * (2 + epsQ F b t) * vnorm (J reg (elemBits F) Fn) := by sorry
Source
Formalization of Theorem 7.4 (algorithmic part), repository https://github.com/sragavan99/lean-prove2me-fills/blob/db81d0d4e3fa008609ed37789a2eb2f6f08ee48d/WorkInProgress/QuantumOPIVariants/OPI/DecReal.lean#L251-L380

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