5

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 ?

Adam Zalcman
  • 3,524
SOORAJ SOMAN
  • 8,038

5 Answers5

3

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.

  • Here the function is $f(x)=-x\log x$, which is concave, right ? – SOORAJ SOMAN Jan 09 '23 at 13:27
  • yes so $f(x) = x \log(x)$ is convex. –  Jan 09 '23 at 13:32
  • 1
    @Balajisb Did you use the condition $|y - x| \le 1/2$? Without the condition $|y - x| \le 1/2$, the inequality $|f(y) − f(x)| \leq f(|y − x|)$ is not true. For example, $x = \mathrm{e}^{-1}$ and $y = 1$. – River Li Jan 09 '23 at 13:39
  • @RiverLi where does the condition $|y-x|\leq1/2$ fits in ? – SOORAJ SOMAN Jan 09 '23 at 13:52
  • The fact that $f(y)-f(x) \leq f(y-x)$ is true for all $y>x>0$. –  Jan 09 '23 at 14:05
  • 2
    @Balajisb If $x, y \in [0, 1]$ and $|y - x| \le 1/2$, then $|f(y) − f(x)| \leq f(|y − x|)$. Without the condition $|y - x| \le 1/2$, it is not true. What's the purpose of your answer? paritial answer? – River Li Jan 09 '23 at 14:05
  • 1
    @RiverLi, Balajisb How do we incorporate the condition $|y-x|\leq 1/2$ in the proof ? – SOORAJ SOMAN Jan 09 '23 at 14:20
  • This particular problem is taken from a book of information theory, where when we define the entropy $x\log x$ is assumed to be zero. Is that the source of confusion here? – SOORAJ SOMAN Jan 09 '23 at 14:48
  • @Balajisb I found someone downvoted you. It is not me who downvoted you although I commented on your answer. For your edited: Is your proof complete? Did you use the condition $|y - x| \le 1/2$? Or it is implicit in your proof? – River Li Jan 10 '23 at 01:43
  • @SoorajS You may analyze $(x,y): x<y, f(y)>f(x)$ to see if it is related to $y - x \le 1/2$? – River Li Jan 10 '23 at 01:48
  • 1
    @RiverLi the condition $y-x<0.5$ appears in the case $f(x)>f(y)$ and $x<y$. I updated my answer. There is still a small range missing. I hope Sooraj can fill in the gap. Thanks. Cheers ! –  Jan 10 '23 at 04:11
  • @Balajisb Thanks your the update. The first part is nice. (+1) – River Li Jan 10 '23 at 04:54
  • @Balajisb I have updated my post including your suggestion on obtaining the condition $y-x\leq 1/2$, am I thinking it correct? Could you please have a look? – SOORAJ SOMAN Jan 10 '23 at 14:56
  • @SoorajS what you have written seems OK to me. Cheers ! –  Jan 10 '23 at 15:38
  • @Balajisb But think I'm not obtaining the condition $y-x$\leq 1/2 just by taking $y>x>0$ and $f(x)>f(y)$ as I tried in my attempt, it rather gives me $y-x<1$, which is not useful. Is there any way that I can improve my steps to reach the required condition? – SOORAJ SOMAN Jan 10 '23 at 17:05
  • @RiverLi , Balajisb Here log has base 2, therefore I think the last part of your answer should be, $$ \log(\frac{y^2-x^2}{4})\leq -2\implies \frac{y^2-x^2}{4}\le 2^{-2}=\frac{1}{4}\ \implies y^2-x^2=(y-x)(y+x)\le1\implies y-x\le\frac{1}{y+x}\ y+x\le 2;&;\frac{1}{y+x}\ge1/2 $$I don't think its obtaining the required condition $y-x\leq 1/2$ – SOORAJ SOMAN Jan 11 '23 at 00:54
  • @SoorajS I am assuming base $e$ in the derivation. This is correct since after proving the inequality $|f(x)-f(y)| \leq f(|x-y|)$, you can multiply by $\log_2(e)$ on both sides of this inequality and change the base to $2$. –  Jan 11 '23 at 01:41
  • @Balajisb Fine, but its still not providing the condition $y-x\leq1/2$, right ? – SOORAJ SOMAN Jan 11 '23 at 02:16
  • @SoorajS there is a small range in $x,y$ for which i did not prove. I have clearly stated the condition under the which the proof works. But it seems like other guys have proved it nicely. Take a look at their answers. They are nice. Cheers ! –  Jan 11 '23 at 03:04
2

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.

River Li
  • 49,125
  • 1
    Nice proof (+1). It would be nice to get the inequality without too much algebra. Like using Jenson, Subadditivity, log sum inequality etc. I couldnt get it based on what i tried. Let me know if you did get the inequality using simple properties like Jenson, Subadditivity, log sum inequality etc. –  Jan 10 '23 at 07:11
  • @Balajisb Thanks. A simple proof is expected always. – River Li Jan 10 '23 at 07:13
  • 2
    @Balajisb: It is Jensen's inequality :) – Martin R Jan 10 '23 at 07:49
  • Can you identify what is missing in Balajisb's answer? why is it not providing the condition $y-x\leq1/2$? – SOORAJ SOMAN Jan 11 '23 at 02:46
  • @SoorajS Did you see the two new answers. I think we can get it from them. – River Li Jan 11 '23 at 02:49
2

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))$.

  • 1
    It is very nice. (+1) Typos in the chord joining $(0, f(z))$ and $(1, f(1))$? It should be $(0, f(0))$ and $(z, f(z))$. By the way, this is well-known property of convex function. – River Li Jan 11 '23 at 00:24
  • @AdityaDhawan In the first inequality $f(y)-f(x) \geq -f(1-z)$, dont we need $x \leq 1-z \leq x+z \leq 1$ ? So in this case how is $1-z \leq x+z$ ? In the second inequality $f(y)-f(x) \leq f(z)$, we need $0 \leq x \leq z \leq x+z$, how is $x \leq z$ true ? Both of these doesnt seem to fall under $a \leq b \leq c \leq d$ with inequality $\frac{f(d)-f(b)}{d-b} \leq \frac{f(b)-f(a)}{b-a}$. Can you kind clarify ? –  Jan 11 '23 at 02:00
  • @Balaji sb Typo in the note fixed. We do not need $ x \leq z $. – Aditya Dhawan Jan 11 '23 at 02:10
  • @ River Li Thank you. Typo fixed. – Aditya Dhawan Jan 11 '23 at 02:10
  • @AdityaDhawan Dont u need $a \leq b \leq c \leq d$ ?'if this is the case, dont you need $1-z \leq x+z$ for first inequality and $x \leq z$ for second inequality ? –  Jan 11 '23 at 02:12
  • @AdityaDhawan Thanks –  Jan 11 '23 at 02:19
  • you mean we take two points $a,d$ in the domain and the points $c,d$ must lie between $a,d$ for the required statement involving slope of the chords to be true, right ? – SOORAJ SOMAN Jan 11 '23 at 22:49
  • 1
    What we need is that the left endpoint and the right endpoint of one chord be greater than the the left and right endpoint of the other respectively. So if $[a,c]$ and $[b,d]$ are the chords being considered, we need $ a \leq b$ and $c \leq d$. Apologies for the typo riddled answer, and I hope this clarifies my intentions. – Aditya Dhawan Jan 12 '23 at 01:45
  • @AdityaDhawan How do we prove $f(z)\geq f(1-z)$ ? I can see that from the graph though. – SOORAJ SOMAN Jan 12 '23 at 21:46
  • The standard approach would be to look at the derivative, as @AdamZalcman has done. – Aditya Dhawan Jan 13 '23 at 05:59
  • 1
    I offer a different proof. $x \to \log(x)$ is concave on $(0, \infty)$, and so as $ 0 \lt z \leq 1-z \leq 1$ for $0 \lt z \leq 1/2$, the slope of the chord joining $[z,1]$ exceeds the slope of the chord joining $[1-z,1]$, which gives precisely $f(z) \geq f(1-z)$. – Aditya Dhawan Jan 13 '23 at 06:03
  • @AdityaDhawan Nice! – SOORAJ SOMAN Jan 14 '23 at 22:35
2

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$

Adam Zalcman
  • 3,524
  • 1
    It is very nice. (+1) By the way, Balaji sb also used the subadditive property. – River Li Jan 11 '23 at 00:05
  • Nice +1. I had the same proof in mind except that i could not prove $f(1-x) \leq f(x)$ for $0<x<1/2$. Any simple proof you have in mind for this ? –  Jan 11 '23 at 04:08
  • 2
    @Balajisb Well, the simplest is probably to look at the plot, but if you prefer something more rigorous, here's one idea: Let $\Delta(x)=f(x)-f(1-x)$ and note that $\Delta'(x)=-2-\log(x(1-x))$. For $x\in[0,1]$ we find three zeros $\Delta(0)=\Delta(\frac12)=\Delta(1)=0$ and two extrema (since $\Delta'(x)=0$ leads to a quadratic equation with two roots). Also, for $x$ slightly less than one half we have $\Delta(x)>0$ since $\Delta(x)=\int_x^{1-x} (1+\ln t) dt$ and the integrand is positive because $1/e < 1/2$. Thus, $\Delta(x)$ is non-negative for $x\in[0,\frac12]$ and the conclusion follows. – Adam Zalcman Jan 11 '23 at 07:08
  • @AdamZalcman Thanks ! –  Jan 11 '23 at 07:24
  • @AdamZalcman I can see that the integrand is positive when $x$ is slightly less than $1/2$. But looking at the graph of $f(x)=-x\log x$ the integrand must be positive whenever $x\leq 1/2$, except may be close to zero. How can we prove that? – SOORAJ SOMAN Jan 12 '23 at 22:10
  • 1
    @SoorajS This follows from four facts: 1. $\Delta$ is differentiable and hence continuous on $[0,\frac12]$. 2. $\Delta$ crosses the $x$ axis at $x=0$ and $x=\frac12$. 2. Its derivative changes sign exactly once in $[0,\frac12]$ because $\Delta'(x)=0$ leads to quadratic equation with two roots one of which, say $x_1$, is in $[0,\frac12]$. 3. For $x$ near the right end of $[0,\frac12]$ we have $\Delta(x)>0$. All this implies that $\Delta$ increases after crossing the $x$ axis at $x=0$ until maximum at $x_1$ and then decreases until it hits the $x$ axis again at $x=\frac12$. See my last comment. – Adam Zalcman Jan 12 '23 at 22:48
-1

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 :-)

Barackouda
  • 3,879