Never mind, I figured it out. They weren't saying that all of these are equivalent. In the second step they are just isolating the exponent for the purpose of simplifying it by way of Fermat's theorem. As the solution goes on, once they get the exponent simplified all the way, they go on to build back up sequentially to the original problem, which is then easily solvable. Thanks anyway.