A book I'm reading uses the following fact:
$$\alpha^{m_1} \equiv \alpha^{m_2} \pmod{p} \Longleftrightarrow m_1 \equiv m_2 \pmod{p - 1}$$
Here, $\alpha$ is a primitive root mod $p$. I don't understand why this is true.
I get that $\alpha$ being a primitive root means that its powers are uniformly distributed among the $p - 1$ integers $p$ is coprime to. But, why does that imply $m_{1} \equiv m_{2}$ in a different modulus? Can someone please clarify?