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: f \left({x}\right) = \begin{cases}

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

Let $x > 0$.

We have that:

Thus $f \left({x}\right) = + \sqrt {x^2}$

Definition 2 implies Definition 1
Let $f: \R \to \R$ be the function defined as:
 * $\forall x \in \R: f \left({x}\right) = + \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 {\left({-y}\right)^2} = y = -x$