# A question about applying Birkhoff's ergodic Theorem.

Suppose that I have the transformation $$T(x,y)=(x+a,y+b), a,b \in \mathbb{R}$$ from the 2-dimensional torus $$\mathbb{R}^2/\mathbb{Z}^2$$ to itself. We know that this transformation in ergodic with respect to the Lebesgue 2-d measure on the torus if and only if $$a,b$$ are rationally independent which means $$na+mb \in \mathbb{Z}$$ if and only if $$n=m=0$$.

Now according to Birkhoff's ergodic theorem for any function $$f\in C(\mathbb{R}^2/\mathbb{Z}^2,\mathbb{R})$$ we have that $$\lim_{n\to\infty}\frac{1}{n}\sum_{j=0}^{n-1}f(T^j(x,y))=\int f dm$$ for almost all $$(x,y) \in \mathbb{R}^2/\mathbb{Z}^2$$, where $$T^j$$ are the iterates of $$T$$ and $$m$$ is the 2-d Lebesgue measure and the integral is over $$[0,1]\times[0,1]$$.

Let's say that we choose the function $$f(x,y)=\cos (2\pi y)$$ which is continuous in $$[0,1]\times[0,1]$$ and we choose $$a\not \in \mathbb{Q}$$ and $$b=0$$. Then $$T$$ is ergodic and $$T^j(x,y)=(x+ja,y)$$, so we have that $$\lim_{n\to\infty}\frac{1}{n}\sum_{j=0}^{n-1}\cos(2\pi y)=\int_{0}^{1}\int_{0}^{1} \cos (2\pi y) dydx=0$$ But this cannot be true almost everywhere since the sum on the left is equal with $$\cos (2\pi y)$$.

Now my Question is what am I doing wrong?

Your choice for $$(a,b)$$ does not give rationally independent elements, because $$0\cdot a+1\cdot b=0$$ (with $$n=0$$, $$m=1$$) hence the transformation is not ergodic.
The only problem is with rational independence of $$a$$ and $$b$$. Since $$(0)(a)+(1)(b)=0$$ your $$a$$ and $$b$$ are not rationally independent. So $$T$$ is not ergodic.