Metamath Proof Explorer


Theorem 2lgs

Description: The second supplement to the law of quadratic reciprocity (for the Legendre symbol extended to arbitrary primes as second argument). Two is a square modulo a prime P iff P == +- 1 (mod 8 ), see first case of theorem 9.5 in ApostolNT p. 181. This theorem justifies our definition of ( N /L 2 ) ( lgs2 ) to some degree, by demanding that reciprocity extend to the case Q = 2 . (Proposed by Mario Carneiro, 19-Jun-2015.) (Contributed by AV, 16-Jul-2021)

Ref Expression
Assertion 2lgs P2/LP=1Pmod817

Proof

Step Hyp Ref Expression
1 prm2orodd PP=2¬2P
2 2lgslem4 2/L2=12mod817
3 2 a1i P=22/L2=12mod817
4 oveq2 P=22/LP=2/L2
5 4 eqeq1d P=22/LP=12/L2=1
6 oveq1 P=2Pmod8=2mod8
7 6 eleq1d P=2Pmod8172mod817
8 3 5 7 3bitr4d P=22/LP=1Pmod817
9 8 a1d P=2P2/LP=1Pmod817
10 2prm 2
11 prmnn PP
12 dvdsprime 2PP2P=2P=1
13 10 11 12 sylancr PP2P=2P=1
14 z2even 22
15 breq2 P=22P22
16 14 15 mpbiri P=22P
17 16 a1d P=2P2P
18 eleq1 P=1P1
19 1nprm ¬1
20 19 pm2.21i 12P
21 18 20 syl6bi P=1P2P
22 17 21 jaoi P=2P=1P2P
23 22 com12 PP=2P=12P
24 13 23 sylbid PP22P
25 24 con3dimp P¬2P¬P2
26 2z 2
27 25 26 jctil P¬2P2¬P2
28 2lgslem1 P¬2Px|i1P12x=i2P2<xmodP=P12P4
29 28 eqcomd P¬2PP12P4=x|i1P12x=i2P2<xmodP
30 nnoddn2prmb P2P¬2P
31 30 biimpri P¬2PP2
32 31 3ad2ant1 P¬2P2¬P2P12P4=x|i1P12x=i2P2<xmodPP2
33 eqid P12=P12
34 eqid y1P12ify2<P2y2Py2=y1P12ify2<P2y2Py2
35 eqid P4=P4
36 eqid P12P4=P12P4
37 32 33 34 35 36 gausslemma2d P¬2P2¬P2P12P4=x|i1P12x=i2P2<xmodP2/LP=1P12P4
38 37 eqeq1d P¬2P2¬P2P12P4=x|i1P12x=i2P2<xmodP2/LP=11P12P4=1
39 27 29 38 mpd3an23 P¬2P2/LP=11P12P4=1
40 36 2lgslem2 P¬2PP12P4
41 m1exp1 P12P41P12P4=12P12P4
42 40 41 syl P¬2P1P12P4=12P12P4
43 2nn 2
44 dvdsval3 2P12P42P12P4P12P4mod2=0
45 43 40 44 sylancr P¬2P2P12P4P12P4mod2=0
46 36 2lgslem3 P¬2PP12P4mod2=ifPmod81701
47 11 46 sylan P¬2PP12P4mod2=ifPmod81701
48 47 eqeq1d P¬2PP12P4mod2=0ifPmod81701=0
49 ax-1 Pmod817ifPmod81701=0Pmod817
50 iffalse ¬Pmod817ifPmod81701=1
51 50 eqeq1d ¬Pmod817ifPmod81701=01=0
52 ax-1ne0 10
53 eqneqall 1=010Pmod817
54 52 53 mpi 1=0Pmod817
55 51 54 syl6bi ¬Pmod817ifPmod81701=0Pmod817
56 49 55 pm2.61i ifPmod81701=0Pmod817
57 iftrue Pmod817ifPmod81701=0
58 56 57 impbii ifPmod81701=0Pmod817
59 58 a1i P¬2PifPmod81701=0Pmod817
60 45 48 59 3bitrd P¬2P2P12P4Pmod817
61 39 42 60 3bitrd P¬2P2/LP=1Pmod817
62 61 expcom ¬2PP2/LP=1Pmod817
63 9 62 jaoi P=2¬2PP2/LP=1Pmod817
64 1 63 mpcom P2/LP=1Pmod817