I am just beginning learning about proofs, which is pretty cool, and I wanted to prove that $\forall x,y\in\mathbb{R}[\rvert x-y \lvert = \rvert y-x \lvert]$. I was wondering if my proof is correct:
Let $x,y\in\mathbb{R}$.
Case 1: $\enspace x-y> 0$. Then $\lvert x - y\rvert = x - y = -1\cdot(y - x)=\lvert -1\rvert\cdot\lvert y-x\lvert = \lvert y-x\lvert$
Case 2: $\enspace x - y < 0$. Then $\lvert x - y\rvert = -(x-y) = y - x =\lvert y-x\rvert$
$\square$
Your proof needs work. In your first case, you claim that $$-1\cdot(y-x) = |-1|\cdot|y-x|$$ which is not justified.
If you already know that $|ab| = |a||b|$, then your proof is needlesly complicated, since you can just say $|x-y| = |(-1)\cdot(-1)\cdot(x-y)| = |-1|\cdot |(-1)\cdot(x-y) = 1\cdot |-x - (-y)| = |y-x|$