Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section 2, after Eq. (8) — adjacent-interchange cost identity

Proved
DeterioratingJobs.Weighted.interchange_identity

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

deteriorating-jobsinterchange-argumentp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1scheduling

Consider a schedule π\piπ with adjacent positions j,j+1j,j+1j,j+1 occupied by jobs a,ba,ba,b. Let π1\pi_1π1​ interchange these positions, and let Sj−1(π)S_{j-1}(\pi)Sj−1​(π) be the completion time immediately before job aaa starts. For every outcome,

C(π)−C(π1)=Sj−1(π)[cbαa(1+αb)−caαb(1+αa)]+[Xacb(1+αb)−Xbca(1+αa)]+∑r=j+2Ncπ(r)∏k=j+2r(1+απ(k))[Xaαb−Xbαa].\begin{aligned} C(\pi)-C(\pi_1) ={}&S_{j-1}(\pi)[c_b\alpha_a(1+\alpha_b)-c_a\alpha_b(1+\alpha_a)]\\ &+[X_a c_b(1+\alpha_b)-X_b c_a(1+\alpha_a)]\\ &+\sum_{r=j+2}^{N}c_{\pi(r)} \prod_{k=j+2}^{r}(1+\alpha_{\pi(k)}) [X_a\alpha_b-X_b\alpha_a]. \end{aligned}C(π)−C(π1​)=​Sj−1​(π)[cb​αa​(1+αb​)−ca​αb​(1+αa​)]+[Xa​cb​(1+αb​)−Xb​ca​(1+αa​)]+r=j+2∑N​cπ(r)​k=j+2∏r​(1+απ(k)​)[Xa​αb​−Xb​αa​].​

It gives the exact change in total weighted completion cost from interchanging two adjacent jobs.

Formalization Note The printed display is for the identity order and has a multiplication dot before its second bracket. The Lean statement applies to any permutation and replaces that dot with addition. For two jobs with X=(1,2)X=(1,2)X=(1,2), α=(1,1)\alpha=(1,1)α=(1,1) and c=(2,1)c=(2,1)c=(2,1), the costs are 666 and 121212, and both sides of the corrected identity equal −6-6−6.

Preamble
import Mathlib
import Definitions.Def_DeterioratingJobs_Weighted_Model
Formal statement
namespace DeterioratingJobs.Weighted

/-- The unnumbered interchange display between (8) and Proposition 2, p. 497.
The printed multiplication dot preceding the second bracket is corrected to addition. -/
theorem interchange_identity {Ω : Type*} {N : ℕ}
    (X : Fin N → Ω → ℝ) (α c : Fin N → ℝ)
    (π : Equiv.Perm (Fin N)) (p : Fin N) (hp : p.val + 1 < N) (ω : Ω) :
    let q : Fin N := ⟨p.val + 1, hp⟩
    let a := π p
    let b := π q
    let π₁ := π * Equiv.swap p q
    totalCost X α c π ω - totalCost X α c π₁ ω =
      DeterioratingJobs.Makespan.completionTime X α π p.val ω *
        (c b * α a * (1 + α b) - c a * α b * (1 + α a)) +
      (X a ω * c b * (1 + α b) - X b ω * c a * (1 + α a)) +
      ∑ r : Fin N with p.val + 2 ≤ r.val,
        c (π r) *
          (∏ k : Fin N with p.val + 2 ≤ k.val ∧ k ≤ r, (1 + α (π k))) *
          (X a ω * α b - X b ω * α a) := by sorry

end DeterioratingJobs.Weighted
Source
Browne, Yechiali, Scheduling Deteriorating Jobs on a Single Processor, Oper. Res. 38 (1990), p. 497, Section 2, unnumbered display between Eq. (8) and Proposition 2; https://doi.org/10.1287/opre.38.3.495
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