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 AP2A/LP=1xx2modP=AmodP¬Px

Proof

Step Hyp Ref Expression
1 lgsqrmod AP2A/LP=1xx2modP=AmodP
2 1 imp AP2A/LP=1xx2modP=AmodP
3 eldifi P2P
4 prmnn PP
5 3 4 syl P2P
6 5 ad3antlr AP2A/LP=1xP
7 zsqcl xx2
8 7 adantl AP2A/LP=1xx2
9 simplll AP2A/LP=1xA
10 moddvds Px2Ax2modP=AmodPPx2A
11 6 8 9 10 syl3anc AP2A/LP=1xx2modP=AmodPPx2A
12 5 nnzd P2P
13 12 ad3antlr AP2A/LP=1xP
14 13 8 9 3jca AP2A/LP=1xPx2A
15 14 adantl PxAP2A/LP=1xPx2A
16 dvdssub2 Px2APx2APx2PA
17 15 16 sylan PxAP2A/LP=1xPx2APx2PA
18 17 ex PxAP2A/LP=1xPx2APx2PA
19 bicom Px2PAPAPx2
20 3 ad3antlr AP2A/LP=1xP
21 simpr AP2A/LP=1xx
22 2nn 2
23 22 a1i AP2A/LP=1x2
24 prmdvdsexp Px2Px2Px
25 20 21 23 24 syl3anc AP2A/LP=1xPx2Px
26 25 biimparc PxAP2A/LP=1xPx2
27 bianir Px2PAPx2PA
28 5 ad2antlr AP2A/LP=1P
29 dvdsmod0 PPAAmodP=0
30 29 ex PPAAmodP=0
31 28 30 syl AP2A/LP=1PAAmodP=0
32 lgsprme0 APA/LP=0AmodP=0
33 3 32 sylan2 AP2A/LP=0AmodP=0
34 eqeq1 A/LP=0A/LP=10=1
35 0ne1 01
36 eqneqall 0=101¬Px
37 35 36 mpi 0=1¬Px
38 34 37 syl6bi A/LP=0A/LP=1¬Px
39 33 38 syl6bir AP2AmodP=0A/LP=1¬Px
40 39 com23 AP2A/LP=1AmodP=0¬Px
41 40 imp AP2A/LP=1AmodP=0¬Px
42 31 41 syld AP2A/LP=1PA¬Px
43 42 ad2antrl PxAP2A/LP=1xPA¬Px
44 27 43 syl5com Px2PAPx2PxAP2A/LP=1x¬Px
45 44 ex Px2PAPx2PxAP2A/LP=1x¬Px
46 45 com23 Px2PxAP2A/LP=1xPAPx2¬Px
47 26 46 mpcom PxAP2A/LP=1xPAPx2¬Px
48 19 47 biimtrid PxAP2A/LP=1xPx2PA¬Px
49 18 48 syld PxAP2A/LP=1xPx2A¬Px
50 49 ex PxAP2A/LP=1xPx2A¬Px
51 2a1 ¬PxAP2A/LP=1xPx2A¬Px
52 50 51 pm2.61i AP2A/LP=1xPx2A¬Px
53 11 52 sylbid AP2A/LP=1xx2modP=AmodP¬Px
54 53 ancld AP2A/LP=1xx2modP=AmodPx2modP=AmodP¬Px
55 54 reximdva AP2A/LP=1xx2modP=AmodPxx2modP=AmodP¬Px
56 2 55 mpd AP2A/LP=1xx2modP=AmodP¬Px
57 56 ex AP2A/LP=1xx2modP=AmodP¬Px