Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

p. 62, display "In general" — total elapsed time =∑iBi+max⁡uKu= \sum_i B_i + \max_u K_u=∑i​Bi​+maxu​Ku​

Proved
JohnsonFlowShop.TwoStage.makespan_asap_eq

by mikedeng1 · Sep 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

flow-shopp2o-batch-p200bp2o-gran-per-chapterp2o-plan-paperp2o-v1scheduling

Let n≥1n \ge 1n≥1 items have positive processing times Ai>0A_i > 0Ai​>0 and Bi>0B_i > 0Bi​>0, and let σ\sigmaσ be an order, σ(k)\sigma(k)σ(k) being the item in position kkk. For the as-soon-as-possible schedule aaa of σ\sigmaσ, the total elapsed time is

T(a)=∑iBi+max⁡0≤u≤n−1Ku=∑iBi+F(σ),Ku=∑l≤uAσ(l)−∑l<uBσ(l).T(a) = \sum_{i} B_i + \max_{0 \le u \le n-1} K_u = \sum_i B_i + F(\sigma), \qquad K_u = \sum_{l \le u} A_{\sigma(l)} - \sum_{l < u} B_{\sigma(l)} .T(a)=i∑​Bi​+0≤u≤n−1max​Ku​=i∑​Bi​+F(σ),Ku​=l≤u∑​Aσ(l)​−l<u∑​Bσ(l)​.

Equivalently, writing XkX_kXk​ for the idle time of machine 2 immediately before the item in position kkk comes onto it, ∑kXk=max⁡uKu\sum_k X_k = \max_u K_u∑k​Xk​=maxu​Ku​: this is Johnson's display ∑1nXi=max⁡1≤u≤nKu\sum_1^n X_i = \max_{1 \le u \le n} K_u∑1n​Xi​=max1≤u≤n​Ku​. It turns the scheduling problem into the combinatorial problem of choosing an order that minimizes FFF.

Formalization Note Positions are 0-based, so Lean's KuK_uKu​ is the paper's Ku+1K_{u+1}Ku+1​ and the maximum runs over u=0,…,n−1u = 0, \dots, n-1u=0,…,n−1. The statement is given in the elapsed-time form (total time = total machine-2 processing time plus total machine-2 idle time).

Preamble
import Mathlib
import Definitions.Def_JohnsonFlowShop_Shared_makespan
import Definitions.Def_JohnsonFlowShop_TwoStage_asapStart2
import Definitions.Def_JohnsonFlowShop_Shared_K
import Definitions.Def_JohnsonFlowShop_TwoStage_F
Formal statement
namespace JohnsonFlowShop.TwoStage

/-- p. 62, display "In general": for the as-soon-as-possible schedule of the order `σ`, the total
idle time of machine 2 is `max_u K_u`; equivalently the total elapsed time is
`∑_i B_i + max_u K_u = ∑_i B_i + F(σ)`. -/
theorem makespan_asap_eq {n : ℕ} [NeZero n] (A B : Fin n → ℝ)
    (hA : ∀ i, 0 < A i) (hB : ∀ i, 0 < B i) (σ : Equiv.Perm (Fin n)) :
    Shared.makespan B (asapStart2 A B σ) = ∑ i, B i + F A B σ := by sorry

end JohnsonFlowShop.TwoStage
Source
Johnson, Optimal Two- and Three-Stage Production Schedules with Setup Times Included, NRLQ 1(1) 1954, p. 62, Two-stage production schedule, display "In general"
Human review
  • Endorsed by Shuze Chen · Oct 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 1, 2026

    Confirmed by the mission captain (proposal self-audit).

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