Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Regev numbers: accepted mass ≥P\ge P≥P, bad accepted mass ≤∣D∣(1−P)\le |D|(1-P)≤∣D∣(1−P)

Proved
OPI.regev_bounds

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

lean-formalizationquantum-algorithmstwo-fold-opi-construction

Let UUU be a unitary on nnn qubits (the decoder) and DDD a finite nonempty set of labels. For each d∈Dd\in Dd∈D let ψd′\psi'_dψd′​ be a unit vector, and let out\mathrm{out}out assign a label to every computational basis state (the value of the decoder's output register). Let PPP be a real number such that, for every d∈Dd\in Dd∈D, the decoder recovers ddd from ψd′\psi'_dψd′​ with probability at least PPP:

P≤∥Πout=d Uψd′∥2.P\le\|\Pi_{\mathrm{out}=d}\,U\psi'_d\|^2 .P≤∥Πout=d​Uψd′​∥2.

Let good\mathrm{good}good be a set of basis states such that ∑d∈Dψd′\sum_{d\in D}\psi'_d∑d∈D​ψd′​ vanishes outside good\mathrm{good}good (the interference condition).

Put ψd=∣D∣−1/2ψd′\psi_d=|D|^{-1/2}\psi'_dψd​=∣D∣−1/2ψd′​ and define the accepted vector

vacc=U†∑d∈DΠout=d Uψd.v_{\mathrm{acc}}=U^\dagger\sum_{d\in D}\Pi_{\mathrm{out}=d}\,U\psi_d .vacc​=U†d∈D∑​Πout=d​Uψd​.

Statement.

∥vacc∥2≥Pand∥Π¬good vacc∥2≤∣D∣ (1−P),\|v_{\mathrm{acc}}\|^2\ge P\qquad\text{and}\qquad\|\Pi_{\neg\mathrm{good}}\,v_{\mathrm{acc}}\|^2\le |D|\,(1-P),∥vacc​∥2≥Pand∥Π¬good​vacc​∥2≤∣D∣(1−P),

where Π¬good\Pi_{\neg\mathrm{good}}Π¬good​ restricts to basis states outside good\mathrm{good}good.

In the algorithm, vaccv_{\mathrm{acc}}vacc​ is the state accepted by one trial of Regev's reduction: decode, subtract the decoded word from RRR, undecode, and test R=0R=0R=0. The first inequality bounds the acceptance probability from below. The second bounds the probability of accepting with an output outside C∩AC\cap AC∩A.

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
open QAlgorithms Matrix
variable {n : ℕ} {δ : Type*} [DecidableEq δ]
Formal statement
theorem OPI.regev_bounds (U : Mat n) (hU : U ∈ Matrix.unitaryGroup (Qubits n) ℂ) (D : Finset δ)
    (hD : D.Nonempty) (ψ' : δ → Qubits n → ℂ) (hn : ∀ d ∈ D, nsq (ψ' d) = 1) (out : Qubits n → δ)
    (P : ℝ) (hP : ∀ d ∈ D, P ≤ nsq (projOut out d (U.mulVec (ψ' d))))
    (good : Qubits n → Prop) [DecidablePred good]
    (hgood : ∀ z, ¬ good z → (∑ d ∈ D, ψ' d) z = 0) :
    P ≤ nsq (vAcc U D (fun d => ((Real.sqrt D.card)⁻¹ : ℂ) • ψ' d) out) ∧
      nsq (offGood good (vAcc U D (fun d => ((Real.sqrt D.card)⁻¹ : ℂ) • ψ' d) out)) ≤
        D.card * (1 - P) := by sorry
Source
Formalization of Theorem 7.4 (algorithmic part), repository https://github.com/sragavan99/lean-prove2me-fills/blob/db81d0d4e3fa008609ed37789a2eb2f6f08ee48d/WorkInProgress/QuantumOPIVariants/OPI/RegevNum.lean#L23-L64

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