SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Proof. We want to prove that with probability  $1 - \delta$  we have  $||\mu (S) - \mu (P)||^2\leq \varepsilon \mathrm{cost}(P,\mu (P)) / |P|$ . Then, applying Lemma 1 gives the desired result. First, we notice that  $\mu (P)$  is an unbiased estimator of  $\mu (P)$ , namely  $E[\mu (S)] = \mu (P)$ . Then, we have
$$
E \left[ | | \mu (S) - \mu (P) | | ^ {2} \right] = \frac {1}{m} \sum_ {i = 1} ^ {| S |} E \left[ | | s _ {i} - \mu (P) | | ^ {2} \right] = \frac {\mathsf {c o s t} (P , \mu (P))}{m \cdot | P |}
$$
where  $s_i$  are uniform independent samples from  $P$ . Applying Markov's inequality concludes the proof.
The algorithm that verifies Theorem 12 is very similar to the MSLS algorithm from Section 3 and we use the same notation to describe it. The intuition is that in MSLS we sample  $\mathcal{Q} = \{q_1\ldots q_p\}$  hoping that  $q_{i}\in \operatorname {core}(o_{i})$  for each  $i$ ; here we refine  $q_{i}$  to a better approximation  $\hat{o}_i$  of  $o_i$  and swap the points  $(\hat{o}_i)_i$  rather than  $(q_{i})_{i}$ . Our points  $\hat{o}_i$  are generated taking the average of some sampled point, thus we possibly have  $\hat{o}_i\notin P$  while, on the other hand,  $q_{i}\in P$ .
A  $(9 + \varepsilon)$ -approximation MSLS algorithm. First, we initialize our set of centers using  $k$ -means++. Then, we run  $ndk^{O(\varepsilon^{-2})} \cdot 2^{poly(\varepsilon^{-1})}$  local search steps, where a local search step works as follows. Set  $p = \Theta(\varepsilon^{-1})$ . We  $D^2$ -sample a set  $\mathcal{Q} = \{q_1 \ldots q_p\}$  of points from  $P$  (without updating costs). Then, we iterate over all possible sets  $Out = \{c_1 \ldots c_p\}$  of  $p$  distinct elements in  $\mathcal{C} \cup \mathcal{Q}$ . We define the set of temporary centers  $\mathcal{T} = (\mathcal{C} \cup \mathcal{Q}) \setminus Out$  and run a subroutine APX-CENTERS( $\mathcal{T}$ ) which returns a list of  $poly(\varepsilon^{-1}) \cdot \log^{O(\varepsilon^{-1})}(\Delta)$  size- $s$  sets  $\widehat{In} = \{\hat{o}_1 \ldots \hat{o}_s\}$  (where  $s = |\mathcal{Q} \setminus Out|$ ). We select the set  $\widehat{In}$  in this list such that the swap  $(\widehat{In}, Out \setminus \mathcal{Q})$  yields the maximum cost reduction. Then we select the set  $Out$  that maximizes the cost reduction obtained in this way. If  $(\widehat{In}, Out \setminus \mathcal{Q})$  actually reduces the cost then we perform that swap.
A subroutine to approximate optimal centers. Here we describe the subroutine APX-CENTERS  $(\mathcal{T})$ . Let  $\mathcal{Q} \setminus Out = \{q_1 \ldots q_s\}$ . Recall that  $s \leq p = O(\varepsilon^{-1})$ . This subroutine outputs a list of  $2^{poly(\varepsilon^{-1})} \cdot \log^{O(\varepsilon^{-1})}(\Delta)$  size- $s$  sets  $\widehat{In} = \{\hat{o}_1 \ldots \hat{o}_s\}$ . Here we describe how to find a list of  $2^{poly(\varepsilon^{-1})} \cdot \log(\Delta)$  values for  $\hat{o}_1$ . The same will apply for  $\hat{o}_2 \ldots \hat{o}_s$  and taking the Cartesian product yields a list of  $2^{poly(\varepsilon^{-1})} \cdot \log^{O(\varepsilon^{-1})}(\Delta)$  size- $s$  sets. Assume wlog that the pairwise distances between points in  $P$  lie in  $[1, \Delta]$ . We iterate over all possible values of  $\rho_1 \in \{1, (1 + \varepsilon) \ldots (1 + \varepsilon)^{\lceil \log_{1 + \varepsilon} \Delta \rceil}\}$ . We partition  $P$  in three sets: the set of far points  $F = \{x \in P | cost(x, q_1) > \rho_1^2 / \varepsilon^3\}$ , the set of close points  $C = \{x \in P \setminus F | cost(x, T) \leq \varepsilon^3 \rho_1^2\}$  and the set of nice points  $N = P \setminus (C \cup F)$ . Then, we sample uniformly from  $N$  a set  $S$  of size  $\Theta(\varepsilon^{-1})$ . For each  $(s + 1)$ -tuple of coefficients  $\alpha_0, \alpha_1 \ldots \alpha_s \in \{1, (1 - \varepsilon), (1 - \varepsilon)^2, \ldots (1 - \varepsilon)^{\lceil \log_{1 - \varepsilon} (\varepsilon^7) \rceil}\} \cup \{0\}$  we output the candidate solution given by the convex combination
$$
\hat {o} _ {1} = \hat {o} _ {1} \left(\alpha_ {0} \dots \alpha_ {s}\right) = \frac {\alpha_ {0} \mu (S) + \sum_ {i = 1} ^ {s} \alpha_ {i} q _ {i}}{\sum_ {i = 0} ^ {s} \alpha_ {i}} \tag {3}
$$
so, for each value of  $\rho_{1}$ , we output  $2^{poly(\varepsilon^{-1})}$  values for  $\hat{o}_{1}$ . Hence,  $2^{poly(\varepsilon^{-1})} \cdot \log(\Delta)$  values in total.
The key insight in the analysis of the MSLS algorithm form Section 3 was that every  $q_{i}$  was a proxy for  $o_{i}$  because  $q_{i} \in \mathrm{core}(o_{i})$ , and thus  $q_{i}$  provided a good center for  $O_{i}^{*}$ . In the analysis of this improved version of MSLS we replace  $q_{i}$  with  $\hat{o}_i$  which makes a better center for  $O_{i}^{*}$ . Formally, fixed Out, we say that a point  $\hat{o}_i$  is a perfect approximation of  $o_i$  when  $\mathrm{cost}(O_i^*, (\mathcal{C} \cup \{\hat{o}_i\}) \setminus Out) \leq (1 + \varepsilon)\mathrm{OPT}_i + \varepsilon \mathrm{OPT} / k$ . We define  $\widetilde{\mathcal{O}}$  and  $\widetilde{\mathcal{C}}$  as in Section 3, except that we replace  $\delta$  with  $\varepsilon$  (which here is not assumed to be a constant). Likewise, we build the set  $S$  of ideal multi-swaps as in Section 3. Recall that we say that a multi-swap  $(In, Out)$  is strongly improving if  $\mathrm{cost}(P, (\mathcal{C} \cup In) \setminus Out) \leq (1 - \varepsilon / k) \cdot \mathrm{cost}(P, \mathcal{C})$ . Let  $In = \{o_1 \dots o_s\} \subseteq \widetilde{\mathcal{O}}$  and  $Out = \{c_1 \dots c_s\} \subseteq \widetilde{\mathcal{C}}$ , we overload the definition from Section 3 and say that the ideal multi-swap  $(In, Out)$  is good if for every  $\widehat{In} = \{\hat{o}_1 \dots \hat{o}_s\}$  such that each  $\hat{o}_i$  is a perfect approximation of  $o_i$  for each  $i = 1 \dots s$  the swap  $(\widehat{In}, Out)$  is strongly improving. We call an ideal swap bad otherwise. As in Section 3, we define the core of an optimal center; once again we replace  $\delta$  with  $\epsilon$ , which is no longer constant. The two following lemmas are our stepping stones towards Theorem 12.
Lemma 14. If  $ALG / OPT > 9 + O(\varepsilon)$  then, with probability  $k^{-O(\varepsilon^{-1})} \cdot 2^{-poly(\varepsilon^{-1})}$ , there exists  $Out \subseteq \mathcal{C} \cup \mathcal{Q}$  such that:
(i) If  $\mathcal{Q} \setminus Out = \{q_1 \ldots q_s\}$  then  $q_1 \in core(o_1) \ldots q_s \in core(o_s)$  for some  $o_1 \ldots o_s \in \mathcal{O}^*$ .
(ii) If we define  $In = \{o_1 \dots o_s\}$  then  $(In, Out \setminus \mathcal{Q})$  is a good ideal swap.
Lemma 15. If (i) from Lemma 14 holds, then with probability  $k^{-O(\varepsilon^{-2})} \cdot 2^{-poly(\varepsilon^{-1})}$ , the list returned by APX-CENTERS contains  $\widehat{In} = \{\hat{o}_1 \dots \hat{o}_s\}$  such that  $\hat{o}_i$  is a perfect approximation of  $o_i$  for each  $i = 1 \dots s$ .
Proof of Theorem 12. Here we prove that our improved MSLS algorithm achieves a  $(9 + O(\varepsilon))$ -approximation, which is equivalent to Theorem 12 up to rescaling  $\varepsilon$ . Combining Lemma 14 and
Lemma 15 we obtain that, as long as  $\mathrm{ALG / OPT} > 9 + O(\varepsilon)$ , with probability at least  $k^{-O(\varepsilon^{-2})}$ .  $2^{-poly(\varepsilon^{-1})}$ , the list returned by APX-CENTERS contains  $\widehat{In} = \{\hat{o}_1\ldots \hat{o}_s\}$  such that  $(\widehat{In},Out\setminus \mathcal{Q})$  is strongly improving. If this happens, we call such a local step successful. Now the proof goes exactly as the proof of Theorem 3. Indeed, We show that  $k^{O(\varepsilon^{-2})}\cdot 2^{poly(\varepsilon^{-1})}$  local steps suffice to obtain  $\Omega (k\log \log k / \varepsilon)$  successful local steps, and thus to obtain the desired approximation ratio, with constant probability.
To prove the running time bound it is sufficient to notice that a local search step can be performed in time  $nd\log^{O(\varepsilon^{-1})}(\Delta)\cdot 2^{poly(\varepsilon^{-1})}$ .
In the rest of this section, we prove Lemma 14 and Lemma 15.
Observation 16. If we assume  $\delta = \varepsilon$  non-constant in Lemma 2, then performing the computations explicitly we obtain  $\operatorname*{Pr}[q\in \mathsf{core}(O_i^*)]\geq poly(\varepsilon)$
In order to prove Lemma 14, we first prove the two lemmas. Lemma 17 is the analogous of Lemma 10 and Lemma 18 is the analogous of Lemma 11. Overloading once again the definition from Section 3, we define  $G$  as the union of cores of good optimal centers in  $\widetilde{\mathcal{O}}$ , where an optimal center is defined to be good if at least one of the ideal multi-swaps in  $S$  it belongs to is good (exactly as in Section 3).
Lemma 17. If an ideal swap  $(In, Out)$  is bad, then we have
$$
\operatorname {c o s t} \left(O _ {I n} ^ {*}, \mathcal {C}\right) \leq (1 + \varepsilon) \operatorname {c o s t} \left(O _ {I n} ^ {*}, \mathcal {O} ^ {*}\right) + \operatorname {R e a s s i g n} (\operatorname {I n}, \operatorname {O u t}) + \varepsilon A L G / k. \tag {4}
$$
Proof. Let  $In = \{o_1 \ldots o_s\}$ ,  $\widehat{In} = \{\hat{o}_1 \ldots \hat{o}_s\}$  such that  $\hat{o}_i$  is a perfect approximation of  $o_i$  for each  $i = 1 \ldots s$ . Recall that  $O_{In}^* := \bigcup_{i=1}^{s} O_i^*$ , then
$$
\operatorname {c o s t} \left(O _ {I n} ^ {*}, \left(\mathcal {C} \cup \widehat {I n}\right) \backslash O u t\right) \leq \sum_ {i = 1} ^ {s} \operatorname {c o s t} \left(O _ {i} ^ {*}, \left(\mathcal {C} \cup \{\hat {o} _ {i} \}\right) \backslash O u t\right) \leq (1 + \varepsilon) \operatorname {c o s t} \left(O _ {I n} ^ {*}, \mathcal {O} ^ {*}\right). \tag {5}
$$
Moreover,  $\operatorname{Reassign}(In, Out) = \operatorname{cost}(P \setminus O_{In}^{*}, \mathcal{C} \setminus Out) - \operatorname{cost}(P \setminus O_{In}^{*}, \mathcal{C})$  because points in  $P \setminus C_{Out}$  are not affected by the swap. Therefore,  $\operatorname{cost}\left(P, (\mathcal{C} \cup \widehat{In}) \setminus Out\right) \leq (1 + \varepsilon)\operatorname{cost}(O_{In}^{*}, O^{*}) + \operatorname{Reassign}(In, Out) + \operatorname{cost}(P \setminus O_{In}^{*}, \mathcal{C})$ . Suppose by contradiction that Equation (4) does not hold, then
$$
\operatorname {c o s t} (P, \mathcal {C}) - \operatorname {c o s t} \left(P, (\mathcal {C} \cup \widehat {I n}) \backslash O u t\right) =
$$
$$
\operatorname {c o s t} \left(P \backslash O _ {I n} ^ {*}, \mathcal {C}\right) + \operatorname {c o s t} \left(O _ {I n} ^ {*}, \mathcal {C}\right) - \operatorname {c o s t} \left(P, \left(\mathcal {C} \cup \widehat {I n}\right) \backslash O u t\right) \geq \epsilon \mathrm {A L G} / k.
$$
Hence,  $(\widehat{In},Out)$  is strongly improving and this holds for any choice of  $\widehat{In}$ , contradiction.
Lemma 18. If  $ALG / OPT > 9 + O(\varepsilon)$  then  $cost(G, \mathcal{C}) \geq cost(P, \mathcal{C}) \cdot poly(\varepsilon)$ . Thus, if we  $D^2$ -sample  $q$  we have  $P[q \in G] \geq poly(\varepsilon)$ .
Proof. First, we observe that the combined current cost of all optimal clusters in  $\mathcal{O}^*\setminus \widetilde{\mathcal{O}}$  is at most  $k\cdot \varepsilon \mathrm{ALG} / k = \varepsilon \mathrm{ALG}$ . Now, we prove that the combined current cost of all  $O_{i}^{*}$  such that  $o_i$  is bad is  $\leq (1 - 2\varepsilon)\mathrm{ALG}$ . Suppose, by contradiction, that it is not the case, then we have:
$$
(1 - 2 \varepsilon) \mathrm {A L G} <   \sum_ {\text {B a d} o _ {i} \in \widetilde {\mathcal {O}}} \operatorname {c o s t} \left(O _ {i} ^ {*}, \mathcal {C}\right) \leq \sum_ {\text {B a d} (I n, O u t) \in \mathcal {S}} w (I n, O u t) \cdot \operatorname {c o s t} \left(O _ {I n} ^ {*}, \mathcal {C}\right) \leq
$$
$$
\sum_ {\text {B a d} (I n, O u t)} w (I n, O u t) \cdot ((1 + \varepsilon) \operatorname {c o s t} \left(O _ {I n} ^ {*}, \mathcal {O} ^ {*}\right) + \operatorname {R e a s s i g n} (I n, O u t) + \varepsilon \operatorname {A L G} / k) \leq
$$
$$
(1 + \varepsilon) \mathrm {O P T} + (2 + 2 / p) \mathrm {O P T} + (2 + 2 / p) \sqrt {\mathrm {A L G}} \sqrt {\mathrm {O P T}} + \varepsilon \mathrm {A L G}.
$$
The second and last inequalities make use of Observation 7. The third inequality uses Lemma 17.
Setting  $\eta^2 = \mathrm{ALG / OPT}$  we obtain the inequality  $\eta^2 -(2 + 2 / p\pm O(\varepsilon))\eta -(3 + 2 / p\pm O(\varepsilon))\leq 0.$  Hence, we obtain a contradiction in the previous argument as long as  $\eta^2 -(2 + 2 / p\pm O(\varepsilon))\eta -(3 +$
$2 / p\pm O(\varepsilon)) > 0$  , which holds for  $p = \Theta (\varepsilon^{-1})$  and  $\eta^2 = 9 + O(\varepsilon)$  . A contradiction there implies that at least an  $\varepsilon$  -fraction of the current cost is due to points in  $\bigcup_{\mathrm{Good}o_i\in \tilde{\mathcal{O}}}O_i^*$  . Thanks to Observation 16, we have  $P_{q\sim \mathrm{cost}(q,\mathcal{C})}[q\in \mathrm{core}(O_i^*)\mid q\in O_i^* ]\geq poly(\varepsilon)$  . Therefore, we can conclude that the current cost of  $G = \bigcup_{\mathrm{Good}o_i\in \tilde{\mathcal{O}}} \mathrm{core}(O_i^*)$  is at least a poly(ε)-fraction of the total current cost.
Proof of Lemma 14. Thanks to Lemma 18, we have that  $P[q_1 \in G] \geq poly(\varepsilon)$ . Whenever  $q_1 \in G$  we have that  $q_1 \in \operatorname{core}(o_1)$  for some good  $o_1$ . Then, for some  $s \leq p$  we can complete  $o_1$  with  $o_2 \ldots o_s$  such that  $In = \{o_1 \ldots o_s\}$  belongs to a good swap. Concretely, there exists  $Out \subseteq \mathcal{C}$  such that  $(In, Out)$  is a good swap. Since  $In \subset \widetilde{\mathcal{O}}$  we have  $\operatorname{cost}(O_i^*, \mathcal{C}) > \varepsilon \mathrm{OPT} / k$  for all  $o_i \in In$ , which combined with Observation 16 gives that, for each  $i = 2 \ldots s$ ,  $P[q_i \in \operatorname{core}(o_i)] \geq poly(\varepsilon) / k$ . Hence, we have  $P[q_i \in \operatorname{core}(o_i)$  for  $i = 1 \ldots s] \geq 2^{-poly(\varepsilon^{-1})} k^{-O(\varepsilon^{-1})}$ . Notice, however, that  $(\widehat{In}, Out)$  is a  $s$ -swap and we may have  $s < p$ . Nevertheless, whenever we sample  $q_1 \ldots q_s$  followed by any sequence  $q_{s+1} \ldots q_p$  it is enough to choose  $Out' = Out \cup \{q_{s+1} \ldots q_p\}$  to obtain that  $(\{q_1 \ldots q_p\}, Out')$  is an improving  $p$ -swap.
In order to prove Lemma 15 we first need a few technical lemmas.
Lemma 19 (Lemma 2 from Lattanzi and Sohler [2019]). For each  $x, y, z \in \mathbb{R}^d$  and  $\varepsilon > 0$ ,  $\text{cost}(x, y) \leq (1 + \varepsilon) \text{cost}(x, z) + (1 + 1 / \varepsilon) \text{cost}(z, y)$ .
Lemma 20. Given  $q \in \mathbb{R}^d$  and  $Z \subseteq \mathbb{R}^d$  such that  $\text{cost}(Z, q) \leq \varepsilon^2 \Gamma$  then, for each  $o \in \mathbb{R}^d$
$$
(1 - O (\varepsilon)) \operatorname {c o s t} (Z, o) - O (\varepsilon) \Gamma \leq | Z | \operatorname {c o s t} (q, o) \leq (1 + O (\varepsilon)) \operatorname {c o s t} (Z, o) + O (\varepsilon) \Gamma
$$
Proof. To obtain the first inequality, we apply Lemma 19 to bound  $\mathrm{cost}(z,o)\leq (1 + \varepsilon)\mathrm{cost}(z,o) +$ $(1 + 1 / \varepsilon)\mathrm{cost}(z,q)$  for each  $z\in Z$  . To obtain the second inequality, we bound  $\mathrm{cost}(q,o)\leq$ $(1 + \varepsilon)\mathrm{cost}(z,o) + (1 + 1 / \varepsilon)\mathrm{cost}(z,q)$  for each  $z\in Z$
Lemma 21. Let  $X = \{x_{1}\ldots x_{\ell}\}$  be a weighted set of points in  $\mathbb{R}^d$  such that  $x_{i}$  has weight  $w_{i}$ . Let  $\mu$  be the weighted average of  $X$ . Let  $\hat{\mu} = \hat{\mu} (\alpha_{1}\dots \alpha_{\ell})$  be the weighted average of  $X$  where  $x_{i}$  has weight  $\alpha_{i}$ . If  $w_{i}\leq \alpha_{i}\leq w_{i} / (1 - \varepsilon)$  for each  $i = 1\dots \ell$ , then if we interpret  $cost(X,C)$  as  $\sum_{x_i\in X}w_i\cdot cost(x_i,C)$  we have  $cost(X,\hat{\mu})\leq (1 + O(\varepsilon))cost(X,\mu)$ .
Proof. We note that  $\mu$  minimizes the expression  $\mathrm{cost}(X,\mu)$ . Moreover,  $\mathrm{cost}(X,z) \leq \sum_{i=1}^{\ell} \alpha_i \cdot \mathrm{cost}(x_i,z) \leq \mathrm{cost}(X,z)/(1-\varepsilon)$ . Since  $\hat{\mu}$  minimizes the expression  $\sum_{i=1}^{\ell} \alpha_i \cdot \mathrm{cost}(x_i,z)$  it must be  $\mathrm{cost}(X,\hat{\mu}) \leq \mathrm{cost}(X,\mu)/(1-\varepsilon)$ .
Adopting the same proof strategy, we obtain the following.
Observation 22. Thanks to Lemma 20, we can assume that the points in  $Z$  are concentrated in  $q$  for the purpose of computing a  $(1 + O(\varepsilon))$ -approximation to the 1-means problem on  $Z$ , whenever an additive error  $\Gamma$  is tolerable. Indeed, moving all points in  $Z$  to  $q$  introduces a  $1 + O(\varepsilon)$  multiplicative error on  $cost(Z, \cdot)$  and a  $O(\varepsilon)\Gamma$  additive error.
The next lemma shows that a point  $z$  that is far from a center  $o$  experiences a small variation of  $\mathrm{cost}(z, o)$  when the position of  $o$  is slightly perturbed.
Lemma 23. Given  $o, z \in \mathbb{R}^d$  such that  $||o - z|| \geq r / \varepsilon$  we have that for every  $o' \in B(o, r)$ ,  $\text{cost}(z, o') = (1 \pm O(\varepsilon)) \text{cost}(z, o)$ .
Proof. It is enough to prove it for all  $o'$  that lie on the line  $L$  passing through  $o$  and  $z$ , any other point in  $o'' \in B(o, r)$  admits a point  $o' \in B(o, r) \cap L$  with  $||o' - z|| = ||o'' - z||$ . It is enough to compute the derivative of  $\mathsf{cost}(z, \cdot)$  with respect to the direction of  $L$  and see that  $\frac{\partial \mathsf{cost}(z, \cdot)}{\partial L} |_{B(o, r)} = (1 \pm O(\varepsilon))r / \varepsilon$ . Thus,  $\mathsf{cost}(z, o') = \mathsf{cost}(z, o) \pm (1 \pm O(\varepsilon))r^2 / \varepsilon = (1 \pm O(\varepsilon))\mathsf{cost}(z, o)$ .
Proof of Lemma 15. Here we prove that for each  $o_1 \ldots o_s$  there exist coefficients  $\alpha_0^{(i)} \ldots \alpha_s^{(i)} \in \{1, (1 - \varepsilon) \ldots (1 - \varepsilon)^{\lceil \log_{1 - \varepsilon}(\varepsilon^7) \rceil} \} \cup \{0\}$  such that the convex combination  $\hat{o}_i = \hat{o}_i(\alpha_0^{(i)} \ldots \alpha_s^{(i)})$  is a perfect approximation of  $o_i$ , with probability  $k^{-O(\varepsilon^{-2})} \cdot 2^{-poly(\varepsilon^{-1})}$ . Wlog, we show this
for  $o_1$  only. Concretely, we want to show that, with probability  $k^{-O(\varepsilon^{-1})} \cdot 2^{-poly(\varepsilon^{-1})}$ , there exist coefficients  $\alpha_0 \ldots \alpha_s$  such that  $\hat{o}_1 = \hat{o}_1(\alpha_0 \ldots \alpha_s)$  satisfies  $\mathrm{cost}(O_1^*, (\mathcal{C} \cup \{\hat{o}_1\}) \setminus Out) \leq (1 + O(\varepsilon))\mathrm{OPT}_1 + O(\varepsilon)\mathrm{OPT}/k$ . Taking the joint probability of these events for each  $i = 1 \ldots s$  we obtain the success probability  $k^{-O(\varepsilon^{-2})} \cdot 2^{-poly(\varepsilon^{-1})}$ . Note that we are supposed to prove that  $\mathrm{cost}(O_1^*, (\mathcal{C} \cup \{\hat{o}_1\}) \setminus Out) \leq (1 + \varepsilon)\mathrm{OPT}_1 + \varepsilon\mathrm{OPT}/k$ , however we prove a weaker version where  $\varepsilon$  is replaced by  $O(\varepsilon)$ , which is in fact equivalent up to rescaling  $\varepsilon$ .
Similarly to  $\mathcal{C}[\cdot ]$  and  $\mathcal{O}^* [\cdot ]$  define  $\mathcal{T}[p]$  as the closest center to  $p$  in  $\mathcal{T}$ . Denote with  $C_1,F_1$  and  $N_{1}$  the intersections of  $O_1^*$  with  $C,F$  and  $N$  respectively. In what follows we define the values of  $\alpha_0\ldots \alpha_s$  that define  $\hat{o}_1 = \hat{o}_1(\alpha_0\ldots \alpha_s)$  and show an assignment of points in  $O_1^*$  to centers in  $(\mathcal{C}\cup \{\hat{o}_1\})\backslash Out$  with cost  $(1 + O(\varepsilon))\mathrm{OPT}_1 + O(\varepsilon)\mathrm{OPT} / k$ . Recall that we assume that  $q_{i}\in \operatorname {core}(o_{i})$  for each  $i = 1\dots s$ .
In what follows, we assign values to the coefficients  $(\alpha_{i})_{i}$ . It is understood that if the final value we choose for  $\alpha_{i}$  is  $v$  then we rather set  $\alpha_{i}$  to the smallest power of  $(1 - \varepsilon)$  which is larger than  $v$ , if  $v > \varepsilon^{7}$ . Else, set  $\alpha_{i}$  to 0. We will see in the end that this restrictions on the values of  $\alpha_{i}$  do not impact our approximation.
In what follows, we will assign the points in  $O_1^*$  to  $\mathcal{C} \setminus Out$ , if this can be done inexpensively. If it cannot, then we will assign points to  $\hat{o}_1$ . In order to compute a good value for  $\hat{o}_1$  we need an estimate of the average of points assigned to  $\hat{o}_1$ . For points in  $N_1$ , computing this average is doable (leveraging Lemma 13) while for points in  $O_1^* \setminus N_1$  we show that either their contribution is negligible or we can collapse them so as to coincide with some  $q_i \in \mathcal{Q}$  without affecting our approximation. The coefficients  $(\alpha_i)_{i \geq 1}$  represent the fraction of points in  $O_i^*$  which is collapsed to  $q_i$ .  $\alpha_0$  represents the fraction of points in  $O_i^*$  which average we estimate as  $\mu(S)$ . Thus, Equation (3) defines  $\hat{o}_i$  as the weighted average of points  $q_i$ , where the weights are the (approximate) fractions of points collapsed onto  $q_i$ , together with the average  $\mu(S)$  and its associated weight  $\alpha_0$ .
Points in  $C_1$ . All points  $p \in C_1$  such that  $\mathcal{T}[p] \notin \mathcal{Q}$  can be assigned to  $\mathcal{T}[p] \in \mathcal{C} \setminus Out$  incurring a total cost of at most  $\varepsilon^6 \mathrm{OPT}_1$ , by the definition of  $C_1$ . Given a point  $p \in C_1$  with  $\mathcal{T}[p] \in \mathcal{Q}$  we might have  $\mathcal{T}[p] \notin \mathcal{C} \setminus Out$  and thus we cannot assign  $p$  to  $\mathcal{T}[p]$ . Denote with  $W$  the set of points  $p$  with  $\mathcal{T}[p] \in \mathcal{Q}$ . Our goal is now to approximate  $\mu(W)$ . In order to do that, we will move each  $p \in W$  to coincide with  $q_i = \mathcal{T}[p]$ . We can partition  $W$  into  $W_1 \ldots W_s$  so that for each  $z \in W_i$ $\mathcal{T}[z] = q_i$ . If  $p \in Z_i$  then we have  $||p - q_i||^2 \leq \varepsilon^3\rho_1^2$ . Hence, thanks to Observation 22, we can consider points in  $W_i$  as if they were concentrated in  $q_i$  while losing at most an additive factor  $O(\varepsilon)\mathrm{OPT}_1$  and a multiplicative factor  $(1 + \varepsilon)$  on their cost. For  $i = 1\ldots s$ , set  $\alpha_i \gets |W_i| / |O_1^*|$ . In this way,  $\sum_{i=1}^{s} \alpha_i \cdot q_i / \sum_{i=1}^{s} \alpha_i$  is an approximated solution to 1-mean on  $W$  up to a multiplicative factor  $(1 + \varepsilon)$  and an additive factor  $O(\varepsilon)\mathrm{OPT}_1$ .
Points in  $N_{1}$ . Consider the two cases:  $(i)$ $\mathrm{cost}(N_1,\mathcal{T}) > \varepsilon^2\mathrm{OPT} / k$  .  $(ii)$ $\mathrm{cost}(N_1,\mathcal{T})\leq$ $\varepsilon^2\mathrm{OPT} / k$
Case (i). We show that in this case  $\mu(S)$  is a  $(1 + \varepsilon)$ -approximation for 1-mean on  $N_{1}$ , with probability  $k^{-O(\varepsilon^{-1})} \cdot 2^{-poly(\varepsilon^{-1})}$ . First, notice that if we condition on  $S \subseteq N_{1}$  then Lemma 13 gives that  $\mu(S)$  is a  $(1 + \varepsilon)$ -approximation for 1-mean on  $N_{1}$  with constant probability. Thus, we are left to prove that  $S \subseteq N_{1}$  with probability  $k^{-O(\varepsilon^{-1})} \cdot 2^{-poly(\varepsilon^{-1})}$ . We have that the  $P_{p \sim \mathrm{cost}(p, \mathcal{T})}[p \in N_{1} \mid p \in N] \geq \varepsilon^{2}/k$ , however the costs w.r.t.  $\mathcal{T}$  of points in  $N$  varies of at most a factor  $poly(\varepsilon^{-1})$ , thus  $P_{p \sim Unif}[p \in N_{1} \mid p \in N] \geq poly(\varepsilon)/k$ . The probability of  $S \subseteq N_{1}$  is thus  $(poly(\varepsilon)/k)^{|S|} = k^{-O(\varepsilon^{-1})} \cdot 2^{-poly(\varepsilon^{-1})}$ . In this case, we set  $\alpha_{0} \gets |N_{1}|/|O_{1}^{*}|$  because  $\mu(S)$  approximates the mean of the entire set  $N_{1}$ .