Theorem 3.2 — single-swap local search for metric k-median has locality gap at most 5
ProvedLocalSearchFL.KMedian.single_swap_locality_gapConsider a metric instance with a finite set of clients , a finite set of facilities and service costs (nonnegative, symmetric, satisfying the triangle inequality), and let . For a nonempty let .
Let be a set of exactly facilities that is locally optimum for single swaps: for every and . Then for every nonempty set of at most facilities,
In the paper's words: a local search procedure for the metric k-median problem with the neighbourhood structure has a locality gap of at most 5. Taking to be an optimal solution, every local optimum of the single-swap local search is a 5-approximation.
Formalization Note The local search starts from facilities and swaps preserve the size, so the local optimum has exactly facilities; ranges over every feasible solution (the proof never uses optimality of ), which is stronger than comparing with an optimum. The bound is multiplied out, so it is meaningful when . The hypothesis is expressed by the nonemptiness of .
import Mathlib import Definitions.Def_LocalSearchFL_KMedian_kmCost
namespace LocalSearchFL.KMedian
/-- Theorem 3.2 (p. 551): single-swap local search for the metric k-median problem has locality
gap at most 5. If `S` is a set of `k` facilities that is locally optimum for single swaps, then
`cost(S) ≤ 5 · cost(O)` for every nonempty set `O` of at most `k` facilities. -/
theorem single_swap_locality_gap {Cl Fa : Type} [Fintype Cl] [DecidableEq Cl]
[Fintype Fa] [DecidableEq Fa]
(I : LocalSearchFL.Shared.MetricInstance Cl Fa) (k : ℕ) (S : Finset Fa) (hS : S.Nonempty) (hSk : S.card = k)
(hloc : IsSwapLocalOpt I S hS)
(O : Finset Fa) (hO : O.Nonempty) (hOk : O.card ≤ k) :
kmCost I S hS ≤ 5 * kmCost I O hO := by sorry
end LocalSearchFL.KMedian
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Let (clients) and (facilities) be arbitrary finite types, each with decidable equality. The statement fixes the following data:
- , a value of type
LocalSearchFL.Shared.MetricInstanceover and . Its contents are defined in the imported definitions file, which is not shown here. Judging by its name it bundles distances between clients and facilities with some metric conditions, but exactly which fields and axioms it contains cannot be read from this declaration. - .
- , a finite set of facilities that is nonempty and has exactly elements.
- A hypothesis that satisfies
IsSwapLocalOptwith respect to . This predicate is also defined in the imported file and is not shown. Its name suggests that is a local optimum for single swaps (removing one facility and adding one). The precise condition is whatever that definition says, for example which swaps are allowed, whether the comparison is or , and whether the cardinality must stay the same. - , any nonempty finite set of facilities with .
Write for kmCost I X. This function is defined in the imported file and takes a nonemptiness proof for . Its formula (for example, a sum over clients of the distance to the nearest facility in ) and its value type are not visible in this declaration. The theorem asserts:
Here and are interpreted in whatever ordered type kmCost returns.
Edge cases and scope:
- The number only enters through and . So the claim is that for every nonempty with .
- Since must be nonempty, and must have at least one element. If is empty, no exists and the statement is vacuous.
- may be a single facility, may equal , and may overlap in any way.
- If , then is that single facility and the inequality reads . This holds if the cost is nonnegative, which the code shown does not guarantee.
- The client type may be empty. What the cost equals then (for example, an empty sum of , giving ) depends on the unshown definition of
kmCost. - If
IsSwapLocalOptor the axioms ofMetricInstancecan never be satisfied, the theorem is vacuous. Whether that happens cannot be determined from this declaration. - No division, natural-number subtraction, integrals or suprema appear in the statement itself. Any such operation that returns a default value would sit inside the unshown definitions.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.