Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4.1 (correctness) — the backward rule solves 1∥fmax⁡A:fmax⁡B≤Q1\|f^A_{\max} : f^B_{\max}\le Q1∥fmaxA​:fmaxB​≤Q

Proved
TwoAgentSched.MaxMax.theorem_4_1

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

algorithmp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1schedulingtwo-agent

Consider nA≥1n_A\ge1nA​≥1 A-jobs and nBn_BnB​ B-jobs on one machine, with nonnegative processing times, nondecreasing cost functions fhAf^A_hfhA​, fkBf^B_kfkB​, and a bound QQQ. The backward rule of §4 builds a schedule from the end: with τˉ\bar\tauτˉ the total processing time of the unscheduled jobs, it places last any unscheduled B-job JkBJ^B_kJkB​ with fkB(τˉ)≤Qf^B_k(\bar\tau)\le QfkB​(τˉ)≤Q, and if there is none, an unscheduled A-job with the smallest fhA(τˉ)f^A_h(\bar\tau)fhA​(τˉ); it stops when all A-jobs are scheduled and no B-job can be placed. Then:

  1. every complete schedule the rule can produce, under any tie-breaking, is optimal for
1∥fmax⁡A:fmax⁡B≤Q:min⁡ fmax⁡A(σ)  subject to  fmax⁡B(σ)≤Q;1\|f^A_{\max} : f^B_{\max}\le Q:\quad \min\ f^A_{\max}(\sigma)\ \text{ subject to }\ f^B_{\max}(\sigma)\le Q;1∥fmaxA​:fmaxB​≤Q:min fmaxA​(σ)  subject to  fmaxB​(σ)≤Q;
  1. the rule produces a complete schedule if and only if the instance has a feasible schedule.

Printed as "1∥fmax⁡A:fmax⁡B1\|f^A_{\max} : f^B_{\max}1∥fmaxA​:fmaxB​ can be solved in time O(nA2+nBlog⁡nB)O(n_A^2+n_B\log n_B)O(nA2​+nB​lognB​)", this is the paper's first and simplest two-agent result: a single-machine scheduling problem between two agents with maximum-cost objectives is solved by a greedy rule.

Formalization Note Only the correctness of the algorithm is formalized; the running time O(nA2+nBlog⁡nB)O(n_A^2+n_B\log n_B)O(nA2​+nB​lognB​) is not. "The rule produces a complete schedule" is stated as the existence of a schedule of all jobs satisfying the backward-rule property, at every position of which the rule's choice is legal.

Preamble
import Mathlib
import Definitions.Def_TwoAgentSched_MaxMax_BackwardRule
Formal statement
namespace TwoAgentSched.MaxMax

/-- Theorem 4.1, correctness of the algorithm (Agnetis et al. 2004, §4, pp. 232–233): the
backward rule solves `1‖f^A_max : f^B_max ≤ Q`.
1. Every sequence of all `nA + nB` jobs that the backward rule can produce (any tie-breaks) is
   optimal for `1‖f^A_max : f^B_max ≤ Q`.
2. The backward rule produces a complete sequence (never stops) if and only if the instance is
   feasible.
The running time `O(n_A² + n_B log n_B)` of the printed theorem is not formalized. -/
theorem theorem_4_1 {nA nB : ℕ} (hA : 0 < nA) (p : Job nA nB → ℝ) (hp : ∀ j, 0 ≤ p j)
    (fA : Fin nA → ℝ → ℝ) (fB : Fin nB → ℝ → ℝ) (hfA : ∀ h, Monotone (fA h))
    (hfB : ∀ k, Monotone (fB k)) (Q : ℝ) :
    (∀ l : List (Job nA nB), MooreLateJobs.Shared.IsSchedule Finset.univ l →
      IsBackwardRuleSeq p fA fB Q l → IsOptimal hA p fA fB Q l) ∧
    ((∃ l : List (Job nA nB), MooreLateJobs.Shared.IsSchedule Finset.univ l ∧
        IsBackwardRuleSeq p fA fB Q l) ↔
      ∃ l : List (Job nA nB), IsFeasible p fB Q l) := by sorry

end TwoAgentSched.MaxMax
Source
Agnetis, Mirchandani, Pacciarelli & Pacifici, Scheduling Problems with Two Competing Agents, Oper. Res. 52(2) (2004), p. 233, Theorem 4.1, with the algorithm and its justification on pp. 232–233, §4
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