# Applying Fermats Little Theorem to show $a^p \equiv_p b^p$ implies $a \equiv_p b$

Let $p$ be a prime number and $a$,$b$ be two positive integers.

Show that \begin{equation} a^p \equiv_p b^p \implies a \equiv_p b \end{equation}

I'm thinking the best way to show this relationship is using Fermat's Little Theorem two times? Maybe this can be done simply using the properties of Modular arithmetics?

FLT states that if $p$ is a prime number, then for any integer $a$, the number $a^p-a$ is an integer multiple of $p$. Expressed :

$a^p \equiv_p a$

I'm not sure how to apply FLT in this case, any help would be much appreciated!

Observe that, any prime $p|\binom{p}{r}$ for $r\in \{1,2,\cdots ,p-1\}$. Hence, we have $$(a-b)^p\equiv_p a^p-\binom{p}{1}a^{p-1}\cdot b+\cdots +\binom{p}{p-1}a\cdot b^{p-1}-b^p \equiv_p a^p-b^p$$ For $p=2$, you need some effort - $(a-b)^2\equiv_2 a^2+b^2\equiv_2 a^2-b^2$. Now as you have $a^p\equiv_p b^p$, you get $$(a-b)^p\equiv_p a^p-b^p\equiv_p 0$$ or, $a\equiv_p b$.
• Why do you need $p$ to be odd with your method? – Arnaud Mortier Jul 31 '18 at 21:36
• Ok, $(a-b)^2\equiv_2 a^2+b^2\equiv_2 a^2-b^2$. Thanks! – tarit goswami Jul 31 '18 at 21:38
Note that $$a\equiv_{p}a^p\equiv_{p} b^p\equiv_{p} b$$ where the outer equalities are consequences of Fermat's Little Theorem.
Your idea (applying FLT twice) is fine:$$a\equiv_pa^p\equiv_pb^p\equiv b.$$