Metamath Proof Explorer


Theorem lcmgcdlem

Description: Lemma for lcmgcd and lcmdvds . Prove them for positive M , N , and K . (Contributed by Steve Rodriguez, 20-Jan-2020) (Proof shortened by AV, 16-Sep-2020)

Ref Expression
Assertion lcmgcdlem M N M lcm N M gcd N = M N K M K N K M lcm N K

Proof

Step Hyp Ref Expression
1 nnmulcl M N M N
2 1 nnred M N M N
3 nnz M M
4 3 adantr M N M
5 4 zred M N M
6 nnz N N
7 6 adantl M N N
8 7 zred M N N
9 0red M 0
10 nnre M M
11 nngt0 M 0 < M
12 9 10 11 ltled M 0 M
13 12 adantr M N 0 M
14 0red N 0
15 nnre N N
16 nngt0 N 0 < N
17 14 15 16 ltled N 0 N
18 17 adantl M N 0 N
19 5 8 13 18 mulge0d M N 0 M N
20 2 19 absidd M N M N = M N
21 3 6 anim12i M N M N
22 nnne0 M M 0
23 22 neneqd M ¬ M = 0
24 nnne0 N N 0
25 24 neneqd N ¬ N = 0
26 23 25 anim12i M N ¬ M = 0 ¬ N = 0
27 ioran ¬ M = 0 N = 0 ¬ M = 0 ¬ N = 0
28 26 27 sylibr M N ¬ M = 0 N = 0
29 lcmn0val M N ¬ M = 0 N = 0 M lcm N = sup x | M x N x <
30 21 28 29 syl2anc M N M lcm N = sup x | M x N x <
31 ltso < Or
32 31 a1i M N < Or
33 gcddvds M N M gcd N M M gcd N N
34 33 simpld M N M gcd N M
35 gcdcl M N M gcd N 0
36 35 nn0zd M N M gcd N
37 dvdsmultr1 M gcd N M N M gcd N M M gcd N M N
38 37 3expb M gcd N M N M gcd N M M gcd N M N
39 36 38 mpancom M N M gcd N M M gcd N M N
40 34 39 mpd M N M gcd N M N
41 21 40 syl M N M gcd N M N
42 gcdnncl M N M gcd N
43 nndivdvds M N M gcd N M gcd N M N M N M gcd N
44 1 42 43 syl2anc M N M gcd N M N M N M gcd N
45 41 44 mpbid M N M N M gcd N
46 45 nnred M N M N M gcd N
47 breq2 x = M N M gcd N M x M M N M gcd N
48 breq2 x = M N M gcd N N x N M N M gcd N
49 47 48 anbi12d x = M N M gcd N M x N x M M N M gcd N N M N M gcd N
50 33 simprd M N M gcd N N
51 21 50 syl M N M gcd N N
52 21 36 syl M N M gcd N
53 42 nnne0d M N M gcd N 0
54 dvdsval2 M gcd N M gcd N 0 N M gcd N N N M gcd N
55 52 53 7 54 syl3anc M N M gcd N N N M gcd N
56 51 55 mpbid M N N M gcd N
57 dvdsmul1 M N M gcd N M M N M gcd N
58 4 56 57 syl2anc M N M M N M gcd N
59 nncn M M
60 59 adantr M N M
61 nncn N N
62 61 adantl M N N
63 42 nncnd M N M gcd N
64 60 62 63 53 divassd M N M N M gcd N = M N M gcd N
65 58 64 breqtrrd M N M M N M gcd N
66 21 34 syl M N M gcd N M
67 dvdsval2 M gcd N M gcd N 0 M M gcd N M M M gcd N
68 52 53 4 67 syl3anc M N M gcd N M M M gcd N
69 66 68 mpbid M N M M gcd N
70 dvdsmul1 N M M gcd N N N M M gcd N
71 7 69 70 syl2anc M N N N M M gcd N
72 60 62 mulcomd M N M N = N M
73 72 oveq1d M N M N M gcd N = N M M gcd N
74 62 60 63 53 divassd M N N M M gcd N = N M M gcd N
75 73 74 eqtrd M N M N M gcd N = N M M gcd N
76 71 75 breqtrrd M N N M N M gcd N
77 65 76 jca M N M M N M gcd N N M N M gcd N
78 49 45 77 elrabd M N M N M gcd N x | M x N x
79 46 adantr M N n x | M x N x M N M gcd N
80 elrabi n x | M x N x n
81 80 nnred n x | M x N x n
82 81 adantl M N n x | M x N x n
83 breq2 x = n M x M n
84 breq2 x = n N x N n
85 83 84 anbi12d x = n M x N x M n N n
86 85 elrab n x | M x N x n M n N n
87 bezout M N x y M gcd N = M x + N y
88 21 87 syl M N x y M gcd N = M x + N y
89 88 adantr M N n M n N n x y M gcd N = M x + N y
90 nncn n n
91 90 ad2antlr M N n x y n
92 1 nncnd M N M N
93 92 ad2antrr M N n x y M N
94 63 ad2antrr M N n x y M gcd N
95 60 ad2antrr M N n x y M
96 61 ad3antlr M N n x y N
97 22 ad3antrrr M N n x y M 0
98 24 ad3antlr M N n x y N 0
99 95 96 97 98 mulne0d M N n x y M N 0
100 53 ad2antrr M N n x y M gcd N 0
101 91 93 94 99 100 divdiv2d M N n x y n M N M gcd N = n M gcd N M N
102 101 adantr M N n x y M gcd N = M x + N y n M N M gcd N = n M gcd N M N
103 oveq2 M gcd N = M x + N y n M gcd N = n M x + N y
104 103 oveq1d M gcd N = M x + N y n M gcd N M N = n M x + N y M N
105 zcn x x
106 105 ad2antrl M N n x y x
107 95 106 mulcld M N n x y M x
108 zcn y y
109 108 ad2antll M N n x y y
110 96 109 mulcld M N n x y N y
111 91 107 110 adddid M N n x y n M x + N y = n M x + n N y
112 111 oveq1d M N n x y n M x + N y M N = n M x + n N y M N
113 91 107 mulcld M N n x y n M x
114 91 110 mulcld M N n x y n N y
115 113 114 93 99 divdird M N n x y n M x + n N y M N = n M x M N + n N y M N
116 112 115 eqtrd M N n x y n M x + N y M N = n M x M N + n N y M N
117 104 116 sylan9eqr M N n x y M gcd N = M x + N y n M gcd N M N = n M x M N + n N y M N
118 91 95 106 mul12d M N n x y n M x = M n x
119 118 oveq1d M N n x y n M x M N = M n x M N
120 91 106 mulcld M N n x y n x
121 120 96 95 98 97 divcan5d M N n x y M n x M N = n x N
122 119 121 eqtrd M N n x y n M x M N = n x N
123 91 96 109 mul12d M N n x y n N y = N n y
124 123 oveq1d M N n x y n N y M N = N n y M N
125 72 ad2antrr M N n x y M N = N M
126 125 oveq2d M N n x y N n y M N = N n y N M
127 91 109 mulcld M N n x y n y
128 127 95 96 97 98 divcan5d M N n x y N n y N M = n y M
129 124 126 128 3eqtrd M N n x y n N y M N = n y M
130 122 129 oveq12d M N n x y n M x M N + n N y M N = n x N + n y M
131 130 adantr M N n x y M gcd N = M x + N y n M x M N + n N y M N = n x N + n y M
132 102 117 131 3eqtrd M N n x y M gcd N = M x + N y n M N M gcd N = n x N + n y M
133 132 ex M N n x y M gcd N = M x + N y n M N M gcd N = n x N + n y M
134 133 adantlrr M N n M n N n x y M gcd N = M x + N y n M N M gcd N = n x N + n y M
135 134 imp M N n M n N n x y M gcd N = M x + N y n M N M gcd N = n x N + n y M
136 6 ad3antlr M N n x y N
137 nnz n n
138 137 ad2antlr M N n x y n
139 simprl M N n x y x
140 dvdsmultr1 N n x N n N n x
141 136 138 139 140 syl3anc M N n x y N n N n x
142 138 139 zmulcld M N n x y n x
143 dvdsval2 N N 0 n x N n x n x N
144 136 98 142 143 syl3anc M N n x y N n x n x N
145 141 144 sylibd M N n x y N n n x N
146 145 adantld M N n x y M n N n n x N
147 146 3impia M N n x y M n N n n x N
148 3 ad3antrrr M N n x y M
149 simprr M N n x y y
150 dvdsmultr1 M n y M n M n y
151 148 138 149 150 syl3anc M N n x y M n M n y
152 138 149 zmulcld M N n x y n y
153 dvdsval2 M M 0 n y M n y n y M
154 148 97 152 153 syl3anc M N n x y M n y n y M
155 151 154 sylibd M N n x y M n n y M
156 155 adantrd M N n x y M n N n n y M
157 156 3impia M N n x y M n N n n y M
158 147 157 zaddcld M N n x y M n N n n x N + n y M
159 158 3expia M N n x y M n N n n x N + n y M
160 159 an32s M N x y n M n N n n x N + n y M
161 160 impr M N x y n M n N n n x N + n y M
162 161 an32s M N n M n N n x y n x N + n y M
163 162 adantr M N n M n N n x y M gcd N = M x + N y n x N + n y M
164 135 163 eqeltrd M N n M n N n x y M gcd N = M x + N y n M N M gcd N
165 45 nnzd M N M N M gcd N
166 165 ad2antrr M N n M n N n x y M N M gcd N
167 1 nnne0d M N M N 0
168 92 63 167 53 divne0d M N M N M gcd N 0
169 168 ad2antrr M N n M n N n x y M N M gcd N 0
170 138 adantlrr M N n M n N n x y n
171 dvdsval2 M N M gcd N M N M gcd N 0 n M N M gcd N n n M N M gcd N
172 166 169 170 171 syl3anc M N n M n N n x y M N M gcd N n n M N M gcd N
173 172 adantr M N n M n N n x y M gcd N = M x + N y M N M gcd N n n M N M gcd N
174 164 173 mpbird M N n M n N n x y M gcd N = M x + N y M N M gcd N n
175 174 ex M N n M n N n x y M gcd N = M x + N y M N M gcd N n
176 175 reximdvva M N n M n N n x y M gcd N = M x + N y x y M N M gcd N n
177 89 176 mpd M N n M n N n x y M N M gcd N n
178 1z 1
179 ne0i 1
180 r19.9rzv M N M gcd N n y M N M gcd N n
181 178 179 180 mp2b M N M gcd N n y M N M gcd N n
182 r19.9rzv y M N M gcd N n x y M N M gcd N n
183 178 179 182 mp2b y M N M gcd N n x y M N M gcd N n
184 181 183 bitri M N M gcd N n x y M N M gcd N n
185 177 184 sylibr M N n M n N n M N M gcd N n
186 165 adantr M N n M n N n M N M gcd N
187 simprl M N n M n N n n
188 dvdsle M N M gcd N n M N M gcd N n M N M gcd N n
189 186 187 188 syl2anc M N n M n N n M N M gcd N n M N M gcd N n
190 185 189 mpd M N n M n N n M N M gcd N n
191 86 190 sylan2b M N n x | M x N x M N M gcd N n
192 79 82 191 lensymd M N n x | M x N x ¬ n < M N M gcd N
193 32 46 78 192 infmin M N sup x | M x N x < = M N M gcd N
194 30 193 eqtr2d M N M N M gcd N = M lcm N
195 194 45 eqeltrrd M N M lcm N
196 195 nncnd M N M lcm N
197 92 196 63 53 divmul3d M N M N M gcd N = M lcm N M N = M lcm N M gcd N
198 194 197 mpbid M N M N = M lcm N M gcd N
199 20 198 eqtr2d M N M lcm N M gcd N = M N
200 simprl M N K M K N K K
201 eleq1 n = K n K
202 breq2 n = K M n M K
203 breq2 n = K N n N K
204 202 203 anbi12d n = K M n N n M K N K
205 201 204 anbi12d n = K n M n N n K M K N K
206 205 anbi2d n = K M N n M n N n M N K M K N K
207 breq2 n = K M lcm N n M lcm N K
208 206 207 imbi12d n = K M N n M n N n M lcm N n M N K M K N K M lcm N K
209 194 breq1d M N M N M gcd N n M lcm N n
210 209 adantr M N n M n N n M N M gcd N n M lcm N n
211 185 210 mpbid M N n M n N n M lcm N n
212 208 211 vtoclg K M N K M K N K M lcm N K
213 200 212 mpcom M N K M K N K M lcm N K
214 213 ex M N K M K N K M lcm N K
215 199 214 jca M N M lcm N M gcd N = M N K M K N K M lcm N K