Modulo Addition is Closed

Integers
Let $m \in \Z$ be an integer.

Then addition modulo $m$ on the set of integers modulo $m$ is closed:


 * $\forall \left[\!\left[{x}\right]\!\right]_m, \left[\!\left[{y}\right]\!\right]_m \in \Z_m: \left[\!\left[{x}\right]\!\right]_m +_m \left[\!\left[{y}\right]\!\right]_m \in \Z_m$.

Real Numbers
Let $z \in \R$ be a real number.

Then addition modulo $z$ on the set of all residue classes modulo $z$ is closed:


 * $\forall \left[\!\left[{x}\right]\!\right]_z, \left[\!\left[{y}\right]\!\right]_z \in \R_z: \left[\!\left[{x}\right]\!\right]_z +_z \left[\!\left[{y}\right]\!\right]_z \in \R_z$.

Proof for Integers
From the definition of addition modulo $m$, we have:
 * $\left[\!\left[{x}\right]\!\right]_m +_m \left[\!\left[{y}\right]\!\right]_m = \left[\!\left[{x + y}\right]\!\right]_m$

By the Division Theorem:
 * $x + y = q m + r$ where $0 \le r < m$

Therefore $\left[\!\left[{x + y}\right]\!\right]_m = \left[\!\left[{r}\right]\!\right]_m, 0 \le r < m$.

Therefore $\left[\!\left[{x + y}\right]\!\right]_m \in \Z_m$, from the definition of integers modulo $m$.

Proof for Real Numbers
From the definition of addition modulo $z$, we have:
 * $\left[\!\left[{x}\right]\!\right]_z +_z \left[\!\left[{y}\right]\!\right]_z = \left[\!\left[{x + y}\right]\!\right]_z$

As $x, y \in R$, we have that $x + y \in \R$ as Real Addition is Closed.

Hence by definition, $\left[\!\left[{x + y}\right]\!\right]_z \in \R_z$.

Note
On the face of it, there seems no need to prove this for both integers and reals.

From the above we see that the sum of two integers congruent to a given integer modulus is congruent to an integer to the same modulus.

However, it is important to note that the sum of two integers congruent to a given real modulus may not be congruent to an integer.

Take, as an example, $a = 2, b = 3, m = \pi$.

Then $\left({a + b}\right) \left({\bmod\, \pi}\right) = 5 - \pi \notin \Z$.