As a general rule, when trying to understand or prove something, symmetry is a big help. If something has obvious symmetries, or can be brought into a symmetric form, doing so is usually worth trying. One example of this is my old post on index determination for DXT5/BC3 alpha blocks. But a while ago I ran into something that makes for a really nice example: consider the expression
If these were regular parentheses, this would simply evaluate to , but we’re taking absolute values here, so it’s a bit more complicated than that. However, the expression does look pretty symmetric, so let’s see if we can do something with that. Name and conquer, so let’s define:
This expression looks fairly symmetric in a and b, so what happens if we switch the two?
So it’s indeed symmetric in the two arguments. Another candidate to check is sign flips – we’re taking absolute values here, so we might find something interesting there as well:
And because we already know that f is symmetric in its arguments, this gives us for free – bonus! Putting all these together, we now know that
which isn’t earth-shattering but not obvious either. You could prove this directly from the original expression, but I like doing it this way (defining a function f and poking at it) because it’s much easier to see what’s going on.
But we’re not quite done yet: One final thing you can do with absolute values is figure out what needs to happen for the expression to be non-negative and see if you can simplify it further. Now, both and are always non-negative, so in fact we have
Now suppose that . In that case, we know the sign of the expression on the right and can simplify further:
and similarly, when , we get . Putting the two together, we arrive at the conclusion
which I think is fairly cute. (This expression comes up in SATD computations and can be used to save some work in the final step.)