SlowGuess/NeurIPS_2023_OCR huggingface dataset:
The first term is bounded by  $\varepsilon /2$ , the second goes to 0 in probability: in the p.s.d. case, this is a result of [42], by an application of Hoeffding's inequality in the Hilbert space of Hilbert-Schmidt operators in an RKHS; in the SBM case, there is a finite number of non-zero eigenvalues for both  $W$  and  $\mathbf{S}$  that converge to each other and the result follows.
Now we need to bound  $\left\| S_{\gamma} - \hat{S}\right\|_{\mathrm{F}}$  for a well chosen MLP. Define  $(i_T,j_T) = \arg \min_{i\in T,j\in T^c}\left|\lambda_i^{\mathbf{S}} - \lambda_j^{\mathbf{S}}\right|$ ,  $\tau = \frac{\left|\lambda_{i_T}^{\mathbf{S}} - \lambda_{j_T}^{\mathbf{S}}\right|}{4} >0$  and  $\bar{\lambda} = \frac{\left|\lambda_{i_T}^{\mathbf{S}} + \lambda_{j_T}^{\mathbf{S}}\right|}{2}$ . Note that we have  $T = \{i\mid |\lambda_i^{\mathbf{S}}|\geqslant \bar{\lambda} +2\tau \}$  and  $T^{c} = \{i\mid |\lambda_{i}^{\mathbf{S}}|\leqslant \bar{\lambda} -2\tau \}$  Define the following  $f^{\mathrm{MLP}}:\mathbb{R}\to \mathbb{R}$ :
$$
\begin{array}{l} f ^ {\mathrm {M L P}} (\lambda) = \frac {\bar {\lambda} + \tau}{2 \tau} \left(\rho (\lambda - \bar {\lambda} + \tau) - \rho (\lambda - \bar {\lambda} - \tau)\right) + \rho (\lambda - \bar {\lambda} - \tau) (33) \\ + \frac {- \bar {\lambda} - \tau}{2 \tau} (\rho (- \lambda - \bar {\lambda} + \tau) - \rho (- \lambda - \bar {\lambda} - \tau)) - \rho (- \lambda - \bar {\lambda} - \tau) (34) \\ \end{array}
$$
where  $\rho$  is ReLU. This is a continuous piecewise linear function that is equal to  $\lambda$  on  $(- \infty, -\bar{\lambda} - \tau]$ , 0 on  $[- \bar{\lambda} + \tau, \bar{\lambda} - \tau]$ , and  $\lambda$  on  $[\bar{\lambda} + \tau, +\infty)$ .
Recall that with probability going to 1, we have  $\sup_{i}\left|\lambda_{i}^{S} - \lambda_{i}^{\mathbf{S}}\right|\leqslant \tau$ , so in particular, for all  $i\in T$  we have  $\left|\lambda_i^S\right|\geqslant \bar{\lambda} +\tau$  and for all  $i\in T^c$  we have  $\left|\lambda_i^S\right|\leqslant \bar{\lambda} -\tau$ . In that case, the MLP filtering is exactly the ideal filtering and  $h(S) = \hat{S}$ , which concludes the proof.
B.4 Proof of Prop. 5
The case of  $\mathcal{F}_{\mathrm{Dist}}$  was proven in [25, Theorem 4]. For  $\mathcal{F}_{\mathrm{Eig}}$ , we consider the SBM (ex. a) with adjacency matrix (ex. 1) and
$$
C = \left( \begin{array}{c c} 1 / 2 & 1 / 4 \\ 1 / 4 & 3 / 8 \end{array} \right), \quad P = (1 / 3, 2 / 3)
$$
We have  $\mathbf{S}1 = (1/3, 1/3)$ , therefore  $\mathcal{F}_{\mathbf{S}}(1)$  contains only constant functions. Moreover,  $u_i^{\mathbf{S}} = (1, 1)/\sqrt{2}$ . From the orthogonality equation  $(u_2^{\mathbf{S}})^\top \mathrm{diag}(P) u_1^{\mathbf{S}} = 0$  we get  $(u_2^{\mathbf{S}})_1 = 2(u_2^{\mathbf{S}})_2$ . Hence it is possible to choose  $f$  such that  $f((u_2^{\mathbf{S}})_1) + f(-(u_2^{\mathbf{S}})_1) \neq f((u_2^{\mathbf{S}})_2) + f(-(u_2^{\mathbf{S}})_2)$ , thus  $\mathcal{F}_{\mathrm{Eig}}$  contains a non-constant function, which concludes the proof.
B.5 Proof of Prop. 6
Consider the SBM case  $\mathcal{X} = \{1,\dots ,K\}$  with  $K$  even and  $P = 1_{K} / K$ . Adopting the notations of the section above, we have  $\mathbf{S}f = C\mathrm{diag}(P_k)f$ ,  $C_P = \mathrm{diag}(\sqrt{P_k})C\mathrm{diag}(\sqrt{P_k}) = \sum_{i = 1}^{K}\lambda_i^{\mathbf{S}}u_i^P (u_i^P)^\top$  with  $u_{i}^{P} = \mathrm{diag}(\sqrt{P_{k}})u_{i}^{\mathbf{S}}$  orthonormal (in Euclidean  $\mathbb{R}^K$ ).
For  $\mathcal{F}_{\mathrm{Eig}}$  , we consider the case where
$$
\begin{array}{l} \lambda_ {1} ^ {\mathbf {S}} > \lambda_ {2} ^ {\mathbf {S}} > 0, \quad \lambda_ {i} = 0 \text {f o r} i \geqslant 3 \\ (u _ {1} ^ {P}) _ {i} = \left\{ \begin{array}{l l} \sqrt {2 / K} & \text {i f i i s e v e n} \\ 0 & \text {o t h e r w i s e ,} \end{array} \right. (u _ {2} ^ {P}) _ {i} = \left\{ \begin{array}{l l} 0 & \text {i f i i s e v e n} \\ C \cdot i & \text {o t h e r w i s e ,} \end{array} \right. \\ \end{array}
$$
where  $C$  is a constant such that  $\left\| u_2^P\right\| = 1$ . Consider eigenvectors PEs with  $q = 1$ . The space  $\mathcal{F}_{\mathrm{Eig}}$  contains all the function  $g$  of the form
$$
g _ {i} = f ((u _ {1} ^ {\mathbf {S}}) _ {i}) + f (- (u _ {1} ^ {\mathbf {S}}) _ {i})
$$
for any  $f$ . By construction of  $u_1^P$ , these functions have the property of being 2-periodic: for all  $i$ ,  $g_i = g_{i+2}$ . Now,  $\mathcal{F}_{\mathbf{S}}(\mathcal{F}_{\mathrm{Eig}})$  contains e.g. the following function
$$
\mathbf {S} 1 = K C _ {P} 1 = \lambda_ {1} ^ {\mathbf {S}} (1 ^ {\top} u _ {1} ^ {P}) u _ {1} ^ {P} + \lambda_ {2} ^ {\mathbf {S}} (1 ^ {\top} u _ {2} ^ {P}) u _ {2} ^ {P}
$$
This function is not 2-periodic: on  $i$  odd, we have  $(u_2^P)_i \neq (u_2^P)_{i+2}$  and therefore  $g_i \neq g_{i+2}$ , which concludes the proof.
For  $\mathcal{F}_{\mathrm{Dist}}$ , taking again  $q = 1$ , we consider  $K = 4$  and  $C_{01} = C_{10} = 1$ , and  $C_{k\ell} = 0$  otherwise. The space  $\mathcal{F}_{\mathrm{Dist}}$  contains all the function  $g$  of the form
$$
g = \frac {1}{K} f (C) 1
$$
where  $f$  is applied element-wise on  $C$ . With this choice, for any  $f$  we have  $g_{3} = g_{4} = f(0)$ . However, the space  $\mathcal{F}_{\mathrm{S}}(\mathcal{F}_{\mathrm{Dist}})$  contains the function
$$
h = \frac {1}{K ^ {2}} C f (C) 1
$$
Here we have  $h_3 = \frac{f(0)f(1)}{8} + \frac{7f(0)^2}{8}$  and  $h_4 = f(0)^2$ , which can be made unequal. Hence  $h \notin \mathcal{F}_{\mathrm{Dist}}$  which concludes the proof.
C Universality
Here we recall the universality results of [25], that were derived for an architecture called Structured GNN, in the case of non-random edges. In this paper, these results are valid for the distance-encoded PEs (10), through Theorem 3, our definition of  $\mathcal{F}_{\mathrm{Dist}}$  (11). The results in [25] basically prove that  $\mathcal{F}_{\mathbf{S}}(\mathcal{F}_{\mathrm{Dist}})$  satisfies the hypotheses of Prop. 3. We recall them here without proof. The following results are valid for adjacency matrix (ex. 1), distance-encoding PE (10), and SBM (ex. a) or p.s.d. kernel (ex. b), with other additional hypotheses in each cases.
- SBM: if  $\mathcal{X}$  is finite,  $C = [w(k,\ell)]$  is invertible, and  $P$  is such that for all  $s\in \{-1,0,1\} ^K$ ,  $s^\top P = 0$  implies  $s = 0$ , then  $\mathcal{F}_{\mathbf{S}}(\mathcal{F}_{\mathrm{PE}}) = L_{\square}^{2}$ .
- Additive kernel: if  $w(x,y) = v(u(x) + u(y))$  with  $u, v$  that are continuous and injective, then  $\mathcal{F}_{\mathrm{S}}(\mathcal{F}_{\mathrm{PE}}) = L_{\sqcup}^{2}$ .
- Unidimensional radial kernel: if  $\mathcal{X} = [-1,1]$ ,  $w(x,y) = v(|x - y|)$  with continuous injective  $v$ , and  $P$  is symmetric (that is,  $P([a,b]) = P([-b, -a])$  for all intervals), then  $\mathcal{F}_{\mathbf{S}}(\mathcal{F}_{\mathrm{PE}}) = L_{\sqcup}^{2} \cap \mathcal{S}(\mathcal{X})$  where  $\mathcal{S}$  are symmetric functions. If  $P$  is not symmetric, then  $\mathcal{F}_{\mathbf{S}}(\mathcal{F}_{\mathrm{PE}}) = L_{\sqcup}^{2}$ .
- Spherical kernels: If  $\mathcal{X} = \mathbb{S}^{d - 1}$  is the  $d$ -dimensional sphere,  $w(x,y) = v(x^{\top}y)$  with continuous injective  $v$ , and  $P$  has a density  $p$  w.r.t. the uniform distribution on the sphere such that: the unique decomposition  $p(x) = \sum_{k\geqslant 0}\sum_{j = 1}^{N(d,k)}a_{k,j}Y_{k,j}(x)$  where  $Y_{k,j}$  are spherical harmonics is such that  $x\mapsto [\sum_{j = 1}^{N(d,k)}a_{k,j}Y_{k,j}(x)]_k$  is injective (see [25] and references therein), then  $\mathcal{F}_{\mathbf{S}}(\mathcal{F}_{\mathrm{PE}}) = L_{\sqcup}^{2}$ .
D Technical or third-party results
The following Lemma can be proved in a number of ways.
Lemma 8 (Lemma 4 in [24]). Let  $\mathcal{X}$  be a compact metric space, and  $\mathcal{Y}$  a measurable space. Consider a bivariate measurable function  $U: \mathcal{X} \times \mathcal{Y} \to \mathbb{R}$  that is uniformly bounded, and continuous in the first variable. Let  $y_1, \ldots, y_n$  be drawn i.i.d from a distribution  $P$  on  $\mathcal{Y}$ . Then
$$
\left\| \frac {1}{n} \sum_ {i} \eta (\cdot , y _ {i}) - \int \eta (\cdot , y) d P (y) \right\| _ {\infty} \xrightarrow [ n \to \infty ]{\mathcal {P}} 0
$$
We extend the previous results to polynomials of the kernel.
Lemma 9. For any bounded, continuous kernel  $w_{\mathbf{S}}$ , we have for all  $k \geqslant 1$ :
$$
\sup  _ {x, x ^ {\prime} \in \mathcal {X}} \left| \frac {1}{n ^ {k}} \sum_ {i _ {1}, \dots , i _ {k}} w _ {\mathbf {S}} \left(x, x _ {i _ {1}}\right) w _ {\mathbf {S}} \left(x _ {i _ {1}}, x _ {i _ {2}}\right) \dots w _ {\mathbf {S}} \left(x _ {i _ {k}}, x ^ {\prime}\right) - \left(\mathbf {S} ^ {k + 1} \delta_ {x ^ {\prime}}\right) (x) \right| \xrightarrow [ n \rightarrow \infty ]{\mathcal {P}} 0 \tag {35}
$$
Proof. We prove it by induction. For  $k = 1$ , we have
$$
\sup  _ {x, x ^ {\prime} \in \mathcal {X}} \left| \frac {1}{n} \sum_ {i} w _ {\mathbf {S}} \left(x, x _ {i}\right) w _ {\mathbf {S}} \left(x _ {i}, x ^ {\prime}\right) - \int w _ {\mathbf {S}} (x, y) w _ {\mathbf {S}} \left(y, x ^ {\prime}\right) d P (y) \right| \xrightarrow [ n \rightarrow \infty ]{\mathcal {P}} 0 \tag {36}
$$
by applying Lemma 8 on  $\mathcal{X} \times \mathcal{X}$ , and since  $w_{\mathbf{S}}$  is continuous on a compact domain and therefore bounded and Lipschitz.
Then, assuming the property for  $k - 1$ , we write
$$
\begin{array}{l} \sup  _ {x, x ^ {\prime} \in \mathcal {X}} \left| \frac {1}{n ^ {k}} \sum_ {i _ {1}, \dots , i _ {k}} w _ {\mathbf {S}} (x, x _ {i _ {1}}) w _ {\mathbf {S}} \left(x _ {i _ {1}}, x _ {i _ {2}}\right) \dots w _ {\mathbf {S}} \left(x _ {i _ {k}}, x ^ {\prime}\right) - \left(\mathbf {S} ^ {k + 1} \delta_ {x ^ {\prime}}\right) (x) \right| \\ \leqslant \sup  _ {x, x ^ {\prime} \in \mathcal {X}} \left| \frac {1}{n} \sum_ {i _ {1}} w _ {\mathbf {S}} \left(x, x _ {i _ {1}}\right) \left[ \frac {1}{n ^ {k - 1}} \sum_ {i _ {2}, \dots , i _ {k}} w _ {\mathbf {S}} \left(x _ {i _ {1}}, x _ {i _ {2}}\right) \dots w _ {\mathbf {S}} \left(x _ {i _ {k}}, x ^ {\prime}\right) - \left(\mathbf {S} ^ {k} \delta_ {x ^ {\prime}}\right) \left(x _ {i _ {1}}\right) \right] \right| \\ + \sup  _ {x, x ^ {\prime} \in \mathcal {X}} \left| \frac {1}{n} \sum_ {i _ {1}} w _ {\mathbf {S}} (x, x _ {i _ {1}}) (\mathbf {S} ^ {k} \delta_ {x ^ {\prime}}) (x _ {i _ {1}}) - \int w _ {\mathbf {S}} (x, y) (\mathbf {S} ^ {k} \delta_ {x ^ {\prime}}) (y) d P (y) \right| \\ \end{array}
$$
The first part converges to 0 using the boundedness of  $w_{\mathbf{S}}$  and the recursive hypothesis, while the second converges to 0 using again Lemma 8.
Theorem 8 (Simplified Davis-Kahan, see [57]). Let  $A, \hat{A} \in \mathbb{R}^{d \times d}$  be symmetric with eigenvalues  $\lambda_i$  and  $\hat{\lambda}_i$  ordered by decreasing order and eigenvector  $u_i, \hat{u}_i$ . Take  $p$  and assume that  $\delta = \min(\lambda_{p-1} - \lambda_p, \lambda_p - \lambda_{p+1}) > 0$ . Then there exists  $s \in \{-1,1\}$  such that
$$
\left\| s u _ {p} - \hat {u} _ {p} \right\| \leqslant \frac {\left\| A - \hat {A} \right\|}{\delta} \tag {37}
$$
Theorem 9. Denote  $W = [w(x_i, x_j) / n]_{ij}$ ,  $\bar{W} = \left[\frac{w(x_i, x_j)}{n\sqrt{d(x_i)d(x_j)}}\right]_{ij}$  and  $L(M) = D_M^{-\frac{1}{2}}MD_M^{-\frac{1}{2}}$  with  $D_M = \mathrm{diag}(M1)$
If  $\alpha_{n} \gtrsim (\log n) / n$ , then
$$
\left\| \frac {A}{\alpha_ {n} n} - W \right\| \xrightarrow [ n \rightarrow \infty ]{\mathcal {P}} 0. \tag {38}
$$
Moreover, if  $d(x) \geqslant d_{\min} > 0$  and  $\alpha_n \geqslant C(\log n) / n$  where  $C$  is a constant that depends on  $w$ , then
$$
\left\| L (A) - \bar {W} \right\| \xrightarrow [ n \rightarrow \infty ]{\mathcal {P}} 0. \tag {39}
$$
Proof. The first result is due to Lei and Rinaldo [28].
For the second result, we have from [24, Theorem 6] that
$$
\| L (A) - L (W) \| \rightarrow 0 \tag {40}
$$
Then, according to Lemma 8 we have that
$$
\left\| d - \frac {1}{n} \sum_ {i} w (\cdot , x _ {i}) \right\| _ {\infty} \xrightarrow [ n \rightarrow \infty ]{\mathcal {P}} 0 \tag {41}
$$
and in particular with probability going to one  $d_i^W \stackrel{\mathrm{def.}}{=} (D_W)_i \geqslant d_{\min} / 2 > 0$  for all  $i$ .
Denoting by  $\bar{D} = \mathrm{diag}(d(x_i))$ , and noticing that  $W = \bar{D}^{-\frac{1}{2}}W\bar{D}^{-\frac{1}{2}}$  and  $\| W\| \leqslant 1$ , we have
$$
\begin{array}{l} \left\| \bar {W} - L (W) \right\| = \left\| \bar {D} ^ {- \frac {1}{2}} W \bar {D} ^ {- \frac {1}{2}} - D _ {W} ^ {- \frac {1}{2}} W D _ {W} ^ {- \frac {1}{2}} \right\| \\ \lesssim \frac {1}{\sqrt {d _ {\operatorname* {m i n}}}} \left\| \bar {D} ^ {- \frac {1}{2}} - D _ {W} ^ {- \frac {1}{2}} \right\| = \frac {1}{\sqrt {d _ {\operatorname* {m i n}}}} \max  _ {i} \left| \frac {1}{\sqrt {d (x _ {i})}} - \frac {1}{\sqrt {d _ {i} ^ {W}}} \right| \\ = \frac {1}{\sqrt {d _ {\mathrm {m i n}}}} \max _ {i} \left| \frac {d (x _ {i}) - d _ {i} ^ {W}}{\sqrt {d (x _ {i}) d _ {i} ^ {W} (\sqrt {d (x _ {i})} + \sqrt {d _ {i} ^ {W}})}} \right| \\ \lesssim \frac {1}{d _ {\operatorname* {m i n}} ^ {2}} \left\| d - \frac {1}{n} \sum_ {i} w (\cdot , x _ {i}) \right\| _ {\infty} \xrightarrow [ n \to \infty ]{\mathcal {P}} 0 \\ \end{array}
$$