Inequality (2): the cost bound for a considered swap
ProvedLocalSearchFL.KMedian.swap_inequality_2Consider a metric instance with clients and facilities . Let be a nonempty set of facilities that is locally optimum for single swaps, and let be a set of facilities. Let and be nearest-facility assignments for and , with service costs and and neighbourhoods , . Let be a bijection that maps every onto itself and satisfies Property 3.1 on every : whenever does not capture , .
If and are such that captures no facility with , then
Summed over the swaps of §3.2, these inequalities give , i.e. Theorem 3.2.
Formalization Note The facilities and may coincide or may lie in (the paper notes that its inequalities hold even if ). The permutation is one permutation of all clients, the union of the bijections of the individual sets .
import Mathlib import Definitions.Def_LocalSearchFL_KMedian_captures
namespace LocalSearchFL.KMedian
/-- Inequality (2) (pp. 550–551). Let `S` be a locally optimum solution for single swaps, `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 `π` a permutation of the clients that maps each `N_O(o)` onto itself
and satisfies Property 3.1 on each. If `s ∈ S`, `o ∈ O` and `s` captures no `o' ∈ O` other than
`o`, then
`∑_{j ∈ N_O(o)} (O_j − S_j) + ∑_{j ∈ N_S(s), j ∉ N_O(o)} (O_j + O_{π(j)} + S_{π(j)} − S_j) ≥ 0`. -/
theorem swap_inequality_2 {Cl Fa : Type} [Fintype Cl] [DecidableEq Cl] [DecidableEq Fa]
(I : LocalSearchFL.Shared.MetricInstance Cl Fa) (S O : Finset Fa) (hS : S.Nonempty)
(hloc : IsSwapLocalOpt I S hS)
(σS σO : Cl → Fa) (hσS : IsNearestAssignment I S σS) (hσO : IsNearestAssignment I O σO)
(π : Equiv.Perm Cl) (hπO : ∀ j, σO (π j) = σO j)
(hπ : ∀ s o : Fa, ¬ captures σS σO s o →
∀ j ∈ nbhd σO o ∩ nbhd σS s, π j ∉ nbhd σO o ∩ nbhd σS s)
(s o : Fa) (hs : s ∈ S) (ho : o ∈ O)
(hcap : ∀ o' ∈ O, o' ≠ o → ¬ captures σS σO s o') :
0 ≤ ∑ j ∈ nbhd σO o, (I.c j (σO j) - I.c j (σS j)) +
∑ j ∈ nbhd σS s \ nbhd σO o,
(I.c j (σO j) + I.c (π j) (σO (π j)) + I.c (π j) (σS (π j)) - I.c j (σS j)) := by sorry
end LocalSearchFL.KMedian
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting.
- is a finite type of clients with decidable equality.
- is a type of facilities with decidable equality.
- is an instance of the structure
MetricInstance(defined in a file not shown), supplying a real cost for client and facility . No property of is stated in this code. - are finite sets with nonempty. No relation between and is assumed.
Notation:
- .
- " captures " means .
- .
Hypotheses.
- Swap local optimality of . For every and every facility , .
- is a nearest assignment for . For every , and for all .
- is a nearest assignment for . For every , and for all .
- preserves . is a permutation of with for all . Hence maps each set onto itself.
- Non-capture property of . For all facilities (not only those in , ): if does not capture , then for every , .
- and .
- captures no with . Whether captures itself is left open.
Conclusion. Writing and :
By hypothesis 4, the middle terms are and .
Degenerate cases.
- If is empty, hypotheses 2–5 hold trivially, both sums are empty, and the conclusion is . still has to contain , so is nonempty.
- If is nonempty, hypothesis 3 forces to be nonempty. Hypothesis 2 is consistent with being nonempty.
- If contains every facility of , hypothesis 1 holds trivially and gives no information.
- The identity permutation satisfies hypothesis 4. It satisfies hypothesis 5 only when every set with not capturing is empty.
- The statement does not itself assert that some meeting hypotheses 4 and 5 exists. If none exists for given , the claim is vacuous for them.
- If , the first sum is . If , the second sum is .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.