Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 4.9 — Algorithm 2 terminates (positive job sizes)

Proved
RestrictedAssignment.Svensson.extendSchedule_terminates

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

local-searchp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1schedulingtermination

Let (J,M,p,Γ)(J, M, p, \Gamma)(J,M,p,Γ) be an instance of restricted assignment in which every job has positive size, pj>0p_j > 0pj​>0. Let σ0\sigma_0σ0​ be a valid partial schedule and jnewj_{\mathrm{new}}jnew​ a job with σ0(jnew)=TBD\sigma_0(j_{\mathrm{new}}) = \mathrm{TBD}σ0​(jnew​)=TBD. Then Algorithm 2 started on (σ0,jnew)(\sigma_0, j_{\mathrm{new}})(σ0​,jnew​) has no infinite run: there is no sequence of states s0,s1,s2,…s_0, s_1, s_2, \dotss0​,s1​,s2​,… with s0s_0s0​ the initial state and sn+1s_{n+1}sn+1​ obtained from sns_nsn​ by one iteration of the while loop, whichever potential move of minimum value is chosen in each iteration.

In particular, if there is always a potential move to choose, Algorithm 2 terminates, i.e. assigns jnewj_{\mathrm{new}}jnew​. Combined with Lemma 4.6, this is the correctness of the local search.

Formalization Note The printed lemma allows pj≥0p_j \ge 0pj​≥0. Its proof uses that moving a job off a machine in a small blocker strictly decreases that machine's load, which fails for a job of size 000, and the statement fails too. Take one small job jnewj_{\mathrm{new}}jnew​ of size 9/179/179/17 with Γ(jnew)={a,b}\Gamma(j_{\mathrm{new}}) = \{a, b\}Γ(jnew​)={a,b}, a job zzz of size 000 with Γ(z)={a,b}\Gamma(z) = \{a,b\}Γ(z)={a,b}, a job of size 25/1725/1725/17 with Γ={a}\Gamma = \{a\}Γ={a} on aaa, a job of size 25/1725/1725/17 with Γ={b}\Gamma = \{b\}Γ={b} on bbb, and zzz on aaa. Then the algorithm can alternate forever between blocking aaa, moving zzz to bbb, blocking bbb and moving zzz back to aaa, with all choices of minimum value. The hypothesis pj>0p_j > 0pj​>0 excludes this and loses nothing for the goal, where jobs of size 000 can be placed at the end.

Preamble
import Mathlib
import Definitions.Def_RestrictedAssignment_Svensson_configLP
import Definitions.Def_RestrictedAssignment_Svensson_extendSchedule
Formal statement
namespace RestrictedAssignment.Svensson

/-- Svensson, arXiv:1011.1168v2, p. 19, Lemma 4.9: Algorithm 2 terminates — it has no infinite
run, whatever potential move of minimum value is chosen in each iteration. Stated for positive
job sizes: with a job of size 0 the printed statement fails (see the natural-language
statement). -/
theorem extendSchedule_terminates {J M : Type} [Fintype J] [Fintype M] [DecidableEq J] [DecidableEq M]
    (Γ : J → Finset M) (p : J → ℝ) (hp : ∀ j, 0 < p j)
    (σ0 : J → Option M) (jnew : J) (hσ0 : Valid Γ p σ0) (hjnew : σ0 jnew = none) :
    ¬ ∃ f : ℕ → AlgState J M,
        f 0 = initState σ0 jnew ∧ ∀ n, Step Γ p jnew (f n) (f (n + 1)) := by sorry

end RestrictedAssignment.Svensson
Source
Svensson, Santa Claus Schedules Jobs on Unrelated Machines, arXiv:1011.1168v2, p. 19, Lemma 4.9 (proof pp. 19-20)
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Let JJJ (jobs) and MMM (machines) be finite types with decidable equality. Let Γ(j)⊆M\Gamma(j) \subseteq MΓ(j)⊆M for each job, and let every size be strictly positive: pj>0p_j > 0pj​>0.

Hypotheses.

  • σ0:J→M∪{TBD}\sigma_0 : J \to M \cup \{\mathrm{TBD}\}σ0​:J→M∪{TBD} is a valid partial schedule:
    • assigned jobs on machines in their Γ(j)\Gamma(j)Γ(j);
    • at most one big job (pj≥11/17p_j \ge 11/17pj​≥11/17) per machine;
    • loads ≤1+16/17=33/17\le 1 + 16/17 = 33/17≤1+16/17=33/17.
  • σ0(jnew)=TBD\sigma_0(j_{new}) = \mathrm{TBD}σ0​(jnew​)=TBD.

Conclusion. There is no infinite sequence of states s0,s1,s2,…s_0, s_1, s_2, \dotss0​,s1​,s2​,… such that s0=(σ0, [({jnew}, ⊥, small)])s_0 = (\sigma_0,\ [(\{j_{new}\},\ \bot,\ \text{small})])s0​=(σ0​, [({jnew​}, ⊥, small)]) and every consecutive pair is one step, Stepjnew(sn,sn+1)\mathrm{Step}_{j_{new}}(s_n, s_{n+1})Stepjnew​​(sn​,sn+1​) for every nnn.

What one step is. A step from s=(σ,T)s = (\sigma, T)s=(σ,T), where TTT is a list of blockers (job set, machine or ⊥\bot⊥, kind), holds exactly when:

  1. σ(jnew)=TBD\sigma(j_{new}) = \mathrm{TBD}σ(jnew​)=TBD.
  2. Some potential move (j,i)(j,i)(j,i) has lexicographically minimum value among all potential moves.
  3. Some blocker BkB_kBk​ with j∈J(Bk)j \in J(B_k)j∈J(Bk​) is chosen.
  4. The next state is:
    • if σ(j):=i\sigma(j) := iσ(j):=i yields a valid schedule: that reassignment, with BkB_kBk​ and all later blockers removed;
    • else, for a small or huge-to-small move: σ\sigmaσ unchanged, plus an appended small blocker on iii holding σ−1(i)∖J(T)\sigma^{-1}(i) \setminus J(T)σ−1(i)∖J(T);
    • else, for a medium/large-to-big or huge-to-big move: an appended big blocker on iii holding the big jobs on iii;
    • otherwise: an appended medium blocker on iii holding the medium jobs on iii.

Potential moves. (j,i)(j,i)(j,i) is a potential move if j∈J(T)j \in J(T)j∈J(T), i∈Γ(j)i \in \Gamma(j)i∈Γ(j), σ(j)≠i\sigma(j) \ne iσ(j)=i, and one of:

  • small: jjj small and i∉MS(T)i \notin M_S(T)i∈/MS​(T); or jjj medium, i∉M(T)i \notin M(T)i∈/M(T), no big job on iii; or jjj large, i∉MB(T)∪MS(T)i \notin M_B(T) \cup M_S(T)i∈/MB​(T)∪MS​(T), no big job on iii.
  • medium/large-to-big: those medium/large conditions with a big job on iii.
  • huge-to-small or huge-to-big: jjj huge, i∉M(T)i \notin M(T)i∈/M(T), no big job or a big job on iii respectively, and pj+p(Si∪Mi)≤33/17p_j + p(S_i \cup M_i) \le 33/17pj​+p(Si​∪Mi​)≤33/17.
  • huge-to-medium: jjj huge, i∉M(T)i \notin M(T)i∈/M(T), and pj+p(Si)≤33/17<pj+p(Si∪Mi)p_j + p(S_i) \le 33/17 < p_j + p(S_i \cup M_i)pj​+p(Si​)≤33/17<pj​+p(Si​∪Mi​).

Class boundaries: small ≤9/17<\le 9/17 <≤9/17< medium <11/17≤< 11/17 \le<11/17≤ large <14/17≤< 14/17 \le<14/17≤ huge.

Values. Values are compared lexicographically:

  • valid move: (0,0)(0,0)(0,0);
  • small type: (pj,load of i)(p_j, \text{load of } i)(pj​,load of i);
  • medium/large-to-big: (2,0)(2,0)(2,0);
  • huge-to-small: (3,load of i)(3, \text{load of } i)(3,load of i);
  • huge-to-big: (4,0)(4,0)(4,0);
  • huge-to-medium: (5,∣Mi∣)(5, \lvert M_i \rvert)(5,∣Mi​∣).

Degenerate cases.

  • The claim covers every choice of tie-breaking and of kkk.
  • No configuration-LP feasibility is assumed.
  • Zero or negative sizes are excluded by hypothesis.
  • A run that stops because no step is possible (for example, no potential move exists, or σ(jnew)\sigma(j_{new})σ(jnew​) has been assigned) is consistent with the conclusion.
Human review
  • Endorsed by Shuze Chen · Sep 28, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 28, 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