Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4(a): KNAPSACK is reducible to n∣1∣rn≥0,wj=1∣∑wjCjn|1|r_n\ge0,w_j=1|\sum w_jC_jn∣1∣rn​≥0,wj​=1∣∑wj​Cj​

Proved
SchedComplexity.TotalCompletion.theorem_4a_knapsack_reducible

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

knapsacknp-completenessp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1reductionschedulingtotal-completion-time

Brucker, Lenstra and Rinnooy Kan state (Theorem 4, p. 16):

THEOREM 4. KNAPSACK is reducible to the following problems: (a) n∣1∣rn≥0,wj=1∣∑wjCjn|1|r_n\ge0,w_j=1|\sum w_jC_jn∣1∣rn​≥0,wj​=1∣∑wj​Cj​; (b) n∣1∣Lmax⁡≤0∣∑wjCjn|1|L_{\max}\le0|\sum w_jC_jn∣1∣Lmax​≤0∣∑wj​Cj​; (c) n∣1∣rn≥0∣Lmax⁡n|1|r_n\ge0|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\ge0,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\ge0|C_{\max}n∣2∣F,rn​≥0∣Cmax​; (h) n∣2∣F,tree∣Cmax⁡n|2|F,tree|C_{\max}n∣2∣F,tree∣Cmax​; (i) n∣2∣G,mj≤3∣Cmax⁡n|2|G,m_j\le3|C_{\max}n∣2∣G,mj​≤3∣Cmax​; (j) n∣3∣G,mj≤2∣Cmax⁡n|3|G,m_j\le2|C_{\max}n∣3∣G,mj​≤2∣Cmax​.

This item formalizes part (a). Here "reducible" is the paper's notion (Section 2): every instance of KNAPSACK can be transformed in polynomial time into an instance of the scheduling problem with the same answer. Precisely, there is a function fff on strings, computable in polynomial time, such that for every string xxx,

x∈KNAPSACK  ⟺  f(x)∈L(n∣1∣rn≥0,wj=1∣∑wjCj),x\in\mathrm{KNAPSACK} \iff f(x)\in L\bigl(n|1|r_n\ge0,w_j=1|\textstyle\sum w_jC_j\bigr),x∈KNAPSACK⟺f(x)∈L(n∣1∣rn​≥0,wj​=1∣∑wj​Cj​),

where KNAPSACK is the language of binary codes of solvable instances with positive entries, and the target language consists of the codes of pairs (instance, yyy) such that the instance has unit weights, release date 000 for every job except the last, and a feasible single-machine schedule with ∑jCj≤y\sum_jC_j\le y∑j​Cj​≤y.

The target instances are written in the multiplicity encoding of the paper's Remark (p. 23): "In the last two reductions the size of the scheduling problem depends on AAA and a∗a_*a∗​. It can be questioned if these reductions are truly polynomial-bounded: in some encodings the length of the scheduling input string is polynomial in AAA and a∗a_*a∗​ and thus exponential in the length of the KNAPSACK input string, the latter one being proportional to log⁡2a∗\log_2 a_*log2​a∗​. We may settle this question, however, by characterizing a subset of jobs with identical data (pjr,wj,rj,dj)(p_{jr},w_j,r_j,d_j)(pjr​,wj​,rj​,dj​) by its cardinality and a single copy of the data." The last two reductions are (d) and (a).

With the NP-completeness of KNAPSACK (Theorem 2(b)) the result shows that the single-machine total completion time problem becomes NP-complete as soon as one job has a nonzero release date.

Formalization Note Reducibility is CookPvsNP.PolyReducible from the published definition CookPvsNP_defs (polynomial-time many-one reducibility in Cook's machine model); polynomiality is part of the statement. Numbers are coded in binary over the alphabet of ProjSchedTW.Complexity.Encoding. The target language uses the multiplicity encoding: a list of job types (count, processing time, weight, release date) and the threshold yyy, with class membership checked on the expanded job list. Under a one-entry-per-job encoding the construction is not polynomial and the paper does not claim the statement. Starting times are natural numbers (Section 3).

Preamble
import Mathlib
import Definitions.Def_CookPvsNP_defs
import Definitions.Def_SchedComplexity_TotalCompletion_Knapsack
import Definitions.Def_SchedComplexity_TotalCompletion_SingleMachine
Formal statement
namespace SchedComplexity.TotalCompletion

/-- Theorem 4(a) (p. 16; proof pp. 22–23; Remark p. 23): KNAPSACK is reducible to
`n|1|r_n≥0,w_j=1|Σw_jC_j`, as a polynomial-time many-one reduction (`CookPvsNP.PolyReducible`)
from the binary-coded KNAPSACK language to the language of the scheduling problem in the
multiplicity encoding of the Remark on p. 23. -/
theorem theorem_4a_knapsack_reducible :
    CookPvsNP.PolyReducible knapsackLang sumCLangMult := by sorry

end SchedComplexity.TotalCompletion
Source
Brucker, Lenstra & Rinnooy Kan, Complexity of Machine Scheduling Problems, Mathematisch Centrum Report BW 43/75 (1975), p. 16, Theorem 4(a); proof pp. 22–23; Remark p. 23; Section 2, p. 4 (reducibility)
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