Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section 2, proof of the Theorem — adjacent i,ji, ji,j with dˉi>dˉj\bar d_i > \bar d_jdˉi​>dˉj​ can be interchanged

Proved
LawlerMoore.PrecDeadline.adjacent_interchange

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

deadlinesp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1precedence-constraintsscheduling

Consider nnn jobs on a single machine with processing times aj≥0a_j \ge 0aj​≥0 and real deadlines djd_jdj​. The machine starts at time 000 and processes the jobs of a sequence one after another without idle time, so the completion time Cj(σ)C_j(\sigma)Cj​(σ) of job jjj in a sequence σ\sigmaσ is the total processing time of jjj and the jobs before it. Let ρ\rhoρ be a transitive precedence relation, numbered so that iρji\rho jiρj implies i≤ji \le ji≤j, and let dˉj\bar d_jdˉj​ be the modified deadlines with ε>0\varepsilon > 0ε>0 and nε<dl−dkn\varepsilon < d_l - d_knε<dl​−dk​ whenever dk<dld_k < d_ldk​<dl​.

Suppose the sequence

σ=( σ1, i, j, σ2 )\sigma = (\,\sigma_1,\ i,\ j,\ \sigma_2\,)σ=(σ1​, i, j, σ2​)

lists every job exactly once, is consistent with ρ\rhoρ, and completes every job on time (Cx(σ)≤dxC_x(\sigma) \le d_xCx​(σ)≤dx​ for all xxx), and suppose dˉi>dˉj\bar d_i > \bar d_jdˉi​>dˉj​. Then the sequence σ′=(σ1,j,i,σ2)\sigma' = (\sigma_1, j, i, \sigma_2)σ′=(σ1​,j,i,σ2​) obtained by interchanging iii and jjj is again consistent with ρ\rhoρ and again completes every job on time.

This is the exchange step of the §2 Theorem: a finite number of such interchanges transforms any on-time sequence consistent with ρ\rhoρ into the sequence ordered by increasing dˉj\bar d_jdˉj​.

Formalization Note Sequences are duplicate-free lists of all jobs (MooreLateJobs.Shared.IsSchedule) with completion times MooreLateJobs.Shared.completionTime (start at 000, no idle time); consistency with ρ\rhoρ is LawlerPrec.MinMax.IsFeasible. The hypothesis aj≥0a_j \ge 0aj​≥0 is not stated in the paper but is used by its argument ("jjj will remain on time since it will be earlier in the sequence") and is necessary. The paper's "ε\varepsilonε is a small number" is made explicit as above. Jobs are Fin n, 0-based.

Preamble
import Mathlib
import Definitions.Def_MooreLateJobs_Shared_completionTime
import Definitions.Def_LawlerPrec_MinMax_IsFeasible
import Definitions.Def_LawlerMoore_PrecDeadline_modifiedDeadline
Formal statement
namespace LawlerMoore.PrecDeadline

theorem adjacent_interchange (n : ℕ) (a d : Fin n → ℝ) (ha : ∀ j, 0 ≤ a j)
    (ρ : Fin n → Fin n → Prop) [DecidableRel ρ]
    (htrans : ∀ i j k, ρ i j → ρ j k → ρ i k)
    (hnum : ∀ i j, ρ i j → i ≤ j)
    (ε : ℝ) (hε : 0 < ε) (hgap : ∀ k k', d k < d k' → (n : ℝ) * ε < d k' - d k)
    (l₁ l₂ : List (Fin n)) (i j : Fin n)
    (hfeas : LawlerPrec.MinMax.IsFeasible ρ Finset.univ (l₁ ++ i :: j :: l₂))
    (hon : ∀ x, MooreLateJobs.Shared.completionTime a (l₁ ++ i :: j :: l₂) x ≤ d x)
    (hlt : modifiedDeadline ρ d ε j < modifiedDeadline ρ d ε i) :
    LawlerPrec.MinMax.IsFeasible ρ Finset.univ (l₁ ++ j :: i :: l₂) ∧
      ∀ x, MooreLateJobs.Shared.completionTime a (l₁ ++ j :: i :: l₂) x ≤ d x := by sorry

end LawlerMoore.PrecDeadline
Source
Lawler, Moore, A Functional Equation and Its Application to Resource Allocation and Sequencing Problems, Management Sci. 16 (1969), p. 78, Section 2, proof of the Theorem
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