Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Inequality (5) — dropping a good facility

Proved
LocalSearchFL.UFL.drop_good_inequality_5

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

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

Let fi≥0f_i \ge 0fi​≥0 be facility opening costs on a metric instance with at least one client, let SSS be a nonempty set of facilities that is locally optimum for the add/drop/swap neighbourhood (4), and let OOO be any solution. Let σS\sigma_SσS​, σO\sigma_OσO​ be nearest-facility assignments for SSS and OOO, write Sj=cjσS(j)S_j = c_{j\sigma_S(j)}Sj​=cjσS​(j)​ and Oj=cjσO(j)O_j = c_{j\sigma_O(j)}Oj​=cjσO​(j)​, and let π\piπ be a permutation of the clients satisfying the three conditions of the mapping of the proof of Lemma 4.2 (it preserves every NO(o)N_O(o)NO​(o), satisfies Property 3.1, and fixes the clients of a captured block that it maps into that block).

If s∈Ss \in Ss∈S is good, i.e. captures no facility of OOO, then

−fs+∑j∈NS(s)π(j)≠j(Oj+Oπ(j)+Sπ(j)−Sj)+2∑j∈NS(s)π(j)=jOj ≥ 0.-f_s + \sum_{\substack{j \in N_S(s)\\ \pi(j) \neq j}} \bigl(O_j + O_{\pi(j)} + S_{\pi(j)} - S_j\bigr) + 2 \sum_{\substack{j \in N_S(s)\\ \pi(j) = j}} O_j \ \ge\ 0.−fs​+j∈NS​(s)π(j)=j​∑​(Oj​+Oπ(j)​+Sπ(j)​−Sj​)+2j∈NS​(s)π(j)=j​∑​Oj​ ≥ 0.

The inequality records what the local optimum learns from the drop move that closes a good facility. Summed with inequality (8) for the bad facilities, it gives the facility cost bound of Lemma 4.2.

Formalization Note The instance is required to have at least one client. Then a good facility is never the only open facility, so dropping it is a legal move. With no clients and S={s}S = \{s\}S={s} the inequality would read −fs≥0-f_s \ge 0−fs​≥0, which fails; the paper implicitly assumes clients exist.

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

/-- Inequality (5), p. 555. Let `S` be a locally optimum solution for the neighbourhood (4), `O`
any solution, `σS`, `σO` nearest-facility assignments for `S` and `O` (so `S_j = c_{j σS(j)}`,
`O_j = c_{j σO(j)}`), and `π` the mapping of the proof of Lemma 4.2. If there is at least one
client and `s ∈ S` is good (captures no `o ∈ O`), then
`−f_s + ∑_{j ∈ N_S(s), π(j) ≠ j} (O_j + O_{π(j)} + S_{π(j)} − S_j)
  + 2 ∑_{j ∈ N_S(s), π(j) = j} O_j ≥ 0`. -/
theorem drop_good_inequality_5 {Cl Fa : Type} [Fintype Cl] [DecidableEq Cl] [Nonempty Cl]
    [Fintype Fa] [DecidableEq Fa]
    (I : MetricInstance Cl Fa) (f : Fa → ℝ) (hf : ∀ i, 0 ≤ f i)
    (S O : Finset Fa) (hS : S.Nonempty) (hloc : IsUFLLocalOpt I f S hS)
    (σS σO : Cl → Fa) (hσS : IsNearestAssignment I S σS) (hσO : IsNearestAssignment I O σO)
    (π : Equiv.Perm Cl) (hπ : IsRefinedPi σS σO π)
    (s : Fa) (hs : s ∈ S) (hgood : IsGood σS σO O s) :
    0 ≤ -f s +
      ∑ j ∈ (nbhd σS s).filter (fun j => π j ≠ j),
        (I.c j (σO j) + I.c (π j) (σO (π j)) + I.c (π j) (σS (π j)) - I.c j (σS j)) +
      2 * ∑ j ∈ (nbhd σS s).filter (fun j => π j = j), I.c j (σO j) := 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, eq. (5)
Read-back

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

Setting. Let C\mathcal CC (clients) be a finite, nonempty type and F\mathcal FF (facilities) a finite type, both 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 nonempty A⊆FA\subseteq\mathcal FA⊆F, write cost(A)=∑i∈Afi+∑j∈Cmin⁡i∈Acji\mathrm{cost}(A)=\sum_{i\in A}f_i+\sum_{j\in\mathcal C}\min_{i\in A}c_{ji}cost(A)=∑i∈A​fi​+∑j∈C​mini∈A​cji​.

Hypotheses.

  • S,OS,OS,O are finite sets of facilities, and SSS is nonempty. OOO is not explicitly required to be nonempty.

  • SSS 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′.
  • σS,σO:C→F\sigma_S,\sigma_O:\mathcal C\to\mathcal FσS​,σO​:C→F are nearest-facility assignments:

    • for every jjj: σS(j)∈S\sigma_S(j)\in SσS​(j)∈S and cjσS(j)≤cjic_{j\sigma_S(j)}\le c_{ji}cjσS​(j)​≤cji​ for all i∈Si\in Si∈S;
    • for every jjj: σO(j)∈O\sigma_O(j)\in OσO​(j)∈O and cjσO(j)≤cjic_{j\sigma_O(j)}\le c_{ji}cjσO​(j)​≤cji​ for all i∈Oi\in Oi∈O.

    Write Sj=cjσS(j)S_j=c_{j\sigma_S(j)}Sj​=cjσS​(j)​ and Oj=cjσO(j)O_j=c_{j\sigma_O(j)}Oj​=cjσO​(j)​.

  • Write NS(s)={j:σS(j)=s}N_S(s)=\{j:\sigma_S(j)=s\}NS​(s)={j:σS​(j)=s}, NO(o)={j:σO(j)=o}N_O(o)=\{j:\sigma_O(j)=o\}NO​(o)={j:σO​(j)=o} and Nso=NO(o)∩NS(s)N^o_s=N_O(o)\cap N_S(s)Nso​=NO​(o)∩NS​(s). Say that sss captures ooo when ∣NO(o)∣<2∣Nso∣|N_O(o)|<2|N^o_s|∣NO​(o)∣<2∣Nso​∣.

  • π\piπ is a permutation of C\mathcal CC satisfying all three of:

    • (i) σO(π(j))=σO(j)\sigma_O(\pi(j))=\sigma_O(j)σO​(π(j))=σO​(j) for all jjj;
    • (ii) for all facilities s,os,os,o with sss not capturing ooo: j∈Nso⇒π(j)∉Nsoj\in N^o_s\Rightarrow\pi(j)\notin N^o_sj∈Nso​⇒π(j)∈/Nso​;
    • (iii) for all facilities s,os,os,o with sss capturing ooo: j∈Nsoj\in N^o_sj∈Nso​ and π(j)∈Nso\pi(j)\in N^o_sπ(j)∈Nso​ imply π(j)=j\pi(j)=jπ(j)=j.
  • s∈Ss\in Ss∈S is good: it captures no o∈Oo\in Oo∈O.

Conclusion.

0≤−fs+∑j∈NS(s)π(j)≠j(Oj+Oπ(j)+Sπ(j)−Sj)+2∑j∈NS(s)π(j)=jOj,0\le -f_s+\sum_{\substack{j\in N_S(s)\\ \pi(j)\ne j}}\big(O_j+O_{\pi(j)}+S_{\pi(j)}-S_j\big)+2\sum_{\substack{j\in N_S(s)\\ \pi(j)=j}}O_j,0≤−fs​+j∈NS​(s)π(j)=j​∑​(Oj​+Oπ(j)​+Sπ(j)​−Sj​)+2j∈NS​(s)π(j)=j​∑​Oj​,

where Oπ(j)=cπ(j) σO(π(j))O_{\pi(j)}=c_{\pi(j)\,\sigma_O(\pi(j))}Oπ(j)​=cπ(j)σO​(π(j))​ and Sπ(j)=cπ(j) σS(π(j))S_{\pi(j)}=c_{\pi(j)\,\sigma_S(\pi(j))}Sπ(j)​=cπ(j)σS​(π(j))​.

Degenerate cases.

  • Because C\mathcal CC is nonempty, the nearest-assignment hypothesis for OOO forces O≠∅O\neq\emptysetO=∅.
  • If NS(s)=∅N_S(s)=\emptysetNS​(s)=∅ (the facility s∈Ss\in Ss∈S serves no client), both sums are empty. The statement then asserts fs≤0f_s\le0fs​≤0, hence fs=0f_s=0fs​=0.
  • If S={s}S=\{s\}S={s}, then NS(s)=CN_S(s)=\mathcal CNS​(s)=C.
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