# Integers modulo n

Consider the true statement

\[\mathbb Z_n \approx \mathbb Z/n\mathbb Z\]that the two groups indicated are isomorphic. Intuitively, we think of the group of integers modulo $n$ (with addition) as the isomorphism class indicated above.

The right-hand side representation is an example of what’s called a

As sets, we define

\[\mathbb Z_n=\{0,1,\ldots,n-1\}\]and

\[\mathbb Z/n\mathbb Z=\{\class{0},\class{1},\ldots,\class{n-1}\}\]where $\class{a}$ is the congruence class mod $n$ to which $a$ belongs. Recall that a congruence class mod $n$ is an equivalence class of the equivalence relation $a\equiv b\pmod n$. That is,

\[\class{a} = \{ x \mid x\equiv a\pmod n \}\]As groups, their operation is addition, defined slightly differently for each, respectively, since the elements of the first group are integers, whereas those of the second group are congruence classes.

In both cases, we are talking about the “same” group up to isomorphism, the familiar integers mod $n$ with addition. Think arabic numerals with addition, versus roman numerals with addition. In both cases, we are talking about the “same” group up to isomorphism, the

For example, in $\mathbb Z_n,$ addition is defined by $a+b = r,$ where $r$ is the remainder when $a+b$ is divided by $n$. Note that $a,b,$ and $r$ are all integers in this group. In contrast, $\mathbb Z/n\mathbb Z$ defines addition as $\class{a}+\class{b}=\class{a+b}\pmod n$. Here, the elements of the group are not the integers $a$ or $b,$ but rather the congruence classes $\class{a}$ and $\class{b}.$

So, say we are operating on integers mod $7$ and we want to find $5+7.$ Then in $\mathbb Z_7$ we do

\[5+7=5\]since $r=5$ is the remainder of $12\div 7.$

Now, contrast the equivalent operation in $\mathbb Z/7\mathbb Z:$

\[\class{5}+\class{7}=\class{5+7}=\class{12}=\class{5}.\]Looking back at the solution in $\mathbb Z_7,$ notice the importance of the division algorithm, which guarantees the existence of such an $r=5$ in $\mathbb Z_7,$ for the “normal” sum $5+7=12$ in $\mathbb Z.$ The division algorithm states, in the case of $n=7$, that there are unique integers $q$ and $r,$ $0\le r < 7,$ such that $12 = 7q + r.$ In the example above, that was $r=5.$ The point here is that $a+b$ defined on $\mathbb Z_n$ earlier is “closed”, a quality required for any group: if $a$ and $b$ are in the group $(G,+)$, then so is $a+b.$

When considering the isomorphism between these groups, it is important to remember that $\mathbb Z_n$ is a finite set of *integers*, *not* congruence classes, namely the integers $0,1,\ldots,n-1.$ In other words, “regular” addition gives

That’s why we define addition in $\mathbb Z_n$ as $a+b=r$ since $r$ *will* always be in $\mathbb Z_n.$ In contrast, addition in $\mathbb Z/n\mathbb Z$ has no such dependency, since

The two groups $\mathbb Z_n$ and $\mathbb Z/n\mathbb Z$ give us different, but isomorphic, representations of the group of integers mod $n$ with addition.

Understanding the isomorphism above is but one milestone on the journey to understanding the fundamental homomorphism theorem. Another is understanding why the representation involving congruence classes uses the notation $\mathbb Z/n\mathbb Z.$ That’s where factor groups come in, as a generalization of the example. The fundamental homorphism theorem is what guarantees that $\mathbb Z_n\approx \mathbb Z/n\mathbb Z$ as a special case. The integers mod $n$ correspond to the quotient group $\mathbb Z/n\mathbb Z.$

The thing to remember with mod is that addition involves finding remainders, and we always divide by $n.$