Weighted-subset model for the capacitated k-means lower bound
DefinitionPriceCapacities_LowerBound_WeightedSubsetModelcapacitated-coresetsclusteringcoresets
For a finite unweighted Euclidean input, a weighted-subset coreset uses nonnegative weights supported on the input. It preserves total mass and approximates capacitated squared-distance assignment costs for every configuration of at most centers and every feasible load. Support size counts distinct points of positive weight. These definitions specify the model and the lower-bound rate for Theorem 3.1.
Definition code
import Mathlib.Algebra.BigOperators.Field
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Analysis.Real.Sqrt
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Data.Finsupp.Basic
import Mathlib.Data.Real.Basic
import Mathlib.Order.ConditionallyCompleteLattice.Finset
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.NormNum
import Mathlib.Tactic.Positivity
import Mathlib.Tactic.Ring
section
noncomputable section
attribute [local instance] Classical.propDecidable
open scoped BigOperators
namespace CapacitatedCoresets
universe u
structure WeightedPointSet (X : Type u) where
weight : X →₀ ℝ
nonneg : ∀ x, 0 ≤ weight x
namespace WeightedPointSet
variable {X : Type u}
def support (P : WeightedPointSet X) : Finset X := P.weight.support
def supportSize (P : WeightedPointSet X) : ℕ := P.support.card
def sum (P : WeightedPointSet X) (f : X → ℝ) : ℝ :=
∑ x ∈ P.support, P.weight x * f x
def mass (P : WeightedPointSet X) : ℝ := P.sum (fun _ => 1)
def ofFinset (s : Finset X) : WeightedPointSet X := by
classical
refine ⟨Finsupp.onFinset s (fun x => if x ∈ s then 1 else 0) ?_, ?_⟩
· intro x hx
by_contra hn
simp [hn] at hx
· intro x
simp only [Finsupp.onFinset_apply]
split_ifs <;> norm_num
end WeightedPointSet
abbrev Euclidean (d : ℕ) := Fin d → ℝ
def squaredDistance {I : Type*} [Fintype I] (x y : I → ℝ) : ℝ := ∑ i, (x i - y i) ^ 2
end CapacitatedCoresets
end
end
section
noncomputable section
attribute [local instance] Classical.propDecidable
open scoped BigOperators
namespace CapacitatedCoresets
universe u
variable {X : Type u}
def FeasibleLoad {k : ℕ} (n : ℝ) (h : Fin k → ℝ) : Prop :=
(∀ i, 0 ≤ h i) ∧ ∑ i, h i = n
structure Assignment (P : WeightedPointSet X) {k : ℕ} (h : Fin k → ℝ) where
entry : P.support → Fin k → ℝ
nonneg : ∀ x i, 0 ≤ entry x i
row_sum : ∀ x, ∑ i, entry x i = P.weight x
col_sum : ∀ i, ∑ x, entry x i = h i
namespace Assignment
variable {P : WeightedPointSet X} {k : ℕ} {h : Fin k → ℝ}
def cost (a : Assignment P h) (c : X → Fin k → ℝ) : ℝ :=
∑ x, ∑ i, a.entry x i * c x i
end Assignment
def transportCost (P : WeightedPointSet X) {k : ℕ}
(c : X → Fin k → ℝ) (h : Fin k → ℝ) : ℝ :=
sInf (Set.range (fun a : Assignment P h => a.cost c))
def euclideanDistance {d : ℕ} (x y : Euclidean d) : ℝ :=
Real.sqrt (squaredDistance x y)
def euclideanCost {d k : ℕ} (z : ℝ) (C : Fin k → Euclidean d)
(x : Euclidean d) (i : Fin k) : ℝ := euclideanDistance x (C i) ^ z
def capacitatedCost {d k : ℕ} (P : WeightedPointSet (Euclidean d)) (z : ℝ)
(C : Fin k → Euclidean d) (h : Fin k → ℝ) : ℝ :=
transportCost P (euclideanCost z C) h
def IsCapacitatedCoreset {d : ℕ} (P Q : WeightedPointSet (Euclidean d))
(k : ℕ) (z ε : ℝ) : Prop :=
Q.mass = P.mass ∧ ∀ m, 0 < m → m ≤ k → ∀ C : Fin m → Euclidean d,
∀ h : Fin m → ℝ, FeasibleLoad P.mass h →
|capacitatedCost Q z C h - capacitatedCost P z C h| ≤
ε * capacitatedCost P z C h
def IsSubsetCapacitatedCoreset {d : ℕ} (P Q : WeightedPointSet (Euclidean d))
(k : ℕ) (z ε : ℝ) : Prop :=
Q.support ⊆ P.support ∧ IsCapacitatedCoreset P Q k z ε
end CapacitatedCoresets
end
end
section
noncomputable section
namespace CapacitatedCoresets
def warmupRate (k : ℕ) (ε : ℝ) : ℝ :=
min ((k : ℝ) * ε ^ (-4 : ℝ)) ((k : ℝ) ^ (2 : ℕ) * ε ^ (-2 : ℝ))
def SubsetCapacitatedHardInstance (k : ℕ) (ε bound : ℝ) : Prop :=
∃ d : ℕ, ∃ P : Finset (Euclidean d),
∀ Q : WeightedPointSet (Euclidean d),
IsSubsetCapacitatedCoreset (WeightedPointSet.ofFinset P) Q k 2 ε →
bound ≤ (Q.supportSize : ℝ)
end CapacitatedCoresets
end
end
Source
Prabhu, Schwiegelshohn and Shyam, The Price of Capacities for Clustering Coresets, Theorem 3.1 and the weighted-subset model. https://github.com/sudarshanshy/capacitated-coresets-lean/blob/54b6ee5f3275d21e77246f3ab4ab7e2d0d207ae5/CapacitatedCoresets/Asymptotics.lean#L74