Metamath Proof Explorer


Theorem lgsdilem

Description: Lemma for lgsdi and lgsdir : the sign part of the Legendre symbol is multiplicative. (Contributed by Mario Carneiro, 4-Feb-2015)

Ref Expression
Assertion lgsdilem A B N A 0 B 0 if N < 0 A B < 0 1 1 = if N < 0 A < 0 1 1 if N < 0 B < 0 1 1

Proof

Step Hyp Ref Expression
1 simplrr A B N A 0 B 0 A < 0 B 0
2 1 biantrud A B N A 0 B 0 A < 0 0 B 0 B B 0
3 0re 0
4 simpl2 A B N A 0 B 0 B
5 4 zred A B N A 0 B 0 B
6 5 adantr A B N A 0 B 0 A < 0 B
7 ltlen 0 B 0 < B 0 B B 0
8 3 6 7 sylancr A B N A 0 B 0 A < 0 0 < B 0 B B 0
9 simpl1 A B N A 0 B 0 A
10 9 zred A B N A 0 B 0 A
11 10 adantr A B N A 0 B 0 A < 0 A
12 11 renegcld A B N A 0 B 0 A < 0 A
13 12 recnd A B N A 0 B 0 A < 0 A
14 13 mul01d A B N A 0 B 0 A < 0 A 0 = 0
15 11 recnd A B N A 0 B 0 A < 0 A
16 6 recnd A B N A 0 B 0 A < 0 B
17 15 16 mulneg1d A B N A 0 B 0 A < 0 A B = A B
18 14 17 breq12d A B N A 0 B 0 A < 0 A 0 < A B 0 < A B
19 0red A B N A 0 B 0 A < 0 0
20 10 lt0neg1d A B N A 0 B 0 A < 0 0 < A
21 20 biimpa A B N A 0 B 0 A < 0 0 < A
22 ltmul2 0 B A 0 < A 0 < B A 0 < A B
23 19 6 12 21 22 syl112anc A B N A 0 B 0 A < 0 0 < B A 0 < A B
24 10 5 remulcld A B N A 0 B 0 A B
25 24 adantr A B N A 0 B 0 A < 0 A B
26 25 lt0neg1d A B N A 0 B 0 A < 0 A B < 0 0 < A B
27 18 23 26 3bitr4d A B N A 0 B 0 A < 0 0 < B A B < 0
28 2 8 27 3bitr2rd A B N A 0 B 0 A < 0 A B < 0 0 B
29 lenlt 0 B 0 B ¬ B < 0
30 3 6 29 sylancr A B N A 0 B 0 A < 0 0 B ¬ B < 0
31 28 30 bitrd A B N A 0 B 0 A < 0 A B < 0 ¬ B < 0
32 31 ifbid A B N A 0 B 0 A < 0 if A B < 0 1 1 = if ¬ B < 0 1 1
33 oveq2 if B < 0 1 1 = 1 -1 if B < 0 1 1 = -1 -1
34 neg1mulneg1e1 -1 -1 = 1
35 33 34 eqtrdi if B < 0 1 1 = 1 -1 if B < 0 1 1 = 1
36 oveq2 if B < 0 1 1 = 1 -1 if B < 0 1 1 = -1 1
37 ax-1cn 1
38 37 mulm1i -1 1 = 1
39 36 38 eqtrdi if B < 0 1 1 = 1 -1 if B < 0 1 1 = 1
40 35 39 ifsb -1 if B < 0 1 1 = if B < 0 1 1
41 ifnot if ¬ B < 0 1 1 = if B < 0 1 1
42 40 41 eqtr4i -1 if B < 0 1 1 = if ¬ B < 0 1 1
43 32 42 eqtr4di A B N A 0 B 0 A < 0 if A B < 0 1 1 = -1 if B < 0 1 1
44 iftrue A < 0 if A < 0 1 1 = 1
45 44 adantl A B N A 0 B 0 A < 0 if A < 0 1 1 = 1
46 45 oveq1d A B N A 0 B 0 A < 0 if A < 0 1 1 if B < 0 1 1 = -1 if B < 0 1 1
47 43 46 eqtr4d A B N A 0 B 0 A < 0 if A B < 0 1 1 = if A < 0 1 1 if B < 0 1 1
48 iffalse ¬ A < 0 if A < 0 1 1 = 1
49 48 adantl A B N A 0 B 0 ¬ A < 0 if A < 0 1 1 = 1
50 49 oveq1d A B N A 0 B 0 ¬ A < 0 if A < 0 1 1 if B < 0 1 1 = 1 if B < 0 1 1
51 neg1cn 1
52 51 37 ifcli if B < 0 1 1
53 52 mulid2i 1 if B < 0 1 1 = if B < 0 1 1
54 5 adantr A B N A 0 B 0 ¬ A < 0 B
55 0red A B N A 0 B 0 ¬ A < 0 0
56 10 adantr A B N A 0 B 0 ¬ A < 0 A
57 lenlt 0 A 0 A ¬ A < 0
58 3 10 57 sylancr A B N A 0 B 0 0 A ¬ A < 0
59 58 biimpar A B N A 0 B 0 ¬ A < 0 0 A
60 simplrl A B N A 0 B 0 ¬ A < 0 A 0
61 56 59 60 ne0gt0d A B N A 0 B 0 ¬ A < 0 0 < A
62 ltmul2 B 0 A 0 < A B < 0 A B < A 0
63 54 55 56 61 62 syl112anc A B N A 0 B 0 ¬ A < 0 B < 0 A B < A 0
64 56 recnd A B N A 0 B 0 ¬ A < 0 A
65 64 mul01d A B N A 0 B 0 ¬ A < 0 A 0 = 0
66 65 breq2d A B N A 0 B 0 ¬ A < 0 A B < A 0 A B < 0
67 63 66 bitrd A B N A 0 B 0 ¬ A < 0 B < 0 A B < 0
68 67 ifbid A B N A 0 B 0 ¬ A < 0 if B < 0 1 1 = if A B < 0 1 1
69 53 68 syl5eq A B N A 0 B 0 ¬ A < 0 1 if B < 0 1 1 = if A B < 0 1 1
70 50 69 eqtr2d A B N A 0 B 0 ¬ A < 0 if A B < 0 1 1 = if A < 0 1 1 if B < 0 1 1
71 47 70 pm2.61dan A B N A 0 B 0 if A B < 0 1 1 = if A < 0 1 1 if B < 0 1 1
72 71 adantr A B N A 0 B 0 N < 0 if A B < 0 1 1 = if A < 0 1 1 if B < 0 1 1
73 simpr A B N A 0 B 0 N < 0 N < 0
74 73 biantrurd A B N A 0 B 0 N < 0 A B < 0 N < 0 A B < 0
75 74 ifbid A B N A 0 B 0 N < 0 if A B < 0 1 1 = if N < 0 A B < 0 1 1
76 73 biantrurd A B N A 0 B 0 N < 0 A < 0 N < 0 A < 0
77 76 ifbid A B N A 0 B 0 N < 0 if A < 0 1 1 = if N < 0 A < 0 1 1
78 73 biantrurd A B N A 0 B 0 N < 0 B < 0 N < 0 B < 0
79 78 ifbid A B N A 0 B 0 N < 0 if B < 0 1 1 = if N < 0 B < 0 1 1
80 77 79 oveq12d A B N A 0 B 0 N < 0 if A < 0 1 1 if B < 0 1 1 = if N < 0 A < 0 1 1 if N < 0 B < 0 1 1
81 72 75 80 3eqtr3d A B N A 0 B 0 N < 0 if N < 0 A B < 0 1 1 = if N < 0 A < 0 1 1 if N < 0 B < 0 1 1
82 simpr A B N A 0 B 0 ¬ N < 0 ¬ N < 0
83 82 intnanrd A B N A 0 B 0 ¬ N < 0 ¬ N < 0 A B < 0
84 83 iffalsed A B N A 0 B 0 ¬ N < 0 if N < 0 A B < 0 1 1 = 1
85 1t1e1 1 1 = 1
86 84 85 eqtr4di A B N A 0 B 0 ¬ N < 0 if N < 0 A B < 0 1 1 = 1 1
87 82 intnanrd A B N A 0 B 0 ¬ N < 0 ¬ N < 0 A < 0
88 87 iffalsed A B N A 0 B 0 ¬ N < 0 if N < 0 A < 0 1 1 = 1
89 82 intnanrd A B N A 0 B 0 ¬ N < 0 ¬ N < 0 B < 0
90 89 iffalsed A B N A 0 B 0 ¬ N < 0 if N < 0 B < 0 1 1 = 1
91 88 90 oveq12d A B N A 0 B 0 ¬ N < 0 if N < 0 A < 0 1 1 if N < 0 B < 0 1 1 = 1 1
92 86 91 eqtr4d A B N A 0 B 0 ¬ N < 0 if N < 0 A B < 0 1 1 = if N < 0 A < 0 1 1 if N < 0 B < 0 1 1
93 81 92 pm2.61dan A B N A 0 B 0 if N < 0 A B < 0 1 1 = if N < 0 A < 0 1 1 if N < 0 B < 0 1 1