The head-cost quantity of the wrapper decider is polynomially bounded
ProvedMIPRE.Cost.Prog.polyBounded_wrapHeadZLet be a universal machine of the ambient cost model (a closed program U.univ simulating any program, with overhead bounded by the polynomial U.bound) and let be an -level sampler with program S.prog and dimension function S.dim n. For a cost coefficient function and a degree , wrapHeadZ U S Cf kf n is the following explicit natural number, where is the fixed datum encoding the sampler's dimension query, is the size of a datum, , and is the bit length of :
Theorem: if is polynomially bounded and S.dim is polynomially bounded, then for every the function is polynomially bounded, that is, there is a polynomial with natural coefficients such that for all .
is the quantity whose square bounds the cost of the head of the wrapper decider, the stage that queries the sampler's dimension through the universal machine and converts it to unary (wrapHead_cost' bounds that cost by beyond the head's continuation), for a sampler running within . Its polynomial boundedness is what wrapCore_hasPolyCost needs to bound the whole wrapper, which is what makes the verifier a string denotes -bounded.
Formalization Note PolyBounded f := ∃ P : Polynomial ℕ, ∀ n, f n ≤ P.eval n. wrapHeadZ is noncomputable and is exactly the displayed sum, with esize x = (encode x : Data).size, (encode CL.Sampler.Query.dimension : Data).size for , U.bound.eval for the overhead polynomial and Nat.size for the bit length. The section variables U : UniversalMachine and S : CL.Sampler ℓ are explicit arguments and ℓ is implicit; kf : ℕ is explicit and enters only through the constant ; Cf is implicit with hypothesis hCf : PolyBounded Cf, and hdim : PolyBounded S.dim. Namespace MIPRE.Cost.Prog, module MIPRE.Foundations.Halting.WrapperCost.
import Mathlib.Algebra.BigOperators.Group.Finset.Basic
import Mathlib.Algebra.BigOperators.Ring.Finset
import Mathlib.Algebra.Polynomial.Eval.Defs
import Mathlib.Algebra.Polynomial.Eval.Degree
import Mathlib.Analysis.CStarAlgebra.CStarMatrix
import Mathlib.Analysis.CStarAlgebra.Classes
import Mathlib.Analysis.Matrix.Order
import Mathlib.Computability.Primrec.List
import Mathlib.Data.ENat.Lattice
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Pi
import Mathlib.Data.List.Basic
import Mathlib.Data.Nat.Bits
import Mathlib.Data.Nat.Notation
import Mathlib.Data.Nat.Size
import Mathlib.Data.Real.Basic
import Mathlib.Data.ZMod.Basic
import Mathlib.LinearAlgebra.Matrix.Kronecker
import Mathlib.LinearAlgebra.Pi
import Mathlib.Logic.Denumerable
import Mathlib.Logic.Function.Iterate
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Ring
import Definitions.Def_MIPRE_Foundations_CL_Register
import Definitions.Def_MIPRE_Foundations_CL_Basic
import Definitions.Def_MIPRE_Foundations_CL_Closure
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_CL_Sampler
import Definitions.Def_MIPRE_Foundations_Games
import Definitions.Def_MIPRE_Foundations_GameTransport
import Definitions.Def_MIPRE_Foundations_Cost_Closure
import Definitions.Def_MIPRE_Foundations_Cost_Toolkit
import Definitions.Def_MIPRE_Foundations_Cost_Toolkit_B
import Definitions.Def_MIPRE_Foundations_Cost_Machine
import Definitions.Def_MIPRE_Foundations_Cost_Machine_B
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_MachineData
import Definitions.Def_MIPRE_Foundations_Cost_MachineData_B
import Definitions.Def_MIPRE_Foundations_Cost_Interpreter
import Definitions.Def_MIPRE_Foundations_Cost_Interpreter_B
import Definitions.Def_MIPRE_Foundations_Cost_Unary
import Definitions.Def_MIPRE_Foundations_Cost_MachineBound
import Definitions.Def_MIPRE_Foundations_Cost_MachineBound_B
import Definitions.Def_MIPRE_Foundations_Cost_Universal
import Definitions.Def_MIPRE_Foundations_Cost_Universal_B
import Definitions.Def_MIPRE_Foundations_Cost_Kleene
import Definitions.Def_MIPRE_Foundations_Cost_Kleene_B
import Definitions.Def_MIPRE_Foundations_GameDouble
import Definitions.Def_MIPRE_Foundations_Verifier
import Definitions.Def_MIPRE_Foundations_GapCompression
import Definitions.Def_MIPRE_Foundations_VerifierValue
import Definitions.Def_MIPRE_Foundations_Halting_Freeze
import Definitions.Def_MIPRE_Foundations_Halting_Classes
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
import Definitions.Def_MIPRE_Foundations_Cost_Growth
import Definitions.Def_MIPRE_Foundations_Halting_Arith
import Definitions.Def_MIPRE_Foundations_Halting_Wrapper
import Definitions.Def_MIPRE_Foundations_Halting_PolyBounded
import Definitions.Def_MIPRE_Foundations_Halting_WrapperCost
open MIPRE
open MIPRE.Cost
open MIPRE.Cost.Prog
open MIPRE.Cost.Data
variable {ℓ : ℕ} (U : UniversalMachine) (S : CL.Sampler ℓ)theorem MIPRE.Cost.Prog.polyBounded_wrapHeadZ {Cf : ℕ → ℕ} (hCf : PolyBounded Cf) (kf : ℕ)
(hdim : PolyBounded S.dim) : PolyBounded fun n => wrapHeadZ U S Cf kf n := by sorry