TITLE: Proof of Fermat's little theorem using groups
QUESTION [6 upvotes]: 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

REPLY [7 votes]: There is an elementary proof, that works for abelian groups, and does not require Lagrange or any facts about group orders. 
Let $G$ be a finite abelian group of order $n$. Let $a \in G$. The map $x \mapsto a x$ is a permutation of $G$. Thus
$$
\prod_{x \in G} x
=
\prod_{x \in G} a x
=
a^n 
\cdot
\prod_{x \in G} x, 
$$
where we have used the fact that $G$ is abelian. 
It follows $a^n = 1$.