Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Program families serialized by a word-RAM algorithm on zero-padded prefixes of the instance encoding (Theorem 7.4)

Definition
TwoFoldOPI_RAMSerializableF

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

coding-theoryoptimal-polynomial-intersectionquantum-algorithmsuniformityword-ram

RAM-serializability on raw prefixes. For an instance xxx of Theorem 7.4 with public bit encoding enc(x)\mathrm{enc}(x)enc(x) and size parameter scale(x)=m+r+q+t\mathrm{scale}(x)=m+r+q+tscale(x)=m+r+q+t, write enc(x)[s]\mathrm{enc}(x)_{[s]}enc(x)[s]​ for the first sss bits of enc(x) 0∞\mathrm{enc}(x)\,0^\inftyenc(x)0∞.

A family of programs x↦construct(x)x\mapsto\mathrm{construct}(x)x↦construct(x) (QAlgorithms.OPI.PackedMembershipProgram) is RAM-serializable on raw prefixes if there are a uniform word-RAM algorithm AAA (the published WordRAM.Complexity model, either instruction set) and a function FFF on bit strings such that AAA computes FFF in polynomial time and, for every instance xxx and every sss,

F(enc(x)[s])={true⋅ser(construct(x))if ∣enc(x)∣≤s and scale(x)≤s,[false]otherwise,F\bigl(\mathrm{enc}(x)_{[s]}\bigr)=\begin{cases}\mathrm{true}\cdot\mathrm{ser}(\mathrm{construct}(x)) & \text{if } |\mathrm{enc}(x)|\le s \text{ and } \mathrm{scale}(x)\le s,\\ [\mathrm{false}] & \text{otherwise,}\end{cases}F(enc(x)[s]​)={true⋅ser(construct(x))[false]​if ∣enc(x)∣≤s and scale(x)≤s,otherwise,​

where ser\mathrm{ser}ser is the canonical serialization packedSerialization used by UniformResourceFamily.

The algorithm reads the self-delimiting instance encoding from a zero-padded prefix. It reports whether the prefix is long enough, and when it is, it outputs the program. A running time polynomial in sss is polynomial in m+r+q+tm+r+q+tm+r+q+t once s≥max⁡(∣enc(x)∣,scale(x))s\ge\max(|\mathrm{enc}(x)|,\mathrm{scale}(x))s≥max(∣enc(x)∣,scale(x)). This is the hypothesis of the bridge TwoFoldOPI.uniformFamily_of_RAMSerializableF.

Formalization Note. RAMPolyTimeComputable A F is the published notion: AAA, at its canonical word width, halts within c(n+1)dc(n+1)^dc(n+1)d steps with output FFF of its input. FFF is unconstrained on strings that are not zero-padded prefixes of encodings.

Definition code
import Mathlib
import Definitions.Def_TwoFoldOPI_Input
import Definitions.Def_QAlgorithms_Defs_OPIUniformity
import Definitions.Def_WordRAM_Complexity_BitIO

namespace TwoFoldOPI

open QAlgorithms.OPI

/-- **RAM-serializability on raw prefixes.** A program family `construct` is serialized by a
polynomial-time word-RAM algorithm working on zero-padded prefixes of the instance encoding: on the
first `s` bits of `encode x ++ 0^∞` the algorithm outputs `true` followed by the canonical
serialization of `construct x` once the prefix contains the whole encoding and `s` is at least the
size parameter `m + r + q + t`, and outputs `[false]` otherwise. -/
def RAMSerializableF (construct : Input → PackedMembershipProgram) : Prop :=
  ∃ (m : WordRAM.Model) (A : WordRAM.Complexity.Algorithm m) (F : List Bool → List Bool),
    WordRAM.Complexity.RAMPolyTimeComputable A F ∧
    ∀ (x : Input) (s : ℕ), F ((x.encode ++ List.replicate s false).take s) =
      if x.encode.length ≤ s ∧ x.scale ≤ s then true :: packedSerialization (construct x)
      else [false]

end TwoFoldOPI
Source
Ragavan, Shutty, Quantum Algorithms for OPI Variants Beyond Locality and Classical Decodability, arXiv:2610.00502 (version held), §7.3, Theorem 7.4, p.40 ("running in poly(m, q, log(1/ϵ)) time") and §5.2, "Computational conventions", p.26.

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