I have a quick question regarding modular arithmetic.
If I have a Pythagorean Triple $(a, b, c)$, is it possible to consider this equation $\mod{c}$. That is to say,
Is the implication
$$a^2 + b^2 = c^2 \implies (a \mod{c})^2 + (b \mod{c})^2 \equiv 0\mod{c}$$
true?
I attempted to prove this (rather naïvely) by remembering that
\begin{align} a + cx &= a \mod{c}\\ b + cy &= b \mod{c}\\ cz &= 0 \mod{c} \end{align}
for some $x, y, z \in \Bbb{Z}.$ Squaring these expressions gives me
$$a^2 + b^2 + 2cx(a + b) + c^2(x^2 + y^2) = cz$$
and hence that $$a^2 + b^2 \equiv 0 \mod{c}.$$
Have I made some fundamental error or is this a valid method?
Edit: Changed $c^2z^2$ to $cz$.
It has to be true due to a mod b=a if a
Proof: Since a and b are smaller than c, $((a\mod c)^2+(b\mod c)^2)\mod c=(a^2+b^2)\mod c=c^2\mod c=0$
Q.E.D.
And yes, your method is valid too, it is just a longer version of the method above