SlowGuess/NeurIPS_2023_OCR huggingface dataset:
(a)  $|\bar{p}^{(i)} - p^{(i)}| \leq \varepsilon$  for every  $i \in [N]$  with probability at least  $1 - \delta$ .
(b)  $\bar{p}^{(i)}\geq 0$  forall  $i\in [N]$
(c)  $\sum_{i}\bar{p}^{(i)} = 1.$
Moreover, the algorithm has sample complexity
$$
O \left(\frac {\ln 1 / \delta + N}{\varepsilon^ {2} (\rho - \delta) ^ {2}}\right) = \tilde {O} \left(\frac {N}{\varepsilon^ {2} \rho^ {2}} \log \frac {1}{\delta}\right).
$$
$$
\varepsilon^ {\prime} := \frac {\varepsilon (\rho - 2 \delta)}{\rho + 1 - 2 \delta}.
$$
By Proposition B.1, sampling
$$
\begin{array}{l} n = \frac {2 \ln^ {1 / \delta} + 2 N \ln 2}{\varepsilon^ {\prime 2}} \\ \leq \frac {8 \ln 1 / \delta + 8 N \ln 2}{\varepsilon^ {2} (\rho - 2 \delta) ^ {2}}. \\ \end{array}
$$
points implies that  $\sum_{i=1}^{N}|\widehat{p}^{(i)} - p^{(i)}| < \varepsilon'$  with probability at least  $1 - \delta$ .
Thus running Algorithm D.4 with functions
$$
g _ {j} \left(x _ {1}, \dots , x _ {N}\right) := \frac {1}{N} \sum_ {i = 1} ^ {N} \mathbb {1} \left\{x _ {i} = j \right\}
$$
yields  $\bar{p}^{(i)}$ 's such that  $|\bar{p}^{(i)} - p^{(i)}| \leq \varepsilon$  for each  $i \in [N]$ . If there are any negative  $\bar{p}^{(i)}$ 's, we can only improve the approximation by setting them to 0. If the sum of estimates is not equal to 1, we can normalize by taking
$$
\bar {p} ^ {(i)} \leftarrow \bar {p} ^ {(i)} - \frac {1}{N} \left[ \sum_ {i} \bar {p} ^ {(i)} - 1 \right].
$$
This introduces an additional error of  $\varepsilon / N$  for each  $\hat{p}^{(i)}$  and a maximum error of  $2\varepsilon$ . Choosing  $\varepsilon_1 := \varepsilon / 2$  concludes the proof.
D.5 Replicable OPT Estimation for  $(k,p)$ -Clustering
Our coreset algorithm assumes the knowledge of a constant ratio estimation of OPT. If this is not provided to us, we show in this section that it is possible to replicably compute such an estimate using a two-step approach. First, we are able to produce replicable estimates with additive error  $\varepsilon$  simply by approximately solving the sample  $(k,p)$ -clustering problem on a sufficiently large sample thanks to uniform convergence (cf. Theorem C.9). Then, we repeat this process with  $\varepsilon \gets \varepsilon /2$  until  $\varepsilon$  is but a small fraction of the outputted estimate.
Theorem D.22 (OPT Estimation with Additive Error). Let  $\beta \geq 1$  be an absolute constant and  $\varepsilon, \rho \in (0,1), \delta \in (0,\rho /3)$ . Suppose we are provided with an algorithm  $\mathcal{A}$  that, given an instance of sample  $(k,p)$ -clustering, outputs an estimate  $\Xi$  of the value  $\widehat{\mathrm{OPT}}$  such that
$$
\Xi \in \left[ \frac {1}{\beta} \widehat {\mathrm {O P T}}, \widehat {\mathrm {O P T}} \right].
$$
Then there is a  $\rho$ -replicable algorithm which produces an estimate  $\Lambda$  of OPT such that
$$
\Lambda \in \left[ \frac {\mathrm {O P T}}{\beta} - \varepsilon , \mathrm {O P T} + \varepsilon \right]
$$
with probability at least  $1 - \delta$ . Moreover, the algorithm has sample complexity
$$
\tilde {O} \left(\frac {k ^ {2} d ^ {2}}{\varepsilon^ {6} \rho^ {6}} \log \frac {p}{\delta}\right).
$$
We note that the algorithm  $\mathcal{A}$  can be taken to be any  $\beta$ -approximation algorithm with some postprocessing, where we divide the value of the cost by  $\beta$ . Alternatively, we can take  $\mathcal{A}$  to be some convex relaxation of our problem with constant integral gap.
Proof. Let  $X_{1},\ldots ,X_{N}\sim \mathbb{P}$  be i.i.d. random variables. The output  $\Xi = \mathcal{A}(X_1,\dots ,X_N)\in [0,1]$  is thus a bounded random variable. Suppose we repeat this experiment  $n$  times to produce estimates  $\Xi_1,\ldots ,\Xi_n$ . By an Hoeffding bound,
$$
\mathbb {P} \left\{\frac {1}{n} \sum_ {i = 1} ^ {n} \left(\Xi_ {i} - \mathbb {E} [ \Xi ]\right) > \varepsilon \right\} \leq 2 \exp \left(- 2 n \varepsilon^ {2}\right).
$$
$$
n \geq \frac {1}{2 \varepsilon^ {2}} \ln \frac {2}{\delta}
$$
trials, the average estimate  $\bar{\Xi} \coloneqq \frac{1}{n}\sum_{i=1}^{n}\Xi_{i}$  satisfies  $|\bar{\Xi} - \mathbb{E}[\Xi]| < \varepsilon$  with probability at least  $1 - \delta$ . Now, by Theorem C.9, choosing
$$
N = O \left(\frac {k ^ {2} d ^ {2}}{\varepsilon^ {4}} \log \frac {n p}{\delta}\right)
$$
i.i.d. samples from  $\mathbb{P}$  ensures that  $\left|\widehat{\mathrm{OPT}} -\mathrm{OPT}\right|\leq \varepsilon$  for all  $n$  trial with probability at least  $1 - \delta$ . Thus conditioning on success, we have
$$
\Xi_ {i} \in \left[ \frac {\mathrm {O P T}}{\beta} - \varepsilon , \mathrm {O P T} + \varepsilon \right]
$$
for every trial  $i \in [n]$ . But then the average  $\bar{\Xi}$  also falls into this interval as well.
We have shown that there is an algorithm that outputs an estimate
$$
\bar {\Xi} \in [ \mathbb {E} [ \Xi ] - \varepsilon , \mathbb {E} [ \Xi ] + \varepsilon ] \cap \left[ \frac {\mathrm {O P T}}{\beta} - \varepsilon , \mathrm {O P T} + \varepsilon \right]
$$
$$
\begin{array}{l} n N = O \left(\frac {1}{\varepsilon^ {2}} \log \frac {1}{\delta} \cdot \frac {k ^ {2} d ^ {2}}{\varepsilon^ {4}} \log \left(\frac {p}{\varepsilon^ {2} \delta} \log \frac {1}{\delta}\right)\right) \\ = O \left(\frac {k ^ {2} d ^ {2}}{\varepsilon^ {6}} \log^ {2} \frac {p}{\varepsilon \delta}\right) \\ \end{array}
$$
We can now apply the replicable rounding algorithm (cf. Algorithm D.4) to achieve the desired outcome. Indeed, by Theorem D.20, the output  $\Lambda$  after the rounding procedure is  $\rho$ -reproducible and offsets the average  $\Xi$  by at most  $\varepsilon$ . Hence we have
$$
\Lambda \in \left[ \frac {\mathrm {O P T}}{\beta} - 2 \varepsilon , \mathrm {O P T} + 2 \varepsilon . \right]
$$
with probability at least  $1 - \delta$ . Finally, the algorithm has sample complexity
$$
O \left(\frac {k ^ {2} d ^ {2}}{\varepsilon^ {6} \rho^ {6}} \log^ {2} \frac {p}{\varepsilon \rho \delta}\right)
$$
Choosing  $\varepsilon' = \varepsilon / 2$  completes the proof.
Theorem D.23 (OPT Estimation with Relative Error). Fix  $\varepsilon, \rho \in (0,1)$  and  $\delta \in (0,\rho /3)$ . There is a  $\rho$ -replicable algorithm such that with probability at least  $1 - \delta$ , it outputs an estimate  $\Lambda$  of OPT where
$$
\Lambda \in \left[ \frac {1}{\beta (1 + \varepsilon)} \mathrm {O P T}, (1 + \varepsilon) \mathrm {O P T} \right].
$$
$$
\tilde {O} \left(\frac {k ^ {2} d ^ {2} \beta^ {1 2}}{\varepsilon^ {1 2} \rho^ {6} \cdot \mathrm {O P T} ^ {1 2}} \log \frac {p}{\delta}\right).
$$
Proof. We run the estimation algorithm with additive error with
$$
\varepsilon_ {i} := 2 ^ {- i}
$$
$$
\rho_ {i} := 2 ^ {- i} \rho
$$
$$
\delta_ {i} := 2 ^ {- i} \delta
$$
for  $i = 1,2,3,\ldots$  until we obtain an estimate  $\Lambda_{i}$  such that  $\varepsilon_{i}\leq \varepsilon \Lambda_{i} / 2$
Remark that
$$
\begin{array}{l} 2 ^ {- i} \leq \frac {1}{2} \varepsilon \Lambda_ {i} \\ \Longleftarrow 2 ^ {- i} \leq \frac {1}{2} \varepsilon \left(\frac {\mathrm {O P T}}{\beta} - 2 ^ {- i}\right) \\ \Longleftrightarrow 2 ^ {- i} \left(1 + \frac {1}{2} \varepsilon\right) \leq \frac {\varepsilon \mathrm {O P T}}{2 \beta} \\ \Longleftarrow - i \leq \log \frac {\varepsilon \mathrm {O P T}}{4 \beta} \\ \Longleftrightarrow i = \log \frac {\beta}{\varepsilon \mathrm {O P T}} + 2. \\ \end{array}
$$
Thus the algorithm certainly terminates.
Upon termination, we output some  $\Lambda$  such that  $\Lambda \in [\mathrm{OPT} / \beta -\varepsilon \Lambda /2,\mathrm{OPT} + \varepsilon \Lambda /2]$ . It follows that
$$
\Lambda \leq \mathrm {O P T} + \frac {1}{2} \varepsilon \Lambda
$$
$$
\left(1 - \frac {1}{2} \varepsilon\right) \Lambda \leq \text {O P T}
$$
$$
\begin{array}{l} \Lambda \leq \frac {1}{1 - \frac {\varepsilon}{2}} \mathrm {O P T} \\ \leq (1 + \varepsilon) \mathrm {O P T} \\ \end{array}
$$
$$
\begin{array}{l} \Lambda \geq \frac {\mathrm {O P T}}{\beta} - \frac {1}{2} \varepsilon \Lambda \\ \beta \left(1 + \frac {1}{2} \varepsilon\right) \Lambda \geq \mathrm {O P T} \\ \Lambda \geq \frac {1}{\beta (1 + \varepsilon)} \mathrm {O P T}. \\ \end{array}
$$
The probability of not being replicable in each iteration is  $2^{-i}\rho$ . Hence the total probability is at most
$$
\sum_ {i = 1} ^ {\infty} 2 ^ {- i} \rho = \rho
$$
and similarly for  $\delta$
Finally, there are  $O\left(\log \frac{\beta}{\varepsilon\mathrm{OPT}}\right)$  iterations and the sample complexity of each iteration is bounded above by the sample complexity of the final iteration where
$$
2 ^ {- i} = \Omega \left(\frac {\varepsilon \mathrm {O P T}}{\beta}\right).
$$
Hence the total sample complexity is
$$
\tilde {O} \left(\log \frac {\beta}{\varepsilon \mathrm {O P T}} \cdot \frac {k ^ {2} d ^ {2}}{\left(\frac {\varepsilon \mathrm {O P T}}{\beta}\right) ^ {6} \left(\frac {\varepsilon \mathrm {O P T}}{\beta} \cdot \rho\right) ^ {6}} \log \frac {p}{\delta}\right) = \tilde {O} \left(\frac {k ^ {2} d ^ {2} \beta^ {1 2}}{\varepsilon^ {1 2} \rho^ {6} \cdot \mathrm {O P T} ^ {1 2}} \log \frac {p}{\delta}\right).
$$
D.6 Putting it Together
We are now ready to prove the results on statistical  $k$ -medians and statistical  $k$ -means, which we restate below for convenience. Recall that  $\beta$  is an absolute constant and hence disappears under the big-O notation.
Proof (Theorem 4.2). First, we compute  $\Lambda$ , an estimate of OPT with relative error  $\varepsilon$ , confidence  $\delta/3$ , and replicability parameter  $\rho/3$ . Then, we produce an  $\varepsilon/2$ -coreset for  $k$ -medians of cardinality  $N$  with confidence and replicability parameters  $\delta/3, \rho/3$ . Finally, we estimate the mass at each point of the coreset with confidence and replicability parameters  $\delta/3, \rho/3$  to an accuracy of
$$
\frac {\varepsilon \Lambda}{4 N} \leq \frac {\varepsilon \mathrm {O P T}}{2 N}.
$$
By Proposition D.19, running the approximation oracle on the coreset with the estimated weights yields a  $\beta (1 + \varepsilon)$ -approximation.
By Theorem D.23, computing  $\Lambda$  requires
$$
\tilde {O} \left(\frac {k ^ {2} d ^ {2}}{\varepsilon^ {1 2} \rho^ {6} \cdot \mathrm {O P T} ^ {1 2}} \log \frac {1}{\delta}\right)
$$
By Theorem D.16, the coreset construction yields a coreset of cardinality
$$
N = O \left(\frac {k 2 ^ {5 d} \Delta^ {d + 1}}{\varepsilon^ {d + 1}} \log \frac {\Delta}{\varepsilon \cdot \mathrm {O P T}} \cdot 2 ^ {d}\right) = O \left(\frac {k 2 ^ {6 d} \Delta^ {d + 1}}{\varepsilon^ {d + 1}} \log \frac {\Delta}{\varepsilon \cdot \mathrm {O P T}}\right)
$$
and incurs a sample cost of
$$
\tilde {O} \left(\frac {k ^ {3} 2 ^ {1 5 d} \Delta^ {3 d + 3}}{\rho^ {2} \varepsilon^ {3 d + 3} \cdot \mathrm {O P T} ^ {3}} \cdot 2 ^ {3 d} \frac {1}{\delta}\right) = \tilde {O} \left(\frac {k ^ {3} 2 ^ {1 8 d} \Delta^ {3 d + 3}}{\rho^ {2} \varepsilon^ {3 d + 3} \cdot \mathrm {O P T} ^ {3}} \frac {1}{\delta}\right).
$$
Finally, Corollary D.21 states that the probability mass estimation incurs a sample cost of
$$
\begin{array}{l} \tilde {O} \left(\frac {N ^ {3}}{\varepsilon^ {2} \rho^ {2} \cdot \Lambda^ {2}} \log \frac {1}{\delta}\right) = \tilde {O} \left(\frac {N ^ {3}}{\varepsilon^ {2} \rho^ {2} \cdot \mathrm {O P T} ^ {2}} \log \frac {1}{\delta}\right) \\ = \tilde {O} \left(\frac {k ^ {3} 2 ^ {1 8 d} \Delta^ {3 d + 3}}{\varepsilon^ {3 d + 3}} \cdot \frac {1}{\varepsilon^ {2} \rho^ {2} \cdot \mathrm {O P T} ^ {2}} \log \frac {1}{\delta}\right) \\ = \tilde {O} \left(\frac {k ^ {3} 2 ^ {1 8 d} \Delta^ {3 d + 3}}{\rho^ {2} \varepsilon^ {3 d + 5} \cdot \mathrm {O P T} ^ {2}} \log \frac {1}{\delta}\right). \\ \end{array}
$$
Proof (Theorem 4.3). Similar to  $k$ -median, we first compute  $\Lambda$ , an estimate of OPT with relative error  $\varepsilon$ , confidence  $\delta / 3$ , and replicability parameter  $\rho / 3$ . Then, we produce an  $\varepsilon / 2$ -coreset for  $k$ -medians of cardinality  $N$  with confidence and replicability parameters  $\delta / 3, \rho / 3$ . Finally, we estimate the mass at each point of the coreset with confidence and replicability parameters  $\delta / 3, \rho / 3$  to an accuracy of
By Theorem D.18, the coreset construction yields a coreset of cardinality
$$
N = O \left(\frac {k 2 ^ {1 1 d} \Delta^ {d + 2}}{\varepsilon^ {2 d + 2}} \log \frac {\Delta}{\varepsilon \mathrm {O P T}} \cdot 2 ^ {2 d}\right) = O \left(\frac {k 2 ^ {1 3 d} \Delta^ {d + 2}}{\varepsilon^ {2 d + 2}} \log \frac {\Delta}{\varepsilon \mathrm {O P T}}\right).
$$
$$
\tilde {O} \left(\frac {k ^ {3} 2 ^ {3 3 d} \Delta^ {3 d + 6}}{\rho^ {2} \varepsilon^ {6 d + 6} \cdot \mathrm {O P T} ^ {3}} \cdot 2 ^ {6 d}\right) = \tilde {O} \left(\frac {k ^ {3} 2 ^ {3 9 d} \Delta^ {3 d + 6}}{\rho^ {2} \varepsilon^ {6 d + 6} \cdot \mathrm {O P T} ^ {3}} \frac {1}{\delta}\right).
$$
$$
\begin{array}{l} \tilde {O} \left(\frac {N ^ {3}}{\varepsilon^ {2} \rho^ {2} \cdot \Lambda^ {2}} \frac {1}{\delta}\right) = \tilde {O} \left(\frac {N ^ {3}}{\varepsilon^ {2} \rho^ {2} \cdot \mathrm {O P T} ^ {2}} \frac {1}{\delta}\right) \\ = \tilde {O} \left(\frac {k ^ {3} 2 ^ {3 9 d} \Delta^ {3 d + 6}}{\varepsilon^ {6 d + 6}} \cdot \frac {1}{\varepsilon^ {2} \rho^ {2} \cdot \mathrm {O P T} ^ {2}} \frac {1}{\delta}\right) \\ = \tilde {O} \left(\frac {k ^ {3} 2 ^ {3 9 d} \Delta^ {3 d + 6}}{\rho^ {2} \varepsilon^ {6 d + 8} \cdot \mathrm {O P T} ^ {2}} \frac {1}{\delta}\right). \\ \end{array}
$$
E The Euclidean Metric, Dimensionality Reduction, and  $(k,p)$ -Clustering
We now build towards a proof for Theorem 5.1, which states the formal guarantees of the replicable  $k$ -medians and  $k$ -means algorithms under the Euclidean distance. Let us begin by recalling the Johnson-Lindenstrauss lemma.
Theorem E.1 ([Johnson, 1984]). There exists a family of random linear maps  $\pi_{d,m}$  from  $\mathbb{R}^d\to \mathbb{R}^m$  such that the following hold.
(i) For every  $d \geq 1, \varepsilon, \delta \in (0, 1/2), x \in \mathbb{R}^d$ , and  $m = O(1/\varepsilon^2 \log 1/\delta)$ ,
$$
\frac {1}{1 + \varepsilon} \| \pi x \| _ {2} \leq \| x \| _ {2} \leq (1 + \varepsilon) \| \pi x \| _ {2}
$$
(ii)  $\pi_{d,m}$  is sub-Gaussian-tailed, thus for every unit vector  $x\in \mathbb{R}^d$  and  $\varepsilon >0$
$$
\left\| \pi x \right\| _ {2} \geq 1 + \varepsilon
$$
with probability at most  $\exp \bigl (-\Omega (\varepsilon^2 m)\bigr)$
Furthermore, we can take  $\pi_{d,m}$  to be the set of random orthogonal projections  $\mathbb{R}^d\to \mathbb{R}^m$  scaled by a factor of  $\sqrt{\frac{d}{m}}$ .
We say that  $\pi \in \pi_{d,m}$  is a standard random dimension-reduction map and write  $\mathbb{P}_{\pi}$  to denote the projected distribution on  $\mathbb{R}^m$ , i.e.,  $\mathbb{P}_{\pi}(\cdot) = \mathbb{P}(\pi^{-1}(\cdot))$ .
As mentioned in Section 5, it is not entirely clear how to translate between sets of centers for high-dimensional data and solutions sets for the compressed data. For this reason, our goal is to produce a clustering function  $f: \mathcal{X} \to [k]$  which computes the label for any given point in polynomial time. This also requires us to consider another notion of cost which is translated more easily.
Definition E.2 (Partition Cost). Define the cost of a  $k$ -partition  $\mathcal{C} = (C^{(1)},\ldots ,C^{(k)})$  of  $\mathcal{X}$  as
$$
\operatorname {c o s t} (\mathcal {C}) := \min  _ {u ^ {(j)} \in \mathbb {R} ^ {d}: j \in [ k ]} \mathbb {E} _ {x} \left[ \sum_ {j = 1} ^ {k} \mathbb {1} \{x \in C ^ {(j)} \} \cdot \kappa (x, u ^ {(j)}) ^ {p} \right].
$$
i.e., we consider the expected cost of picking the optimal centers w.r.t. the underlying data-generating distribution. Similarly, we define the following sample partition cost.
Definition E.3 (Sample Partition Cost). We define the sample cost of a  $k$ -partition  $\mathcal{C}$  of  $x_{1},\ldots ,x_{n}$  as
$$
\widehat {\operatorname {c o s t}} (\mathcal {C}, w) = \min _ {u ^ {(j)} \in \mathbb {R} ^ {d}: j \in [ k ]} \sum_ {i = 1} ^ {n} w _ {i} \sum_ {j = 1} ^ {k} \mathbb {1} \{x _ {i} \in C ^ {(j)} \} \kappa (x _ {i}, u ^ {(j)}) ^ {p}
$$
where  $w \geq 0, \sum_{i} w_{i} = 1$ . i.e., we consider the cost that is induced by the distribution specified by  $w$  on the samples. We write  $\widehat{\mathrm{cost}}(\mathcal{C})$  to denote the cost with the uniform distribution on the samples.
Remark that if  $\mathcal{C}$  is induced by  $F$ , then  $\mathrm{OPT} \leq \mathrm{cost}(\mathcal{C}) \leq \mathrm{cost}(F)$  and similarly for the sample partition cost as well.
Theorem E.4 ([Makarychev et al., 2019]). Let  $x_{1},\ldots ,x_{n}\in \mathbb{R}^{d}$  be an instance of the Euclidean  $(k,p)$ -clustering problem. Fix  $\varepsilon \in (0,1 / 4)$ ,  $\delta \in (0,1)$  and suppose  $\pi :\mathbb{R}^d\to \mathbb{R}^m$  is a standard random dimension-reduction map with
$$
m = O \left(\frac {p ^ {4}}{\varepsilon^ {2}} \log \frac {k}{\varepsilon \delta}\right).
$$
$$
\frac {1}{1 + \varepsilon} \widehat {\mathrm {c o s t}} (\mathcal {C}) \leq \widehat {\mathrm {c o s t}} (\pi (\mathcal {C})) \leq (1 + \varepsilon) \widehat {\mathrm {c o s t}} (\mathcal {C})
$$
for every  $k$ -partition  $\mathcal{C}$  of  $x_{1},\ldots ,x_{n}$ .
In essence, this theorem tells us that if we let the centers of the clusters be the centers of the partition, then the (sample) cost is preserved in the lower dimensional space. To the best of our knowledge, this is the strongest result for dimensionality reduction in (sample)  $(k,p)$ -clustering which preserves more than just the costs of optimal centers.
The rest of Appendix E serves to generalize Theorem E.4 for preserving partition costs in the distributional setting. First, Appendix E.1 addresses the issue that a random orthogonal projection can increase the diameter of our data in the worst case by scaling the original data by an appropriate factor. Next, Appendix E.2 slightly generalizes Theorem E.4 to the weighted sample clustering setting. Finally, Appendix E.3 extends Theorem E.4 to the distributional setting, culminating with Theorem E.10, which may be of independent interest beyond replicability.
Recall that  $\mathbb{P}_{\pi}$  is the push-forward measure on  $\pi (\mathcal{X})$  induced by  $\pi$ . We write  $\mathrm{OPT}_{\pi}$  to denote the cost of an optimal solution to the statistical  $(k,p)$ -clustering problem on  $(\pi (\mathcal{X}),\mathbb{P}_{\pi})$  and  $\widehat{\mathrm{OPT}}_{\pi}$  for the  $(k,p)$ -clustering problem on  $\pi (x_1),\ldots ,\pi (x_n)$ .
E.1 Scaling
We may assume that a standard dimension-reduction map  $\pi$  satisfies  $\pi = \sqrt{\frac{d}{m}} P$  for some orthogonal projection  $P$ . Hence  $\pi$  has operator norm at most  $\sqrt{d}$  and
$$
\pi (\mathcal {X}) \subseteq \sqrt {d} \mathcal {B} _ {m}.
$$
In order to apply our existing analysis, we first scale down the samples in the input space by a factor of  $\sqrt{d}$  so that the projected space still lives in a  $\kappa$ -ball of diameter 1. This does not affect our approximation guarantees as they are all multiplicative and hence scale-invariant. However, the analysis we perform is on the scaled distribution with optimal cost  $\mathrm{OPT}' = d^{-p/2} \mathrm{OPT}$ . This extra term must be accounted for.
We proceed assuming now that  $\mathcal{X} \subseteq \frac{1}{\sqrt{d}}\mathcal{B}_d$  and  $\pi(\mathcal{X}) \subseteq \mathcal{B}_m$ .
E.2 Preserving Partition Costs
Let  $\widehat{\mathrm{cost}}(\mathcal{C}, w), \widehat{\mathrm{cost}}(\pi(\mathcal{C}), w)$  be the weighted cost of the partition and projected partition, respectively. Recall this means that the points participate with weights  $w$  in the objective. Essentially, the next result shows that since the projection guarantees do not depend on the number of points we are projecting, we can simulate the weights by considering multiple copies of the points.
Proposition E.5. Let  $x_{1}, \ldots, x_{n} \in \mathbb{R}^{d}$  be an instance of the Euclidean  $(k,p)$ -clustering problem and  $w_{1}, \ldots, w_{n} \in \mathbb{R}_{+}$  be weights which sum to 1. Fix  $\varepsilon \in (0,1/4), \delta \in (0,1)$ , and suppose  $\pi: \mathbb{R}^d \to \mathbb{R}^m$  is a standard random dimension-reduction map with
$$
\frac {1}{1 + \varepsilon} \widehat {\operatorname {c o s t}} (\mathcal {C}, w) \leq \widehat {\operatorname {c o s t}} (\pi (\mathcal {C}), w) \leq (1 + \varepsilon) \widehat {\operatorname {c o s t}} (\mathcal {C}, w),
$$
Proof (Proposition E.5). First suppose that  $w_{i} = \frac{a_{i}}{b_{i}}$  for  $a_{i}, b_{i} \in \mathbb{Z}_{+}$  and consider
$$
w _ {i} ^ {\prime} := \operatorname {l c m} \left(b _ {1}, \dots , b _ {n}\right) w _ {i} \in \mathbb {Z} _ {+}
$$
obtained from  $w_{i}$  by multiplying by the least common multiple of the denominators.
Let  $y_{1}, \ldots, y_{n'}$  be the multiset obtained from  $x_{1}, \ldots, x_{n}$  by taking  $w_{i}'$  multiples of  $x_{i}$ . The cost of any partition of  $x_{1}, \ldots, x_{n}$  with weights  $q_{1}, \ldots, q_{n}$  is equal to the cost of the induced partition of  $y_{1}, \ldots, y_{n'}$  with uniform weights. Thus we can apply Theorem E.4 on  $y_{1}, \ldots, y_{n'}$  to conclude the proof.
Now, for general  $w_{i}\in \mathbb{R}_{+}$ , we remark by the density of the rationals in  $\mathbb{R}$  that there are some  $q_{1},\ldots ,q_{n}\in \mathbb{Q}_{+}$  which sum to 1 and satisfy
$$
\sum_ {i = 1} ^ {n} | q _ {i} - w _ {i} | <   \frac {\varepsilon \min (\widehat {\mathrm {O P T}} , \widehat {\mathrm {O P T}} _ {\pi})}{2}.
$$
Then for any  $k$ -partition  $\mathcal{C}$  and  $u^{(1)},\ldots ,u^{(k)}\in \mathcal{B}_d$
$$
\begin{array}{l} \left| \sum_ {i = 1} ^ {n} q _ {i} \sum_ {j = 1} ^ {k} \mathbb {1} \{x _ {i} \in C ^ {(j)} \} \kappa (x _ {i}, u ^ {(j)}) ^ {p} - \sum_ {i = 1} ^ {n} w _ {i} \sum_ {j = 1} ^ {k} \mathbb {1} \{x _ {i} \in C ^ {(j)} \} \kappa (x _ {i}, u ^ {(j)}) ^ {p} \right| \\ \leq \sum_ {i = 1} ^ {n} \left| q _ {i} - w _ {i} \right| \sum_ {j = 1} ^ {k} \mathbb {1} \left\{x _ {i} \in C ^ {(j)} \right\} \kappa \left(x _ {i}, u ^ {(j)}\right) ^ {p} \\ \leq \sum_ {i = 1} ^ {n} \left| q _ {i} - w _ {i} \right| \\ \leq \frac {\varepsilon}{2} \widehat {\mathrm {O P T}}. \\ \end{array}
$$
$$
\frac {1}{1 + \varepsilon} \operatorname {c o s t} (\mathcal {C}, w) \leq \operatorname {c o s t} (\mathcal {C}, q) \leq (1 + \varepsilon) \operatorname {c o s t} (\mathcal {C}, w).
$$
Similarly, for any  $v^{(1)},\ldots ,v^{(k)}\in \mathcal{B}_m$
$$
\begin{array}{l} \left| \sum_ {i = 1} ^ {n} q _ {i} \sum_ {j = 1} ^ {k} \mathbb {1} \{x _ {i} \in C ^ {(j)} \} \kappa (\pi (x _ {i}), v ^ {(j)}) ^ {p} - \sum_ {i = 1} ^ {n} w _ {i} \sum_ {j = 1} ^ {k} \mathbb {1} \{x _ {i} \in C ^ {(j)} \} \kappa (\pi (x _ {i}), v ^ {(j)}) ^ {p} \right| \\ \leq \frac {\varepsilon}{2} \widehat {\mathrm {O P T}} _ {\pi}, \\ \end{array}
$$
$$
\frac {1}{1 + \varepsilon} \operatorname {c o s t} (\pi (\mathcal {C}), w) \leq \operatorname {c o s t} (\pi (\mathcal {C}), q) \leq (1 + \varepsilon) \operatorname {c o s t} (\pi (\mathcal {C}), w).
$$
Finally, we conclude that
$$
\begin{array}{l} \operatorname {c o s t} (\mathcal {C}, w) \leq (1 + \varepsilon) \operatorname {c o s t} (\mathcal {C}, q) \\ \leq (1 + \varepsilon) ^ {2} \operatorname {c o s t} (\pi (\mathcal {C}), q) \\ \leq (1 + \varepsilon) ^ {3} \operatorname {c o s t} (\pi (\mathcal {C}), w) \\ \operatorname {c o s t} (\pi (\mathcal {C}), w) \leq (1 + \varepsilon) ^ {3} \operatorname {c o s t} (\mathcal {C}, w). \\ \end{array}
$$
Choosing  $\varepsilon^{\prime}$  to be a constant fraction of  $\varepsilon$  concludes the proof.
Corollary E.6. Let  $x_{1},\ldots ,x_{n}\in \mathbb{R}^{d}$  be an instance of the weighted Euclidean  $(k,p)$ -clustering problem with non-negative weights  $w_{1},\dots ,w_{n}\in \mathbb{R}_{+}$  which sum to 1. Fix  $\varepsilon \in (0,1 / 4),\delta \in (0,1)$  and suppose  $\pi :\mathbb{R}^d\to \mathbb{R}^m$  is a standard random dimension-reduction map with
$$
\frac {1}{1 + \varepsilon} \widehat {\mathrm {O P T}} \leq \widehat {\mathrm {O P T}} _ {\pi} \leq (1 + \varepsilon) \widehat {\mathrm {O P T}}.
$$
Proof (Corollary E.6). The optimal clustering cost coincides with the cost of the partition induced by the optimal centers.  $\square$
E.3 Dimensionality Reduction