Cost of one layer of the dynamic program
ProvedOAI.ThreeMachine.StackCompiler.Costs.layerStepThroughout, a routine R : Uniform f is a program in the compiler's while-language Code, with a charge function, that computes the function family on encoded data. R.time i x is the charge of on the encoding of , a natural number that bounds the number of evaluation steps of the program on that input. For , the predicate Poly s f d means that there is a constant with for all . Let be an index type with , with table and family lengths satisfying Poly n of degree , candidate-triple list length of degree , and tables good for and bounded: Algorithm.TableGood says that each stored block is a valid full schedule of its set, and Algorithm.TableBounded that each stored block has all time values at most its length. The routine Uniform.layerStep, which solves the given family of sets from the table (Algorithm.solve) and records the results (Algorithm.tableOf), has running time satisfying Poly n of degree .
Formalization Note The statement is reproduced verbatim from upstream SchedulingCosts.lean (openai/math, Apache-2.0, credit OpenAI). It feeds the bound requestRawBound_poly and the running-time statement of main_theorem.
import Mathlib
import Definitions.Def_OAIThreeMachineSched02
set_option maxHeartbeats 2000000
set_option maxRecDepth 100000
set_option linter.all false
set_option Elab.async false
namespace OAI
section
namespace ThreeMachine.StackCompiler.Costs
variable {J : Type} (n : J → ℕ) (U : ∀ j, Universe (n j)) (M : ∀ j, Matrix (n j))
variable (tab : ∀ j, Table (n j)) (fs zs : ∀ j, List (Finset (Fin (n j))))
theorem layerStep
(hl : Poly n (fun j => (tab j).length) 30000)
(hf : Poly n (fun j => (fs j).length) 30000) (hz : Poly n (fun j => (zs j).length) 3)
(ht : ∀ j, Algorithm.TableGood (matrixRel (M j)) (tab j))
(hb : ∀ j, Algorithm.TableBounded (tab j)) :
Poly n (fun j => Uniform.layerStep.time (n j) ((U j,(M j,(fs j,zs j))),tab j)) 150009 := by
sorry
end ThreeMachine.StackCompiler.Costs
end
end OAI