# 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)$.
Just for fun, here is a proof using alternative definitions (which are actually the briefest definitions I've seen).\newcommand{\calc}{\begin{align} \quad &} \newcommand{\op}[1]{\\ #1 \quad & \quad \unicode{x201c}} \newcommand{\hints}[1]{\mbox{#1} \\ \quad & \quad \phantom{\unicode{x201c}} } \newcommand{\hint}[1]{\mbox{#1} \unicode{x201d} \\ \quad & } \newcommand{\endcalc}{\end{align}} \newcommand{\Ref}[1]{\text{(#1)}} \newcommand{\then}{\Rightarrow} \newcommand{\when}{\Leftarrow} \newcommand{\true}{\text{true}} \newcommand{\false}{\text{false}} \newcommand{\abs}[1]{\left| #1 \right|} \newcommand{\maxx}{\text{max}_{x}} \newcommand{\minx}{\text{min}_{x}} Specifically, I will use the following definitions of $\;\abs{\quad}\;$, $\;\maxx f(x)\;$, and $\;\minx f(x)\;$: for all $\;z\;$,\begin{align} \abs{x} \le z & \;\equiv\; x \le z \land -x \le z \\ \maxx f(x) \le z & \;\equiv\; \langle \forall x :: f(x) \le z \rangle \\ z \le \minx f(x) & \;\equiv\; \langle \forall x :: z \le f(x) \rangle \end{align} (To avoid boilerplate notation, I'm implicitly assuming $\;x \in X\;$ and $\;z \in \mathbb R\;$.)
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.