# Proof of the general case for Fermat's little theorem

I have proved Fermat's little theorem (F.L.T) that is "If $$p$$ be a prime, then $$x^p=x\bmod p$$ " by induction on x for $$x \in \mathbb Z$$ and $$x \ge 0$$. I want to prove the general case that is for $$x \lt 0$$.

Here is my attempt

Proof: Let $$y =-x$$. Since y is positive, thus by F.L.T we have $$y^p= y \bmod p$$. So $$(-x)^p=-x \bmod p$$. If $$p \gt 2$$, then $$x^p=x \bmod p$$ and we are done. If $$p = 2$$, then $$x^2 =-x \bmod p$$.

Here I stuck how can I proceed further to reach at $$x^p = x \bmod p$$ for $$p=2$$? Thank you.

• If $p=2$ then $x\equiv 0 \text{ or } 1\bmod 2$ so checking both cases $x\equiv -x \bmod 2$ and similarly $x^2\equiv x \bmod 2$ Jun 6, 2023 at 15:48

I'm just a 13 year old who loves maths so my answer might be wrong, but, following your work and to answer your request, notice that Fermat's little theorem indicates that $$p\not|a$$. Since $$p=2$$, $$a\equiv 1 \mod [2]$$
Now, the rest is quite obvious, notice that, $$-1\mod[2]$$ and $$1\mod[2]$$ are the same, since 2-1 is 1, and 2+1=3, $$3\equiv 1\mod[2]$$ , thus, we have proved what you sought for