# Properties of modular arithmetic without equivalence classes

With modular arithmetic, it seems possible to define the addition operation without imposing equivalence classes. That is, with the set of remainders when dividing by $$n$$ as $$\{0, ..., n - 1\}$$, we can define the addition between members of this set to be the usual integer sum in $$\mathbb{Z}$$, reduced modulo $$n$$. My university notes say that, with this definition, addition is well-defined but that its properties are difficult to glean. As a result, equivalence classes are imposed and addition occurs between these classes. My questions are: (1) why is it difficult to glean the properties of the original addition (please provide examples to make it clearer) and (2) how does the introduction of equivalence classes solve this problem? Below is an excerpt from the notes I am referring to:

Another group with a different flavor is $$(\mathbb{Z}/(n\mathbb{Z}), +)$$, the integers modulo $$n ≥ 2$$ integer: as a set, this can be identified with $$\{0, 1, . . . , n − 1\}$$ (the remainders when dividing by $$n$$ in integers), and addition gives the usual sum in $$\mathbb{Z}$$, reduced modulo $$n$$, so e.g. in $$(\mathbb{Z}/(5\mathbb{Z}), +)$$, $$2 + 4 = 1$$. It is less confusing though to write $$\{[0], . . . , [n − 1]\}$$ for the set, and $$[2] + [4] = [1]$$ then; below we see why this is a good notation.

With this definition, addition is well defined on $$(\mathbb{Z}/(n\mathbb{Z}), +)$$, but it can be quite awkward to check its properties. It is usually better to proceed as follows: we partition (divide into disjoint sets) $$\mathbb{Z}$$ into equivalence classes, and say that $$a$$ and $$b$$ are in the same class, or $$a ∼ b$$, if $$a − b$$ is divisible by $$n$$, i.e. if $$a$$ and $$b$$ differ by a multiple of $$n$$. Then there are $$n$$ equivalence classes, namely exactly the remainders when dividing by $$n$$. We write the equivalence class of $$a ∈ \mathbb{Z}$$ as $$[a]$$...

• Please see my comment under the answer you accepted. Although the right approach is to use equivalence classes, it is not at all as awkward to do without them, contrary to the claim in that answer. Commented Aug 19, 2023 at 5:03

## 2 Answers

Consider, for example, the associative property. Without using equivalence classes (at least implicitly*), to check that $$(a+b)+c = a + (b + c)$$ one has to consider the results of four different additions. If the definition of addition in modular arithmetic is given by the remainder of the actual sum on division by $$n$$, then it can either be the sum itself, or the sum minus $$n$$. Thus there are two cases to check for each addition. Since there are four additions, that amounts to $$2^4=16$$ different cases to check. Some of these will be quite similar to each other, but it is still rather a cumbersome process to wade through all $$16$$ possibilities.

On the other hand, if we are talking about equivalence classes, after showing that $$[a]+[b]:=[a+b]$$ is well-defined, we get associativity almost for free, since \begin{align*} ([a]+[b])+[c] &= [a+b]+[c] = [(a+b)+c] = [a + (b+c)] \\ &= [a] +[b+c] = [a]+ ([b]+[c])\text{,} \end{align*} with every equation following from the definition of modular addition except the middle one, which follows from associativity of regular addition.

*Update: In the comments, user21820 correctly points out that the equivalence classes do not need to be explicitly defined in order to establish associativity as in the argument above - one could indeed simply define $$[a]$$ to be $$a$$ reduced mod $$n$$, and then prove that $$[a+b]=[[a]+[b]]$$.

Here equivalence classes are still at play implicitly, as any map $$f\colon X\rightarrow Y$$ induces an equivalence relation on its domain with equivalence classes of the form $$f^{-1}(\{y\})$$ under that map, and in this case, the map $$a\mapsto a \mod n$$ induces the very equivalence relation on $$\mathbb Z$$ that we use to define modular arithmetic.

• Said in ring language, hom's preserve identities so taking the image of the associative law in $\Bbb Z$ yields the associative law in $\Bbb Z_n$, as explained here Commented Aug 18, 2023 at 17:41
• One does not have to consider "16 different possibilities". Let ⊕ denote the new addition. If we do not use the equivalence classes, and just use "[a]" for "a mod n", then all we need is [a]⊕[b] = [[a]+[b]] = [a+b] for every a,b∈ℤ, so we also get ([a]⊕[b])⊕[c] = [a+b]⊕[c] = [(a+b)+c] = ... for every a,b,c∈ℤ, same as you. But there are no equivalence classes here! The point is that you shouldn't use a strawman (16 cases). Commented Aug 19, 2023 at 5:01
• I see your point, technically you do not have to be explicit in defining the equivalence relation. On the other hand, in this case you are defining a function $a\mapsto [a]$ given by reduction mod n. The inverse images of numbers under that function are the very equivalence classes you wish to avoid.
– M W
Commented Aug 19, 2023 at 5:15
• @MW: I did not say I wish to avoid equivalence classes. Just because they arise via some taking the preimage of the function I am using, does not imply that there is no possible benefit to avoiding them in some cases. For instance, in some weaker systems we do not wish to have unnecessarily 'complicated' objects simply because we cannot manipulate them. In normal mathematics, sure, equivalence classes are the right approach. But your reason for preferring them is still a strawman. Commented Aug 19, 2023 at 5:40
• I perhaps mis-spoke with "wish to avoid". Would you agree that with your approach, its fair to say that an equivalence relation is still at play behind the scenes though? I tried editing the answer to address your observation.
– M W
Commented Aug 19, 2023 at 5:54

Saying the properties are "difficult to glean" is not a formal statement. Rather, I believe they refer to statements such as $$2+4=1$$, which is of course true in modulo $$5$$, but it's pretty uncomfortable to look at. To be more precise in what the difficulty is: From the above we see that the idea of positive and negative numbers are completely erased. As another example, multiplication also works modulo $$5$$, and you can check that $$4\cdot 4 =1$$, so $$4$$ is in some sense also $$\frac14$$? This is why adding brackets is nice, as you no longer think of it as integers, but rather families of integers, $$[2]+[4]=[1]$$ (some people also use $$\equiv$$ instead of $$=$$, and/or write (mod $$5$$) at the end).

Thinking of equivalence classes also allows you to preserve some sense of usual integer addition. Indeed, they are refering to the wonderful fact that $$[a]+[b]= [a+b]$$, i.e. the sum of the class of $$a$$ and the class of $$b$$ is the class of $$a+b$$, the latter sum being true integer addition.

This means that you can use $$2+4=6$$, so $$[2]+[4]=[2+4]=[6]$$, and you simply have to realise that $$6-5=1$$, so $$[6]=[1]$$.