Hacker News new | ask | show | jobs
by akalin 2305 days ago
There's a subtle point to keep in mind when generalizing to rings/fields. The concept of 'positive' and 'negative' are defined in terms of an order relation, e.g., 'positive' means >0 and 'negative' means <0. The integers / real numbers have the usual order relation such that the additive inverse of a positive number is negative and vice versa, but an arbitrary ring or field might not even have an order relation.

For example, the integers mod n is a ring, so (-a) * (-b) = a * b holds, but it doesn't make sense to call a number mod n positive or negative, since -a mod n effectively means n - a mod n.

(posted an earlier version of this comment on susam.in.)

1 comments

> The concept of 'positive' and 'negative' are defined in terms of an order relation, e.g., 'positive' means >0 and 'negative' means <0.

I thought the concept of "negative" was defined by reference to an operation. "Negative 5" is whatever value Q satisfies the equation 5 + Q = 0.

That definition immediately tells you that the negative of a negative is a positive. Once we know 5 + Q = 0, we ask what the negative of Q is. It's the value V such that Q + V = 0. But by the definition of Q (and the commutativity of addition), we already know V = 5.

Once you define negatives this way, it's trivial to show that negatives obey the standard ordering. But that ordering wasn't necessary in order to define them.

Summing up, the product of negatives is positive because negation is a kind of inversion (additive inversion), and two successive inversions always cancel in any context.

That's precisely the subtlety I'm talking about, in which additive inverses and real numbers less than 0 can both be referred to as 'negatives', and that the operation of taking additive inverses and real numbers less than 0 both use the symbol '-'.

It's pretty standard, though, that a 'negative number' is one that is less than 0, and a 'positive number' is one that is greater than 0, where a 'number' is an element of some subring of the reals.

I don't understand the point you're trying to make. You claimed that negative and positive are defined by absolute reference to zero. I claimed that they aren't. But you're presenting an example that assumes I'm right and you're wrong!

> For example, the integers mod n is a ring, so (-a) * (-b) = a * b holds, but it doesn't make sense to call a number mod n positive or negative, since -a mod n effectively means n - a mod n.

If negative numbers were defined by reference to a comparison to zero, then the expression (-a) * (-b) would be meaningless nonsense in Z mod 5 -- as you point out yourself, Z mod 5 is not ordered in that way. But it isn't nonsense, and you're not saying it is -- instead, you assume it's obviously valid when you observe that the equality (-a)(-b) = ab holds.

I guess I'm not being too clear, so I'll try again. There are two concepts:

1) Positive and negative numbers (defined in terms of comparison to 0)

2) The negation of a number (i.e., the additive inverse)

They're related in that when both concepts are defined, a negative number is the negation of a positive number. However, the two concepts don't coincide. I'm sure you know this, but even over the reals '-x' is the negation of a number, but not necessarily a negative number.

(-a) * (-b) = a * b is an equation about #2, and it holds in any ring/field, even ones where #1 doesn't make sense, e.g. Z mod 5. If #1 makes sense, then this immediately implies that the product of two negative numbers is positive.

My original point was that the blog post is talking about real numbers, for which #1 and #2 are both defined. However, if it's generalized to arbitrary rings/fields, where only #2 is defined, then you can't really refer to the equation '(-a) * (-b) = a * b' as 'the product of two negative numbers is positive'.

In a finite numeric field, then, negatives are the same as positives. (For example, in Z mod 5, you get 2 + 3 = 0 and, sure, 2 + (-2) = 0, too.)
Yes?

In Z mod 5 using your notation, you have that 3 = -2. It doesn't make sense to distinguish two classes of "negative" and "positive" numbers in that case, but it still makes sense to talk about -2.

That was precisely the original point - the distinction only makes sense in an ordered set; otherwise, calling -2 "negative" may be devoid of any meaning (e.g. when -2 = 3).