Metamath Proof Explorer


Theorem lgsquad2lem1

Description: Lemma for lgsquad2 . (Contributed by Mario Carneiro, 19-Jun-2015)

Ref Expression
Hypotheses lgsquad2.1 φ M
lgsquad2.2 φ ¬ 2 M
lgsquad2.3 φ N
lgsquad2.4 φ ¬ 2 N
lgsquad2.5 φ M gcd N = 1
lgsquad2lem1.a φ A
lgsquad2lem1.b φ B
lgsquad2lem1.m φ A B = M
lgsquad2lem1.1 φ A / L N N / L A = 1 A 1 2 N 1 2
lgsquad2lem1.2 φ B / L N N / L B = 1 B 1 2 N 1 2
Assertion lgsquad2lem1 φ M / L N N / L M = 1 M 1 2 N 1 2

Proof

Step Hyp Ref Expression
1 lgsquad2.1 φ M
2 lgsquad2.2 φ ¬ 2 M
3 lgsquad2.3 φ N
4 lgsquad2.4 φ ¬ 2 N
5 lgsquad2.5 φ M gcd N = 1
6 lgsquad2lem1.a φ A
7 lgsquad2lem1.b φ B
8 lgsquad2lem1.m φ A B = M
9 lgsquad2lem1.1 φ A / L N N / L A = 1 A 1 2 N 1 2
10 lgsquad2lem1.2 φ B / L N N / L B = 1 B 1 2 N 1 2
11 6 nnzd φ A
12 11 zcnd φ A
13 ax-1cn 1
14 npcan A 1 A - 1 + 1 = A
15 12 13 14 sylancl φ A - 1 + 1 = A
16 7 nnzd φ B
17 16 zcnd φ B
18 npcan B 1 B - 1 + 1 = B
19 17 13 18 sylancl φ B - 1 + 1 = B
20 15 19 oveq12d φ A - 1 + 1 B - 1 + 1 = A B
21 peano2zm A A 1
22 11 21 syl φ A 1
23 22 zcnd φ A 1
24 13 a1i φ 1
25 peano2zm B B 1
26 16 25 syl φ B 1
27 26 zcnd φ B 1
28 23 24 27 24 muladdd φ A - 1 + 1 B - 1 + 1 = A 1 B 1 + 1 1 + A 1 1 + B 1 1
29 1t1e1 1 1 = 1
30 29 a1i φ 1 1 = 1
31 30 oveq2d φ A 1 B 1 + 1 1 = A 1 B 1 + 1
32 23 mulid1d φ A 1 1 = A 1
33 27 mulid1d φ B 1 1 = B 1
34 32 33 oveq12d φ A 1 1 + B 1 1 = A 1 + B - 1
35 31 34 oveq12d φ A 1 B 1 + 1 1 + A 1 1 + B 1 1 = A 1 B 1 + 1 + A 1 + B 1
36 28 35 eqtrd φ A - 1 + 1 B - 1 + 1 = A 1 B 1 + 1 + A 1 + B 1
37 20 36 eqtr3d φ A B = A 1 B 1 + 1 + A 1 + B 1
38 8 37 eqtr3d φ M = A 1 B 1 + 1 + A 1 + B 1
39 38 oveq1d φ M 1 = A 1 B 1 + 1 + A 1 + B - 1 - 1
40 23 27 mulcld φ A 1 B 1
41 addcl A 1 B 1 1 A 1 B 1 + 1
42 40 13 41 sylancl φ A 1 B 1 + 1
43 23 27 addcld φ A 1 + B - 1
44 42 43 24 addsubd φ A 1 B 1 + 1 + A 1 + B - 1 - 1 = A 1 B 1 + 1 - 1 + A 1 + B 1
45 pncan A 1 B 1 1 A 1 B 1 + 1 - 1 = A 1 B 1
46 40 13 45 sylancl φ A 1 B 1 + 1 - 1 = A 1 B 1
47 46 oveq1d φ A 1 B 1 + 1 - 1 + A 1 + B 1 = A 1 B 1 + A 1 + B 1
48 39 44 47 3eqtrd φ M 1 = A 1 B 1 + A 1 + B 1
49 48 oveq1d φ M 1 2 = A 1 B 1 + A 1 + B 1 2
50 2cnd φ 2
51 2ne0 2 0
52 51 a1i φ 2 0
53 40 43 50 52 divdird φ A 1 B 1 + A 1 + B 1 2 = A 1 B 1 2 + A 1 + B - 1 2
54 23 27 50 52 divassd φ A 1 B 1 2 = A 1 B 1 2
55 23 50 52 divcan2d φ 2 A 1 2 = A 1
56 55 oveq1d φ 2 A 1 2 B 1 2 = A 1 B 1 2
57 dvdsmul1 A B A A B
58 11 16 57 syl2anc φ A A B
59 58 8 breqtrd φ A M
60 2z 2
61 1 nnzd φ M
62 dvdstr 2 A M 2 A A M 2 M
63 60 11 61 62 mp3an2i φ 2 A A M 2 M
64 59 63 mpan2d φ 2 A 2 M
65 2 64 mtod φ ¬ 2 A
66 1zzd φ 1
67 2prm 2
68 nprmdvds1 2 ¬ 2 1
69 67 68 mp1i φ ¬ 2 1
70 omoe A ¬ 2 A 1 ¬ 2 1 2 A 1
71 11 65 66 69 70 syl22anc φ 2 A 1
72 dvdsval2 2 2 0 A 1 2 A 1 A 1 2
73 60 52 22 72 mp3an2i φ 2 A 1 A 1 2
74 71 73 mpbid φ A 1 2
75 74 zcnd φ A 1 2
76 dvdsmul2 A B B A B
77 11 16 76 syl2anc φ B A B
78 77 8 breqtrd φ B M
79 dvdstr 2 B M 2 B B M 2 M
80 60 16 61 79 mp3an2i φ 2 B B M 2 M
81 78 80 mpan2d φ 2 B 2 M
82 2 81 mtod φ ¬ 2 B
83 omoe B ¬ 2 B 1 ¬ 2 1 2 B 1
84 16 82 66 69 83 syl22anc φ 2 B 1
85 dvdsval2 2 2 0 B 1 2 B 1 B 1 2
86 60 52 26 85 mp3an2i φ 2 B 1 B 1 2
87 84 86 mpbid φ B 1 2
88 87 zcnd φ B 1 2
89 50 75 88 mulassd φ 2 A 1 2 B 1 2 = 2 A 1 2 B 1 2
90 54 56 89 3eqtr2d φ A 1 B 1 2 = 2 A 1 2 B 1 2
91 23 27 50 52 divdird φ A 1 + B - 1 2 = A 1 2 + B 1 2
92 90 91 oveq12d φ A 1 B 1 2 + A 1 + B - 1 2 = 2 A 1 2 B 1 2 + A 1 2 + B 1 2
93 49 53 92 3eqtrd φ M 1 2 = 2 A 1 2 B 1 2 + A 1 2 + B 1 2
94 93 oveq1d φ M 1 2 N 1 2 = 2 A 1 2 B 1 2 + A 1 2 + B 1 2 N 1 2
95 60 a1i φ 2
96 74 87 zmulcld φ A 1 2 B 1 2
97 95 96 zmulcld φ 2 A 1 2 B 1 2
98 97 zcnd φ 2 A 1 2 B 1 2
99 74 87 zaddcld φ A 1 2 + B 1 2
100 99 zcnd φ A 1 2 + B 1 2
101 3 nnzd φ N
102 omoe N ¬ 2 N 1 ¬ 2 1 2 N 1
103 101 4 66 69 102 syl22anc φ 2 N 1
104 peano2zm N N 1
105 101 104 syl φ N 1
106 dvdsval2 2 2 0 N 1 2 N 1 N 1 2
107 60 52 105 106 mp3an2i φ 2 N 1 N 1 2
108 103 107 mpbid φ N 1 2
109 108 zcnd φ N 1 2
110 98 100 109 adddird φ 2 A 1 2 B 1 2 + A 1 2 + B 1 2 N 1 2 = 2 A 1 2 B 1 2 N 1 2 + A 1 2 + B 1 2 N 1 2
111 96 zcnd φ A 1 2 B 1 2
112 50 111 109 mulassd φ 2 A 1 2 B 1 2 N 1 2 = 2 A 1 2 B 1 2 N 1 2
113 112 oveq1d φ 2 A 1 2 B 1 2 N 1 2 + A 1 2 + B 1 2 N 1 2 = 2 A 1 2 B 1 2 N 1 2 + A 1 2 + B 1 2 N 1 2
114 94 110 113 3eqtrd φ M 1 2 N 1 2 = 2 A 1 2 B 1 2 N 1 2 + A 1 2 + B 1 2 N 1 2
115 114 oveq2d φ 1 M 1 2 N 1 2 = 1 2 A 1 2 B 1 2 N 1 2 + A 1 2 + B 1 2 N 1 2
116 neg1cn 1
117 116 a1i φ 1
118 neg1ne0 1 0
119 118 a1i φ 1 0
120 96 108 zmulcld φ A 1 2 B 1 2 N 1 2
121 95 120 zmulcld φ 2 A 1 2 B 1 2 N 1 2
122 99 108 zmulcld φ A 1 2 + B 1 2 N 1 2
123 expaddz 1 1 0 2 A 1 2 B 1 2 N 1 2 A 1 2 + B 1 2 N 1 2 1 2 A 1 2 B 1 2 N 1 2 + A 1 2 + B 1 2 N 1 2 = 1 2 A 1 2 B 1 2 N 1 2 1 A 1 2 + B 1 2 N 1 2
124 117 119 121 122 123 syl22anc φ 1 2 A 1 2 B 1 2 N 1 2 + A 1 2 + B 1 2 N 1 2 = 1 2 A 1 2 B 1 2 N 1 2 1 A 1 2 + B 1 2 N 1 2
125 expmulz 1 1 0 2 A 1 2 B 1 2 N 1 2 1 2 A 1 2 B 1 2 N 1 2 = -1 2 A 1 2 B 1 2 N 1 2
126 117 119 95 120 125 syl22anc φ 1 2 A 1 2 B 1 2 N 1 2 = -1 2 A 1 2 B 1 2 N 1 2
127 neg1sqe1 1 2 = 1
128 127 oveq1i -1 2 A 1 2 B 1 2 N 1 2 = 1 A 1 2 B 1 2 N 1 2
129 1exp A 1 2 B 1 2 N 1 2 1 A 1 2 B 1 2 N 1 2 = 1
130 120 129 syl φ 1 A 1 2 B 1 2 N 1 2 = 1
131 128 130 syl5eq φ -1 2 A 1 2 B 1 2 N 1 2 = 1
132 126 131 eqtrd φ 1 2 A 1 2 B 1 2 N 1 2 = 1
133 132 oveq1d φ 1 2 A 1 2 B 1 2 N 1 2 1 A 1 2 + B 1 2 N 1 2 = 1 1 A 1 2 + B 1 2 N 1 2
134 124 133 eqtrd φ 1 2 A 1 2 B 1 2 N 1 2 + A 1 2 + B 1 2 N 1 2 = 1 1 A 1 2 + B 1 2 N 1 2
135 117 119 122 expclzd φ 1 A 1 2 + B 1 2 N 1 2
136 135 mulid2d φ 1 1 A 1 2 + B 1 2 N 1 2 = 1 A 1 2 + B 1 2 N 1 2
137 75 88 109 adddird φ A 1 2 + B 1 2 N 1 2 = A 1 2 N 1 2 + B 1 2 N 1 2
138 137 oveq2d φ 1 A 1 2 + B 1 2 N 1 2 = 1 A 1 2 N 1 2 + B 1 2 N 1 2
139 136 138 eqtrd φ 1 1 A 1 2 + B 1 2 N 1 2 = 1 A 1 2 N 1 2 + B 1 2 N 1 2
140 115 134 139 3eqtrd φ 1 M 1 2 N 1 2 = 1 A 1 2 N 1 2 + B 1 2 N 1 2
141 9 10 oveq12d φ A / L N N / L A B / L N N / L B = 1 A 1 2 N 1 2 1 B 1 2 N 1 2
142 74 108 zmulcld φ A 1 2 N 1 2
143 87 108 zmulcld φ B 1 2 N 1 2
144 expaddz 1 1 0 A 1 2 N 1 2 B 1 2 N 1 2 1 A 1 2 N 1 2 + B 1 2 N 1 2 = 1 A 1 2 N 1 2 1 B 1 2 N 1 2
145 117 119 142 143 144 syl22anc φ 1 A 1 2 N 1 2 + B 1 2 N 1 2 = 1 A 1 2 N 1 2 1 B 1 2 N 1 2
146 141 145 eqtr4d φ A / L N N / L A B / L N N / L B = 1 A 1 2 N 1 2 + B 1 2 N 1 2
147 lgscl A N A / L N
148 11 101 147 syl2anc φ A / L N
149 148 zcnd φ A / L N
150 lgscl B N B / L N
151 16 101 150 syl2anc φ B / L N
152 151 zcnd φ B / L N
153 lgscl N A N / L A
154 101 11 153 syl2anc φ N / L A
155 154 zcnd φ N / L A
156 lgscl N B N / L B
157 101 16 156 syl2anc φ N / L B
158 157 zcnd φ N / L B
159 149 152 155 158 mul4d φ A / L N B / L N N / L A N / L B = A / L N N / L A B / L N N / L B
160 6 nnne0d φ A 0
161 7 nnne0d φ B 0
162 lgsdir A B N A 0 B 0 A B / L N = A / L N B / L N
163 11 16 101 160 161 162 syl32anc φ A B / L N = A / L N B / L N
164 8 oveq1d φ A B / L N = M / L N
165 163 164 eqtr3d φ A / L N B / L N = M / L N
166 lgsdi N A B A 0 B 0 N / L A B = N / L A N / L B
167 101 11 16 160 161 166 syl32anc φ N / L A B = N / L A N / L B
168 8 oveq2d φ N / L A B = N / L M
169 167 168 eqtr3d φ N / L A N / L B = N / L M
170 165 169 oveq12d φ A / L N B / L N N / L A N / L B = M / L N N / L M
171 159 170 eqtr3d φ A / L N N / L A B / L N N / L B = M / L N N / L M
172 140 146 171 3eqtr2rd φ M / L N N / L M = 1 M 1 2 N 1 2