3 Birkhoff’s Ergodic Theorem 469since the measure-preserving nature ofTimplies that, for anyg∈L(X,B,μ),
∫Xg(Tx)dμ(x)=∫
Xg(x)dμ(x).Since
∫
Xf ̃dμ≤∫
Xfdμ+∫
X\ENMdμ≤∫
Xfdμ+ε,it follows that
∫
Xf ̄Mdμ≤∫
Xfdμ+ 2 ε+NM/L.SinceLmay be chosen arbitrarily large and thenεarbitrarily small, we conclude that
∫Xf ̄Mdμ≤∫
Xfdμ.Now lettingM→∞, we obtain
∫Xf ̄dμ≤∫
Xfdμ.The proof that
∫Xfdμ≤∫
Xfdμis similar. Givenε>0, there exists for eachx∈Xa positive integernsuch that
n−^1n∑− 1k= 0f(Tkx)≤f(x)+ε. (∗∗)IfFnis the set of allx∈Xfor which (∗∗) holds and ifEn=
⋃n
k= 1 Fk, we can choose
Nso large that
∫X\ENfdμ<ε.Put
f ̃(x)=f(x) ifx∈EN,
=0ifx∈/EN.Letτ(x)be the least positive integernfor which (∗∗) holds ifx∈EN,andτ(x)= 1
otherwise. The proof now goes through in the same way as before.