Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Theorem 5.2, Eq. (1) — a KNAPSACK solution yields a schedule meeting QAQ_AQA​ and QBQ_BQB​

Proved
TwoAgentSched.Knapsack.eq_1

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

knapsackp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1reductionschedulingtwo-agent

Let (u,w,b,W)(u,w,b,W)(u,w,b,W) be a KNAPSACK instance with nnn items and consider the two-agent instance of the proof of Theorem 5.2: AAA-jobs with piA=uip^A_i=u_ipiA​=ui​, wiA=wiw^A_i=w_iwiA​=wi​, one BBB-job with p1B=w^u^p^B_1=\hat w\hat up1B​=w^u^, and thresholds QB=b+p1BQ_B=b+p^B_1QB​=b+p1B​, QA=w^u^+(w^−W)p1BQ_A=\hat w\hat u+(\hat w-W)p^B_1QA​=w^u^+(w^−W)p1B​, where u^=∑iui\hat u=\sum_iu_iu^=∑i​ui​, w^=∑iwi\hat w=\sum_iw_iw^=∑i​wi​.

Let S⊆{1,…,n}S\subseteq\{1,\dots,n\}S⊆{1,…,n} solve KNAPSACK, i.e. ∑i∈Sui≤b\sum_{i\in S}u_i\le b∑i∈S​ui​≤b and ∑i∈Swi≥W\sum_{i\in S}w_i\ge W∑i∈S​wi​≥W, and let σ\sigmaσ be any sequence of all n+1n+1n+1 jobs in which the AAA-jobs sequenced before the BBB-job are exactly those JiAJ^A_iJiA​ with i∈Si\in Si∈S. Then

C1B(σ)≤QBand∑i=1nwiCiA(σ)≤QA.C^B_1(\sigma)\le Q_B\qquad\text{and}\qquad\sum_{i=1}^n w_iC^A_i(\sigma)\le Q_A .C1B​(σ)≤QB​andi=1∑n​wi​CiA​(σ)≤QA​.

This is the "KNAPSACK yes ⇒\Rightarrow⇒ schedule yes" direction of the reduction.

Formalization Note The paper writes the two estimates on the terms of (1) as strict ("smaller than"); they hold only with ≤\le≤ (with n=1n=1n=1, u1=w1=1u_1=w_1=1u1​=w1​=1, S={1}S=\{1\}S={1}, b=W=1b=W=1b=W=1, the cost equals QAQ_AQA​), and only ≤\le≤ is needed, so the statement uses ≤\le≤. The statement holds for every order of the jobs within SSS and within its complement. No positivity assumption is needed in this direction.

Preamble
import Mathlib
import Definitions.Def_TwoAgentSched_Knapsack_Construction
Formal statement
namespace TwoAgentSched.Knapsack

/-- Proof of Theorem 5.2, Eq. (1) (Agnetis et al. 2004, p. 233): from a KNAPSACK solution `S`
(`∑_{i∈S} u_i ≤ b`, `∑_{i∈S} w_i ≥ W`), every sequence of the constructed instance in which the
A-jobs placed before the B-job are exactly those of `S` meets both thresholds `Q_A` and `Q_B`. -/
theorem eq_1 {n : ℕ} (u w : Fin n → ℕ) (b W : ℤ) (S : Finset (Fin n))
    (hu : ((∑ i ∈ S, u i : ℕ) : ℤ) ≤ b) (hw : W ≤ ((∑ i ∈ S, w i : ℕ) : ℤ))
    (l : List (Fin (construction u w).nA ⊕ Fin (construction u w).nB))
    (hl : MooreLateJobs.Shared.IsSchedule Finset.univ l)
    (hS : ∀ i : Fin n, i ∈ S ↔ l.idxOf (aJob u w i) < l.idxOf (bJob u w)) :
    (construction u w).Meets ((QA u w W : ℤ) : ℝ) ((QB u w b : ℤ) : ℝ) l := by sorry

end TwoAgentSched.Knapsack
Source
Agnetis, Mirchandani, Pacciarelli & Pacifici, Scheduling Problems with Two Competing Agents, Oper. Res. 52(2) (2004), p. 233, proof of Theorem 5.2, Eq. (1)
Human review
  • Endorsed by Shuze Chen · Oct 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 8, 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