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 P 2 / L P = 1 P mod 8 1 7

Proof

Step Hyp Ref Expression
1 prm2orodd P P = 2 ¬ 2 P
2 2lgslem4 2 / L 2 = 1 2 mod 8 1 7
3 2 a1i P = 2 2 / L 2 = 1 2 mod 8 1 7
4 oveq2 P = 2 2 / L P = 2 / L 2
5 4 eqeq1d P = 2 2 / L P = 1 2 / L 2 = 1
6 oveq1 P = 2 P mod 8 = 2 mod 8
7 6 eleq1d P = 2 P mod 8 1 7 2 mod 8 1 7
8 3 5 7 3bitr4d P = 2 2 / L P = 1 P mod 8 1 7
9 8 a1d P = 2 P 2 / L P = 1 P mod 8 1 7
10 2prm 2
11 prmnn P P
12 dvdsprime 2 P P 2 P = 2 P = 1
13 10 11 12 sylancr P P 2 P = 2 P = 1
14 z2even 2 2
15 breq2 P = 2 2 P 2 2
16 14 15 mpbiri P = 2 2 P
17 16 a1d P = 2 P 2 P
18 eleq1 P = 1 P 1
19 1nprm ¬ 1
20 19 pm2.21i 1 2 P
21 18 20 syl6bi P = 1 P 2 P
22 17 21 jaoi P = 2 P = 1 P 2 P
23 22 com12 P P = 2 P = 1 2 P
24 13 23 sylbid P P 2 2 P
25 24 con3dimp P ¬ 2 P ¬ P 2
26 2z 2
27 25 26 jctil P ¬ 2 P 2 ¬ P 2
28 2lgslem1 P ¬ 2 P x | i 1 P 1 2 x = i 2 P 2 < x mod P = P 1 2 P 4
29 28 eqcomd P ¬ 2 P P 1 2 P 4 = x | i 1 P 1 2 x = i 2 P 2 < x mod P
30 nnoddn2prmb P 2 P ¬ 2 P
31 30 biimpri P ¬ 2 P P 2
32 31 3ad2ant1 P ¬ 2 P 2 ¬ P 2 P 1 2 P 4 = x | i 1 P 1 2 x = i 2 P 2 < x mod P P 2
33 eqid P 1 2 = P 1 2
34 eqid y 1 P 1 2 if y 2 < P 2 y 2 P y 2 = y 1 P 1 2 if y 2 < P 2 y 2 P y 2
35 eqid P 4 = P 4
36 eqid P 1 2 P 4 = P 1 2 P 4
37 32 33 34 35 36 gausslemma2d P ¬ 2 P 2 ¬ P 2 P 1 2 P 4 = x | i 1 P 1 2 x = i 2 P 2 < x mod P 2 / L P = 1 P 1 2 P 4
38 37 eqeq1d P ¬ 2 P 2 ¬ P 2 P 1 2 P 4 = x | i 1 P 1 2 x = i 2 P 2 < x mod P 2 / L P = 1 1 P 1 2 P 4 = 1
39 27 29 38 mpd3an23 P ¬ 2 P 2 / L P = 1 1 P 1 2 P 4 = 1
40 36 2lgslem2 P ¬ 2 P P 1 2 P 4
41 m1exp1 P 1 2 P 4 1 P 1 2 P 4 = 1 2 P 1 2 P 4
42 40 41 syl P ¬ 2 P 1 P 1 2 P 4 = 1 2 P 1 2 P 4
43 2nn 2
44 dvdsval3 2 P 1 2 P 4 2 P 1 2 P 4 P 1 2 P 4 mod 2 = 0
45 43 40 44 sylancr P ¬ 2 P 2 P 1 2 P 4 P 1 2 P 4 mod 2 = 0
46 36 2lgslem3 P ¬ 2 P P 1 2 P 4 mod 2 = if P mod 8 1 7 0 1
47 11 46 sylan P ¬ 2 P P 1 2 P 4 mod 2 = if P mod 8 1 7 0 1
48 47 eqeq1d P ¬ 2 P P 1 2 P 4 mod 2 = 0 if P mod 8 1 7 0 1 = 0
49 ax-1 P mod 8 1 7 if P mod 8 1 7 0 1 = 0 P mod 8 1 7
50 iffalse ¬ P mod 8 1 7 if P mod 8 1 7 0 1 = 1
51 50 eqeq1d ¬ P mod 8 1 7 if P mod 8 1 7 0 1 = 0 1 = 0
52 ax-1ne0 1 0
53 eqneqall 1 = 0 1 0 P mod 8 1 7
54 52 53 mpi 1 = 0 P mod 8 1 7
55 51 54 syl6bi ¬ P mod 8 1 7 if P mod 8 1 7 0 1 = 0 P mod 8 1 7
56 49 55 pm2.61i if P mod 8 1 7 0 1 = 0 P mod 8 1 7
57 iftrue P mod 8 1 7 if P mod 8 1 7 0 1 = 0
58 56 57 impbii if P mod 8 1 7 0 1 = 0 P mod 8 1 7
59 58 a1i P ¬ 2 P if P mod 8 1 7 0 1 = 0 P mod 8 1 7
60 45 48 59 3bitrd P ¬ 2 P 2 P 1 2 P 4 P mod 8 1 7
61 39 42 60 3bitrd P ¬ 2 P 2 / L P = 1 P mod 8 1 7
62 61 expcom ¬ 2 P P 2 / L P = 1 P mod 8 1 7
63 9 62 jaoi P = 2 ¬ 2 P P 2 / L P = 1 P mod 8 1 7
64 1 63 mpcom P 2 / L P = 1 P mod 8 1 7