Cost of one expansion step of the marked states
ProvedOAI.ThreeMachine.StackCompiler.Costs.markingsStepThroughout, 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 tables, state lists and mark lists of lengths satisfying Poly n of degrees , and , and with all blocks small in tables and marks, where BlockSmall b means that the length of and all its time values are at most . The routine Uniform.markingsStep, performing Algorithm.expand on these data, has running time satisfying Poly n of degree .
Formalization Note The statement is reproduced verbatim from upstream TableCosts.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
universe u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14
section
namespace ThreeMachine.StackCompiler.Uniform
variable {I : Type u1} {α : I → Type u2} {β : I → Type u3} {γ : I → Type u4}
variable [∀ i, Coding (α i)] [∀ i, Coding (β i)] [∀ i, Coding (γ i)]
end ThreeMachine.StackCompiler.Uniform
namespace ThreeMachine.StackCompiler
variable {α : Type u5} {β : Type u6} [Coding α] [Coding β]
end ThreeMachine.StackCompiler
namespace ThreeMachine.StackCompiler.Poly
variable {I : Type u7} {J : Type u8} {s : J → ℕ} {α : I → Type u9} {β : I → Type u10} {γ : I → Type u11}
variable [∀ i, Coding (α i)] [∀ i, Coding (β i)] [∀ i, Coding (γ i)]
end ThreeMachine.StackCompiler.Poly
end
section
namespace ThreeMachine.StackCompiler.Uniform
end ThreeMachine.StackCompiler.Uniform
namespace ThreeMachine.StackCompiler.Costs
variable {J : Type} (n : J → ℕ)
variable (U : ∀ j, Universe (n j)) (tab : ∀ j, Table (n j))
variable (ms : ∀ j, Marks (n j)) (v : ∀ j, Algorithm.State (Fin (n j)))
end ThreeMachine.StackCompiler.Costs
end
section
namespace ThreeMachine.StackCompiler.Poly
variable {J : Type} {s n : J → ℕ} {d l : ℕ}
end ThreeMachine.StackCompiler.Poly
end
section
namespace ThreeMachine.StackCompiler.Uniform
end ThreeMachine.StackCompiler.Uniform
namespace ThreeMachine.StackCompiler.Costs
variable {J : Type} (n : J → ℕ) (tab : ∀ j, Table (n j))
end ThreeMachine.StackCompiler.Costs
end
section
namespace ThreeMachine.StackCompiler.Uniform
end ThreeMachine.StackCompiler.Uniform
namespace ThreeMachine.StackCompiler
namespace Costs
variable {J : Type} (n : J → ℕ) (U : ∀ j, Universe (n j)) (tab : ∀ j, Table (n j))
variable (sts : ∀ j, List (Algorithm.State (Fin (n j))))
theorem markingsStep (ms : ∀ j, Marks (n j))
(hl : Poly n (fun j => (tab j).length) 30000)
(hsl : Poly n (fun j => (sts j).length) 30003)
(hml : Poly n (fun j => (ms j).length) 30003)
(ht : ∀ j, TableSmall (tab j)) (hm : ∀ j, MarksSmall (ms j)) :
Poly n (fun j => Uniform.markingsStep.time (n j) ((U j,(tab j,sts j)),ms j)) 120008 := by
sorry
end Costs
end ThreeMachine.StackCompiler
end
end OAI