Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The input decider accepts a padded instance encoding iff its length and scale fit

Proved
OPI.Parse.decideI_spec

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

lean-formalizationquantum-algorithmstwo-fold-opi-construction

An instance xxx of the code-intersection problem consists of a field presentation (ppp and the defining polynomial fff, so q=pdeg⁡fq=p^{\deg f}q=pdegf), the length mmm, an r×mr\times mr×m matrix HHH with a flag (generator or parity-check matrix), the forbidden values β∈Fm\beta\in\mathbb F^mβ∈Fm, and a precision ttt. It is encoded as a bit string enc(x)\mathrm{enc}(x)enc(x), and its scale is scale(x)=m+r+q+t\mathrm{scale}(x)=m+r+q+tscale(x)=m+r+q+t.

For a bound sss, the decider receives the length-sss string

w=takes(enc(x)+ ⁣ ⁣+0s),w=\mathrm{take}_s\bigl(\mathrm{enc}(x)\mathbin{+\!\!+}0^s\bigr),w=takes​(enc(x)++0s),

i.e. the encoding padded with zeros (or truncated) to exactly sss bits. The decider decideI parses www with all numbers saturated at s+1s+1s+1, and outputs [ b ][\,b\,][b] where bbb says that the parse succeeded and the parsed scale, with qqq computed as min⁡(pdeg⁡f,s+1)\min(p^{\deg f},s+1)min(pdegf,s+1), is at most sss.

Statement. For every instance xxx and every s∈Ns\in\mathbb Ns∈N,

decideI(takes(enc(x)+ ⁣ ⁣+0s))=[ ∣enc(x)∣≤s ∧ scale(x)≤s ].\mathrm{decideI}\bigl(\mathrm{take}_s(\mathrm{enc}(x)\mathbin{+\!\!+}0^s)\bigr)=\bigl[\,|\mathrm{enc}(x)|\le s\ \wedge\ \mathrm{scale}(x)\le s\,\bigr].decideI(takes​(enc(x)++0s))=[∣enc(x)∣≤s ∧ scale(x)≤s].

This is the decider half of the polynomial-time uniformity of the algorithm. Together with the polynomial realizer decideI_pr it certifies, from the padded prefix alone, whether the instance is complete and small enough for the program generated at size sss.

Preamble
import Definitions.Def_TwoFoldOPI_CL_Part05
import Definitions.Def_TwoFoldOPI_Input
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_CLSerializableF
open OPI.Parse
open OPI OPI.W6 OPI.W6.IsPR OAI.ThreeMachine.StackCompiler
variable {α : Type} [Coding α]
open TwoFoldOPI QAlgorithms.LocalHamiltonian
Formal statement
theorem OPI.Parse.decideI_spec (x : Input) (s : ℕ) :
    decideI ((x.encode ++ List.replicate s false).take s) =
      [decide (x.encode.length ≤ s ∧ x.scale ≤ s)] := by sorry
Source
Formalization of Theorem 7.4 (algorithmic part), repository https://github.com/sragavan99/lean-prove2me-fills/blob/db81d0d4e3fa008609ed37789a2eb2f6f08ee48d/WorkInProgress/QuantumOPIVariants/OPI/Parse.lean#L799-L855

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