Cost of one table lookup and advance step
ProvedOAI.ThreeMachine.StackCompiler.Costs.tryAdvanceThroughout, 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 , suppose the lookup tables have length satisfying Poly n of degree and contain only small blocks, and that the blocks in the marked states are small, where BlockSmall b means that the length of and all its time values are at most . The routine Uniform.tryAdvance, which attempts Algorithm.tryAdvance from a marked state using the table, has running time satisfying Poly n of degree .
Formalization Note The statement is reproduced verbatim from upstream SolverCosts.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 → ℕ)
variable (U : ∀ j, Universe (n j)) (tab : ∀ j, Table (n j))
variable (u : ∀ j, Algorithm.State (Fin (n j)) × Algorithm.Block (Fin (n j)))
variable (v : ∀ j, Algorithm.State (Fin (n j)))
theorem tryAdvance
(hl : Poly n (fun j => (tab j).length) 30000)
(ht : ∀ j, TableSmall (tab j)) (hb : ∀ j, BlockSmall (u j).2) :
Poly n (fun j => Uniform.tryAdvance.time (n j) (U j,(tab j,(u j,v j)))) 60002 := by
sorry
end ThreeMachine.StackCompiler.Costs
end
end OAI