The normalization program computes normBin within an explicit quadratic cost bound
ProvedMIPRE.Cost.Prog.normBinProg_runsIn the ambient cost model, Prog.Runs p x r t means that the program , run on the one-entry environment , halts with result at cost (Eval [x] p r t). The total normalization of a parameter is : a datum that is a canonical binary numeral (the encoding of a bit string that is empty or ends in a one, i.e. the binary encoding of a natural number) is kept, and everything else is sent to , which denotes . The program builds the state , runs the canonicity loop on it, and returns if the loop returned and the input otherwise. For a datum , is its number of nodes and its length as a list.
For every datum ,
This is the correctness and cost statement of the third of the format-check programs of the wrapper decider of the halting reduction (after the bit-walk and the equality test): the parameter of a description is normalized so that every string names a parameter. The cost is quadratic in the size of the input, as for the other walks, which copy the remainder of the list at each step.
Formalization Note. The statement is MIPRE.Cost.Prog.normBinProg_runs, with no hypotheses; the result is normBin d (Data.normBin) and the cost t is existential with the bound (d.spine + 2) * (d.size + 25) + 3 * d.size + 10, in which Data.spine (list length) and Data.size (node count) are distinct measures that the docstring both writes as .
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.Tactic.Ring import Definitions.Def_MIPRE_Foundations_Cost_Basic import Definitions.Def_MIPRE_Foundations_Cost_Basic_B import Definitions.Def_MIPRE_Foundations_Cost_Encoding import Definitions.Def_MIPRE_Foundations_Cost_Encoding_B 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_Loops_B import Definitions.Def_MIPRE_Foundations_Cost_Codable import Definitions.Def_MIPRE_Foundations_Cost_Codable_B import Definitions.Def_MIPRE_Foundations_Cost_Unary import Definitions.Def_MIPRE_Foundations_Halting_Descriptions import Definitions.Def_MIPRE_Foundations_Cost_Numeric import Definitions.Def_MIPRE_Foundations_Cost_Numeric_B import Definitions.Def_MIPRE_Foundations_Halting_Lists open MIPRE open MIPRE.Cost open MIPRE.Cost.Prog open MIPRE.Cost.Data
theorem MIPRE.Cost.Prog.normBinProg_runs (d : Data) :
∃ t ≤ (d.spine + 2) * (d.size + 25) + 3 * d.size + 10,
normBinProg.Runs d (normBin d) t := by sorry