Metamath Proof Explorer


Theorem m1lgs

Description: The first supplement to the law of quadratic reciprocity. Negative one is a square mod an odd prime P iff P == 1 (mod 4 ). See first case of theorem 9.4 in ApostolNT p. 181. (Contributed by Mario Carneiro, 19-Jun-2015)

Ref Expression
Assertion m1lgs P2-1/LP=1Pmod4=1

Proof

Step Hyp Ref Expression
1 neg1z 1
2 oddprm P2P12
3 2 nnnn0d P2P120
4 zexpcl 1P1201P12
5 1 3 4 sylancr P21P12
6 5 peano2zd P21P12+1
7 eldifi P2P
8 prmnn PP
9 7 8 syl P2P
10 6 9 zmodcld P21P12+1modP0
11 10 nn0cnd P21P12+1modP
12 1cnd P21
13 11 12 12 subaddd P21P12+1modP1=11+1=1P12+1modP
14 2re 2
15 14 a1i P22
16 9 nnrpd P2P+
17 0le2 02
18 17 a1i P202
19 oddprmgt2 P22<P
20 modid 2P+022<P2modP=2
21 15 16 18 19 20 syl22anc P22modP=2
22 df-2 2=1+1
23 21 22 eqtrdi P22modP=1+1
24 23 eqeq1d P22modP=1P12+1modP1+1=1P12+1modP
25 eldifsni P2P2
26 25 neneqd P2¬P=2
27 prmuz2 PP2
28 7 27 syl P2P2
29 2prm 2
30 dvdsprm P22P2P=2
31 28 29 30 sylancl P2P2P=2
32 26 31 mtbird P2¬P2
33 32 adantr P2¬2P12¬P2
34 1cnd P2¬2P121
35 2 adantr P2¬2P12P12
36 simpr P2¬2P12¬2P12
37 oexpneg 1P12¬2P121P12=1P12
38 34 35 36 37 syl3anc P2¬2P121P12=1P12
39 35 nnzd P2¬2P12P12
40 1exp P121P12=1
41 39 40 syl P2¬2P121P12=1
42 41 negeqd P2¬2P121P12=1
43 38 42 eqtrd P2¬2P121P12=1
44 43 oveq1d P2¬2P121P12+1=-1+1
45 ax-1cn 1
46 neg1cn 1
47 1pneg1e0 1+-1=0
48 45 46 47 addcomli -1+1=0
49 44 48 eqtrdi P2¬2P121P12+1=0
50 49 oveq2d P2¬2P1221P12+1=20
51 2cn 2
52 51 subid1i 20=2
53 50 52 eqtrdi P2¬2P1221P12+1=2
54 53 breq2d P2¬2P12P21P12+1P2
55 33 54 mtbird P2¬2P12¬P21P12+1
56 55 ex P2¬2P12¬P21P12+1
57 56 con4d P2P21P12+12P12
58 2z 2
59 58 a1i P22
60 moddvds P21P12+12modP=1P12+1modPP21P12+1
61 9 59 6 60 syl3anc P22modP=1P12+1modPP21P12+1
62 4z 4
63 4ne0 40
64 nnm1nn0 PP10
65 9 64 syl P2P10
66 65 nn0zd P2P1
67 dvdsval2 440P14P1P14
68 62 63 66 67 mp3an12i P24P1P14
69 65 nn0cnd P2P1
70 51 a1i P22
71 2ne0 20
72 71 a1i P220
73 69 70 70 72 72 divdiv1d P2P122=P122
74 2t2e4 22=4
75 74 oveq2i P122=P14
76 73 75 eqtrdi P2P122=P14
77 76 eleq1d P2P122P14
78 68 77 bitr4d P24P1P122
79 2 nnzd P2P12
80 dvdsval2 220P122P12P122
81 58 71 79 80 mp3an12i P22P12P122
82 78 81 bitr4d P24P12P12
83 57 61 82 3imtr4d P22modP=1P12+1modP4P1
84 46 a1i P24P11
85 neg1ne0 10
86 85 a1i P24P110
87 58 a1i P24P12
88 78 biimpa P24P1P122
89 expmulz 1102P12212P122=-12P122
90 84 86 87 88 89 syl22anc P24P112P122=-12P122
91 2 nncnd P2P12
92 91 70 72 divcan2d P22P122=P12
93 92 adantr P24P12P122=P12
94 93 oveq2d P24P112P122=1P12
95 neg1sqe1 12=1
96 95 oveq1i -12P122=1P122
97 1exp P1221P122=1
98 88 97 syl P24P11P122=1
99 96 98 eqtrid P24P1-12P122=1
100 90 94 99 3eqtr3d P24P11P12=1
101 100 oveq1d P24P11P12+1=1+1
102 22 101 eqtr4id P24P12=1P12+1
103 102 oveq1d P24P12modP=1P12+1modP
104 103 ex P24P12modP=1P12+1modP
105 83 104 impbid P22modP=1P12+1modP4P1
106 13 24 105 3bitr2d P21P12+1modP1=14P1
107 lgsval3 1P2-1/LP=1P12+1modP1
108 1 107 mpan P2-1/LP=1P12+1modP1
109 108 eqeq1d P2-1/LP=11P12+1modP1=1
110 4nn 4
111 110 a1i P24
112 prmz PP
113 7 112 syl P2P
114 1zzd P21
115 moddvds 4P1Pmod4=1mod44P1
116 111 113 114 115 syl3anc P2Pmod4=1mod44P1
117 106 109 116 3bitr4d P2-1/LP=1Pmod4=1mod4
118 1re 1
119 nnrp 44+
120 110 119 ax-mp 4+
121 0le1 01
122 1lt4 1<4
123 modid 14+011<41mod4=1
124 118 120 121 122 123 mp4an 1mod4=1
125 124 eqeq2i Pmod4=1mod4Pmod4=1
126 117 125 bitrdi P2-1/LP=1Pmod4=1