$m$ and $n$ go from 0 to 1 and are known
if $[(m+n)/2] > 0.5$ then $s= 2-m-n$ if $[(m+n)/2] \leq 0.5$ then $s= m+n$
What process does one use to conclude that the above could be summarized as $s= 1- |m+n-1|$
What would be a valid equivalent for $m$ and $n$ that go from 0 to 10 ? A demonstration would be nice.
As @fleablood said in the comment, $$ \frac{m + n}{2} > 0.5 \\ \implies m + n > 1 \\ \implies m + n - 1 > 0 \\ \implies \lvert m + n - 1 \rvert = m + n - 1 $$ Similarly, $\frac{m + n}{2} \leq 0.5 \implies \lvert m + n - 1 \rvert = - m - n + 1$. In both cases, if you manipulate the definitions of $s$ a little, you will see that you can come to $s = 1 - \lvert m + n - 1 \rvert$. The intuition can be obtained by thinking of the 'size' of $m$ and $n$ compared to 1, and whether it would be necessary to add or subtract them to get $s$.
For $0 < m, n < a$, just use the intuition hint above. Can you follow through after $\frac{m + n}{2} > \frac{a}{2}$?