The hardcoded search program halts once the start-level string is produced and the semidecider accepts it
ProvedMIPRE.Cost.Prog.searchProg_runsWe work in the ambient cost model (programs Prog on binary-tree data, timed semantics, Prog.Runs p x r t: the program on the input halts with at cost ). A universal machine (UniversalMachine) is a closed program with a polynomial overhead such that every run of a program on with result yields a run of on the pair with the same result, and conversely halts on only if halts on , with the same result.
The compressibility criterion (Lin's criterion, blueprint lem:compressible-criterion-nested) adds a search branch to the self-referential decider of the recursive compression argument: at each level the decider tests, under a budget, whether a semidecision procedure accepts the string at the start level of the recursion. The program tested is the search program with its data hardcoded. For a universal program and a program , expects the pair of and an (ignored) input: it runs on the first component of , i.e. simulates on the encoded triple to obtain a value (the string at the start level), and then runs on the pair . The s-m-n map fixes , so that is a program to be run on the empty input nil.
Let be a universal machine, a closed program (well-scoped in one variable), programs, , and data. Suppose that on halts with (at some cost ) and that on halts with (at some cost ). Then
This is the forward direction of the correctness of the search branch; with its converse searchProg_halts_of it shows that the search branch of the decider fires exactly when halts on the string at the start level, which is what the proof of compressibility_criterion_nested uses (the search eventually fires if the start string lies outside the class recognized by ).
Formalization Note. The statement is MIPRE.Cost.Prog.searchProg_runs; the triple carries the start level twice because the decider's input is with the start level and the current level, and the search is about the string at . The semidecider receives the pair , in the per-level form of the criterion where halts on iff . No cost bound is claimed (only the existence of a halting run), since the decider tests halting within a budget that is then taken large enough.
import Mathlib.Algebra.Polynomial.Eval.Defs import Mathlib.Algebra.Polynomial.Eval.Degree import Mathlib.Computability.Halting import Mathlib.Computability.Partrec import Mathlib.Computability.PartrecCode import Mathlib.Computability.Primrec.List import Mathlib.Computability.TuringMachine.Config import Mathlib.Data.ENat.Lattice import Mathlib.Data.List.Basic import Mathlib.Data.Nat.Bits import Mathlib.Data.Nat.Notation import Mathlib.Data.Nat.Size import Mathlib.Logic.Denumerable import Mathlib.Logic.Function.Iterate import Mathlib.Tactic.Linarith import Mathlib.Tactic.Ring import Definitions.Def_MIPRE_Foundations_Cost_Basic import Definitions.Def_MIPRE_Foundations_Cost_Encoding import Definitions.Def_MIPRE_Foundations_Cost_PolyTime import Definitions.Def_MIPRE_Foundations_Cost_Closure import Definitions.Def_MIPRE_Foundations_Cost_Loops import Definitions.Def_MIPRE_Foundations_Cost_Unary import Definitions.Def_MIPRE_Foundations_Cost_Numeric import Definitions.Def_MIPRE_Foundations_Cost_BitQuery import Definitions.Def_MIPRE_Foundations_Cost_Toolkit import Definitions.Def_MIPRE_Foundations_Cost_Succinct import Definitions.Def_MIPRE_Foundations_Cost_Clocked import Definitions.Def_MIPRE_Foundations_Cost_Threshold import Definitions.Def_MIPRE_Foundations_Cost_Machine import Definitions.Def_MIPRE_Foundations_Cost_Codable import Definitions.Def_MIPRE_Foundations_Cost_MachineData import Definitions.Def_MIPRE_Foundations_Cost_Interpreter import Definitions.Def_MIPRE_Foundations_Cost_MachineBound import Definitions.Def_MIPRE_Foundations_Cost_Universal import Definitions.Def_MIPRE_Foundations_Cost_Kleene import Definitions.Def_MIPRE_Foundations_Cost_Partrec import Definitions.Def_MIPRE_Foundations_Cost_FromPartrec import Definitions.Def_MIPRE_Foundations_Compression open MIPRE open MIPRE.Cost open MIPRE.Cost.Prog open Polynomial
theorem MIPRE.Cost.Prog.searchProg_runs (U : UniversalMachine) {S : Prog} (hS : S.WellScoped 1)
{c' e : Prog} {m : ℕ} {x r : Data} {tx ts : ℕ}
(hx : c'.Runs (encode (e, (m, m))) x tx) (hSr : S.Runs (.cons x (encode m)) r ts) :
∃ T, (hardcode (searchProg U.univ S) (encode ((c', (e, (m, m))), m))).Runs .nil r T := by sorry