I am tasked with showing that
If $a,b\in \mathbb{R}$, show that $\max{\{a,b\}}=\frac1{2}(a+b+|a-b|)$
I think I can say "without loss of generality, let $a<b$." Then $b-a>0$ But also, $$\max{\{a,b\}}=b=\frac1{2}a+\frac1{2}b-\frac1{2}a+\frac1{2}b$$ $$=\frac1{2}(a+b-a+b)$$ $$=\frac1{2}(a+b+(-a+b))$$ $$=\frac1{2}(a+b+|b-a|)$$ $$=\frac1{2}(a+b+|a-b|)$$
Is this valid? Does the proof (if valid) work the same way for the $\min$ function?