SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Definition 2 (PACC). A hypothesis class  $\mathcal{F}_{\theta}$  is probably approximately correct constrained (PACC) learnable with respect to the losses  $\{\ell_i\}_{i = 0,\dots,m}$  if there exists an algorithm that, for every  $\epsilon ,\delta \in (0,1)$  and every distribution  $\mathcal{D}_i$ $i = 0,\ldots ,m$  , can obtain  $f_{\theta}\in \mathcal{F}_{\theta}$  using  $N(\epsilon ,\delta ,m)$  samples from each  $\mathcal{D}_i$  that is, with probability  $1 - \delta$
1) probably approximately optimal, i.e., for  $\mathsf{P}^{\star}$  as in (P),
$$
\left| \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {0}} \left[ \ell_ {0} (f _ {\theta} (\mathbf {x}), y) \right] - \mathrm {P} ^ {\star} \right| \leq \epsilon , \text {a n d} \tag {7}
$$
2) probably approximately feasible, i.e.,
$$
\mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {i}} \left[ \ell_ {i} \left(f _ {\theta} (\mathbf {x}), y\right) \right] \leq \epsilon , \quad \text {f o r a l l} i \geq 1. \tag {8}
$$
Definition 2 is an extension of the probably approximately correct (PAC) framework from classical learning theory to the problem of learning under requirements. Indeed, note that for unconstrained learning problems  $[m = 0$  in (P)],  $\mathsf{P}^{\star} \leq \mathbb{E}_{\mathcal{D}_0}\left[\ell_0(f_\theta (\mathbf{x}),y)\right]$  for all  $\theta \in \Theta$ . In that case, (7) reduces to the classical definition of PAC learnability [41, Def. 2.14]. In general, however, a PACC learner must also satisfy the approximate feasibility condition (8).
Constrained learning theory shows that, under mild conditions, the PAC learnability of  $\mathcal{F}_{\theta}$  with respect to each individual loss  $\ell_{i}$  implies its PACC learnability [38, Thm. 1]. This does not mean that an empirical version of (P) is a PACC learner, i.e., approximates the value of  $\mathsf{P}^{\star}$ . In fact, this is typically not the case.
Case in point, consider the learning problem
$$
\begin{array}{l} \mathsf {P} _ {e} ^ {\star} = \min _ {\theta \in \Theta} J (\theta) \triangleq \mathbb {E} _ {\mathcal {D} _ {0}} [ | \theta^ {\top} \mathbf {x} | ] \\ \text {s u b j e c t} \quad \mathbb {E} _ {\mathcal {D} _ {1}} \left[ y \theta^ {\top} \mathbf {x} \right] \leq - 1, \quad \mathbb {E} _ {\mathcal {D} _ {2}} \left[ y \theta^ {\top} \mathbf {x} \right] \leq 1, \\ \end{array}
$$
where  $\mathcal{D}_0$  is the distribution of
$$
(\mathbf {x}, y) = \left\{ \begin{array}{l l} \big ([ \tau , - \tau ] ^ {T}, - 1 \big), & \text {w i t h p r o b . 1 / 2} \\ \big ([ 0, \alpha ] ^ {T}, 1 \big), & \text {w i t h p r o b . 1 / 2} \end{array} \right.,
$$
$\mathcal{D}_1$  is such that  $(\mathbf{x},y) = ([-1,\tau ],1)$ , and  $\mathcal{D}_2$  is such that  $(\mathbf{x},y) = ([-\tau ,1],1)$ , where  $\alpha$  is drawn uniformly at random from  $[0,1 / 4]$  and  $\tau$  is drawn uniformly at random from  $[-1 / 2,1 / 2]$ . Notice that the  $\mathcal{D}_i$  are correlated through the random variable  $\tau$ . The parameters  $\theta = [\theta_{1},\theta_{2}]$  are taken from the finite set  $\Theta = \{\theta^a,\theta^b,\theta^c,\theta^d\}$ , described below together with their corresponding objective values:
$$
J (\theta) = \left\{ \begin{array}{l l} 1 / 3 2, & \theta = \theta^ {a} \triangleq [ 1 / 2, 1 / 2 ] ^ {T} \\ 1 / 1 6, & \theta = \theta^ {b} \triangleq [ 1, 1 ] ^ {T} \\ 1 / 1 6 + 1 / 2 4, & \theta = \theta^ {c} \triangleq [ 1, 1 / 3 ] ^ {T} \\ 1 / 8, & \theta = \theta^ {d} \triangleq [ 1, 0 ] ^ {T} \end{array} . \right. \tag {9}
$$
Notice that under these distributions, the constraints in (PII) reduce to  $-\theta_{1} \leq -1$  and  $\theta_{2} \leq 1$ . Hence, all parameters expect for  $[1/2, 1/2]^{T}$  are feasible for the statistical (PII). From (9), its optimal value is therefore  $\mathsf{P}_{e}^{\star} = 1/16$  achieved for  $\theta^{\star} = \theta^{b}$ .
In the sequel, we will show that (i) the empirical version of (PII) [as in (PIII)] recovers its solution with exponentially small probability (Sec. A.1); (ii) relaxing the empirical problem [as in (PIV)] too little or too much fails to mitigate this issue (Sec. A.2); and (iii) a resilient relaxation [as in (PV)] allows the empirical version of (PII) to recover its solutions with high probability. In summary, the empirical counterpart of (PII) can be relaxed into a PACC learner, but care must be taken when choosing that relaxations.
A.1 Empirical constrained risk minimization (ECRM)
Consider the empirical version of (9), which can be written as
$$
\hat {\mathrm {P}} _ {e} ^ {\star} = \min  _ {\theta \in \Theta} \quad \hat {J} (\theta) \triangleq \frac {1}{N} \sum_ {n = 1} ^ {N} | \theta^ {\top} \mathbf {x} _ {n} | \tag {PIII}
$$
subject to  $\theta_{1}\geq 1 + \bar{\tau}\theta_{2},\quad \theta_{2}\leq 1 + \bar{\tau}\theta_{1},$
where  $\bar{\tau} = \frac{1}{N}\sum_{n=1}^{N}\tau_n$  is the empirical average of i.i.d. samples  $\tau_n$  drawn uniformly at random from  $[-1/2, 1/2]$ . Notice that
- for  $\theta^a$ , the first constraint reduces to  $1/2 \geq 1 + \bar{\tau}/2$  and since  $\bar{\tau} \geq -1/2$ , it is violated unless  $\bar{\tau} = 0$ ; and
- for  $\theta^b$ , the constraints read  $1 \geq 1 + \bar{\tau}$  and  $1 \leq 1 + \bar{\tau}$ , so that at least one is violated unless  $\bar{\tau} = 0$ .
Since  $\tau$  is a continuous distribution,  $\bar{\tau} \neq 0$  almost surely. Immediately, we obtain that  $\hat{\mathsf{P}}_e^\star \geq \min(\hat{J}(\theta^c), \hat{J}(\theta^d))$ . Additionally,  $\hat{\mathsf{P}}_e^\star < \infty$  since  $\theta^d$  is always feasible. Hence,
$$
\begin{array}{l} \mathbb {P} \left[ | \hat {\mathrm {P}} _ {e} ^ {\star} - \mathrm {P} _ {e} ^ {\star} | \leq 1 / 6 4 \right] \leq \mathbb {P} \left[ | \hat {J} \left(\theta^ {c}\right) - \mathrm {P} _ {e} ^ {\star} | \leq 1 / 6 4 \cup | \hat {J} \left(\theta^ {d}\right) - \mathrm {P} _ {e} ^ {\star} | \leq 1 / 6 4 \right] \\ \leq \mathbb {P} \left[ | \hat {J} \left(\theta^ {c}\right) - \mathsf {P} _ {e} ^ {\star} | \leq 1 / 6 4 \right] + \mathbb {P} \left[ | \hat {J} \left(\theta^ {d}\right) - \mathsf {P} _ {e} ^ {\star} | \leq 1 / 6 4 \right] \\ \leq \mathbb {P} \left[ | \hat {J} \left(\theta^ {c}\right) - J \left(\theta^ {c}\right) | \geq 1 / 2 4 - 1 / 6 4 \right] + \mathbb {P} \left[ | \hat {J} \left(\theta^ {d}\right) - J \left(\theta^ {d}\right) | \geq 1 / 1 6 - 1 / 6 4 \right] \\ \leq 4 e ^ {- 0. 0 0 1 N}. \\ \end{array}
$$
A.2 Relaxed ECRM
Consider now a relaxation of (PIII), namely
$$
\hat {\mathrm {P}} _ {x} ^ {\star} = \min  _ {\theta \in \Theta} \quad \hat {J} (\theta) \triangleq \frac {1}{N} \sum_ {n = 1} ^ {N} | \theta^ {\top} \mathbf {x} _ {n} | \tag {PIV}
$$
subject to  $\theta_{1} \geq 1 + \bar{\tau}\theta_{2} - u_{1}, \quad \theta_{2} \leq 1 + \bar{\tau}\theta_{1} + u_{2}$ .
Problem (PIV) is the empirical version of  $(\mathbf{P_u})$  for the relaxation  $\mathbf{u} = [u_1,u_2]^T$ . It is straightforward to see that if  $u_{1},u_{2} < \bar{\tau}$ , then we are in the situation of Sec. A.1 and once again  $\mathbb{P}\big[|\hat{\mathsf{P}}_e^\star -\mathsf{P}_e^\star |\leq 1 / 64\big]\to 0$  as  $N\rightarrow \infty$ .
On the other hand, notice that the constraints always hold whenever  $u_{1} \geq 1 + \bar{\tau}\theta_{2} - \theta_{1}$  and  $u_{2} \geq \theta_{2} - \bar{\tau}\theta_{1} - 1$ :
- For  $\theta^a$ , this reduces to  $u_1 \geq (\bar{\tau} + 1)/2$ , since  $u_2 \geq -(\bar{\tau} + 1)/2$  is satisfied for all  $\mathbf{u} \succeq \mathbf{0}$ . We therefore obtain that
$$
0 \leq \hat {\mathsf {P}} _ {x} ^ {\star} \leq \hat {J} (\theta^ {a}), \quad \text {f o r} u _ {1} \geq \frac {\bar {\tau} + 1}{2}.
$$
In this case, recalling that  $\bar{\tau} \neq 0$  almost surely yields
$$
\begin{array}{l} \mathbb {P} \left[ | \hat {\mathsf {P}} _ {x} ^ {\star} - \mathsf {P} _ {e} ^ {\star} | \leq 1 / 6 4 \right] = \mathbb {P} \left[ | \hat {J} \left(\theta^ {a}\right) - 1 / 1 6 | \leq 1 / 6 4 \cap \hat {J} \left(\theta^ {a}\right) \leq \hat {J} \left(\theta^ {b}\right) \vee \hat {J} \left(\theta^ {c}\right) \vee \hat {J} \left(\theta^ {d}\right)) \right] \\ \leq \mathbb {P} \left[ | \hat {J} \left(\theta^ {a}\right) - 1 / 1 6 | \leq 1 / 6 4 \right], \\ \end{array}
$$
where we use  $x \vee y = \min(x, y)$ . Using the fact that  $J(\theta^a) = 1/32$ , we obtain
$$
\begin{array}{l} \mathbb {P} \left[ | \hat {\mathbf {P}} _ {x} ^ {\star} - \mathbf {P} _ {e} ^ {\star} | \leq 1 / 6 4 \right] \leq \mathbb {P} \left[ | \hat {J} \left(\theta^ {a}\right) - J \left(\theta^ {a}\right) - 1 / 3 2 | \leq 1 / 6 4 \right] \\ \leq \mathbb {P} \left[ | \hat {J} \left(\theta^ {a}\right) - J \left(\theta^ {a}\right) | \geq 1 / 6 4 \right] \leq 2 e ^ {- 0. 0 0 0 1 N}. \\ \end{array}
$$
- For  $\theta^b$ , this becomes  $u_1 \geq \bar{\tau}$  and  $u_2 \geq \bar{\tau}$ . Hence,
$$
\hat {J} \left(\theta^ {a}\right) \neq \hat {\mathrm {P}} _ {x} ^ {\star} \leq \hat {J} \left(\theta^ {b}\right), \quad \text {f o r} \bar {\tau} \leq u _ {1} <   \frac {\bar {\tau} + 1}{2} \text {a n d} u _ {2} \geq \bar {\tau}.
$$
Since  $\mathsf{P}_e^\star = J(\theta^b)$ , we therefore get
$$
\begin{array}{l} \mathbb {P} \left[ \left| \hat {\mathbf {P}} _ {x} ^ {\star} - \mathbf {P} _ {e} ^ {\star} \right| \leq 1 / 6 4 \right] = \mathbb {P} \left[ \left| \hat {J} \left(\theta^ {b}\right) - J \left(\theta^ {b}\right) \right| \leq 1 / 6 4 \cap \hat {J} \left(\theta^ {b}\right) \leq \hat {J} \left(\theta^ {c}\right) \vee \hat {J} \left(\theta^ {d}\right) \right] \\ \geq \mathbb {P} \big [ \hat {J} (\theta^ {b}) \leq \hat {J} (\theta^ {c}) \vee \hat {J} (\theta^ {d}) \big ] - \mathbb {P} \big [ | \hat {J} (\theta^ {b}) - J (\theta^ {b}) | \geq 1 / 6 4 \big ] \\ \end{array}
$$
Notice that since  $\hat{J}(\theta)$  concentrates around  $J(\theta)$  for  $\theta \in \Theta$ , for every  $\epsilon > 0$ , there exists  $N_0$  such that  $\mathbb{P}\big[\hat{J}(\theta^b) \leq \hat{J}(\theta^c) \vee \hat{J}(\theta^d)\big] \geq 1 - \epsilon$ . We therefore conclude that
$$
\begin{array}{l} \mathbb {P} \left[ \left| \hat {\mathbf {P}} _ {x} ^ {\star} - \mathbf {P} _ {e} ^ {\star} \right| \leq 1 / 6 4 \right] \geq 1 - \epsilon - \mathbb {P} \left[ \left| \hat {J} \left(\theta^ {b}\right) - J \left(\theta^ {b}\right) \right| \geq 1 / 6 4 \right] \\ \geq 1 - \epsilon - 2 e ^ {- 0. 0 0 0 4 N} \\ \end{array}
$$
In summary, we have that
$$
\mathbb {P} \big [ | \hat {\mathsf {P}} _ {x} ^ {\star} - \mathsf {P} _ {e} ^ {\star} | \leq 1 / 6 4 \big ] = \left\{ \begin{array}{l l} \leq 4 e ^ {- 0. 0 0 1 N}, & u _ {1}, u _ {2} <   \bar {\tau} \\ \geq 1 - 3 e ^ {- N t ^ {2}}, & \bar {\tau} \leq u _ {1} <   \frac {\bar {\tau} + 1}{2} \text {a n d} u _ {2} \geq \bar {\tau} \\ \leq 2 e ^ {- 0. 0 0 0 1 N}, & u _ {1} \geq \frac {\bar {\tau} + 1}{2} \end{array} \right.
$$
A.3 Resilient ECRM
Finally, consider the resilient version of (PIII)
$$
\hat {\mathrm {P}} _ {R} ^ {\star} = \min  _ {\theta \in \Theta , \mathbf {u} \in \mathbb {R} _ {+} ^ {m}} \quad \hat {J} (\theta) + \frac {\left\| \mathbf {u} \right\| ^ {2}}{2} \tag {PV}
$$
$$
\text {s u b j e c t} \theta_ {1} \geq 1 + \bar {\tau} \theta_ {2} - u _ {1}, \quad \theta_ {2} \leq 1 + \bar {\tau} \theta_ {1} + u _ {2}
$$
and let  $\hat{\theta}_R^\star$  be a solution of (PV). Notice that (PV) is an empirical version of the equivalent formulation in Prop. 4. We consider the value of the problem for each possible element of  $\Theta$ :
- For  $\theta^a$  to be feasible, it must be that  $u_1 \geq (\bar{\tau} + 1)/2$  ( $u_2$ , on the other hand, can be 0). Hence, we have that
$$
\hat {\mathrm {P}} _ {R} ^ {\star} \leq \hat {J} \left(\theta^ {a}\right) + \frac {(\bar {\tau} + 1) ^ {2}}{8}.
$$
- For  $\theta^b$  to be feasible, it must be that  $u_1 \geq \bar{\tau}$  and  $u_2 \geq \bar{\tau}$ . Hence,
$$
\hat {\mathsf {P}} _ {R} ^ {\star} \leq \hat {J} (\theta^ {b}) + \bar {\tau} ^ {2}.
$$
- For  $\theta^c$  to be feasible, it must be that  $u_1 \geq \bar{\tau}/3$  (once again the second constraint need not be relaxed). Hence,
$$
\hat {\mathsf {P}} _ {R} ^ {\star} \leq \hat {J} (\theta^ {c}) + \frac {2 \bar {\tau} ^ {2}}{9}.
$$
- Finally,  $\theta^d$  is feasible for all  $\mathbf{u} \in \mathbb{R}_+^m$ . Hence,
$$
\hat {\mathsf {P}} _ {R} ^ {\star} \leq \hat {J} (\theta^ {d}).
$$
Putting together these conditions, we obtain that for  $\theta^b$  to be optimal, i.e., for  $\hat{J} (\hat{\theta}_R^\star)\to \mathsf{P}_e^\star$ , it must be that
$$
\hat {J} \left(\theta^ {b}\right) + \bar {\tau} ^ {2} \leq \hat {J} \left(\theta^ {a}\right) + \frac {(\bar {\tau} + 1) ^ {2}}{8} \vee \hat {J} \left(\theta^ {c}\right) + \frac {2 \bar {\tau} ^ {2}}{9} \vee \hat {J} \left(\theta^ {d}\right) \tag {10}
$$
From the fact that  $\hat{J}(\theta)$  concentrates around  $J(\theta)$  for  $\theta \in \Theta$  (e.g., by Hoeffding's inequality) and using the values of  $J$  from (9), it holds that there exists  $N_0$  such that  $\theta^b$  is optimal for  $N \geq N_0$  as long as  $|\bar{\tau}| \leq 0.2$ . We therefore conclude that
$$
\mathbb {P} \left[ | J (\hat {\theta} _ {R} ^ {\star}) - \mathsf {P} _ {e} ^ {\star} | \leq 1 / 6 4 \right] \geq \mathbb {P} \left[ \hat {\theta} _ {R} ^ {\star} = \theta^ {b} \right] \geq \mathbb {P} \left[ | \bar {\tau} | \leq 0. 2 \right] \geq 1 - 2 e ^ {- 0. 0 8 N}.
$$
B Convexity of the Perturbation Function for Nonconvex Losses
The definition of resilient equilibrium and all subsequent results in the paper require convexity of the perturbation function  $\tilde{\mathsf{P}}^{\star}(\mathbf{u})$  defined in  $(\tilde{\mathbf{P}}_{\mathbf{u}})$ . This requisite is stated in Assumption 1.
Assumption 1 is well known to hold if the optimization problem  $(\tilde{\mathrm{P}}_{\mathbf{u}})$  is convex, for which it is sufficient for the class  $\mathcal{F}$  to be a convex set and the losses  $\ell_i$  to be convex functions (see, e.g., [40]). If the problem is not parametric, as is, e.g., (P), then assuming the hypothesis class  $\mathcal{F}$  is convex is mild. Consider, e.g., the set  $\mathcal{F}$  to be the intersection of the space of  $\mathcal{D}_i$ -measurable functions. Overall, it is not a significant restriction to assume that the losses are convex since this is the case for typical losses, such as cross entropy and mean squared error<sup>1</sup>.
This convex losses requirement can be relaxed as long as the distributions are well-behaved and the hypothesis class  $\mathcal{F}$  is rich enough. We define these conditions in two technical assumptions. In what follows, we consider the distributions  $\mathcal{D}_i$  are defined over the same probability space  $(\mathcal{X} \times \mathcal{Y}, \Sigma, \mathbb{P}_i)$  for the sigma-algebra  $\Sigma$  and the measures  $\mathbb{P}_i$ .
Assumption 6 (Non-atomic distributions). The set  $\mathcal{V}$  is finite and the conditional random variables  $\mathbf{x} \mid y$  induced by the  $\mathcal{D}_i$  measures are non-atomic. That is, for every measurable event  $Z \in \Sigma$  with strictly positive conditional measure  $\mathbb{P}_{i,\mathbf{x}|y}(Z) > 0$ , there exist an events  $\Sigma \ni Z' \subset Z$  strictly included in  $Z$  with positive conditional measure  $mbP_{i,\mathbf{x}|y}(Z') > 0$ .
Assumption 7 (Decomposable hypothesis class). The set  $\mathcal{F}$  is decomposable in the sense that for all pair of functions  $\phi_1, \phi_2 \in \mathcal{F}$  and all measurable set  $Z \in \Sigma$ , it holds that  $\bar{\phi} \in \mathcal{F}$  for
$$
\bar {\phi} (x) = \left\{ \begin{array}{l l} \phi_ {1} (x), & x \in Z \\ \phi_ {2} (x), & x \notin Z \end{array} \right.
$$
Assumption 6 requires data probability distributions in which all points have zero measure. Assumption 7 requires hypothesis classes that are closed under "cutting and stitching" of functions.
In turns out that Assumptions 6 and 7 are enough to guarantee that the perturbation function is convex. In particular, they imply the following result [38, Lemma A.1].
Lemma 1. Define the cost constraint epigraph of  $(\tilde{\mathbf{P}}_{\mathbf{u}})$  to be the set
$$
\mathcal {C} = \left\{\left[ s _ {0}; \mathbf {s} \right] \in \mathbb {R} ^ {m + 1} \mid \exists \phi \in \mathcal {F} \text {s u c h t h a t} \mathbb {E} _ {\mathcal {D} _ {i}} \left[ \ell_ {i} (\phi (\mathbf {x}), y) \right] \leq s _ {i} i = 0, \dots , m \right\}. \tag {11}
$$
Under Assumptions 6 and 7, the set  $\mathcal{C}$  is convex.
Notice that Lemma 1 does not require the losses  $\ell_{i}$  to be convex for the cost-constraint epigraph to be convex. This is a significant fact since it implies that the perturbation function of  $(\tilde{\mathbf{P}}_{\mathbf{u}})$  is also convex, as we show next.
Proposition 5. Consider the perturbation function  $\tilde{\mathsf{P}}^{\star}(\mathbf{u})$  defined in  $(\tilde{\mathbf{P}}_{\mathbf{u}})$ . Under Assumptions 6 and 7,  $\tilde{\mathsf{P}}^{\star}(\mathbf{u})$  is convex.
Proof. Let  $\mathbf{v}$  and  $\mathbf{w}$  be two perturbations of  $(\tilde{\mathrm{P}}_{\mathbf{u}})$  and define the convex combination perturbation  $\mathbf{u}_a = a\mathbf{v} + (1 - a)\mathbf{w}$  for some  $a \in [0,1]$ . To prove that  $\tilde{\mathrm{P}}^{\star}(\mathbf{u})$  is convex we need to show that  $\tilde{\mathrm{P}}^{\star}(\mathbf{u}_a) \leq a\tilde{\mathrm{P}}^{\star}(\mathbf{v}) + (1 - a)\tilde{\mathrm{P}}^{\star}(\mathbf{w})$  for all  $a$ .
If either  $\mathbf{v}$  or  $\mathbf{w}$  yield infeasible problems we have  $\tilde{\mathrm{P}}^{\star}(\mathbf{v}) = \infty$  or  $\tilde{\mathrm{P}}^{\star}(\mathbf{w}) = \infty$ . In this case,  $\tilde{\mathrm{P}}^{\star}(\mathbf{u}_a) \leq a\tilde{\mathrm{P}}^{\star}(\mathbf{v}) + (1 - a)\tilde{\mathrm{P}}^{\star}(\mathbf{w}) = \infty$ . In the more interesting case where  $\mathbf{v}$  and  $\mathbf{w}$  both yield feasible problems, we have that
$$
[ \tilde {\mathbf {P}} ^ {\star} (\mathbf {v}); \mathbf {v} ] \in \mathcal {C} \quad \text {a n d} \quad [ \tilde {\mathbf {P}} ^ {\star} (\mathbf {w}); \mathbf {w} ] \in \mathcal {C}, \tag {12}
$$
for  $\mathcal{C}$  defined in (11). Indeed, any  $\phi_{\mathbf{v}}^{\star}$  that solves  $(\tilde{\mathrm{P}}_{\mathbf{v}})$  must satisfy  $\mathbb{E}_{\mathfrak{D}_i}[\ell_i(\phi_{\mathbf{v}}^\star (\mathbf{x}),y)]\leq u_i$  for  $i > 0$  and  $\mathbb{E}_{\mathfrak{D}_0}[\ell_0(\phi_{\mathbf{v}}^\star (\mathbf{x}),y)] = \tilde{\mathrm{P}}^\star (\mathbf{v})$ . Likewise for a function  $\phi_{\mathbf{w}}^{\star}$  that solves  $(\tilde{\mathrm{P}}_{\mathbf{w}})$ .
Under Assumptions 6 and 7, we can combine (12) and Lemma 1 to get that
$$
a \left[ \tilde {\mathbf {P}} ^ {\star} (\mathbf {v}); \mathbf {v} \right] + (1 - a) \left[ \tilde {\mathbf {P}} ^ {\star} (\mathbf {w}); \mathbf {w} \right] \in \mathcal {C}, \quad \text {f o r a l l} a \in [ 0, 1 ]. \tag {13}
$$
It is only when dealing with the parametrized  $\mathcal{F}_{\theta}$  that the composition of the parametrization with the loss may lead to a convex function of the decision variable  $\theta$
For this to hold, the definition of  $\mathcal{C}$  in (11) implies that there exists a function  $\phi_a\in \mathcal{F}$  such that
$$
\mathbb {E} \left[ \ell_ {0} \left(\phi_ {a} (\mathbf {x}), y\right) \right] \leq a \tilde {\mathbf {P}} ^ {\star} (\mathbf {v}) + (1 - a) \tilde {\mathbf {P}} ^ {\star} (\mathbf {w}) \quad \text {a n d} \tag {14a}
$$
$$
\mathbb {E} \left[ \ell_ {i} \left(\phi_ {a} (\mathbf {x}), y\right) \right] \leq a u _ {i} + (1 - a) v _ {i}, \quad \text {f o r} i = 1, \dots , m. \tag {14b}
$$
From (14b) we obtain that  $\phi_{a}$  is feasible for  $(\tilde{\mathbf{P}}_{\mathbf{u}_a})$ . Hence, it is a suboptimal solution of  $(\tilde{\mathbf{P}}_{\mathbf{u}_a})$ , which implies that
$$
\tilde {\mathbf {P}} ^ {\star} (\mathbf {u} _ {a}) \leq \mathbb {E} \left[ \ell_ {0} \left(\phi_ {a} (\mathbf {x}), y\right) \right] \leq a \tilde {\mathbf {P}} ^ {\star} (\mathbf {v}) + (1 - a) \tilde {\mathbf {P}} ^ {\star} (\mathbf {w}), \tag {15}
$$
thus concluding the proof.
Proposition 5 shows that the perturbation function  $\tilde{\mathbf{P}}^{\star}(\mathbf{u})$  can be convex even when  $(\tilde{\mathbf{P}}_{\mathbf{u}})$  is defined based on non-convex losses. In the context of resilient learning, this is important because it allows us to quantify the variations of the perturbation function, which is the basis for the resilient equilibrium from Def. 1.
The convexity of the perturbation function  $\tilde{\mathbb{P}}^{\star}(\mathbf{u})$  is also relevant because, under a constraint qualification such as the one stated in Assumption 2, it implies that the optimization problem is strongly dual. We encapsulate this result in the next lemma since it will be used in subsequent derivations.
Lemma 2. Suppose  $\tilde{\mathbf{P}}^{\star}(\mathbf{u})$  associated to  $(\tilde{\mathbf{P}}_{\mathbf{u}})$  is convex (Assumption 1) and there exists  $\phi \in \mathcal{F}$  strictly feasible for  $(\tilde{\mathbf{P}}_0)$  (Assumption 2). Then, strong duality holds for  $(\tilde{\mathbf{P}}_{\mathbf{u}})$ , i.e.,  $\tilde{\mathbf{P}}^{\star} = \tilde{\mathbf{D}}^{\star}$ .
Proof. The result follows from [50, Thm. 15] since the constraint qualification in Assumption (2) implies that  $\tilde{\mathbb{P}}^{\star}$  is lower semi-continuous [50, Thm. 18(a)], i.e., that its epigraph is closed [51, Prop. 1.1.2].
C Proof of Thm. 1
The proof is divided in three steps that transform the resilient functional dual problem (PRES) into the resilient, parametrized, empirical dual problem (D-RES). Explicitly, define the Lagrangian of (P-RES) as
$$
\tilde {L} _ {\mathrm {R}} (\phi , \boldsymbol {\lambda}; \mathbf {u}) = \mathbb {E} _ {\mathcal {D} _ {0}} \left[ \ell_ {0} (\phi (\mathbf {x}), y) \right] + h (\mathbf {u}) + \sum_ {i = 1} ^ {m} \lambda_ {i} \left(\mathbb {E} _ {\mathcal {D} _ {i}} \left[ \ell_ {i} (\phi (\mathbf {x}), y) \right] - u _ {i}\right) \tag {16}
$$
and its dual problem as
$$
\tilde {D} _ {R} ^ {\star} = \max  _ {\boldsymbol {\lambda} \in \mathbb {R} _ {+} ^ {m}} \min  _ {\phi \in \mathcal {F}, \mathbf {u} \in \mathbb {R} _ {+} ^ {m}} \tilde {L} _ {R} (\phi , \boldsymbol {\lambda}; \mathbf {u}). \tag {D-RES}
$$
First, from lemma 2 we have that if assumption 1 and assumption 2 hold then the problem is strongly dual, i.e.,  $\tilde{\mathsf{P}}_{\mathbb{R}}^{\star} = \tilde{\mathsf{D}}_{\mathbb{R}}^{\star}$ .
Then, to relate (D-RES) to its parametrized, empirical version ( $\hat{\mathrm{D}}$ -RES), we begin by approximating  $\mathcal{F}$  by  $\mathcal{F}_{\theta}$ . Explicitly, we consider the difference between  $\hat{\mathrm{P}}_{\mathrm{R}}^{\star}$  and
$$
\tilde {\mathrm {D}} _ {\theta} ^ {\star} = \max  _ {\boldsymbol {\lambda} \in \mathbb {R} _ {+} ^ {m}} \min  _ {\theta \in \Theta , \mathbf {u} \in \mathbb {R} _ {+} ^ {m}} \tilde {L} _ {\mathrm {R}} \left(f _ {\theta}, \boldsymbol {\lambda}; \mathbf {u}\right). \tag {D_{\theta}-\mathrm{RES}}
$$
This difference, which we call the approximation error, is bounded in the following proposition:
Proposition 6. Under Assumptions 1-2, it holds that
$$
\tilde {\mathrm {P}} _ {\mathrm {R}} ^ {\star} \leq \tilde {\mathrm {D}} _ {\theta} ^ {\star} \leq \tilde {\mathrm {P}} _ {\mathrm {R}} ^ {\star} + h (\mathbf {u} ^ {\star} + \mathbb {1} \cdot M \nu) - h (\mathbf {u} ^ {\star}) + M \nu , \tag {17}
$$
for  $\tilde{\mathrm{P}}_{\mathbb{R}}^{\star}$  and  $\mathbf{u}^{\star}$  as in (P-RES) and  $\tilde{\mathrm{D}}_{\theta}^{\star}$  as in (D  $_{\theta}$  -RES).
The proof of Prop. 6 is deferred to Sec. C.1. We proceed by replacing the expectations in  $(\mathrm{D}_{\theta}\text{-RES})$  by empirical averages, leading to a generalization error bounded as follows:
Proposition 7. Let  $\tilde{\mathrm{D}}_{\theta}^{\star}$  be the value of the parametrized dual problem  $(\mathrm{D}_{\theta}\text{-RES})$  achieved for a Lagrange multiplier  $\lambda^{\star}$  and  $\hat{\mathrm{D}}_{\mathrm{R}}^{\star}$  be the value of the empirical, parametrized dual problem (D-RES) achieved for a Lagrange multiplier  $\hat{\lambda}^{\star}$ . Under Assumption (5), it holds that
$$
\left| \tilde {\mathrm {D}} _ {\theta} ^ {\star} - \hat {\mathrm {D}} _ {\mathrm {R}} ^ {\star} \right| \leq (1 + \Delta) \xi (N, \delta) \tag {18}
$$
with probability  $1 - 2(m + 1)\delta$ , where  $\Delta = \max \left(\|\lambda^{\star}\|_{1},\|\hat{\lambda}^{\star}\|_{1}\right)$ .