# Namioka's trick for amenability/folner

I'm trying to prove that a countable group $$G$$ being amenable, implies that it satisfies the Folner condition.

There are some steps I need to prove. Among them:

1: For every $$r \in [0,1]$$, we denote by $$E_r$$ the function that is equal to $$1$$ on $$(r, 1]$$ and equal to $$0$$ elsewhere. Prove that for every $$a, b \in [0,1]$$ we have $$| a - b | = \int_0^1 | E_r(a) - E_r(b)| dr \quad \text{and} \quad a = \int_0^1 E_r(a) dr.$$

2: Whenever $$\xi: G \rightarrow [0,1]$$ and $$r \in [0,1]$$, we denote by $$\xi^r := E_r \circ \xi$$. Note that $$\xi^r = \chi_{A_r}$$ where $$\chi$$ is the indicator function and $$A_r = \left\{ g \in G \mid \chi(g) \in (r, 1] \right\}$$. Prove that for all finitely supported functions $$\xi, \eta: G \rightarrow [0,1]$$, we have $$|| \xi - \eta ||_1 = \int_0^1 || \xi^r - \eta^r ||_1 dr \quad \text{and} \quad || \xi||_1 = \int_0^1 || \xi^r ||_1 dr.$$

Attempt: I'm not sure how to solve this. For $$a \in [0,1]$$,I wish to show that $$a = \int_0^1 E_r(a) dr$$. Since $$E_r$$ equals $$1$$ on $$(r,1]$$ and zero elsewhere, I think that $$\int_0^1 E_r(a) dr = \int_r^1 E_r(a) dr.$$ So now we know that $$a \in (r,1]$$. Now I wanted to make different case, but I don't get the desired result.

Also not sure how to solve 2).