SlowGuess/NeurIPS_2023_OCR huggingface dataset:
where the first and third inequalities are due to the triangle inequality, and the second inequality is due to the definition of  $u_{q}$  and Theorem 3.3. Now, note that  $\delta_T(\nu_q,w) = \delta_i^{\nu_q}\leq \tau_q^{\nu_q}$  from the condition of Line 16.
Enumerate the path in the tree between  $u_{q}$  and  $v_{q}$  as  $u_{q} = w_{0}, w_{1}, \dots, w_{k} = v_{q}$ , and note that  $\delta_{T}(u_{q}, v_{q}) = \sum_{j=0}^{k-1} c(w_{j})$ . Now, note that the variable  $v$  advanced from  $w_{j}$  to  $w_{j+1}$  due to  $\tau_{q}^{w_{j}} \geq c(w_{j})$ ; thus,  $\delta_{T}(u_{q}, v_{q}) = \sum_{j=0}^{k-1} \tau_{q}^{w_{j}}$ . Finally, note that  $\sum_{j=0}^{k} \tau_{q}^{w_{j}} = \tau_{q}$ ; combining, we get
$$
\delta_ {T} (u _ {q}, v _ {q}) + \delta_ {T} (v _ {q}, w) \leq \sum_ {j = 0} ^ {k} \tau^ {w _ {j}} = \tau_ {q}
$$
Plugging the above into Equation (7), we get  $\delta(q, w) \leq \tau_q + \delta(q, S)$ . We thus charge the connection cost of requests from  $Q'$  to the  $(\tau_q + \delta(q, S))$  term in  $\mathrm{OA}(q, \pi)$ .
Observation A.2. The online amortization OA of Algorithm 2 is monotone.
Bounding Amortized Costs. Having shown that the online amortization is valid and monotone, it remains to bound the amortized cost of the algorithm. To show that the algorithm is Lagrangian subset-competitive, it is enough to show that it is PRSC; see Proposition C.2. We thus focus on showing that the algorithm is PRSC using OA w.r.t.  $S$ .
From this point on, for every node  $\nu \in T$  and index  $i\in [k(\nu) + 1]$ , we slightly abuse notation and use  $\lambda (\nu ,i)$  to refer to both the counter itself, and its value at the end of the algorithm.
Proposition A.3 (Penalty Robustness). For every  $(q,\pi)\in Q$ , it holds that  $\mathrm{OA}(q,\pi)\leq 2\pi$
Proof. If  $\mathrm{UPONREQUEST}(q,\pi)$  returns in Line 22, then it must be that the condition in Line 9 has failed, and thus  $\tau +\delta (u,q)\leq \pi$ ; thus,  $\mathrm{OA}(q,\pi) = \tau +(\tau +\delta (u,q))\leq 2\pi$
Otherwise,  $\mathrm{UPONREQUEST}(q,\pi)$  returned on Line 11, in which case note that since  $\tau$  is raised continuously from 0, Line 11 ensures that  $\tau \leq \pi$  at all times. Thus,  $\mathrm{OA}(q,\pi) = \tau +\pi \leq 2\pi$  completing the proof.
It remains to show subset competitiveness for the algorithm. Henceforth, fix any subset of the input  $Q' \subseteq Q$ .
Proposition A.4. For every request  $q$  and  $\nu \in T$ ,  $\tau_q^\nu \leq c(\nu)$ .
Proof. Observe that  $\tau_q^\nu$  cannot exceed  $\delta_{t(\nu)}^{\nu}$ , for some current value of  $t(\nu)$ , or else the request is connected (or escalated to a parent node). The fact that  $\delta_0^\nu = c(\nu)$ , together with the fact that  $\delta_i^\nu$  is a decreasing sequence in  $i$  (Observation 3.4) complete the proof.
We now begin to bound the (amortized) costs of the algorithm. Recall that  $\overline{Q^{\prime}}$  is the input  $Q^{\prime}$  with the penalties set to infinity; that is, the prize-collecting input converted to the standard setting. We would like to prove the following lemma.
Lemma A.5.  $\mathbb{E}[\mathrm{OA}(Q'|Q)]\leq O(\log (|S|))\cdot \mathrm{OPT}_S\Big(\overline{Q'}\Big).$
When the input consists of requests that are also from  $S$ , both the clients and facilities are from  $S$ , and thus on the leaves of the tree  $T$ . In this case, we define  $\mathrm{OPT}_T$  to be any solution for the input under the metric space induced by the weighted HST  $T$ . To prove Lemma A.5, we first bound the cost of the algorithm against  $\mathrm{OPT}_T$  on a set of clients mapped to their closest neighbors in  $S$ .
Lemma A.6. Let  $Q_S'$  be the input formed from  $Q'$  by mapping each request  $(q, \pi) \in Q'$  to the request  $(p(q), \pi)$ . It holds that
$$
\mathrm {O A} \left(Q ^ {\prime} | Q\right) \leq \sum_ {(q, \pi) \in Q ^ {\prime}} \delta (q, S) + O (D) \cdot \mathrm {O P T} _ {T} ^ {f} \left(\overline {{Q _ {S} ^ {\prime}}}\right) + O (1) \cdot \mathrm {O P T} _ {T} ^ {c} \left(\overline {{Q _ {S} ^ {\prime}}}\right)
$$
Proof. First, observe both return statements in Algorithm 2 and note that for every request  $(q,\pi)\in Q$  it holds that
$$
\mathrm {O A} (q, \pi) \leq 2 \tau_ {q} + \delta (q, S). \tag {8}
$$
We now focus on bounding  $\sum_{(q,\pi)\in Q^{\prime}}\tau_{q}$ , i.e., total amount by which counters are raised when handling  $Q^{\prime}$ . Let  $w$  be a facility opened in  $\mathrm{OPT}_T(\overline{Q_S'})$ . Let  $R\subseteq Q^{\prime}$  be the set of requests such that their corresponding requests in  $\overline{Q_S'}$  are connected by  $\mathrm{OPT}_T$  to the facility  $w$ . Using Observation 3.4, for every ancestor tree node  $v$  of  $w$ , we define  $i_v$  to be the minimal index such that  $\ell (o_{i_v}^v)\leq \ell (o_w)$  and  $\ell (\delta_{i_v}^v)\leq \ell (\delta_T(v,w))$ .
Let  $P(w) = (v_0 = w, v_1, \dots, v_k = r)$  be the path from  $w$  to the root. The sum  $\sum_{(q,\pi) \in Q'} \tau_q$  can be divided as follows:
1. Raising counters  $\lambda(v, i)$  for  $v \in P(w), i \leq i_v$ . The total amount here is at most
$$
\begin{array}{l} \sum_ {v \in P (w)} \sum_ {i = 1} ^ {i _ {v}} \lambda (v, i) \leq \sum_ {v \in P (w)} \sum_ {i = 1} ^ {i _ {v}} o _ {i} ^ {v} \leq \sum_ {i = 1} ^ {i _ {v}} 2 ^ {\ell \left(o _ {i} ^ {v}\right) + 1} \leq \sum_ {v \in P (w)} 2 ^ {\ell \left(o _ {i _ {v}} ^ {v}\right) + 2} \\ \leq \sum_ {v \in P (w)} 2 ^ {\ell \left(o _ {w}\right) + 2} \leq \sum_ {v \in P (w)} 4 o _ {w} \leq 4 D o _ {w}. \\ \end{array}
$$
2. Raising counters  $\lambda (\nu ,i)$  for  $\nu \notin P(w)$ . Consider a request  $q\in R$ , and define  $u\coloneqq p(q) = u$  and  $\nu$  to be the lowest common ancestor of  $u$  and  $w$ . The only nodes not in  $P(w)$  in which counters are raised when handling  $q$  are on the path from  $u$  (inclusive) to  $\nu$  (non-inclusive). Using Proposition A.4, the total increase in counters for these nodes is at most  $\delta_T(u,\nu)$ .
3. Raising counters  $\lambda(v, i)$  for  $v \in P(w)$  and  $i > i_v$ . Suppose that a request  $q$  raises such a counter  $\lambda(v_j, i)$  for some node  $v_j \in P(w)$ . When such a counter is raised, the proxy  $s_{i_{v_j}}^{v_j}$  is already open, and thus the total raising of counters of index greater than  $i_{v_j}$  for  $v_j$  by  $q$  is at most  $\delta_{i_{v_j}}^{v_j} \leq 2\delta_w^{v_j} = 2\delta_T(v_j, v) + 2\delta_T(v, w)$ , where  $v$  is the lowest common ancestor of  $u$  and  $w$ . (Note that other proxies of  $v_j$  of larger index could be open, but they can only be closer to  $v_j$ , thus limiting the raising of counters even further.)
Of those two costs, we would like to charge  $q$  only for  $2\delta_T(v,w)$ , and charge  $2\delta_T(\nu_j,\nu)$  in aggregate over all  $q$ . To do so, observe that the counters for nodes in  $P(w)\backslash \{\nu_j\}$  that were raised upon request  $q$  must be of the form  $\lambda (\nu_l,1)$  for  $\nu_{l}\in \{\nu_{0},\dots ,\nu_{j - 1}\}$ . As the request  $q$  was repeatedly escalated from  $v$  to  $\nu_{j}$ , the total increase in those counters must be at least  $\delta_T(\nu ,\nu_j)$ , and thus  $2\delta_{T}(\nu ,\nu_{j})$  is upper bounded by twice the increase in those counters. However, as seen in Item 1, over all requests, these increases sum to at most  $4Do_w$  over all  $q\in R$ ; thus, the term  $2\delta_{T}(\nu_{j},\nu)$  sums in aggregate to at most  $8Do_w$ .
Overall, denoting by  $w^q$  the lowest common ancestor of  $p(q)$  and  $w$ , we get:
$$
\begin{array}{l} \sum_ {(q, \pi) \in R} \tau (q, \pi) \leq 4 D o _ {w} + \sum_ {(q, \pi) \in R} \delta_ {T} (p (q), w ^ {q}) + \left(8 D o _ {w} + \sum_ {(q, \pi) \in R} \delta_ {T} (w ^ {q}, w)\right) \\ \leq 1 2 D o _ {w} + 2 \delta_ {T} (p (q), w). \\ \end{array}
$$
Summing over all  $w$ , we get
$$
\sum_ {(q, \pi) \in Q ^ {\prime}} \tau (q, \pi) \leq 1 2 D \cdot \mathrm {O P T} _ {T} ^ {f} \left(\overline {{Q _ {S} ^ {\prime}}}\right) + 2 \cdot \mathrm {O P T} _ {T} ^ {c} \left(\overline {{Q _ {S} ^ {\prime}}}\right).
$$
Combining with Equation (8), we get
$$
\mathrm {O A} (Q ^ {\prime} | Q) \leq \sum_ {(q, \pi) \in Q ^ {\prime}} \delta (q, S) + 2 4 D \cdot \mathrm {O P T} _ {T} ^ {f} \left(\overline {{Q _ {S} ^ {\prime}}}\right) + 4 \cdot \mathrm {O P T} _ {T} ^ {c} \left(\overline {{Q _ {S} ^ {\prime}}}\right).
$$
Having bounded the costs of the algorithm against  $\mathrm{OPT}_T$ , we can now prove Lemma A.5.
Proof of Lemma A.5. Using Lemma A.6, we get the following.
$$
\mathbb {E} \left[ \mathrm {O A} \left(Q ^ {\prime} | Q\right) \right] \leq \sum_ {(q, \pi) \in Q ^ {\prime}} \delta (q, S) + \mathbb {E} \left[ O \left(\log \left(| S |\right)\right) \cdot \operatorname {O P T} _ {T} ^ {f} \left(\overline {{Q _ {S} ^ {\prime}}}\right) + O (1) \cdot \operatorname {O P T} _ {T} ^ {c} \left(\overline {{Q _ {S} ^ {\prime}}}\right) \right]
$$
Now, note that every solution  $\mathrm{OPT}_S(\overline{Q_S'})$  induces a solution for  $\overline{Q_S'}$  on  $T$ , which opens the same facilities and makes the same connections (through the tree); the new tree solution has the same facility opening costs, and connection costs which are, in expectation, at most  $O(\log(|S|))$ -times greater (see Theorem 3.3). Thus, we have
$$
\mathbb {E} \left[ \mathrm {O A} \left(Q ^ {\prime} | Q\right) \right] \leq \sum_ {(q, \pi) \in Q ^ {\prime}} \delta (q, S) + O (\log (| S |)) \cdot \operatorname {O P T} _ {S} \left(\overline {{Q _ {S} ^ {\prime}}}\right)
$$
Now, note that any solution  $\mathrm{OPT}_S\left(\overline{Q'}\right)$  induces a solution for  $\overline{Q_S'}$  of cost  $\sum_{(q,\pi)\in Q'}\delta (q,S) + \mathrm{OPT}_S\left(\overline{Q'}\right)$ , and also note that  $\sum_{(q,\pi)\in Q'}\delta (q,S)$  is a lower bound for  $\mathrm{OPT}_S\left(\overline{Q'}\right)$ . Plugging into the displayed equation above completes the proof of the lemma.
Proof of Theorem 3.1. Lemma A.1 and Observation A.2 show that the online amortization OA is valid and monotone. Proposition A.3 shows penalty robustness, while Lemma A.5 shows subset competitiveness; thus, the algorithm is  $O(\log |S|)$ -PRSC using OA w.r.t.  $S$ . Using Proposition C.2, the algorithm is Lagrangian  $O(\log |S|)$ -subset-competitive using OA w.r.t.  $S$ .
Algorithm 4: Variant of Fotakis' Algorithm for Prize-Collecting OFLP
1 Initialization   
2 Let  $Q\gets \emptyset$    
3 Let  $F\gets \emptyset$    
4 For every  $\nu \in X$  , let  $p(\nu)\leftarrow 0$    
5 Event Function UPONREQUEST(q,π) // Upon the next request q in the sequence on point u E X   
6 Set  $Q\gets Q\cup \{q\}$    
7 Denote by  $\nu_{0}$  the closest open facility to q.   
8 Define  $\tau_q\gets \min \{\pi ,\delta (q,F),\min_{v\in X}\{o_v - p(v) + \delta (q,v)\} \}$    
9 if  $\tau_q = \delta (q,F)$  then   
10 Connect q to the closest facility in F.   
11 else if  $\tau_q = o_v - p(v) + \delta (q,v)$  for some v E X then   
12 Open a facility at v.   
13 Connect q to v.   
14 else   
15 Pay the penalty  $\pi$  for q.   
16 COMPUTEPOTENTIALs()   
17 return  $2\tau_q$  // return amortized cost   
18 Function COMPUTEPOTENTIALs()   
19 For every  $q\in Q$  , define  $\lambda_q = \min \{\delta (q,F),\tau_q\}$    
20 For every location  $\nu \in X$  , set  $p(\nu)\gets \sum_{q\in Q}\bigl (\lambda_q - \delta (q,\nu)\bigr)^+$
B Online Facility Location: The  $O(\log n)$ -Competitive Algorithm
In this section, we present and analyze a prize-collecting algorithm for facility location with predictions whose competitive ratio on the number of requests  $n = |Q|$ . As is required for using Algorithm 1, this algorithm is Lagrangian subset-competitive. This algorithm is based on the work of Fotakis [18] for the non-prize-collecting setting. Specifically, we prove the following theorem.
Theorem B.1. For facility location with predictions, there exists a deterministic prize-collecting algorithm ALG with a monotone online amortization OA which is Lagrangian  $O(\log n)$ -subset-competitive using OA.
B.1 The Algorithm
Algorithm's description. This algorithm follows the main principles of Fotakis [18]. Each point in the metric space has an associated potential, such that when that potential exceeds the cost of opening a facility at that point, the facility is opened. This potential roughly translates to the amount by which the cost of the offline solution for known requests would decrease by opening a facility at that location. Observing each request, consider the ball centered at that request such that the closest open facility lies on the sphere of that ball; the request imposes a potential increase for every point inside that ball. However, as the requests now have penalties, these penalties cap the radius of the ball, i.e., limit the potential imposed by the requests.
Specifically, the algorithm assigns each request a cost  $\tau_{q}$ , which intuitively is the minimum cost of handling the current request. This cost could be the penalty cost, the cost of connecting to an open facility, or the cost of opening a facility (beyond the current potential budget) and then connecting to it. The algorithm spends an amortized cost of  $\tau_{q}$  to serve  $q$ , but a potential ball of radius  $\tau_{q}$  is also created to serve future requests (at an future cost of at most  $\tau_{q}$ ).
For every  $x$ , we use  $x^{+}$  as a shorthand for  $\max \{0, x\}$ . The prize-collecting algorithm based on [18] is given in Algorithm 4.
B.1.1 Analysis
We now analyze Algorithm 4 and show that it proves Theorem B.1. For this analysis, we fix the prize-collecting input  $Q$ . Next, we define the online amortization OA such that  $\mathrm{OA}(q,\pi)$  is the value returned by UPONREQUEST in Theorem B.1 upon release of  $(q,\pi)\in Q$ .
Online Amortization
We first prove that OA is valid and monotone.
Lemma B.2. The online amortization OA for Algorithm 4 is valid, i.e.,  $\mathrm{ALG}(Q) \leq \mathrm{OA}(Q)$ .
Proof. For each request, observe the variable  $\tau_q$ , and note that:
- If the penalty  $\pi$  is paid for  $q$ , then  $\tau_q = \pi$ .
- If  $q$  is connected to some facility, the connection cost of  $q$  does not exceed  $\tau_q$ .
It remains to bound the opening costs of the algorithm. Observe the evolution of the potential function  $\sum_{q\in Q}\min \bigl \{\delta (q,F),\tau_q\bigr \}$  as  $Q$  and  $F$  grow over time. This function is nonnegative, and grows by exactly  $\tau_{q}$  upon the release of  $(q,\pi)$  (after Line 8). Moreover, whenever a facility at  $\nu$  is opened (thus joining  $F$ ), it decreases this amount by exactly  $o_{\nu}$ . Thus, the total opening cost can be bounded by  $\sum_{q\in Q}\tau_q$ .
Overall, we bounded the cost of the algorithm by  $\sum_{(q,\pi)\in Q}2\tau_q = \sum_{(q,\pi)\in Q}\mathrm{OA}(q,\pi)$ .
Observation B.3. The online amortization OA given for Algorithm 4 is a monotone online amortization.
B.2 Bounding Amortized Costs
Having shown the necessary properties for the online amortization, we proceed to show that Algorithm 4 is Lagrangian subset-competitive using this amortization. As in Section 3, we first show that the algorithm is PRSC (see Proposition C.2); we begin by observing the penalty robustness of the algorithm.
Observation B.4. For every  $(q,\pi)\in Q$ , it holds that  $\mathrm{OA}(q,\pi)\leq 2\pi$
We now fix the subset  $Q' \subseteq Q$  for the sake of proving subset competitiveness. Recall that  $\overline{Q'}$  is the standard input formed from the prize-collecting input  $Q'$  (by setting penalties to infinity).
Before proving subset-competitiveness, we need to prove the following simple lemma.
Lemma B.5 (Min trace lemma). Let  $(a_{1},\dots ,a_{k}),(b_{1},\dots ,b_{k})$  be two sequences of non-negative numbers, and define  $c_{i,j} = \min (a_i,b_j)$ . Then if there exists  $z$  such that for every  $i$  it holds that  $\sum_{j = 1}^{i}c_{i,j}\leq z$ , then it holds that  $\sum_{i = 1}^{k}c_{i,i} = O(\log k)\cdot z$ .
Proof. We prove that  $\sum_{i=1}^{k} c_{i,i} \leq H_k \cdot z$  by induction on  $k$ , where  $H_k = \sum_{i=1}^{k} \frac{1}{i}$  is the  $k$ -th harmonic number. Note that the base case, in which  $k = 1$ , holds as  $c_{1,1} \leq z$ .
Now, for the general case, note that if we can find  $i$  such that  $c_{i,i} \leq \frac{z}{k}$ , then we can complete the proof by induction on the sequences  $(a_1, \dots, a_{i-1}, a_{i+1}, \dots, a_k)$  and  $(b_1, \dots, b_{i-1}, b_{i+1}, \dots, b_k)$ . (Note that the constraints required for this inductive instance are implied by the original constraints.) This induction would imply that  $\sum_{i' \neq i} c_{i',i'} \leq H_{k-1} \cdot z$ , to which adding  $c_{i,i}$  would complete the proof.
It remains to find  $i$  such  $c_{i,i} \leq \frac{z}{k}$ . We consider the constraint  $\sum_{j=1}^{k} c_{k,j} \leq z$ , and observe the following cases.
Case 1:  $c_{k,j}$  are equal for all  $j$ . In this case, all  $c_{k,j}$  are at most  $\frac{z}{k}$ . In particular, this is true for  $c_{k,k}$ ; thus, choosing  $i = k$  completes the proof.
Case 2:  $c_{k,j}$  are not all equal. In this case, observe  $j$  that minimizes  $c_{k,j}$ , and note that  $c_{k,j} \leq \frac{z}{k}$ . There exists  $j'$  such that  $c_{k,j} < c_{k,j'}$ , which implies  $c_{k,j} < a_k$ , and thus  $c_{k,j} = b_j$ , yielding  $b_j \leq \frac{z}{k}$ . But this implies  $c_{j,j} \leq b_j \leq \frac{z}{k}$ , and thus choosing  $i = j$  completes the proof.
We can now prove subset-competitiveness, as stated in Lemma B.6.
Lemma B.6.  $\mathrm{OA}(Q'|Q) \leq O(\log |Q'|) \cdot \mathrm{OPT}\bigg(\overline{Q'}\bigg)$ .
Proof. Let  $w$  be some facility opened by  $\mathrm{OPT}\Big(\overline{Q^{\prime}}\Big)$ , and denote by  $R \subseteq \overline{Q^{\prime}}$  the set of requests connected to that facility in  $\mathrm{OPT}\Big(\overline{Q^{\prime}}\Big)$ . Define  $C_w := \sum_{(q,\pi) \in R} \delta(w,q)$  the total connection cost incurred by  $\mathrm{OPT}\Big(\overline{Q^{\prime}}\Big)$  on the facility  $w$ . Enumerate these requests as  $((q_1,\pi_1),\dots ,(q_k,\pi_k))$ , where  $k = |R|$ . For  $1 \leq i \leq k$ , denote by  $F_i$  the set of facilities which were open immediately before the release of  $(q_i,\pi_i)$ . As a shorthand, we also define  $\tau_i = \tau_{q_i}$ . Consider that the total potential of the facility  $w$  can never exceed its cost  $o_w$ ; moreover, upon release of  $(q_i,\pi_i)$ , the choice of  $\tau_i$  ensures that
$$
\begin{array}{l} o _ {w} \geq \tau_ {i} - \delta (q _ {i}, w) + \sum_ {j = 1} ^ {i - 1} \min  (\tau_ {j}, (\delta (q _ {j}, F _ {i}) - \delta (q _ {j}, w)) ^ {+}) \\ \geq \tau_ {i} - \delta (q _ {i}, w) + \sum_ {j = 1} ^ {i - 1} \min  (\tau_ {j}, \delta (q _ {i}, F _ {i}) - \delta (q _ {i}, w) - \delta (q _ {j}, w) - \delta (q _ {j}, w)) \\ \geq \tau_ {i} - \delta (q _ {i}, w) + \sum_ {j = 1} ^ {i - 1} \min  (\tau_ {j}, \tau_ {i} - \delta (q _ {i}, w)) - 2 \sum_ {j = 1} ^ {i - 1} \delta (q _ {j}, w) \\ \geq \tau_ {i} - \delta (q _ {i}, w) + \sum_ {j = 1} ^ {i - 1} \min  (\tau_ {j}, \tau_ {i} - \delta (q _ {i}, w)) - 2 C _ {w} \\ \geq \sum_ {j = 1} ^ {i} \min  \left(\tau_ {j}, \tau_ {i} - \delta \left(q _ {i}, w\right)\right) - 2 C _ {w} \tag {9} \\ \end{array}
$$
where the second inequality uses the triangle inequality and the third inequality uses the definition of  $\tau_{i}$ .
From Equation (9), we have that for every  $1 \leq i \leq k$  it holds that
$$
\sum_ {j = 1} ^ {i} \min  (\tau_ {j}, \tau_ {i} - \delta (q _ {i}, w)) \leq o _ {w} + 2 C _ {w}.
$$
Using Lemma B.5, this yields
$$
\sum_ {i = 1} ^ {k} \min  \left(\tau_ {i}, \tau_ {i} - \delta \left(q _ {i}, w\right)\right) \leq O (\log k) \cdot \left(o _ {w} + 2 C _ {w}\right)
$$
Since  $\tau_{i} - \delta (q_{i},w) = \min (\tau_{i},\tau_{i} - \delta (q_{i},w))$  , and since  $\sum_{i = 1}^{k}\delta (q_i,w) = C_w$  , we have
$$
\sum_ {i = 1} ^ {k} \tau_ {i} \leq O (\log k) \cdot \left(o _ {w} + C _ {w}\right) \leq O (\log | Q ^ {\prime} |) \cdot \left(o _ {w} + C _ {w}\right)
$$
Finally, summing over all facilities  $w$  in  $\mathrm{OPT}(\overline{Q'})$  yields
$$
\sum_ {(q, \pi) \in Q ^ {\prime}} \tau_ {q} \leq O (\log | Q ^ {\prime} |) \mathrm {O P T} (\overline {{Q ^ {\prime}}}).
$$
Proof of Theorem B.1. Through Lemma B.2 and Observation B.3, we have that OA is a valid and monotone amortization for Algorithm 4. Lemma B.6 and Observation B.4 then yield that the algorithm is  $O(\log Q)$ -PRSC using OA. Using Proposition C.2 yields that the algorithm is Lagrangian  $O(\log Q)$ -subset-competitive using OA, which completes the proof of the theorem.
C The Smooth Combination Framework
C.1 Proof of Theorem 2.5
Proof of Theorem 2.5. Consider the framework in Algorithm 1 applied to algorithms  $\mathrm{ALG}_1$ ,  $\mathrm{ALG}_2$ . The framework ensures that all requests are satisfied, as at least one of the constituent algorithms
serves each request. Denote by  $\alpha(q)$  the final value assigned to the variable  $\alpha$  upon request  $q$ ; the prize-collecting input given to both constituent algorithms is  $Q^{*} = ((q, \alpha(q)))_{q \in Q}$ . We define  $Q_{1}^{*}, Q_{2}^{*}$  be the partition of  $Q^{*}$  induced by the partition of  $Q$  into  $Q_{1}, Q_{2}$ . As the algorithm only buys items bought by one of the constituent algorithms, its cost can thus be bounded by  $\mathrm{ALG}_{1}(Q^{*}) + \mathrm{ALG}_{2}(Q^{*})$ . We now bound  $\mathrm{ALG}_{1}(Q^{*})$ ; bounding  $\mathrm{ALG}_{2}(Q^{*})$  is identical.
First, consider the prize-collecting solution which serves  $Q_{1}^{*}$  optimally subject to using items from  $S$ , but pays the penalty for requests from  $Q_{2}^{*}$ ; using the Lagrangian subset-competitiveness of  $\mathrm{ALG}_{1}$  against this solution yields
$$
\mathbb {E} \left[ \mathrm {A L G} _ {1} \left(Q ^ {*}\right) \right] \leq O \left(\beta_ {1}\right) \cdot \mathrm {O P T} _ {S} \left(Q _ {1}\right) + \mathbb {E} \left[ O (1) \cdot \sum_ {q \in Q _ {2}} \alpha (q) \right] \tag {10}
$$
Now, observe that using the definition of  $\alpha$  and the fact that  $\mathrm{ALG}_2$  is monotone, we have that  $\alpha(q) \leq \mathrm{ALG}_2(q, \alpha(q))$ ; summing over requests in  $Q_2$  we get that  $\sum_{q \in Q_2} \alpha(q) \leq \mathrm{ALG}_2(Q_2^* | Q^*)$ . Plugging into Equation (10), we get
$$
\begin{array}{l} \mathbb {E} \left[ \mathrm {A L G} _ {1} \left(Q ^ {*}\right) \right] \leq O \left(\beta_ {1}\right) \cdot \operatorname {O P T} _ {S} \left(Q _ {1}\right) + \mathbb {E} \left[ O (1) \cdot \mathrm {A L G} _ {2} \left(Q _ {2} ^ {*} \mid Q ^ {*}\right) \right] \\ \leq O \left(\beta_ {1}\right) \cdot \operatorname {O P T} _ {S} \left(Q _ {1}\right) + O \left(\beta_ {2}\right) \cdot \operatorname {O P T} \left(Q _ {2}\right) \\ \end{array}
$$
where the second inequality uses the fact that  $\mathrm{ALG}_2$  is subset competitive to bound its cost on the subset  $Q_2^*$  against the solution which serves those requests optimally. This completes the bounding of costs for  $\mathrm{ALG}_1$ ; we can bound  $\mathbb{E}[\mathrm{ALG}_2(Q^*)]$  in the same way. Summing the bounds for  $\mathrm{ALG}_1$  and  $\mathrm{ALG}_2$ , we get
$$
\operatorname {A L G} (Q) \leq O \left(\beta_ {1}\right) \cdot \operatorname {O P T} _ {S} \left(Q _ {1}\right) + O \left(\beta_ {2}\right) \cdot \operatorname {O P T} \left(Q _ {2}\right)
$$
C.2 Penalty-Robust Subset-Competitive Algorithms
In proving that a prize-collecting algorithm is Lagrangian subset-competitive (for use in our framework), we sometimes find it easier to prove that it is penalty-robust subset competitive. As we now prove, this latter property is sufficient to prove the former. (In fact, it is easy to see that both properties are in fact equivalent.)
Definition C.1 (PRSC algorithm using online amortization). Let ALG be a randomized prize-collecting algorithm equipped with an online amortization OA running on an input  $Q$ . We say that ALG is  $\beta$  penalty-robust subset competitive (PRSC) using OA if both following conditions hold:
1. For every  $(q,\pi)\in Q$  we have  $\mathrm{OA}(q,\pi)\leq O(1)\cdot \pi$
2. For every subset  $Q^{\prime}\subseteq Q$  , we have  $\mathbb{E}[\mathrm{OA}(Q^{\prime}|Q)]\leq \beta \cdot \mathrm{OPT}(\overline{Q^{\prime}})$
(where  $\overline{Q^{\prime}}$  is the input formed from  $Q^{\prime}$  by forcing service, i.e., setting penalties to infinity.)