# Maximum value and the absolute value

Let $f\colon X \rightarrow \mathbb{R}$ be a function such that $\max_{x\in X} f(x) + \min_{x\in X} f(x) = 0$. Does it then follow that $\max_{x\in X} f(x) = \max_{x\in X} |f(x)|$?

I'm quite sure it does but I don't know how to prove it. Here's what I tried: First of all, $\max_{x\in X} f(x)$ and $\min_{x\in X} f(x)$ cannot be both negative, and since $\max_{x\in X} f(x) \geq \min_{x\in X} f(x)$, we have $\max_{x\in X} f(x) \geq 0$.

Case 1: $\max_{x\in X} f(x) = 0$. Then $\min_{x\in X} f(x) = 0$, so $f(x) = 0$ for all $x$ and thus $\max_{x\in X} f(x) = \max_{x\in X} |f(x)|$.

Case 2: $\max_{x\in X} f(x) > 0$. Then $\min_{x\in X} f(x) < 0$, so $-\min_{x\in X} f(x) > 0$ and thus $\max_{x\in X} (-f(x)) > 0$.

How could I proceed? Thanks.

EDIT: Following Michael Burr's advice, I'll try to prove the three steps:

Step 3: $\max_{x\in X} f(x) + \min_{x\in X} f(x) = 0$ implies $\max_{x\in X} f(x) = -\min_{x\in X} f(x)$, and with step 2 we get $\max_{x\in X} f(x) = \max_{x\in X} -f(x)$.

Step 2: Let $x'\in X$ be such that $-f(x') = \max_{x\in X} -f(x)$. Then \begin{align*} & &-f(x') &\geq -f(x) &\quad \forall x\in X \\ &\Rightarrow &f(x') &\leq f(x) &\quad \forall x\in X \\ &\Rightarrow &\min_{x\in X} f(x) &= f(x') \\ &\Rightarrow &-\min_{x\in X} f(x) &= -f(x') = \max_{x\in X} -f(x) \\ \end{align*}

Okay so far? I have no clue how to prove step 1.

• Your case $2$ seems to be going on a tangent. The results don't seem closely related to the goal. – Michael Burr Apr 22 '16 at 10:21

• Step 1: Show that, in general, $\max\limits_{x\in X}|f(x)|=\max\left\{\max\limits_{x\in X}f(x),\max\limits_{x\in X}-f(x)\right\}$
• Step 2: Show that, in general, $\max\limits_{x\in X}-f(x)=-\min\limits_{x\in X}f(x)$.
• Step 3: Show that, in the present case, $\max\limits_{x\in X}f(x)=\max\limits_{x\in X}-f(x)$.
Now we start at the most complex side of the statement that we want to prove, which is the right hand side, and we try to simplify: for all $\;z\;$, $$\calc \maxx \abs{f(x)} \le z \op\equiv\hint{definition of \;\maxx\;} \langle \forall x :: \abs{f(x)} \le z \rangle \op\equiv\hint{definition of \;\abs\;} \langle \forall x :: f(x) \le z \land -f(x) \le z \rangle \op\equiv\hints{logic: \;\land\; distributes over \;\forall\;}\hints{-- this seems the only way forward, and lets us}\hint{introduce the desired \;\maxx f(x) \le z\;} \langle \forall x :: f(x) \le z \rangle \;\land\; \langle \forall x :: -f(x) \le z \rangle \op\equiv\hints{LHS: definition of \;\maxx\;;}\hint{RHS: negate both sides of \;\le\;, definition of \;\minx\;} \maxx f(x) \le z \;\land\; -z \le \minx f(x) \op\equiv\hints{RHS is equivalent to LHS by given}\hint{\;\maxx f(x) + \minx f(x) = 0\;} \maxx f(x) \le z \endcalc$$ Now, by $$x = y \;\equiv\; \langle \forall z :: x \le z \;\equiv\; y \le z \rangle$$ it follows imediately that $$\maxx \abs{f(x)} \;=\; \maxx f(x)$$ is indeed true.