As seen on [wikipedia](http://en.wikipedia.org/wiki/Ergodic_theory#Sojourn_time), given a measure space $(X,\Sigma,\mu)$ with $\mu(X) < \infty$ and a measure preserving transformation $T: X \mapsto X$. Let $A \subset X$ be a set of positive measure. Define $k\_i$ as the power of $T$ such that $T^{k\_i}x \in A$ for the $i$th time: that is to say $k\_i$ is the "$i$'th return time to $A$". The difference between recurrence times is $R\_i = k\_i - k\_{i-1}$ (assume for simplicity that $k\_0 = 0$, that is $x \in A$)


I would like know how to prove the following:


$$ \lim\limits\_{n\mapsto\infty} \frac{R\_1 + \cdots + R\_n}{n} = \frac{\mu(X)}{\mu(A)}$$


The [wikipedia article](http://en.wikipedia.org/wiki/Ergodic_theory#Sojourn_time) indicates that this is a consequence of the ergodic theorem.


Note that my definition of the $k\_i$ above differs slightly from that of wikipedia, in as much as I have omitted to say that the $k\_i$s are sorted in increasing order.



The average recurrence time
As you might guess from the reference to the ergodic theorem, you do need to assume that
$T$ is ergodic. For a counterexample where $T$ is not ergodic, consider the identity 
map and suppose $\mu(A) < \mu(X)$. 


Note that $R\_1 + \ldots + R\_n = k\_n$. Let $I\_A$ be the indicator function of $A$, which of course is in $L^1(\mu)$.  

The Birkhoff ergodic theorem says if $T$ is ergodic, $\lim\_{k \to \infty} \frac{1}{k} \sum\_{j=1}^k I\_A(T^i x)
= \frac{1}{\mu(X)} \int I\_A d\mu$ almost everywhere, i.e. $S\_k(x)/k \to \mu(A)/\mu(X)$
where $S\_k(x)$ is the number of $i \in \{1,2,\ldots, k\}$ such that $T^i(x) \in A$.
Since $\mu(A) > 0$, we also have $k/S\_k(x) \to \mu(X)/\mu(A)$ almost everywhere.
But if $k = k\_n(x)$, $S\_k = n$.


