I am wondering if the following two congruences are equivalent:
$(-2)^{56} \equiv 128^8 \equiv 3^8$ (mod $125$)
and
$(-2)^{56} \equiv (-128)^8 \equiv (-3)^8$ (mod $125$).
The following property of exponents was used to rewrite $56$ as $7\times 8: x^{yz} = (x^y)^z$ for the purposes of easier computation modulo $125$, and the author omitted the negative sign in the first example, even though $(-2)^7 = -128$ because of odd exponent.
Now my question is essentially are we allowed to use the first example when writing congruence intermediary steps (like utilizing exponent properties here) since we know that eventually $(-2)^{56}$ will be positive?
Yes, $(-2)^{56} \equiv ((-2)^7)^8 \equiv (-128)^8 \equiv (-1)^8128^8 \equiv 128^8$