SlowGuess/NeurIPS_2023_OCR huggingface dataset:
We now upper bound  $\mathrm{cost}_z(Y_1, \ldots, Y_k)$  in terms of  $\mathrm{cost}_z(X_1^*, \ldots, X_k^*)$ . We do this by going through the centers chosen according to Claim B.6. This will allow us to upper bound the cost of clustering with  $(Y_1, \ldots, Y_k)$  in terms of the  $\mathrm{cost}_z(X_1^*, \ldots, X_k^*)$  as well as clustering cost involving only pairwise distances from  $\{c_1^*, \ldots, c_k^*\}$ . Then, we relate to distances after applying the map II. Specifically, first notice that if we consider the set of centers  $c_1', \ldots, c_k'$  chosen from Claim B.6
$$
\begin{array}{l} \operatorname {c o s t} _ {z} \left(Y _ {1}, \dots , Y _ {n}\right) \leq \sum_ {i = 1} ^ {k} \sum_ {x \in Y _ {i}} \| x - c _ {i} ^ {\prime} \| _ {2} ^ {z} \\ \leq \sum_ {i = 1} ^ {k} \sum_ {j = 1} ^ {k} \sum_ {x \in Y _ {i} \cap X _ {j} ^ {*}} \left(\| x - c _ {j} ^ {*} \| _ {2} + \| c _ {j} ^ {*} - c _ {i} ^ {\prime} \| _ {2}\right) ^ {z} \\ \leq 2 ^ {z - 1} \cdot \operatorname {c o s t} _ {z} \left(X _ {1} ^ {*}, \dots , X _ {k} ^ {*}\right) + 2 ^ {z - 1} \sum_ {i = 1} ^ {k} \sum_ {j = 1} ^ {k} \left| Y _ {i} \cap X _ {j} ^ {*} \right| \cdot \| c _ {j} ^ {*} - c _ {i} ^ {\prime} \| _ {2} ^ {z}, \tag {4} \\ \end{array}
$$
where the third inequality uses Lemma A.3 once more. Note that the right-most summation of (4) involves distances which are only among  $c_1^*, \ldots, c_k^*$ , so by the first assumption of the map  $\Pi$  and Claim B.6, we may upper bound
$$
\begin{array}{l} \sum_ {i = 1} ^ {k} \sum_ {j = 1} ^ {k} | Y _ {i} \cap X _ {j} ^ {*} | \cdot \| c _ {j} ^ {*} - c _ {i} ^ {\prime} \| _ {2} ^ {z} \leq \mathrm {D} _ {1} ^ {z} \sum_ {i = 1} ^ {k} \sum_ {j = 1} ^ {k} | Y _ {i} \cap X _ {j} ^ {*} | \cdot \| \Pi (c _ {j} ^ {*}) - \Pi (c _ {i} ^ {\prime}) \| _ {2} ^ {z} \\ \leq \mathrm {D} _ {1} ^ {z} \cdot 2 ^ {z} \cdot \operatorname {v a l} \left(\Pi , c ^ {*}, Y _ {1}, \dots , Y _ {k}\right). \tag {5} \\ \end{array}
$$
Combining (4) and (5), we may upper bound
$$
\begin{array}{l} \operatorname {c o s t} _ {z} \left(Y _ {1}, \dots , Y _ {n}\right) \leq 2 ^ {z - 1} \cdot \operatorname {c o s t} _ {z} \left(X _ {1} ^ {*}, \dots , X _ {k} ^ {*}\right) + \mathrm {D} _ {1} ^ {z} \cdot 2 ^ {2 z - 1} \cdot \operatorname {v a l} \left(\Pi , c ^ {*}, Y _ {1}, \dots , Y _ {k}\right) \\ = 2 ^ {z - 1} \cdot \operatorname {c o s t} _ {z} \left(X _ {1} ^ {*}, \dots , X _ {k} ^ {*}\right) + \mathrm {D} _ {1} ^ {z} \cdot 2 ^ {2 z - 1} \sum_ {i = 1} ^ {k} \sum_ {j = 1} ^ {k} \left| Y _ {i} \cap X _ {j} ^ {*} \right| \cdot \| \Pi \left(c _ {j} ^ {*}\right) - \hat {c} _ {i} \| _ {2} ^ {z}. \tag {6} \\ \end{array}
$$
We continue upper bounding the right-most expression in (6) by applying the triangle inequality:
$$
\sum_ {i = 1} ^ {k} \sum_ {j = 1} ^ {k} | Y _ {i} \cap X _ {j} ^ {*} | \cdot \| \Pi (c _ {j} ^ {*}) - \hat {c} _ {i} \| _ {2} ^ {z}
$$
$$
\begin{array}{l} \leq 2 ^ {z - 1} \sum_ {i = 1} ^ {k} \sum_ {j = 1} ^ {k} \sum_ {x \in Y _ {i} \cap X _ {j} ^ {*}} \| \Pi (x) - \Pi \left(c _ {j} ^ {*}\right) \| _ {2} ^ {z} + 2 ^ {z - 1} \sum_ {i = 1} ^ {k} \sum_ {j = 1} ^ {k} \sum_ {x \in Y _ {i} \cap X _ {j} ^ {*}} \| \Pi (x) - \hat {c} _ {i} \| _ {2} ^ {z} \\ \leq 2 ^ {z - 1} \mathrm {D} _ {2} \cdot \operatorname {c o s t} _ {z} \left(X _ {1} ^ {*}, \dots , X _ {k} ^ {*}\right) + 2 ^ {z - 1} \cdot \operatorname {c o s t} _ {z} \left(\Pi \left(Y _ {1}\right), \dots , \Pi \left(Y _ {k}\right)\right). \tag {7} \\ \end{array}
$$
By the third assumption of the lemma, we note that
$$
\begin{array}{l} \operatorname {c o s t} _ {z} \left(\Pi \left(Y _ {1}\right), \dots , \Pi \left(Y _ {k}\right)\right) \leq \mathrm {D} _ {3} \cdot \min  _ {c _ {1}, \dots , c _ {k} \in \mathbb {R} ^ {t}} \sum_ {x \in X} \min  _ {j \in [ k ]} \| \Pi (x) - c _ {j} \| _ {2} ^ {z} \\ \leq \mathrm {D} _ {3} \cdot \sum_ {j = 1} ^ {k} \sum_ {x \in X _ {j}} \| \Pi (x) - \Pi \left(c _ {j} ^ {*}\right) \| _ {2} ^ {z} \leq \mathrm {D} _ {3} \mathrm {D} _ {2} \cdot \operatorname {c o s t} _ {z} \left(X _ {1} ^ {*}, \dots , X _ {k} ^ {*}\right). \tag {8} \\ \end{array}
$$
Summarizing by plugging (7) and (8) into (6), can upper bound
$$
\operatorname {c o s t} _ {z} \left(Y _ {1}, \dots , Y _ {n}\right) \leq \left(2 ^ {z - 1} + 2 ^ {3 z - 2} \cdot \mathrm {D} _ {1} ^ {z} \mathrm {D} _ {2} (1 + \mathrm {D} _ {3})\right) \cdot \operatorname {c o s t} _ {z} \left(X _ {1} ^ {*}, \dots , X _ {k} ^ {*}\right).
$$
C Efficient Seeding in One Dimension
In this section, we prove Theorem 2.1, which shows an upper bound for the running time of our algorithm PRONE. As in Theorem B.2, we consider a generalized version of PRONE where we run  $k$ -means++ seeding for general  $z \geq 1$  (Definition A.2) in Step 2. We prove the following generalized version of Theorem 2.1:
Theorem C.1 (Theorem 2.1 for general  $z \geq 1$ ). Let  $X = \{x_{1}, \ldots, x_{n}\} \subset \mathbb{R}^{d}$  be a dataset consisting of  $n$  points in  $d$  dimensions. Assume that  $d \leq \mathfrak{n} \mathfrak{nz}(X)$ , which can be ensured after removing redundant dimensions  $j \in [d]$  where the  $j$ -th coordinate of every  $x_{i}$  is zero. For any  $z \geq 1$ , the algorithm PRONE (for general  $z$  as in Theorem B.2) has expected running time  $O(\mathfrak{n} \mathfrak{nz}(X) + 2^{z/2} n \log n)$  on  $X$ . For any  $\delta \in (0, 1/2)$ , with probability at least  $1 - \delta$ , the algorithm runs in time  $O(\mathfrak{n} \mathfrak{nz}(X) + 2^{z/2} n \log (n / \delta))$ . Moreover, the algorithm always runs in time  $O(\mathfrak{n} \mathfrak{nz}(X) + n \log n + nk)$ .
To prove Theorem 2.1, we show an efficient implementation (Algorithm 1) of the  $k$ -means++ seeding procedure that runs in expected time  $O(2^{z/2}n\log n)$  for one-dimensional points (Lemma C.3). A naive implementation of the seeding procedure would take  $\Theta(nk)$  time in one dimension because we need  $\Theta(n)$  time to update  $p_i$  and sample from the  $D^2$  distribution to add each of the  $k$  centers. To obtain an improved and provable running time, we use a basic binary tree data structure to sample from the  $D^2$  distribution more efficiently, and we use a potential argument to bound the number of updates to  $p_i$ .
The data structure  $S$  we use in Algorithm 1 can be implemented as a basic binary tree, as described in more detail in Appendix D. The data structure  $S$  keeps track of  $n$  nonnegative numbers  $s_1, \ldots, s_n$  corresponding to  $p_1^z, \ldots, p_n^z$  and it supports the following operations:
1. Initialize(a). Given an array  $a = (a_{1},\dots ,a_{n})\in \mathbb{R}_{\geq 0}^{n}$ , the operation Initialize(a) creates a data structure  $S$  that keeps track of the numbers  $s_1,\ldots ,s_n$  initialized so that  $(s_1,\ldots ,s_n) = (a_1,\ldots ,a_n)$ . This operation runs in  $O(n)$  time.
2.  $\operatorname{Sum}(S)$ . The operation  $\operatorname{Sum}(S)$  returns the sum  $s_1 + \dots + s_n$ . This operation runs in  $O(1)$  time, as the value will be maintained as the data structure is updated.
3. Find  $(S,r)$ . Given a number  $r\in [0,\sum_{i = 1}^{n}s_i)$ , the operation  $\operatorname{Find}(S,r)$  returns the unique index  $\ell \in \{1,\ldots ,n\}$  such that
$$
\sum_ {i = 1} ^ {\ell - 1} s _ {i} \leq r <   \sum_ {i = 1} ^ {\ell} s _ {i}.
$$
This operation runs in  $O(\log n)$  time.
4. Update  $(S, a, i_1, i_2)$ . Given an array  $a = (a_1, \ldots, a_n) \in \mathbb{R}_{\geq 0}^n$  and indices  $i_1, i_2$  satisfying  $1 \leq i_1 \leq i_2 \leq n$ , the operation  $\text{Update}(S, a, i_1, i_2)$  performs the updates  $s_i \gets a_i$  for every  $i = i_1, i_1 + 1, \ldots, i_2$ . This operation runs in  $O((i_2 - i_1 + 1) + \log n)$  time.
Algorithm 1: Efficient  $k$ -means++ seeding in one dimension
Input: Points  $x_{1},\ldots ,x_{n}\in \mathbb{R};k\in \mathbb{Z}$  satisfying  $1\leq k\leq n$  real number  $z\geq 1$  Output: Centers  $x_{\ell_1},\ldots ,x_{\ell_k}\in \mathbb{R}$  ; assignment  $\sigma :[n]\to [k]$    
1 Sort and re-order the points so that  $x_{1}\leq \dots \leq x_{n}$    
2 Choose  $\ell_1$  uniformly at random from  $\{1,\dots ,n\}$    
3 Initialize  $a = (a_{1},\dots ,a_{n})$  by setting  $a_i\gets |x_i - x_{\ell_1}|^z$  for every  $i = 1,\dots ,n$    
4  $S\gets$  Initialize(a);   
5 for  $t = 2,\ldots ,k$  do   
6 Choose  $r$  uniformly at random from  $[0,\mathrm{Sum}(S))$    
7  $\ell_t\gets \mathrm{Find}(S,r)$  .  $a_{\ell_t}\gets 0$  .  $i\gets \ell_t - 1$  .  $j\gets \ell_t + 1$    
8 while  $i\geq 0$  and  $|x_{i} - x_{\ell_{t}}|^{z} <   a_{i}$  do   
9  $a_i\gets |x_i - x_{\ell_t}|^z$    
10  $i\gets i - 1$    
11 end   
12 while  $j\leq n$  and  $|x_j - x_{\ell_t}|^z <  a_j$  do   
13  $a_j\gets |x_j - x_{\ell_t}|^z$    
14  $j\gets j + 1$    
15 end   
16 Update  $(S,a,i + 1,j - 1)$    
17 end   
18 Sort and re-order  $\ell_1,\ldots ,\ell_k$  so that  $\ell_1\leq \dots \leq \ell_k$  ..   
19  $i\gets 1$  .  $j\gets 1$    
20 while  $i\leq n$  do /\* Assign  $x_{i}$  to the closest center  $x_{\ell_{\sigma (i)}}$  among  $x_{\ell_1},\ldots ,x_{\ell_k}$  /\*   
21 if  $j <   k$  and  $|x_i - x_{\ell_j}|\geq |x_i - x_{\ell_{j + 1}}|$  then   
22  $j\gets j + 1$    
23 else   
24  $\sigma (i)\gets j;$    
25  $i\gets i + 1$    
26 end   
27 end   
28 return  $x_{\ell_1},\ldots ,x_{\ell_k}$  and  $\sigma$  (converted to the old ordering of  $x_{1},\ldots ,x_{n}$  before Line 1);
The following claim shows that Algorithm 1 correctly implements the  $k$ -means++ seeding procedure in one dimension.
Claim C.2. Consider the values of  $t, a_1, \ldots, a_n$  and the data structure  $S$  at the beginning of each iteration of the for-loop (i.e., right before Line 6). Let  $s_1, \ldots, s_n$  be the numbers the data structure  $S$  keeps track of. For every  $i = 1, \ldots, n$ , define  $p_i := \min_{t' = 1, \ldots, t-1} |x_i - x_{\ell_{t'}}|$ . Then  $s_i = a_i = p_i^z$  for every  $i = 1, \ldots, n$ . Consequently, the distribution of  $\ell_t$  at Line 7 conditioned on the execution history so far satisfies  $\operatorname{Pr}[\ell_t = i] = p_i^z / \sum_{i'=1}^{n} p_{i'}^z$  for every  $i = 1, \ldots, n$ .
The claim follows immediately by induction over the iterations of the for-loop based on the description of the data structure  $S$  and its operations above. The following lemma bounds the running time of Algorithm 1:
Lemma C.3 (Lemma 2.4 for general  $z \geq 1$ ). The expected running time of Algorithm 1 is  $O(2^{z/2}n\log n)$ . For any  $\delta \in (0,1/2)$ , with probability at least  $1 - \delta$ , Algorithm 1 runs in time  $O(2^{z/2}n\log(n/\delta))$ . Moreover, Algorithm 1 always runs in time  $O(n\log n + nk)$ .
Before proving Lemma C.3, we first use it to prove Theorem C.1.
Proof of Theorem C.1. Lemma C.3 bounds the running time of Step 2 of our algorithm PRONE defined in Section 2. Now we show that Step 1 (random one-dimensional projection) can be performed in time  $O(\mathsf{nnz}(X) + n)$ . Indeed,  $x_{i}^{\prime}$  can be computed as  $x_{i}^{\prime} = \sum_{j}x_{ij}v_{j}$  where the sum is over all the non-zero coordinates  $x_{ij}$  of  $x_{i}$ , and each  $v_{j}$  is drawn independently from the one-dimensional standard Gaussian (the value of  $v_{j}$  should be shared for all  $i$ ). The time needed to compute  $x_{1}^{\prime},\ldots ,x_{n}^{\prime}$  in this way is  $O(\mathsf{nnz}(X) + n)$ . In Step 3 of PRONE, we compute the center of mass for every cluster.
This can be done in time  $O(\mathsf{nnz}(X) + n)$  by summing up the points in each cluster and dividing each sum by the number of points in that cluster.
The key step towards proving Lemma C.3 is to bound the number of updates to  $a$  at Lines 9 and 13. As the algorithm starts by sorting the  $n$  input points, which can be done in time  $O(n\log n)$ , we can assume that the points are sorted such that  $x_{1}\leq \dots \leq x_{n}$ . For  $i = 1,\ldots ,n$  and  $t = 2,\ldots ,k$ , we define  $\xi (i,t) = 1$  if  $a_{i}$  is updated at Line 9 in iteration  $t$  and define  $\xi (i,t) = 0$  otherwise. Here, we denote each iteration of the for-loop beginning at Line 5 by the value of the iterate  $t$ . We define  $u_{i}:= \sum_{t = 2}^{k}\xi (i,t)$  to be the number of times  $a_{i}$  gets updated at Line 9. The following lemma gives upper bounds on  $u_{i}$  both in expectation and with high probability:
Lemma C.4. For every  $i = 1,\dots ,n$  , it holds that
$$
\mathbb {E} \left[ u _ {i} \right] \leq O \left(2 ^ {z / 2} \log n\right).
$$
Moreover, for some absolute constant  $B > 0$  and for every  $\delta \in (0,1 / 2)$ , it holds that
$$
\Pr [ u _ {i} \leq B 2 ^ {z / 2} \log (n / \delta) ] \geq 1 - \delta .
$$
Before proving Lemma C.4, we first use it to prove Lemma C.3.
Proof of Lemma C.3. Recall that for  $i = 1, \dots, n$  and  $t = 2, \dots, k$ , we define  $\xi(i, t) = 1$  if  $a_i$  is updated at Line 9 in iteration  $t$  and define  $\xi(i, t) = 0$  otherwise. Similarly, for  $j = 1, \dots, n$  and  $t = 2, \dots, k$ , we define  $\xi'(j, t) = 1$  if  $a_j$  is updated at Line 13 in iteration  $t$  and define  $\xi'(j, t) = 0$  otherwise.
The computation at Lines 1-4 takes  $O(n \log n)$  time. The computation at Lines 18-28 takes  $O(k \log k + n) = O(n \log n)$  time. For  $t = 2, \ldots, k$ , iteration  $t$  of the for-loop takes time  $O(\log n + \sum_{i=1}^{n} \xi(i, t) + \sum_{i=1}^{n} \xi'(i, t))$ . Summing them up, the total running time of Algorithm 1 is
$$
O \left(n \log n + \sum_ {i = 1} ^ {n} \sum_ {t = 2} ^ {k} \xi (i, t) + \sum_ {i = 1} ^ {n} \sum_ {t = 2} ^ {k} \xi^ {\prime} (i, t)\right). \tag {9}
$$
By Lemma C.4,
$$
\mathbb {E} \left[ \sum_ {i = 1} ^ {n} \sum_ {t = 2} ^ {k} \xi (i, t) \right] = \mathbb {E} \left[ \sum_ {i = 1} ^ {n} u _ {i} \right] = O \left(2 ^ {z / 2} n \log n\right). \tag {10}
$$
Also, for any  $\delta' \in (0, 1/2)$ , setting  $\delta = \delta'/n$  in Lemma C.4, by the union bound we have
$$
\begin{array}{l} \Pr \left[ \sum_ {i = 1} ^ {n} \sum_ {t = 2} ^ {k} \xi (i, t) \leq 2 B 2 ^ {z / 2} n \log (n / \delta^ {\prime}) \right] \geq \Pr \left[ \sum_ {i = 1} ^ {n} \sum_ {t = 2} ^ {k} \xi (i, t) \leq B 2 ^ {z / 2} n \log (n / \delta) \right] \\ \geq 1 - n \delta \\ = 1 - \delta^ {\prime}. \tag {11} \\ \end{array}
$$
Similarly to (10) and (11) we have
$$
\mathbb {E} \left[ \sum_ {i = 1} ^ {n} \sum_ {t = 2} ^ {k} \xi^ {\prime} (i, t) \right] = O \left(2 ^ {z / 2} n \log n\right), \quad \text {a n d} \tag {12}
$$
$$
\Pr \left[ \sum_ {i = 1} ^ {n} \sum_ {t = 2} ^ {k} \xi^ {\prime} (i, t) \leq 2 B 2 ^ {z / 2} n \log \left(n / \delta^ {\prime}\right) \right] \geq 1 - \delta^ {\prime}. \tag {13}
$$
Plugging (10) and (11) into (9) proves that the expected running time of Algorithm 1 is  $O(2^{z/2} n \log n)$ . Choosing  $\delta' = \delta/2$  for the  $\delta$  in Lemma C.3 and plugging (11) and (13) into (9), we can use the union bound to conclude that with probability at least  $1 - \delta$  Algorithm 1 runs in time  $O(2^{z/2} n \log (n / \delta))$ . Finally, plugging  $\xi(i, t) \leq 1$  and  $\xi'(i, t) \leq 1$  into (9), we get that Algorithm 1 always runs in time  $O(n \log n + nk)$ .
To prove Lemma C.4, for  $i = 0,\dots ,n$  and  $u = 0,\ldots ,u_{i}$ , we define  $t(i,u)$  to be the smallest  $t\in \{1,\ldots ,k\}$  such that  $\sum_{t^{\prime} = 2}^{t}\xi (i,t^{\prime}) = u$ . That is,  $a_{i}$  gets updated at Line 9 for the  $u$ -th time in iteration  $t(i,u)$ . Our definition implies that  $t(i,0) = 1$  and  $t(i,u)\in \{2,\dots ,k\}$  for  $u = 1,\dots ,u_{i}$ . We define a nonnegative potential function  $\eta (i,u)$  as follows and show that it decreases exponentially in expectation as  $u$  increases (Lemma C.5).
Potential Function  $\eta(i, u)$ . For  $t = 2, \ldots, k$ , we consider the value of  $\ell_t$  after Line 7 in iteration  $t$ . For  $u = 1, \ldots, u_i$ , we define  $\eta(i, u)$  to be  $\ell_{t(i, u)} - i$ , which is guaranteed to be a positive integer by the definition of  $t(i, u)$ . Indeed, in the while-loop containing Line 9,  $i$  starts from  $\ell_t - 1$  and keeps decreasing, so whenever Line 9 is executed,  $i$  is smaller than  $\ell_t$ . In particular,  $a_i$  is updated at Line 9 in iteration  $t(i, u)$  of the for-loop, so we have  $i < \ell_{t(i, u)}$ . We define  $\eta(i, 0) = n$ , and for  $u = u_i + 1, u_i + 2, \ldots$ , we define  $\eta(i, u) = 0$ . See Figure 4 for an example illustrating the definition of  $\eta(i, u)$ .
Figure 4: An example illustrating the definition of the potential function  $\eta$ . Here,  $a_{i}$  is updated at Line 9 for the first time in iteration  $t(i,1)$  when  $\ell_{t(i,1)} = i + 4$ . Then  $a_{i}$  gets updated at Line 9 for the second time in iteration  $t(i,2)$  when  $\ell_{t(i,2)} = i + 1$ . We always have  $\ell_t > i$  whenever  $a_{i}$  is updated at Line 9, and  $\eta$  is the difference between  $\ell_t$  and  $i$ . Thus in this example  $\eta (i,1) = 4$  and  $\eta (i,2) = 1$ . If  $a_{i}$  is never updated at Line 9 after iteration  $t(i,2)$ , we define  $\eta (i,u) = 0$  for  $u = 3,4,\ldots$ .
Lemma C.5 (Potential function decrease). For any  $i\in \{1,\dots ,n\}$  and  $u\in \mathbb{Z}_{\geq 0}$
$$
\mathbb {E} \left[ \eta (i, u + 1) \mid \eta (i, 0), \dots , \eta (i, u) \right] \leq \max  \left\{0, \frac {2 ^ {z / 2}}{2 ^ {z / 2} + 1} \eta (i, u) - \frac {1}{2} \right\}.
$$
Before proving Lemma C.5, we first use it to prove Lemma C.4. Intuitively, Lemma C.5 says that  $\eta(i,u)$  decreases exponentially (in expectation) as a function of  $u$ . Since  $\eta(i,u)$  is always a nonnegative integer, we should expect  $\eta(i,u)$  to become zero as soon as  $u$  exceeds a small threshold. Moreover, our definition ensures  $\eta(i,u_i) > 0$ , so  $u_i$  must be smaller than the threshold. This allows us to show upper bounds for  $u_i$  and prove Lemma C.4.
Proof of Lemma C.4. Our definition of  $\eta$  ensures  $\eta(i, u_i) \geq 1$ . By Lemma C.5 and Lemma C.7,
$$
\mathbb {E} [ u _ {i} + 1 ] \leq \frac {\ln n}{\ln \frac {2 ^ {z / 2} + 1}{2 ^ {z / 2}}} + \frac {1}{1 - \frac {2 ^ {z / 2}}{2 ^ {z / 2} + 1}} = O (2 ^ {z / 2} \ln n) + 2 ^ {z / 2} + 1.
$$
This implies  $\mathbb{E}[u_i] = O(2^{z / 2}\log n)$ . Moreover, by Lemma C.5,
$$
\mathbb {E} [ \eta (i, u) ] \leq \eta (i, 0) \left(\frac {2 ^ {z / 2}}{2 ^ {z / 2} + 1}\right) ^ {u} = n \left(\frac {2 ^ {z / 2}}{2 ^ {z / 2} + 1}\right) ^ {u},
$$
and thus, by Markov's inequality,
$$
\Pr [ u _ {i} \geq u ] = \Pr [ \eta (i, u) \geq 1 ] \leq n \left(\frac {2 ^ {z / 2}}{2 ^ {z / 2} + 1}\right) ^ {u}.
$$
For any  $\delta \in (0,1 / 2)$ , choosing  $u = \ln (n / \delta) / \ln (\frac{2^{z / 2} + 1}{2^{z / 2}}) = O(2^{z / 2}\log (n / \delta))$  in the inequality above gives  $\operatorname*{Pr}[u_i\geq u]\leq \delta$ .
We need the following helper lemma to prove Lemma C.5.
Lemma C.6. The following holds at the beginning of each iteration of the for-loop in Algorithm 1, i.e., right before Line 6 is executed. Choose an arbitrary  $i = 1,\dots ,n$  and define
$$
L := \{i \} \cup \{\ell \in \mathbb {Z}: i <   \ell \leq n, | x _ {i} - x _ {\ell} | ^ {z} <   a _ {i} \}. \tag {14}
$$
Then for  $\ell, \ell' \in L$  satisfying  $\ell < \ell'$ , it holds that  $a_{\ell'} \leq 2^z a_\ell$ .
Proof. For  $t = 2, \ldots, k$ , at the beginning of iteration  $t$ , the values  $\ell_1, \ldots, \ell_{t-1}$  have been determined. For every  $x \in \mathbb{R}$ , let  $\rho(x)$  denote the value among  $x_{\ell_1}, \ldots, x_{\ell_{t-1}}$  closest to  $x$ . By Claim C.2,  $a_i = |x_i - \rho(x_i)|^z$  for every  $i \in [n]$ . Now for a fixed  $i \in [n]$ , define  $L$  as in (14) and consider  $\ell, \ell' \in L$  satisfying  $\ell < \ell'$ . It is easy to see that  $x_i \leq \rho(x_\ell) \leq x_{\ell'}$  cannot hold because otherwise  $a_i \leq |x_i - \rho(x_\ell)|^z \leq |x_i - x_{\ell'}|^z < a_i$ , a contradiction. For the same reason, the inequality  $x_i \leq \rho(x_{\ell'}) \leq x_{\ell'}$  cannot hold. Thus there are only three possible orderings of  $x_i, x_\ell, x_{\ell'}, \rho(x_\ell), \rho(x_{\ell'})$ :
1.  $\rho (x_{\ell}) = \rho (x_{\ell '}) <   x_{i}\leq x_{\ell}\leq x_{\ell '};$
2.  $\rho (x_{\ell}) <   x_{i}\leq x_{\ell}\leq x_{\ell^{\prime}} <   \rho (x_{\ell^{\prime}})$
3.  $x_{i}\leq x_{\ell}\leq x_{\ell^{\prime}} <   \rho (x_{\ell}) = \rho (x_{\ell^{\prime}})$
In scenario 3, it is clear that  $a_{\ell'} = |x_{\ell'} - \rho(x_{\ell'})|^{z} \leq |x_{\ell} - \rho(x_{\ell})|^{z} = a_{\ell}$ . In the first two scenarios, for any  $t' = 0, \ldots, t - 1$ ,
$$
\left| x _ {i} - x _ {\ell_ {t ^ {\prime}}} \right| \geq \left| x _ {\ell} - x _ {\ell_ {t ^ {\prime}}} \right| - \left| x _ {\ell} - x _ {i} \right| \geq \left| x _ {\ell} - \rho (x _ {\ell}) \right| - \left| x _ {\ell} - x _ {i} \right| = \left| x _ {i} - \rho (x _ {\ell}) \right|.
$$
This implies that  $\rho(x_{\ell})$  is the closest point to  $x_{i}$  among  $x_{\ell_1}, \ldots, x_{\ell_{t-1}}$ . Therefore,  $a_{i} = |x_{i} - \rho(x_{\ell})|^{z}$ . Jensen's inequality ensures  $((g + h)/2)^{z} \leq (g^{z} + h^{z})/2$  for any  $g, h \geq 0$ , which implies  $(g + h)^{z} \leq 2^{z-1} g^{z} + 2^{z-1} h^{z}$ . Therefore,
$$
a _ {\ell^ {\prime}} \leq | x _ {\ell^ {\prime}} - \rho (x _ {\ell}) | ^ {z} \leq 2 ^ {z - 1} | x _ {\ell^ {\prime}} - x _ {i} | ^ {z} + 2 ^ {z - 1} | x _ {i} - \rho (x _ {\ell}) | ^ {z} <   2 ^ {z} a _ {i},
$$
$$
a _ {\ell} = \left| x _ {\ell} - \rho (x _ {\ell}) \right| ^ {z} \geq \left| x _ {i} - \rho (x _ {\ell}) \right| ^ {z} = a _ {i}.
$$
Thus, we have  $a_{\ell^{\prime}} \leq 2^{z} a_{\ell}$  in all three scenarios.
Proof of Lemma C.5. Throughout the proof, we fix  $i \in \{1, \dots, n\}$  and  $u \in \mathbb{Z}_{\geq 0}$  so that they are deterministic numbers. Algorithm 1 is a randomized algorithm, and when we run it, exactly one of the following four events happens, and we define a random variable  $t^*$  accordingly:
1. Event  $E_{1}$ :  $u_{i} < u$ . That is,  $a_{i}$  gets updated at Line 9 for less than  $u$  times. In this case we have  $\eta (i,u + 1) = 0$  by our definition of  $\eta$ , and we define  $t^{*} = +\infty$ .
2. Event  $E_{2}$ :  $u_{i} = u$  and  $i$  is never chosen as  $\ell_t$  at Line 7. In this case we also have  $\eta(i, u + 1) = 0$ , and we also define  $t^{*} = +\infty$ .
3. Event  $E_{3}$ :  $u_{i} = u$  and there exists  $t \in \{2, 3, \dots, k\}$  such that  $i$  is chosen as  $\ell_{t}$  at Line 7 in iteration  $t$ . This  $t$  must satisfy  $t > t(i, u)$ , as all updates to  $a_{i}$  in Line 9 must happen before  $x_{i}$  is chosen as a center. We define  $t^{*} = t$  in this case. Again, we have  $\eta(i, u + 1) = 0$  in this case.
4. Event  $E_4$ :  $u_i > u$ . We define  $t^* \coloneqq t(i, u + 1) > t(i, u)$  in this case.
Define  $E^{*} \coloneqq E_{3} \cup E_{4}$ . Since  $\eta(i, u + 1) = 0$  under  $E_{1}$  and  $E_{2}$ , it suffices to prove that
$$
\mathbb {E} [ \eta (i, u + 1) | \eta (i, 0), \dots , \eta (i, u), E ^ {*} ] \leq \frac {2 ^ {z / 2}}{2 ^ {z / 2} + 1} \eta (i, u) - \frac {1}{2}. \tag {15}
$$
By our definition, the random variable  $t^*$  takes its value in  $\{2, 3, \ldots, k\} \cup \{+\infty\}$ . Moreover,  $t^* = +\infty$  if and only if  $E^*$  does not happen. Therefore, to prove (15), it suffices to prove the following for every  $t_0 = 2, 3, \ldots, k$ :
$$
\mathbb {E} [ \eta (i, u + 1) | \eta (i, 0), \dots , \eta (i, u), t ^ {*} = t _ {0} ] \leq \frac {2 ^ {z / 2}}{2 ^ {z / 2} + 1} \eta (i, u) - \frac {1}{2}. \tag {16}
$$
Consider a fixed  $t_0 \in \{2, 3, \dots, k\}$ . For  $t^* = t_0$  to happen, the following must hold during the execution of Algorithm 1 before iteration  $t_0$ :  $a_i$  has been updated at Line 9 for exactly  $u$  times, and  $i$  has not been chosen as  $\ell_t$  at Line 7. Thus, the rest of the proof assumes that the execution history  $H$  of Algorithm 1 before iteration  $t_0$  satisfies this property. Now we know that the values  $\eta(i, 0), \dots, \eta(i, u)$  are determined by the execution history  $H$ . Lines 6-7 guarantee that the distribution of  $\ell_{t_0}$  satisfies
$$
\Pr \left[ \ell_ {t _ {0}} = \ell | H \right] = \frac {a _ {\ell}}{\sum_ {j = 1} ^ {n} a _ {j}} \quad \text {f o r e v e r y} \ell = 1, \dots , n,
$$
where we use the values  $a_1, \ldots, a_n$  right before iteration  $t_0$  is executed. Moreover, conditioned on  $H$ , we have  $t^* = t_0$  if and only if  $\ell_{t_0} \in L$ , where