Prove $|f(y) − f(x)| \leq f(|y − x|)$ if $|y − x| ≤ 1/2$ given $f(x)=-x\log_2 x$

411 Views Asked by At

How do I prove that whenever $|y − x| ≤ 1/2$ it follows that $|f(y) − f(x)| \leq f(|y − x|)$ given $f(x)=-x\log_2 x$?

where $x,y\in[0,1]$

The graph of $f(x)=-x\log_2 x$ function is

-xlogx

$$ f'(x)=-\log x-\frac{x}{x\ln 2}=-\log x-\frac{1}{\ln 2}=0\implies \log x=-\frac{1}{\ln 2}\\ \frac{\ln x}{\ln 2}=-\frac{1}{\ln 2}\implies \ln x=-1\implies x=1/e\approx 0.3679 $$

I was only able to write the following proof:

When $0\le x\le y\le 1$,

\begin{align} |f(x)-f(y)|&=|-x\log x+y\log y|\\ &=|-x\log x+\frac{x}{\ln 2}+y\log {y}-\frac{y}{\ln 2}+\frac{y}{\ln 2}-\frac{x}{\ln 2}|\\ &\leq |-(x\log x-\frac{x}{\ln 2})+(y\log y-\frac{y}{\ln 2})|+\frac{|y-x|}{\ln 2}\\ &=|\int_x^y \log tdt|+\frac{|y-x|}{\ln 2}=-\int_x^y \log tdt+\frac{|y-x|}{\ln 2}\\ &=-\int_x^{x+(y-x)} \log tdt+\frac{|y-x|}{\ln 2}\\ &\leq -\int_0^{y-x} \log tdt+\frac{|y-x|}{\ln 2}\\ &=-\Big(t\log t-t\Big)_0^{y-x}+\frac{|y-x|}{\ln 2}\\ &=-(y-x)\log(y-x)+(y-x)+\frac{|y-x|}{\ln 2}\\ &=f(|y-x|)+|y-x|+\frac{|y-x|}{\ln 2} \end{align}

My Attempt

Thanks @Balajisb for the hint.

If $f$ is a concave function then $f(a+b)\leq f(a)+f(b)$ for all $a,b>0$ $$ -y\log y=-(y-x+x)\log(y-x+x)\le-(y-x)\log(y-x)-x\log x\\ -y\log y-(-x\log x)\le -(y-x)\log(y-x)\\ f(y)-f(x)\le f(y-x) $$ $$ D_{\log x}\in(0,\infty]\implies x,y,y-x\geq 0\implies 1\ge y>x>0\\ $$ $$ 1>y-x>0\implies -(y-x)\log(y-x)>0 $$ $$ f(y)-f(x)\le f(|y-x|) \;\forall\;(x,y)\;|\;y>x>0\\f(x)-f(y)\le f(|y-x|) \;\forall\;(x,y)\;|\;x>y>0 $$ Therefore, $$ |f(y)-f(x)|\le f(|y-x|) \;\forall\;(x,y)\;|\;y>x>0\;\&\;f(y)>f(x)\\|f(y)-f(x)|\le f(|y-x|) \;\forall\;(x,y)\;|\;y<x<0\;\&\;f(y)<f(x) $$

In order to prove $|f(y)-f(x)|\le f(|y-x|) \;\forall\;x,y>0$ we need to also consider the cases $y>x>0\;\&\;f(y)<f(x)$ and $x>y>0\;\&\;f(x)<f(y)$. So I think that's where the condition $y-x\leq 1/2$ lies in.

Case 1 : $y>x>0\;\&\;f(y)<f(x)$ $$ -y\log y<-x\log x\implies y\log y>x\log x\\ x\log x-y\log y<0\\x\log x-\frac{x}{\ln 2}-y\log y+\frac{y}{\ln 2}-\frac{y-x}{\ln 2}<0\\ \int_y^x \log t dt-\frac{y-x}{\ln 2}>0\\ y-x<\ln 2\int_y^x \log t dt=-\ln 2\int_x^y \log t dt=-\ln 2\int_x^y \frac{\ln t}{\ln 2}dt=-\int_x^y \ln t dt\\ <-\int_0^1 \log t dt=-1\times -1=1 $$

How do I obtain the condition $y-x\leq 1/2$ in this case ?

5

There are 5 best solutions below

12
On BEST ANSWER

Assume without loss of generality that $ y > x$, and write $z = y - x$, so that $0 \leq x \leq 1-z \lt 1 \ \text{and} \ z \leq 1/2$ .

Then the concavity of $f$ tells us that the slope of the chord joining $(x,f(x))$ and $(x+z,f(x+z))$ exceeds the slope of the chord joining $(1-z,f(1-z)) $ and $(1,f(1))$, which gives us $f(y) - f(x) \geq -f(1-z)$.

Likewise the slope of the chord joining $(x,f(x))$ and $(x+z,f(x+z))$ is smaller than the slope of the chord joining $(0,f(0)) $ and $(z,f(z))$, which gives $f(y) - f(x) \leq f(z)$.

Hence, $|f(y) - f(x)| \leq \max\{f(z),f(1-z) \} = f(z)$, as $z \leq 1/2$.

Note : If $f$ is convex, and $ a \leq b ;c \leq d $, where $ a \leq c $ and $ b \leq d $, then the slope of the chord joining $(b,f(b)), (d,f(d))$ exceeds that of the chord joining $(a,f(a)), (c,f(c))$.

19
On

Let wlog $x<y$:

$y \log(y) = (y-x+x) \log(y-x+x) $

By subadditivity: If $f$ is a concave function and $f(0) \geq 0$ then $f(a+b) \leq f(a) + f(b)$ for all $a,b >0$

Hence since $x \log(x)$ is convex:

we have $y \log(y) = (y-x+x) \log(y-x+x) \geq (y-x) \log(y-x)+x\log(x)$.

Hence $y \log(y) - x \log(x) \geq (y-x) \log(y-x)$. Hence we have proved that $|f(y)-f(x)| \leq f(|y-x|)$, for all $(x,y): x<y, f(y)>f(x)$, since we have proved that $f(y)-f(x) \leq f(y-x)$, for all $y > x > 0$.

$f(x)>f(y)$ and $0<x<y$:

By convexity of $f'(u)$, we have by Jenson inequality, $$f(x)-f(y) = \int_x^y -f'(u) du \leq -(y-x)f'\left(\frac{y+x}{2}\right)$$ By convexity of $f'(u)$, we have by Jenson inequality, $$f(y-x) = \int_0^{y-x} f'(u) du \geq (y-x)f'\left(\frac{y-x}{2}\right)$$

We are done if we prove: $$-f'\left(\frac{y+x}{2}\right) \leq f'\left(\frac{y-x}{2}\right) \iff$$

$$1+\log\left(\frac{y+x}{2}\right) \leq -1-\log\left(\frac{y-x}{2}\right) \iff $$

$$4e^{-2} \geq y^2-x^2 \iff $$

$$4e^{-2} \geq (x+(y-x))^2-x^2 \iff $$

$$\frac{2e^{-2}}{(y-x)}-\frac{(y-x)}{2} \geq x $$

So the proof works either when $f(y)>f(x)$ or when $$\frac{2e^{-2}}{(y-x)}-\frac{(y-x)}{2} \geq x $$.

I think there is a small range missing which is yet to be proved. I hope you can fill that gap. Try and if you cant prove, ping us here in the comments below.

0
On

We have a simple proof for $a,x\in(0,1)$ such that $|a-x|\leq 1/2$

We have for $a>0.5$:

$$g\left(x\right)=-\left|a-x\right|\ln\left(\left|a-x\right|\right),f\left(x\right)=\left|a\ln a-x\ln x\right|,g''(a/2)-f''(a/2)=0,g(a)=f(a)$$

It's not hard to see that :

$$x\in[a/2,1),g''(x)-f''(x)<0;x\in(0,a/2),g''(x)-f''(x)>0$$

For $a,x\in(0,0.5]$ we have :

$$x\in(0,|a-x|),g''(x)-f''(x)<0;x\in(|a-x|,a),g''(x)-f(x)<0;g'''(a/2)-f'''(a/2)=0;g'''\left(\left(\frac{1}{a}-1\right)a^{2}\right)-f'''\left(a^{2}\right)=0$$

And so on.

I think you can finish by yourself :-)

5
On

Here is a proof.

WLOG, assume that $x \le y$.

We need to prove that $$|-y\ln y + x\ln x| \le -(y - x)\ln(y - x). \tag{1}$$

Using the identity for $u \ge 0$ (easy to prove) $$u\ln u =\int_0^1 \frac{u(u - 1)}{1+(u-1)t}\,\mathrm{d} t,$$ (1) is written as $$\left|\int_0^1 \left(\frac{y(1-y)}{1+(y-1)t} - \frac{x(1-x)}{1+(x-1)t}\right)\,\mathrm{d} t\right| \le \int_0^1 \frac{(y-x)(1 - (y-x))}{1 + (y-x - 1)t}\,\mathrm{d} t.$$

It suffices to prove that $$\int_0^1 \left|\frac{y(1-y)}{1+(y-1)t} - \frac{x(1-x)}{1+(x-1)t}\right|\,\mathrm{d} t \le \int_0^1 \frac{(y-x)(1 - (y-x))}{1 + (y-x - 1)t}\,\mathrm{d} t.$$

It suffices to prove that, for all $t \in [0, 1]$ and $0 \le x \le y \le 1$ with $y - x \le 1/2$, $$\left|\frac{y(1-y)}{1+(y-1)t} - \frac{x(1-x)}{1+(x-1)t}\right| \le \frac{(y-x)(1 - (y-x))}{1 + (y-x - 1)t}$$ or $$\left(\frac{y(1-y)}{1+(y-1)t} - \frac{x(1-x)}{1+(x-1)t}\right)^2 \le \left(\frac{(y-x)(1 - (y-x))}{1 + (y-x - 1)t}\right)^2$$ or (clearing the denominators and simplifying) $$xy[1 - 2(y - x)]t^2 + (2x^2 - xy - 2y^2 + 2y)t(1 - t) + 2(1-y)(1-t)^2 \ge 0 \tag{2}$$ which is true (the proof is given at the end).

We are done.


Proof of (2):

It suffices to prove that $2x^2 - xy - 2y^2 + 2y \ge 0$.

If $0 \le x \le 1/3$, then $$2x^2 - xy - 2y^2 + 2y \ge 2x^2 - xy - 2y\cdot (x + 1/2) + 2y = 2x^2 + y(1 - 3x) \ge 0.$$

If $1/3 < x < 1/2$, then $$2x^2 - xy - 2y^2 + 2y \ge 2x^2 - xy - 2y\cdot (x + 1/2) + 2y = 2x^2 - y(3x - 1) $$ $$\ge 2x^2 - (x + 1/2)(3x - 1) = \frac12(1 + x)(1 - 2x) \ge 0.$$

If $1/2 \le x \le 1$, then $2x^2 - xy - 2y^2 + 2y = x(2x - y) + 2y(1 - y) \ge 0$.

We are done.

6
On

TL;DR: I prove $f(y)-f(x)\le f(|y-x|)$ and $f(x)-f(y)\le f(|y-x|)$. The former follows from subadditivity of $f$ which in turn follows from $f(0)=0$ and concavity. The latter follows by analogous arguments applied to $g(x)=f(1-x)$ combined with $g(z)\le f(z)$ which holds when $z\le\frac12$. This explains the significance of the condition $|y-x|\le\frac12$: it unites two upper bounds, one on $f(y)-f(x)$ and one on $f(x)-f(y)$, into an upper bound on the absolute value $|f(y)-f(x)|$.


Define $f,g:[0,1]\to\mathbb{R}$ as $$ f(x)=\begin{cases} -x\log x & x>0 \\ 0 & x = 0 \end{cases}\tag1 $$ and $g(x)=f(1-x)$. This proof is built from the following simple facts which I leave as exercises. The first two concern properties of $f$ of which one can convince themselves also by glancing at the plot in the question. The latter two are generally useful facts about real functions.

Exercise 1 Both $f(x)$ and $g(x)$ are concave on their domain $[0,1]$.

Exercise 2 If $0\le z \le \frac12$, then $g(z)\le f(z)$.

Exercise 3 If $h:[0,1]\to\mathbb{R}$ is concave and $h(0)=0$ then $h$ is subadditive $$ h(x+y)\le h(x)+h(y)\tag2 $$ whenever function arguments are all in the domain of $h$.

Exercise 4 If $h:[0,1]\to\mathbb{R}$ is subadditive, then $$ h(y)-h(x)\le h(y-x)\tag3 $$ whenever function arguments are all in the domain of $h$.

Proof Assume without loss of generality that $x\le y$. There are two cases: either $f(x)\le f(y)$ or $f(x)>f(y)$. If $f(x)\le f(y)$ then exercises $1$, $3$ and $4$ immediately give us $$ f(y)-f(x)\le f(y-x)=f(|y-x|).\tag4 $$ Suppose then that $f(x)>f(y)$ and set $a:=1-x$ and $b:=1-y$. We have $b\le a$ and $g(b)<g(a)$, so exercises $1$, $3$ and $4$ give us $$ g(a)-g(b)\le g(a-b).\tag5 $$ However, $g(a)-g(b)=f(x)-f(y)$. Moreover, $a-b=|y-x|\le\frac12$ so by exercise $2$ we have $g(a-b)\le f(|y-x|)$. Thus, $$ f(x)-f(y)=g(a)-g(b)\le g(a-b)\le f(|y-x|)\tag6 $$ which combined with $(4)$ completes the proof.$\square$