Efficient s-m-n, description size:
ProvedMIPRE.Cost.hardcode_sizePrograms of the ambient cost model occur as data through their tree serialization (Prog.toData): each constructor becomes a node whose head is a unary tag (the list of copies of , a tree of size ) and whose tail holds the fields. The size of a program is (esize), where counts the nodes of a binary tree, and (hardcode p d) is the s-m-n map, the program running on the pair of the literal and its input.
Statement. For every program and datum ,
This is the description-size clause of the efficient s-m-n theorem (blueprint lem:smn, [MNY, Lemma 2.2]): hardcoding grows a description additively. The recursive compression argument relies on it to keep the self-referential description that it hands to the compressor within the size slack of the succinctness definition at the next level, and the compressibility criterion computes the size of its hardcoded search program with this equation.
Formalization Note: The statement is an exact equality, specific to the serialization: toData (hardcode p d) is with tags (let_), (cons), (const), and ; the is the node count of this fixed scaffolding. [MNY] states only a polynomial bound on the size of .
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.hardcode_size (p : Prog) (d : Data) :
esize (hardcode p d) = esize p + d.size + 35 := by sorry