Program families serialized by polynomial-time Cook–Levin machines on zero-padded prefixes of the instance encoding (Theorem 7.4)
DefinitionTwoFoldOPI_CLSerializableFCook–Levin serializability on raw prefixes. For an instance of Theorem 7.4 with public bit encoding and size parameter , write for the first bits of .
A family of programs (QAlgorithms.OPI.PackedMembershipProgram) is Cook–Levin-serializable on raw prefixes if there are two legal multitape Cook–Levin machines, each running in time on inputs of length :
- a decider computing a function with, for every instance and every ,
- a generator computing a function with
where is the canonical serialization packedSerialization used by UniformResourceFamily.
This is the Cook–Levin counterpart of TwoFoldOPI.RAMSerializableF. It states the running time of the classical constructor directly in the cost model of OPIBridge.bitProgram_prefixSearch, so that constructors compiled to Turing machines (for example through the OAI routine compiler) can be used without a word-RAM implementation. It is the hypothesis of the bridge TwoFoldOPI.uniformFamily_of_CLSerializableF.
Formalization Note. Legality and time are the published CookLevin.TuringMachine and CookLevin.ComputesInTime with bound CookLevin.polyBound c d. The functions and are unconstrained on strings that are not zero-padded prefixes of encodings, and is unconstrained on prefixes that are too short.
import Mathlib
import Definitions.Def_TwoFoldOPI_Input
import Definitions.Def_QAlgorithms_Defs_OPIUniformity
import Definitions.Def_CookLevin_Cost
namespace TwoFoldOPI
open QAlgorithms.OPI
/-- **Cook–Levin serializability on raw prefixes.** A program family `construct` is serialized by
two polynomial-time Cook–Levin machines that read zero-padded prefixes `(encode x ++ 0^∞).take s`
of the instance encoding:
* the *decider* outputs `[true]` when the prefix contains the whole encoding and
`s ≥ scale x` (the size parameter `m + r + q + t`), and `[false]` otherwise;
* on every such long-enough prefix the *generator* outputs the canonical serialization of
`construct x`.
This is the Cook–Levin analogue of `RAMSerializableF`: it states the constructor's polynomial
running time directly in the `CookLevin` cost model used by `OPIBridge.bitProgram_prefixSearch`. -/
def CLSerializableF (construct : Input → PackedMembershipProgram) : Prop :=
∃ (MV : CookLevin.Machine) (kV GV cV dV : ℕ) (v : List Bool → List Bool)
(M : CookLevin.Machine) (k G c d : ℕ) (g : List Bool → List Bool),
CookLevin.TuringMachine kV GV MV ∧
CookLevin.ComputesInTime MV kV (CookLevin.polyBound cV dV) v ∧
CookLevin.TuringMachine k G M ∧
CookLevin.ComputesInTime M k (CookLevin.polyBound c d) g ∧
∀ (x : Input) (s : ℕ),
v ((x.encode ++ List.replicate s false).take s) =
[decide (x.encode.length ≤ s ∧ x.scale ≤ s)] ∧
(x.encode.length ≤ s → x.scale ≤ s →
g ((x.encode ++ List.replicate s false).take s) = packedSerialization (construct x))
end TwoFoldOPI