SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Next, we compound the bounds for  $\mathcal{R}(\mathcal{F}_Z)$ . The optimum  $\alpha > 0$  in the first line of (4.2) is the one for which  $\frac{n}{9} = \ln \mathcal{N}(\mathcal{F},\alpha,\| \cdot \|_{\infty})$ . Keeping in mind (4.6), we choose  $\alpha = \mathrm{diam}(\mathcal{Z})n^{-\frac{1}{\mathrm{ddim}\mathcal{Z}}}$  in (4.2), which gives (abbreviating  $d = \mathrm{ddim}\mathcal{Z}$ ,  $D = \mathrm{diam}\mathcal{Z}$ )
$$
\begin{array}{l} \mathcal {R} (\mathcal {F} _ {Z}) \lesssim D / n ^ {1 / d} + n ^ {- 1 / 2} \int_ {D n ^ {- 1 / d}} ^ {\infty} (D / t) ^ {d / 2} d t = D / n ^ {1 / d} + (D / n) ^ {1 / 2} \int_ {n ^ {- 1 / d}} ^ {\infty} \tau^ {- d / 2} d \tau \\ = \frac {D}{n ^ {1 / d}} \left(1 + \frac {2}{d - 2}\right). \\ \end{array}
$$
Now the last equation and equation (A.1) yield the claim.
A.1.2 Proof of Proposition 4.2
We start with a preliminary result under hypotheses of strict equivariance. In this case, we are able to use a change of variables to reduce the generalization error formula to an equivalent one depending only on a measurable choice of  $G$ -orbit representatives of elements from  $\mathcal{Z}$ :
Proposition A.1. Let  $\mathcal{F}$  be a set of  $G$ -invariant functions, and let  $\mathcal{Z}^0 \subset \mathcal{Z}$  be a choice of  $G$ -orbit representatives for points in  $\mathcal{Z}$ , such that  $\iota^0: \mathcal{Z} \to \mathcal{Z}^0$  associating to each  $z \in \mathcal{Z}$  its orbit representative  $z^0$ , is Borel measurable. Let  $\mathcal{F}^0 := \{f|_{\mathcal{Z}^0}: f \in \mathcal{F}\}$  and denote by  $\iota^0(\mathcal{D})$  the image measure of  $\mathcal{D}$ . Then for each  $n \in \mathbb{N}$  if  $\{Z_i\}_{i=1}^n$  are i.i.d. samples with  $Z_i \sim \mathcal{D}$  and  $Z_i^0 := \iota^0 \circ Z_i$ , we have
$$
\operatorname {G e n E r r} \left(\mathcal {F}, \left\{Z _ {i} \right\}, \mathcal {D}\right) = \operatorname {G e n E r r} ^ {(G)} \left(\mathcal {F}, \left\{Z _ {i} \right\}, \mathcal {D}\right) = \operatorname {G e n E r r} \left(\mathcal {F} ^ {0}, \left\{Z _ {i} ^ {0} \right\}, \iota^ {0} (\mathcal {D})\right).
$$
Proof. For the first equality, we use the definition of  $\mathsf{GenErr}$  and the change of variable formula (3.1) and the fact that  $G$ -invariant functions  $f$  satisfy  $f(Z) = \mathbb{E}_g[f(g\cdot Z)]$ . For the second equality, note that by hypothesis, for each  $f\in \mathcal{F}$  we have  $f(z) = f(g\cdot z)$  for all  $g\in G,z\in \mathcal{Z}$ , in particular  $f(z) = f(\iota^0 (z))$  and we conclude by a change of variable by the map  $\iota^0$  in the expectations from the definition of  $\mathsf{GenErr}^{(G)}$ .
Now the proof Proposition 4.2 combines the above idea with a simple extra step:
Proof of Proposition 4.2: The proof uses the triangular inequality. For  $f \in \mathcal{F}$  and  $g \in \mathrm{Stab}_{\epsilon}$ , we have:
$$
| P f - P _ {n} f | = \left| \mathbb {E} [ f (Z) ] - \frac {1}{n} \sum_ {i = 1} ^ {n} f (Z _ {i}) \right| \leq \left| \mathbb {E} [ g \cdot f (Z) ] - \frac {1}{n} \sum_ {i = 1} ^ {n} g \cdot f (Z _ {i}) \right| + 2 \| g \cdot f - f \| _ {\infty}.
$$
By averaging over  $g \in \mathsf{Stab}_{\epsilon}$ , we obtain the inequality in the statement of the proposition. The equality follows by a change of variable via map  $\iota_{\epsilon}^{0}$ , exactly as in the strategy of Proposition A.1.
A.1.3 Proof of Corollary 4.3 and of the more general result of Theorem A.3
In order to make the treatment better digestible, we first consider the intuitively simpler case of strict equivariance, and then describe how to extend it to the more general case of approximate and partial equivariance. In this case, if we restrict our equivariant functions to only the space of orbit representatives  $\mathcal{Z}^0$ , the dimension counts from classical generalization bounds of Proposition 4.1 improve as follows:
Corollary A.2. Assume that  $\mathcal{F}$  is composed of  $G$ -invariant functions and that  $d_0 \coloneqq \mathrm{ddim}(\mathcal{Z}^0) > 2$ . Also, denote  $D_0 \coloneqq \mathrm{diam}(\mathcal{Z}^0)$ . With the same notation as in Proposition A.1 and with the hypotheses of Proposition 4.1, for any probability distribution  $\mathcal{D}$  over  $\mathcal{Z}$ , the following holds with probability at least  $1 - \delta$ :
$$
\operatorname {G e n E r r} (\mathcal {F}, \{Z _ {i} \}, \mathcal {D}) \lesssim \frac {d _ {0}}{d _ {0} - 2} \left(\frac {D _ {0} ^ {d _ {0}}}{n}\right) ^ {1 / d _ {0}} + n ^ {- 1 / 2} \sqrt {\| \mathcal {F} \| _ {\infty} \log (2 / \delta)}.
$$
Proof. Due to Proposition A.1, we only need to bound  $\mathsf{GenErr}(\mathcal{F}^0,\{Z_i^0\},\iota^0 (\mathcal{D}))$ . Thus it suffices to apply Proposition 4.1 for the above function. We note that  $\| \mathcal{F}^0\|_{\infty}\leq \| \mathcal{F}\|_{\infty}$  to conclude.
The drawback of the above Corollary, is that it leaves open the question of how to actually bound the diameter and dimension of  $\mathcal{Z}^0$ , on which we do not have direct control. The next steps we take consist precisely in translating the information from properties of  $G$  to relevant properties of  $\mathcal{Z}^0$ .
A first, simpler, approach could be the following. Under the reasonable assumption that  $\mathcal{Z},\mathcal{Z}^0$  have diameter greater than 1, the leading term on the left in Corollary A.2 is  $n^{-1 / d_0}$ . Thus the optimal choices of  $\mathcal{Z}^0$  are those which minimize the doubling dimension  $d_0 = \mathrm{ddim}(\mathcal{Z}^0)$  amongst sets of representatives of  $G$ -orbits. This is a weak regularity assumption, implying that we want  $\mathcal{Z}^0$  to not oscillate wildly. The effect of  $G$  on coverings is evident in case  $G$ ,  $\mathcal{Z}^0$  are manifolds, and  $\mathcal{Z} = \mathcal{Z}^0\times G$  (see (A.3) for the strictly equivariant case, and the more general (A.5) for the general case). Since  $\mathrm{ddim}$  coincides with topological dimension, we immediately have
In order to include more general situations, we now describe a second, more in-depth approach. We take a step back and rather than addressing direct diameter and dimension bounds for  $\mathcal{Z}^0$ , we go "back to the source" of Proposition 4.1. We update the bounds on covering numbers of  $\mathcal{Z}^0$ , directly in terms of the  $G$ -action and of  $\mathcal{Z}$ . The ensuing framework is robust enough to later include, after a few adjustments, also the cases of partial and approximate equivariance. Here is our fundamental bound, which generalizes and extends [51, Thm.3].
Theorem A.3. Assume that  $\mathcal{Z}$  is a metric space with distance  $d$  and  $S\subset G$  is a subset of a metric group  $G$  consisting of transformations  $g:\mathcal{Z}\to \mathcal{Z}$  (with action denoted  $g\cdot z\coloneqq g(z)$ ) for which there exists a choice of  $S$ -orbit representatives  $\mathcal{Z}_0\subset \mathcal{Z}$  and a distance function  $\mathbf{d}$  on  $S$  satisfying the following for  $L,L^{\prime}\in (0, + \infty ]$  (with the conventions  $1 / + \infty \coloneqq 0$  and  $\mathcal{N}(X,0)\coloneqq +\infty ,\mathcal{N}(X, + \infty)\coloneqq 0$ ):
1. For all  $z_0, z_0' \in \mathcal{Z}_0$  and all  $g \in S$  it holds that  $\frac{1}{L} \mathsf{d}(z_0, z_0') \leq \mathsf{d}(g \cdot z_0, g \cdot z_0') \leq L' \mathsf{d}(z_0, z_0')$ .
2. For all  $g, g' \in S$  and  $z_0, z_0' \in \mathcal{Z}_0$  it holds that  $\frac{1}{L} \mathsf{d}_G(g, g') \leq \mathsf{d}(g \cdot z_0, g' \cdot z_0') \leq L' \mathsf{d}_G(g, g')$ .
Then for each  $\delta' > 0$  the following holds
$$
\mathcal {N} \left(\mathcal {Z} _ {0}, 2 \delta^ {\prime} L\right) \mathcal {N} \left(S, 2 \delta^ {\prime} L\right) \leq \mathcal {N} \left(\mathcal {Z}, \delta^ {\prime}\right) \leq \mathcal {N} \left(\mathcal {Z} _ {0}, \delta^ {\prime} / 2 L ^ {\prime}\right) \mathcal {N} \left(S, \delta^ {\prime} / 2 L ^ {\prime}\right). \tag {A.2}
$$
Before the proof, we observe how Corollary 4.3 can be recovered using the choice  $L > 0$ ,  $L' = +\infty$  in Theorem A.3:
Proof of Corollary 4.3: We apply Theorem A.3 to  $S = \mathsf{Stab}_{\epsilon}$  and  $\mathcal{Z}_0 = \mathcal{Z}_\epsilon^0$  as in the corollary statement. Then we take  $\delta = 2L\delta'$  in the conclusion (A.2), and consider only the lower bound inequality, which directly gives the claim of the corollary.
Proof of Theorem A.3: In this proof, we will denote a minimal  $\alpha$ -ball cover of a metric space  $X$  by  $X_{\alpha}$ .
Note that we are not assuming  $G$  to be a group, but due to lower bound in property 1. it follows that  $z_0 \mapsto g \cdot z_0$  is injective (for  $z_0 \neq z_0'$  we have  $\mathsf{d}(z_0, z_0') > 0$  and thus  $g \cdot z_0 \neq g \cdot z_0'$ ), and when below we write "  $g^{-1}$ " this has to be interpreted as the inverse of the  $g$ -action, restricted to its image.
Further, note that the case when one of  $L, L'$  is  $+\infty$ , corresponds to removing the part of the assumptions (and of the conclusions) involving that value, thus we only consider the case of finite  $L'$  and finite  $L$ .
On fixing an arbitrary point  $z \in \mathcal{Z}$ , we can write  $z = g \cdot z_0$  for a suitable  $g \in G, z_0 \in \mathcal{Z}^0$ . Let  $\eta := \delta'/2L'$ . For fixed covers  $\mathcal{Z}_{\eta}^0$ ,  $G_{\eta}$ , there exists a point  $z_0' \in \mathcal{Z}_{\eta}^0$  with  $\mathsf{d}(z_0', z_0) < \eta$  and  $g' \in G_{\eta}$  with  $\mathsf{d}_G(g', g) < \eta$ . Thus by property 1. we have  $\mathsf{d}(g \cdot z_0', z) < L' \eta = \epsilon/2$  and by property 2. we have  $\mathsf{d}(g' \cdot z_0', g \cdot z_0') < L' \eta = \delta'/2$ . By the triangle inequality,  $\mathsf{d}(g' \cdot z_0', z) < \delta'$  and thus  $G_{\eta} \cdot \mathcal{Z}_{\eta}^0$  is an  $\delta'$ -cover of  $\mathcal{Z}$ . Thus we have
$$
\mathcal {N} \left(\mathcal {Z}, \delta^ {\prime}\right) \leq \# G _ {\delta^ {\prime} / 2 L ^ {\prime}} \# \mathcal {Z} _ {\delta^ {\prime} / 2 L ^ {\prime}} ^ {0},
$$
optimizing over the cardinalities on the right hand side yields the second inequality in (A.2).
Now consider an  $\delta'$ -cover  $\mathcal{Z}_{\delta'}$  of  $\mathcal{Z}$ , and for  $\eta = 2\delta L$  consider an  $\eta$ -cover  $G_{\eta}$  of  $G$ . We find that for each  $z \in \mathcal{Z}_{\delta'}$ , there exists at most one  $g \in G_{\eta}$  such that  $\mathrm{dist}(z, g \cdot \mathcal{Z}_0) < \eta / 2L = \delta'$ . Notice that if this were false, we could use the triangle inequality and contradict property 2. in the statement. For each  $g \in G_{\eta}$  denote  $Z_g$  the set of such points  $z \in \mathcal{Z}_{\delta'}$  such that there exists  $x \in g \cdot \mathcal{Z}^0$ , and assign exactly one such  $x = x(z)$  to each  $z$ , forming a set  $X_g$  of all such  $x(z)$ . Any other point  $x' \in g \cdot \mathcal{Z}^0$  such that  $\mathsf{d}(x', z) < \delta'$  then satisfies  $\mathsf{d}(x', x) < 2\delta'$  by triangle inequality, and thus  $X_g$  is a  $2\delta'$ -cover of  $g \cdot \mathcal{Z}_0$ . If for  $g \cdot z_0 \in g \cdot \mathcal{X}_0$  the point  $x \in g \cdot \mathcal{X}_0$  satisfies  $\mathsf{d}(g \cdot z_0, x) < 2\delta'$ , then by property 1. in the statement we have  $\mathsf{d}(z_0, g^{-1} \cdot x) < 2\delta' L$ , and thus  $g^{-1} \cdot X_g$  is a  $2\delta' L$ -cover of  $\mathcal{Z}_0$ , having the same cardinality as  $Z_g$ . We then compute as follows, proving the first inequality in (A.2):
$$
\mathcal {N} (\mathcal {Z}, \delta^ {\prime}) \geq \sum_ {g \in G _ {\eta}} \# Z _ {g} = \sum_ {g \in G _ {\eta}} \# (g ^ {- 1} \cdot X _ {g}) \geq \mathcal {N} (G, 2 \delta^ {\prime} L) \mathcal {N} (\mathcal {Z} _ {0}, 2 \delta^ {\prime} L).
$$
A.1.4 Proof of Theorem 4.4
As before, we focus again first on the exact equivariance case, where Theorem A.4 is the direct analogue to (or special case of) Theorem 4.4.
Under the hypotheses of Theorem A.3 on the  $G$ -action, we directly obtain the following, for the strictly equivariant case:
$$
\mathcal {N} \left(\mathcal {Z} _ {0}, \delta\right) \leq \frac {\mathcal {N} \left(\mathcal {Z} , \delta / 2 L\right)}{\mathcal {N} (G , \delta)}. \tag {A.3}
$$
We next impose that for  $\delta \lesssim \mathrm{diam}(G)$  the group  $G$  satisfies the natural "volume growth" assumption, where for compact groups  $\mathrm{Vol}(G)$  is its  $\dim(G)$ -dimensional Hausdorff measure and  $\dim(G)$  is the usual Hausdorff dimension, and for finite groups we use minimum separation notation  $\delta_G > 0$  as defined in (4.4):
$$
\text {A s s u m p t i o n :} \quad \mathcal {N} (G, \delta) \gtrsim \left\{ \begin{array}{l l} \# G / (\max  \{\delta , \delta_ {G} \}) ^ {\mathrm {d d i m} (G)}, & \text {i f} G \text {f i n i t e}, \\ \operatorname {V o l} (G) / \delta^ {\dim G}, & \text {i f} \dim G > 0. \end{array} \right. \tag {A.4}
$$
Similarly to Proposition 4.1, we then get the following, in which the leading term in the bound has exponent figuring  $d_0 = \mathsf{ddim}(\mathcal{Z}) - \mathsf{dim}(G)$ . Recall that  $\mathsf{dim}(G) = 0$  for finite groups, thus the distinction can be made directly in terms of the dimension of  $G$ .
Theorem A.4. Let  $\delta > 0$  be fixed. Assume that for a given ambient group  $G$  the group  $G$  satisfies assumption (A.4) and that its action satisfies the assumptions 1. and 2. of Theorem A.3 for some finite  $L > 0$  and  $L' = +\infty$ . We denote  $d_G = \mathsf{ddim}(G)$  if  $G$  is a discrete group and  $d_G = \mathsf{dim}(G)$  if  $G$  is compact and non-discrete, and  $d = \mathsf{ddim}(\mathcal{Z})$ . Further assume  $d_0 := d - d_G > 2$ . Furthermore, set  $|G| := \mathsf{Vol}(G)$  if  $\mathsf{dim}G > 0$  and  $|G| := \# G$  for finite  $G$ . Then with the notations of Proposition 4.1 we have with probability  $\geq 1 - \delta$
$$
\operatorname {G e n E r r} \left(\mathcal {F}, \left\{Z _ {i} \right\}, \mathcal {D}\right) \lesssim n ^ {- 1 / 2} \sqrt {\| \mathcal {F} \| _ {\infty} \log (2 / \delta)} + (E),
$$
$$
(E) := \left\{ \begin{array}{l l} \frac {d _ {0}}{d _ {0} - 2} \delta_ {G} ^ {- d _ {0} / 2 + 1} \left(\frac {(2 L) ^ {d} D ^ {d}}{| G | n}\right) ^ {1 / 2} & \text {i f G i s f i n i t e a n d (2 L) ^ {d} D ^ {d} <   | G | n   \delta_ {G} ^ {d _ {0}}}, \\ \frac {d _ {0}}{d _ {0} - 2} \left(\frac {(2 L) ^ {d} D ^ {d}}{| G | n}\right) ^ {1 / d _ {0}} & \text {o t h e r w i s e}. \end{array} \right.
$$
Proof. We follow the same computation as Proposition 4.1, but use Proposition A.1 in order to reduce to restrictions of functions to  $\mathcal{Z}^0$ . In this case, using (A.3) and assumption (A.4), and with notation as in our statement, we will have:
$$
\mathcal {N} \left(\mathcal {Z} _ {0}, t\right) \lesssim \frac {(2 L) ^ {d} D ^ {d}}{| G |} \max  \left\{\delta_ {G}, t \right\} ^ {- d _ {0}},
$$
where we have  $\delta_G = 0$  for  $\dim G > 0$ . We set  $C \coloneqq \frac{(2L)^dD^d}{|G|}$  for simplicity of notation. In case  $C\delta_G^{d_0} < 1$  (which includes the case  $\dim G > 0$ ), we take  $\alpha = (C / n)^{1 / d_0}$  in the Dudley integral (4.2) and find
$$
\mathcal {R} (\mathcal {F} _ {Z ^ {0}}) \lesssim \alpha + n ^ {- 1 / 2} \int_ {\alpha} ^ {\infty} \sqrt {C t ^ {- d _ {0}}} d t,
$$
from which the proof goes exactly as in Proposition 4.1, with  $C$  replacing  $D^{d}$ , and we get the second option for the value of  $(E)$  as given in our statement. In case  $C\delta_{G}^{d_{0}} < 1$  instead we take  $\alpha = 0$  and our above bound for  $\mathcal{N}(\mathcal{Z}_0,t)$  plugged into (4.2) (recalling the notation for  $C$ ):
$$
\mathcal {R} (\mathcal {F} _ {Z ^ {0}}) \lesssim \int_ {0} ^ {\infty} \sqrt {C \max \{\delta_ {G} , t \} ^ {- d _ {0}}} d t = \delta_ {G} ^ {- d _ {0} / 2 + 1} \sqrt {C / n} + \sqrt {C / n} \int_ {\delta_ {G}} ^ {\infty} t ^ {- d _ {0} / 2} d t,
$$
from which the second case of the value of  $(E)$  follows by direct computation.
Now the proof of Theorem 4.4 proceeds in exactly the same manner as the above. Below we explain the required adaptations:
Proof of Theorem 4.4: The following updates are the principal adaptations required for the above proof of Theorem A.4:
- The role of  $G$  should be replaced by  $\mathsf{Stab}_{\epsilon}$ , except for the fact that parameters  $\delta_G, d_G$  remain unchanged (i.e. we use their values corresponding to "ambient" group  $G$  rather than those for  $\mathsf{Stab}_{\epsilon}$ ).
- The  $G$ -orbit representative set  $\mathcal{Z}^0$  then should be replaced by representatives  $\mathcal{Z}_{\epsilon}^{0}$  for orbits of  $\mathsf{Stab}_{\epsilon}$ .
With these changes, assumption (A.4) implies its more general version, assumption (4.7). Indeed,  $|G|$  equals  $\# G$  for finite  $G$  and  $\mathsf{Vol}(G)$  for compact  $G$ , and  $\delta_G > 0$  only in the first case. Furthermore, we have  $\delta_{\mathsf{Stab}_{\epsilon}} \geq \delta_G$  as a direct consequence of  $\mathsf{Stab}_{\epsilon} \subseteq G$ .
We observe that Corollary 4.3 (which also is obtained from Theorem A.3 with the above two main substitutions) directly gives the version of Theorem (A.3) required to get the correct replacement of (A.3) under our initially declared two substitutions. We get:
$$
\mathcal {N} \left(\mathcal {Z} _ {\epsilon} ^ {0}, \delta\right) \leq \frac {\mathcal {N} \left(\mathcal {Z} , \delta / 2 L\right)}{\mathcal {N} \left(\operatorname {S t a b} _ {\epsilon} , \delta\right)}. \tag {A.5}
$$
With the above changes, the proof follows by exactly the same steps as in the above proof of Theorem A.4.
Remark A.5. Note that, as might be evident from the last proof, we could have introduced new more precise parameters to keep track of dimensionality and minimum separation for  $\mathsf{Stab}_{\epsilon}$  rather than formulating assumption (4.7) in terms of  $d_G, \delta_G$ . This is justified for the aims of this work. Indeed, all the main situations of interest to us are those in which  $\mathsf{Stab}_{\epsilon}$  is a "large" subset of  $G$ , i.e. it has dimension  $d_G$ , and in all our examples for finite groups  $\delta_G > 0$ , the minimum separation for  $\mathsf{Stab}_{\epsilon}$  is within a small factor of  $\delta_G$  itself.
A.2 Proof of Proposition 5.1
Proof. We have that  $Z = (X, Y)$  is a data distribution in which by our assumption 2. Proceeding the proposition, we have that almost surely  $Y = y^{*}(X)$  for a deterministic function  $y^{*}$ . With this notation, we may write
$$
\mathbb {E} _ {Z} [ f (Z) ] = \mathbb {E} _ {X _ {\epsilon} ^ {0}} \mathbb {E} _ {g | X _ {\epsilon} ^ {0}} [ f (g \cdot X _ {\epsilon} ^ {0}, y ^ {*} (g \cdot X _ {\epsilon} ^ {0}) ].
$$
Recalling that we restrict to functions of the form  $f(x,y) = \ell(\widetilde{f}(x),y) = \mathsf{d}_{\mathcal{Y}}(\widetilde{f}(x),y)^2$ , we first consider the precise equivariance case  $\epsilon = 0$ . In this case for  $g \in \mathsf{Stab}_{\epsilon}(\mathcal{F})$  we find also  $\widetilde{f}(g \cdot X_{\epsilon}^{0}) = g \cdot \widetilde{f}(X_{\epsilon}^{0})$  and thus when optimizing over  $\widetilde{f}$  we have to determine the optimal value of  $y = \widetilde{f}(X_{\epsilon}^{0})$  to be associate to each  $X_{\epsilon}^{0}$ . Thus as a consequence of all the above, if  $\widetilde{\mathcal{F}}$  would be the class of all precisely  $\mathsf{Stab}_{\epsilon}$ -equivariant measurable functions, we would get the following rewriting:
$$
\operatorname {A p p G a p} (\mathcal {F}, \mathcal {D}) = \min  _ {\widetilde {f} \in \widetilde {\mathcal {F}}} \mathbb {E} _ {Z} [ \mathrm {d} \mathcal {Y} (\widetilde {f} (X), y ^ {*} (X) ] = \mathbb {E} _ {X _ {\epsilon} ^ {0}} \min  _ {y \in \mathcal {Y}} \mathbb {E} _ {g | X _ {\epsilon} ^ {0}} [ \mathrm {d} \mathcal {Y} (g \cdot y, y ^ {*} (g \cdot X _ {\epsilon} ^ {0}) ^ {2} ]. \tag {A.6}
$$
For  $\epsilon > 0$ , for each fixed  $X_{\epsilon}^{0} = x_{\epsilon}^{0}$  we may further perturb the associated  $y = \widetilde{f}(x_{\epsilon}^{0})$  by at most  $\epsilon$  in the direction of  $y^{*}(X_{\epsilon}^{0})$ , while still obtaining a measurable function with approximation  $\ell_{\infty}$ -norm error bounded by  $\epsilon$ , thus the above bound is improved to
$$
\operatorname {A p p E r r} (\mathcal {F}, \mathcal {D}) \leq \mathbb {E} _ {X _ {\epsilon} ^ {0}} \min  _ {y} \mathbb {E} _ {g | X _ {\epsilon} ^ {0}} \left[ \left(\mathrm {d} y (g \cdot y, y ^ {*} (g \cdot X _ {\epsilon} ^ {0})) - \epsilon\right) _ {+} ^ {2} \right], \tag {A.7}
$$
as desired. In case  $\widetilde{\mathcal{F}}$  contains a strict subset of measurable invariant functions with error  $\epsilon$ , we would only get an inequality instead of the first equality in (A.6) but we still have the same bound as in (A.7), and thus the proof is complete.
A.3 Proof of Theorem 5.2
Proof. We use the isodiametric inequality (5.1) in  $G$ , applying it to  $\mathsf{Stab}_{\epsilon}(\mathcal{F})$  for  $\mathcal{F}\in \mathcal{C}_{\epsilon ,\lambda}$ . Then by taking  $\mathsf{Stab}_{\epsilon}(\mathcal{F}) = X$  which is optimal for inequality (5.1) we can saturate the two bounds (modulo discretization errors for discrete  $G$ ) and we get
$$
\frac {| \operatorname {S t a b} _ {\epsilon} (\mathcal {F}) |}{| G |} \simeq \lambda , \quad \operatorname {d i a m} (\operatorname {S t a b} _ {\epsilon} (\mathcal {F})) \simeq C _ {G} \lambda^ {1 / \operatorname {d d i m} (G)}.
$$
We next use Lipschitz deformation bounds and find that for all  $x \in \mathcal{X}$  we have
$$
\begin{array}{l} \operatorname {d i a m} \left\{y ^ {*} (g \cdot x): g \in \operatorname {S t a b} _ {\epsilon} (\mathcal {F}) \right\} \leq \operatorname {d i a m} \left(\operatorname {S t a b} _ {\epsilon} (\mathcal {F})\right) \operatorname {L i p} \left(y ^ {*}\right) L ^ {\prime} \\ \leq C _ {G} \lambda^ {1 / \operatorname {d d i m} (G)} \epsilon (\mathcal {F})) \operatorname {L i p} \left(y ^ {*}\right) L ^ {\prime}. \\ \end{array}
$$
Then we use Proposition 5.1 for  $\mathcal{F}$  and observe that when  $g, X_{\epsilon}^{0}$  are random variables as in the proposition, in particular  $g \in \mathsf{Stab}_{\epsilon}(\mathcal{F})$  and for each  $X_{\epsilon}^{0} = x_{\epsilon}^{0}$  we find the following estimate valid uniformly over  $y \in \{y^{*}(g \cdot X_{\epsilon}^{0}) : g \in \mathsf{Stab}_{\epsilon}(\mathcal{F})\}$ :
$$
\mathrm {d} _ {\mathcal {Y}} \left(y, y ^ {*} \left(g \cdot x _ {\epsilon} ^ {0}\right)\right) \leq C _ {G} ^ {\prime} \lambda^ {1 / \mathrm {d d i m} (G)} \operatorname {L i p} \left(y ^ {*}\right) L ^ {\prime}.
$$
In a similar way, we also find
$$
\mathrm {d} _ {\mathcal {Y}} (y, g \cdot y) \leq C _ {G} ^ {\prime} \lambda^ {1 / \mathrm {d d i m} (G)} L ^ {\prime}.
$$
By triangle inequality, and using the assumption that  $\operatorname{Lip}(y^{*}) \simeq 1$  it follows that
$$
\mathrm {d} _ {\mathcal {Y}} (y, y ^ {*} (g \cdot x _ {\epsilon} ^ {0}) \leq C _ {G} ^ {\prime} \lambda^ {1 / \mathrm {d d i m} (G)} (1 + \operatorname {L i p} (y ^ {*})) L ^ {\prime} \lesssim C _ {G} ^ {\prime} \lambda^ {1 / \mathrm {d d i m} (G)} \operatorname {L i p} (y ^ {*}) L ^ {\prime}.
$$
Then we may perturb each  $y$  by  $\epsilon$  in order to possibly diminish this value without violating the condition defining  $\mathsf{Stab}_{\epsilon}(\mathcal{F})$ , and with these choices we obtain the claim.
A.4 Finding the optimal  $\lambda = \lambda^{*}$  for the bound of Theorem 6.1
We note that  $\lambda^{*}$  minimizing  $C\lambda^{\alpha} + C'\lambda^{-\beta}$  for  $\alpha, \beta > 0$  is given by
$$
\lambda^ {*} = \left(\frac {\beta}{\alpha} \frac {C ^ {\prime}}{C}\right) ^ {1 / (\alpha + \beta)}.
$$
recall that in our case have the following choices, for case 1 and case 2 in the theorem's statement.
$$
\alpha_ {1} = \alpha_ {2} = 1 / d _ {G}, \quad \beta_ {1} = 1 / 2, \beta_ {2} = 1 / d _ {0},
$$
$$
C = C _ {G} \operatorname {L i p} \left(y ^ {*}\right) L ^ {\prime},
$$
$$
C _ {1} ^ {\prime} \simeq \frac {(2 L D) ^ {d / 2} | G | ^ {1 / 2}}{\delta_ {G} ^ {(d _ {0} - 2) / 2}},
$$
$$
C _ {2} ^ {\prime} \simeq (2 L D) ^ {d / d _ {0}} | G | ^ {1 / d _ {0}},
$$
and thus the optimal choice of  $\lambda$  is
in case  $n\lambda \geq C_3$ $\lambda^{*} = \left(\frac{2}{d_{G}}\frac{(2LD)^{d / 2}|G|^{1 / 2}}{\delta_{G}^{(d_{0} + 2) / 2}}\right)^{2d_{G} / (d_{G} + 2)}n^{-d_{G} / (d_{G} + 2)},$
in case  $n\lambda >C_3$ $\lambda^{*} = \left(\frac{d_{0}}{d_{G}} (2LD)^{d / d_{0}}|G|^{1 / d_{0}}\right)^{d_{0}d_{G} / (d_{0} + d_{G})}n^{-d_{G} / (d_{G} + 2)}.$