Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1: the three-machine flow shop FS, with at most two nonzero tasks per job, has a schedule of finish time ≤2T\le 2T≤2T, preemptive or not, iff SSS has a partition

Proved
FlowJobShop.PartitionFlow.theorem_1

by mikedeng1 · Oct 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

flow-shopnp-completenessp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1preemptive-schedulingreductionscheduling

Let S={a1,…,an}S=\{a_1,\dots,a_n\}S={a1​,…,an​} be a multiset of nonnegative integers, T=∑i=1naiT=\sum_{i=1}^n a_iT=∑i=1n​ai​, and FS the flow shop with m=3m=3m=3 processors and n+2n+2n+2 jobs built from SSS in the proof of Lemma 1. Then

  1. every job of FS has at most two nonzero tasks;
  2. FS has a preemptive schedule with finish time ≤2T\le 2T≤2T if and only if SSS has a partition;
  3. FS has a non-preemptive schedule with finish time ≤2T\le 2T≤2T if and only if SSS has a partition.

In symbols, with FT\mathrm{FT}FT the finish time,

(∃S′ preemptive, FT(S′)≤2T)  ⟺  PARTITION(S)  ⟺  (∃S′ non-preemptive, FT(S′)≤2T).\big(\exists S'\ \text{preemptive},\ \mathrm{FT}(S')\le 2T\big)\iff \mathrm{PARTITION}(S)\iff\big(\exists S'\ \text{non-preemptive},\ \mathrm{FT}(S')\le 2T\big).(∃S′ preemptive, FT(S′)≤2T)⟺PARTITION(S)⟺(∃S′ non-preemptive, FT(S′)≤2T).

The paper states Theorem 1 as "FOFT with m=3m=3m=3 and no job having more than two nonzero tasks is NP-complete", proved by Lemma 1 (Partition reduces to preemptive FOFT), Lemma 2 (preemptive FOFT is in NP) and the remark that the same proof covers non-preemptive FOFT (Corollary 1). The formal statement is the mathematical content of the hardness half: the restriction to three processors and two nonzero tasks per job, and the equivalence for the constructed instance in both scheduling models. This makes the three-machine flow shop with two nonzero tasks per job the simplest flow-shop finish-time problem known to be NP-complete.

Formalization Note "NP-complete", polynomial-time reducibility and membership in NP (Lemma 2) are not formalized. m=3m=3m=3 is fixed by the type of FS.

Preamble
import Mathlib
import Definitions.Def_FlowJobShop_PartitionFlow_FlowShop
import Definitions.Def_FlowJobShop_PartitionFlow_Partition
import Definitions.Def_FlowJobShop_PartitionFlow_Instance

open FlowJobShop.PartitionFlow.FlowShop
Formal statement
namespace FlowJobShop.PartitionFlow

/-- Theorem 1 (Gonzalez–Sahni 1978, p. 38), in the form its proof establishes: for every
PARTITION instance `S = {a_1, …, a_n}`, the three-processor flow shop FS built from it has at
most two nonzero tasks per job, and it has a preemptive schedule with finish time `≤ 2T` iff
`S` has a partition, and a non-preemptive schedule with finish time `≤ 2T` iff `S` has a
partition. -/
theorem theorem_1 {n : ℕ} (a : Fin n → ℕ) :
    (FS a).AtMostTwoNonzeroTasks ∧
      ((∃ S : PreemptiveSchedule (FS a), S.finishTime ≤ 2 * T a) ↔ HasPartition a) ∧
      ((∃ S : PreemptiveSchedule (FS a), S.IsNonPreemptive ∧ S.finishTime ≤ 2 * T a) ↔
        HasPartition a) := by sorry

end FlowJobShop.PartitionFlow
Source
Gonzalez, Sahni, Flowshop and Jobshop Schedules: Complexity and Approximation, Operations Research 26(1) (1978), p. 38, Theorem 1 (with Lemma 1, p. 38–39, and Corollary 1, pp. 39–40)
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 6, 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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me