# Prove that $\int_0^1|f(x)-x|dx\leq 1/4$ if $f$ is increasing on $[0,1]$, $0\leq f(x)\leq 1$ and $\int_0^1(f(x)-x)dx=0$.

Let $$f$$ be an increasing function on $$[0,1]$$ such that $$0\leq f(x)\leq 1$$ and $$\int_0^1(f(x)-x)dx=0$$. Show that \begin{align} \int_0^1|f(x)-x|dx\leq 1/4. \end{align}

Here is my try. I find that the equality is satisfied for $$f\equiv 1/2$$. Moreover, I want to use the Poincaré inequality but I cannot bound $$\int_0^1|f'(x)-1|dx$$ by $$1/4$$. Can you give me some references or hints?

• Is $f$ continuous ? Moreover, why should $f$ be derivable ?
– Surb
Commented Apr 26, 2022 at 12:11
• Is the upper bound $1/4$ correct? I just wonder because here is the same question (with answers), only with $1/2$ instead of $1/4$: math.stackexchange.com/q/3188689/42969. Commented Apr 26, 2022 at 12:14
• @ Surb, As $f$ is increasing, $f'$ exists a.e.. Though it maybe inacurate, it is only my attempt, I assume that the smoothness of $f$ and want to get some observation about it. Commented Apr 26, 2022 at 12:15
• @MartinR, I do not find counterexample and in the question you post, I do not find the condition for the equality. Commented Apr 26, 2022 at 12:21
• The upper bound $1/4$ is also claimed here, but without proof: math.stackexchange.com/q/3190661/42969. Commented Apr 26, 2022 at 12:35

Step 1. (Proof under extra assumptions) Assume that

• $$f : [0, 1] \to [0, 1]$$ is continuous and non-decreasing;
• $$\int_{0}^{1} (f(x) - x) \, \mathrm{d}x = 0$$;
• $$f(0) = 0$$, and $$f(1) = 1$$.

Then the set $$U_+ = \{ x \in [0, 1] : f(x) > x \}$$ is open, hence it is written as the union of at most countably many disjoint open intervals $$(a_i, b_i)$$, $$i = 1, 2, \ldots$$ Also, the continuity of $$f$$ forces that $$f(b_i) = b_i$$. So,

\begin{align*} I_+ &:= \int_{U_+} |f(x) - x| \, \mathrm{d}x = \sum_{i} \int_{(a_i, b_i)} (f(x) - x) \, \mathrm{d}x \\ &\leq \sum_{i} \int_{(a_i, b_i)} (b_i - x) \, \mathrm{d}x = \sum_{i} \frac{(b_i - a_i)^2}{2} \\ &\leq \frac{1}{2}\biggl( \sum_{i} (b_i - a_i) \biggr)^2 = \frac{1}{2} \operatorname{Leb}(U_+)^2. \end{align*}

A similar argument shows that, for $$U_- = \{ x \in [0, 1] : f(x) < x \}$$ we have

\begin{align*} I_- := \int_{U_-} |f(x) - x| \, \mathrm{d}x \leq \frac{1}{2} \operatorname{Leb}(U_-)^2. \end{align*}

Moreover, from $$\int_{0}^{1} (f(x) - x) \, \mathrm{d}x = 0$$ we get $$I_+ = I_-$$. Therefore, together with the observations$$\int_{0}^{1} |f(x) - x| \, \mathrm{d}x = 2I_+ = 2I_-$$ and $$\operatorname{Leb}(U_+) + \operatorname{Leb}(U_-) \leq 1$$, we conclude that

$$\int_{0}^{1} |f(x) - x| \, \mathrm{d}x \leq \min\{ \operatorname{Leb}(U_+), \operatorname{Leb}(U_-) \}^2 \leq \frac{1}{4}.$$

These inequalities have a nice interpretation in terms of areas:

Step 2. (General case by approximation) Now suppose $$f : [0, 1] \to [0, 1]$$ is non-decreasing and satisfies $$\int_{0}^{1} (f(x) - x) \, \mathrm{d}x = 0$$. Then it is not hard to find a sequence $$f_n(x)$$ satisfying the conditions in Step 1 and $$f_n(x) \to f(x)$$ for almost every $$x$$. So, by the dominated convergence theorem,

$$\int_{0}^{1} |f(x) - x| \, \mathrm{d}x = \lim_{n\to\infty} \int_{0}^{1} |f_n(x) - x| \, \mathrm{d}x \leq \frac{1}{4}.$$

• @MartinR, I revamped my answer. I am not fully satisfied with this as I was looking for a more elegant solution, but at least the current version faithfully reflects our geometric intuition about this problem. Commented Apr 26, 2022 at 20:44
• This is really nice, and the image makes it clear why the inequality holds! – I wonder if $\int_{U_+} ( f(x) - x) \, dx \le \frac 12 \lambda(U_+)^2$ can somehow be proven “directly,” without resorting to continuous functions and sums first. Commented Apr 27, 2022 at 1:36
• Is $f(0) = 0$, $f(1) = 1$ really needed in the first part of your proof? Commented Apr 27, 2022 at 1:43
• @MartinR, Not quite, but they make both $U_{\pm}$ open sets of $\mathbb{R}$. Commented Apr 27, 2022 at 1:56