Prove existence of Borel set related to the function $f(x)=2x \mod 1$ Let $I=[0,1)$ and $f(x)=2x \mod 1$. Prove that for every $\epsilon>0$ there is $E\subset I$ Borel set s.a $m(I/E)<\epsilon$ and $\lim_{N\to\infty} \sup \left\{|\frac{1}{N}\sum_{j=0}^{N-1} 1_{[0,1/2)}(f^j(x))-1/2|:x\in E\right\}=0$.
$f^j$ means $f\circ f\circ f\circ ...$, and $1_{[0,1/2)}(f^j(x))$ is $1$ if $f^j(x)\in [0,1/2)$ and $0$ otherwise.
Could you help me with this question?
1. this is homework. thought it would be fair to mention it. I did spend a lot of time on it though.


*My thoughts are that given a $j$, in order for $f^j(x)$ to be $1$, $x$ has to lie in one of $j$ subsets of $[0,1/2)$ of length $1/j$ (am i right? did i understand $f$ correctly?)

*Also, one could show that $\lim \int =0$ and therefore deduce that the integrand is $0$ a.e.

*Lebesgue sets are the complement of the Borel sigma algebra, so if i could find any measurable set satisfies it, I could also find a Borel subset of it close enough to it.
Thanks!
P.s
I understand that it has something to do with ergodic theory. I'm not allowed to use any ergodic theorems - purely measure theory.
P.s2:
I am allowed to use this, if you should find it useful:
Let $(X,M,\mu)$ be a measure space, and $f_k:M\to\mathbb R$ function series. assume $\int f_k^2 <A$ and $\langle f_i,f_j\rangle=0$ for $i\not=j$. Then $\lim_{N\to\infty} \frac{1}{N}\sum_{k=1}^N f_k(x)=0 $ a.e.
 A: I'll give a few hints. The idea is first to prove:

$$\lim_{N \to + \infty} \left| \frac{1}{N}\sum_{j=0}^{N-1} 1_{[0,1/2)} \circ f^j-\frac{1}{2} \right| = 0 \ \ a.e. \ \ (*)$$

There are two ways. The first is to turn almost every $x$ into its binary expansion $0.x_0 x_1 \ldots$. Then, $x$ is chosen under the Lebesgue measure if and only if the $x_j$'s are independent and equidistributed, with $\mathbb{P} (x_j = 0) = \mathbb{P} (x_j = 0) = 1/2$. In addition, $1_{[0, 1/2)} (f^j (x)) = x_j$. The result follows from the strong law of large numbers.
But, to stay in the spirit of your question, I'd suggest to tweak the formulation. For $j \geq 0$, let $f_j := (1_{[0, 1/2)} -1/2)\circ f^j$.
Question 1: Prove that $f$ preserve the Lebesgue measure, i.e. that for all $\varphi \in \mathbb{L}^1 ([0,1))$, we have $\int \varphi \circ f (x) \ dx = \int \varphi (x) \ dx$. Compute $\int f_j^2 (x) \ dx$.
That's not as hard as it sounds. There are two ways. The first is to use the change of variable formula, but it needs some tweaking as $f$ is not bijective. The other is to prove the equality when $\varphi$ is the characteristic function of an interval.
Let $[a,b) \subset [0,1)$. Then what is $f^{-1} ([a,b))$? Prove that $Leb(|a,b)) = Leb(f^{-1} ([a,b)))$.
This gives you $\int \varphi \circ f (x) \ dx = \int \varphi (x) \ dx$ for $\varphi = 1_I$ for any interval $I$. Conclude.
Question 2: For $j \geq 0$, write carefully the set $A_j$ such that $f_j = 1_{A_j} -1/2$. Hint: $A_j = f^{-j} ([0, 1/2))$, and in your 2) you did not understand $f^j$ correctly (there are much more pieces!). You may try to draw $A_1$ and $A_2$.
The main difficulty is to see what happens and write down an explicit formula for $A_j$.
Question 3: For $i \neq j$, compute $\int f_i (x) f_j (x) \ dx$. Conclude.
We want to show that $\int f_i (x) f_j (x) \ dx = 0$ for $i<j$. By the preservation of measure, it is equal to $\int f_0 (x) f_{j-i} (x) \ dx = 0$. Prove that this is equivalent to $\int 1_{A_0} (x) 1_{A_{j-i}} (x) \ dx = 1/4$, that is, $Leb(A_0 \cap A_{i-j}) = 1/4$. Use the explicit formula for $A_{i-j}$ you found before.

Now, you have proved $(*)$. But you are not finished yet! Let $D$ be the set on which the equality of $(*)$ holds.
Question 4: Let $A_{N, M} := \{\sup_{n \geq N} \left| \frac{1}{N}\sum_{j=0}^{N-1} 1_{[0,1/2)} \circ f^j-1/2 \right| \leq 1/M \}$. Express $D$ with the $A_{N, M}$. Show that $\bigcup_N A_{N,M}$ has full measure for all $M$.
A point is in $D$ if for all $M$, there exists $N$ such that it is in $A_{N,M}$. You should find $D = \bigcap_M \bigcup_N A_{N,M}$. Hence, $D \subset 
\bigcup_N A_{N,M}$ for all $M$.
Question 5: Carefully construct/choose $(N(M))_{M \geq 1}$ such that $A_{N(M), M}$ has measure at least $1-\varepsilon$. Conclude.
Let $(\varepsilon_M)_{M \geq 1} \in (0,1)^{\mathbb{N}_+}$. Show that for all $N$, you can find $N(M)$ such that $Leb(\bigcup_{N\leq N(M)} A_{N,M}) \geq (1-\varepsilon_M)$. Let $E :=\bigcap_M \bigcup_{N\leq N(M)} A_{N,M}$. Prove that $Leb (E) \geq 1-\sum_M \varepsilon_M$. Choose $(\varepsilon_M)_{M \geq 1}$ wisely.
Finally, let $M(N) := \sup \{M \geq 1: \ N(M) \leq N\}$. Prove that $\lim_{N \to + \infty} M(N) = + \infty$, and that:
$$\sup \left| \frac{1}{N}\sum_{j=0}^{N-1} 1_{[0,1/2)} \circ f^j-\frac{1}{2} \right| \leq \frac{1}{M(N)} \ \ \text{on} \ E.$$
