Why is absolute difference of max of functions less than max of absolute difference of functions

Title is wordy, but the question (I believe) is simple. Why does the following inequality hold? It is used as a step in the solution key for a homework assignment of mine, but doesn't explain why. Is there a name for this property?:

$|\max f(x) - \max g(x)| \le \max|f(x) - g(x)|$

Thanks!


Solution 1:

We have that

$$f(x)\le |f(x)-g(x)|+g(x).$$ Thus

$$\max f(x)\le \max (|f(x)-g(x)|+g(x))\le \max |f(x)-g(x)| +\max g(x).$$ So

$$\max f(x)-\max g(x)\le \max |f(x)-g(x)|.$$ Changing the roles of $f$ and $g$ we have that

$$\max g(x)-\max f(x)\le \max |f(x)-g(x)|.$$ Thus we are done.

Solution 2:

Alternatively (to the other answer), to remember which way this inequality goes, compare $\sin(x)$ and $-\sin(x)$ (on, say , $(-\infty, \infty)$, although many non-tricky choices are equivalent). The maximum of both functions is $1$, so the difference of the maxima is $0$. The maxima of one coincides with the minima of the other and vice versa, so $|\sin(\pi/2) - (-\sin(\pi/2))| = 2$ is the maximum of the absolute differences.

The inobviousness of this sort of result seems to be thinking that the maxima of both functions happen at the same places in the domain.