<s>[INST] Proof verification: If $a \equiv b (mod$ $n)$, then $a^3 \equiv b^3 (mod$ $n)$ Would someone be willing to verify the following proof?
Theorem: Suppose $a, b \in \mathbb{Z}; n \in \mathbb{N}$.  If $a \equiv b (mod$ $n)$, then $a^3 \equiv b^3 (mod$ $n)$. 
Proof:
$a \equiv b (mod$ $n) \rightarrow xn = a - b; x \in \mathbb{Z}$
$\rightarrow a = xn + b$
Then, $a^3 = (xn)^3 + 3b(xn)^2 + 3b^2(xn) + b^3$.
This gives us $a^3 - b^3 = (xn)^3 + 3b(xn)^2 + 3b^2(xn) = n(x^3n^2 + 3bx^2n + 3b^2x)$
$n | n(x^3n^2 + 3bx^2n + 3b^2x) \rightarrow n | (a^3 - b^3)$
Therefore $a^3 \equiv b^3 (mod$ $n)$.
 [/INST] The posted proof is correct. It might be even easier, however, to first prove the more general:
$$
a \equiv b \pmod{n} \quad\text{and}\quad a' \equiv b' \pmod{n} \quad \implies \quad a \cdot a' \equiv b \cdot b' \pmod{n}\quad
$$
The proof goes the same: $a\cdot a' = (xn+b)\cdot(x'n+b')=b\cdot b'+n\cdot (x\cdot b'+ x' \cdot b+n\cdot x\cdot x')\,$.
Then, using the proposition with $a'=a, b'=b$ gives $a \equiv b \implies a^2 \equiv b^2 \implies a^3 \equiv b^3 \pmod{n}$.
</s>