Existence of a clocked universal machine: total, budgeted simulation in polynomial time
ProvedMIPRE.Cost.exists_clocked_universalFix the ambient cost model: programs run on values (binary trees), (c.Runs v r t) says that halts on with result at cost , programs are encoded as values of size , and budgets are passed in unary, being the list of copies of . The budgeted result of on under the cost budget is
A clocked universal machine (ClockedUniversalMachine) is a structure consisting of a closed program (reading only its input) and a polynomial such that for every program , every input and every budget there is a cost
The theorem states that such a machine exists:
In words: there is a fixed program that, given , a program and an input , runs on for cost at most and reports either the result or a timeout, always halting, and does so in time polynomial in . This is the time-bounded half of blueprint lem:universal-tm (efficient universal Turing machine, [MNY, Lemma 2.1]). It is the primitive with which the deciders of the compression pipeline (introspection, parallel repetition) simulate other deciders under a budget, and with which the recursive compression argument runs a description "for steps"; because the machine is a structure, downstream definitions can refer to its program and its overhead polynomial as data.
Formalization Note: The budget counts cost units of the big-step semantics and is given in unary, so a polynomial bound in is the appropriate notion ("run for steps" with written out); the input is the triple encoded as . The witness is the clocked self-interpreter selfClockedUniversal of Cost/Universal.lean (program univTProg, polynomial univTPoly). The result is total, which the blueprint statement of lem:universal-tm does not mention separately: it covers the unclocked machine, and the clocked variant is attached to the same blueprint node.
import Mathlib.Algebra.Polynomial.Eval.Defs import Mathlib.Computability.Primrec.List 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_Toolkit 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 open MIPRE open MIPRE.Cost open Polynomial
theorem MIPRE.Cost.exists_clocked_universal : Nonempty ClockedUniversalMachine := by sorry