SlowGuess/NeurIPS_2023_OCR huggingface dataset:
We need to obtain a similar relation (11), but for  $g \in H_N^{(4)}$ . Each value  $g(a + kh)$  in Eq. (11) belongs to one of the  $2^N$  branches  $\widetilde{g} \in \widetilde{H}_N^{(4)}$ , which we associate with  $p = 2^N$  colors. By applying van der Waerden's theorem with  $p = 2^N$  and  $s = \widetilde{m} + 1$ , we see that if we set  $m = N_{\mathrm{vdW}}(\widetilde{m} + 1, 2^N) - 1$ , then the length-  $(m + 1)$  progression  $a, a + h, \ldots, a + mh$  appearing in Eq. (11) contains at least one length-  $(\widetilde{m} + 1)$  sub-progression  $\widetilde{a}, \widetilde{a} + \widetilde{h}, \ldots, \widetilde{a} + \widetilde{m}\widetilde{h}$  on which the values of  $g$  belong to the same branch. We can then satisfy condition (11) by defining the polynomial  $R$  by
$$
R \left(z _ {0}, \dots , z _ {m}\right) = \prod_ {\mathbf {s} = \left(s _ {0}, \dots , s _ {\widetilde {m}}\right)} \widetilde {R} \left(z _ {s _ {0}}, \dots , z _ {s _ {\widetilde {m}}}\right), \tag {128}
$$
where  $s$  runs over all length-  $(\widetilde{m} +1)$  progressions from the set  $\{0,\ldots ,m\}$
D Proof of Theorem 8
The "only if" part follows from Theorem 5. The "if" part is a generalization of Lemma 1 from [29]. Suppose that  $\sigma$  is not a polynomial; we want to prove that  $H^{\sigma} \in \mathcal{G}_1$ . By absorbing  $h$  in  $\sigma$ , we can assume that  $\sigma(0) \neq 0$ . Dropping then  $h$ , we specialize to  $f(x) = c \sin(\omega \sigma(bx))$ . Consider an arbitrary finite subset  $X = \{x_1, \ldots, x_N\} \subset [0,1]$ . By Theorem 2, it is sufficient to show that there exists  $b \in [-1,1]$  such that the values  $\sigma(bx_1), \ldots, \sigma(bx_N)$  are rationally independent. Suppose that this is not the case. For fixed coefficients  $\lambda = (\lambda_1, \ldots, \lambda_N)$ , the function  $\sigma_{\lambda}(b) = \sum_{n=1}^{N} \lambda_n \sigma(bx_n)$  is real analytic for  $b \in [-1,1]$ . Since there are only countably many  $\lambda \in \mathbb{Q}^N$ , there is some  $\lambda$  such that  $\sigma_{\lambda}$  vanishes at uncountably many  $b \in [-1,1]$ . Then, by analyticity,  $\sigma_{\lambda} \equiv 0$  on  $[-1,1]$ . Expanding this  $\sigma_{\lambda}$  into the Taylor series at  $b = 0$ , we get the identity  $\sum_{n=1}^{N} \lambda_n x_n^m = 0$  for each  $m$  such that  $\frac{d^m \sigma}{dw^m}(0) \neq 0$ . Suppose that  $x_k$  have the natural order  $0 \leq x_1 < \ldots < x_N$ . If there are infinitely many  $m$  for which  $\frac{d^m \sigma}{dw^m}(0) \neq 0$ , then, by letting  $m \to \infty$ , we first show that  $\lambda_N = 0$ , then  $\lambda_{N-1} = 0$ , etc. If  $x_1 > 0$ , then we exhaust all  $\lambda_n$  in this way; otherwise we exhaust all except  $\lambda_1$ . However,  $\lambda_1 = 0$  follows then from  $\sigma(0) \neq 0$ . Thus, either  $\lambda = 0$  or  $\sigma$  is a polynomial, which contradicts our assumption.
Suppose that the function sequence  $f_{n}(x) = c_{n}\sin (\omega_{n}\sigma (b_{n}x) + h_{n})$  converges to a nontrivial limit point  $f_{*}$ . By a compactness argument, this requires at least one of the parameters  $c_{n},\omega_{n}$  to be unbounded. We expect unboundedness of one parameter to be compensated by another parameter converging to 0. Accordingly, we consider three possibilities:  $\omega_{n}\rightarrow 0,\omega_{n}\rightarrow \omega \neq 0$  and  $\omega_{n}\to \infty$ . One of these possibilities can always be ensured by choosing a subsequence of  $f_{n}$ , if necessary (in the sequel we will without further mention repeatedly use such reductions based on compactness and/or transition to subsequences).
Case 1:  $\omega_{n} \to 0$ . Since  $\sigma(b_{n}x)$  is uniformly bounded by our assumption and  $\sin$  is periodic, we can assume that  $\omega_{n}\sigma(b_{n}x) + h_{n} \stackrel{n \to \infty}{\longrightarrow} a$  with some constant  $a \in [0,2\pi)$ , for all  $x \in [0,1]$ . If  $a \neq 0, \pi$ , then the limit  $f_{*}$  can only be trivial, a constant. Suppose that  $a = 0$  (the case  $a = \pi$  leads to analogous results). In this case  $f_{n}(x) = c_{n}(\omega_{n}\sigma(b_{n}x) + h_{n})(1 + o(1))$ , so  $f_{*}(x) = \lim_{n \to \infty} c_{n}(\omega_{n}\sigma(b_{n}x) + h_{n})$ . There are two possibilities:  $b_{n} \to b \neq 0$  and  $b_{n} \to 0$ . In the first case we obtain nontrivial limits
$$
f _ {*} (x) = a \sigma (b x) + c, \quad a, b, c \in \mathbb {R}. \tag {129}
$$
In the second case we can Taylor expand
$$
\sigma \left(b _ {n} x\right) = \sigma (0) + \frac {1}{r !} \frac {d ^ {r} \sigma}{d x ^ {r}} (0) \left(b _ {n} x\right) ^ {r} + o \left(b _ {n} ^ {r}\right), \quad \frac {d ^ {r} \sigma}{d w ^ {r}} (0) \neq 0. \tag {130}
$$
A nontrivial  $f_{*}$  requires  $c_{n}b_{n}^{r}$  to have a finite nonzero limit. In this case, by adjusting  $h_n$  we obtain nontrivial limits
$$
f _ {*} (x) = a _ {0} + a _ {r} x ^ {r}, \quad a _ {0}, a _ {r} \in \mathbb {R}. \tag {131}
$$
Case 2:  $\omega_{n} \to \omega \neq 0$ . Consider again the two possibilities:  $b_{n} \to b \neq 0$  and  $b_{n} \to 0$ . In the first case we do not get any nontrivial limits. In the second case we again have Taylor expansion (130). Arguing as in Case 1, the only nontrivial limits that we can produce are of the form (131).
Case 3:  $\omega_{n}\to \infty$ . In this case we must have  $b_{n}\rightarrow 0$ , since otherwise  $\sin (\omega_n\sigma (b_nx) + h_n)$  will have an unbounded number of alternating values  $\pm 1$ , so we must have  $c_{n}\rightarrow 0$  and accordingly the only possible limit is  $f_{*} = 0$ . It follows that we again have expansion (130), and
$$
f _ {n} (x) = c _ {n} \sin \left(\omega_ {n} \left(\sigma (0) + \frac {1}{r !} \frac {d ^ {r} \sigma}{d x ^ {r}} (0) \left(b _ {n} x\right) ^ {r} + o \left(b _ {n} ^ {r}\right)\right) + h _ {n}\right). \tag {132}
$$
To avoid triviality due to an unbounded number of alternating values  $\pm 1$  of  $\sin$ , we must have  $\omega_{n}b_{n}^{r} = O(1)$ . We get new nontrivial limits of  $f_{n}$  when  $\omega_{n}b_{n}^{r}$  has a nonzero limit:
$$
f _ {*} (x) = c \sin \left(a _ {0} + a _ {r} x ^ {r}\right), \quad a, a _ {0}, a _ {r} \in \mathbb {R}. \tag {133}
$$
We need to prove that  $H_N^{(5)}\in \mathcal{G}_1$  and  $H_N^{(5)}\notin \mathcal{G}_2$
Proof of  $H_N^{(5)} \in \mathcal{G}_1$ . For  $N \geq 2$ , this property can be concluded from Theorem 8, since we can just set  $\sigma(x) = \sin(x)$  and  $h = h \sin(0 \cdot x + \pi/2)$  in this theorem. In the case  $N = 1$ , observe that in the proof of Theorem 8 we only use  $h$  to redefine  $\sigma$  so that  $\sigma(0) \neq 0$ ; otherwise we can set  $h = 0$ . Then, this proof becomes applicable to the family  $f(x) = c \sin(\omega \sigma(bx))$  with  $\sigma(x) = \sin(x + h)$  and any phase  $h \neq \pi k, k \in \mathbb{Z}$ ; this is a subfamily of  $H_{N=1}^{(5)}$ .
Proof of  $H_N^{(5)} \notin \mathcal{G}_2$ . We will show that we cannot obtain a general continuous function as a limit of functions from  $H_N^{(5)}$ , because any such limit has a particular restrictive form.
We write  $f_{n}(x) = c_{n}\sin (g_{n}(x)) + h_{n}$  and consider several cases depending on the behavior of  $c_{n}$ .
Case 1:  $c_{n} \to 0$ . In this case the limiting function is constant:  $f_{*}(x) = h$ .
Case 2:  $c_{n} \to c \neq 0$ . In this case  $h_{n}$  must be bounded and hence can be assumed to converge to some  $h$  (by possibly choosing a subsequence). Denote  $\phi_{n}(y) = c_{n}\sin(y) + h_{n}$ ; then  $\phi_{n}(y)$  converges uniformly on  $\mathbb{R}$  to  $\phi_{*}(y) = c\sin(y) + h$ . Clearly, the functions  $\widetilde{f}_{n}(x) = \phi_{*}(g_{n})$  also uniformly converge to  $f_{*}$ .
Consider now two alternatives: either the family  $\{g_n\}$  is uniformly equicontinuous, or not. In the first case, fix some point  $x_0 \in [0,1]$ , let  $r_n = \left\lfloor \frac{g_n(x_0)}{2\pi} \right\rfloor$  and consider the shifted functions  $\widetilde{g}_n(x) = g_n(x) - 2\pi r_n$ . We have  $\phi_*(g_n(x)) \equiv \phi_*(\widetilde{g}_n(x))$ , the family  $\{\widetilde{g}_n\}$  is also equicontinuous, and  $\widetilde{g}_n(x_0) \in [0,2\pi]$  for all  $n$ , so that the family  $\{\widetilde{g}_n\}$  is additionally uniformly bounded on  $[0,1]$ . Then, by the Arzelà-Ascoli theorem, the family  $\{\widetilde{g}_n\}$  contains a uniformly convergent subsequence. It follows that  $f = \phi_*(g_*)$ , where  $g_*$  is a uniform limit of some functions from  $H_{N+1}^{(2)}$ . Theorem 4 describes all such limits.
In the case of the second alternative, there exist  $\epsilon > 0$  and a subsequence  $g_{n_s}$  such that for some  $x_s, x_s' \in [0,1]$  we have  $|x_s - x_s'| \to 0$  while  $|g_{n_s}(x_s) - g_{n_s}(x_s')| \geq \epsilon$  for all  $s$ . Let  $r_s = \left\lfloor \frac{g_{n_s}(x_s)}{2\pi} \right\rfloor$  and  $\widetilde{g}_s(x) = g_{n_s}(x) - 2\pi r_s$ . Then  $\widetilde{g}_s(x_s) \in [0,2\pi]$  and by choosing a subsequence we can assume that  $g_s(x_s)$  converges to some  $y_* \in [0,2\pi]$ . Using  $|\widetilde{g}_s(x_s) - \widetilde{g}_s(x_s')| \geq \epsilon$  and the continuity of  $\widetilde{g}_s$ , we can then assume that  $\widetilde{g}_s(x_s')$  converges to some  $y_*' \neq y_*$ . Also, we can assume that  $x_s$  and  $x_s'$  converge to
some  $x_{*}\in [0,1]$ . Then, by the uniform convergence of  $\widetilde{f_n}$ ,  $\sup_{x\in [x_s,x_s']}|\widetilde{f}_{n_s}(x) - \widetilde{f}_*(x_*)| \to 0$  as  $s\to \infty$ . On the other hand,  $\widetilde{f}_{n_s}(x) = \phi_*(g_{n_s}(x)) = \phi_*(\widetilde{g}_s(x))$  so that, by the continuity of  $\widetilde{g}_s$ ,
$$
\lim  _ {s \rightarrow \infty} \sup  _ {x \in \left[ x _ {s}, x _ {s} ^ {\prime} \right]} \left| \widetilde {f} _ {n _ {s}} (x) - \widetilde {f} _ {*} \left(x _ {*}\right)\right| \geq \sup  _ {y \in \left[ y _ {*}, y _ {*} ^ {\prime} \right]} \left| \phi_ {*} (y) - \widetilde {f} _ {*} \left(x _ {*}\right)\right| \neq 0, \tag {134}
$$
because  $\phi_*$  in nonconstant on any interval  $[y_*, y_*']$ . This contradiction shows that the second alternative is impossible.
Case 3:  $c_n \to \infty$ . In this case the range of  $g_{n}$  must shrink, since otherwise the range of  $f_{n}$  would be unbounded. Taking a subsequence, we can assume that for some  $y_0 \in [0,2\pi ]$  we have  $g_{n}(x) = y_{0} + 2\pi m_{n} + o(1)$  uniformly on [0, 1]. We can then Taylor expand
$$
\begin{array}{l} f _ {n} (x) = h _ {n} + c _ {n} \sin \left(y _ {0}\right) + c _ {n} \cos \left(y _ {0}\right) \left(g _ {n} - y _ {0} - 2 \pi m _ {n}\right) (135) \\ - \frac {c _ {n}}{2} \sin \left(y _ {0}\right) \left(g _ {n} - y _ {0} - 2 \pi m _ {n}\right) ^ {2} + c _ {n} O \left(\left(g _ {n} - y _ {0} - 2 \pi m _ {n}\right) ^ {3}\right). (136) \\ \end{array}
$$
If  $\cos(y_0) \neq 0$ , then the respective term dominates the higher order terms and must be bounded as  $n$  increases. We can then discard the higher order terms, and we see that  $f_*$  is a uniform limit of the functions  $c_n g_n - a_n$  with some  $a_n$ . These limits are among the limits of the family  $H_{N+1}^{(2)}$ , again covered by Theorem 4.
If  $\cos(y_0) = 0$ , then the respective term vanishes and the next, second order term will dominate the higher order terms. In this case  $f_*$  is a limit of functions of the form  $\psi_n = h_n + a_n (g_n - b_n)^2$ . Substituting  $g_n \in H_N^{(2)}$  and expanding products of sines, we see that  $\psi_n \in H_{1+2(N+1)^2}^{(2)}$ , so, again, the limits of  $\psi_n$  are restricted by Theorem 4.