Negatives
“Negatives” (like negative numbers) are a great idea in many situations, but they can be tricky to learn and are a common source of mistakes. Here are some less-conventional ways to make them easier to work with, and hopefully easier to understand.
Caveat: I’m talking about normal, everyday maths here; nothing exotic, like finite fields or whatever!
NOTE: I will be using “over-bar” notation for negation (like )
You Ain’t Gonna Need It!
As always, we should avoid unnecessary complications where possible. Situations which are easily modelled without negative numbers shouldn’t have them shoe-horned in “for the sake of it”, or “by default” (the same way we shouldn’t default to fractions, complex numbers, surreal numbers, etc. when they’re not needed).
For example: Alice has apples, Bob has apples; Alice gives apples to Bob, how many apples does Bob then have? Bob is gaining apples, so negatives aren’t needed. Of course, when a situation does make sense with negatives we should use them: e.g. extending the example to ask how many apples Alice ends up with, which we can model by adding to her . We could instead use subtraction, but that also requires negatives (in case of “underflow”), so I prefer to stick with addition.
Whilst this may seem obvious, note that many programming languages
get it wrong, e.g. encoding length
as a (signed)
integer, rather than an (unsigned) natural number;
forcing callers to account for the negative cases.
Defining Negatives with Plus and Zero
We can define the “meaning” of negatives using the following property:
In other words, the negative of something is whatever we can add to that thing to get a result of .
Note that this definition does not involve subtraction, since I consider subtraction to be more trouble than it’s worth.
The Negative of
We know that adding to anything will leave that thing unchanged ( is called the “identity” value for addition), i.e.
This tells us that, as a special case, (in the case that ). Since that sum equals , it fits our above definition of a negative. Hence the negative of is itself :
“Double Negatives” (Negatives of Negatives)
If we take the negative of something that’s already a negative, we get back the original thing:
Proof
We can add to a “double negative” without changing it (as per equation (2)):
We can replace with the sum of a value and its negative (as per equation (1)). Let’s replace the with the sum of and its negative :
Let’s rearrange this sum, and introduce parentheses to make the next step clearer:
The expression in the parentheses is the sum of a value () and its negative (), which is (according to equation (1)):
Finally, we can get rid of the addition of zero since it doesn’t change the value (as per equation (2)):
QED
Hence such “double negatives” will “cancel out”.
Expanding, Contracting and Shifting Negatives
When negatives are multiplied, we can “expand” the bar to cover the whole multiplication:
Proof
Adding to our multiplication won’t change its value (equation (2)):
We can replace that with the sum of a value () and its negative () as per equation (1):
The first two terms have a common factor of , which we can factor out:
Those parentheses contain the sum of a value () and its negation (), which is equal to (equation (1)):
Multiplying by always gives :
Finally we can remove the addition (as per equation (2)):
QED
We can use the same approach for the second value (except we’ll get a common factor of in the proof), to show that:
These equations also tell us we can “contract” a bar from an entire multiplication down to just one of its factors.
In combination, these let us “shift” bars from one factor to another:
Multiplying Negatives
Consider the multiplication of two negatives: we can “expand” one of the bars to cover the whole product (as per equation (5)):
From equation (6), we can replace with :
This is a double negative, which cancels out (via equation (4)):
In this way, multiplications can always be simplified to contain either one negative, or no negatives at all.
The Role of
We can always multiply values by without changing them, i.e. (we say is the “identity” value for multiplication). This combines nicely with the expansion, contraction and shifting of negatives:
This lets us think about a value’s “direction” ( or ) separately to its “size”; for example, whether a number is pointing “up” or “down” the number line.
Normal (Canonical) Forms
Having multiple ways to write the same thing can be convenient during a calculation, but we’d rather have a single way to write our “final result”; so it can be easily compared to other results (by just comparing the symbols).
Such notation is called a “normal form” (or “canonical form”), and may be familiar from dealing with fractions, where e.g. and appear to be different numbers. We can write these in normal form by removing common factors, to get and ; which are obviously identical.
In the case of products, we can introduce and eliminate factors of , and we can expand, contract and shift around negatives between factors. Hence there are many ways to write down the same value, and it would be nice to have a normal form for any “final results”. The most natural approach is the following:
- Eliminate any factors of . This makes the expression as small as possible.
- Expand all negatives to cover the whole expression, since this avoids having to choose between factors arbitrarily.
- Eliminate any “double negatives”, to get only zero or one negative. This is easy once all the negatives have been expanded.
For example, the following expression:
Would have the following normal form:
Note that the isn’t itself a product, so its negative can’t expand or shift around. We could also “multiply out” and factorise, but that’s more about “sums and products” rather than negatives, so I’ll leave it up to taste, e.g.