Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

p. 65, worked example — the order (5, 1, 4, 3, 2) takes 47 units, the reversed order 78

Proved
JohnsonFlowShop.TwoStage.example_p65

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

flow-shopjohnson-rulep2o-batch-p200bp2o-gran-per-chapterp2o-plan-paperp2o-v1scheduling

Consider the five items of Johnson's example, with processing times

item (paper)12345
AiA_iAi​443062
BiB_iBi​514303

For an order ρ\rhoρ, write T(ρ)T(\rho)T(ρ) for the total elapsed time of its as-soon-as-possible schedule. Then

  1. the order (5,1,4,3,2)(5, 1, 4, 3, 2)(5,1,4,3,2) has T=47T = 47T=47;
  2. its total delay (idle) time on machine 2 is 47−∑iBi=47−43=447 - \sum_i B_i = 47 - 43 = 447−∑i​Bi​=47−43=4;
  3. the reversed order (2,3,4,1,5)(2, 3, 4, 1, 5)(2,3,4,1,5) has T=78T = 78T=78;
  4. every order ρ\rhoρ satisfies 47≤T(ρ)≤7847 \le T(\rho) \le 7847≤T(ρ)≤78.

So (5,1,4,3,2)(5, 1, 4, 3, 2)(5,1,4,3,2), the order the working rule produces, is optimal and the reversed order is the worst possible.

Formalization Note Items are 0-based in Lean: the paper's order (5,1,4,3,2)(5,1,4,3,2)(5,1,4,3,2) is the permutation σ\sigmaσ with σ=(4,0,3,2,1)\sigma = (4, 0, 3, 2, 1)σ=(4,0,3,2,1) (position ↦\mapsto↦ item) and the reversed order (2,3,4,1,5)(2,3,4,1,5)(2,3,4,1,5) is τ=(1,2,3,0,4)\tau = (1, 2, 3, 0, 4)τ=(1,2,3,0,4). "Optimal" and "worst" are stated over all orders with their as-soon-as-possible schedules.

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

/-- The worked example of p. 65, with items renumbered 0–4: `A = (4, 4, 30, 6, 2)`,
`B = (5, 1, 4, 30, 3)`. The order `(4, 0, 3, 2, 1)` (the paper's `(5, 1, 4, 3, 2)`) has
as-soon-as-possible total elapsed time 47 and total machine-2 idle time `47 - ∑ B = 4`; the
reversed order `(1, 2, 3, 0, 4)` has 78; every order has total elapsed time between 47 and 78. -/
theorem example_p65 :
    let A : Fin 5 → ℝ := ![4, 4, 30, 6, 2]
    let B : Fin 5 → ℝ := ![5, 1, 4, 30, 3]
    let σ : Equiv.Perm (Fin 5) := ⟨![4, 0, 3, 2, 1], ![1, 4, 3, 2, 0], by decide, by decide⟩
    let τ : Equiv.Perm (Fin 5) := ⟨![1, 2, 3, 0, 4], ![3, 0, 1, 2, 4], by decide, by decide⟩
    Shared.makespan B (asapStart2 A B σ) = 47 ∧
    Shared.makespan B (asapStart2 A B σ) - ∑ i, B i = 4 ∧
    Shared.makespan B (asapStart2 A B τ) = 78 ∧
    ∀ ρ : Equiv.Perm (Fin 5),
      47 ≤ Shared.makespan B (asapStart2 A B ρ) ∧ Shared.makespan B (asapStart2 A B ρ) ≤ 78 := by sorry

end JohnsonFlowShop.TwoStage
Source
Johnson, Optimal Two- and Three-Stage Production Schedules with Setup Times Included, NRLQ 1(1) 1954, p. 65, worked example (table of A_i, B_i)
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