Addition modulo an integer (source code)

= Addition modulo an integer
{title2=$[a]_n+[b]_n=[a+b]_n$}

= Modular addition
{synonym}

For an integer $n\ge1$, add residue classes by adding their representatives and taking the class modulo $n$. This is well-defined because replacing either representative by a multiple-of-$n$ translate changes the sum by a multiple of $n$. The <associativity>, identity class $[0]_n$ and inverse $[-a]_n$ are inherited from integer <addition>. The result is the additive <cyclic group> $\mathbb Z/n\mathbb Z$.