Metamath Proof Explorer


Theorem lgsqrmodndvds

Description: If the Legendre symbol of an integer A for an odd prime is 1 , then the number is a quadratic residue mod P with a solution x of the congruence ( x ^ 2 ) == A (mod P ) which is not divisible by the prime. (Contributed by AV, 20-Aug-2021) (Proof shortened by AV, 18-Mar-2022)

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

Proof

Step Hyp Ref Expression
1 lgsqrmod A P 2 A / L P = 1 x x 2 mod P = A mod P
2 1 imp A P 2 A / L P = 1 x x 2 mod P = A mod P
3 eldifi P 2 P
4 prmnn P P
5 3 4 syl P 2 P
6 5 ad3antlr A P 2 A / L P = 1 x P
7 zsqcl x x 2
8 7 adantl A P 2 A / L P = 1 x x 2
9 simplll A P 2 A / L P = 1 x A
10 moddvds P x 2 A x 2 mod P = A mod P P x 2 A
11 6 8 9 10 syl3anc A P 2 A / L P = 1 x x 2 mod P = A mod P P x 2 A
12 5 nnzd P 2 P
13 12 ad3antlr A P 2 A / L P = 1 x P
14 13 8 9 3jca A P 2 A / L P = 1 x P x 2 A
15 14 adantl P x A P 2 A / L P = 1 x P x 2 A
16 dvdssub2 P x 2 A P x 2 A P x 2 P A
17 15 16 sylan P x A P 2 A / L P = 1 x P x 2 A P x 2 P A
18 17 ex P x A P 2 A / L P = 1 x P x 2 A P x 2 P A
19 bicom P x 2 P A P A P x 2
20 3 ad3antlr A P 2 A / L P = 1 x P
21 simpr A P 2 A / L P = 1 x x
22 2nn 2
23 22 a1i A P 2 A / L P = 1 x 2
24 prmdvdsexp P x 2 P x 2 P x
25 20 21 23 24 syl3anc A P 2 A / L P = 1 x P x 2 P x
26 25 biimparc P x A P 2 A / L P = 1 x P x 2
27 bianir P x 2 P A P x 2 P A
28 5 ad2antlr A P 2 A / L P = 1 P
29 dvdsmod0 P P A A mod P = 0
30 29 ex P P A A mod P = 0
31 28 30 syl A P 2 A / L P = 1 P A A mod P = 0
32 lgsprme0 A P A / L P = 0 A mod P = 0
33 3 32 sylan2 A P 2 A / L P = 0 A mod P = 0
34 eqeq1 A / L P = 0 A / L P = 1 0 = 1
35 0ne1 0 1
36 eqneqall 0 = 1 0 1 ¬ P x
37 35 36 mpi 0 = 1 ¬ P x
38 34 37 syl6bi A / L P = 0 A / L P = 1 ¬ P x
39 33 38 syl6bir A P 2 A mod P = 0 A / L P = 1 ¬ P x
40 39 com23 A P 2 A / L P = 1 A mod P = 0 ¬ P x
41 40 imp A P 2 A / L P = 1 A mod P = 0 ¬ P x
42 31 41 syld A P 2 A / L P = 1 P A ¬ P x
43 42 ad2antrl P x A P 2 A / L P = 1 x P A ¬ P x
44 27 43 syl5com P x 2 P A P x 2 P x A P 2 A / L P = 1 x ¬ P x
45 44 ex P x 2 P A P x 2 P x A P 2 A / L P = 1 x ¬ P x
46 45 com23 P x 2 P x A P 2 A / L P = 1 x P A P x 2 ¬ P x
47 26 46 mpcom P x A P 2 A / L P = 1 x P A P x 2 ¬ P x
48 19 47 syl5bi P x A P 2 A / L P = 1 x P x 2 P A ¬ P x
49 18 48 syld P x A P 2 A / L P = 1 x P x 2 A ¬ P x
50 49 ex P x A P 2 A / L P = 1 x P x 2 A ¬ P x
51 2a1 ¬ P x A P 2 A / L P = 1 x P x 2 A ¬ P x
52 50 51 pm2.61i A P 2 A / L P = 1 x P x 2 A ¬ P x
53 11 52 sylbid A P 2 A / L P = 1 x x 2 mod P = A mod P ¬ P x
54 53 ancld A P 2 A / L P = 1 x x 2 mod P = A mod P x 2 mod P = A mod P ¬ P x
55 54 reximdva A P 2 A / L P = 1 x x 2 mod P = A mod P x x 2 mod P = A mod P ¬ P x
56 2 55 mpd A P 2 A / L P = 1 x x 2 mod P = A mod P ¬ P x
57 56 ex A P 2 A / L P = 1 x x 2 mod P = A mod P ¬ P x