Hacker News new | ask | show | jobs
by lvh 2989 days ago
The usual notation for modular arithmetic uses three dashes, not two, to denote congruence.
3 comments

At least in my university, in one of the first Algebra courses about integers, factorization and congruence the usual notation is

  3 * 3 ≡ 1 (mod 4)
but in the next year Algebra course about groups and crazy algebraic structures the notation in the group Z_4 is just

  3 * 3 = 1
and everyone understand that you are working in Z_4 (and the * and = symbols are "overloaded" (but no one call them "overloaded")).
I don't think "=" is being overloaded in this example. The symbols "1", "3" and "*" are, since they're working in Z_4 rather than Z, but equality is just equality.
Sure; I think we’re in violent agreement here, it’s absolutely the case that people write the simpler version when the meaning is clear from context. I’ve definitely done that a bunch.
Piling on with a bit more pedantry, my experience is a bit different.

In my current ring theory course, we have indeed written things like 3 * 3 = 1 when working in |F_5 (not sure that notation is going to work as well as I hope, looks alright in the app I use), but it's not the equality symbol is overloaded, but the numbers themselves. Rather than using = to mean numeric equality and equality w.r.t. equivalence classes, we just use the numbers themselves as shorthand for their equivalence classes.

That seems odd to me. I don't think I've read any ring/algebra/module theory text that doesn't explicitly denote equivalence classes with, for example, square brackets.
There's a canonical ring homomorphism from the integers into any commutative ring with 1. When such a homomorphism is unique, you often omit it, hence mathematicians sometimes just write numbers without equivalence class brackets.

This is not limited to rings of the form Z/nZ.

In my experience, mathematicians tend to drop the third dash.

I should also add that, as generally presented in higher level math, modular arithmetic actually does use literal equality. The abuse is in the numbers.

That is to say, when we write "9" in modular arithmetic, we mean the set of all numbers congruent to 9. In this case in "9=1 mod 4" the equality is literal because the set of numbers congruent to 9 is literally the same set as the set of numbers congruent to 1.

I probably should have said "common" notation; it's certainly what I learned. I think you're right in that many authors prefer ≡ to emphasize that it is an equivalence rather than equality relation.

Source that both are in use: https://math.stackexchange.com/questions/196081/the-right-wa...

I don't understand the schism. For example, 11=1 gives the equivalence of two different programs. Whereas 33 mod 4 and 1 are equal in Z_4 ...

It bothered me a lot when I took logics lectures that equality wasn't treated as operator or even just anything within a theory (whereas turnstyle was described, at least).

Yeah, sorry, I didn’t mean to split hairs. They’re definitely both in use. I do plenty of work in Zp and I feel bad every time I don’t write \equiv or the \pmod for that matter :)