SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
\begin{array}{l} \frac {1}{\pi} \left[ \cos^ {- 1} \left(\frac {c S _ {0}}{K I \left(\omega_ {\max }\right)}\right) - \cos^ {- 1} \left(\frac {S _ {0}}{K I \left(\omega_ {\max }\right)}\right) \right] \geq \frac {1}{\pi K I \left(\omega_ {\max }\right)} (c - 1) S _ {0} \left. \frac {d}{d s} \cos^ {- 1} (s) \right| _ {s \in \left(c S _ {0}, S _ {0}\right)} \\ = \frac {1}{\pi K I (\omega_ {\mathrm {m a x}})} (c - 1) S _ {0} \times - \frac {1}{\sqrt {1 - s ^ {2}}} \\ = \frac {(1 - c) S _ {0}}{\pi K I (\omega_ {\mathrm {m a x}}) \sqrt {1 - s ^ {2}}} \\ \geq \frac {(1 - c) S _ {0}}{\pi K I (\omega_ {\max})} \\ \geq \frac {2 \Delta_ {\mathrm {s i m}}}{\pi^ {2} K I \left(\omega_ {\max }\right) \omega_ {\max }} + \frac {2 L _ {\cos}}{\pi \sqrt {K I \left(\omega_ {\max }\right) M}} \tag {46} \\ \end{array}
$$
The last inequality (i) is due to the conditions that:
$$
\omega_ {\max } > \frac {4 \Delta_ {\operatorname {s i m}}}{\pi (1 - c) S _ {0}}; \quad M > \left[ \frac {4 L _ {\cos}}{(1 - c) S _ {0}} \right] ^ {2} K I (\omega_ {\max }) \tag {47}
$$
This leads us to the following relationship:
$$
\begin{array}{l} 1 - \frac {1}{\pi} \cos^ {- 1} \left(\frac {c S _ {0}}{K I (\omega_ {\mathrm {m a x}})}\right) + \frac {L _ {\mathrm {c o s}}}{\pi \sqrt {K M}} + \frac {\Delta_ {\mathrm {s i m}}}{\pi^ {2} K I (\omega_ {\mathrm {m a x}}) \omega_ {\mathrm {m a x}}} \\ \leq 1 - \frac {1}{\pi} \cos^ {- 1} \left(\frac {S _ {0}}{K I \left(\omega_ {\max }\right)}\right) - \frac {L _ {\cos}}{\pi \sqrt {K M}} - \frac {\Delta_ {\operatorname {s i m}}}{\pi^ {2} K I \left(\omega_ {\max }\right) \omega_ {\max }} \tag {48} \\ \end{array}
$$
$$
\begin{array}{l} p _ {2} = 1 - \frac {1}{\pi} \cos^ {- 1} \left(\frac {\mathrm {s i m} (q , x)}{K I (\omega_ {\mathrm {m a x}})} \Big | _ {\mathrm {s i m} (q, x) <   c S _ {0}}\right) + \frac {L _ {\mathrm {c o s}}}{\pi \sqrt {K M}} + \frac {\Delta_ {\mathrm {s i m}}}{\pi^ {2} K I (\omega_ {\mathrm {m a x}}) \omega_ {\mathrm {m a x}}} \\ \leq 1 - \frac {1}{\pi} \cos^ {- 1} \left(\frac {c S _ {0}}{K I (\omega_ {\max})}\right) + \frac {L _ {\mathrm {c o s}}}{\pi \sqrt {K M}} + \frac {\Delta_ {\mathrm {s i m}}}{\pi^ {2} K I (\omega_ {\max}) \omega_ {\max}} \\ \leq 1 - \frac {1}{\pi} \cos^ {- 1} \left(\frac {S _ {0}}{K I (\omega_ {\max})}\right) - \frac {L _ {\mathrm {c o s}}}{\pi \sqrt {K M}} - \frac {\Delta_ {\mathrm {s i m}}}{\pi^ {2} K I (\omega_ {\max}) \omega_ {\max}} \\ \leq 1 - \frac {1}{\pi} \cos^ {- 1} \left(\frac {\mathrm {s i m} (q , x)}{K I (\omega_ {\mathrm {m a x}})} \Big | _ {\mathrm {s i m} (q, x) > S _ {0}}\right) - \frac {L _ {\mathrm {c o s}}}{\pi \sqrt {K M}} - \frac {\Delta_ {\mathrm {s i m}}}{\pi^ {2} K I (\omega_ {\mathrm {m a x}}) \omega_ {\mathrm {m a x}}} \\ = p _ {1} \tag {49} \\ \end{array}
$$
D.3 Effect of truncating frequencies
Lemma D.1. Let  $\widehat{\mathrm{sim}}_{\omega_{\mathrm{max}}}(q,x) = \mathbb{E}_{\omega \sim p(\omega)}[F_q(\iota \omega)^\top F_x(\iota \omega)]$  with  $p(\omega)$  being defined as follows:
$$
p (\omega) \propto \left\{ \begin{array}{l l} \prod_ {k \in [ K ]} | \operatorname {R e} \left(S \left(\iota \omega_ {k}\right)\right) | + | \operatorname {I m} \left(S \left(\iota \omega_ {k}\right) \right| & \text {i f ,} \omega \in \left[ - \omega_ {\max }, \omega_ {\max } \right] \\ 0 & \text {o t h e r w i s e} \end{array} \right. \tag {50}
$$
Then, if  $T > \max_{\boldsymbol{x}, \boldsymbol{q}} \| \boldsymbol{x} - \boldsymbol{q} \|_{\infty}$ , then we have:
$$
\left| \widehat {\operatorname {s i m}} _ {\omega_ {\max }} (q, x) - \operatorname {s i m} (q, x) \right| \leq \frac {6 K + 2 K \max  \left\{1 , \frac {T}{T - \operatorname* {m a x} _ {\boldsymbol {x} , \boldsymbol {q}} \left\| \boldsymbol {x} - \boldsymbol {q} \right\| _ {\infty}} \right\}}{\pi \omega_ {\max }} \tag {51}
$$
Proof Let  $S(\iota \omega)$  be the Fourier transform of  $s(t)$ ,  $\mathcal{F}^{-1}$  is the inverse Fourier transform,  $\star$  is the convolution operator. Further, we define the LOWPASS  $(\omega | \omega_{\max})$  is defined as
$$
\operatorname {L O W P A S S} (\omega \mid \omega_ {\max }) = 1 \text {i f} | \omega | \leq \omega_ {\max } \text {a n d} 0 \text {o t h e r w i s e .} \tag {52}
$$
Let us define the filtered or frequency truncated signal of  $s(t)$  as defined in Eq. (4) as:
$$
\begin{array}{l} \widehat {s} _ {\omega_ {\max}} (t) = \mathcal {F} ^ {- 1} \left[ S (\iota \omega) \mathrm {L O W P A S S} \left(\omega \mid \omega_ {\max}\right) \right] \\ = \mathcal {F} ^ {- 1} [ S (\iota \omega) ] \star \mathcal {F} ^ {- 1} \left[ \operatorname {L O W P A S S} (\omega | \omega_ {\max }) \right]. \tag {53} \\ \end{array}
$$
In this context,  $\widehat{\mathrm{sim}}_{\omega_{\mathrm{max}}}(q,x)$  can be expressed as follows:
$$
\widehat {\operatorname {s i m}} _ {\omega_ {\max }} (q, x)
$$
$$
= \int_ {\boldsymbol {\omega} \in \Omega} \boldsymbol {F} _ {q} (\iota \boldsymbol {\omega}) ^ {\top} \boldsymbol {F} _ {x} (\iota \boldsymbol {\omega}) p (\boldsymbol {\omega}) d \boldsymbol {\omega} \tag {54}
$$
$$
= \int_ {\boldsymbol {\omega} \in \Omega} \boldsymbol {S} _ {q} (\iota \boldsymbol {\omega}) ^ {\top} \boldsymbol {S} _ {c} (\iota \boldsymbol {\omega}) d \boldsymbol {\omega} \tag {55}
$$
$$
= \sum_ {k \in [ K ]} \int_ {- \omega_ {\max }} ^ {\omega_ {\max }} \left[ \operatorname {R e} \left(S \left(\iota \omega_ {k}\right)\right) \cos \left(\omega_ {k} (\boldsymbol {q} [ k ] - \boldsymbol {x} [ k ])\right) - \operatorname {I m} \left(S \left(\iota \omega_ {k}\right)\right) \sin \left(\omega_ {k} (\boldsymbol {q} [ k ] - \boldsymbol {x} [ k ])\right) \right] d \omega_ {k} \tag {56}
$$
$$
\stackrel {(i)} {=} \sum_ {k \in [ K ]} \int_ {- \omega_ {\max }} ^ {\omega_ {\max }} \left[ \operatorname {R e} \left(S \left(\iota \omega_ {k}\right)\right) \cos \left(\omega_ {k} \left(\boldsymbol {q} [ k ] - \boldsymbol {x} [ k ]\right)\right) - \operatorname {I m} \left(S \left(\iota \omega_ {k}\right)\right) \sin \left(\omega_ {k} \left(\boldsymbol {q} [ k ] - \boldsymbol {x} [ k ]\right)\right) \right] d \omega_ {k}
$$
$$
+ \sum_ {k \in [ K ]} \iota \int_ {- \omega_ {\max }} ^ {\omega_ {\max }} \underbrace {\left[ \operatorname {I m} \left(S \left(\iota \omega_ {k}\right)\right) \cos \left(\omega_ {k} \left(\boldsymbol {q} [ k ] - \boldsymbol {x} [ k ]\right)\right) + \operatorname {R e} \left(S \left(\iota \omega_ {k}\right)\right) \sin \left(\omega_ {k} \left(\boldsymbol {q} [ k ] - \boldsymbol {x} [ k ]\right)\right) \right]} _ {\text {O d d f u n c t i o n i n} \omega_ {k}} d \omega_ {k} \tag {57}
$$
$$
= \sum_ {k \in [ K ]} \int_ {- \omega_ {\max }} ^ {\omega_ {\max }} \left[ \operatorname {R e} \left(S \left(\iota \omega_ {k}\right)\right) + \iota \operatorname {I m} \left(S \left(\iota \omega_ {k}\right)\right) \exp \left(\iota \omega_ {k} (\boldsymbol {q} [ k ] - \boldsymbol {x} [ k ])\right) d \omega_ {k} \right. \tag {58}
$$
$$
= \sum_ {k \in [ K ]} \int_ {- \omega_ {\max }} ^ {\omega_ {\max }} S \left(\iota \omega_ {k}\right) \exp \left(\iota \omega_ {k} (\boldsymbol {q} [ k ] - \boldsymbol {x} [ k ])\right) d \omega_ {k} \tag {59}
$$
$$
= \sum_ {k \in [ K ]} \int_ {- \infty} ^ {\infty} S (\iota \omega_ {k}) \operatorname {L O W P A S S} \left(\omega_ {k} \mid \omega_ {\max }\right) \exp \left(\omega_ {k} \left(\boldsymbol {q} [ k ] - \boldsymbol {x} [ k ]\right)\right) d \omega_ {k} \tag {60}
$$
$$
= \sum_ {k \in [ K ]} \mathcal {F} ^ {- 1} \left[ S \left(\iota \omega_ {k}\right) \operatorname {L O W P A S S} \left(\omega_ {k} \mid \omega_ {\max }\right) \right] \tag {61}
$$
$$
\stackrel {(i i)} {=} \sum_ {k \in [ K ]} \widehat {s} _ {\omega_ {\max }} (q [ k ] - x [ k ]) \tag {62}
$$
Equality (i) is due to the fact that the newly added imaginary integrand is an odd function (since,  $\mathrm{Im}(S(\imath \omega)) = -\mathrm{Im}(S(-\imath \omega))$  and  $\mathrm{Re}(S(\imath \omega)) = \mathrm{Re}(S(-\imath \omega)))$  and thus, the integral from  $-\omega_{\max}$  and  $\omega_{\max}$  is zero. Equality (ii) is due to Eq. (53). Next we focus on  $\widehat{s}_{\omega_{\max}}(t)$ . Since  $\mathcal{F}^{-1}[S(\imath \omega)] =$
$s(t)$  and  $\mathcal{F}^{-1}\left[\mathrm{LOWPASS}(\omega \mid \omega_{\max}) = \frac{\sin\omega_{\max}t}{\pi t}\right.$ , we have:
$$
\begin{array}{l} \widehat {s} _ {\omega_ {\max }} (t) = \int_ {- \infty} ^ {\infty} s (t - \tau) \frac {\sin \omega_ {\max } \tau}{\pi \tau} d \tau (63) \\ = \int_ {- \infty} ^ {\infty} s \left(t - \frac {\tau}{\omega_ {\operatorname* {m a x}}}\right) \frac {\sin \tau}{\pi \tau} d \tau (64) \\ = \int_ {- \infty} ^ {\infty} s (t) \frac {\sin \tau}{\pi \tau} d \tau + \underbrace {\left[ s \left(t - \frac {\tau}{\omega_ {\operatorname* {m a x}}}\right) - s (t) \right]} _ {\Delta s \left(t - \frac {\tau}{\omega_ {\operatorname* {m a x}}}\right)} \frac {\sin \tau}{\pi \tau} d \tau (65) \\ = s (t) \int_ {- \infty} ^ {\infty} \frac {\sin \tau}{\pi \tau} d \tau + \int_ {- \infty} ^ {\infty} \underbrace {\left[ s \left(t - \frac {\tau}{\omega_ {\operatorname* {m a x}}}\right) - s (t) \right]} _ {\Delta s \left(t - \frac {\tau}{\omega_ {\operatorname* {m a x}}}\right)} \frac {\sin \tau}{\pi \tau} d \tau (66) \\ = s (t) + \int_ {- \infty} ^ {\infty} \left[ s \left(t - \frac {\tau}{\omega_ {\operatorname* {m a x}}}\right) - s (t) \right] \frac {\sin \tau}{\pi \tau} d \tau (67) \\ \end{array}
$$
We only consider the case when  $t \in (-T, T)$ . We decompose the error term  $\widehat{s}_{\omega_{\max}}(t) - s(t)$  as:
$$
\begin{array}{l} \widehat {s} _ {\omega_ {\max }} (t) - s (t) = \int_ {- \infty} ^ {\omega_ {\max } (t - T)} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau + \int_ {\omega_ {\max } (t - T)} ^ {\omega_ {\max } t} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau (68) \\ + \int_ {\omega_ {\max } t} ^ {\omega_ {\max } (t + T)} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau + \int_ {\omega_ {\max } (t + T)} ^ {\infty} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau (69) \\ \end{array}
$$
Bounding the error  $\left|\widehat{s}_{\omega_{\max}}(t) - s(t)\right|$  when  $-T < t \leq 0$ . We separately bound the four integrals as follows:
Bound on the first integral  $\int_{-\infty}^{\omega_{\max}(t - T)}\Delta s\left(t - \frac{\tau}{\omega_{\max}}\right)\frac{\sin\tau}{\pi\tau} d\tau$ : Thus,  $s\left(t - \frac{\tau}{\omega_{\max}}\right) = 0$  and  $\Delta s\left(t - \frac{\tau}{\omega_{\max}}\right) = s\left(t - \frac{\tau}{\omega_{\max}}\right) - s(t) = 0 - T$ . We compute the bound on the first term as:
$$
\begin{array}{l} \int_ {- \infty} ^ {\omega_ {\max } (t - T)} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau = - T \int_ {- \infty} ^ {\omega_ {\max } (t - T)} \frac {\sin \tau}{\pi \tau} d \tau (70) \\ = - T \int_ {\omega_ {\max } (T - t)} ^ {\infty} \frac {\sin \tau}{\pi \tau} d \tau (71) \\ \end{array}
$$
Thus, from Proposition D.2, we have:
$$
\left| \int_ {- \infty} ^ {\omega_ {\max } (t - T)} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau \right| \leq \frac {2 T}{\pi \omega_ {\max } (T - t)} \leq \frac {2}{\pi \omega_ {\max }} \quad (\text {s i n c e} t <   0) \tag {72}
$$
Bound on the second integral  $\int_{\omega_{\max}(t - T)}^{\omega_{\max}t}\Delta s\left(t - \frac{\tau}{\omega_{\max}}\right)\frac{\sin\tau}{\pi\tau} d\tau$  Since  $\tau \in (\omega_{\max}(t - T),\omega_{\max}t]$  we have  $0\leq t - \tau /\omega_{\mathrm{max}} <   T$  . Thus,  $s\left(t - \frac{\tau}{\omega_{\mathrm{max}}}\right) = T - t + \frac{\tau}{\omega_{\mathrm{max}}}$
We compute the bound on the second term as:
$$
\begin{array}{l} \int_ {\omega_ {\max } (t - T)} ^ {\omega_ {\max } t} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau (73) \\ = \int_ {\omega_ {\max } (t - T)} ^ {\omega_ {\max } t} \left(T - t + \frac {\tau}{\omega_ {\max }} - T\right) \frac {\sin \tau}{\pi \tau} d \tau (74) \\ = - t \int_ {\omega_ {\max } (t - T)} ^ {\omega_ {\max } t} \frac {\sin \tau}{\pi \tau} d \tau + \int_ {\omega_ {\max } (t - T)} ^ {\omega_ {\max } t} \frac {\tau}{\omega_ {\max }} \frac {\sin \tau}{\pi \tau} d \tau (75) \\ = - t \int_ {\omega_ {\max } (t - T)} ^ {\omega_ {\max } t} \frac {\sin \tau}{\pi \tau} d \tau + \frac {\cos \omega_ {\max } (t - T) - \cos \omega_ {\max } t}{\pi \omega_ {\max }} (76) \\ \end{array}
$$
$$
\left| \int_ {\omega_ {\max } (t - T)} ^ {\omega_ {\max } t} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau \right| \leq \frac {2 t}{\pi \omega_ {\max } t} + \frac {2}{\pi \omega_ {\max }} = \frac {4}{\pi \omega_ {\max }} \tag {77}
$$
Bound on the third integral  $\int_{\omega_{\max}t}^{\omega_{\max}(t + T)}\Delta s\left(t - \frac{\tau}{\omega_{\max}}\right)\frac{\sin\tau}{\pi\tau} d\tau$ : When  $\tau \in (\omega_{\max}t,\omega_{\max}(t + T)]$  we have  $-T \leq t - \tau /\omega_{\max} < 0$ . Moreover,  $-T \leq t < 0$ . Thus,  $s(t) = s(t - \tau /\omega_{\max}) = T$ , resulting in  $\Delta s\left(t - \frac{\tau}{\omega_{\max}}\right) = 0$  and the third integral is zero.
$$
\int_ {\omega_ {\max } t} ^ {\omega_ {\max } (t + T)} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau = 0 \tag {78}
$$
Bound on the fourth integral  $\int_{\omega_{\max}(t + T)}^{\infty}\Delta s\left(t - \frac{\tau}{\omega_{\max}}\right)\frac{\sin\tau}{\pi\tau} d\tau$ : When  $\tau \in (\omega_{\max}(t + T),\infty)$ , we have  $-\infty < t - \tau /\omega_{\max} < -T$ . Then,  $s\left(t - \frac{\tau}{\omega_{\max}}\right) = 0$
We compute the bound on the first term as:
$$
\int_ {\omega_ {\max } (T + t)} ^ {\infty} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau = - T \int_ {\omega_ {\max } (T + t)} ^ {\infty} \frac {\sin \tau}{\pi \tau} d \tau \tag {79}
$$
$$
\left| \int_ {\omega_ {\max } (T + t)} ^ {\infty} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau \right| \leq \frac {2 T}{\pi \omega_ {\max } (T + t)} \tag {81}
$$
Bounding the error  $\left|\widehat{s}_{\omega_{\max}}(t) - s(t)\right|$  when  $0 \leq t < T$
$$
\begin{array}{l} \widehat {s} _ {\omega_ {\max }} (t) - s (t) = \int_ {- \infty} ^ {\omega_ {\max } (t - T)} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau + \int_ {\omega_ {\max } (t - T)} ^ {\omega_ {\max } t} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau (82) \\ + \int_ {\omega_ {\max } t} ^ {\infty} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau (83) \\ \end{array}
$$
Now, since  $0 \leq t < T$ , we have  $s(t) = T - t$ , throughout the next part of the proof.
Bound on the first integral  $\int_{-\infty}^{\omega_{\max}(t - T)}\Delta s\left(t - \frac{\tau}{\omega_{\max}}\right)\frac{\sin\tau}{\pi\tau} d\tau$ : Since  $\tau \in (-\infty, \omega_{\max}(t - T)]$ , we have  $T \leq t - \tau / \omega_{\max} < \infty$ . Thus,  $s\left(t - \frac{\tau}{\omega_{\max}}\right) = 0$  and  $\Delta s\left(t - \frac{\tau}{\omega_{\max}}\right) = s\left(t - \frac{\tau}{\omega_{\max}}\right) - s(t) = 0 - (T - t)$ .
$$
\begin{array}{l} \left| \int_ {- \infty} ^ {\omega_ {\max } (t - T)} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau \right| \\ = \left| - (T - t) \int_ {- \infty} ^ {\omega_ {\max } (t - T)} \frac {\sin \tau}{\pi \tau} d \tau \right| \stackrel {(i)} {\leq} (T - t) \frac {2}{\omega_ {\max } (T - t) \pi} = \frac {2}{\omega_ {\max } \pi} \tag {84} \\ \end{array}
$$
Inequality (i) is due to Proposition D.2
$$
\begin{array}{l} \left| \int_ {\omega_ {\max } (t - T)} ^ {\omega_ {\max } t} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau \right| = \left| \int_ {\omega_ {\max } (t - T)} ^ {\omega_ {\max } t} [ T - (t - \tau / \omega_ {\max }) - (T - t) ] \frac {\sin \tau}{\pi \tau} \right| \\ = \left| \int_ {\omega_ {\max } (t - T)} ^ {\omega_ {\max } t} \frac {\sin \tau}{\pi \omega_ {\max }} d \tau \right| \leq \frac {2}{\pi \omega_ {\max }} \tag {85} \\ \end{array}
$$
Bound on the third integral  $\int_{\omega_{\max}t}^{\omega_{\max}(t + T)}\Delta s\left(t - \frac{\tau}{\omega_{\max}}\right)\frac{\sin\tau}{\pi\tau} d\tau$  : When  $\tau \in (\omega_{\max}t,\omega_{\max}(t + T)]$  we have  $-T\leq t - \tau /\omega_{\mathrm{max}} < 0$  . Thus,  $s(t - \tau /\omega_{\mathrm{max}}) = T$
$$
\begin{array}{l} \left| \int_ {\omega_ {\max } t} ^ {\omega_ {\max } (t + T)} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau \right| = \left| \int_ {\omega_ {\max } t} ^ {\omega_ {\max } (t + T)} [ T - (T - t) ] \frac {\sin \tau}{\pi \tau} d \tau \right| (86) \\ = t \left| \int_ {\omega_ {\max } t} ^ {\omega_ {\max } (t + T)} \frac {\sin \tau}{\pi \tau} d \tau \right| (87) \\ = \frac {t}{\pi} \left| \int_ {\omega_ {\max } t} ^ {\omega_ {\max } (t + T)} \frac {\sin \tau}{\tau} d \tau \right| \leq \frac {(i)}{\pi} \frac {2}{\omega_ {\max } t} = \frac {2}{\pi \omega_ {\max }} (88) \\ \end{array}
$$
$$
\begin{array}{l} \left| \int_ {\omega_ {\max } (t + T)} ^ {\infty} \Delta s \left(t - \frac {\tau}{\omega_ {\max }}\right) \frac {\sin \tau}{\pi \tau} d \tau \right| = \left| \int_ {\omega_ {\max } (t + T)} ^ {\infty} (T - t) \frac {\sin \tau}{\tau} d \tau \right| \\ \stackrel {(i)} {\leq} \frac {(T - t) \times 2}{\omega_ {\max } (t + T) \pi} (89) \\ \leq \frac {2}{\pi \omega_ {\max }}. (90) \\ \end{array}
$$
Inequality (i) is due to Proposition D.2 Hence,
$$
\left| \widehat {s} _ {\omega_ {\max }} (t) - s (t) \right| \leq \frac {6 + 2 \max  \left\{1 , \frac {T}{T + t} \right\}}{\pi \omega_ {\max }} \tag {91}
$$
The above result, together with  $\mathrm{sim}(q,x) = \sum_{k\in [K]}s(\pmb {q}[k] - \pmb {x}[k])$  and  $\widehat{\mathrm{sim}}_{\omega_{\max}}(q,x) = \sum_{k\in [K]}\widehat{s}_{\omega_{\max}}(\pmb {q}[k] - \pmb {x}[k])$  prove the Lemma. Q.E.D.
Proposition D.2. If  $\alpha$  and  $\beta$  have the same sign and  $\alpha < \beta$ , then we have:
$$
\left| \int_ {\alpha} ^ {\beta} \frac {\sin t}{\pi t} d t \right| \leq \left\{ \begin{array}{l l} \frac {2}{\pi \alpha} & \text {i f} \beta > \alpha > 0 \\ - \frac {2}{\pi \beta} & \text {i f} 0 > \beta > \alpha \end{array} \right. \tag {92}
$$
Proof Note that  $\frac{d}{dt} \frac{\cos t}{t} = -\frac{\sin t}{t} - \frac{\cos t}{t^2}$ . Then we have:
$$
\begin{array}{l} \int_ {\alpha} ^ {\beta} \frac {\sin t}{t} d t = - \int_ {\alpha} ^ {\beta} \frac {d}{d t} \left[ \frac {\cos t}{t} \right] d t - \int_ {\alpha} ^ {\beta} \frac {\cos t}{t ^ {2}} d t (93) \\ = \frac {\cos \alpha}{\alpha} - \frac {\cos \beta}{\beta} + \int_ {\alpha} ^ {\beta} \frac {\cos t}{t ^ {2}} d t. (94) \\ \end{array}
$$
This gives us the following inequality:
$$
\begin{array}{l} \left| \int_ {\alpha} ^ {\beta} \frac {\sin t}{t} d t \right| \leq \left| \frac {\cos \alpha}{\alpha} - \frac {\cos \beta}{\beta} \right| + \left| \int_ {\alpha} ^ {\beta} \frac {\cos t}{t ^ {2}} d t \right| (95) \\ \leq \frac {1}{| \alpha |} + \frac {1}{| \beta |} + \int_ {\alpha} ^ {\beta} \frac {| \cos t |}{t ^ {2}} d t (96) \\ \leq \frac {1}{| \alpha |} + \frac {1}{| \beta |} + \frac {1}{\alpha} - \frac {1}{\beta} \\ = \left\{ \begin{array}{l l} \frac {2}{\alpha} & \text {i f} \beta > \alpha > 0 \\ - \frac {2}{\beta} & \text {i f} 0 > \beta > \alpha \end{array} \right. (97) \\ \end{array}
$$
E Additional details about the experimental setup
E.1 Dataset Generation
We obtain the  $\mathsf{MSWEB}^1$  and  $\mathsf{MSNBC}^2$  datasets from the UCI Machine Learning repository. Both of the datasets contain anonymized logs of real world user web activity. Each data item in MSWEB is a set of text snippets denoting areas of the website www.microsoft.com visited by an user within a specified time frame. Similarly, MSWEB consists of multi-sets denoting user page requests under various news categories at www.msnbc.com. Overall, we regard each data set as a collection of items, each item being a bag of words. For each data set, we sample a subset of items and designate them as queries, and the remaining items are designated as corpus items. The (binary) query-corpus relevance for MSWEB-1 and MSWEB-2 are governed by set containment, while for MSNBC-1 and MSNBC-2 we use multi-set (bag) containment. I.e.,  $x$  is relevant for  $q$  iff  $q \subseteq x$ . To test the ability of FOURIERHASHNET to retrieve semantically similar items close to the gold items, we report not only on MAP based on gold labels but also scores of the top-10 candidates (Figure 3). The dataset characteristics are summarized in Table 7. We create datasets which differ greatly in terms of corpus size (10734 for MSWEB-1 and MSWEB, 110790 for MSNBC-1 and MSNBC-2), as well as span a range of average query selectivity between  $1.7 \times 10^{-4}$  and  $3.3 \times 10^{-3}$ . We set aside 100 query graphs each for training and validation, and use the remaining 300 for testing.
Dataset	|Q|	|X|	∑q∈Qx∈Xrel(q,x) |Q|	minq∈Qx∈Xrel(q,x) |Q|	maxq∈Qx∈Xrel(q,x) |Q|	∑q∈Qx∈Xrel(q,x) |Q||C|
MsWEB-1	500	10734	35.624	9	327	0.0033
MsWEB-2	500	10734	20.392	9	49	0.0019
MsNBC-1	500	110790	24.09	9	44	0.00022
MsNBC-2	500	110790	19.78	9	34	0.00017
Table 7: Dataset statistics. From left to right: Datasets name, number of queries, number of corpus, the average number of relevant corpus items per query, the minimum num of relevnt corpus items per query, the maximum number of corpus items per query and the average query selectivity.
E.2 Learning Representations for  $q$  and  $x$  for the baselines
During experiments for Section 4.2, in each of the baseline method (Cosine similarity, Dot product and Weighted Jaccard), we use the respective similarity scoring functions, and minimize a pairwise ranking loss on the gold relevance labels to learn the deep set network. We observed that the pairwise ranking loss performs better than the BCE loss for the baselines. The margin enabled pairwise ranking loss is specified as
$$
\operatorname {L o s s} = \sum_ {q \in Q} \sum_ {\substack {x \in X _ {q \checkmark} \\ x ^ {\prime} \in X _ {q \times}}} \left[ \operatorname {m a r g i n} + \operatorname {s i m} (q, x ^ {\prime}) - \operatorname {s i m} (q, x) \right] _ {+}. \tag{98}
$$
where  $\mathrm{sim}$  is the choice of similarity scoring baseline,  $X_{q\checkmark}, X_{q\mathbf{x}}$  are the set of relevant and irrelevant corpus items for the query  $q$ . We use the best performing margin among  $\{1,0.1\}$ .
E.3 Sampling from arbitrary distribution
One key component of FOURIERHASHNET is sampling  $\omega^{1\dots M}\sim p(\omega)$ . We have chosen to set  $p(\omega)\propto |\mathrm{Re}(S(\iota \omega))| + |\mathrm{Im}(S(\iota \omega))|$ , with the support set between  $p(\omega)$  between  $[-100, 100]$ . The samples are drawn using Inverse Transform Sampling.
E.4 Details about fourier transformation network
In our experiments, we generate  $M = 10$  samples for  $\omega$ . The neural networks  $\phi_q$  and  $\phi_x$  are linear layers which output 10 dimensional transformed Fourier representations  $z_q = \phi_q(F_q(\iota \omega^{1..M}))$  and  $z_x = \phi_x(F_x(\iota \omega^{1..M}))$ . These are trained using the BCE loss specified in Eq. (12).
<https://archive.ics.uci.edu/ml/machine-learning-databases/msweb-mld>
$^{2}$ https://archive.ics.uci.edu/ml/machine-learning-databases/msnbc-mld/
E.5 Details about hashcode generation network
We use the same hashcode training procedure for FOURIERHASHNET, as well as the DP-RH and RH baselines. In all three cases, we generate 64 dimensional hashcodes. For FOURIERHASHNET, the random hyperplanes  $\mathbf{W}$  are trained on 10 dimensional trained Fourier representations  $z_{q}, z_{x}$ . For RH we use the original embeddings  $\mathbf{q}$  and  $\mathbf{x}$ . For DP-RH, we use the augmented embeddings  $g(q) = \mathrm{sign}(\mathbf{W}[0, \mathbf{q}/||\mathbf{q}||])$  and  $h(x) = \mathrm{sign}(\mathbf{W}[\sqrt{T^2 - ||\mathbf{x}||^2}, \mathbf{x}])$ .
E.6 AP and MAP measurements