if $N=pq$ where $p$ and $q$ are different primes. Given $e$ and $d$ in $\{1,\ldots,\phi(N)-1\}$ for which holds that $ed=1\pmod {\phi(N)}$.Then we have $a^{ed}=a\pmod N$ for all non-invertible $a$ in $\Bbb Z_n$.
Why is this?
I tried to go this way: $ed=1 \pmod {\phi(N)}$, so $ed-1=k\cdot \phi(N)$ , for some $k$. Then $a^{ed}=a^{k\cdot \phi(N)+1}=a^{k \cdot \phi(N)}a=(a^{\phi(N)})^ka$
but I can only use $a^{\phi(N)}=1$ if is a unit, right?
Do I have to use that $\phi(N)=(p-1)(q-1)$?
thanks very much