TITLE: $f\in L^{p}$ iff $\sum_{n=1}^{\infty} 2^{np}(\mu(\{\ x : |f(x)| > 2^{n} \}\ )) < \infty$
QUESTION [6 upvotes]: Let $p\in [1, \infty)$, prove that if $f \in L^{p}(\mu)$ iff
$$\sum_{n=1}^{\infty} 2^{np}(\mu(\{\ x : |f(x)| > 2^{n} \}\ )) < \infty $$
I tried the following ways but couldn't get any result: If $f\in L^{p}$ 
I considered the following sets: $$E_{n}= \{\ x : |f(x)|^{p} > 2^{np} \}\ =\{\ x : |f(x)| > 2^{n} \}\ $$
From that I derived that $$\sum_{n=1}^{\infty} 2^{np} \chi_{E_{n}}(x) \leq |f(x)|^{p} $$
(I hope that this inequality is correct). So then, if $f\in L^{p}$, then $\int \sum_{n=1}^{\infty}2^{np} \chi_{E_{n}} < \infty \implies \sum_{n=1}^{\infty} 2^{np}(\mu(\{\ x : |f(x)| > 2^{n} \}\ )) < \infty $. I am stuck on the converse though!
Thanks in advance for any kind of help!

REPLY [3 votes]: Assume $\mu(X) < \infty$ and $f\ge 0.$ I'll take $p=1$ just for simplicity. Then $\int_{0\le f\le 2} f\, d\mu  < \infty,$ and we don't need to worry about it. So it suffices to assume $f>2$ everywhere.
Interestingly, you got the harder direction (mostly) and not the easier direction! Harder direction: Suppose $f\in L^1.$ Let $x\in X.$ Then $2^m < f(x)\le 2^{m+1}$ for a unique $m\in \mathbb N.$ It follows that
$$\tag 1 \sum_{n=1}^{\infty} 2^n\chi_{\{f>2^n\})}(x) = \sum_{n=1}^{m} 2^n\chi_{\{f>2^n\})}(x) = \sum_{n=1}^{m} 2^n \le 2^{m+1} < 2f(x).$$
Integrating $(1)$ over $X$ then gives the finiteness of the sum on the left.
Easier direction: Assume $ \sum_{n=1}^{\infty} 2^n\mu(\{f>2^n\})<\infty.$ Then
\begin{align*}
\int_X f\, d\mu &= \sum_{n=1}^{\infty} \int_{\{2^n < f\le 2^{n+1}\}} f\, d\mu \\ \\
&\le \sum_{n=1}^{\infty} 2^{n+1}\mu(\{2^n < f\le 2^{n+1}\}) \\ \\
&\le 2\sum_{n=1}^{\infty} 2^{n}\mu(\{2^n < f\})< \infty.
\end{align*}