Let $f(x)$ be a real-valued Riemann integrable function supported in $[0,1]$ with range in $[0,1]$. Let $\alpha$ be irrational. Consider the weighted Riemann sum


$$S\_N:=\frac{1}{N}\sum\_{k=1}^Nf\left(\frac{k}{N}\right)e^{2\pi i \alpha k}.$$


What can be said about $\lim\_{N\to\infty} S\_N$? It seems like a kind of Cesàro average.



Twisted Riemann sums
$\newcommand\abs[1]{\lvert#1\rvert}$As hinted at by [Achim Krause](https://mathoverflow.net/questions/452893/twisted-riemann-sums#comment1171477_452893), the limit is $0$ for all such functions $f$, however the approximation procedure is somewhat subtle.


First let us show it is $0$ for all step functions $f$. By linearity, it suffices to prove it in the case where $f$ is the indicator function of an interval $[a, b]$. But we have
\begin{gather\*}
S\_N(f) = \frac{1}{N}\sum\_{k=1}^N 1\_{[a, b]}\left (\frac{k}{N} \right ) e^{2\pi i \alpha k} \\
= \frac{1}{N} \sum\_{k = \lceil Na \rceil}^{\lfloor Nb \rfloor} e^{2\pi i \alpha k},
\end{gather\*}


where $\lceil \cdot \rceil$, $\lfloor \cdot \rfloor$ denote the ceiling and floor functions respectively. This is in turn less than or equal to in magnitude to


\begin{gather\*}
\frac{1}{\lfloor Nb \rfloor - \lceil Na \rceil} \sum\_{k = \lceil Na \rceil}^{\lfloor Nb \rfloor} e^{2\pi i \alpha k} \\
= e^{2 \pi i \alpha \lceil Na \rceil} \left ( \frac{1}{\lfloor Nb \rfloor - \lceil Na \rceil} \sum\_{k = 0}^{\lfloor Nb \rfloor - \lceil Na \rceil} e^{2\pi i \alpha k} \right ).
\end{gather\*}


Since irrational rotations are uniquely ergodic, by the pointwise ergodic theorem, the term in brackets converges to $0$. Taking absolute values and noting that $ \abs{ e^{2 \pi i \alpha \lceil Na \rceil} }$ is uniformly bounded by $1$ allows us to conclude.


Now let $f$ be Riemann integrable on $[0, 1]$ with the given bound on the range. Actually, the assumption on the range is unnecessary since all Riemann integrable functions are uniformly bounded, and the proof works just as well for bounded functions. However, I will assume wlog that the range lies in $[0, 1]$; it should be clear how to adapt the proof in the general bounded case.


Fix $\varepsilon > 0$, and let us choose a partition $0 = a\_0 < \dotsb < a\_{n-1} = 1$ such that the following holds.


Write $P\_k = [a\_k, a\_{k+1})$, and denote by $\mathcal G$ the set of intervals $P\_k$ such that $\sup\_{x, y \in P\_k} \abs{f(x) - f(y)} < \varepsilon$. We choose the partition such that $\mu(\bigcup\_{P\_k \in \mathcal G} \, P\_k) > 1 - \varepsilon$. The existence of such a partition follows directly from the definition of the Darboux sums for the Riemann integral.


Define the step function $g$ by $g(x) = \sum\_{k = 0}^{n-1} \mathbb 1\_{P\_k} (x) \inf\_{y \in P\_k} f(y)$. Clearly we have $\abs{f - g} \leq \varepsilon$ on $\mathcal G$, and by the bound on $f$ we have $\abs{f - g} \leq 1$ on the complement of $\mathcal G$.


Now we write


$$\abs{S\_N (f)} \leq \abs{S\_N (f - g)} + \abs{S\_N (g)}.$$


By the earlier discussion, the last term may be made arbitrarily small by choosing $N$ large enough. On the other hand, we have


$$\abs{S\_N (f - g)} = \frac{1}{N}\sum\_{k, \frac{k}{N} \in \bigcup\_{P\_k \in \mathcal G} \, P\_k} \left ( f(\frac{k}{N}) - g(\frac{k}{N}) \right ) e^{2\pi i \alpha k} + \frac{1}{N}\sum\_{j, \frac{j}{N} \in [0, 1] \setminus \bigcup\_{P\_k \in \mathcal G}\, P\_k} \left ( f(\frac{j}{N}) - g(\frac{j}{N}) \right ) e^{2\pi i \alpha j}.$$


The summands in the first term are bounded in absolute value by $\varepsilon$, while those in the second are bounded by $1$. Additionally, the number of terms in the second sum is at most $\varepsilon N + n$, where we recall that $n$ is the number of terms in the partition. Thus


$$\abs{S\_N (f - g)} \leq \varepsilon + \frac{1}{N} (\varepsilon N + n) \leq 3 \varepsilon$$


for all $N$ large enough. Since $\varepsilon$ was arbitrary, we conclude that $S\_N (f) \to 0$ as desired.


