Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 2 — if min⁡Ai≥max⁡Bj\min A_i \ge \max B_jminAi​≥maxBj​, Johnson's rule on A+BA+BA+B, B+CB+CB+C gives an optimal three-stage schedule

Proved
JohnsonFlowShop.ThreeStage.johnson_three_stage_optimal

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

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

Let Ai,Bi,Ci>0A_i, B_i, C_i > 0Ai​,Bi​,Ci​>0 be the processing times of nnn items on machines 1, 2, 3, and suppose every AiA_iAi​ is at least every BjB_jBj​ (min⁡iAi≥max⁡jBj\min_i A_i \ge \max_j B_jmini​Ai​≥maxj​Bj​). Then

  1. there is an ordering σ\sigmaσ of the items consistent with all definite preferences of Johnson's relation (IV): item iii precedes item jjj whenever
min⁡(Ai+Bi, Cj+Bj)<min⁡(Aj+Bj, Ci+Bi);\min(A_i + B_i,\ C_j + B_j) < \min(A_j + B_j,\ C_i + B_i);min(Ai​+Bi​, Cj​+Bj​)<min(Aj​+Bj​, Ci​+Bi​);
  1. for every such ordering σ\sigmaσ, the as-soon-as-possible three-machine schedule of σ\sigmaσ is feasible and its total elapsed time is at most that of every feasible three-machine schedule:
makespan⁡(as-soon-as-possible schedule of σ)≤makespan⁡(s3)for every feasible (s1,s2,s3).\operatorname{makespan}\bigl(\text{as-soon-as-possible schedule of } \sigma\bigr) \le \operatorname{makespan}(s^3)\quad\text{for every feasible } (s^1, s^2, s^3).makespan(as-soon-as-possible schedule of σ)≤makespan(s3)for every feasible (s1,s2,s3).

Items that are indifferent (equality in the rule) may be placed in either order, provided the ordering is consistent with the definite inequalities. The rule is Johnson's two-machine rule (Theorem 1) applied to the times Ai+BiA_i + B_iAi​+Bi​ and Bi+CiB_i + C_iBi​+Ci​.

Formalization Note The hypothesis min⁡Ai≥max⁡Bi\min A_i \ge \max B_iminAi​≥maxBi​ is read globally, Bj≤AiB_j \le A_iBj​≤Ai​ for all i,ji, ji,j, as in the section heading "MIN Ai≥A_i \geAi​≥ MAX BjB_jBj​". Under the pointwise reading Bi≤AiB_i \le A_iBi​≤Ai​ the conclusion is false (A=(6,10,8,8,5)A = (6,10,8,8,5)A=(6,10,8,8,5), B=(5,6,6,6,5)B = (5,6,6,6,5)B=(5,6,6,6,5), C=(6,3,7,5,4)C = (6,3,7,5,4)C=(6,3,7,5,4): the consistent ordering (1,3,4,2,5)(1,3,4,2,5)(1,3,4,2,5) takes 47, the optimum is 46). Optimality is against all feasible schedules, whose machine orders may differ, not only against permutation schedules. Part 1 makes part 2 non-vacuous.

Preamble
import Mathlib
import Definitions.Def_JohnsonFlowShop_ThreeStage_IsFeasible
import Definitions.Def_JohnsonFlowShop_Shared_makespan
import Definitions.Def_JohnsonFlowShop_ThreeStage_asapSchedule
import Definitions.Def_JohnsonFlowShop_ThreeStage_JohnsonOrdered
Formal statement
namespace JohnsonFlowShop.ThreeStage

/-- Theorem 2 (Johnson 1954, p. 67). If every `A_i` is at least every `B_j`
(and all processing times are positive), then (i) there is an order `σ` consistent with all
definite preferences of relation (IV), and (ii) for every such order the as-soon-as-possible
three-machine schedule of `σ` is feasible and its total elapsed time is at most that of every
feasible three-machine schedule. -/
theorem johnson_three_stage_optimal {n : ℕ} (A B C : Fin n → ℝ)
    (hA : ∀ i, 0 < A i) (hB : ∀ i, 0 < B i) (hC : ∀ i, 0 < C i)
    (hAB : ∀ i j, B j ≤ A i) :
    (∃ σ : Equiv.Perm (Fin n), JohnsonOrdered A B C σ) ∧
    ∀ σ : Equiv.Perm (Fin n), JohnsonOrdered A B C σ →
      IsFeasible A B C (asapStart1 A B C σ) (asapStart2 A B C σ) (asapStart3 A B C σ) ∧
      ∀ s₁ s₂ s₃ : Fin n → ℝ, IsFeasible A B C s₁ s₂ s₃ →
        Shared.makespan C (asapStart3 A B C σ) ≤ Shared.makespan C s₃ := by sorry

end JohnsonFlowShop.ThreeStage
Source
Johnson, Optimal Two- and Three-Stage Production Schedules with Setup Times Included, NRLQ 1(1) 1954, p. 67, Theorem 2
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