Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 5.5 (correctness) — the algorithm of Figure 1 solves 1‖ΣC^A_i : f^B_max ≤ Q

Proved
TwoAgentSched.TotalMax.theorem_5_5

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

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

Consider the problem 1∥∑CiA:fmax⁡B≤Q1\|\sum C^A_i : f^B_{\max}\le Q1∥∑CiA​:fmaxB​≤Q with positive processing times and nondecreasing BBB-cost functions fkBf^B_kfkB​, and the algorithm of Figure 1: building the schedule backwards, with τ\tauτ the total length of the unscheduled jobs, place last any unscheduled BBB-job JkBJ^B_kJkB​ with fkB(τ)≤Qf^B_k(\tau)\le QfkB​(τ)≤Q if there is one, otherwise a longest unscheduled AAA-job, and stop with "no solution exists" if neither is possible. Then:

  1. if the instance is feasible, every schedule the algorithm can produce, under any tie-breaking, is optimal;
  2. the algorithm can run to completion (some schedule of all jobs obeys its rule) if and only if the instance is feasible.

This is the correctness of the paper's algorithm for the unweighted problem.

Formalization Note The paper's Theorem 5.5 states that the problem can be solved in time O(nAlog⁡nA+nBlog⁡nB)O(n_A\log n_A+n_B\log n_B)O(nA​lognA​+nB​lognB​); the running time is not formalized, only the correctness of the algorithm as Figure 1 and the text before Theorem 5.5 describe it. The algorithm is the property IsFig1Seq of a finished sequence.

Preamble
import Mathlib
import Definitions.Def_TwoAgentSched_TotalMax_Rules
Formal statement
namespace TwoAgentSched.TotalMax

/-- Theorem 5.5, correctness half (Agnetis et al. 2004, §5.2, p. 234): the algorithm of
Figure 1 solves `1‖ΣC^A_i : f^B_max ≤ Q`.
1. On a feasible instance, every schedule of all jobs that the algorithm can produce (any
   tie-breaking) is optimal.
2. The algorithm runs to completion (some schedule of all jobs satisfies its rule) if and only
   if the instance is feasible.
The running time `O(n_A log n_A + n_B log n_B)` is not formalized. -/
theorem theorem_5_5 {nA nB : ℕ} (p : TwoAgentSched.MaxMax.Job nA nB → ℝ) (hp : ∀ j, 0 < p j)
    (fB : Fin nB → ℝ → ℝ) (hfB : ∀ k, Monotone (fB k)) (Q : ℝ) :
    (IsFeasibleInstance p fB Q →
      ∀ l : List (TwoAgentSched.MaxMax.Job nA nB), MooreLateJobs.Shared.IsSchedule Finset.univ l →
        IsFig1Seq p fB Q l → IsOptimal p fB Q l) ∧
    ((∃ l : List (TwoAgentSched.MaxMax.Job nA nB), MooreLateJobs.Shared.IsSchedule Finset.univ l ∧
        IsFig1Seq p fB Q l) ↔ IsFeasibleInstance p fB Q) := by sorry

end TwoAgentSched.TotalMax
Source
Agnetis, Mirchandani, Pacciarelli & Pacifici, Scheduling Problems with Two Competing Agents, Oper. Res. 52(2) (2004), p. 234, Theorem 5.5 and Figure 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