SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
\left\| \mathcal {K} _ {d} ^ {(q)} \tilde {g} - f \right\| _ {\mathbb {S} ^ {d - 1}} ^ {2} \leq C \cdot \min  _ {g \in L ^ {2} (\mathbb {S} ^ {d - 1})} \left\| \mathcal {K} _ {d} ^ {(q)} g - f \right\| _ {\mathbb {S} ^ {d - 1}} ^ {2},
$$
and if we let  $f^{(q)} \coloneqq \mathcal{K}_d^{(q)}f$ , where  $\mathcal{K}_d^{(q)}$  is defined as per Definition 2, then the following holds
$$
\left\| \mathcal {K} _ {d} ^ {(q)} \tilde {g} - f ^ {(q)} \right\| _ {\mathbb {S} ^ {d - 1}} ^ {2} \leq (C - 1) \cdot \left\| f ^ {(q)} - f \right\| _ {\mathbb {S} ^ {d - 1}} ^ {2}.
$$
Claim 2 shows that solving the regression problem in Eq. (7) approximately provides a solution to our spherical harmonics interpolation problem (Problem 2). But how can we solve this least-squares problem efficiently? Not only does the problem involve a possibly infinite dimensional parameter vector  $g$ , but the objective function also involves the continuous domain on the surface of  $\mathbb{S}^{d - 1}$ .
3.1 Randomized Discretization via Leverage Function Sampling
We solve the continuous regression in Eq. (7) by randomly discretizing the sphere  $\mathbb{S}^{d - 1}$ , thereby reducing our problem to a regression on a finite set of points  $w_{1}, w_{2}, \ldots, w_{s} \in \mathbb{S}^{d - 1}$ . In particular, we propose to sample points on  $\mathbb{S}^{d - 1}$  with probability proportional to the so-called leverage function, a specific distribution that has been widely applied in randomized algorithms for linear algebra problems on discrete matrices [LMP13]. We start with the definition of the leverage function for compact operators such as  $\kappa_{d}^{(q)}$ :
Definition 3 (Leverage Function). For integers  $q \geq 0$  and  $d > 0$ , we define the leverage function of the operator  $\mathcal{K}_d^{(q)}$  (see Definition 2) for every  $w \in \mathbb{S}^{d - 1}$  as follows,
$$
\tau_ {q} (w) := \max  _ {g \in L ^ {2} \left(\mathbb {S} ^ {d - 1}\right)} \left\| \mathcal {K} _ {d} ^ {(q)} g \right\| _ {\mathbb {S} ^ {d - 1}} ^ {- 2} \cdot \left| \left[ \mathcal {K} _ {d} ^ {(q)} g \right] (w) \right| ^ {2}. \tag {8}
$$
Intuitively,  $\tau_q(w)$  is an upper bound of how much a function that is spanned by the eigenfunctions of the operator  $\mathcal{K}_d^{(q)}$  can "blow up" at  $w$ . The larger the leverage function  $\tau_q(w)$  implies the higher the probability we will be required to sample  $w$ . This ensures that our sample points well reflect any possibly significant components, or "spikes", of the function. Ultimately, the integral  $\int_{\mathbb{S}^{d-1}} \tau_q(w) \, dw$  determines how many samples we require to solve the regression problem Eq. (7) to a given accuracy. It is a known fact that the leverage function integrates to the rank of the operator  $\mathcal{K}_d^{(q)}$  (which is equal to the dimensionality of the Hilbert space  $\mathcal{H}^{(q)}(\mathbb{S}^{d-1})$ ). This ultimately allows us to achieve a  $\widetilde{\mathcal{O}}(\sum_{\ell=0}^q \alpha_{\ell,d})$  sample complexity bound for solving Problem 2. To compute the leverage function, we make use of the following useful alternative characterization of the leverage function.
Lemma 4 (Min Characterization of the Leverage Function). For any  $w \in \mathbb{S}^{d - 1}$ , let  $\tau_q(w)$  be the leverage function (Definition 3) and define  $\phi_w \in L^2 (\mathbb{S}^{d - 1})$  by  $\phi_w(\sigma) \equiv \sum_{\ell = 0}^{q}\frac{\alpha_{\ell,d}}{|\mathbb{S}^{d - 1}|} P_d^\ell (\langle \sigma ,w\rangle)$ . We have the following minimization characterization of the leverage function:
$$
\tau_ {q} (w) = \left\{\min  _ {g \in L ^ {2} \left(\mathbb {S} ^ {d - 1}\right)} \| g \| _ {\mathbb {S} ^ {d - 1}} ^ {2}, \quad s. t. \mathcal {K} _ {d} ^ {(q)} g = \phi_ {w} \right\}. \tag {9}
$$
Using the min and max characterizations of the leverage function we can find upper and lower bounds on this function. Surprisingly, in this case the upper and lower bounds match, so we actually have an exact value for the leverage function.
Lemma 5 (Leverage Function is Constant). The leverage function given in Definition 3 is equal to  $\tau_q(w) = \sum_{\ell=0}^{q} \frac{\alpha_{\ell,d}}{|\mathbb{S}^{d-1}|}$  for every  $w \in \mathbb{S}^{d-1}$ .
Algorithm 1 Efficient Spherical Harmonic Expansion
1: Input: accuracy parameter  $\varepsilon > 0$ , integer  $q \geq 0$
2: Set  $s = c \cdot (\beta_{q,d} \log \beta_{q,d} + \beta_{q,d} / \varepsilon)$  for sufficiently large fixed constant  $c$
3: Sample i.i.d. random points  $w_{1}, w_{2}, \ldots, w_{s}$  from  $\mathcal{U}(\mathbb{S}^{d-1})$
4: Compute  $\pmb {K}\in \mathbb{R}^{s\times s}$  with  $K_{i,j} = \sum_{\ell = 0}^{q}\frac{\alpha_{\ell,d}}{s\cdot|\mathbb{S}^{d - 1}|}\cdot P_d^\ell (\langle w_i,w_j\rangle)$  for  $i,j\in [s]$
5: Compute  $\pmb {f}\in \mathbb{R}^s$  with  $\pmb {f}_j = \frac{1}{\sqrt{s}}\cdot \pmb {f}(w_j)$  for  $j\in [s]$
6: Solve the regression by computing  $z = K^{\dagger}f$
7: Return:  $y \in \mathcal{H}^{(q)}(\mathbb{S}^{d - 1})$  with  $y(\sigma) \coloneqq \sum_{\ell = 0}^{q}\frac{\alpha_{\ell,d}}{\sqrt{s}\cdot|\mathbb{S}^{d - 1}|}\cdot \sum_{j = 1}^{s}z_{j}\cdot P_{d}^{\ell}\left(\langle w_{j},\sigma \rangle\right)$  for  $\sigma \in \mathbb{S}^{d - 1}$ .
We prove this lemma in Appendix C. The integral of the leverage function, which determines the total samples needed to solve our least-squares regression, is therefore equal to the dimensionality of the Hilbert space  $\mathcal{H}^{(q)}(\mathbb{S}^{d - 1})$ .
Corollary 1. The leverage function defined in Definition 3 integrates to the dimensionality of the Hilbert space  $\mathcal{H}^{(q)}(\mathbb{S}^{d - 1})$ , which we denote by  $\beta_{q,d}$ , i.e.,
$$
\int_ {\mathbb {S} ^ {d - 1}} \tau_ {q} (w) d w = \dim \left(\mathcal {H} ^ {(q)} (\mathbb {S} ^ {d - 1})\right) = \sum_ {\ell = 0} ^ {q} \alpha_ {\ell , d} \equiv \beta_ {q, d}.
$$
We now show that the leverage function can be used to randomly sample the points on the unit sphere to discretize the regression problem in Eq. (7) and solve it approximately.
Theorem 4 (Approximate Regression via Leverage Function Sampling). For any  $\varepsilon >0$ , let  $s = c\cdot \left(\beta_{q,d}\log \beta_{q,d} + \frac{\beta_{q,d}}{\varepsilon}\right)$ , for sufficiently large fixed constant  $c$ , and let  $x_{1},x_{2},\ldots ,x_{s}$  be i.i.d. uniform samples on  $\mathbb{S}^{d - 1}$ . Define the quasi-matrix  $\pmb {P}:\mathbb{R}^s\to L^2 (\mathbb{S}^{d - 1})$  as follows, for every  $v\in \mathbb{R}^d$ :
$$
[ \boldsymbol {P}   v ] (\sigma) := \sum_ {\ell = 0} ^ {q} \frac {\alpha_ {\ell , d}}{\sqrt {s} \cdot | \mathbb {S} ^ {d - 1} |} \cdot \sum_ {j = 1} ^ {s} v _ {j} \cdot P _ {d} ^ {\ell} \left(\langle x _ {j}, \sigma \rangle\right) \quad f o r   \sigma \in \mathbb {S} ^ {d - 1}.
$$
Also let  $\pmb{f} \in \mathbb{R}^s$  be a vector with  $\pmb{f}_j := \frac{1}{\sqrt{s}} \cdot f(x_j)$  for  $j = 1, 2, \dots, s$  and let  $\pmb{P}^*$  be the adjoint of  $\pmb{P}$ . If  $\tilde{g}$  is an optimal solution to the least-squares problem  $\tilde{g} \in \arg \min_{g \in L^2(\mathbb{S}^{d-1})} \| \pmb{P}^* g - \pmb{f} \|_2^2$ , then with probability at least  $1 - 10^{-4}$  the following holds,
$$
\left\| \mathcal {K} _ {d} ^ {(q)} \tilde {g} - f \right\| _ {\mathbb {S} ^ {d - 1}} ^ {2} \leq (1 + \varepsilon) \cdot \min  _ {g \in L ^ {2} (\mathbb {S} ^ {d - 1})} \left\| \mathcal {K} _ {d} ^ {(q)} g - f \right\| _ {\mathbb {S} ^ {d - 1}} ^ {2}.
$$
We prove Theorem 4 in Appendix C. This theorem shows that the function  $\tilde{g}$  obtained from solving the discretized regression problem provides an approximate solution to Eq. (7).
3.2 Efficient Solution for the Discretized Least-Squares Problem
In this section, we demonstrate how to apply Theorem 4 algorithmically to approximately solve the regression problem of Eq. (7). To achieve this, we leverage the kernel trick, following a similar approach to previous works such as  $\mathrm{[AKM^{+}19,CP19]}$ , which allows us to efficiently address the randomly discretized least squares problem as detailed in Algorithm 1. The associated guarantee for this approach is provided in Theorem 5.
Theorem 5 (Efficient Spherical Harmonic Interpolation). Algorithm 1 returns a function  $y \in \mathcal{H}^{(q)}(\mathbb{S}^{d - 1})$  such that, with probability at least  $1 - 10^{-4}$ :
$$
\left\| y - f ^ {(q)} \right\| _ {\mathbb {S} ^ {d - 1}} ^ {2} \leq \varepsilon \cdot \left\| f ^ {(q)} - f \right\| _ {\mathbb {S} ^ {d - 1}} ^ {2}, \text {w h e r e} f ^ {(q)} := \mathcal {K} _ {d} ^ {(q)} f.
$$
Suppose we can compute the Gegenbauer polynomial  $P_d^\ell(t)$  at every point  $t \in [-1, 1]$  in constant time. Then Algorithm 1 queries the function  $f$  at  $s = \mathcal{O}\left(\beta_{q,d} \log \beta_{q,d} + \frac{\beta_{q,d}}{\varepsilon}\right)$  points on the sphere  $\mathbb{S}^{d-1}$  and runs in  $\mathcal{O}(s^2 \cdot d + s^\omega)$  time. This algorithm evaluates  $y(\sigma)$  in  $\mathcal{O}(d \cdot s)$  time for any  $\sigma \in \mathbb{S}^{d-1}$ .
We provide the proof of this theorem in Appendix D.
Remark 1 (Noise Robustness). In Theorem 5, our method's robustness is demonstrated under a noise model where the function  $f$  is not strictly a low-degree spherical harmonic and may include high-degree components. In this scenario, the higher-degree components are considered as noise added to the input function.
However, our algorithm is robust against alternative noise models, particularly additive i.i.d. Normal noise that corrupts the function evaluations  $\pmb{f}$  in Algorithm 1 with iid Normal noise. More precisely, suppose that we observe samples from the function  $f^{(q)}$  contaminated by Gaussian noise, i.e.,  $f(w_{j}) = f^{(q)}(w_{j}) + n_{j}$  in Algorithm 1 for i.i.d.  $n_1, n_2, \ldots, n_s \sim \mathcal{N}(0,1)$ . The expected value of perturbation's norm in the output  $y$  of our algorithm caused by this noise is:
$$
\mathbb {E} \left[ \left\| y - f ^ {(q)} \right\| _ {\mathbb {S} ^ {d - 1}} ^ {2} \right] = (1 / s) \cdot \mathrm {t r a c e} \left(\boldsymbol {K} ^ {\dagger} \boldsymbol {K} \boldsymbol {K} ^ {\dagger}\right).
$$
By Markov's inequality, with 0.99 probability  $\| y - f^{(q)}\|_{\mathbb{S}^{d - 1}}^2 = O(1 / s)\cdot \mathrm{trace}\left(K^\dagger KK^\dagger\right)$ . If we let  $P$  be the operator defined in Theorem 4, then we can see that  $K = P^{*}P$ . Using the properties of the trace, one can see that trace  $\left(K^{\dagger}KK^{\dagger}\right) = 1 / \lambda_1 + 1 / \lambda_2 + \ldots$ , where  $\lambda_{i}$ 's are the singular values of the operator  $PP^{*}$ . By matrix Chernoff inequalities one can show that all singular values of the operator  $PP^{*}$  closely approximate the singular values of the projection operator  $\mathcal{K}_d^{(q)}$  up to a constant factor. So, we have trace  $\left(K^{\dagger}KK^{\dagger}\right) = O(\mathrm{rank}(\mathcal{K}_d^{(q)})) = O(\beta_{q,d})$ . Thus, because  $s\geq \Omega (\beta /\varepsilon)$  and using union bound, with 0.98 probability:
$$
\left\| y - f ^ {(q)} \right\| _ {\mathbb {S} ^ {d - 1}} ^ {2} \leq \varepsilon .
$$
4 Lower Bound on The Number of Required Observations
We conclude by showing that the dimensionality of the Hilbert space  $\mathcal{H}^{(q)}(\mathbb{S}^{d - 1})$  tightly characterizes the sample complexity of Problem 2. Thus, our Theorem 5 is optimal up to a logarithmic factor. Intuitively, there are  $\beta_{q,d}$  degrees of freedom for specifying a spherical harmonic. Consequently, any deterministic algorithm attempting to reconstruct such polynomials would need at least  $\beta_{q,d}$  samples. We aim to demonstrate that even a "randomized" algorithm, which succeeds with only a constant probability, must still gather  $\beta_{q,d}$  samples. This complements our upper bound, which is established using a randomized algorithm. The crucial fact we use for proving the lower bound is that all (non-zero) eigenvalues of the operator  $\mathcal{K}_d^{(q)}$  are equal to one. This fact follows from the addition theorem presented in Theorem 3, i.e., if  $\left\{y_1^\ell ,y_2^\ell ,\ldots ,y_{\alpha_\ell ,d}^\ell \right\}$  is an orthonormal basis of  $\mathcal{H}_{\ell}\left(\mathbb{S}^{d - 1}\right)$ , then for any function  $f\in L^{2}\left(\mathbb{S}^{d - 1}\right)$ ,
$$
\left[ \mathcal {K} _ {d} ^ {(q)} f \right] (\sigma) = \sum_ {\ell = 0} ^ {q} \alpha_ {\ell , d} \cdot \underset {w \sim \mathcal {U} \left(\mathbb {S} ^ {d - 1}\right)} {\mathbb {E}} \left[ P _ {d} ^ {\ell} (\langle \sigma , w \rangle) \cdot f (w) \right] = \sum_ {\ell = 0} ^ {q} \sum_ {j = 1} ^ {\alpha_ {\ell , d}} \langle y _ {j} ^ {\ell}, f \rangle_ {\mathbb {S} ^ {d - 1}} \cdot y _ {j} ^ {\ell} (\sigma). \tag {10}
$$
Theorem 6 (Lower Bound). Consider an error parameter  $\varepsilon > 0$ , and any (possibly randomized) algorithm that solves Problem 2 with probability greater than  $1/10$  for any input function  $f$  and makes at most  $r$  (possibly adaptive) queries on any input. Then  $r \geq \beta_{q,d}$ .
We describe a distribution on input function  $f$  on which any deterministic algorithm that takes  $r < \beta_{q,d}$  samples fails with probability  $\geq 9/10$ . The theorem then follows by Yao's principle.
Hard Input Distribution. For integer  $\ell \leq q$ , consider an orthonormal basis of  $\mathcal{H}_{\ell}\left(\mathbb{S}^{d-1}\right)$  and denote it by  $\left\{y_1^\ell, y_2^\ell, \ldots, y_{\alpha_{\ell,d}}^\ell\right\}$ . Let  $\mathbf{Y}_{\ell}: \mathbb{R}^{\alpha_{\ell,d}} \to \mathcal{H}_{\ell}\left(\mathbb{S}^{d-1}\right)$  be the quasi-matrix with  $y_j^\ell$  as its  $j^{th}$  column, i.e.,  $[\mathbf{Y}_\ell \cdot u](\sigma) \coloneqq \sum_{j=1}^{\alpha_{\ell,d}} u_j \cdot y_j^\ell(\sigma)$  for any  $u \in \mathbb{R}^{\alpha_{\ell,d}}$  and  $\sigma \in \mathbb{S}^{d-1}$ . Let  $v^{(0)} \in \mathbb{R}^{\alpha_{0,d}}, v^{(1)} \in \mathbb{R}^{\alpha_{1,d}}, \ldots, v^{(q)} \in \mathbb{R}^{\alpha_{q,d}}$  be independent random vectors with i.i.d. Gaussian entries:  $v_j^{(\ell)} \sim \mathcal{N}(0,1)$ . The random input is defined to be  $f \coloneqq \sum_{\ell=0}^{q} \mathbf{Y}_\ell \cdot v^{(\ell)}$ . In other words,  $f = \sum_{\ell=0}^{q} \mathbf{Y}_\ell \cdot v^{(\ell)}$  is a random linear combination of the eigenfunctions of  $\mathcal{K}_d^{(q)}$ . We prove that accurate
reconstruction of  $f$  drawn from the aforementioned distribution yields accurate reconstruction of random vectors  $v^{(0)}, v^{(1)}, \ldots, v^{(q)}$ . Since each  $v^{(\ell)}$  is  $\alpha_{\ell, d}$ -dimensional, this reconstruction requires  $\Omega(\sum_{\ell=0}^{q} \alpha_{\ell, d}) = \Omega(\beta_{q, d})$  samples, giving us a lower bound for accurate reconstruction of  $f$ .
First we show that finding an  $\tilde{f}^{(q)}$  satisfying the condition of Problem 2 is at least as hard as accurately finding all vectors  $v^{(0)}, v^{(1)}, \ldots, v^{(q)}$ . The following lemma is proved in Appendix E.
Lemma 6. If a deterministic algorithm solves Problem 2 with probability at least  $1/10$  over our random input distribution  $f = \sum_{\ell=0}^{q} \mathbf{Y}_{\ell} \cdot v^{(\ell)}$ , then with probability at least  $1/10$ , the output of the algorithm  $\tilde{f}^{(q)}$  satisfies  $\mathbf{Y}_{\ell}^{*}\tilde{f}^{(q)} = v^{(\ell)}$  for all integers  $\ell \leq q$ .
Finally, we complete the proof of Theorem 6 by arguing that if  $\tilde{f}^{(q)}$  is formed using less than  $\beta_{q,d}$  queries from  $f$ , then  $\sum_{\ell=0}^{q}\left\|\mathbf{Y}_{\ell}^{*}\tilde{f}^{(q)}-v^{(\ell)}\right\|_{2}^{2}>0$  with good probability, thus the bound of Lemma 6 cannot hold and  $\tilde{f}^{(q)}$  cannot be a solution to Problem 2. Assume for sake of contradiction that there is a deterministic algorithm which solves Problem 2 with probability  $\geq 1/10$  over the random input  $f=\sum_{\ell=0}^{q}\mathbf{Y}_{\ell}\cdot v^{(\ell)}$  that makes  $r=\beta_{q,d}-1$  queries on any input (we can modify an algorithm that makes fewer queries to make exactly  $\beta_{\ell,d}-1$  queries). For every  $\sigma\in\mathbb{S}^{d-1}$  and integer  $\ell\leq q$  define  $u_{\sigma}^{\ell}:=\left[y_{1}^{\ell}(\sigma),y_{2}^{\ell}(\sigma),\ldots,y_{\alpha_{\ell,d}}^{\ell}(\sigma)\right]$ . Also define  $\boldsymbol{u}_{\sigma}:=\left[u_{\sigma}^{0},u_{\sigma}^{1},\ldots,u_{\sigma}^{q}\right]\in\mathbb{R}^{\beta_{q,d}}$  and  $\boldsymbol{v}\in\mathbb{R}^{\beta_{q,d}}$  as  $\boldsymbol{v}:=\left(v^{(0)},v^{(1)},\ldots,v^{(q)}\right)$ . Additionally, define the quasi-matrix  $\boldsymbol{Y}:=[\boldsymbol{Y}_0,\dots,\boldsymbol{Y}_q]$ .
Using the above notations and the definition of the hard input instance  $f$ , each query to  $f$  is in fact a query to the random vector  $\mathbf{v}$  in the form of  $f(\sigma) = \langle \mathbf{u}_{\sigma}, \mathbf{v} \rangle$ . Now consider a deterministic function  $Q$ , that is given input  $V \in \mathbb{R}^{i \times \beta_{q,d}}$  (for any positive integer  $i$ ) and outputs  $Q(V) \in \mathbb{R}^{\beta_{q,d} \times \beta_{q,d}}$  such that  $Q(V)$  has orthonormal rows with the first  $i$  rows spanning the  $i$  rows of  $V$ . If  $\sigma_1, \sigma_2, \ldots, \sigma_r \in \mathbb{S}^{d-1}$  denote the points where our algorithm queries the input  $f$ , for any integer  $i \in [r]$ , let  $Q^i$  be an orthonormal matrix whose first  $i$  rows span the first  $i$  queries of the algorithm, i.e.,  $Q^i := Q([u_{\sigma_1}, u_{\sigma_2}, \ldots, u_{\sigma_i}]^\top)$ . Since the algorithm is deterministic,  $Q^i$  is a deterministic function of input  $\mathbf{v}$ . The following claim is proved in [AKM+19]:
Claim 3 (Claim 23 of  $\mathrm{[AKM^{+}19]}$ ). Conditioned on the queries  $f(\sigma_1), f(\sigma_2), \ldots, f(\sigma_r)$  for  $r < \beta_{q,d}$ , the variable  $[\mathbf{Q}^r \cdot \mathbf{v}]_{(\beta_{q,d})}$  is distributed as  $\mathcal{N}(0,1)$ .
Now using Claim 3 we can write,
$$
\begin{array}{l} \operatorname * {P r} _ {\pmb {v}} \left[ \sum_ {\ell = 0} ^ {q} \left\| v ^ {(\ell)} - \pmb {Y} _ {\ell} ^ {*} \tilde {f} ^ {(q)} \right\| _ {2} ^ {2} = 0 \right] = \operatorname * {P r} _ {\pmb {v}} \left[ \pmb {Q} ^ {r} \pmb {v} = \pmb {Q} ^ {r} \pmb {Y} ^ {*} \tilde {f} ^ {(q)} \right] \leq \operatorname * {P r} _ {\pmb {v}} \left[ [ \pmb {Q} ^ {r} \pmb {v} ] _ {\beta_ {q, d}} = [ \pmb {Q} ^ {r} \pmb {Y} ^ {*} \tilde {f} ^ {(q)} ] _ {\beta_ {q, d}} \right] \\ = \mathbb {E} \left[ \Pr_ {\boldsymbol {v}} \left[ \left[ \boldsymbol {Q} ^ {r} \boldsymbol {v} \right] _ {\beta_ {q, d}} = \left[ \boldsymbol {Q} ^ {r} \boldsymbol {Y} ^ {*} \tilde {f} ^ {(q)} \right] _ {\beta_ {q, d}} \mid f (\sigma_ {1}), \dots , f (\sigma_ {r}) \right] \right], \\ \end{array}
$$
where the expectation in the last line is taken over the randomness of  $f(\sigma_1), \ldots, f(\sigma_r)$ . Conditioned on  $f(\sigma_1), \ldots, f(\sigma_r)$ ,  $\left[ Q^r Y^* \tilde{f}^{(q)} \right] (\beta_{q,d})$  is a fixed quantity because the algorithm determines  $\tilde{f}^{(q)}$  given the knowledge of the queries  $f(\sigma_1), \ldots, f(\sigma_r)$ . Furthermore, by Claim 3,  $[Q^r \cdot v](\beta_{q,d})$  is a random variable distributed as  $\mathcal{N}(0,1)$ , conditioned on  $f(\sigma_1), \ldots, f(\sigma_r)$ . This implies that,
$$
\Pr \left[ \left[ \boldsymbol {Q} ^ {r} \cdot \boldsymbol {v} \right] (\beta_ {q, d}) = \left[ \boldsymbol {Q} ^ {r} \boldsymbol {Y} ^ {*} \tilde {f} ^ {(q)} \right] (\beta_ {q, d}) \mid f (\sigma_ {1}), \dots , f (\sigma_ {r}) \right] = 0.
$$
Thus,  $\operatorname*{Pr}\left[\sum_{\ell=0}^{q}\left\|v^{(\ell)} - \mathbf{Y}_{\ell}^{*}\tilde{f}^{(q)}\right\|_{2}^{2}=0\right]=\mathbb{E}_{f(\sigma_{1}),\ldots,f(\sigma_{r})}[0]=0$ . However, we have assumed that this algorithm solves Problem 2 with probability at least  $1/10$ , and hence, by Lemma 6,  $\operatorname*{Pr}\left[\sum_{\ell=0}^{q}\|v^{(\ell)}-\mathbf{Y}_{\ell}^{*}\tilde{f}^{(q)}\|_{2}^{2}=0\right] \geq 1/10$ . This is a contradiction, yielding Theorem 6.
5 Numerical Evaluation
Noise-free Setting. For a fixed  $q$ , we generate a random function  $f(\sigma) = \sum_{\ell=0}^{q} c_{\ell} P_d^\ell (\langle \sigma, v \rangle)$  where  $v \sim \mathcal{U}(\mathbb{S}^{d-1})$  and  $c_\ell$ 's are i.i.d. samples from  $\mathcal{N}(0, 1)$ . Then,  $f$  is recovered by running Algorithm 1 with  $s$  random evaluations of  $f$  on  $\mathbb{S}^{d-1}$ . Note that  $\| \mathcal{K}_d^{(q)} f - f \|_{\mathbb{S}^{d-1}} = 0$  since  $f \in \mathcal{H}^{(q)}(\mathbb{S}^{d-1})$ , thus,
(a)  $d = 3$
(b)  $d = 4$
Figure 1: (Left) Empirical success probabilities of Algorithm 1 varying the number of samples  $s$  and the degree of spherical harmonic expansion  $q$ . (Right) The dimension  $\beta_{q,d}$  of the Hilbert space  $\mathcal{H}^{(q)}(\mathbb{S}^{d-1})$  as a function of  $q$  when (a)  $d = 3$  and (b)  $d = 4$ , respectively.
Figure 2: (Left) Empirical success probabilities of Algorithm 1 in presence of additive noise, where "success" means the error's energy is below the noise level  $\| \tilde{f}^{(q)} - f\|_{\mathbb{S}^{d - 1}}\leq \| n\|_{\mathbb{S}^{d - 1}}$ . (Right) The error's norm  $\| \tilde{f}^{(q)} - f\|_{\mathbb{S}^{d - 1}}$  as a function of  $q$  when (a)  $d = 3$  and (b)  $d = 4$ , respectively.
as shown in Theorem 4, Algorithm 1 can recover  $f$  "exactly" using  $s = \mathcal{O}(\beta_{q,d}\log \beta_{q,d})$  evaluations, where  $\beta_{q,d}$  is the dimension of the Hilbert space  $\mathcal{H}^{(q)}(\mathbb{S}^{d - 1})$ . We predict  $f$ 's value on a random test set on  $\mathbb{S}^{d - 1}$  and consider the algorithm fails if the testing error is greater than  $10^{-12}$ . We count the number of failures among 100 independent random trials with different choices of  $d\in \{3,4\}$ ,  $q\in \{5,\ldots ,22\}$ , and  $s\in \{40,\dots ,2400\}$ . The empirical success probabilities for  $d = 3$  and 4 are reported in Fig. 1(a) and Fig. 1(b), respectively. Fig. 1 illustrates that the success probabilities of our algorithm sharply transition to 1 as soon as the number of samples approaches  $s\approx \beta_{q,d}$  for a wide range of  $q$  and both  $d = 3,4$ . These experimental results complement our Theorem 4 along with the lower bound analysis in Section 4 and empirically verify the performance of our algorithm.
Noisy Setting. We repeated our experiments in the presence of an additive noise which is a linear combination of random spherical harmonics of degrees  $q + 1$  to  $2q$ . More precisely, we let the noise be  $n(\sigma) = \sum_{\ell = q + 1}^{2q}c_{\ell}P_{d}^{\ell}(\langle v,\sigma \rangle)\in \mathcal{H}^{(2q)}(\mathbb{S}^{d - 1})\setminus \mathcal{H}^{(q)}(\mathbb{S}^{d - 1})$  for  $c_{\ell}$ 's that are i.i.d. samples from  $\mathcal{N}(0,1)$ . We then re-scale the noise to have norm  $\| n\|_{\mathbb{S}^{d - 1}} = 10^{-6}$ . Furthermore, the function  $f$  is defined as before, and  $f$  is recovered by Algorithm 1 with  $s$  random evaluations of  $f + n$  on  $\mathbb{S}^{d - 1}$ . The heat-maps in Fig. 2 are generated by considering an instance of our algorithm as a "success" if the error's energy is below the noise level,  $\left\| \tilde{f}^{(q)} - f\right\|_{\mathbb{S}^{d - 1}}\leq \| n\|_{\mathbb{S}^{d - 1}} = 10^{-6}$ . The success probability transitions less sharply than the noiseless setting but the shift of probabilities starts at  $\beta_{s,q}$  samples.
We studied the problem of robustly recovering spherical harmonic expansion of a function defined on the sphere. The number of function evaluations needed to recover its degree- $q$  expansion is the dimension of spherical harmonics of degree at most  $q$ , up to a logarithmic factor. We develop a simple yet efficient kernel regression-based algorithm to recover degree- $q$  expansion of the function by only evaluating the function on uniformly sampled points on the sphere. Unlike the prior results on fast spherical harmonic transform, our algorithm works efficiently using a nearly optimal number of samples in any dimension. We believe our findings would appeal to the readership of the community.
$\left[\mathrm{ZHA}^{+}21\right]$  Amir Zandieh, Insu Han, Haim Avron, Neta Shoham, Chaewon Kim, and Jinwoo Shin. Scaling Neural Tangent Kernels via Sketching and Random Features. In Neural Information Processing Systems (NeurIPS), 2021.
A Properties of Gegenbauer Polynomials and Spherical Harmonics