If \(a^2 ≡ b^2 \bmod p\) (where \(p\) is prime), then:
$$ p|(a^2- b^2) $$$$ p|(a-b)(a+b) $$
Using this lemma, p|(a-b) or p|(a+b):
$$\begin{gather} p|(a±b) \\ a ≡ ±b \mod p \end{gather}$$
If \(a^2 ≡ b^2 \bmod p\) (where \(p\) is prime), then:
Using this lemma, p|(a-b) or p|(a+b):