For two real numbers \(x\) and \(y\), prove that \(\max(x,y) = \frac{1}{2}(x+y+|x - y|)\).


For the definitions of an upper bound and the least upper bound of a set. See This.

Proof:

Suppose \(x\) and \(y\) are two real numbers. Consider the following cases

  • Case \(x = y\):
  • $$ \begin{align*} \max(x, x) &= \frac{1}{2}(x + x + |x - x|) \\ &= x \end{align*} $$
    which is true.
  • Case \(x \neq y\): Without the loss of generality suppose that \(x > y\), then
$$ \begin{align*} \max{x, y} = &\frac{1}{2}(x + y + |x - y|) \\ \max{x, y} = &\frac{1}{2}(x + y + x - y) \\ \max{x, y} = &\frac{1}{2}(2x)) \\ &= x \end{align*} $$

Which is also true since we assumed that (x > y). \(\blacksquare\)

References: