Inverse in Modular Exponent Properties I have a question about modular exponentiation that I would be very grateful to get some help with.
Assuming we have the values $x, a, r$ and the inverse of $a$ as $-a$ all under $mod \:N$. I know that the following property holds:
$(({x^a} \:mod \: N)^r \: mod \: N)^{-a} \: mod \: N == x^{a \cdot r \cdot -a} \: mod \: N$
What I am trying to understand is if $(({x^a} \:mod \: N)^r \: mod \: N)^{-a} \: mod \: N == x^r \: mod \: N$
I thought this property would hold since $a\cdot-a \: mod \: N= 1$ but I may be missing something here since I get a different result when testing this. I think it may be because $a \cdot -a$ is only equal to $1$ when under the modular operation, which it never is in the exponent, but also I could be way off. Any help would be appreciated!
 A: You are confusing your self.
Short answer we do NOT have $a^{m} \equiv a^{m\pmod N} \pmod N$.  Mod equivalences don't work on exponents as  remainders are not preserved over exponents.  And simple example we try will fail.   Take for instance $2\pmod 5$.  then $2^2 \equiv 4\pmod 5$ and $2^3\equiv 8\equiv 3\pmod 5$ and $2^4\equiv 16\equiv 1 \pmod 5$ and $2^5\equiv 32 \equiv 2 \pmod 5$ and $2^6 \equiv 64 \equiv 4\pmod 5$.  We do NOT have $32=2^5\equiv 2^{5\mod 5}\equiv 2^0\equiv 1 \pmod 5$ nor do we have $64\equiv 2^6\equiv 2^{6\mod 5} \equiv 2^1 \equiv 2 \pmod 5$.
We just don't.
But we do have something close.
Fermat's Little thereom:  If $p$ is prime and $a$ is not a multiple of $p$ then $a^{p-1}\equiv 1 \pmod p$ and so;

$a^{k\pmod {p-1}} \equiv a \pmod p$ and so if we have $k \equiv -a \pmod {p-1}$ then we do have $a^a \cdot a^r \cdot a^k \equiv a^a\cdot a^r\cdot a^{-a}\equiv a^{a+r-a\pmod {p-1}}\equiv a^r \pmod p$.

For example.  Take $\mod 13$.   Not that $4 \equiv -8 \pmod{12}$.  So we ought to have $a^4 \cdot a^4\cdot a^8\equiv a^4 \pmod {13}$.  And we do.  For example if $a =3$ and $r = 5$ we have $a^4=3^4=81\equiv 3\pmod {13}$.  And $3^8=6561\equiv 9\pmod{13}$.  So $3^4\cdot 3^r \cdot e^8 \equiv 81\cdot 3^r \cdot 6561 \equiv 3\cdot 3^r \cdot 9\pmod 13 \equiv 27\cdot 3^r\equiv 1\cdot 3^r\pmod {13}$
We also have Eulers th: that if $\gcd(n,b) =1$ then $b^{\phi(n)} = 1$ and if  then we would have $b^{a\pmod{\phi(n)}}\cdot b^r \cdot b^{-a\pmod{\phi(n)}} \equiv b^r\pmod{\phi(n)}$.
