Fermat's little theorem $\forall a \in \mathbb{Z}$ and every prime p. Then, $a^{p}\equiv a\pmod p$
$a=pm+r $
$\forall 0 \leq r<p$
Proof for $r\not\equiv 0:$
Then, $\forall r \in \bar{U}\left ( p \right )$ and $\left | \bar{U}\left ( p \right ) \right |=p-1$
$r^{\left | \bar{U}\left ( p \right ) \right |}=e$ by a certain theorem in Cosets.
But this is really just $r^{p-1} \equiv 1\pmod p$
How does the last equivalence follows? My knowledge of number theory is almost non-existant. A verbose explanation would really help.
Thanks in advance.