What does mod and congruence mean in algebra.

I have sometimes seen notations like $a\equiv b\pmod c$. How do we define the notation? Have I understood correctly that $c$ must be an element of some ring or does the notation work in magmas in general?


In a commutative ring $\,R,\, $ $\, a\equiv b\pmod c\,$ means $\,c\mid a-b,\ $ i.e. $\,a-b = cr\,$ for some $\,r \in R,\,$ i.e. $\,a-b\in cR.\,$ Generally, $\,a\equiv b\pmod{ c_1,\ldots, c_n}\,$ means that $\,a-b\in (c_1,\ldots c_n)R := c_1 R+\cdots+ c_n R,\,$ the sum of the principal ideals $\,c_i R,\,$ i.e $\,a-b = c_1 r_1 + \cdots + c_n r_n\,$ for some $\,r_i\in R,\,$ and $\,a\equiv b\pmod{\! S}$ means $\,a-b\in SR$ where $\,SR\,$ is the ideal generated by $S$ ($=S$ if $S$ is already an ideal).

Congruence arithmetic provides an "element-ary" way of working in quotient (residue) rings. See here for the general correspondence between congruences, ideals, and $R$-subalgebras of the square $R^2$.

As for magmas, or any other algebraic structure defined by purely equational axioms, the notion of ring-congruence generalizes in a straightforward way to that of an equivalence relation that is compatible with all of the operations of the structure, e.g. $\, A\equiv a,\ B\equiv b\,\Rightarrow\, A\oplus B = a\oplus b\,$ for all binary operations $\,\oplus\,$ of the algebra, and similarly for all other $\,n$-ary operations of the structure. Just as for rings, there is a quotient algebra that reifies the (modular) congruence arithmetic within an algebraic structure of the same type, just like even/odd parity arthmetic of integers mod $\,2\,$ is ring-theoretically reified as arithmetic in the quotient/residue ring $\,\Bbb Z/2.$


We take $\mathbb{N}$ and say that $x R y$ if $\exists k\in \mathbb{N}$ such that $x-y = kc$, where $c$ is the "mod" number.

This is an equivalence relation, therefore you can define $\mathbb{N}/R$ and its elements are $x \pmod c$ numbers.

Example: $\mathbb{N}/(3)$ . You say $x=y$ if $x-y=3k$. So you have three elements in that quotient: $[0],[1],[2]$. In fact $3-0=3$, so $[3]=[0]$ and so on