To prove that an operation is well-defined in modular arithmetic I started to study the relation of congruence modulo n and a big important question came to me. In the book Poofs and Fundamentals, by Ethan D. Bloch, we have the definition:

Definition: Let $n \in \mathbb{N}$. Define operations $+$ and $\cdot$ on $\mathbb{Z}_{n}$ by letting $[a] + [b] = [a + b]$ and $[a] \cdot [b] = [ab]$ for all $[a], [b] \in \mathbb{Z}_{n}$.

Next, Bloch consider the following problem: Let $n \in \mathbb{N}$, and let $[a], [b], [c], [d] \in \mathbb{Z}_{n}$. Suppose that $[a] = [c]$ and $[b] = [d]$. Do $[a + b] = [c + d]$ and $[ab] = [cd]$ necessarily hold?
Bloch also states that if this doesn’t hold, then both operations are not well-defined. Reading this made me think of the following questions:

*

*Why proving that if $[a] = [c]$ and $[b] = [d]$ then $[a+b] = [c+d]$ shows that $+$ is well-defined in $\mathbb{Z}_{n}$?


*If I show that $\mathbb{Z}_{n}$ is closed under $+$, am I automatically showing that $+$ is well-defined in $\mathbb{Z}_{n}$? (If yes, what’s the relation between these two?)
Thank you so much for your attention!
 A: Question 1. We say that a definition is well-defined when, even though there is an apparent ambiguity in the definition, in fact there is not.
In your case, the definition $[a]+[b]=[a+b]$ is ambiguous because equivalence classes of different elements can coincide. For example, in $\mathbb{Z}_5$, $[3]=[8]$. So it is not immediately clear that if you take different representatives for $a$ or $b$ will give the same result for $[a+b]$. That is, one needs to prove that if $[a_1]=[a_2]$ and $[b_1]=[b_2]$ then $[a_1+b_1]=[a_2+b_2]$.
For example, suppose we define for $\mathbb{Z}_5$, $[a]^{[b]}:=[a^b]$. It looks fine but it is not really because $[3]=[8]$, $[2]=[7]$, but $[3^2]=[4]\ne[8^7]=[2]$, so the mapping is not well-defined.
Question 2. An operation is a well-defined function mapping $X^2\to X$. Showing closure and well-defined are not the same. An operation that is not well-defined is not normally called an operation, so in this strict sense, it does not make sense for an operation to be closed but not well-defined.
But even if one is generous with what makes an operation, showing closure does not automatically imply it is well-defined. For example, one can argue that the example above $[a]^{[b]}:=[a^b]$ is 'closed' in the sense that it gives an equivalence class as output, but it is still not well-defined.
