The maximum of the absolute value of a real-valued function

100 Views Asked by At

For a continuous real-valued function $f$ on a compact set $X\neq \emptyset$, we have \begin{equation*} \max_{x\in X}|f(x)| = \max \{\max_{x\in X} f(x), \max_{x\in X} -f(x)\}. \end{equation*}

Could someone please check if the proof is correct? Is there a much shorter proof? (Side note: Someone suggested to prove this statement in the context of another question that I posted here: Maximum value and the absolute value)

Proof: Let $x' \in X$ be such that $\max_{x\in X}|f(x)| = |f(x')|$, i.e. $|f(x')| \geq |f(x)|$ for all $x\in X$. Since for all $x\in X$ we also have $|f(x)| \geq f(x)$ and $|f(x)| \geq -f(x)$, it follows that \begin{equation} |f(x')| \geq f(x) \quad \forall x\in X \quad \text{(1)} \end{equation} and \begin{equation} |f(x')| \geq -f(x) \quad \forall x\in X \quad \text{(2)}. \end{equation} We now consider two cases.

Case 1: $f(x') \geq 0$. Then $|f(x')| = f(x')$, and by equation 1 we get $f(x') \geq f(x)$ for all $x\in X$, i.e. $\max_{x\in X}|f(x)| = \max_{x\in X} f(x)$. We now have to show that we also have $\max_{x\in X} f(x) \geq \max_{x\in X}-f(x)$. Let $x'' \in X$ be such that $\max_{x\in X} -f(x) = -f(x'')$. Since $|f(x)| \geq -f(x)$ for all $x\in X$ and $f(x') \geq |f(x)|$ for all $x\in X$, it follows that $f(x') \geq -f(x'')$, i.e. $\max_{x\in X} f(x) \geq \max_{x\in X}-f(x)$.

Case 2: $f(x') < 0$. Then $|f(x')| = -f(x')$, and by equation 2 we get $-f(x') \geq -f(x)$ for all $x\in X$, i.e. $\max_{x\in X}|f(x)| = \max_{x\in X} -f(x)$. We now have to show that we also have $\max_{x\in X} -f(x) \geq \max_{x\in X} f(x)$. Let $x''' \in X$ be such that $\max_{x\in X} f(x) = f(x''')$. Since $|f(x)| \geq f(x)$ for all $x\in X$ and $-f(x') \geq |f(x)|$ for all $x\in X$, it follows that $-f(x') \geq f(x''')$, i.e. $\max_{x\in X} -f(x) \geq \max_{x\in X} f(x)$.