3

When computing modular expressions, I see that $x\pmod m \equiv r$ rather than $x\pmod m = r$. Why do we use logical equivalence instead of the equals sign here?

Also, in general can we write $\equiv$ instead of $=$ between 2 numbers when they have the same numerical values?

EDIT: I am now confused on whether $\equiv$ always refers to congruence or whether it can mean numerical equality in this context, due to the following quote by my course notes:

we can define $x \pmod m$ to be the remainder $r$ when we divide $x$ by $m$. I.e., if $x \pmod m \equiv r$, then $x = mq+r$ where $0 ≤ r ≤ m−1$ and $q$ is an integer

I am confused because they are defining mod operations here and the restriction on $r$ implies they are talking about $r$ being the numerical quantity equal to the mod operation, rather than a value to which it is congruent. So does $\equiv$ at all refer to numerical equivalence rather than just congruence in modular arithmetic?

Princess Mia
  • 2,403
  • 1
    Be cause $x \pmod{m}$ is an equivalence class, and $r$ is a real number (or integer, or whatever). But I wouldn't get overly prescriptive about this. – Xander Henderson Aug 18 '23 at 02:02
  • 2
    Maybe I just had a different education than you, but I remember seeing expressions like “$a \equiv b (\mod n)$”. Not expressions like “$a ( \mod n) \equiv b$” – Joe Aug 18 '23 at 02:02
  • 2
    Correct is either $,x\equiv r\pmod{m},$ or $,x\bmod m = r.\ $ See here for further discussion on mod the equivalence relation vs. remainder operation. – Bill Dubuque Aug 18 '23 at 02:10
  • @Xander $,x\pmod{!m},$ is undefined in most elementary number theory textbooks. – Bill Dubuque Aug 18 '23 at 02:19
  • @Joe as an aside on notation, a \equiv b \pmod n produces the parentheses with the correct spacing, as in $a\equiv b\pmod n$. – Jackozee Hakkiuz Aug 18 '23 at 03:16
  • @JackozeeHakkiuz Thanks for the tip! My bad. – Joe Aug 18 '23 at 04:15
  • 1
    No bads at all! It's something I recently learned and now I try to spread wherever I can :) – Jackozee Hakkiuz Aug 18 '23 at 05:12
  • re: your edit. The correct (standard) way to write the quoted text is as follows. $\tag*{}$ we define $,x \bmod m,$ to be the remainder $,r,$ left when we divide $,x,$ by $,m,,$ i.e. $$x \bmod m = r\iff x = qm+r\ \text{ for some integer }q,\text{ and },0 \le r \le m−1\qquad\ \ \ \ $$ This is well-defined by the uniqueness of the remainder. $\ \ $ – Bill Dubuque Aug 23 '23 at 21:09

2 Answers2

5

It's not logical equivalence, it's another use of the symbol $\equiv$ is a different context. That use is a convention.

The statement "$a=b$" means that $a$ and $b$ are different ways of talking about the same object. That's why you can say $1+1 = 2$.

If you think like a programmer you might write $$ 9 \pmod{5} = 4 \pmod{5} , $$ but you are more likely to see $$ 9 \equiv 4 \pmod{5} . $$ With an equal sign in the second expression you might be momentarily distracted into thinking $9 = 4$.

For a thorough discussion I recommend @BillDubuque 's answer at mod [= remainder] operation (and relation), name and meaning

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199
  • 3
    The notation $\ 9 \pmod{5} = 4 \pmod{5}\ $ is incorrect, confusing the congruence equivalence relation with the binary mod (remainder) operation. See here for further discussion. – Bill Dubuque Aug 18 '23 at 02:07
  • 1
    @BillDubuque I guess this should be $$9 ~~\rm {mod 5} = 4\rm {mod ~~5}=4$$ Is that notation correct now ? – lone student Aug 18 '23 at 02:10
  • 1
    @lone It's correct, but it's simpler to write $\ 9\bmod 5 = 4\ \ $ – Bill Dubuque Aug 18 '23 at 02:12
  • @BillDubuque Thanks , I understand, but what I mean , the notation $$9 \pmod{5} = 4 \pmod{5}$$ seems incorrect/confusing, because there exist brackets here ? – lone student Aug 18 '23 at 02:16
  • 2
    @lone Yes, the paren notation is usually reserved for the mod the congruence (equivalence) relation, not the mod remainder operation. See this answer for more on that. – Bill Dubuque Aug 18 '23 at 02:28
1

We do not normally write $x\pmod m\equiv r$ but rather $x\equiv r\pmod m$. Here the $\pmod m$ does not modify $r$ (or $x$) but rather modifies $\equiv$: it gives the context under which this relationship applies. It is short for

Working modulo $m$, we have $x\equiv r$.

Now to make such a statement you don't want $=$, but something weaker, since $x$ and $r$ are not equal, just congruent/equivalent. There is (as far as I know) no good reason why we don't use $\cong$ instead of $\equiv$, other than tradition.

  • The modulus $m$ must be specified; as you say, it gives the context for the relation. But in the context of arithmetic modulo $m$, the expressions are residue classes modulo $m$, and what is wrong with asserting equality of such residue classes? $\mathbb{Z}/m\mathbb{Z}$ has just as much right to an equality operator as $\mathbb{Z}$ does. – Rosie F Aug 18 '23 at 14:06
  • 2
    There's nothing wrong with asserting equality of residue classes. E.g. [x]_m = [r]_m makes perfect sense. But when we talk about individuals then equality isn't correct. x \equiv r (mod m) is a relation between individuals that happens to hold iff the equation on residue classes holds. – Tjaden Hess Aug 18 '23 at 14:43
  • Granted this distinction often gets lost in practice as we "pun" between r and [r]_m – Tjaden Hess Aug 18 '23 at 14:45
  • @RosieF In many elementary number theory textbooks congruence arithmetic is introduced without using quotient rings or residue equivalence classes, so readers of these books often do not have any knowledge of equivalence relations and classes and quotients objects mod an equivalence or congruence. Such topics are usually first encountered later in a class in abstract algebra. – Bill Dubuque Aug 19 '23 at 18:37