The Ring of Z/nZ

# The Ring of Z/nZ

Recall from the Rings page that if $+$ and $*$ are binary operations on the set $R$, then $R$ is called a ring under $+$ and $*$ denoted $(R, +, *)$ when the following are satisfied:

• 1. For all $a, b \in R$ we have that $(a + b \in R)$ (Closure under $+$).
• 2. For all $a, b, c \in R$, $a + (b + c) = (a + b) + c$ (Associativity of elements in $R$ under $+$).
• 3. There exists an $0 \in R$ such that for all $a \in R$ we have that $a + 0 = a$ and $0 + a = a$ (The existence of an identity element $0$ of $R$ under $+$).
• 4. For all $a \in R$ there exists a $-a \in R$ such that $a + (-a) = 0$ and $(-a) + a = 0$ (The existence of inverses for each element in $R$ under $+$).
• 5. For all $a, b \in R$ we have that $a + b = b + a$ (Commutativity of elements in $R$ under $+$).
• 6. For all $a, b \in R$ we have that $a * b = b * a$ (Closure under $*$).
• 7. For all $a, b, c \in R$, $a * (b * c) = (a * b) * c$ (Associativity of elements in $R$ under $*$).
• 8. There exists a $1 \in R$ such that for all $a \in R$ we have that $a * 1 = a$ and $1 * a = a$ (The existence of an identity element $1$ of $R$ under $*$).
• 9. For all $a, b, c \in R$ we have that $a * (b + c) = (a * b) + (b * c)$ and $(a + b) * c = (a * c) + (b * c)$ (Distributivity of $*$ over $+$).

We will now look at the ring of $\mathbb{Z} / n\mathbb{Z}$ for $n \in \{ 2, 3, ... \}$. On The Ring of Z/2Z page, we defined $\mathbb{Z} / 2\mathbb{Z}$ to be the following set of sets:

(1)
\begin{align} \quad \mathbb{Z} / 2 \mathbb{Z} = \{ [0]_2, [1]_2 \} \end{align}

The set $[0]_2$ denotes the set of integers $z \in \mathbb{Z}$ such that $z \equiv 0 \pmod 2$ and the set $[1]_2$ denotes the set of integers $z \in \mathbb{Z}$ such that $z \equiv 1 \pmod 2$. In set-builder notation we have that:

(2)
\begin{align} \quad [0]_2 = \{ z \in \mathbb{Z} : z \equiv 0 \pmod 2 \} \quad \mathrm{and} \quad [1]_2 = \{ z \in \mathbb{Z} : z \equiv 1 \pmod 2 \} \end{align}

We saw that $(\mathbb{Z} / 2 \mathbb{Z}, +, *)$ formed a ring with respect to the addition $+$ and multiplication $*$ which we defined on it. We will now look more generally at the collection of sets $\mathbb{Z} / n\mathbb{Z}$ for $n \in \{ 2, 3, ... \}$. Define this set to be the set of sets where:

(3)
\begin{align} \quad \mathbb{Z} / n\mathbb{Z} = \{ [0]_n, [1]_n, ..., [n-1]_n \} \end{align}

For each $k \in \{1, 2, ..., n-1 \}$ we define the set $[k]_n$ as the set of integers $z \in \mathbb{Z}$ such that $z$ has the remainder $k$ upon division by $n$, that is:

(4)
\begin{align} \quad [k]_n = \{ z \in \mathbb{Z} : z \equiv k \pmod n \} \end{align}

Note that if $k \in \mathbb{Z}$ and $k > n - 1$ then $[k]_n = [i]_n$ for some $i = \{ 0, 1, 2, ..., n-1 \}$. This is due to the fact that the remainder when $z \in \mathbb{Z}$ is divided by $n$ must be either $0$, $1$, …, or $n - 1$ as we saw on The Division Algorithm page. Therefore if $k > n - 1$ then $k$ can be written in the form $k = nq + r$ where $0 \leq r < n$ and so $[k]_n = [r]_n$ for $r \in \{0, 1, 2, ..., n-1 \}$. We will now define the operations $+$ and $*$ to make $\mathbb{Z} / n \mathbb{Z}$ a ring.

We define the operation of addition, $+$, for all $[k]_n, [j]_n \in \mathbb{Z} / n\mathbb{Z}$ by:

(5)
\begin{align} \quad [k]_n + [j]_n = [k + j]_n = \{ z \in \mathbb{Z} : z \equiv (k + j) \pmod n \} \end{align}

Similarly we define the operation of multiplication, $*$, for all $[k]_n, [j]_n \in \mathbb{Z} / n \mathbb{Z}$ by:

(6)
\begin{align} \quad [k]_n * [j]_n = [kj]_n = \{ z \in \mathbb{Z} : z \equiv kj \pmod n \} \end{align}

We will now show that $\mathbb{Z} / n \mathbb{Z}$ is a ring under the operations $+$ and $*$.

Clearly $\mathbb{Z} / n \mathbb{Z}$ is closed under $+$ because the sum $k + j \equiv r \pmod n$ and so $k + j]_n = [r]_n$ for some $r \in \{0, 1, 2, ..., n-1\}$.

Furthermore, $+$ is associative since $(i + (j + k)) \equiv ((i + j) + k) \pmod n$ and so:

(7)
\begin{align} \quad [i]_n + ([j]_n + [k]_n) = [i]_n + [j + k]_n = [i + (j + k)]_n = [(i + j) + k]_n = [i + j]_n + [k]_n = ([i]_n + [j]_n) + [k]_n \end{align}

The identity element of $+$ is $[0]_n$ since:

(8)
\begin{align} \quad [k]_n + [0]_n = [k + 0]_n = [k]_n \end{align}
(9)
\begin{align} \quad [0]_n + [k]_n = [0 + k]_n = [k]_n \end{align}

The inverse element for each $[k]_n$ is $[n-k]_n$ since $n-k \equiv r \pmod n$ for some $r \in \{ 0, 1, 2, ..., n-1 \}$. Noting that $n \equiv 0 \pmod n$ we have that:

(10)
\begin{align} \quad [k]_n + [n-k]_n = [k + (n - k)]_n = [n]_n = [0]_n \end{align}

The operation $+$ is commutative since $(k + j) \equiv (j + k) \pmod n$, so:

(11)
\begin{align} \quad [k]_n + [j]_n = [k + j]_n = [j + k]_n = [j]_n + [k]_n \end{align}

The set $\mathbb{Z} / n\mathbb{Z}$ is closed under $*$ since the product $kj \equiv r \pmod n$ for some $r \in \{0, 1, 2, ..., n- 1\}$.

The operation $*$ is also associative since $i * (j * k) \equiv (i * j) *k \pmod n$ so:

(12)
\begin{align} \quad [i]_n * ([j]_n * [k]_n) = [i]_n * [jk]_n = [i(jk)]_n = [(ij)k]_n = [ij]_n + [k]_n = ([i]_n + [j]_n) + [k]_n \end{align}

The identity for $*$ is $[1]_n$.

Lastly, the distributivity property holds since $(i \cdot (j + k)) \equiv (i \cdot j + i \cdot k) \pmod n$ and $((i + j) \cdot k) \equiv (i \cdot k + j \cdot k) \pmod n$ and so for left distributivity we have:

(13)
\begin{align} \quad [i]_n * ([j]_n + [k]_n) = [i]_n * [j + k]_n = [i \cdot j + i \cdot k]_n = [i \cdot j]_n + [i \cdot k]_n \end{align}

And for right distributivity we have:

(14)
\begin{align} \quad ([i]_n + [j]_n) * [k]_n = [i + j]_n * [k]_n = [i \cdot k + j \cdot k]_n = [i \cdot k]_n + [j \cdot k]_n \end{align}

Therefore we have verified all of the ring axioms and so $(\mathbb{Z} / n \mathbb{Z}, +, *)$ is a ring.