Prove2Me
Navigate
MissionsFormalpediaUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Online Load Balancing on Unrelated Machines

Proved
PrimalDual.buchbinder_naor_unrelated_machines_exact

by wenxinzhang · Aug 19, 2026 · Mathlib c5ea003 (Lean v4.30.0)

competitive-analysisload-balancingonline-algorithmsprimal-dualscheduling

Online load balancing on unrelated machines (exact form of Theorem 8.1). Consider a normalized instance with m≥1m\ge 1m≥1 machines, jobs 0,…,n−10,\dots,n-10,…,n−1 arriving in order, and nonnegative normalized loads p~(i,j)\tilde p(i,j)p~​(i,j), where machine jjj is eligible for job iii exactly when p~(i,j)≤1\tilde p(i,j)\le 1p~​(i,j)≤1. If the packing dual admits a feasible solution assigning unit total mass to every job, then the deterministic Buchbinder–Naor primal–dual algorithm never fails, assigns every job irrevocably, and every machine jjj ends with normalized load

∑i assigned to jp~(i,j)  ≤  ln⁡(3m)ln⁡(3/2).\sum_{i\,\text{assigned to}\,j}\tilde p(i,j)\;\le\;\frac{\ln(3m)}{\ln(3/2)}.iassigned toj∑​p~​(i,j)≤ln(3/2)ln(3m)​.

The source states the guarantee as O(log⁡m)O(\log m)O(logm); the displayed constant is the explicit bound derived in its proof. In the survey's doubling scheme this normalized phase is invoked with a guessed makespan, and a feasible dual assigning all jobs exists precisely when the guess is at least the optimal makespan, which is how the phase yields the O(log⁡m)O(\log m)O(logm)-competitive online algorithm.

Formalization Note The theorem covers the single normalized phase; the doubling wrapper that produces the competitive algorithm is outside the mission's scope. The algorithm, its state, and the dual-feasibility premise all refer to the mission's shared definitions module.

Preamble
import Definitions.Def_pd_unrelated_machines
Formal statement
namespace PrimalDual

/--
**Online load balancing on unrelated machines (exact form).** If the normalized
instance admits a feasible dual assigning unit mass to every job, the
Buchbinder--Naor deterministic online algorithm assigns all jobs, never fails,
and puts normalized load at most `ln(3m) / ln(3/2)` on every machine.
-/
theorem buchbinder_naor_unrelated_machines_exact
    {jobs machines : ℕ} (I : UnrelatedMachines.Instance jobs machines)
    (y : I.EligiblePair → ℝ) (hy : I.DualAssignsAll y) :
    I.Succeeded ∧ I.AssignsAll ∧
      ∀ j, I.assignedLoad j ≤ I.logarithmicLoadBound := by
  sorry

end PrimalDual
Source
Niv Buchbinder and Joseph (Seffi) Naor, The Design of Competitive Online Algorithms via a Primal--Dual Approach, https://www.tau.ac.il/~nivb/download/pd-survey.pdf, Chapter 8, Theorem 8.1 and proof, pp. 195--196; explicit bound displayed on p. 196.
Read-back

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

For every pair of natural numbers nnn and mmm, every instance III consisting of a proof 0<m0<m0<m, a real load pijp_{ij}pij​ for each job i∈{0,…,n−1}i\in\{0,\ldots,n-1\}i∈{0,…,n−1} and machine j∈{0,…,m−1}j\in\{0,\ldots,m-1\}j∈{0,…,m−1}, and proofs pij≥0p_{ij}\ge 0pij​≥0, every function yyy assigning a real number yijy_{ij}yij​ exactly to each eligible pair (i,j)(i,j)(i,j) with pij≤1p_{ij}\le 1pij​≤1, and every proof of the following compound premise: yij≥0y_{ij}\ge0yij​≥0 for every eligible pair, ∑i: pij≤1pijyij≤1\sum_{i:\,p_{ij}\le1}p_{ij}y_{ij}\le1∑i:pij​≤1​pij​yij​≤1 for every machine jjj, ∑j: pij≤1yij≤1\sum_{j:\,p_{ij}\le1}y_{ij}\le1∑j:pij​≤1​yij​≤1 for every job iii, and additionally ∑j: pij≤1yij=1\sum_{j:\,p_{ij}\le1}y_{ij}=1∑j:pij​≤1​yij​=1 for every job iii, the theorem asserts the right-nested conjunction that the deterministic run described below has final failure marker none\mathrm{none}none, and that both every job iii has some machine jjj with final assignment entry some⁡(j)\operatorname{some}(j)some(j) and every machine jjj has final assigned normalized load at most ln⁡(3m)/ln⁡(3/2)\ln(3m)/\ln(3/2)ln(3m)/ln(3/2). The external yyy is defined only on eligible pairs—there are no values for ineligible pairs—and is used only in the premise, not by the run. The run begins with every machine weight equal to 1/(2m)1/(2m)1/(2m), every job assignment equal to none\mathrm{none}none, every job slack equal to 000, every entry of a separate internal rectangular dual array equal to 000, and failure marker none\mathrm{none}none, and processes the jobs once each in the order 0,…,n−10,\ldots,n-10,…,n−1. At an arrival iii, a state whose failure marker is already nonempty is left unchanged; otherwise the run first tests whether the eligible set Ei={j:pij≤1}E_i=\{j:p_{ij}\le1\}Ei​={j:pij​≤1} is empty or whether some current machine weight xjx_jxj​ satisfies the strict inequality 1<xj1<x_j1<xj​, and if either condition holds it changes only the failure marker to iii. If neither holds, it sorts EiE_iEi​ by the natural order of the finite machine indices and deterministically takes an argmin of pijxjp_{ij}x_jpij​xj​; the total definition also marks failure at iii if that choice nevertheless returns no machine. When it returns a machine ℓ\ellℓ, writing p=piℓp=p_{i\ell}p=piℓ​ and x=xℓx=x_\ellx=xℓ​ for the old weight, the transition changes only xℓx_\ellxℓ​ to x(1+p/2)x(1+p/2)x(1+p/2), the assignment of iii to some⁡(ℓ)\operatorname{some}(\ell)some(ℓ), the slack of iii to 1−px1-px1−px, and the internal dual entry at (i,ℓ)(i,\ell)(i,ℓ) to 111, retains all other entries, and leaves the failure marker none\mathrm{none}none; the process’s recorded decision is the resulting assignment entry for iii, while its final state is obtained by iterating these state transitions through the whole arrival list. “Succeeded” here means exactly that this final marker is none\mathrm{none}none, with no additional post-run overweight test, and “assigns all” means exactly ∀i ∃j\forall i\,\exists j∀i∃j, the final assignment of iii is some⁡(j)\operatorname{some}(j)some(j). The final assigned load on jjj is exactly the finite sum \sum_{i=0}^{n-1}\bigl(p_{ij}\ \text{if the final assignment of \(i is }\operatorname{some}(j),\ \text{and }0\text{ otherwise}\bigr)), and its asserted bound is the unrounded real quotient ln⁡(3m)/ln⁡(3/2)\ln(3m)/\ln(3/2)ln(3m)/ln(3/2) for every jjj. Although mmm is universally quantified over natural numbers, m=0m=0m=0 admits no such instance because it would require 0<00<00<0, so that binder case has no III; when n=0n=0n=0, the eligible-pair type and yyy are empty, all per-job unit-mass conditions and the assignment conclusion are vacuous, the machine dual sums and final loads are empty sums 000, no transition occurs, and the load conclusion says 0≤ln⁡(3m)/ln⁡(3/2)0\le\ln(3m)/\ln(3/2)0≤ln(3m)/ln(3/2) for every machine. If n>0n>0n>0 and any job has no eligible machine, its required unit dual mass is the empty sum 0=10=10=1, so no proof of the premise can be supplied and the theorem has no applicable premise in that case; more generally, whenever no such feasible unit-mass yyy exists, the hypothesis is uninhabited.

Human review
  • Endorsed by Shuze Chen · Aug 19, 2026

  • Endorsed by wenxinzhang · Aug 19, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeLaunch a missionPropose a formalization projectFAQ

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.

How Prove2Me works
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me