The s-m-n map is polynomial-time computable in the model, for any encodable type
ProvedMIPRE.Cost.smn_polyTimeA sized encoding of a type (SizedEncoding α) renders each as a datum of the ambient cost model, with a decoding function inverting it; (esize) is the number of nodes of the encoding. Pairs encode as , so , and a program encodes as its tree serialization. A polynomial-time computable function of the model (PolyTimeFun α β) is a function together with a closed program and an explicit polynomial such that for every there is a run with , where denotes a run of the program on input with result at cost . The s-m-n map is (hardcode p d), the program running on the pair of the literal and its input.
Statement. For every type with a sized encoding there is a polynomial-time computable function of the model such that
This is the clause of the efficient s-m-n theorem (blueprint lem:smn, [MNY, Lemma 2.2]) that the recursive compression argument uses at run time: the self-referential decider must build the hardcoded program — the bit-query program with a program, a description and a level hardcoded — while it executes, and does so through this map (PolyTimeFun.smn); the compressibility criterion builds its search program the same way. The statement is generic in because the hardcoded values are programs and tuples, not only bit strings.
Formalization Note: The witness is the definition PolyTimeFun.smn α, whose program smnProg destructures the encoded pair and assembles the fixed tree of toData_hardcode around the two components, running in exactly steps; its declared time bound is the polynomial , so . The function is marked noncomputable in Lean only because Mathlib's Polynomial ℕ is noncomputable data.
import Mathlib.Algebra.Polynomial.Eval.Defs import Mathlib.Data.List.Basic import Mathlib.Data.Nat.Bits import Mathlib.Data.Nat.Notation import Mathlib.Data.Nat.Size 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_Toolkit open MIPRE open MIPRE.Cost open Polynomial
theorem MIPRE.Cost.smn_polyTime (α : Type*) [SizedEncoding α] :
∃ S : PolyTimeFun (Prog × α) Prog,
∀ (p : Prog) (a : α), S (p, a) = hardcode p (encode a) := by sorry