1 Introduction and Main Results

Let \(X_1\), \(X_2\), ...be a sequence of independent identically distributed random vectors valued in \({\mathbb {Z}}^d\), \(d\ge 1\). Consider a random walk generated by \(X_n\)’s, \(S_0:=0\), \(S_n : =X_1+\cdots +X_n\), and the number of visits to a site \(x\in {\mathbb {Z}^d}\) up to time n which is called the local time of x,

$$\begin{aligned} l(n,x) : = \sum _{i=0}^n {\mathbb {I}}\{S_i=x\}. \end{aligned}$$
(1)

Define random variables

$$\begin{aligned} L_n(\alpha ) := \sum _{x\in {\mathbb {Z}}^d:\ l(n,x)>0} l^\alpha (n,x), \quad \alpha \ge 0. \end{aligned}$$
(2)

In particular, the \(L_n(0)=|\{S_0,\ldots ,S_n\}|\) represents the number of distinct sites visited by the random walk up to time n, called the range of \((S_n)_{n\ge 1}\). The case \(\alpha =1\) is trivial because \(L_n(1)=n+1\). The value of \(L_n(2)\) is the number of so-called self-intersections of a random walk. For an integer \(\alpha \), the value of \(L_n(\alpha )\) is the number of \(\alpha \)-fold self-intersections up to time n.

It is known that for a recurrent random walk the quotient \(L_n(0)/n\) tends to be 0 as \(n\rightarrow \infty \) (see, e.g. Spitzer [12, Ch. 1, Sect. 4, Theorem 1]), which assumes a slower growing normalising sequence for a proper limit in the law of large numbers. As shown in Dvoretzky and Erdős [8, Theorem 3] for a simple random walk and in Černý [3] for a general one with zero drift and finite covariance matrix, it is \(n/\log n\) in two dimensions.

In present article, we show that the law of large numbers for \(L_n(\alpha )\) with a non-zero limit and normalising sequence n holds in any dimension d for any transient random walk, that is, when the probability of its return to the origin,

$$\begin{aligned} \gamma := {\mathbb {P}}\{S_n\ne 0\hbox { for all }n\ge 1\}, \end{aligned}$$

is strictly positive, \(\gamma >0\). We assume in addition that \(\gamma <1\) which excludes a trivial case where either \(l(n,x)=1\) or 0 for all x with probability 1, and hence \(L_n(\alpha )=n+1\).

The result for \(L_n(\alpha )\) we are interested in follows from the following more general result. Consider a function \(f:{\mathbb {Z}}^+\rightarrow {\mathbb {R}}\) and a spatial sum

$$\begin{aligned} G_n(f) := \sum _{x\in {\mathbb {Z}}^d}f(l(n,x)). \end{aligned}$$

In particular, for a power function \(f(i)=i^\alpha \), we get \(L_n(\alpha )=G_n(f)\).

Theorem 1

Let the random walk \((S_n)_{n\ge 0}\) be transient and \(f:{\mathbb {Z}}^+\rightarrow {\mathbb {R}}\) be a function satisfying

$$\begin{aligned} \sum _{j=1}^\infty f^2(j)j(1-\gamma )^j< & {} \infty . \end{aligned}$$
(3)

Then,

$$\begin{aligned} \frac{G_n(f)}{n}\rightarrow & {} \gamma ^2\sum _{j=1}^\infty f(j)(1-\gamma )^{j-1} \quad \hbox {as }n\rightarrow \infty \end{aligned}$$
(4)

in mean square and with probability 1.

The proof of Theorem 1 is given in Sect. 4. In Sects. 2 and 3, we discuss an asymptotic behaviour of the expectation and variance of \(G_n(f)\) as \(n\rightarrow \infty \), respectively, needed further in the proofs.

The following corollaries are immediate.

Corollary 2

For any \(\alpha \ge 0\), it holds that

$$\begin{aligned} \frac{L_n(\alpha )}{n}\rightarrow & {} \gamma ^2\sum _{j=1}^\infty j^\alpha (1-\gamma )^{j-1} \quad \hbox { as }n\rightarrow \infty \end{aligned}$$
(5)

in mean square and with probability 1.

The case \(\alpha =0\) was considered by Spitzer in [12, Theorem 1.4.1] where convergence in probability is proven. Before then a strong law of large numbers for \(\alpha =0\) was proven for a simple random walk by Dvoretzky and Erdős in [8]. In Becker and König [1], the strong convergence (5) is proven for all \(\alpha \ge 0\) (up to a gap in the proof of Proposition 2.1, see a comment on it in the proof of Lemma 5 following equation (13)) without any further conditions in the case \(d\ge 3\); however, in the cases \(d\in {\{1,2\}}\), it is assumed there that either the steps \(X_i\) are square integrable or, for some \(\eta >0\) and \(C<\infty \),

$$\begin{aligned} \sum _{k=n}^\infty {\mathbb {P}}\{S_k=0\}\le & {} \frac{C}{n^\eta }\quad \hbox { for all }n. \end{aligned}$$
(6)

Corollary 3

Let \(J\subset {\mathbb {N}}\). Then, with probability 1,

$$\begin{aligned} \frac{1}{n} \sum _{x\in {\mathbb {Z}}^d} {\mathbb {I}}\{l(n,x)\in J\}\rightarrow & {} \sum _{j\in J}\gamma ^2(1-\gamma )^{j-1} \quad \hbox {as }n\rightarrow \infty . \end{aligned}$$

If J is a singleton \(\{j\}\), then we get the strong law of large numbers for the number of sites visited exactly j times up to time n. For these statistics, the last corollary generalises Theorem 12 in Erdős and Taylor [4] from a simple random walk in \(d\ge 3\) dimensions to an arbitrary transient random walk; a general result for transient random walks on a countable Abelian group was proven by induction on j by Pitt in [13]. Notice that, for an arbitrary J, say J the set of all odd numbers, Corollary 3 can be reduced to the singleton case, once we know the strong law of large numbers for the range of \(S_n\).

The growth condition (3) is satisfied for all subexponential functions f(i) of order \(e^{o(i)}\) as \(i\rightarrow \infty \), and also for exponentially growing functions of order \(O(e^{ci})\) with exponent coefficient \(c<\lambda _*/2\) where

$$\begin{aligned} \lambda _*:=\log \frac{1}{1-\gamma }. \end{aligned}$$

It is very likely that the condition (3) may be relaxed to the condition (9) below because under the latter condition we have

$$\begin{aligned} {\mathbb {E}}|f(l(\infty ,0))|= & {} \sum _{k=1}^\infty |f(k)|(1-\gamma )^{k-1}\gamma \ <\ \infty , \end{aligned}$$

and since the number of visited sites up to time n is not greater than n, it clearly indicates that the family \(\{G_n(f)/n,n\ge 1\}\) is stochastically bounded. But if we only assume (9), then it requires a much more delicate analysis compared to the estimation of the variance carried out in Lemma 6, as it happens when we prove a strong law of large numbers for a random walk where existence of the second moment of jumps essentially simplifies proving technique. In the result below, we show how it can be done under some additional technical assumptions.

Theorem 4

Let, for some \(C<\infty \) and \(\varepsilon >0\),

(i) either the condition

$$\begin{aligned} \sum _{k=1}^n k{\mathbb {P}}\{S_k=0\}\le & {} Cn^{1-\eta }\quad \hbox {for all }n \end{aligned}$$
(7)

hold for some \(\eta \in (0,1)\) and \(|f(i)|\le Ce^{i\lambda _*}/i^{2+\varepsilon }\) for all i,

(ii) or the condition

$$\begin{aligned} \sum _{k=1}^n k{\mathbb {P}}\{S_k=0\}\le & {} C\log n\quad \hbox {for all }n \end{aligned}$$
(8)

hold and \(|f(i)|\le Ce^{i\lambda _*}/i\log ^{2+\varepsilon }i\) for all \(i>0\).

Then, the convergence (4) holds with probability 1.

For the proof, see Sect. 5. It is based on truncation technique and on a strong limit theorem for the maximal local time, \(l(n):=\max \{l(n,x),\ x\in {\mathbb {Z}}^d\}\), see Proposition 8 there.

Notice that the condition (7) is equivalent to (6). Indeed, on the one hand, it follows from (6) that

$$\begin{aligned} \sum _{k=1}^n k{\mathbb {P}}\{S_k=0\}= & {} \sum _{j=1}^n \sum _{k=j}^n{\mathbb {P}}\{S_k=0\} \ \le \ C\sum _{j=1}^n j^{-\eta }\ \le \ \frac{C}{1-\eta }n^{1-\eta }. \end{aligned}$$

On the other hand, it follows from (7) that, for all m,

$$\begin{aligned} C(2m)^{1-\eta }\ \ge \ \sum _{k=m}^{2m-1} k{\mathbb {P}}\{S_k=0\}\ge & {} m\sum _{k=m}^{2m-1} {\mathbb {P}}\{S_k=0\}, \end{aligned}$$

hence

$$\begin{aligned} \sum _{k=n}^\infty {\mathbb {P}}\{S_k=0\}= & {} \sum _{j=0}^\infty \sum _{k=n2^j}^{n2^{j+1}-1} {\mathbb {P}}\{S_k=0\} \ \le \ C2^{1-\eta }\sum _{j=0}^\infty (n2^j)^{-\eta } \ =\ \frac{2C}{2^\eta -1}n^{-\eta }. \end{aligned}$$

Also notice that, in \(d\ge 3\) dimensions, if a random walk is not concentrated in some three-dimensional subspace, then the condition (7) is valid because \({\mathbb {P}}\{S_n=0\}=O(1/n^{d/2})\), due to an upper bound for the concentration function of a sum of random vectors, see, e.g. Corollary of Theorem 6.2 in Esseen [6]. For the same reason, in \(d\ge 4\) dimensions, the condition (8) is valid for any random walk not concentrated in some three-dimensional subspace.

If the function f grows faster than assumed in Theorem 4, say if the condition (9) fails, then \(G_n(f)\) would require stronger normalisation than just n, in order to have a proper limit as \(n\rightarrow \infty \). The answer may be conjectured as follows: let \(\tau =\inf \{n\ge 1: S_n=S_0\}\) be the first return time to the origin, then

$$\begin{aligned} {\mathbb {E}}|f(l(n,0))|= & {} \sum _{k=1}^n |f(k)|{\mathbb {P}}\{{\widetilde{\tau }}_1+\cdots +{\widetilde{\tau }}_{k-1}\le n\} (1-\gamma )^{k-1}\gamma , \end{aligned}$$

where \({\widetilde{\tau }}_1\), \({\widetilde{\tau }}_2\), ... are independent copies of \(\tau \) conditioned on \(\{\tau <\infty \}\). For example, consider f such that \(f(k)\sim c_1/(1-\gamma )^k\), then

$$\begin{aligned} {\mathbb {E}}f(l(n,0))\sim & {} c_2\sum _{k=1}^\infty {\mathbb {P}}\{{\widetilde{\tau }}_1+\cdots +{\widetilde{\tau }}\_{k-1}\le n\}\quad \hbox {as }n\rightarrow \infty . \end{aligned}$$

As shown in [7, Theorem 4], in the case where \({\mathbb {E}}X_1=0\), \({\mathbb {E}}\Vert X_1\Vert ^2<\infty \) and \(d\ge 3\), we have an asymptotic relation \({\mathbb {P}}\{{\widetilde{\tau }}=n\}\sim c_3/n^{d/2}\) as \(n\rightarrow \infty \).

Hence, in the case \(d\ge 5\), \({\mathbb {E}}{\widetilde{\tau }}_1<\infty \) and it follows from the renewal theorem that then \({\mathbb {E}}f(l(n,0))\sim c_2n/{\mathbb {E}}{\widetilde{\tau }}_1\), which together with asymptotic size of the range—which is of order O(n)—indicates that the right normalisation for \(G_n(f)\) should be \(n^2\).

In the cases \(d=3\) and \(d=4\), \({\mathbb {E}}{\widetilde{\tau }}_1=\infty \) and it follows from Erickson’s renewal theorem [5, Theorem 5] that then \({\mathbb {E}}f(l(n,0))\sim c_4n^{1/2}\) and \(c_5n/\log n\), respectively, which in turn indicates that the right normalisation for \(G_n(f)\) should be \(n^{3/2}\) and \(n^2/\log n\), respectively.

2 Asymptotics for Expectation of \(G_n(f)\)

In this section, we discuss the asymptotic behaviour of \({\mathbb {E}}G_n(f)\) as \(n\rightarrow \infty \). We prove the following result.

Lemma 5

Let \(f:{\mathbb {Z}}^+\rightarrow {\mathbb {R}}\) be a function satisfying

$$\begin{aligned} \sum _{j=1}^\infty |f(j)|(1-\gamma )^j< & {} \infty . \end{aligned}$$
(9)

Then,

$$\begin{aligned} \frac{{\mathbb {E}}G_n(f)}{n}\rightarrow & {} \gamma ^2\sum _{j=1}^\infty f(j)(1-\gamma )^{j-1} \quad \hbox {as }n\rightarrow \infty . \end{aligned}$$
(10)

Proof

Following Dvoretzky and Erdős [8], we introduce

$$\begin{aligned} \gamma _n:= & {} {\mathbb {P}}\{S_n\ne S_k\hbox { for all } 0\le k\le n-1\}, \end{aligned}$$

the probability that the site visited by random walk in the nth step has not been visited before then; \(\gamma _0=1\). As noticed in [8],

$$\begin{aligned} 1-\gamma _n= & {} {\mathbb {P}}\{S_n=S_k\hbox { for some } 0\le k\le n-1\}\\= & {} {\mathbb {P}}\{S_{n-k}=S_0\hbox { for some } 0\le k\le n-1\}, \end{aligned}$$

so \(\gamma _n\) equals the probability that the random walk does not return to the origin in n steps:

$$\begin{aligned} \gamma _n= & {} {\mathbb {P}}\{S_k\ne S_0\hbox { for all } 1\le k\le n\} \ =\ {\mathbb {P}}\{\tau \ge n+1\}. \end{aligned}$$

We observe the following monotone convergence

$$\begin{aligned} \gamma _n-\gamma \ =\ {\mathbb {P}}\{n+1\le \tau <\infty \}&\downarrow&0 \quad \hbox {as }n\rightarrow \infty . \end{aligned}$$
(11)

Consider the following spatial sum

$$\begin{aligned} Q_n(j)\ :=\ \sum _{x\in {\mathbb {Z}}^d} {\mathbb {I}}\{l(n,x)=j\}, \end{aligned}$$

which represents the number of sites visited exactly j times up to time n, hence

$$\begin{aligned} G_n(f)= & {} \sum _{j=1}^n f(j) Q_n(j). \end{aligned}$$
(12)

As Becker and König [1, Eq. (2.2)] do, we use the following equality, for \(j\ge 1\):

$$\begin{aligned}&{\mathbb {E}}Q_n(j) \nonumber \\&\quad = \sum _{x\in {\mathbb {Z}}^d}{{\mathbb {P}}\{l(n,x)=j\}}\nonumber \\&\quad ={\mathop {\mathop {\sum }\limits _{x\in {\mathbb {Z}}^d}}\limits _{0\le {k_1}<\cdots<k_j\le {n}}} {\mathbb {P}}\{S_{k_1}=\cdots =S_{k_j}=x, S_k\ne x \hbox { for all } k\le n,k\not \in \{k_1,\ldots ,k_j\}\}\nonumber \\&\quad = \sum _{0\le k_1<\cdots <k_j\le n}\gamma _{k_1} \biggl [\prod _{i=1}^{j-1} {\mathbb {P}}\{\tau =k_{i+1}-k_i\}\biggr ]\gamma _{n-k_j}, \end{aligned}$$
(13)

due to the Markov property of the random walk. In [1], the asymptotic behaviour of \({\mathbb {E}}Q_n(j)\) as \(n\rightarrow \infty \) is argued by considering the generating function of \(\{{\mathbb {E}}Q_n(j),n\ge 1\}\) and then referring to the Tauberian theorem, [9, Theorem XIII.5]. Notice that this approach requires the sequence \(\{{\mathbb {E}}Q_n(j),n\ge 1\}\) to be ultimately increasing (see Sects. 1.7.3 and 1.7.4 in [2]) which is not granted from the beginning and probably fails; at least such a discussion is missing in [1]. Notice that this problem can be fixed by first looking at the sum of \(Q_j(n)\) over \(j\ge {\widetilde{j}}\) for some \({\widetilde{j}}\) (this is now monotonic in n) and then looking at the differences. See also Pitt [13] for an alternative proof.

Below we suggest another argument which does not require the Tauberian theorem and is only based on the transience of the random walk. It follows from (13) that

$$\begin{aligned} {\mathbb {E}}Q_n(j)= & {} \mathop {{\mathop {\mathop {\sum }\limits _{n_0,n_j\ge 0}}\limits _{n_1,\ldots ,n_{j-1}\ge 1}}}\limits _{n_0+\cdots +n_j=n} \gamma _{n_0}\gamma _{n_j}\prod _{i=1}^{j-1}{\mathbb {P}}\{\tau =n_i\}\\= & {} \sum _{n_0,n_j:\ 0\le n_0+n_j\le n-j+1} \gamma _{n_0}\gamma _{n_j}{\mathbb {P}}\{\tau _1+\cdots +\tau _{j-1}=n-(n_0+n_j)\}, \end{aligned}$$

where \(\tau _1\), \(\tau _2\), ... are independent copies of \(\tau \), the first return time to the origin. Thus,

$$\begin{aligned} {\mathbb {E}}Q_n(j)= & {} \sum _{s=0}^{n-j+1}{\mathbb {P}}\{\tau _1+ \ldots +\tau _{j-1}=n-s\} \sum _{n_0=0}^s \gamma _{n_0}\gamma _{s-n_0}, \end{aligned}$$

hence

$$\begin{aligned} \frac{{\mathbb {E}}Q_n(j)}{n}= & {} \sum _{s=j-1}^n {\mathbb {P}}\{\tau _1+ \ldots +\tau _{j-1}=s\} \frac{1}{n}\sum _{n_0=0}^{n-s} \gamma _{n_0}\gamma _{n-s-n_0}. \end{aligned}$$
(14)

In view of the convergence (11), for any fixed \(s\ge j-1\),

$$\begin{aligned} \frac{1}{n}\sum _{n_0=0}^{n-s} \gamma _{n_0}\gamma _{n-s-n_0}\rightarrow & {} \gamma ^2 \quad \hbox {as }n\rightarrow \infty , \end{aligned}$$

and, moreover,

$$\begin{aligned} \frac{1}{n}\sum _{n_0=0}^{n-s} \gamma _{n_0}\gamma _{n-s-n_0}\le & {} \frac{n-s+1}{n}\ \le \ 1\quad \hbox {for all }n\hbox { and } s\ge 1. \end{aligned}$$

Therefore, by the dominated convergence theorem, as \(n\rightarrow \infty \),

$$\begin{aligned} \frac{{\mathbb {E}}Q_n(j)}{n}\rightarrow & {} \gamma ^2{\mathbb {P}}\{\tau _1+\cdots +\tau _{j-1}<\infty \}\nonumber \\= & {} \gamma ^2\prod _{k=1}^{j-1}{\mathbb {P}}\{\tau _k<\infty \} \ =\ \gamma ^2(1-\gamma )^{j-1}, \end{aligned}$$

owing to independence of \(\tau _k\)’s. In addition,

$$\begin{aligned} \frac{{\mathbb {E}}Q_n(j)}{n}\le & {} {\mathbb {P}}\{\tau _1+ \ldots +\tau _{j-1}<\infty \}\ =\ (1-\gamma )^{j-1}\quad \hbox { for all }n. \end{aligned}$$
(15)

Then, the condition (9) makes it possible to apply dominated convergence again and to conclude that

$$\begin{aligned} \frac{{\mathbb {E}}G_n(f)}{n}\ =\ \sum _{j=1}^\infty f(j)\frac{{\mathbb {E}}Q_n(j)}{n} \ \rightarrow \ \gamma ^2\sum _{j=1}^\infty f(j)(1-\gamma )^{j-1} \quad \hbox {as }n\rightarrow \infty , \end{aligned}$$

which completes the proof of (10). Also notice that (15) implies an upper bound

$$\begin{aligned} {\mathbb {E}}G_n(f)\le & {} n\sum _{j=1}^n f(j)(1-\gamma )^{j-1}. \end{aligned}$$
(16)

\(\square \)

3 Estimation of Variance of \(G_n(f)\)

The proof of the strong law of large numbers for \(L_n(\alpha )\) for a transient random walk given by Becker and König in [1] is based on the following upper bound for the variance of \(L_n(\alpha )\):

$$\begin{aligned} {\mathbb {V}\mathrm{ar}}L_n(\alpha )\le & {} Cn\sum _{x\in {\mathbb {Z}}^d} \sum _{i,j=0}^n {\mathbb {P}}\{S_i=x\} {\mathbb {P}}\{S_j=-x\}\quad \hbox {for all } n, \end{aligned}$$

where \(C=C(\alpha )\) is a constant. Notice that the proof of this bound provided in [1] starts with an analysis of some representation for the variance of \(L_n(\alpha )\), which is only available for integer \(\alpha \)’s, implication of which is necessary for further arguments for the strong law of large numbers for \(L_n(\alpha )\) in the case of a non-integer \(\alpha \).

For this reason, we suggest below a different bound which works not only for \(L_n(\alpha )\) with a non-integer \(\alpha \), but also for \(G_n(f)\) with a function f other than power. This bound provides a straightforward way for proving the strong law of large numbers for \(G_n(f)\) with f satisfying the growth condition (3).

Lemma 6

For any non-decreasing function f with \(f(0)=0\),

$$\begin{aligned} {\mathbb {V}\mathrm{ar}}G_n(f)\le & {} {\mathbb {E}}G_n(f^2) +4\sum _{i=1}^n f(i)\varDelta f(i) (1-\gamma )^{i-1} \sum _{r=1}^n r(n-r){\mathbb {P}}\{S_r=0\} \end{aligned}$$

for all n where \(\varDelta f(i):=f(i)-f(i-1)\ge 0\).

Proof

In view of the representation (12),

$$\begin{aligned} G_n(f)= & {} \sum _{x\in {\mathbb {Z}}^d}\sum _{i=1}^n f(i) {\mathbb {I}}\{l(n,x)=i\}, \end{aligned}$$

hence

$$\begin{aligned}&{\mathbb {V}\mathrm{ar}}G_n(f)\\&\quad = \sum _{x,y\in {\mathbb {Z}}^d}\sum _{i,j=1}^n f(i)f(j)\Bigl ({\mathbb {P}}\left\{ l(n,x)=i,l(n,y)=j\right\} \\&\qquad -{\mathbb {P}}\left\{ l(n,x)=i\}{\mathbb {P}}\{l(n,y)=j\right\} \Bigr )\\&\quad = \sum _{x\in {\mathbb {Z}}^d}\sum _{i=1}^n f^2(i){\mathbb {P}}\{l(n,x)=i\}\\&\qquad +\sum _{x\not =y}\sum _{i,j=1}^n f(i)f(j){\mathbb {P}}\{l(n,x)=i,l(n,y)=j\}\\&\qquad -\sum _{x,y\in {\mathbb {Z}}^d}\sum _{i,j=1}^n f(i)f(j){\mathbb {P}}\{l(n,x)=i\}{\mathbb {P}}\{l(n,y)=j\}, \end{aligned}$$

because \({\mathbb {P}}\{l(n,x)=i,l(n,y)=j\}=0\) if \(x=y\) and \(i\not = j\). Thus, due to \(f\ge 0\),

$$\begin{aligned} {\mathbb {V}\mathrm{ar}}G_n(f)\le & {} {\mathbb {E}}G_n(f^2) +\sum _{i,j=1}^n f(i)f(j) \Bigl (\sum _{x\not =y}{\mathbb {P}}\{l(n,x)=i,l(n,y)=j\}\nonumber \\&\quad -\sum _{x,y}{\mathbb {P}}\{l(n,x)=i\}{\mathbb {P}}\{l(n,y-x)=j\}\Bigr )\nonumber \\&\quad =: {\mathbb {E}}G_n(f^2)+\varSigma ^1_n-\varSigma ^2_n, \end{aligned}$$
(17)

and it only remains to estimate the difference of sums \(\varSigma ^1_n-\varSigma ^2_n\) on the right hand side. Since \(f(0)=0\),

$$\begin{aligned}&\sum _{i,j=1}^n f(i)f(j){\mathbb {P}}\{l(n,x)=i,l(n,y)=j\} \\&\quad = \sum _{i,j=1}^n {\mathbb {P}}\{l(n,x)=i,l(n,y)=j\} \sum _{i_1=1}^i\sum _{j_1=1}^j \varDelta f(i_1)\varDelta f(j_1)\\&\quad = \sum _{i_1,j_1=1}^n \varDelta f(i_1)\varDelta f(j_1) \sum _{i=i_1}^n\sum _{j=j_1}^n {\mathbb {P}}\{l(n,x)=i,l(n,y)=j\}\\&\quad = \sum _{i,j=1}^n \varDelta f(i)\varDelta f(j){\mathbb {P}}\{l(n,x)\ge i,l(n,y)\ge j\}, \end{aligned}$$

and similar equalities hold for ordinary sums. Therefore,

$$\begin{aligned} \varSigma ^1_n-\varSigma ^2_n= & {} \sum _{i,j=1}^n \varDelta f(i)\varDelta f(j) \biggl (\sum _{x\not =y}{\mathbb {P}}\{l(n,x)\ge i,l(n,y)\ge j\}\\&-\sum _{x,y}{\mathbb {P}}\{l(n,x)\ge i\}{\mathbb {P}}\{l(n,y)\ge j\}\biggr ), \end{aligned}$$

where \(\varDelta f(i)\ge 0\) for all i because f is non-decreasing, and the tail probabilities do not decrease as n grows, which makes it possible to perform a required analysis of the double sum. Let us decompose the event \(B=B(x,y,i,j):=\{l(n,x)\ge i,l(n,y)\ge j\}\) for \(x\not = y\) as a union of four disjoint events \(B\cap B_{xy}\), \(B\cap B_{yx}\), \(B\cap B_{xyx}\) and \(B\cap B_{yxy}\), where

$$\begin{aligned} B_{xyx}:= & {} \{S_{n_1}=x, S_{n_2}=y,S_{n_3}=x \hbox { for some }n_1<n_2<n_3\le n\},\\ B_{xy}:= & {} \{\hbox { all visits to }x\hbox { occur before all visits to }y\}. \end{aligned}$$

Denote by \(\tau _x(i)\) the time of ith visit to x by the random walk \((S_n)_{n\ge 0}\). Then, the event \(B\cap B_{xy}\) implies the event:

$$\begin{aligned} B_{xy}(i,j):= & {} \{\hbox {no visits to }y\hbox { before }\tau _x(i)\\&\hbox { and not less than }j\hbox { visits to }y\hbox { after }\tau _x(i)\}. \end{aligned}$$

Altogether, these imply the following upper bound

$$\begin{aligned} {\mathbb {P}}\{B(x,y,i,j)\}\le & {} {\mathbb {P}}\{B\cap B_{xyx}\}+{\mathbb {P}}\{B\cap B_{yxy}\}\nonumber \\&+{\mathbb {P}}\{B\cap B_{xy}(i,j)\}+{\mathbb {P}}\{B\cap B_{yx}(j,i)\}. \end{aligned}$$
(18)

Let us estimate every probability on the right hand side here. Since \(\tau _x(i)\) is a Markov time,

$$\begin{aligned}&{\mathbb {P}}\{B\cap B_{xy}(i,j)\}\\&\quad = \sum _{k\le n}{\mathbb {P}}\{\tau _x(i)=k, \hbox { not less than }j\hbox { visits to }y \hbox { within time interval }[k+1,n]\}\\&\quad = \sum _{k\le n}{\mathbb {P}}\{\tau _x(i)=k\} {\mathbb {P}}\{l(n-k,y-x)\ge j\}\\&\quad \le \sum _{k\le n}{\mathbb {P}}\{\tau _x(i)=k\} {\mathbb {P}}\{l(n,y-x)\ge j\}, \end{aligned}$$

because the event \(\{l(n,y-x)\ge j\}\) can only increase as n grows. Therefore,

$$\begin{aligned} {\mathbb {P}}\{B\cap B_{xy}(i,j)\}\le & {} {\mathbb {P}}\{\tau _x(i)\le n\} {\mathbb {P}}\{l(n,y-x)\ge j\}\\= & {} {\mathbb {P}}\{l(n,x)\ge i\} {\mathbb {P}}\{l(n,y-x)\ge j\}. \end{aligned}$$

Then, summation over all \(x\not = y\) implies that

$$\begin{aligned}&\sum _{x\not =y}\bigl ({\mathbb {P}}\{B\cap B_{xy}(i,j)\} +{\mathbb {P}}\{B\cap B_{yx}(j,i)\}\bigr )\\&\quad \le \sum _{x\not =y}\Bigl ({\mathbb {P}}\{l(n,x)\ge i\} {\mathbb {P}}\{l(n,y-x)\ge j\} +{\mathbb {P}}\{l(n,y)\ge j\} {\mathbb {P}}\{l(n,x-y)\ge i\}\Bigr )\\&\quad \le \sum _{x,y}{\mathbb {P}}\{l(n,x)\ge i\} {\mathbb {P}}\{l(n,y)\ge j\}. \end{aligned}$$

Together with non-negativity of increments of the function f, it implies that

$$\begin{aligned}&\sum _{i,j=1}^n \varDelta f(i)\varDelta f(j) \biggl ( \sum _{x\not =y}\bigl ({\mathbb {P}}\{B\cap B_{xy}(i,j)\}+{\mathbb {P}}\{B\cap B_{yx}(j,i)\}\bigr ) \nonumber \\&\quad -\sum _{x,y}{\mathbb {P}}\{l(n,x)\ge i\}{\mathbb {P}}\{l(n,y)\ge j\}\biggr ) \ \le \ 0. \end{aligned}$$
(19)

Further, the event \(B_{xyx}\) may be described as follows: firstly, the site x is visited at least once, say \(t\ge 1\) times, then the site y is visited one or more times, say \(s\ge 1\) times, and then again the site x is visited, which is followed by visits to x and y in an arbitrary order. Thus, for \(i\ge j\),

$$\begin{aligned}&{\mathbb {P}}\{B\cap B_{xyx}\}\\&\quad \le \sum _{t,s,k_1<\cdots <k_{t+s+1}\le n} {\mathbb {P}}\{S_{k_1}=\cdots =S_{k_t}=x, S_{k_{t+1}}=\cdots =S_{k_{t+s}}=y,\\&\qquad S_{k_{t+s+1}}=x, \hbox { there are no other visits to }x\hbox { and }y\hbox { up to }k_{t+s+1},\\&\qquad S_k=x\hbox { at least }i-t-1\hbox { times past }k_{t+s+1}\}. \end{aligned}$$

and similarly for \(j\ge i\)

$$\begin{aligned}&{\mathbb {P}}\{B\cap B_{xyx}\}\\&\quad \le \sum _{t,s,k_1<\cdots <k_{t+s+1}\le n} {\mathbb {P}}\{S_{k_1}=\cdots =S_{k_t}=x, S_{k_{t+1}}=\cdots =S_{k_{t+s}}=y,\\&\quad S_{k_{t+s+1}}=x, \hbox { there are no other visits to }x\hbox { and }y\hbox { up to }k_{t+s+1},\\&\quad S_k=y\hbox { at least }j-s\hbox { times past }k_{t+s+1}\}. \end{aligned}$$

Summing up for all x and y, we arrive at the following upper bound

$$\begin{aligned}&\sum _{x\not =y}{\mathbb {P}}\{B\cap B_{xyx}\} \\&\quad \le {\mathbb {P}}^{i-1}\{\tau<\infty \} \sum _{z\in {\mathbb {Z}}^d,\ r_1<r_2<r_3\le n} {\mathbb {P}}\{S_{r_2}-S_{r_1}=z,S_{r_3}-S_{r_2}=-z\}\\&\quad = (1-\gamma )^{i-1} \sum _{z\in {\mathbb {Z}}^d,\ r_1<r_2<r_3\le n} {\mathbb {P}}\{S_{r_2}-S_{r_1}=z,S_{r_3}-S_{r_2}=-z\} \end{aligned}$$

in the case \(i\ge j\) and similarly with coefficient \((1-\gamma )^{j-1}\) in the case \(j\ge i\). Since

$$\begin{aligned} \sum _{z\in {\mathbb {Z}}^d} {\mathbb {P}}\{S_{r_2}-S_{r_1}=z,S_{r_3}-S_{r_2}=-z\} \ =\ {\mathbb {P}}\{S_{r_3}-S_{r_1}=0\}, \end{aligned}$$

we get, for \(i\ge j\),

$$\begin{aligned} \sum _{x\not =y}{\mathbb {P}}\{B\cap B_{xyx}\}\le & {} (1-\gamma )^{i-1} \sum _{r_1<r_3\le n} (r_3-r_1){\mathbb {P}}\{S_{r_3}-S_{r_1}=0\}\\= & {} (1-\gamma )^{i-1} \sum _{r=1}^n r(n-r){\mathbb {P}}\{S_r=0\}, \end{aligned}$$

which together with (17), (18) and (19) shows that the variance of \(G_n(f)\) does not exceed

$$\begin{aligned} {\mathbb {E}}G_n(f^2) +4\sum _{j\le i,\ i,j=1}^n \varDelta f(i)\varDelta f(j) (1-\gamma )^{i-1} \sum _{r=1}^n r(n-r){\mathbb {P}}\{S_r=0\}. \end{aligned}$$

The sum of \(\varDelta f(j)\) from \(j=1\) to i equals f(i), hence the desired upper bound for \({\mathbb {V}\mathrm{ar}}G_n(f)\). \(\square \)

4 Proof of Theorem 1

Without loss of generality, we assume \(f(0)=0\). Any function \(f:{\mathbb {Z}}^+\rightarrow {\mathbb {R}}\) with \(f(0)=0\) is decomposable into a difference of two non-decreasing functions, \(f=f_1-f_2\), where

$$\begin{aligned} f_1(j)\ =\ \sum _{i=1}^j (f(i)-f(i-1))^+,\quad f_2(j)\ =\ \sum _{i=1}^j (f(i)-f(i-1))^-. \end{aligned}$$
(20)

Since

$$\begin{aligned} f_k(j)\le & {} \sum _{i=1}^j |f(i)-f(i-1)| \ \le \ 2\sum _{i=1}^j |f(i)|,\quad k=1,\ 2, \end{aligned}$$

we get the following upper bound

$$\begin{aligned} \sum _{j=1}^\infty f_k^2(j)(1-\gamma )^j\le & {} 4\sum _{j=1}^\infty (1-\gamma )^j\biggl (\sum _{i=1}^j |f(i)|\biggr )^2\\\le & {} 4\sum _{j=1}^\infty (1-\gamma )^j j\sum _{i=1}^j f^2(i)\\= & {} 4\sum _{i=1}^\infty f^2(i) \sum _{j=i}^\infty (1-\gamma )^j j \ \le \ \frac{4}{\gamma ^2}\sum _{i=1}^\infty f^2(i)(i+1)(1-\gamma )^i. \end{aligned}$$

Therefore, the condition (3) implies that

$$\begin{aligned} \sum _{j=1}^\infty f_k^2(j)(1-\gamma )^j< & {} \infty ,\quad k=1,\ 2. \end{aligned}$$
(21)

Hence, without loss of generality, we assume that f is a non-decreasing function satisfying (21) and \(f(0)=0\).

The transience of the random walk \((S_n)_{n\ge 0}\) is equivalent to the convergence of the series

$$\begin{aligned} \sum _{n=1}^\infty {\mathbb {P}}\{S_n=0\}< & {} \infty . \end{aligned}$$
(22)

The condition (21) allows us to apply the upper bound (16) to \(f^2\) and to conclude that \({\mathbb {E}}G_n(f^2)\le c_1n\) for some \(c_1<\infty \). Since f is non-decreasing and \(f(0)=0\), \(\varDelta f(i)\le f(i)\). Therefore, by Lemma 6,

$$\begin{aligned} {\mathbb {V}\mathrm{ar}}G_n(f)\le & {} c_1n+c_2n\sum _{i=1}^n f^2(i) (1-\gamma )^{i-1} \sum _{r=1}^n r{\mathbb {P}}\{S_r=0\}\\\le & {} c_1n+c_3n \sum _{r=1}^n r{\mathbb {P}}\{S_r=0\}, \end{aligned}$$

again by the condition (21). In view of (22),

$$\begin{aligned} a_n\ :=\ \frac{1}{n}\sum _{r=1}^n r{\mathbb {P}}\{S_r=0\}\ \rightarrow 0 \quad \hbox { as }n\rightarrow \infty \end{aligned}$$

and hence

$$\begin{aligned} {\mathbb {V}\mathrm{ar}}\frac{G_n(f)}{n}\le & {} \frac{c_1}{n}+c_3a_n\rightarrow 0\quad \hbox { as }n\rightarrow \infty , \end{aligned}$$
(23)

which is equivalent to the convergence \((G_n(f)-{\mathbb {E}}G_n(f))/n\rightarrow 0\) in \(L_2\). Together with the convergence (10), this completes the proof of \(L_2\)-convergence stated in Theorem 1.

For the proof of the almost sure convergence, first let us notice that (22) yields

$$\begin{aligned} \sum _{n=1}^\infty {\frac{a_n}{n}}= & {} \sum _{n=1}^\infty {\frac{1}{n^2}{\sum _{r=1}^n r{\mathbb {P}}\{S_r=0\}}}\\\le & {} \sum _{r=1}^\infty {\mathbb {P}}\{S_r=0\} \ r\sum _{n=r}^\infty \frac{1}{n^2}\ \le \ 2\sum _{r=1}^\infty {\mathbb {P}}\{S_r=0\}\ <\ \infty . \end{aligned}$$

Hence, we can apply Lemma 7 proven below to the sequence \(\{a_n\}_{n\ge 1}\), so, for any fixed \(\delta >0\), there is an increasing subsequence \(\{n_r\}_{r\ge 1}\) such that \(\sum _{r=1}^\infty a_{n_r}<\infty \) and \(\sqrt{1+\delta }n_{r-1}\le n_{r+1}\le (1+\delta )n_r\) for all r.

Using Chebyshev’s inequality, the upper bound (23) and the convergence (10), we conclude that, for any \(\varepsilon >0\),

$$\begin{aligned} \sum _{r=1}^\infty {\mathbb {P}}\left\{ \Bigl |\frac{G_{n_r}(f)}{{\mathbb {E}}G_{n_r}(f)}-1\Bigl | >\varepsilon \right\}\le & {} \sum _{r=1}^\infty \frac{{\mathbb {V}\mathrm{ar}}G_{n_r}(f)}{{\varepsilon }^2 {({\mathbb {E}}G_{n_r}}(f))^2}\\\le & {} \frac{C}{\varepsilon ^2}\sum _{r=1}^\infty (1/n_r+a_{n_r})<\infty . \end{aligned}$$

Then, it follows from the Borel–Cantelli lemma that

$$\begin{aligned} \frac{G_{n_r}(f)}{{\mathbb {E}}G_{n_r}(f)}{\mathop {\rightarrow }\limits ^{\mathrm{a.s.}}}1 \quad \hbox { as }r\rightarrow \infty . \end{aligned}$$
(24)

Further, for any n, there exists r such that \(n_r\le n\le n_{r+1}\) and, hence

$$\begin{aligned} \frac{G_{n_r}(f)}{{\mathbb {E}}G_{n_{r+1}}(f)}\ \le \ \frac{G_n(f)}{{\mathbb {E}}G_n(f)}\ \le \ \frac{G_{n_{r+1}}(f)}{{\mathbb {E}}G_{n_r}(f)}. \end{aligned}$$
(25)

It follows from (10) that

$$\begin{aligned} \frac{{\mathbb {E}}G_{n_{r+1}}(f)}{{\mathbb {E}}G_{n_r}(f)}\ \sim \ \frac{n_{r+1}}{n_r}\quad \hbox { as }r\rightarrow \infty . \end{aligned}$$

Moreover, \(n_r<n_{r+1}\le (1+\delta )n_r\) for all r. Then, (24) and (25) imply that

$$\begin{aligned} \frac{1}{1+\delta }\ \le \ \liminf _{n\rightarrow \infty }{\frac{G_n(f)}{{\mathbb {E}}G_n(f)}}\le & {} \limsup _{n\rightarrow \infty }{\frac{G_n(f)}{{\mathbb {E}}G_n(f)}}\ \le \ 1+\delta \quad \hbox { a.s.} \end{aligned}$$

Due to arbitrary choice of \(\delta >0\), the a.s. convergence \(G_n(f)/{\mathbb {E}}G_n(f)\rightarrow 1\) follows.

\(\square \)

In the last proof, we have made use of the following auxiliary result.

Lemma 7

Let \(v_n\ge 0\) and \(\sum _{n=1}^\infty \frac{v_n}{n}<\infty \). Then, for any fixed \(\delta >0\), there exists an increasing subsequence \(\{n_r\}_{r\ge 1}\) such that \(\sum _{r=1}^\infty v_{n_r}<\infty \) and \(\sqrt{1+\delta }n_{r-1}\le n_{r+1}\le (1+\delta )n_r\) for all \(r\ge 1\).

Proof

Let us fix an arbitrary \(b\in (1,2)\) and identify a \(K=K(b)\) such that \([b^K]-[b^{K-1}]\ge 2\). For \(r\ge 1\), choose

$$\begin{aligned} n_r\in [[b^{K+r-2}]+1,[b^{K+r-1}]]\hbox { such that } v_{n_r}\ =\ \min _{[b^{K+r-2}]+1\le n \le [b^{K+r-1}]}{v_n}. \end{aligned}$$

By this construction,

$$\begin{aligned} \sum _{n=1}^\infty \frac{v_n}{n}\ge & {} v_{n_1}\sum _{n=1}^{[b^K]} \frac{1}{n}+ v_{n_2}\sum _{n=[b^K]+1}^{[b^{K+1}]}\frac{1}{n}+\cdots + v_{n_r}\sum _{n=[b^{K+r-2}]+1}^{[b^{K+r-1}]}\frac{1}{n}+\cdots \end{aligned}$$

Since

$$\begin{aligned} \sum _{n=\left[ b^{K+r-2} \right] +1}^{\left[ b^{K+r-1}\right] }\frac{1}{n}\rightarrow & {} \log b\ >\ 0\quad \hbox { as } r\rightarrow \infty , \end{aligned}$$

the convergence of the series \(\sum _n\frac{v_n}{n}\) guarantees convergence of the series \(\sum _r v_{n_r}\). Also, for all r,

$$\begin{aligned} \frac{n_{r+1}}{n_{r-1}}\ \ge \ \frac{b^{K+r-1}}{b^{K+r-2}}\ =\ b \quad \hbox { and }\quad \frac{n_{r+1}}{n_r}\ \le \ \frac{b^{K+r}}{b^{K+r-2}}\ =\ b^2, \end{aligned}$$

so the lemma conclusion follows if we take \(b=\sqrt{1+\delta }\). \(\square \)

5 Proof of Theorem 4

To prove Theorem 4, let us first consider the maximal local time, \(l(n):=\max \{l(n,x),\ x\in {\mathbb {Z}}^d\}\). Theorem 13 in Erdős and Taylor [4] states a strong limit theorem for l(n): for a simple random walk in \(d\ge 3\) dimensions,

$$\begin{aligned} \frac{l(n)}{\log n}\rightarrow & {} \frac{1}{\log \frac{1}{1-\gamma }}\ =:\ \frac{1}{\lambda _*}\quad \hbox { as }n\rightarrow \infty \hbox { with probability }1. \end{aligned}$$
(26)

The proof in [4] is split into two parts, dealing with upper and lower bounds. There is some issue with the proof of the upper bound, that is,

$$\begin{aligned} \limsup _{n\rightarrow \infty }\frac{l(n)}{\log n}\le & {} \frac{1}{\lambda _*} \quad \hbox { with probability }1. \end{aligned}$$
(27)

The proof suggested in [4] is based on the inequality for tails

$$\begin{aligned} {\mathbb {P}}\{l(n)>t\}\le & {} n{\mathbb {P}}\{l(n,0)>t\}\quad \hbox { for all }t>0, \end{aligned}$$
(28)

and on the observation that the number of returns to the origin, l(n, 0), is dominated by a geometrically distributed random variable with parameter \(1-\gamma \). Notice that justification of (28) in [4] is not complete because it is based there on the assumption that all sites visited by the random walk—clearly not more than n—can be treated in the same way as the origin. This point requires further justification because the set of visited sites is random. The same issue occurs in the proof of Theorem 1 in Revesz [11]. Notice that this set is contained in the ball of radius n, which leads to the coefficient \(n^d\) instead of n on the right hand side of (28) which in its turn leads to the constant \(d/\lambda _*\) on the right hand side of (27) instead of \(1/\lambda _*\).

The last issue may be resolved in different ways, particularly, we may condition on the non-zero value of \(S_1\),

$$\begin{aligned} {\mathbb {P}}\{l(n)>t\}\le & {} {\mathbb {P}}\{l(n,0)>t\}+\sum _{x\not = 0}{\mathbb {P}}\{l(n-1,x)>t\mid S_1=x\}{\mathbb {P}}\{S_1=x\}, \end{aligned}$$

followed by an induction argument on n. Hence, the upper bound (28) holds for any transient random walk in any dimensions. Therefore,

$$\begin{aligned} {\mathbb {P}}\{l(n)>t\}\le & {} n{\mathbb {P}}\{l(\infty ,0)>t\}\ \le \ n(1-\gamma )^{t-1} \ =\ ne^{-(t-1)\lambda _*}, \end{aligned}$$

which implies, for all \(\varepsilon >0\) and \(m\in \{0,1,2,\ldots \}\), the following upper bound

$$\begin{aligned} {\mathbb {P}}\{C(n,\varepsilon ,m)\}\le & {} \frac{2}{\log n\ldots \log _{(m-2)}n\log _{(m-1)}^{1+\varepsilon }n}, \end{aligned}$$

for the events

$$\begin{aligned} C(n,\varepsilon ,m):= & {} \Bigl \{l(2n)>1+ \frac{1}{\lambda _*}(\log n+\cdots +\log _{(m-1)}n +(1+\varepsilon )\log _{(m)}n)\Bigr \}; \end{aligned}$$

hereinafter \(\log _{(m)}x\) denotes the m-fold iterated logarithms, that is,

$$\begin{aligned} \log _{(0)}(x)=x,\quad \log _{(m)}(x)=\log \log _{(m-1)}x\quad \hbox { for all }m\ge 1. \end{aligned}$$

Therefore, the series \(\sum _{k=1}^\infty {\mathbb {P}}\{C(2^k,\varepsilon ,m)\}\) converges; hence, by the Borel-Cantelli lemma, only finitely many of \(C(2^k,\varepsilon ,m)\) occur, with probability 1. For any \(n\in [2^k,2^{k+1})\) and the event

$$\begin{aligned} B(n,\varepsilon ,m):= & {} \Bigl \{l(n)>1+ \frac{1}{\lambda _*}(\log n+\cdots +\log _{(m-1)}n +(1+\varepsilon )\log _{(m)}n)\Bigr \}, \end{aligned}$$

we have inclusion \(B(n,\varepsilon ,m)\subseteq C(2^k,\varepsilon ,m)\), and thus only finitely many of \(B(2^k,\varepsilon ,m)\) occur, with probability 1. In other words, we arrive at the following result.

Proposition 8

For all \(\varepsilon >0\) and \(m\in \{0,1,2,\ldots \}\),

$$\begin{aligned} l(n)\le & {} \frac{1}{\lambda _*}\Bigl (\log n+\cdots +\log _{(m-1)}n +(1+\varepsilon )\log _{(m)}n\Bigl ), \end{aligned}$$

for all \(n\ge N\) where N is finite with probability 1.

Notice that, for a simple random walk in \({\mathbb {Z}}^d\), \(d\ge 3\), an upper a.s. bound \(\lambda _*^{-1}(\log n+(1+\varepsilon )\log \log n)\) and—in the case of \(d\ge 4\)—a lower a.s. bound \(\lambda _*^{-1}(\log n-(3+\varepsilon )\log \log n)\) is derived by Revesz in [11] following a different technique; he has also proved that \(l(n)\ge \lambda _*^{-1}(\log n+(1-2/(d-2)-\varepsilon )\log \log n)\) infinitely often a.s. The maximal local time for a zero drift random walk on \({\mathbb {Z}}\) with finite variance—which is clearly recurrent—was studied by Kesten in [10].

Let us proceed with the proof of Theorem 4, we start with the case (ii). Introducing two non-decreasing functions, \(f_1\) and \(f_2\) as in (20), we notice that then \(f_k(i)\le {\widetilde{C}} e^{i\lambda _*}/i\log ^{2+\varepsilon }i\) for \(k=1\), 2, because

$$\begin{aligned} \sum _{i=1}^n \frac{e^{i\lambda _*}}{i\log ^{2+\varepsilon }i}= & {} O\Bigl (\frac{e^{n\lambda _*}}{n\log ^{2+\varepsilon }n}\Bigr ) \quad \hbox { as }n\rightarrow \infty . \end{aligned}$$

Hence, without loss of generality, we assume that f is non-decreasing with \(f(0)=0\).

The function f satisfies the condition (9), but not (21), and this generates a certain difficulty we need to overcome. To this end, let us introduce two sequences of truncated functions

$$\begin{aligned} f_n(i):= & {} f(i){\mathbb {I}}\bigl \{i\le \lambda _*^{-1}\log n\bigr \},\\ f_n^+(i):= & {} f(i){\mathbb {I}}\bigl \{\lambda _*^{-1} \log n<i\le \lambda _*^{-1}(\log n+b_n)\bigr \}, \end{aligned}$$

where \(b_n=\log _{(2)}n+2\log _{(3)}n\) and make use of the following decomposition

$$\begin{aligned} G_n(f)= & {} G_n(f_n)+G_n(f_n^+)+G_n(f-f_n-f_n^+). \end{aligned}$$

Since f satisfies the condition (9), we get equivalences

$$\begin{aligned} {\mathbb {E}}G_n(f_n)\sim & {} {\mathbb {E}}G_n(f)\ \sim \ n\gamma ^2 \sum _{j=1}^\infty f(j)(1-\gamma )^{j-1}\quad \hbox { as }n\rightarrow \infty , \end{aligned}$$
(29)

and, by (16), the following upper bound

$$\begin{aligned} {\mathbb {E}}G_n(f_n^2)\le & {} c_1\frac{n}{\log n\log _{(2)}^{2+\varepsilon }n} {\mathbb {E}}G_n(f_n)\ \le \ c_2\frac{n^2}{\log n\log _{(2)}^2 n}. \end{aligned}$$

Further, it follows from the condition (8) that

$$\begin{aligned} \sum _{r=1}^n r(n-r){\mathbb {P}}\{S_r=0\}\le & {} n\sum _{r=1}^n r{\mathbb {P}}\{S_r=0\}\ \le \ c_3n\log n. \end{aligned}$$

In addition,

$$\begin{aligned} \sum _{i=1}^n f_n(i)\varDelta f_n(i)(1-\gamma )^{i-1}\le & {} \sum _{i=1}^{\lambda _*^{-1}\log n} f^2(i)e^{-(i-1)\lambda _*}\\\le & {} c_4\frac{e^{i\lambda _*}}{i^2\log ^4 i}\Big |_{i=\lambda _*^{-1}\log n}\\\le & {} c_5\frac{n}{\log ^2 n\log _{(2)}^4 n}. \end{aligned}$$

Substituting the last three bounds into the right hand side of the inequality provided by Lemma 6, we derive that

$$\begin{aligned} {\mathbb {V}\mathrm{ar}}G_n(f_n)\le & {} c_6n^2/\log n\log _{(2)}^2n. \end{aligned}$$

Choose a subsequence \(n_r=[e^{r/\log ^{1/4}r}]\), then, by Chebyshev’s inequality, the last upper bound and (29), we conclude that

$$\begin{aligned} \sum _{r=1}^\infty {\mathbb {P}}\left\{ \Bigl |\frac{G_{n_r}(f_{n_r})}{{\mathbb {E}}G_{n_r}(f_{n_r})}-1\Bigl | >\frac{1}{\log ^{1/8} r}\right\}\le & {} \sum _{r=1}^\infty \frac{\log ^{1/4} r{\mathbb {V}\mathrm{ar}}G_{n_r}(f_{n_r})}{{({\mathbb {E}}G_{n_r}}(f_{n_r}))^2}\\\le & {} c_7\sum _{r=1}^\infty \frac{1}{r\log ^{3/2}r}\ <\ \infty , \end{aligned}$$

which allows us to apply the Borel–Cantelli lemma, hence obtaining

$$\begin{aligned} \frac{G_{n_r}(f_{n_r})}{{\mathbb {E}}G_{n_r}(f_{n_r})}&{\mathop {\rightarrow }\limits ^{\mathrm{a.s.}}}&1 \quad \hbox { as }r\rightarrow \infty . \end{aligned}$$

Similar to (25), if \(n_r\le n\le n_{r+1}\) then

$$\begin{aligned} \frac{G_{n_r}(f_{n_r})}{{\mathbb {E}}G_{n_{r+1}}(f_{n_{r+1}})}\le & {} \frac{G_n(f_n)}{{\mathbb {E}}G_n(f_n)}\ \le \ \frac{G_{n_{r+1}}(f_{n_{r+1}})}{{\mathbb {E}}G_{n_r}(f_{n_r})}. \end{aligned}$$

In addition, by (29),

$$\begin{aligned} \frac{{\mathbb {E}}G_{n_{r+1}}(f_{n_{r+1}})}{{\mathbb {E}}G_{n_r}(f_{n_r})}\ \sim \ \frac{n_{r+1}}{n_r}\ \sim \ e^{\frac{r+1}{\log ^{1/4}(r+1)}-\frac{r}{\log ^{1/4}r}}\ \rightarrow \ 1\quad \hbox { as }r\rightarrow \infty . \end{aligned}$$

Therefore,

$$\begin{aligned} \frac{G_n(f_n)}{{\mathbb {E}}G_n(f_n)}{\mathop {\rightarrow }\limits ^{\mathrm{a.s.}}}1 \quad \hbox { as }n\rightarrow \infty . \end{aligned}$$
(30)

Further, it follows from (16) that, for all \(m\le n\),

$$\begin{aligned} {\mathbb {E}}\frac{G_n(f_m^+)}{n}\le & {} \sum _{j=[\lambda _*^{-1}\log m]}^{[\lambda _*^{-1}(\log m+b_m)]} f(j)(1-\gamma )^{j-1}\\\le & {} c_7 \sum _{j=[\lambda _*^{-1}\log m]}^{[\lambda _*^{-1}(\log m+b_m)]} \frac{1}{{j\log ^{2+\varepsilon }j}}\\= & {} O\biggl (\frac{b_m}{\log m\log _{(2)}^{2+\varepsilon }m}\biggr ) \ =\ O\biggl (\frac{1}{\log n\log _{(2)}^{1+\varepsilon }n}\biggr ), \end{aligned}$$

if \(m\ge n/2\). Applying Chebyshev’s inequality to non-negative random variables \(G_{n_{k+1}}(f_{n_k}^+)/n_{k+1}\) with \(n_k=2^k\), we get the following series convergence

$$\begin{aligned} \sum _{k=1}^\infty {\mathbb {P}}\Bigl \{\frac{G_{n_{k+1}}(f_{n_k}^+)}{n_{k+1}}\ge \frac{1}{\log ^{\varepsilon /2}k}\Bigr \}\le & {} \sum _{k=1}^\infty \frac{c_8/k\log ^{1+\varepsilon }k}{1/\log ^{\varepsilon /2}k} \ <\ \infty , \end{aligned}$$

which in its turn implies by the Borel–Cantelli lemma that

$$\begin{aligned} \frac{G_{n_{k+1}}(f_{n_k}^+)}{n_{k+1}}\rightarrow & {} 0 \quad \hbox { as }k\rightarrow \infty \hbox { with probability }1. \end{aligned}$$

In addition, for \(n_k\le n\le n_{k+1}\),

$$\begin{aligned} \frac{G_n(f_n^+)}{n}\le & {} \frac{G_{n_{k+1}}(f_{n_k}^+)}{n_k} \ =\ 2\frac{G_{n_{k+1}}(f_{n_k}^+)}{n_{k+1}}, \end{aligned}$$

hence

$$\begin{aligned} \frac{G_n(f_n^+)}{n}\rightarrow & {} 0 \quad \hbox { as }n\rightarrow \infty \hbox { with probability }1. \end{aligned}$$
(31)

Finally, since l(n) is the largest local time,

$$\begin{aligned} \{G_n(f-f_n-f_n^+)>0\}\subseteq & {} \{l(n)>\lambda _*^{-1}\bigl (\log n+\log _{(2)}n+2\log _{(3)}n\bigr )\}, \end{aligned}$$

which implies a.e. convergence \(G_n(f-f_n-f_n^+)\rightarrow 0\) as \(n\rightarrow \infty \), due to Proposition 8 with \(m=3\). Together with (30), (31) and (29) it implies the desired convergence (4) in the case (ii).

In the case (i), the proof requires some alterations. Consider a sequence of truncated functions

$$\begin{aligned} f_n(i):= & {} f(i){\mathbb {I}}\biggl \{i\le \frac{\lambda _*^{-1}\eta }{2}\log n\biggr \}, \end{aligned}$$

and make use of the following decomposition

$$\begin{aligned} G_n(f)= & {} G_n(f_n)+G_n(f-f_n). \end{aligned}$$

As above, the equivalences (29) hold and, by (16),

$$\begin{aligned} {\mathbb {E}}G_n(f_n^2)\le & {} c_9n^{\eta /2}{\mathbb {E}}G_n(f_n)\ \le \ c_{10}n^{1+\eta /2}. \end{aligned}$$

Further, it follows from the condition (7) that

$$\begin{aligned} \sum _{r=1}^n r(n-r){\mathbb {P}}\{S_r=0\}\le & {} n\sum _{r=1}^n r{\mathbb {P}}\{S_r=0\} \ \le \ c_{11}n^{2-\eta }. \end{aligned}$$

In addition,

$$\begin{aligned} \sum _{i=1}^n f_n(i)\varDelta f_n(i)(1-\gamma )^{i-1}\le & {} \sum _{i=1}^{\frac{\lambda _*^{-1}\eta }{2}\log n} f^2(i)e^{-(i-1)\lambda _*} \ \le \ c_{12}n^{\eta /2}. \end{aligned}$$

Substituting the last three bounds into the right hand side of the inequality provided by Lemma 6, we derive that

$$\begin{aligned} {\mathbb {V}\mathrm{ar}}G_n(f_n)\le & {} c_{13}n^{2-\eta /2}, \end{aligned}$$

since \(\eta <1\). Then, similar to the case (ii) we deduce (30). Further, it follows from (16) that, for all \(m\le n\),

$$\begin{aligned} {\mathbb {E}}\frac{G_n(f-f_m)}{n}\le & {} \sum _{j= \left[ \frac{\lambda _*^{-1}\eta }{2}\log m \right] }^n f(j)(1-\gamma )^{j-1}\\\le & {} c_{14} \sum _{j= \left[ \frac{\lambda _*^{-1}\eta }{2}\log m \right] }^\infty \frac{1}{j^{2+\varepsilon }} \ =\ O\biggl (\frac{1}{\log ^{1+\varepsilon }n}\biggr ), \end{aligned}$$

if \(m\ge n/2\). Again similar to the case (ii), we deduce from the last bound that

$$\begin{aligned} \frac{G_n(f-f_n)}{n}\rightarrow & {} 0 \quad \hbox { as }n\rightarrow \infty \hbox { with probability }1, \end{aligned}$$

which together with (30) and equality \(G_n(f)=G_n(f_n)+G_n(f-f_n)\) implies (4) in the case (i). The proof of Theorem 4 is complete. \(\square \)