Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Property 3.2 — a bijection of N_O(o) moving every small class of a partition off itself

Proved
LocalSearchFL.MultiSwap.exists_pi_property_3_2

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

combinatoricsk-medianlocal-searchp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1

Let NNN be a finite set, partitioned into classes: for j∈Nj \in Nj∈N let Pj={x∈N:g(x)=g(j)}P_j = \{x \in N : g(x) = g(j)\}Pj​={x∈N:g(x)=g(j)} be the class of jjj under a labelling ggg. Then there is a one-to-one and onto map π:N→N\pi : N \to Nπ:N→N such that for every class PPP with ∣P∣≤12∣N∣|P| \le \tfrac12 |N|∣P∣≤21​∣N∣,

π(P)∩P=∅.\pi(P) \cap P = \emptyset.π(P)∩P=∅.

In the analysis N=NO(o)N = N_O(o)N=NO​(o) for a facility o∈Oo \in Oo∈O, and the classes are the sets NS(Ai)∩NO(o)N_S(A_i) \cap N_O(o)NS​(Ai​)∩NO​(o) for the blocks with ∣Ai∣≤p|A_i| \le p∣Ai​∣≤p and NS(s)∩NO(o)N_S(s) \cap N_O(o)NS​(s)∩NO​(o) for the facilities sss of the blocks with ∣Ai∣>p|A_i| > p∣Ai​∣>p. The map π\piπ is used to reassign the clients of the deleted facilities in each swap.

Formalization Note The statement is abstract (any type, any finite set NNN, any labelling ggg). The bijection of NNN is a permutation of the ambient type that maps NNN onto itself and fixes every point outside NNN. "∣P∣≤12∣N∣|P| \le \tfrac12|N|∣P∣≤21​∣N∣" is written 2∣P∣≤∣N∣2|P| \le |N|2∣P∣≤∣N∣, and π(P)∩P=∅\pi(P) \cap P = \emptysetπ(P)∩P=∅ as g(π(j))≠g(j)g(\pi(j)) \ne g(j)g(π(j))=g(j) for every j∈Pj \in Pj∈P. This is the same abstract lemma as Property 3.1 of the single-swap mission of this series.

Preamble
import Mathlib
Formal statement
namespace LocalSearchFL.MultiSwap

/-- Property 3.2 (p. 553), in abstract form. Let `N` be a finite set (the clients `N_O(o)` of a
facility `o`) partitioned into the classes of a labelling `g` (the class of `j` is
`P_j = {x ∈ N | g x = g j}`). There is a bijection `π` of `N` (a permutation fixing every point
outside `N`) such that `π(P) ∩ P = ∅` for every class `P` with `|P| ≤ ½ |N|`. -/
theorem exists_pi_property_3_2 {α β : Type} [DecidableEq β] (N : Finset α) (g : α → β) :
    ∃ π : Equiv.Perm α,
      (∀ j, π j ∈ N ↔ j ∈ N) ∧
      (∀ j, j ∉ N → π j = j) ∧
      ∀ j ∈ N, 2 * (N.filter (fun x => g x = g j)).card ≤ N.card → g (π j) ≠ g j := by sorry

end LocalSearchFL.MultiSwap
Source
Arya, Garg, Khandekar, Meyerson, Munagala, Pandit, Local Search Heuristics for k-Median and Facility Location Problems, SIAM J. Comput. 33(3), 2004, p. 553, Property 3.2 (construction as in §3.2, p. 549)
Read-back

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

Data.

  • α\alphaα and β\betaβ are arbitrary types, and β\betaβ has decidable equality.
  • NNN is a finite subset of α\alphaα.
  • g:α→βg : \alpha \to \betag:α→β is an arbitrary function (a labelling).
  • For j∈Nj \in Nj∈N, the class of jjj is
Pj={ x∈N:g(x)=g(j) }.P_j = \{\, x \in N : g(x) = g(j) \,\}.Pj​={x∈N:g(x)=g(j)}.

There are no hypotheses.

Claim. There is a bijection π:α→α\pi : \alpha \to \alphaπ:α→α such that:

  1. For every j∈αj \in \alphaj∈α: π(j)∈N  ⟺  j∈N\pi(j) \in N \iff j \in Nπ(j)∈N⟺j∈N. So π\piπ maps NNN onto NNN.
  2. For every j∉Nj \notin Nj∈/N: π(j)=j\pi(j) = jπ(j)=j.
  3. For every j∈Nj \in Nj∈N with 2 ∣Pj∣≤∣N∣2\,|P_j| \le |N|2∣Pj​∣≤∣N∣, that is ∣Pj∣≤12∣N∣|P_j| \le \tfrac12 |N|∣Pj​∣≤21​∣N∣ with non-strict inequality: g(π(j))≠g(j)g(\pi(j)) \ne g(j)g(π(j))=g(j).

Condition 3 means that every element of a class holding at most half of NNN is sent to an element of a different class. Elements of a class holding more than half of NNN carry no requirement.

Degenerate cases.

  • If N=∅N = \varnothingN=∅, the identity permutation works.
  • If NNN has one element, its class has size 111 and 2>12 > 12>1, so no constraint applies.
  • If all of NNN is one class, then 2∣N∣≤∣N∣2|N| \le |N|2∣N∣≤∣N∣ only when N=∅N = \varnothingN=∅, so again there is no constraint.
  • If α\alphaα is empty, the claim is trivial.
  • All counts are natural numbers and there is no subtraction or division, so no default values arise.
Human review
  • Endorsed by Shuze Chen · Sep 28, 2026

    Confirmed by the moderator at approval.

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