I was reading about the congruence modulo $n$ in The Integers from Topics in Algebra by I.N. Herstein; after showing the congruence modulo relation is equivalent, he introduced the set of all congruence classes viz. $J_n$ as:
[...] Let $J_n$ be the set of the congruence classes mod $n$; that is, $J_n = \{[0],[1],\ldots, [n-1]\}\:.$ Given two elements, $[i]$ and $[j]$ in $J_n,$ let us define \begin{align}[i]+[j] &= [i+j]\tag a\\ [i][j]&= [ij]\tag b\end{align} [...]
He then told they can be shown to be well-defined and jot down few properties which are left as exercise.
However, I didn't get how the author got motivated by "defining" whatever they are in that way above.
He didn't tell us why they are true or whether they are valid; the definition just came from nowhere.
Could anyone shed some light on how to show the relations are true? Or is it that they are defined so?
The objective is to endow $J_n$ with a ring structure. Indeed to have a ring you need two operations and you can check that the ring axioms are verified, the neutral for addition being $[0]$ and the neutral for multiplication being $[1]$.
The difficulty is to make sure the definition is well defined. This means that no matter the value of $i+j$ that is not necessarily $\lt n$ we get $[i+j]\in J_n$ and what we get is unique. It is obvious but requires to be noted.