18

Here's a homework question I'm struggling with:

Let $f,g$ two convex functions. Prove that $h(x)=\max\{f(x),g(x)\}$ is also convex

I don't know where to begin. The only thing I had in mind was was to try proving that if a function is convex on two sets $A$ and $B$, it is also convex on their union. That does not seem right though, for example, if I glue together $f(x)=x^2, g(x)=\frac{x^2}{1000}$ where $f$ is defined on $[0,1]$ and $g$ on $(1,2]$.

Anyway, that was the only thing I thought about. Any better ideas? thanks!

amWhy
  • 210,739
yotamoo
  • 2,861
  • 2
    @yotamoo: While typesetting, use \max instead of max (similarly use \sin instead of sin etc) –  May 20 '12 at 17:54
  • @Didier Can you add that as an answer adding, probably another line or two, so that this question gets an answer? –  May 20 '12 at 18:04

3 Answers3

33

The hint of @Did solves the problem, but there is another proof, which is more intuitive I think.

A function is convex if and only if the area above its graph is convex. But then, the region above $h(x) = \max\{f(x),g(x)\}$ is the intersection of the area above $f$ and the region above $g$. Moreover, intersection of convex sets is convex, and that concludes the proof.

Did
  • 284,245
dtldarek
  • 37,969
19

Hint: Use the characterization that $h$ is convex if and only if, for every $t$ in $[0,1]$ and every $(x,y)$, $h(tx+(1-t)y)\leqslant th(x)+(1-t)h(y)$.

Second hint: One wants to prove that $h(z)\leqslant th(x)+(1-t)h(y)$ where $z=tx+(1-t)y$. Since $h=\max\{f,g\}$, this is equivalent to the two inequalities $$ f(z)\leqslant th(x)+(1-t)h(y),\qquad g(z)\leqslant th(x)+(1-t)h(y). $$ Consider the first inequality. By convexity of $f$, one knows that $f(z)\leqslant tf(x)+(1-t)f(y)$. Furthermore, $f(x)\leqslant$ $____$ and $f(y)\leqslant$ $____$, hence...

Did
  • 284,245
4

A function $ f(x) $ defined for $ x \geq 0 $ is said to be convex if, for every $ 0 \leq x_1 \leq x_2 $ and every $ 0 \leq \lambda \leq 1 $, the inequality $$ f((1 - \lambda)x_1 + \lambda x_2) \leq (1 - \lambda)f(x_1) + \lambda f(x_2) $$ holds.

Now, suppose $ f(x) $ and $ g(x) $ are convex functions defined for $ x \geq 0 $. Define $$ h(x) = \max\{f(x), g(x)\}. $$

Question: Show that $ h(x) $ is also convex.

To show that $ h(x) = \max\{f(x), g(x)\} $ is convex, given that $ f(x) $ and $ g(x) $ are convex, we will proceed as follows:

Proof:

Let $ x_1, x_2 \geq 0 $ and $ 0 \leq \lambda \leq 1 $. We need to show that $$ h((1 - \lambda)x_1 + \lambda x_2) \leq (1 - \lambda)h(x_1) + \lambda h(x_2). $$

By definition of $ h(x) $, we have: $$ h((1 - \lambda)x_1 + \lambda x_2) = \max\{f((1 - \lambda)x_1 + \lambda x_2), g((1 - \lambda)x_1 + \lambda x_2)\}. $$

Since $ f(x) $ and $ g(x) $ are convex, we know that: $$ f((1 - \lambda)x_1 + \lambda x_2) \leq (1 - \lambda)f(x_1) + \lambda f(x_2), $$ $$ g((1 - \lambda)x_1 + \lambda x_2) \leq (1 - \lambda)g(x_1) + \lambda g(x_2). $$

Taking the maximum of both sides, we obtain: $$ h((1 - \lambda)x_1 + \lambda x_2) = \max\{f((1 - \lambda)x_1 + \lambda x_2), g((1 - \lambda)x_1 + \lambda x_2)\} \\ \leq \max\{(1 - \lambda)f(x_1) + \lambda f(x_2), (1 - \lambda)g(x_1) + \lambda g(x_2)\}. $$

Note that: $$ \max\{(1 - \lambda)f(x_1) + \lambda f(x_2), (1 - \lambda)g(x_1) + \lambda g(x_2)\} \\ \leq (1 - \lambda) \max\{f(x_1), g(x_1)\} + \lambda \max\{f(x_2), g(x_2)\}. $$

Thus, we have shown that: $$ h((1 - \lambda)x_1 + \lambda x_2) \leq (1 - \lambda)h(x_1) + \lambda h(x_2). $$

This completes the proof that $ h(x) $ is convex.