Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Lemma 4.2 (facility cost): costf(S)≤costf(O)+2 costs(O)\mathrm{cost}_f(S) \le \mathrm{cost}_f(O) + 2\,\mathrm{cost}_s(O)costf​(S)≤costf​(O)+2costs​(O)

Proved
LocalSearchFL.UFL.facility_cost_lemma_4_2

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

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

Let CCC and FFF be the clients and facilities of a metric instance, and let fi≥0f_i \ge 0fi​≥0 be the opening cost of facility iii. Let S⊆FS \subseteq FS⊆F be a nonempty set of facilities that is locally optimum for the add/drop/swap neighbourhood (4). Then for every nonempty set O⊆FO \subseteq FO⊆F,

costf(S)≤costf(O)+2⋅costs(O).\mathrm{cost}_f(S) \le \mathrm{cost}_f(O) + 2 \cdot \mathrm{cost}_s(O).costf​(S)≤costf​(O)+2⋅costs​(O).

Together with Lemma 4.1 this gives the locality gap 3 of Theorem 4.3; the asymmetry between the coefficients of the two lemmas is what the scaling argument of Theorem 4.4 exploits.

Formalization Note No assumption that clients exist is made: with no clients the statement reduces to costf(S)≤costf(O)\mathrm{cost}_f(S) \le \mathrm{cost}_f(O)costf​(S)≤costf​(O), which the drop and swap moves still give.

Preamble
import Mathlib
import Definitions.Def_LocalSearchFL_UFL_captures
Formal statement
namespace LocalSearchFL.UFL

/-- Lemma 4.2 (facility cost), p. 555. If `S` is a locally optimum solution for the
add/drop/swap neighbourhood (4), then for every solution `O`:
`cost_f(S) ≤ cost_f(O) + 2 · cost_s(O)`. -/
theorem facility_cost_lemma_4_2 {Cl Fa : Type} [Fintype Cl] [DecidableEq Cl]
    [Fintype Fa] [DecidableEq Fa]
    (I : MetricInstance Cl Fa) (f : Fa → ℝ) (hf : ∀ i, 0 ≤ f i)
    (S : Finset Fa) (hS : S.Nonempty) (hloc : IsUFLLocalOpt I f S hS)
    (O : Finset Fa) (hO : O.Nonempty) :
    costF f S ≤ costF f O + 2 * costS I O hO := by sorry

end LocalSearchFL.UFL
Source
Arya, Garg, Khandekar, Meyerson, Munagala, Pandit, Local Search Heuristics for k-Median and Facility Location Problems, SIAM J. Comput. 33(3), 2004, p. 555, Lemma 4.2 (proof pp. 555–556)
Read-back

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

Setting. Let C\mathcal CC (clients) and F\mathcal FF (facilities) be finite types with decidable equality. Let III be a metric instance: ddd on pairs of points of C⊔F\mathcal C\sqcup\mathcal FC⊔F, nonnegative, symmetric, triangle inequality, self-distance not assumed zero. Write cji=d(j,i)c_{ji}=d(j,i)cji​=d(j,i). Let f:F→Rf:\mathcal F\to\mathbb Rf:F→R satisfy fi≥0f_i\ge0fi​≥0 for all iii. For finite A⊆FA\subseteq\mathcal FA⊆F, write costf(A)=∑i∈Afi\mathrm{cost}_f(A)=\sum_{i\in A}f_icostf​(A)=∑i∈A​fi​. For nonempty AAA, write

costs(A)=∑j∈Cmin⁡i∈Acji,cost(A)=costf(A)+costs(A).\mathrm{cost}_s(A)=\sum_{j\in\mathcal C}\min_{i\in A}c_{ji}, \qquad \mathrm{cost}(A)=\mathrm{cost}_f(A)+\mathrm{cost}_s(A).costs​(A)=j∈C∑​i∈Amin​cji​,cost(A)=costf​(A)+costs​(A).

Hypotheses. SSS is a nonempty set of facilities that is locally optimal:

  • cost(S)≤cost(S∪{s′})\mathrm{cost}(S)\le\mathrm{cost}(S\cup\{s'\})cost(S)≤cost(S∪{s′}) for every facility s′s's′;
  • cost(S)≤cost(S∖{s})\mathrm{cost}(S)\le\mathrm{cost}(S\setminus\{s\})cost(S)≤cost(S∖{s}) for every s∈Ss\in Ss∈S with S∖{s}≠∅S\setminus\{s\}\ne\emptysetS∖{s}=∅;
  • cost(S)≤cost((S∖{s})∪{s′})\mathrm{cost}(S)\le\mathrm{cost}((S\setminus\{s\})\cup\{s'\})cost(S)≤cost((S∖{s})∪{s′}) for all s∈Ss\in Ss∈S and all facilities s′s's′.

Conclusion. For every nonempty set OOO of facilities:

costf(S)≤costf(O)+2 costs(O).\mathrm{cost}_f(S)\le\mathrm{cost}_f(O)+2\,\mathrm{cost}_s(O).costf​(S)≤costf​(O)+2costs​(O).

Degenerate cases.

  • If C=∅\mathcal C=\emptysetC=∅, all service costs are 000. The claim becomes ∑i∈Sfi≤∑i∈Ofi\sum_{i\in S}f_i\le\sum_{i\in O}f_i∑i∈S​fi​≤∑i∈O​fi​ for every nonempty OOO, whenever SSS is locally optimal for the facility costs alone.
  • If F\mathcal FF has one element, S=OS=OS=O and the claim is fi≤fi+2 costs(O)f_i\le f_i+2\,\mathrm{cost}_s(O)fi​≤fi​+2costs​(O).
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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me