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?