Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section 6 — minimizing the weighted number of tardy jobs is equivalent to the prefix-constrained knapsack

Proved
LawlerMoore.WeightedTardy.equivalent_prefix_knapsack

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

knapsackp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1schedulingweighted-tardy-jobs

Let nnn jobs on a single machine have nonnegative integer processing times aj′a'_jaj′​, nonnegative integer deadlines numbered so that

d1≤d2≤⋯≤dn,d_1 \le d_2 \le \cdots \le d_n,d1​≤d2​≤⋯≤dn​,

and penalties pj≥0p_j \ge 0pj​≥0. Let W(σ)W(\sigma)W(σ) be the weighted number of tardy jobs of a sequence σ\sigmaσ, and call a 0–1 vector xxx prefix-feasible if a1′x1+⋯+ak′xk≤dka'_1 x_1 + \cdots + a'_k x_k \le d_ka1′​x1​+⋯+ak′​xk​≤dk​ for k=1,…,nk = 1, \dots, nk=1,…,n. Then

  1. for every sequence σ\sigmaσ of the jobs there is a prefix-feasible xxx with ∑jpj−∑jpjxj≤W(σ)\sum_j p_j - \sum_j p_j x_j \le W(\sigma)∑j​pj​−∑j​pj​xj​≤W(σ), and
  2. for every prefix-feasible xxx there is a sequence σ\sigmaσ with W(σ)≤∑jpj−∑jpjxjW(\sigma) \le \sum_j p_j - \sum_j p_j x_jW(σ)≤∑j​pj​−∑j​pj​xj​.

Consequently the minimum of WWW over all sequences equals ∑jpj\sum_j p_j∑j​pj​ minus the maximum of ∑jpjxj\sum_j p_j x_j∑j​pj​xj​ over prefix-feasible xxx: the weighted-tardy-jobs problem of Section 5 is equivalent to the knapsack-type problem

max⁡∑j=1npjxjs.t.a1′x1+⋯+ak′xk≤dk (k=1,…,n),xj∈{0,1}.\max \sum_{j=1}^n p_j x_j \quad\text{s.t.}\quad a'_1 x_1 + \cdots + a'_k x_k \le d_k \ (k = 1, \dots, n), \quad x_j \in \{0, 1\}.maxj=1∑n​pj​xj​s.t.a1′​x1​+⋯+ak′​xk​≤dk​ (k=1,…,n),xj​∈{0,1}.

Formalization Note The paper says the two problems are "equivalent" after "a little manipulation"; this is made explicit as the two inequalities above, which together say the optimal values correspond. The deadline numbering ("ordering the jobs by deadlines", Section 5) is the hypothesis Monotone d on the job index; the penalties are nonnegative. Both are needed: without either, the equivalence fails on small instances.

Preamble
import Mathlib
import Definitions.Def_MooreLateJobs_Shared_completionTime
import Definitions.Def_MooreLateJobs_NumLate_lateSet
import Definitions.Def_LawlerMoore_WeightedTardy_weightedTardy
import Definitions.Def_LawlerMoore_WeightedTardy_PrefixFeasible
Formal statement
namespace LawlerMoore.WeightedTardy

open MooreLateJobs.Shared

/-- §6 (p. 80): with the jobs numbered by deadline (`d` monotone) and penalties `p j ≥ 0`, the
problem of §5 is equivalent to the prefix-constrained knapsack problem: every sequence is matched
by a feasible `x` with `∑ p_j - ∑ p_j x_j` at most its weighted number of tardy jobs, and every
feasible `x` is matched by a sequence whose weighted number of tardy jobs is at most
`∑ p_j - ∑ p_j x_j`. -/
theorem equivalent_prefix_knapsack {n : ℕ} (a' d : Fin n → ℕ) (p : Fin n → ℝ)
    (hp : ∀ j, 0 ≤ p j) (hd : Monotone d) :
    (∀ l : List (Fin n), IsSchedule Finset.univ l →
      ∃ x : Fin n → Bool, PrefixFeasible a' d x ∧
        (∑ j, p j) - knapValue p x ≤ weightedTardy a' d p l) ∧
    (∀ x : Fin n → Bool, PrefixFeasible a' d x →
      ∃ l : List (Fin n), IsSchedule Finset.univ l ∧
        weightedTardy a' d p l ≤ (∑ j, p j) - knapValue p x) := by sorry

end LawlerMoore.WeightedTardy
Source
Lawler, Moore, A Functional Equation and Its Application to Resource Allocation and Sequencing Problems, Management Sci. 16 (1969), p. 80, Section 6
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