1 Introduction & main results

The study of lacunary (trigonometric) series is a classical but still flourishing topic in harmonic analysis. Its origins can be traced back to the work of Rademacher [17] in 1922, who studied the convergence of series of the form

$$\begin{aligned} \sum _{k=1}^{ \infty } b_k r_k( \omega ), \end{aligned}$$
(1)

where \( \omega \in [0,1 ]\), \(b = (b_k )_{k \in {\mathbb {N}}}\), and \(r_k\) denotes the kth Rademacher function \(r_k( \omega ) = {{\,\mathrm{sgn}\,}}\left( \sin ( 2^k \pi \omega ) \right) \). Rademacher proved that under the assumption of square summability \(\sum _{ k=1}^{ \infty } b_k^2 < \infty \) such a series converges for almost every \( \omega \in [0,1]\). It was then in 1925 that Kolmogorov and Khinchin [14] discovered the necessity of square summability in an even more general setting. Observing that for Rademacher sums (1) one has the relation

$$\begin{aligned} \sum _{ k=1}^{ \infty } b_k r_k( \omega )= \sum _{ k=1}^{ \infty } b_k r_1(2^{k-1} \omega ), \end{aligned}$$

where in the sum on the right-hand side we have a fixed function \(r_1\) containing a sequence of exponentially growing dilation factors, marks the beginning of the study of lacunary trigonometric series of the form

$$\begin{aligned} \sum _{ k=1}^{\infty } b_k \cos ( 2 \pi a_k \omega ) \qquad {} \text {and} \qquad {} \sum _{ k=1}^{\infty } b_k \sin ( 2 \pi a_k \omega ), \end{aligned}$$

where \(\omega \in [0,1]\), \((b_k)_{ k \in {\mathbb {N}}}\) is a sequence of real numbers, \((a_k)_{ k \in {\mathbb {N}}}\) is a sequence of positive integers that is lacunary, in the sense that it satisfies the Hadamard gap condition

$$\begin{aligned} \frac{a_{k+1}}{a_k} \ge q > 1 , \qquad {} \text { for every } k \in {\mathbb {N}}. \end{aligned}$$

Kolmogorov [15] showed convergence of such series under the \(\ell _2\)-assumption on \((b_k)_{k \in {\mathbb {N}}}\) and a few years later Zygmund [21] showed that this assumption is necessary.

Coming back to the Rademacher functions \((r_k)_{k \in {\mathbb {N}}}\), one can easily check that they form a system of independent random variables. Thus, it is natural to ask weather \( \sum _{ k \in {\mathbb {N}}} b_k r_k\) satisfies a central limit theorem (CLT). Under the assumptions that \((b_k)_{k \in {\mathbb {N}}} \notin \ell _2\) and \( \max _{ 1 \le k \le n } |b_k |= o( \Vert (b_k)_{k \in {\mathbb {N}}} \Vert _2)\) one can verify that Lindeberg’s condition holds and thus we have that for \(t \in {\mathbb {R}}\)

$$\begin{aligned} \lim _{n \rightarrow \infty } \lambda \left( \left\{ \omega \in [0,1] :\sum _{ k=1}^n b_k r_k( \omega ) \le t \Vert (b_k)_{ k=1 }^n \Vert _2 \right\} \right) = \frac{1}{ \sqrt{2 \pi } } \int _{- \infty }^{t} \mathrm {e}^{-y^2/2} \,\mathrm {d}y. \end{aligned}$$

In particular this is true when \(b_k = 1\) for all \(k \in {\mathbb {N}}\). Kac proved in 1939 a similar CLT for a sequence \((a_k)_{ k \in {\mathbb {N}}}\) with large gaps, that is, if \( a_{k+1}/a_k \rightarrow \infty \), as \(k \rightarrow \infty \) in case of lacunary trigonometric functions. A few years later, in 1947, Salem and Zygmund [18] showed the CLT under the Hadamard gap condition. More precisely they showed that if \((a_k)_{k \in {\mathbb {N}}}\) satisfies \(a_{k+1}/a_k \ge q > 1\), we have

$$\begin{aligned} \lim _{n \rightarrow \infty } \lambda \left( \left\{ \omega \in [0,1] :\sum _{ k=1}^n \cos ( 2 \pi a_k \omega ) \le t \sqrt{n/2} \right\} \right) = \frac{1}{ \sqrt{2 \pi } } \int _{- \infty }^{t} \mathrm {e}^{-y^2/2} \,\mathrm {d}y. \end{aligned}$$

It became more and more evident that lacunary sums show a behavior similar to sums of truly independent random variables. Salem and Zygmund [19] in 1950 and Erdős and Gál [8] in 1955 were able to prove a law of the iterated logarithm under the Hadamard gap condition, that is, for almost every \( \omega \in [0,1]\) we have

$$\begin{aligned} \limsup _{n \rightarrow \infty } \frac{ \sum _{k=1}^n \cos ( 2 \pi a_k \omega )}{ \sqrt{ n \log \log n } } = 1. \end{aligned}$$

It is therefore natural to ask whether results like these can be generalized to arbitrary periodic functions. This is not always possible as a famous example of Erdős and Fortet (see, e.g., [12]) showed, where the law of the iterated logarithm failed to be true even for very simple trigonometric polynomials. In 1946, Kac [11] considered functions \(f :{\mathbb {R}}\rightarrow {\mathbb {R}}\) with

$$\begin{aligned} \int _{0}^1 f(\omega ) \,\mathrm {d}\omega = 0 \quad {} \text { and } \quad {} f( \omega +1) = f( \omega ) \end{aligned}$$

for all \( \omega \in [0,1]\). He was able to show that if one additionally assumes that f is of bounded variation or Hölder-continuous, then \( \frac{1}{\sqrt{n}} \sum _{ k=1}^n f(2^{k - 1} \omega )\) converges in distribution to a normal distribution with mean 0 and variance

$$\begin{aligned} \sigma ^2 := \int _{0}^1 f( \omega )^2 \,\mathrm {d}\omega + 2 \sum _{ k=1}^{ \infty } \int _{0}^{1} f( \omega ) f( 2^k \omega ) \,\mathrm {d}\omega , \end{aligned}$$

provided the latter exists. The form of the variance in the limit is somewhat unexpected, since one would naively assume the same variance as in the independent case, namely \( \int _{0}^{1} f( \omega )^2 \,\mathrm {d}\omega \). This observation shows that not only the regularity of the function f plays a role, also the arithmetic structure of the sequence \((a_k)_{k \in {\mathbb {N}}}\) claims its influence. This phenomenom became even more visible when Gapoškin [9] linked the existence of a CLT to the number of solutions of certain Diophantine equations. Only a few years ago Aistleitner and Berkes [1] improved his result. While both CLT and LIL are quite well understood for lacunary series, fluctuations on the scale of large deviations were not considered till very recently, when in 2020 Aistleitner, Gantert, Kabluchko, Prochno, and Ramanan [2] initiated the study of large deviation principles (LDP) for lacunary trigonometric sums, obtaining a series of unexpected results that display a subtle dependence on the arithmetic structure of the gap sequence that is not visible in the trigonometric setting on the scales of a CLT and a LIL; for the latter two the arithmetic structure is irrelevant and they always display a behavior as in the case of independent and identically distributed random variables.

In this paper we continue the study of large deviations for lacunary series and make progress on some of the open problems stated in [2]. More precisely, we will consider Hadamard gap sequences \((a_k)_{k \in {\mathbb {N}}}\) and study the tail behavior of partial sums of the form

$$\begin{aligned} \sum _{ k=1}^n f( a_k \omega ), \end{aligned}$$
(2)

where \(\omega \in [0,1]\) and \(f :{\mathbb {R}}\rightarrow {\mathbb {R}}\) is a general 1-periodic function satisfying certain regularity assumptions. Functions like the one in (2) can be interpreted as random variables on [0, 1] equipped with the Borel-sigma field and the Lebesgue measure \(\lambda \) on it.

1.1 Main results

Before presenting the main results, recall that a sequence \((X_n)_{n \in {\mathbb {N}}}\) of random variables (not necessarily i.i.d.) satisfies an LDP at speed \((s_n)_{n \in {\mathbb {N}}}\) and rate function \({{\,\mathrm{{\mathbb {I}}}\,}}:{\mathbb {R}}\rightarrow [0, \infty ]\) if, for every Borel measurable set \(A \subset {\mathbb {R}}\), we have

$$\begin{aligned} - \inf _{ x \in A^\circ } {{\,\mathrm{{\mathbb {I}}}\,}}(x) \le \liminf _{n \rightarrow \infty } \frac{1}{s_n} \log {{\,\mathrm{{\mathbb {P}}}\,}}[X_n \in A] \le \limsup _{n \rightarrow \infty } \frac{1}{s_n} \log {{\,\mathrm{{\mathbb {P}}}\,}}[X_n \in A] \le - \inf _{ x \in \overline{A}} {{\,\mathrm{{\mathbb {I}}}\,}}(x), \end{aligned}$$

where \(A^\circ \) and \(\overline{A} \) denote the interior and the closure of A, respectively. The speed \((s_n)_{n \in {\mathbb {N}}}\) is a sequence of positive real numbers tending to infinity and the rate function \({{\,\mathrm{{\mathbb {I}}}\,}}\) is lower-semicontinuous. If \({{\,\mathrm{{\mathbb {I}}}\,}}\) has compact level sets, we speak of a good rate function (GRF). The classical setting of independent and identically distributed (i.i.d.) random variables is dealt with in Cramér’s theorem [5]: for a sequence of i.i.d. random variables \((X_n)_{n \in {\mathbb {N}}}\) with finite exponential moments, i.e.,

$$\begin{aligned} \Lambda (u):= {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ u X_1} \right] < \infty \end{aligned}$$

for all u in a neighborhood of 0, one has that

$$\begin{aligned} \lim _{n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {P}}}\,}}[ X_1 + \cdots + X_n \ge n t] = - \Lambda ^{*}(t), \end{aligned}$$

where \(t > {{\,\mathrm{{\mathbb {E}}}\,}}[X_1]\) and \( \Lambda ^* :{\mathbb {R}}\rightarrow [0, \infty ]\) is the Legendre–Fenchel transform of \(\Lambda \).

Now, let \(U \sim {{\,\mathrm{Unif}\,}}([0,1])\) be a random variable with the uniform distribution on [0, 1]. Given a sequence of positive integers \((a_k)_{k \in {\mathbb {N}}}\) and \(f :{\mathbb {R}}\rightarrow {\mathbb {R}}\), a measurable 1-periodic function, we define

$$\begin{aligned} S_n := \sum _{k=1}^{n} f(a_k U), \qquad n\in {\mathbb {N}}. \end{aligned}$$
(3)

Our aim is to prove LDPs for the sequence \((S_n/n)_{n \in {\mathbb {N}}}\) in two different and natural settings, namely for large gaps and for gap sequences forming a geometric progression.

1.1.1 The case of large gaps

We first consider the case of independent and identically distributed random variables. Assume that for the function \(f :{\mathbb {R}}\rightarrow {\mathbb {R}}\),

$$\begin{aligned} {\widetilde{\Lambda }}^f( \theta ) := \log \int _{0}^{1} \mathrm {e}^{ \theta f( \omega ) } \,\mathrm {d}\omega \end{aligned}$$
(4)

exists for all \( \theta \in {\mathbb {R}}\). Let \((U_k )_{ k \in {\mathbb {N}}} \) be an i.i.d. sequence of random variables with the same distribution as U and define

$$\begin{aligned} {\widetilde{S}}_n := \sum _{k=1}^{n} f(a_k U_k),\qquad n\in {\mathbb {N}}. \end{aligned}$$
(5)

By Cramér’s theorem, \(( {\widetilde{S}}_n/n)_{n \in {\mathbb {N}}}\) satisfies an LDP in \({\mathbb {R}}\) at speed n and with GRF \({\widetilde{I}}^f :{\mathbb {R}}\rightarrow [0, \infty ]\) given by the Legendre–Fenchel transform of \({\widetilde{\Lambda }}^f \), that is,

$$\begin{aligned} {\widetilde{I}}^f(x) := \sup _{ \theta \in {\mathbb {R}}} \left[ \theta x - {\widetilde{\Lambda }}^f(\theta ) \right] . \end{aligned}$$
(6)

Our first result treats the case where the Hadamard gap sequence \((a_k)_{k \in {\mathbb {N}}}\) has “large gaps”, i.e.,

$$\begin{aligned} \frac{a_{k+1}}{a_k} {\mathop {\longrightarrow }\limits ^{k \rightarrow \infty }} \infty . \end{aligned}$$

Theorem A

Let \(f :{\mathbb {R}}\rightarrow {\mathbb {R}}\) be a 1-periodic continuous function, let \(U \sim {{\,\mathrm{Unif}\,}}([0, 1])\) and \((a_k)_{k \in {\mathbb {N}}}\) be a lacunary sequence with large gaps. Then the sequence \(( S_n/n)_{n \in {\mathbb {N}}}\) satisfies an LDP in \({\mathbb {R}}\) at speed n and with GRF \({\widetilde{I}}^f\), where \(S_n\) is defined as in Equ. (3).

Remark 1.1

In essence, modulo several technicalities, the proof (given in Sect. 3) uses uniform approximation of continuous functions via trigonometric polynomials and the Gärtner–Ellis theorem. We also provide a proof in a more restrictive setting using the Fourier expansion technique (see Proposition 3.2), where we put a growth condition on the Fourier coefficients of the function \(f\). We do this with a view towards potential generalizations, e.g., for certain non-continuous f.

1.1.2 The case of geometric progressions

We now consider a lacunary sequence \((a_k)_{k \in {\mathbb {N}}}\) of the form \(a_k=q^k\) for some \(q \in {\mathbb {N}}\) with \(q \ge 2\). In this case, the large deviation behavior changes dramatically as is shown in the next theorem.

Theorem B

Let \(f :{\mathbb {R}}\rightarrow {\mathbb {R}}\) be 1-periodic and Lipschitz continuous. Let \(( a_k)_{k \in {\mathbb {N}}}\) be a geometric sequence, i.e., \( a_k= q^k\) for some \(q \in {\mathbb {N}}\) with \(q \ge 2\), and let \((S_n/n)_{n \in {\mathbb {N}}}\) be as defined in Equ. (3). Then

$$\begin{aligned} \Lambda _q^f( \theta ) := \lim _{n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n} \right] \end{aligned}$$

exists with the convergence holding uniformly on compact subsets of an open set \({\mathcal {D}}\) in the complex plane such that \({\mathbb {R}}\subset {\mathcal {D}}\). Moreover, \((S_n/n)_{n \in {\mathbb {N}}}\) satisfies an LDP in \({\mathbb {R}}\) at speed n. As GRF we obtain the Legendre–Fenchel transform \(I_q^f :{\mathbb {R}}\rightarrow [0, \infty ]\) of \( \Lambda _{q}^f\), i.e.,

$$\begin{aligned} I_q^f(x) := \sup _{ \theta \in {\mathbb {R}}} \left[ \theta x - \Lambda _q^f(\theta ) \right] . \end{aligned}$$
(7)

Furthermore, the limit \(\lim _{ q \rightarrow \infty } I_q^f(x) = {\widetilde{I}}^f(x)\) holds uniformly on compact subsets of the interval \(f({\mathbb {R}})^\circ \).

We are even able to strengthen Theorem B to arbitrary continuous functions.

Corollary 1.2

Let \((a_k)_{k \in {\mathbb {N}}}\) be a geometric sequence, i.e., \(a_k= q^k\) for some \(q \in {\mathbb {N}}\) with \(q \ge 2\), and let \(f :{\mathbb {R}}\rightarrow {\mathbb {R}}\) be a continuous 1-periodic function. Then, \((S_n/n)_{n \in {\mathbb {N}}}\) from Equ. (3) satisfies an LDP in \({\mathbb {R}}\) at speed n and some GRF \({{\,\mathrm{{\mathbb {I}}}\,}}_q^f :{\mathbb {R}}\rightarrow [0, \infty ]\).

Before we present the necessary large deviation background and then the proofs of the main results, we close this section providing some instructive examples.

Example 1.3

1. \(f(\omega ) = \cos (2 \pi \omega )\) and \(a_k = 2^k\). Here the asymptotic cumulant generating function is \(\Lambda _2^f = \Lambda _2\) as given in Theorem B in [2]. There is no closed expression for it, but the coefficients of its Taylor series may be computed explicitly; see Lemma 3.5 and Appendix A loc. cit. for more information.

2. \(f(\omega ) = \cos (2 \pi \omega ) + \cos (4 \pi \omega )\) and \(a_k = 2^k\). We can rewrite \(S_n\) in the following way,

$$\begin{aligned} S_n(\omega )&= \sum _{k = 1}^n \left( \cos (2^{k + 1} \pi \omega ) + \cos (2^{k + 2} \pi \omega ) \right) \\&= 2 \left( \sum _{k = 1}^n \cos (2^{k + 1} \pi \omega )\right) + \cos (2^{n + 2} \pi \omega ) - \cos (4 \pi \omega )\\&=: 2 S_n^{(1)}(\omega ) + r(\omega ), \end{aligned}$$

where \(S_n^{(1)} = \sum _{k = 1}^n \cos (2^{k + 1} \pi \omega )\) is the lacunary sum implicitly dealt with in Example 1, and \(|r(\omega ) |= |\cos (2^{n + 2} \pi \omega ) - \cos (4 \pi \omega ) |\le 2\). Therefore,

$$\begin{aligned} \frac{1}{n} \log \left( {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_n} \right] \right) \le \frac{2 \theta }{n} + \frac{1}{n} \log \left( {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{2 \theta S_n^{(1)}} \right] \right) {\mathop {\longrightarrow }\limits ^{n \rightarrow \infty }} \Lambda _2(2 \theta ), \end{aligned}$$

and analogously,

$$\begin{aligned} \frac{1}{n} \log \left( {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_n} \right] \right) \ge -\frac{2 \theta }{n} + \frac{1}{n} \log \left( {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{2 \theta S_n^{(1)}} \right] \right) {\mathop {\longrightarrow }\limits ^{n \rightarrow \infty }} \Lambda _2(2 \theta ), \end{aligned}$$

and this implies \(\Lambda _2^f(\theta ) = \Lambda _2(2 \theta )\). This is clearly distinct from \(\Lambda _2\), but note also that we could have obtained the same \(\Lambda _2^f\) if we had started with \(g(\omega ) := 2 \cos (2 \pi \omega )\). Thus, we may take away that, for identical \(q\), different \(f\) can result in different \(\Lambda _q^f\), though there is no bijection.

.3, \(f(\omega ) = \cos (2 \pi \omega ) - \cos (4 \pi \omega )\) and \(a_k = 2^k\). Here \(S_n\) will telescope,

$$\begin{aligned} S_n&= \sum _{k = 1}^n \left( \cos (2^{k + 1} \pi \omega ) - \cos (2^{k + 2} \pi \omega ) \right) \\&= \cos (4 \pi \omega ) - \cos (2^{n + 2} \pi \omega ), \end{aligned}$$

this means \(|S_n |\le 2\) for all \(n \in {\mathbb {N}}\) and hence

$$\begin{aligned} \Lambda _2^f(\theta ) = \lim _{n \rightarrow \infty } \frac{1}{n} \log \left( {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_n} \right] \right) = 0. \end{aligned}$$

Therefore, we get a markedly different rate function in this case (the trivial one, to be precise, which maps \(0\) to itself and is \(\infty \) elsewhere), although \(f\) is nontrivial and seems to differ from the previous example only marginally.

4. \(f(\omega ) = \cos (2 \pi \omega ) + \cos (4 \pi \omega )\) and \(a_k = 2^k + 1\). Now \((a_k)_{k \in {\mathbb {N}}}\) is no longer a geometric sequence, yet because of 1-periodicity we have

$$\begin{aligned} S_n(\omega )&= \sum _{k = 1}^n \left( \cos (2 (2^k + 1) \pi x) + \cos (2 (2^{k + 1} + 1) \pi \omega ) \right) \\&= \sum _{k = 1}^n \left( \cos (2^{k + 1} \pi x) + \cos (2^{k + 2} \pi \omega ) \right) , \end{aligned}$$

which is exactly the same as in Example 2.

Together these examples demonstrate that the rate function, and hence the whole LDP, does depend on the interplay between the function \(f\) and the sequence \((a_k)_{k \in {\mathbb {N}}}\), not solely on the one or the other. In particular it is not only the arithmetic properties of \((a_k)_{k \in {\mathbb {N}}}\) that influence the LDP: in the last example it is neither a geometric sequence nor does it have large gaps, so it does not fall into the framework of the present Theorems A and B, and still an LDP can be proved.

2 Elements of large deviations theory – some elementary background

Large deviations describe the decay of the probability of rare events on an exponential scale. In contrast to the law of large numbers and the CLT, large deviations behavior is highly non-universal. In 1938 Cramér [5] published his famous theorem (see also Theorem 2.2.3 in [6]): for a sequence of independent and identically distributed random variables \((X_n)_{n \in {\mathbb {N}}}\) with finite exponential moments, i.e.,

$$\begin{aligned} \Lambda (u):= {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ u X_1} \right] < \infty \end{aligned}$$

for all u in a neighborhood of 0, one has that

$$\begin{aligned} \lim _{n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {P}}}\,}}[ X_1 + \cdots + X_n \ge n t] = - \Lambda ^{*}(t), \end{aligned}$$

where \(t > {{\,\mathrm{{\mathbb {E}}}\,}}[X_1]\). The function \( \Lambda ^* :{\mathbb {R}}\rightarrow [0, \infty ]\) is the Legendre–Fenchel transform of \(\Lambda \), i.e.,

$$\begin{aligned} \Lambda ^*(x) := \sup _{ t \in {\mathbb {R}}}[xt - \Lambda (t)]. \end{aligned}$$

A few decades later, Donsker and Varadhan initiated the systematic study of large deviations and generalized Cramér’s idea (see [6] for more historical background). For the general definition of a large deviations principle we refer the reader to the beginning of Sect. 1.1. An important result from large deviations theory is the Gärtner–Ellis theorem, which we shall use several times in this paper. Having its roots in a paper of Gärtner from 1977 [10], Ellis established this result in 1984 [7]. The reader may also consult [6, Theorem 2.3.6].

Theorem 2.1

Let \((Z_n)_{ n \in {\mathbb {N}}}\) be a sequence of real valued random variables and assume that the following limit exists and is differentiable on \({\mathbb {R}}\):

$$\begin{aligned} \Lambda ( \theta ) := \lim _{n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ e^{n \theta Z_n} \right] . \end{aligned}$$
(8)

Then, \((Z_n)_{n \in {\mathbb {N}}}\) satisfies an LDP at speed n and with GRF \(\Lambda ^{*}:{\mathbb {R}}\rightarrow [0, \infty ]\), where

$$\begin{aligned} \Lambda ^{*}(x) := \sup _{ \theta \in {\mathbb {R}}} \left[ x \theta - \Lambda ( \theta ) \right] \end{aligned}$$

is the Legendre–Fenchel transform of \(\Lambda \).

3 Proofs

In this section we provide the proofs of all statements in Sect. 1.1. The central idea is to establish LDPs for trigonometric polynomials and use uniform approximation of continuous functions by such polynomials. We start with a lemma that will later facilitate the application of the Gärtner–Ellis theorem. In the following, if, e.g., j is an integer index, \( j \in [a,b]\) means \( j \in \{ k \in {\mathbb {Z}}:a \le k \le b \} \), where \( a,b \in {\mathbb {Z}}\).

Lemma 3.1

Let \(d \in {\mathbb {N}}\), define \(p_d(z) := \sum _{j = 0}^d \frac{1}{j!} z^j \) for \( z \in {\mathbb {C}}\), let \(m \in {\mathbb {N}}_0\) and define \(f :{\mathbb {R}}\rightarrow {\mathbb {C}}\) by \(f(x) := \sum _{j = -m}^m c_j \mathrm {e}^{2 \pi \mathrm {i}j x}\) with \(c_{-m}, \dotsc , c_m \in {\mathbb {C}}\). Then, for all \(\theta , x \in {\mathbb {R}}\), we have

$$\begin{aligned} p_d(\theta f(x)) = \sum _{j = -d m}^{d m} b_j(\theta , d) \mathrm {e}^{2 \pi \mathrm {i}j x}, \end{aligned}$$

where the coefficients \(b_j(\theta , d)\), \(j \in [-d m, d m] \), are complex numbers depending on \(c_{-m},\dotsc , c_m\) and with

$$\begin{aligned} b_0(\theta , d) = \int _0^1 p_d(\theta f(\omega )) \, \mathrm {d}\omega {\mathop {\longrightarrow }\limits ^{d\rightarrow \infty }} \int _0^1 \mathrm {e}^{\theta f(\omega )} \, \mathrm {d}\omega . \end{aligned}$$
(9)

Furthermore, given a lacunary sequence \((a_k)_{k \in {\mathbb {N}}}\) with large gaps, there exists \(k_0 = k_0(d, m) \in {\mathbb {N}}\) such that for every \(\theta \in {\mathbb {R}}\) and for all \(n > k_0\),

$$\begin{aligned} \int _0^1 \prod _{k = k_0 + 1}^n p_d(\theta f(a_k \omega )) \, \mathrm {d}\omega = b_0(\theta , d)^{n - k_0}. \end{aligned}$$

Proof

A proof by induction reveals that, for all \(j \in {\mathbb {N}}_0\),

$$\begin{aligned} f(\omega )^j = \sum _{k = -j m}^{j m} c_k^{(j)} \mathrm {e}^{2 \pi \mathrm {i}k \omega }, \end{aligned}$$

with some numbers \(c_k^{(j)}\in {\mathbb {C}}\), \(k \in [-j m, j m]\), the precise knowledge of which is irrelevant. This yields

$$\begin{aligned} p_d(\theta f(\omega ))&= \sum _{j = 0}^d \frac{\theta ^j}{j!} \sum _{k = -j m}^{j m} c_k^{(j)} \mathrm {e}^{2 \pi \mathrm {i}k \omega }\\&= \sum _{k = -d m}^{d m} \left( \sum _{j = \lceil |k |/ m \rceil }^d \frac{c_k^{(j)} \, \theta ^j}{j!} \right) \mathrm {e}^{2 \pi \mathrm {i}k \omega }\\&= \sum _{j = -d m}^{d m} b_j(\theta , d) \mathrm {e}^{2 \pi \mathrm {i}j \omega }, \end{aligned}$$

where we put

$$\begin{aligned} b_j(\theta , d) := \sum _{k = \lceil |j |/ m \rceil }^d \frac{c_j^{(k)} \, \theta ^k}{k!}. \end{aligned}$$

A simple computation reveals that this implies the integral representation of \(b_0(\theta , d)\) in the statement of the lemma, i.e.,

$$\begin{aligned} b_0(\theta , d) = \int _0^1 p_d(\theta f(\omega )) \, \mathrm {d}\omega . \end{aligned}$$

Because \(p_d\) approximates the exponential function uniformly on bounded subsets of \({\mathbb {C}}\) (in particular on compact subsets) and since \(\theta f([0,1])\subset {\mathbb {C}}\) is compact, integration and limit for \(d \rightarrow \infty \) may be exchanged, which shows that

$$\begin{aligned} \lim _{d\rightarrow \infty }b_0(\theta , d) = \int _0^1 \mathrm {e}^{\theta f(\omega )} \, \mathrm {d}\omega . \end{aligned}$$
(10)

Now let \(\theta \in {\mathbb {R}}\) and \(n > k_0\), where \(k_0 \in {\mathbb {N}}\) is such that \(\frac{a_{k + 1}}{a_k} \ge m d + 1\) for all \(k \ge k_0\). Then we have, for all \(\omega \in [0, 1]\),

$$\begin{aligned} \prod _{k = k_0 + 1}^n p_d(\theta f(a_k \omega ))&= \prod _{k = k_0 + 1}^n \, \sum _{j = -d m}^{d m} b_j(\theta , d) \mathrm {e}^{2 \pi \mathrm {i}j a_k \omega }\\&= \sum _{j_{k_0 + 1}, \dotsc , j_n = -d m}^{d m}\, \prod _{k = k_0 + 1}^n \left( b_{j_k}(\theta , d) \mathrm {e}^{2 \pi \mathrm {i}j_k a_k \omega } \right) \\&= \sum _{j_{k_0 + 1}, \dotsc , j_n = -d m}^{d m}\, \left( \prod _{k = k_0 + 1}^n b_{j_k}(\theta , d) \right) \exp \left( 2 \pi \mathrm {i}\omega \sum _{k = k_0 + 1}^n j_k a_k \right) . \end{aligned}$$

It is left to show that if \(j_k \ne 0\) for some \(k \in [k_0 + 1, n]\), then \(\sum _{k = k_0 + 1}^n j_k a_k \ne 0\), because in that case the integral of the exponential function evaluates to zero and the only nontrivial summand left is the one with \(j_{k_0 + 1} = \cdots = j_n = 0\), which then yields the desired \(b_0(\theta , d)^{n - k_0}\). So let \((j_{k_0 + 1}, \dotsc , j_n) \ne 0\) and let \(\ell := \max \{k \in [k_0 + 1, n] :j_k \ne 0\}\). By the choice of \(k_0\), \(a_{\ell } \ge a_k (d m + 1)^{\ell - k}\) for all \(k \in [k_0 + 1, \ell ]\). We now consider two cases according to the sign of \(j_{\ell }\). First, suppose that \(j_{\ell } > 0\). Then, because \(j_{\ell } \ge 1\) and \(j_k \ge -dm\) for all \(k \in [k_0 + 1, \ell - 1]\), we obtain

$$\begin{aligned} \sum _{k = k_0 + 1}^n j_k a_k = \sum _{k = k_0 + 1}^\ell j_k a_k = j_{\ell } a_{\ell } + \sum _{k = k_0 + 1}^{\ell -1} j_k a_k \ge a_{\ell } - d m \sum _{k = k_0 + 1}^{\ell - 1} a_k. \end{aligned}$$

Using \(a_k \le a_\ell (d m + 1)^{k - \ell }\) for all \(k \in [k_0 + 1, \ell ]\), this can be estimated further and we obtain

$$\begin{aligned} a_{\ell } - d m \sum _{k = k_0 + 1}^{\ell - 1} a_k&\ge a_{\ell } \left( 1 - d m \sum _{k = k_0 + 1}^{\ell - 1} (d m + 1)^{k - \ell } \right) \\&= a_\ell \left( 1 - d m \, (d m + 1)^{k_0 - \ell }\sum _{k=1}^{\ell -k_0-1} (dm+1)^k\right) \\&= a_{\ell } \left( 1 - d m \, \frac{1 - (d m + 1)^{k_0 + 1 - \ell }}{d m} \right) \\&= a_{\ell } (d m + 1)^{k_0 + 1 - \ell } > 0. \end{aligned}$$

The case \(j_{\ell } < 0\) is argued analogously. This completes the proof. \(\square \)

We use the previous lemma to prove Theorem A by employing the Stone–Weierstraß theorem (see, e.g., [16, Chapter 15]).

Proof of Theorem A

The proof is done in two steps: first we assume that \(f\) is a trigonometric polynomial and then we use approximation for arbitrary \(f\).

Step 1: The general idea is the same as in the proof of Theorem A in [2]; in particular, [2, Lemma 3.2] can be adapted to hold for any bounded function \(f\) instead of \(\omega \mapsto \cos (2 \pi a_k \omega )\). Now let \(f :\omega \mapsto \sum _{j = -m}^m c_j \mathrm {e}^{2 \pi \mathrm {i}j \omega }\) be a trigonometric polynomial for some \(m \in {\mathbb {N}}_0\) and \(c_{-m}, \dotsc , c_m \in {\mathbb {C}}\) (actually \(c_{-j} = \overline{c_j}\) holds for all \(j \in [0, m]\) because of \(f({\mathbb {R}}) \subset {\mathbb {R}}\)). For fixed \(\theta \in {\mathbb {R}}\) and \(\varepsilon > 0\), we can find some \(d_0 = d_0(\varepsilon ) \in {\mathbb {N}}\) such that \(\lim _{\varepsilon \rightarrow 0} d_0(\varepsilon ) = \infty \) and for all \(d \ge d_0\) and all \( x \in [ - \theta \Vert f \Vert _{ \infty } , \theta \Vert f \Vert _{ \infty }]\) (note that \(\Vert f \Vert _{ \infty }\) is finite for a trigonometric polynomial f) we have

$$\begin{aligned} 1 - \varepsilon \le \frac{\mathrm {e}^x}{p_d(x)} \le 1 + \varepsilon , \end{aligned}$$
(11)

because \(p_d\), as defined in Lemma 3.1, is the dth Taylor polynomial of the exponential function. Recall that, by Lemma 3.1, for fixed \(d \ge d_0\) we can find \(k_0 \in {\mathbb {N}}\) such that, for all \(\theta \in {\mathbb {R}}\) and \(n > k_0\),

$$\begin{aligned} \int _0^1 \prod _{k = k_0 + 1}^n p_d(\theta f(a_k \omega )) \, \mathrm {d}\omega = b_0(\theta , d)^{n - k_0}. \end{aligned}$$
(12)

Combining  (11) and  (12) results in the estimate

$$\begin{aligned} {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n} \right] = \int _{0}^{1} \prod _{k=1}^{n} \mathrm {e}^{ \theta f( a_k \omega ) } \,\mathrm {d}\omega \le C_1 (1 + \varepsilon )^{ n-k_0} \int _{0}^1 \prod _{k=k_0 +1}^{n} p_d( \theta f( a_k \omega ) ) \,\mathrm {d}\omega = C_1 (1 + \varepsilon )^{ n-k_0} b_0(\theta , d)^{n - k_0}, \end{aligned}$$

where we have estimated \( \prod _{k=1}^{k_0} \mathrm {e}^{ \theta f( a_k \omega ) } \le \mathrm {e}^{ k_0 \theta \Vert f \Vert _{ \infty }} =: C_1 \) for \(\omega \in [0,1]\). Analogously one receives the lower bound, where we have

$$\begin{aligned} {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n} \right] \ge C_2(1 - \varepsilon )^{ n-k_0} b_0(\theta , d)^{n - k_0} \end{aligned}$$

with \(C_2 := \mathrm {e}^{- k_0 \theta \Vert f \Vert _{ \infty }} \). Together this leads to

$$\begin{aligned} \log (1 - \varepsilon ) + \log b_0( \theta , d) \le \liminf _{ n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n} \right] \end{aligned}$$

and

$$\begin{aligned} \limsup _{ n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n} \right] \le \log (1 + \varepsilon ) + \log b_0( \theta , d). \end{aligned}$$

Now, if we let \( \varepsilon \rightarrow 0\) (and thus \(d \rightarrow \infty \)) and combine the previous estimates with (9) of Lemma 3.1, we obtain

$$\begin{aligned} \lim _{n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n} \right] = \log \int _{0}^{1} \mathrm {e}^{ \theta f(\omega )} \,\mathrm {d}\omega = {\widetilde{\Lambda }}^f( \theta ). \end{aligned}$$

Hence, the Gärtner–Ellis limit exists for every \(\theta \in {\mathbb {R}}\), is finite, and the map \({\widetilde{\Lambda }}^f\) is clearly differentiable on \({\mathbb {R}}\). Therefore, the claim follows.

Step 2: Let \(f\) be an arbitrary continuous and 1-periodic function. Consider the complex algebra \(D := \left\{ \omega \mapsto \sum _{j = -m}^m c_j \mathrm {e}^{2 \pi \mathrm {i}j \omega } :m \in {\mathbb {N}}_0,\, c_{-m}, \dotsc , c_{m} \in {\mathbb {C}}\right\} \) of all trigonometric polynomials with period 1. We have \(1 \in D\), \(D\) separates points in \([0, 1)\) (because if \(\mathrm {e}^{2 \pi \mathrm {i}\omega } = \mathrm {e}^{2 \pi \mathrm {i}\omega '}\), then \(\omega - \omega ' \in {\mathbb {Z}}\)) and is closed under complex conjugation. By the Stone–Weierstraß theorem there exists a sequence \((f_m)_{m \in {\mathbb {N}}}\) in \(D\) such that, for each \(m \in {\mathbb {N}}\),

$$\begin{aligned} \Vert f - f_m \Vert _\infty \le \frac{1}{m}. \end{aligned}$$
(13)

Note that each \(f_m\) can be chosen to be real-valued. Indeed, for any \(\omega \in {\mathbb {R}}\),

$$\begin{aligned} |f(\omega ) - {\text {Re}}f_m(\omega ) |= |{\text {Re}}(f(\omega ) - f_m(\omega )) |\le |f(\omega ) - f_m(\omega ) |\le \Vert f - f_m \Vert _\infty \end{aligned}$$

and hence

$$\begin{aligned} \Vert f - {\text {Re}}f_m \Vert _\infty \le \Vert f - f_m \Vert _\infty \le \frac{1}{m}. \end{aligned}$$

We are going to prove that, for any \(\theta \in {\mathbb {R}}\),

$$\begin{aligned} \lim _{n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}[\mathrm {e}^{\theta S_n}] = \log \int _0^1 \mathrm {e}^{\theta f(\omega )} \, \mathrm {d}\omega \left( = {\widetilde{\Lambda }}^f(\theta )\right) . \end{aligned}$$

Because obviously \({\widetilde{\Lambda }}^f({\mathbb {R}}) \subset {\mathbb {R}}\) and \({\widetilde{\Lambda }}^f\) is differentiable on \({\mathbb {R}}\), we can then apply the Gärnter–Ellis theorem to obtain the claimed LDP with the corresponding rate function. So let \(S_{n}^m := \sum _{k = 1}^n f_m(a_k U)\), \(n\in {\mathbb {N}}\), \(\theta \in {\mathbb {R}}\), and assume \(\varepsilon > 0\). Then there exists \(m_1 \in {\mathbb {N}}\) such that, for all \(m \ge m_1\),

$$\begin{aligned} \frac{|\theta |}{m} < \frac{\varepsilon }{3}. \end{aligned}$$

From the uniform approximation (13) we infer, for any \(n \in {\mathbb {N}}\) and each realization,

$$\begin{aligned} |S_n - S_{n}^m |= \biggl |\sum _{k = 1}^n \left( f(a_k U) - f_m(a_k U) \right) \biggr |\le \frac{n}{m}. \end{aligned}$$

This in its turn implies

$$\begin{aligned} \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_n}\right]&\le \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_{n}^m + |\theta |n/m}\right] = \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_{n}^m}\right] + \frac{|\theta |}{m}\\&< \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_{n}^m}\right] + \frac{\varepsilon }{3}\\ \end{aligned}$$

and analogously

$$\begin{aligned} \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_n}\right]&> \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_{n}^m}\right] - \frac{\varepsilon }{3}. \end{aligned}$$

Furthermore, note that

$$\begin{aligned} \lim _{m \rightarrow \infty } \int _0^1 \mathrm {e}^{\theta f_m(\omega )} \, \mathrm {d}\omega = \int _0^1 \mathrm {e}^{\theta f(\omega )} \, \mathrm {d}\omega . \end{aligned}$$

This is so, because we have \((f_m)_{m \in {\mathbb {N}}} \rightarrow f\) uniformly, the exponential function is uniformly continuous on, say, \([-|\theta |\Vert f \Vert _\infty - 1, |\theta |\Vert f \Vert _\infty + 1]\) and therefore also \((\mathrm {e}^{\theta f_m})_{m \in {\mathbb {N}}} \rightarrow \mathrm {e}^{\theta f}\) uniformly, which yields convergence of the integrals. This shows the existence of \(m_2 \in {\mathbb {N}}\) such that, for all \(m \ge m_2\),

$$\begin{aligned} \biggl |\log \int _0^1 \mathrm {e}^{\theta f_m(\omega )} \, \mathrm {d}\omega - \log \int _0^1 \mathrm {e}^{\theta f(\omega )} \, \mathrm {d}\omega \biggr |< \frac{\varepsilon }{3}. \end{aligned}$$

Let \(m := \max \{m_1, m_2\}\). Then we know from Step 1 that \(\lim _{n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}[\mathrm {e}^{\theta S_{n}^m}] = \log \int _0^1 \mathrm {e}^{\theta f_m(\omega )} \, \mathrm {d}\omega \). Thus, there exists \(n_0 \ge 1\) such that, for all \(n \ge n_0\),

$$\begin{aligned} \biggl |\frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_n^m}\right] - \log \int _0^1 \mathrm {e}^{\theta f_m(\theta )} \, \mathrm {d}\omega \biggr |< \frac{\varepsilon }{3}. \end{aligned}$$

Now, for every \(n \ge n_0\), we obtain

$$\begin{aligned} \biggl |\frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_n}\right] - \log \int _0^1 \mathrm {e}^{\theta f(\omega )} \, \mathrm {d}\omega \biggr |&\le \Bigl |\frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_n}\right] - \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_{n}^m}\right] \Bigr |\\&\quad + \biggl |\frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{\theta S_{n}^m}\right] - \log \int _0^1 \mathrm {e}^{\theta f_m(\omega )} \, \mathrm {d}\omega \biggr |\\&\quad + \biggl |\log \int _0^1 \mathrm {e}^{\theta f_m(\omega )} \, \mathrm {d}\omega - \log \int _0^1 \mathrm {e}^{\theta f(\omega )} \, \mathrm {d}\omega \biggr |\\&< \frac{\varepsilon }{3} + \frac{\varepsilon }{3} + \frac{\varepsilon }{3} = \varepsilon \end{aligned}$$

and the proof is complete. \(\square \)

In view of the classical work [11] of Kac, another possible approach uses Fourier analytic methods. Taking this route allows us to establish a large deviation principle under certain growth conditions on the Fourier coefficients. Although this result is obtained under slightly stronger assumptions, we present it here with a view towards potential improvements in the future, where such an approach might be useful.

Proposition 3.2

Let \(f :{\mathbb {R}}\rightarrow {\mathbb {R}}\) be a 1-periodic function with \( \int _{0}^{1} f(x)^2 \,\mathrm {d}x < \infty \) and \((a_k)_{ k \in {\mathbb {N}}}\) be a sequence with large gaps. For the Fourier expansion

$$\begin{aligned} f(x) = \sum _{k=- \infty }^{ \infty } c_k \mathrm {e}^{2 \pi \mathrm {i}k x}, \end{aligned}$$
(14)

we assume that \( |c_k |\le M |k |^{ - \beta }\) for some \( \beta > 1\) and some constant \(M\in (0,\infty )\). Then, \((S_n/n)_{n \in {\mathbb {N}}}\) satisfies the LDP at speed n with GRF \({\widetilde{I}}^f\) from (6).

Remark 3.3

Note that the assumptions of Proposition 3.2 imply continuity of the function f. To see this, we consider a sequence \((x_n)_{n \in {\mathbb {N}}}\) of real numbers converging to some \( x \in {\mathbb {R}}\). Then, for fixed \(N \in {\mathbb {N}}\), we have

$$\begin{aligned} |f(x_n) - f(x) |&= \Bigl |\sum _{k = - \infty }^{ \infty } c _k \mathrm {e}^{ 2 \pi \mathrm {i}k x_n} - \sum _{k = - \infty }^{ \infty } c _k \mathrm {e}^{ 2 \pi \mathrm {i}k x} \Bigr |\\&\le \sum _{k = - N }^{ N } |c _k |\bigl |\mathrm {e}^{ 2 \pi \mathrm {i}k x_n} - \mathrm {e}^{ 2 \pi \mathrm {i}k x} \bigr |+ 2 \sum _{|k |> N } |c _k |\\&\le \sum _{k = - N }^{ N } |c _k |\bigl |\mathrm {e}^{ 2 \pi \mathrm {i}k x_n} - \mathrm {e}^{ 2 \pi \mathrm {i}k x} \bigr |+ 4 M \sum _{k =N+1}^{ \infty } k^{- \beta }, \end{aligned}$$

where we used our growth condition on the Fourier coefficents of f in the last line. Now, if we let \(n \rightarrow \infty \), we have

$$\begin{aligned} \lim _{n \rightarrow \infty } |f(x_n) - f(x) |\le 4 M \sum _{k= N+1 }^{ \infty } k^{- \beta }. \end{aligned}$$

For \(N \rightarrow \infty \), the right-hand side tends to zero, since we assumed that \(\beta > 1\).

Proof

(Proof of Proposition 3.2) We consider the sequence of polynomials \((f_m)_{m \in {\mathbb {N}}}\) with

$$\begin{aligned} f_m(x) := \sum _{k=-m}^{m} c_k \mathrm {e}^{2 \pi \mathrm {i}k x}. \end{aligned}$$

In the proof of Theorem A we saw that the LDP holds for \(S_n^m := \sum _{ k=1}^n f_m( a_k U )\), \(n\in {\mathbb {N}}\), with the i.i.d. rate function \( {\widetilde{I}}^{f_m}\). Now fix \(\varepsilon > 0\) and choose \(m=m( \varepsilon )\) such that \(\lim _{\varepsilon \rightarrow 0} m(\varepsilon ) = \infty \) and

$$\begin{aligned} |f(x)-f_m(x) |&= \Bigl |\sum _{ |k |> m} c_k \mathrm {e}^{2 \pi \mathrm {i}k x} \Bigr |\\&\le \sum _{ |k |> m} |c_k |\\&\le \varepsilon . \end{aligned}$$

This approximation can be used to bound the Gärtner–Ellis limit from above: we get

$$\begin{aligned} \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n } \right] = \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta ( S_n - S_n^m)} \mathrm {e}^{ \theta S_n^m} \right] \le \varepsilon + \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n^m } \right] . \end{aligned}$$

Thus, taking the limes superior on both sides yields

$$\begin{aligned} \limsup _{n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n } \right] \le \varepsilon + {\widetilde{\Lambda }}^{ f_m }( \theta ). \end{aligned}$$

Similarly, one receives the lower bound

$$\begin{aligned} \liminf _{n \rightarrow \infty } \frac{1}{n} {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n } \right] \ge {\widetilde{\Lambda }}^{f_m}( \theta ) - \varepsilon . \end{aligned}$$

Now letting \(\varepsilon \rightarrow 0\) (and hence \(m \rightarrow \infty \)) we get

$$\begin{aligned} \liminf _{n \rightarrow \infty } \frac{1}{n} {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n } \right] = \limsup _{n \rightarrow \infty } \frac{1}{n} {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n } \right] = \lim _{m \rightarrow \infty } {\widetilde{\Lambda }}^{f_m}( \theta ). \end{aligned}$$

We note that the convergence of \((f_m)_{m \in {\mathbb {N}}}\) towards f is uniform and that such an f is bounded. This allows us to interchange integral and limit, and we end up with

$$\begin{aligned} \lim _{n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n } \right] = \lim _{m \rightarrow \infty } {\widetilde{\Lambda }}^{f_m}( \theta ) = \log \int _{0}^{1} \mathrm {e}^{ \theta f(x)} \,\mathrm {d}x . \end{aligned}$$

The latter function is differentiable in \(\theta \) and thus by the Gärtner–Ellis theorem we obtain an LDP at speed n for \(( S_n /n)_{n \in {\mathbb {N}}}\) with GRF \( {\widetilde{I}}^f\). \(\square \)

Proof of Theorem B

The proof follows essentially the same steps as the proof of Theorem B and Proposition 3.4 in [2], where the LDP is proven using tools from hyperbolic dynamics and mixing processes. For more information, we refer the reader to the references given on p. 19 in [2]. First, we define the map \({\mathcal {T}} :[0,1] \rightarrow [0,1]\) with

$$\begin{aligned} {\mathcal {T}}( \omega ) := q \omega - \lfloor q \omega \rfloor . \end{aligned}$$

Then, using that \(a_k = q^k\) for \(k \in {\mathbb {N}}\), the lacunary sum \(S_n\) from (2) can be written as

$$\begin{aligned} S_n( \omega ) = \sum _{k=1}^{n} f( q^k \omega ) = \sum _{k=1}^{n} f( {\mathcal {T}}^k ( \omega )) , \quad \omega \in [0,1]. \end{aligned}$$

As in the proof of Theorem A, we use the Gärtner–Ellis theorem to show the LDP. Thus, we need to prove that the limit \(\Lambda _q^f( \theta ) := \lim _{n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n } \right] \) exists for all \(\theta \in {\mathbb {R}}\) and is differentiable in \(\theta \). In order to do so, we express \(\mathrm {e}^{\theta S_n}\) in terms of a certain linear operator.

Let \({{\,\mathrm{Lip}\,}}[0,1]\) be the Banach space of Lipschitz-continuous functions \(g :[0,1] \rightarrow {\mathbb {C}}\), endowed with the norm \(\Vert g \Vert := \Vert g \Vert _{ \infty } + L( g)\), where L(g) is the Lipschitz constant of g. Then, for fixed \(\theta \in {\mathbb {R}}\), define the linear operator \(\Phi _{ \theta , q } :{{\,\mathrm{Lip}\,}}[0,1] \rightarrow {{\,\mathrm{Lip}\,}}[0,1]\) by

$$\begin{aligned} \Phi _{ \theta , q }[g]( \omega ) := \frac{1}{q} \sum _{k=0}^{q-1} \mathrm {e}^{ \theta f \left( \frac{ \omega + k}{q} \right) }g \left( \frac{ \omega + k}{q} \right) , \quad \omega \in [0,1], \quad g \in {{\,\mathrm{Lip}\,}}[0,1]. \end{aligned}$$
(15)

Next, we consider the Perron–Frobenius operator associated to \({\mathcal {T}}\), i.e., \(\Phi _q :{{\,\mathrm{Lip}\,}}[0,1] \rightarrow {{\,\mathrm{Lip}\,}}[0,1]\) with

$$\begin{aligned} \Phi _{ q }[g]( \omega ) := \frac{1}{q} \sum _{k=0}^{q-1} g \left( \frac{ \omega + k}{q} \right) , \quad \omega \in [0,1], \quad g \in {{\,\mathrm{Lip}\,}}[0,1], \end{aligned}$$
(16)

where we note that the operator from (15) can be interpreted as a perturbation of the Perron–Frobenius operator in (16). We have that

$$\begin{aligned} \Phi _{ \theta , q }[g]( \omega ) = \Phi _q \left[ \mathrm {e}^{\theta f } g \right] (\omega ) = \frac{1}{q} \sum _{k=0}^{q-1} \mathrm {e}^{ \theta f \left( \frac{ \omega + k}{q} \right) }g \left( \frac{ \omega + k}{q} \right) , \qquad \omega \in [0,1]. \end{aligned}$$

In a moment we will need the following basic property of \(\Phi _q \): for \(g \in {{\,\mathrm{Lip}\,}}[0,1]\),

$$\begin{aligned} \int _{0}^{1} \Phi _q[g]( \omega ) \,\mathrm {d}\omega= & {} \frac{1}{q} \sum _{k=0}^{q-1} \int _{0}^{1} g \left( \frac{ \omega + k}{q} \right) \,\mathrm {d}\omega = \frac{1}{q} \sum _{k=0}^{q-1} \int _{k/q}^{ (k+1)/q} g ( x) q \,\mathrm {d}x \nonumber \\= & {} \int _{0}^{1} g ( x) \,\mathrm {d}x, \end{aligned}$$
(17)

where we used the variable substitution \( ( \omega +k)/ q = x\) for \(k=0,\dotsc ,q-1\). Let \(\Phi _{ \theta , q}^n\) and \(\Phi _q^n\) denote the n-fold composition of \(\Phi _{ \theta , q}\) and \(\Phi _q\) respectively. Then, by Proposition 5.1 in [3], we have for \(g \in {{\,\mathrm{Lip}\,}}[0,1]\)

$$\begin{aligned} \Phi _{ \theta , q}^n[g] = \Phi _q^n \left[ \mathrm {e}^{ \theta S_n } g \right] , \quad \text {for every } n \in {\mathbb {N}}. \end{aligned}$$

Using this, we can write

$$\begin{aligned} {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n } \right] = \int _{0}^{1 } \mathrm {e}^{ \theta S_n ( \omega )} \,\mathrm {d}\omega =\int _{0}^{1 } \Phi _q^n \left[ \mathrm {e}^{ \theta S_n} \right] ( \omega ) \,\mathrm {d}\omega = \int _{0}^{1 } \Phi _{ \theta , q}^n[\mathbbm {1}] ( \omega ) \,\mathrm {d}\omega , \end{aligned}$$
(18)

where \(\mathbbm {1}\) denotes the constant function with value 1. The second equation in (18) holds due to the calculation in (17).

By assumption, f is Lipschitz-continuous and hence Theorem 4.1 in [20] and Theorem 1.5 in [3] are applicable, therefore we get that \(\Phi _{ \theta , q}\) has a positive eigenvalue \(\lambda _{ \theta , q} =: \lambda _{ \theta }\) with multiplicity 1 and all other eigenvalues of \( \Phi _{ \theta , q}\) have strictly smaller modulus than \( \lambda _{ \theta }\). We use the well-known decomposition

$$\begin{aligned} \Phi _{ \theta , q} = \lambda _{ \theta } Q_{ \theta } + R_{ \theta }, \end{aligned}$$
(19)

where \( Q_{ \theta }\) is a projection operator onto the line spanned by an eigenfunction \(h_{ \theta } > 0\) associated to the eigenvalue \(\lambda _{ \theta }\), and \(R_{ \theta }\) is an operator whose spectral radius is strictly smaller than \(\lambda _\theta \) and which is orthogonal to \(Q_\theta \) in the sense \(R_\theta Q_\theta = Q_\theta R_\theta = 0\). Moreover, there exists a probability measure \( \mu _{ \theta } \) on [0, 1] such that for all \(g \in {{\,\mathrm{Lip}\,}}[0,1]\) we have that

$$\begin{aligned} Q_{ \theta }[g] = h_{ \theta } \, \frac{\int _{0}^{1} g( \omega ) \,\mathrm {d}\mu _{ \theta } (\omega ) }{ \int _{0}^{1} h_{ \theta }( \omega ) \,\mathrm {d}\mu _{ \theta } (\omega ) }. \end{aligned}$$

Using these quantities and the orthogonality of \(R_{ \theta }\) and \(Q_{ \theta }\) gives us for \(g \in {{\,\mathrm{Lip}\,}}[0,1]\)

$$\begin{aligned} \Phi _{ \theta , q}^n[g] = \lambda _\theta ^n Q_{ \theta }^n[g] + R_{ \theta }^n[g] = \lambda _\theta ^n h_{ \theta } \, \frac{\int _{0}^{1}g( \omega ) d \mu _{ \theta } (\omega )}{\int _{0}^{1} h_{ \theta }( \omega ) d \mu _{ \theta } (\omega )} + R_{ \theta }^n[g]. \end{aligned}$$

If we set \(g = \mathbbm {1}\), using (18), we obtain

$$\begin{aligned} {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n } \right] = \int _{0}^{1 }\Phi _{ \theta , q}^n[\mathbbm {1}](\omega ) \,\mathrm {d}\omega = \lambda _\theta ^n \, \frac{\int _{0}^{1} h_{ \theta }( \omega ) \,\mathrm {d}\omega }{ \int _{0}^{1} h_{ \theta }( \omega ) \,\mathrm {d}\mu _{ \theta } (\omega ) } + \int _{0}^{1} R_{\theta }^n[\mathbbm {1}]( \omega ) \,\mathrm {d}\omega .\quad \end{aligned}$$
(20)

Since the spectral radius of \(R_{ \theta }\) is strictly smaller than \(\lambda _{ \theta }\), we get

$$\begin{aligned} \lim _{ n \rightarrow \infty } \frac{{{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n } \right] }{ \lambda _{ \theta }^n} = \frac{\int _{0}^{1} h_{\theta }( \omega ) \,\mathrm {d}\omega }{ \int _{0}^{1} h_{ \theta }( \omega ) \,\mathrm {d}\mu _{ \theta } (\omega )}. \end{aligned}$$
(21)

In particular, we have that

$$\begin{aligned} \lim _{ n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n } \right] = \log \lambda _{ \theta }, \end{aligned}$$

which proves the existence of the Gärtner–Ellis limit.

We now turn to the proof of the remaining assertions, which we claim (and justify below) can be deduced from the perturbation theory of linear operators (see Chapter 7 in [13]), in particular the Kato-Rellich theorem, as stated in Theorem 4.24 in [20]. Indeed, since the family of operators \(\Phi _{ \theta , q} \) depends on \( \theta \in {\mathbb {C}}\) in an analytic way (see Proposition 5.1 (P3) in [4] and Theorem 1.7 in [13]), the decomposition (19) continues to hold in some neighborhood \({\mathcal {D}}\) of the real axis (with \(\lambda _{ \theta } , h_{ \theta }\) and \( \mu _{\theta }\) becoming complex-valued), with \(\lambda _{ \theta } \ne 0\) and \( \lambda _{ \theta }\) (as well as \(h_{ \theta } , \mu _{ \theta }, R_{ \theta }\) ) being analytic on \({\mathcal {D}}\). Moreover, \(|\lambda _{ \theta } |\) stays strictly greater than the spectral radius of \(R_{ \theta } \) if \({\mathcal {D}}\) is sufficiently small, which, looking at (20), shows that convergence in (21) is uniform on compact subsets of \({\mathcal {D}}\).

For the second statement of Theorem B, we fix \(\theta \in {\mathbb {R}}\) and let \(q \rightarrow \infty \). We note that the operator \(\Phi _{ \theta , q}\) from (15) is a Riemann sum and converges to the corresponding Riemann integral. This implies that the sequence of operators \( \Phi _{ \theta , q} \) for \(q \ge 2 \) converges to the operator

$$\begin{aligned} {\widetilde{\Phi }}_{ \theta }[g]( \omega ) = \int _{0}^{1} \mathrm {e}^{ \theta f( x )} g( x) d x = {\widetilde{\lambda }}_{ \theta } \, \frac{ \int _{0}^{1} \mathrm {e}^{ \theta f( x)} g(x) dx}{ \int _{0}^{1} \mathrm {e}^{ \theta f( x)} dx} \cdot \mathbbm {1}( \omega ), \end{aligned}$$

where \( {\widetilde{\lambda }}_{ \theta }:=\int _{0}^{1} \mathrm {e}^{ \theta f( x)} dx = \mathrm {e}^{ {\widetilde{\Lambda }}^f( \theta )}\) with the cumulant generating function \( {\widetilde{\Lambda }}^f\) defined in (4). Thus, \( {\widetilde{\lambda }}_{ \theta }\) is the Perron–Frobenius eigenvalue of \( {\widetilde{\Phi }}_{ \theta }\), since \({\widetilde{\Phi }}_{ \theta }/ {\widetilde{\lambda }}_{ \theta } \) is a projection onto the line spanned by the function \(\mathbbm {1} \).

Now if \(\theta \in {\mathbb {R}}\) stays constant and \(q \rightarrow \infty \), we can view \( \Phi _{ \theta ,q}\) as perturbation of \({\widetilde{\Phi }}_{ \theta }\). By perturbation theory (see e.g. [13]), we have the convergence of the Perron–Frobenius eigenvalues, that is, \( \lim _{ q \rightarrow \infty } \lambda _{ \theta , q} = {\widetilde{\lambda }}_{ \theta }\) for every \(\theta \in {\mathbb {R}}\). Taking the logarithm, we get \(\lim _{ q \rightarrow \infty } \Lambda _{q}^f( \theta ) = {\widetilde{\Lambda }}^f( \theta )\). Since the involved functions are convex, the convergence in fact is uniform on compact intervals. By taking the Legendre–Fenchel transform, it follows that \( \lim _{ q \rightarrow \infty } I_q^f(x) = {\widetilde{I}}^f(x)\) locally uniformly on \(f({\mathbb {R}})^\circ \). \(\square \)

Proof of Corollary 1.2

Let \( ( f_m )_{m \in {\mathbb {N}}} \) be a sequence of Lipschitz continuous functions with \( \Vert f- f_m \Vert _\infty \le \frac{1}{m}\) for all \(m \in {\mathbb {N}}\) (we can find such a sequence by the Stone–Weierstraß theorem). We show that the sequence \(S_n^m := \sum _{k= 1}^n f_m( a_k U)\) for \(m \in {\mathbb {N}}\) is a sequence of exponentially good approximations for \(S_n\). For more details see, e.g., Sect. 4.2.2 in [6]. Note that for all \( \delta > 0\) we have

$$\begin{aligned} \lim _{m \rightarrow \infty } \limsup _{n \rightarrow \infty } \frac{1}{n} \log {{\,\mathrm{{\mathbb {P}}}\,}}\left[ \frac{1}{n} |S_n - S_n^m |> \delta \right] = - \infty , \end{aligned}$$

since \(|S_n - S_n^m |= \bigl |\sum _{ k=1}^n (f(a_k U)- f_m(a_k U)) \bigr |\le \frac{n}{m} \) and hence \({{\,\mathrm{{\mathbb {P}}}\,}}\left[ \frac{1}{n} |S_n - S_n^m |> \delta \right] = 0\) for sufficiently large \(m \in {\mathbb {N}}\). Thus, by Theorem 4.2.16 in [6], \( (S_n/n)_{n \in {\mathbb {N}}} \) satisfies a weak LDP at speed n with rate function \({{\,\mathrm{{\mathbb {I}}}\,}}_q^f :{\mathbb {R}}\rightarrow [0, \infty ]\) given by

$$\begin{aligned} {{\,\mathrm{{\mathbb {I}}}\,}}_q^f(x) := \sup _{ \delta > 0} \liminf _{m \rightarrow \infty } \inf _{ z \in B_\delta (x)} I_q^{f_m}(z). \end{aligned}$$

Here, \(B_{\delta }(x)\) denotes the ball around x with radius \(\delta \), and \(I_q^{f_m}\) is the GRF of the LDP for \((S_n^m/n)_{n \in {\mathbb {N}}}\).

Since f is a continuous and periodic function, it is bounded and we have that \((S_n/n)_{n \in {\mathbb {N}}}\) is exponentially tight (see e.g. Sect. 1.2 in [6]). Hence, \(( S_n/n)_{n \in {\mathbb {N}}}\) satisfies the full LDP and \({{\,\mathrm{{\mathbb {I}}}\,}}_q^f\) is a GRF. \(\square \)

4 Some open problems

In this final section we collect some open problems that seem to be out of reach with the approach chosen in this paper.

Problem 4.1

It would be interesting to gather more properties of the cumulant generating function \(\Lambda _q^f\) from Theorem B. Maybe one can extract similar properties as in Theorem B in [2] for the cosine.

Problem 4.2

The cumulant generating function \(\Lambda _q^f\) in the geometric case is of particular interest. One could try to calculate the Gärtner–Ellis limit directly (i.e., without using Perron–Frobenius theory). First, one can approximate \(\mathrm {e}^{ \theta f(x)}\) uniformly by trigonometric polynomials \(f_m(x) = \sum _{j=-m}^{m} c_j \mathrm {e}^{2 \pi \mathrm {i}j x}\). We can then work with

$$\begin{aligned} {{\,\mathrm{{\mathbb {E}}}\,}}\left[ \mathrm {e}^{ \theta S_n^m} \right]&= \int _{0}^{1} \prod _{k=1}^{n} \sum _{j=-m}^{m} c_j \mathrm {e}^{2 \pi \mathrm {i}j q^k x} \,\mathrm {d}x. \end{aligned}$$

This leads to the set of solutions of

$$\begin{aligned} j_1q+ \cdots +j_nq^n=0, \end{aligned}$$
(22)

where each \( j_i \in \{ -m,\dotsc ,m\} \). Equ. (22) has many solutions (indeed the number of solutions grows very fast in n) and it seems that the typical solution consists of many powers of q.

Problem 4.3

We again consider a continuous and periodic function \(f :{\mathbb {R}}\rightarrow {\mathbb {R}}\). In this case we work with a lacunary sequence \((a_k)_{k \in {\mathbb {N}}}\) with

$$\begin{aligned} \frac{a_{k+1}}{a_k} \rightarrow \eta > 1, \end{aligned}$$

where \(\eta \) is some transcendental number. Using uniform approximation via trigonometric polynomials and calculating the Gärtner–Ellis limit leads to the set of solutions

$$\begin{aligned} j_1 a_1 + \cdots + j_n a_n = 0, \end{aligned}$$

where all \(j_i \in \{ -m,\dotsc , m \} \) for some fixed \(m \in {\mathbb {N}}\). One could even work with the equation

$$\begin{aligned} j_{k_n} a_{k_n}+ \cdots + j_n a_n = 0, \end{aligned}$$
(23)

where \((k_n)_{n \in {\mathbb {N}}}\) is a sequence of natural numbers with \(k_n \ll n\), and again \(j_i \in \{ -m,\dotsc ,m \}\).

It seems that for sufficiently large n, there are no non-trivial solutions to (23). In this case we would be able to establish an LDP for \((S_n/n)_{n \in {\mathbb {N}}}\) with the same GRF \({\widetilde{I}}^f\) as in the independent case.