A halting run of the hardcoded search program yields the start-level string and a halting run of the semidecider
ProvedMIPRE.Cost.Prog.searchProg_halts_ofWe work in the ambient cost model (programs Prog on binary-tree data, timed semantics, Prog.Runs p x r t; Halts p x: some run of on exists). A universal machine is a closed program that simulates any program on any with the same halting behavior and result (UniversalMachine.time_le and UniversalMachine.halts_of).
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, , data and a cost, and suppose that on the input nil halts with at cost . Then
This is the backward direction of the correctness of the search branch of the compressibility criterion's decider: if the search fires (the hardcoded search program halts within the budget), then the self-referential program does produce a string at the start level and the semidecision procedure accepts . In compressibility_criterion_nested this is combined with the determinism of evaluation (the produced is the decider's own output at the start level) and with the specification of to conclude that the start string lies outside .
Formalization Note. The statement is MIPRE.Cost.Prog.searchProg_halts_of; the conclusion names the cost of the run of but only the existence of a run of (Halts S (cons x (encode m))). Its proof is an inversion of the big-step derivation of the hardcoded program, which is possible because the semantics is deterministic and each syntactic form of program has exactly one applicable rule (two for elim, distinguished by the inspected value).
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_halts_of (U : UniversalMachine) {S : Prog} (hS : S.WellScoped 1)
{c' e : Prog} {m : ℕ} {r : Data} {T : ℕ}
(h : (hardcode (searchProg U.univ S) (encode ((c', (e, (m, m))), m))).Runs .nil r T) :
∃ x tx, c'.Runs (encode (e, (m, m))) x tx ∧ Halts S (.cons x (encode m)) := by sorry