# Proving that the tangent to a convex function is always below the function

Consider a real-valued convex function f defined on an open interval $(a,b) \subset \mathbb{R}$. $x,y \in (a,b)$. I want to prove that $$f((1-\lambda)x + \lambda y) \leq (1-\lambda)f(x) + \lambda f(y) , \lambda \in [0,1]\implies f(y) + f'(y)(x-y) \leq f(x)$$ No other assumptions(regarding the second derivatives) is allowed. While both facts are really obvious and clear, I am unable to prove this without making additional assumptions

Presumably you're allowed to assume that $f$ is differentiable.

The Idea: If you draw a picture you convince yourself that if, say, $y<z<x$ then $$\frac{f(y)-f(z)}{y-z}\le\frac{f(y)-f(x)}{y-x}.$$Now let $z\to y$, the left side of the inequality tends to $f'(y)$ and you're done.

Now to make that idea into an actual proof from what we're given we write $z=(1-\lambda)x+\lambda y$.

The Proof: Say $a<y<x<b$ (the proof for $a<x<y<b$ is the same). For $0<\lambda<1$ you have $$f((1-\lambda)x+\lambda y)\le(1-\lambda)f(x)+\lambda f(y).$$Subtract $f(y)$ from both sides and rearrange slightly: $$f((1-\lambda)x+\lambda y)-f(y)\le(1-\lambda)(f(x)-f(y)).$$

Note that $$[(1-\lambda)x+\lambda y]-y=(1-\lambda)(x-y)>0.$$

Since $(1-\lambda)(x-y)>0$ you can divide both sides of the second-last inequality by it and you get

$$\frac{f((1-\lambda)x+\lambda y)-f(y)}{[(1-\lambda)x+\lambda y]-y} \le\frac{f(x)-f(y)}{x-y}.$$Now if $\lambda\to 1$ then $(1-\lambda)x+\lambda y\to y$, so the left side approaches $f'(y)$, and you get $$f'(y)\le\frac{f(x)-f(y)}{x-y}.$$Since $x-y>0$ you can multiply both sides by $x-y$, and you get $$f'(y)(x-y)\le f(x)-f(y).$$

(If $a<x<y<b$ the proof would be the same, except that $(1-\lambda)(x-y)<0$, so above when you divided by $(1-\lambda)(x-y)$ the inequality would change from $\le$ to $\ge$. Then at the end when you multiplied by $x-y$ it would change back to $\le$.)

• @user254665 Glad you liked it. I decided it was perfectly awful, went back and tried to add a little "motivation". – David C. Ullrich Apr 27 '16 at 22:11
• Thats so elegant. I was circling around, but couldnt narrow down the exact steps ..... – sid Apr 27 '16 at 22:21
• @sid I'll tell you how I found the exact steps. Thought about the picture, trying to see "why" it was true. Realized it should be true because of the idea. Then I started with the algebra, trying to rearrange the definition of convexity to say $((f(y)-f(z))/(y-z)\le(f(y)-f(x))/(y-x)$. I had no idea how the algebra was going to work out! But I knew it would, having done this sort of thing before - when the picture of a convex function makes an inequality obvious it seems like it always happens that little magic things happen that let you derive it from the definition. Sure enough. – David C. Ullrich Apr 27 '16 at 22:34
• I applied this methodology to another proof and it worked well.. :-) Thanks! – sid Apr 28 '16 at 3:01