Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 5.5 — multi-copy local search for metric capacitated facility location has locality gap at most 4

Proved
LocalSearchFL.CFL.cfl_locality_gap

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

approximation-algorithmscapacitated-facility-locationfacility-locationlocal-searchp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Consider the metric capacitated facility location problem in which several copies of a facility may be opened: CCC is a nonempty finite set of clients, FFF a set of facilities, ccc a distance on C∪FC \cup FC∪F that is nonnegative, symmetric and satisfies the triangle inequality, and every facility iii has an opening cost fi≥0f_i \ge 0fi​≥0 per copy and an integer capacity ui>0u_i > 0ui​>0 per copy. A solution opens a multiset of copies and assigns every client to a copy, each copy of iii serving at most uiu_iui​ clients; its cost is the total opening cost plus the total distance from clients to their copies.

Local search moves either add one copy of a facility s′s's′, or close a set TTT of open copies and open l≥1l \ge 1l≥1 copies of a facility s′s's′ with lus′≥∣N(T)∣l u_{s'} \ge |N(T)|lus′​≥∣N(T)∣, the number of clients served by TTT. If XXX is locally optimum for these moves, then for every solution OOO,

cost(X)≤4⋅cost(O).\mathrm{cost}(X) \le 4 \cdot \mathrm{cost}(O).cost(X)≤4⋅cost(O).

This is Theorem 5.5: the locality gap of this local search procedure is at most 4. It is obtained by adding the service-cost bound of Lemma 5.1 and the facility-cost bound of Lemma 5.3.

Formalization Note The hypothesis that there is at least one client is added: without clients, a single idle copy of a facility with f=1f = 1f=1, u=1u = 1u=1 is locally optimum (its neighbours cost 222 and 111) and has cost 111, while the solution with no copies has cost 000. OOO ranges over all solutions with all feasible assignments, so the bound holds in particular against an optimum. The bound is stated multiplied out, since cost(O)\mathrm{cost}(O)cost(O) may be 000.

Preamble
import Mathlib
import Definitions.Def_LocalSearchFL_CFL_IsCFLLocalOpt
Formal statement
namespace LocalSearchFL.CFL

/-- **Theorem 5.5**, p. 560: local search for the metric capacitated facility location problem
(with multiple copies of a facility allowed), where each step either adds a copy of a facility
or deletes a subset of the open copies and adds multiple copies of one facility (neighbourhood
(9)), has locality gap at most 4: for every instance with at least one client, every locally
optimum solution `X` and every solution `O`, `cost(X) ≤ 4 · cost(O)`. -/
theorem cfl_locality_gap {Cl Fa : Type} [Fintype Cl] [Nonempty Cl]
    (I : MetricInstance Cl Fa) (u : Fa → ℕ) (hu : ∀ i, 0 < u i) (f : Fa → ℝ) (hf : ∀ i, 0 ≤ f i)
    (X : CFLSol Cl Fa u) (hX : IsCFLLocalOpt I f X) (O : CFLSol Cl Fa u) :
    cost I f X ≤ 4 * cost I f O := by sorry

end LocalSearchFL.CFL
Source
Arya, Garg, Khandekar, Meyerson, Munagala, Pandit, Local Search Heuristics for k-Median and Facility Location Problems, SIAM J. Comput. 33(3), 2004, p. 560, Theorem 5.5
Read-back

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

The statement concerns two arbitrary types:

  • a type CCC of clients, which must be finite and nonempty;
  • a type FFF of facilities, with no assumptions at all. FFF may be empty or infinite.

The inputs are:

  • III, an object of type MetricInstance built on CCC and FFF. This type comes from the imported definitions file, whose contents are not shown here. Its name suggests an instance with some metric on clients and facilities, but what it actually contains or requires cannot be read from this code.
  • u:F→Nu : F \to \mathbb{N}u:F→N, a natural number uiu_iui​ for each facility iii, with the hypothesis
ui>0for every i∈F,u_i > 0 \quad \text{for every } i \in F,ui​>0for every i∈F,

so ui≥1u_i \ge 1ui​≥1 everywhere.

  • f:F→Rf : F \to \mathbb{R}f:F→R, a real number fif_ifi​ for each facility, with the hypothesis
fi≥0for every i∈F.f_i \ge 0 \quad \text{for every } i \in F.fi​≥0for every i∈F.

fff is passed separately from III; it is not part of the instance.

  • XXX and OOO, two objects of type CFLSol built on CCC, FFF and uuu. This type also comes from the unseen definitions file. Its name suggests a capacitated facility location solution that respects the numbers uuu, but its actual constraints cannot be checked here.
  • A hypothesis that XXX satisfies the predicate IsCFLLocalOpt for III and fff. This predicate is also defined in the unseen file, so what kind of local optimality it demands, and against which moves, is not visible here. The predicate takes III, fff and XXX as arguments, and uuu enters only through the type of XXX.

No hypothesis is placed on OOO beyond its type. The conclusion is

costI,f(X)  ≤  4⋅costI,f(O),\mathrm{cost}_{I,f}(X) \;\le\; 4 \cdot \mathrm{cost}_{I,f}(O),costI,f​(X)≤4⋅costI,f​(O),

where costI,f\mathrm{cost}_{I,f}costI,f​ is the imported function cost, applied to the instance III, the numbers fff and a solution. It is being multiplied by the number 4, but how it combines III, fff and the solution is not visible here.

The theorem's comment calls this Theorem 5.5 (p. 560) and describes a specific neighbourhood, open copies of facilities, and a metric instance. None of that is stated by the code shown; it holds only to the extent the four imported definitions encode it.

Edge cases:

  • Client type: there is always at least one client.
  • Facility type: FFF may be empty or infinite, since it carries no finiteness or nonemptiness assumption.
    • If FFF is empty, the hypotheses on uuu and fff hold vacuously. Whether any CFLSol exists then depends on the unseen definition. If none exists, the theorem is vacuously true.
    • If FFF is infinite, any sum over facilities inside cost could be an infinite sum, which Lean treats as 000 when the sum does not converge. Whether this happens depends on the unseen definitions.
  • The numbers uuu: a zero value is excluded by hypothesis.
  • The numbers fff: zero values are allowed, including f≡0f \equiv 0f≡0.
  • Possibly vacuous: if IsCFLLocalOpt cannot be satisfied for some or all instances, the statement is vacuous there. Its satisfiability cannot be judged from the code shown.
  • Negative costs: nothing in the displayed hypotheses guarantees that costI,f\mathrm{cost}_{I,f}costI,f​ is nonnegative. If it could be negative, the inequality with the factor 4 would mean something different, and that also depends on the unseen definitions.
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

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