Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4(g)–(j) — KNAPSACK reduces to two flow-shop and two job-shop makespan problems

Proved
SchedComplexity.Shops.theorem_4_ghij_knapsack_reducible

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

flow-shopjob-shopknapsacknp-completenessp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1scheduling

Theorem 4 of the report reads: KNAPSACK is reducible to the following problems: (a) n∣1∣rn≥0,wj=1∣∑wjCjn|1|r_n{\ge}0,w_j{=}1|\sum w_jC_jn∣1∣rn​≥0,wj​=1∣∑wj​Cj​; (b) n∣1∣Lmax⁡≤0∣∑wjCjn|1|L_{\max}{\le}0|\sum w_jC_jn∣1∣Lmax​≤0∣∑wj​Cj​; (c) n∣1∣rn≥0∣Lmax⁡n|1|r_n{\ge}0|L_{\max}n∣1∣rn​≥0∣Lmax​; (d) n∣1∣∣∑wjTjn|1||\sum w_jT_jn∣1∣∣∑wj​Tj​; (e) n∣1∣∣∑wjUjn|1||\sum w_jU_jn∣1∣∣∑wj​Uj​; (f) n∣1∣rn≥0,wj=1∣∑wjUjn|1|r_n{\ge}0,w_j{=}1|\sum w_jU_jn∣1∣rn​≥0,wj​=1∣∑wj​Uj​; (g) n∣2∣F,rn≥0∣Cmax⁡n|2|F,r_n{\ge}0|C_{\max}n∣2∣F,rn​≥0∣Cmax​; (h) n∣2∣F,tree∣Cmax⁡n|2|F,\mathit{tree}|C_{\max}n∣2∣F,tree∣Cmax​; (i) n∣2∣G,mj≤3∣Cmax⁡n|2|G,m_j{\le}3|C_{\max}n∣2∣G,mj​≤3∣Cmax​; (j) n∣3∣G,mj≤2∣Cmax⁡n|3|G,m_j{\le}2|C_{\max}n∣3∣G,mj​≤2∣Cmax​. Only parts (g)–(j) are formalized here.

Write LKSL_{\mathrm{KS}}LKS​ for the language of binary codes of KNAPSACK yes-instances with positive data, and Lg,Lh,Li,LjL_g, L_h, L_i, L_jLg​,Lh​,Li​,Lj​ for the languages of the four recognition problems (instance in the class and a feasible schedule with Cmax⁡≤yC_{\max}\le yCmax​≤y). The theorem states

LKS≤pLg,LKS≤pLh,LKS≤pLi,LKS≤pLj,L_{\mathrm{KS}}\le_p L_g,\qquad L_{\mathrm{KS}}\le_p L_h,\qquad L_{\mathrm{KS}}\le_p L_i,\qquad L_{\mathrm{KS}}\le_p L_j,LKS​≤p​Lg​,LKS​≤p​Lh​,LKS​≤p​Li​,LKS​≤p​Lj​,

where ≤p\le_p≤p​ is polynomial-time many-one reducibility: a function computable in polynomial time by a Turing machine maps every string xxx to a string f(x)f(x)f(x) with x∈LKS  ⟺  f(x)∈L∗x\in L_{\mathrm{KS}}\iff f(x)\in L_\astx∈LKS​⟺f(x)∈L∗​.

Together with the NP-completeness of KNAPSACK, this shows that minimizing the makespan is NP-hard already in the two-machine flow shop with one nonzero release date or with tree-like precedence constraints, and in job shops with two machines and at most three operations per job or three machines and at most two operations per job.

Formalization Note "Reducible" (Section 2, p. 4) is read as Karp reducibility, CookPvsNP.PolyReducible from the published definitions CookPvsNP_defs. Strings are over the four-letter alphabet of ProjSchedTW.Complexity.Encoding, with every number in binary. Membership in NP is not part of the statement.

Preamble
import Mathlib
import Definitions.Def_SchedComplexity_OneMachine_Knapsack
import Definitions.Def_SchedComplexity_Shops_Problems
Formal statement
namespace SchedComplexity.Shops

open CookPvsNP

/-- Theorem 4(g), (h), (i), (j), Brucker, Lenstra & Rinnooy Kan, Report BW 43/75, p. 16: KNAPSACK
is polynomial-time many-one reducible to each of `n|2|F,r_n≥0|C_max`, `n|2|F,tree|C_max`,
`n|2|G,m_j≤3|C_max` and `n|3|G,m_j≤2|C_max`. -/
theorem theorem_4_ghij_knapsack_reducible :
    PolyReducible SchedComplexity.OneMachine.knapsackLang langFlowRn ∧ PolyReducible SchedComplexity.OneMachine.knapsackLang langFlowTree ∧
    PolyReducible SchedComplexity.OneMachine.knapsackLang langJob2Ops3 ∧ PolyReducible SchedComplexity.OneMachine.knapsackLang langJob3Ops2 := by sorry

end SchedComplexity.Shops
Source
Brucker, Lenstra & Rinnooy Kan, Complexity of Machine Scheduling Problems, Mathematisch Centrum Report BW 43/75 (1975), p. 16, Theorem 4(g), (h), (i), (j); proofs pp. 16–18
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