Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4(b) — KNAPSACK has a solution iff the constructed n∣1∣Lmax⁡≤0∣∑wjCjn|1|L_{\max}\le0|\sum w_jC_jn∣1∣Lmax​≤0∣∑wj​Cj​ instance has value ≤y\le y≤y

Proved
SchedComplexity.OneMachine.theorem_4b_equivalence

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

deadlinesknapsacknp-completenessp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1schedulingsingle-machineweighted-completion-time

Let a1,…,at,ba_1,\dots,a_t,ba1​,…,at​,b be positive integers with 0<b<A=∑j∈Taj0<b<A=\sum_{j\in T}a_j0<b<A=∑j∈T​aj​. Consider the single-machine instance of reduction (b): n=t+1n=t+1n=t+1 jobs, all released at 000; for j∈Tj\in Tj∈T, pj1=wj=ajp_{j1}=w_j=a_jpj1​=wj​=aj​ and dj=A+1d_j=A+1dj​=A+1; for the last job pn1=1p_{n1}=1pn1​=1, wn=0w_n=0wn​=0, dn=b+1d_n=b+1dn​=b+1. Put

y=∑j,k∈T, j≤kajak+A−b.y=\sum_{j,k\in T,\ j\le k}a_ja_k+A-b .y=j,k∈T, j≤k∑​aj​ak​+A−b.

Then KNAPSACK has a solution iff some feasible schedule meets every due date and has small weighted completion time:

∃ S⊆T: ∑j∈Saj=b⟺∃ feasible schedule with Cj≤dj ∀j  and  ∑j=1nwjCj≤y.\exists\,S\subseteq T:\ \sum_{j\in S}a_j=b\quad\Longleftrightarrow\quad \exists\text{ feasible schedule with } C_j\le d_j\ \forall j\ \text{ and }\ \sum_{j=1}^n w_jC_j\le y .∃S⊆T: j∈S∑​aj​=b⟺∃ feasible schedule with Cj​≤dj​ ∀j  and  j=1∑n​wj​Cj​≤y.

This is the equivalence behind KNAPSACK ∝n∣1∣Lmax⁡≤0∣∑wjCj\propto n|1|L_{\max}\le0|\sum w_jC_j∝n∣1∣Lmax​≤0∣∑wj​Cj​. The paper computes, for the processing order ({Jj∣j∈S},Jn,{Jj∣j∈T−S})(\{J_j\mid j\in S\},J_n,\{J_j\mid j\in T-S\})({Jj​∣j∈S},Jn​,{Jj​∣j∈T−S}), that ∑wjCj=y−Ln≥y\sum w_jC_j=y-L_n\ge y∑wj​Cj​=y−Ln​≥y with Ln=∑j∈Saj−b≤0L_n=\sum_{j\in S}a_j-b\le0Ln​=∑j∈S​aj​−b≤0, and concludes "The equivalence follows immediately."

Formalization Note 0<b<A0<b<A0<b<A is the proof's standing assumption (p. 16). The double sum runs over ordered pairs of indices j≤kj\le kj≤k (diagonal included). Schedules may contain idle time and any processing order; the paper's computation covers idle-free orders of the displayed shape, and the statement asserts the equivalence over all feasible schedules.

Preamble
import Mathlib
import Definitions.Def_SchedComplexity_OneMachine_Knapsack
import Definitions.Def_SchedComplexity_OneMachine_Constructions
Formal statement
namespace SchedComplexity.OneMachine

/-- Theorem 4(b), equivalence (Brucker, Lenstra & Rinnooy Kan, Report BW 43/75, p. 19): for
positive integers `a_1, …, a_t, b` with `0 < b < A = ∑ a_j`, KNAPSACK has a solution iff the
constructed `n|1|L_max≤0|∑w_jC_j` instance has a feasible schedule meeting every due date
(`C_j ≤ d_j` for all `j`) with `∑ w_j C_j ≤ y = ∑_{j,k∈T, j≤k} a_j a_k + A - b`. -/
theorem theorem_4b_equivalence (a : List ℕ) (b : ℕ) (ha : ∀ v ∈ a, 0 < v) (hb : 0 < b)
    (hbA : b < a.sum) :
    KnapsackYes a b ↔
      ∃ B, (instB a b).IsFeasible B ∧ (∀ j, (instB a b).C B j ≤ (instB a b).d j) ∧
        (instB a b).sumWC B ≤ yB a b := by sorry

end SchedComplexity.OneMachine
Source
Brucker, Lenstra & Rinnooy Kan, Complexity of Machine Scheduling Problems, Mathematisch Centrum Report BW 43/75 (1975), p. 19, Theorem 4(b)
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