I am trying to prove Fermat's little theorem using groups. Here is my proof:
Let $p$ be a prime. Since all numbers a such that $1\leq a\leq p-1$ are relatively prime with $p$, they form a group under multiplication modulo $p$.(There is a theorem about this, that must be true, they should be forming a group). So, let the group be $G=\{a,a^2,\dots,a^{p-1}\}$ and binary operation is multiplication modulo $p$. Since all elements of this group are relatively prime with $p$, then any element $a \in G$ is a generator of this group, and this group is cyclic. So, we must have $a \cdot a^{p-1}=a \bmod p$. Then multiplying each sides with $a{-1}$ (which exists since this is a group) we get $a^{p-1}=1 \bmod p$.
Is there any mistake in my proof? I appreciate your helps. Thank you