Equivalence of Definitions of Absolute Value Function

Definition 1 implies Definition 2
Let $f: \R \to \R$ be the function defined as:
 * $\forall x \in \R: \map f x = \begin{cases}

x & : x > 0 \\ 0 & : x = 0 \\ -x & : x < 0 \end{cases}$

Let $x > 0$.

We have that:

Thus $\map f x = +\sqrt {x^2}$

Definition 2 implies Definition 1
Let $f: \R \to \R$ be the function defined as:
 * $\forall x \in \R: \map f x = +\sqrt {x^2}$

Let $x > 0$.

Then by definition of square and square root:
 * $+\sqrt {x^2} = x$

Let $x = 0$.

Then $+\sqrt {0^2} = 0$.

Let $x < 0$.

Thus let $x = -y$.

Then:
 * $+\sqrt {\paren {-y}^2} = y = -x$