Cost of computing the output from a closed precedence matrix
ProvedOAI.ThreeMachine.StackCompiler.Costs.answerMatrixThroughout, 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 where satisfies Poly s of degree , and let be optional deadlines whose value (default ) satisfies Poly s of degree . The routine Uniform.answerMatrix, returning answerMatrix M d, namely a schedule for the deadline when is given and otherwise an optimal one, has running time satisfying Poly s of degree .
Formalization Note The statement is reproduced verbatim from upstream RequestBounds.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} (s n : J → ℕ) (U : ∀ j, Universe (n j)) (M : ∀ j, Matrix (n j))
theorem answerMatrix (d : J → Option ℕ) (hn : Poly s n 1)
(hd : Poly s (fun j => (d j).getD 0) 1) :
Poly s (fun j => Uniform.answerMatrix.time (n j) (U j,(M j,d j))) 150011 := by
sorry
end ThreeMachine.StackCompiler.Costs
end
end OAI