Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Cost of appending a selected triple to a block

Proved
OAI.ThreeMachine.StackCompiler.Costs.advanceB

by wurtle · Nov 4, 2026 · Mathlib 0df444a (Lean v4.33.1)

complexityschedulingthree-machine

Throughout, a routine R : Uniform f is a program in the compiler's while-language Code, with a charge function, that computes the function family fif_ifi​ on encoded data. R.time i x is the charge of RRR on the encoding of xxx, a natural number that bounds the number of evaluation steps of the program on that input. For s,f:I→Ns,f:I\to\mathbb{N}s,f:I→N, the predicate Poly s f d means that there is a constant CCC with f(i)≤C (s(i)+2)df(i)\le C\,(s(i)+2)^df(i)≤C(s(i)+2)d for all i∈Ii\in Ii∈I. Let JJJ be an index type with n:J→Nn:J\to\mathbb{N}n:J→N, and let bj,cjb_j,c_jbj​,cj​ be blocks whose volumes, the sizes of their encodings (volume), satisfy Poly n of degree 222. On an input (Uj,(vj,(bj,cj)))(U_j,(v_j,(b_j,c_j)))(Uj​,(vj​,(bj​,cj​))), the routine Uniform.advanceB returns Block.append v.left b Block.triple: the block bbb followed by one new slot, where jobs in the left part of the state vjv_jvj​ keep their times from bbb and all other jobs get the new slot. The block cjc_jcj​ does not affect this output. The running time satisfies Poly n of degree 555 on these inputs.

Formalization Note The statement is reproduced verbatim from upstream TransitionCosts.lean (openai/math, Apache-2.0, credit OpenAI). It feeds the bound requestRawBound_poly and the running-time statement of main_theorem.

Preamble
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

section
namespace ThreeMachine.StackCompiler.Uniform

end ThreeMachine.StackCompiler.Uniform
namespace ThreeMachine.StackCompiler.Costs

end ThreeMachine.StackCompiler.Costs
end

section
namespace ThreeMachine.StackCompiler.Costs
variable {J : Type} (n : J → ℕ) (U : ∀ j, Universe (n j)) (M : ∀ j, Matrix (n j))
variable (fs zs : ∀ j, List (Finset (Fin (n j)))) (W : ∀ j, Finset (Fin (n j)))

end ThreeMachine.StackCompiler.Costs
end

section
namespace ThreeMachine.StackCompiler.Uniform

end ThreeMachine.StackCompiler.Uniform
namespace ThreeMachine.StackCompiler.Costs
variable {J : Type u1} (n : J → ℕ) (x : ∀ j, Uniform.BlockAppendCellInput (n j))

end ThreeMachine.StackCompiler.Costs
end

section
namespace ThreeMachine.StackCompiler.Uniform

end ThreeMachine.StackCompiler.Uniform
namespace ThreeMachine.StackCompiler.Costs
variable {J : Type u2} (n : J → ℕ)
variable (U : ∀ j, Universe (n j)) (W : ∀ j, Finset (Fin (n j)))
variable (b c : ∀ j, Algorithm.Block (Fin (n j)))

end ThreeMachine.StackCompiler.Costs
end

section
namespace ThreeMachine.StackCompiler.Uniform

end ThreeMachine.StackCompiler.Uniform
namespace ThreeMachine.StackCompiler.Poly
variable {J : Type} {s n : J → ℕ} {d : ℕ}

end ThreeMachine.StackCompiler.Poly
namespace ThreeMachine.StackCompiler.Costs
variable {J : Type} (n : J → ℕ) (U : ∀ j, Universe (n j))
variable (v : ∀ j, Algorithm.State (Fin (n j))) (b c : ∀ j, Algorithm.Block (Fin (n j)))

Formal statement
theorem advanceB (hb : Poly n (fun j => volume (b j)) 2)
    (hc : Poly n (fun j => volume (c j)) 2) :
    Poly n (fun j => Uniform.advanceB.time (n j) (U j,(v j,(b j,c j)))) 5 := by
  sorry

end ThreeMachine.StackCompiler.Costs
end
end OAI
Source
OpenAI, "A Polynomial-Time Algorithm for Three-Machine Unit-Job Scheduling" (September 24, 2026), openai/math, cost bounds of the stack compiler. Lean: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/Scheduling/TransitionCosts.lean#L186

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me