# RSA proof Wikipedia Clarification?

I have a question involving how this line of the RSA proof from Wikipedia is simplified. Proof

I know that $m^{p-1} \equiv 1(mod p)$ but how does $m^{p-1}$ simplify to 1 from the image?

Modular arithmetic is useful in large part because it respects arithmetic operations like multiplication. As implied here and here on the Wikipedia page for modular arithmetic, if $a\equiv b\pmod p$ then $ac\equiv bc\pmod p$.
In this case, we have $m^{p-1}\equiv1\pmod p$. Therefore, $\left(m^{p-1}\right)^2\equiv 1*m^{p-1}\equiv 1^2\pmod p$. Similarly, $\left(m^{p-1}\right)^3\equiv 1*\left(m^{p-1}\right)^2\equiv 1^3\pmod p$. Assuming $h$ is a nonnegative integer, we can repeat this sort of step until we arrive at $\left(m^{p-1}\right)^h\equiv 1^h\pmod p$. Then we can use the multiplicative property of modular arithmetic one more time to learn that $\left(m^{p-1}\right)^hm\equiv 1^hm\pmod p$.