Metamath Proof Explorer


Theorem lgsqrmod

Description: If the Legendre symbol of an integer for an odd prime is 1 , then the number is a quadratic residue mod P . (Contributed by AV, 20-Aug-2021)

Ref Expression
Assertion lgsqrmod A P 2 A / L P = 1 x x 2 mod P = A mod P

Proof

Step Hyp Ref Expression
1 lgsqr A P 2 A / L P = 1 ¬ P A x P x 2 A
2 eldifi P 2 P
3 prmnn P P
4 2 3 syl P 2 P
5 4 ad2antlr A P 2 x P
6 zsqcl x x 2
7 6 adantl A P 2 x x 2
8 simpll A P 2 x A
9 moddvds P x 2 A x 2 mod P = A mod P P x 2 A
10 5 7 8 9 syl3anc A P 2 x x 2 mod P = A mod P P x 2 A
11 10 biimprd A P 2 x P x 2 A x 2 mod P = A mod P
12 11 reximdva A P 2 x P x 2 A x x 2 mod P = A mod P
13 12 adantld A P 2 ¬ P A x P x 2 A x x 2 mod P = A mod P
14 1 13 sylbid A P 2 A / L P = 1 x x 2 mod P = A mod P