MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  lcmgcd Structured version   Visualization version   GIF version

Theorem lcmgcd 15951
Description: The product of two numbers' least common multiple and greatest common divisor is the absolute value of the product of the two numbers. In particular, that absolute value is the least common multiple of two coprime numbers, for which (𝑀 gcd 𝑁) = 1.

Multiple methods exist for proving this, and it is often proven either as a consequence of the fundamental theorem of arithmetic 1arith 16263 or of Bézout's identity bezout 15891; see e.g., https://proofwiki.org/wiki/Product_of_GCD_and_LCM 15891 and https://math.stackexchange.com/a/470827 15891. This proof uses the latter to first confirm it for positive integers 𝑀 and 𝑁 (the "Second Proof" in the above Stack Exchange page), then shows that implies it for all nonzero integer inputs, then finally uses lcm0val 15938 to show it applies when either or both inputs are zero. (Contributed by Steve Rodriguez, 20-Jan-2020.)

Assertion
Ref Expression
lcmgcd ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 lcm 𝑁) · (𝑀 gcd 𝑁)) = (abs‘(𝑀 · 𝑁)))

Proof of Theorem lcmgcd
StepHypRef Expression
1 gcdcl 15855 . . . . . . . 8 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈ ℕ0)
21nn0cnd 11958 . . . . . . 7 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈ ℂ)
32mul02d 10838 . . . . . 6 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (0 · (𝑀 gcd 𝑁)) = 0)
4 0z 11993 . . . . . . . . . 10 0 ∈ ℤ
5 lcmcom 15937 . . . . . . . . . 10 ((𝑁 ∈ ℤ ∧ 0 ∈ ℤ) → (𝑁 lcm 0) = (0 lcm 𝑁))
64, 5mpan2 689 . . . . . . . . 9 (𝑁 ∈ ℤ → (𝑁 lcm 0) = (0 lcm 𝑁))
7 lcm0val 15938 . . . . . . . . 9 (𝑁 ∈ ℤ → (𝑁 lcm 0) = 0)
86, 7eqtr3d 2858 . . . . . . . 8 (𝑁 ∈ ℤ → (0 lcm 𝑁) = 0)
98adantl 484 . . . . . . 7 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (0 lcm 𝑁) = 0)
109oveq1d 7171 . . . . . 6 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((0 lcm 𝑁) · (𝑀 gcd 𝑁)) = (0 · (𝑀 gcd 𝑁)))
11 zcn 11987 . . . . . . . . 9 (𝑁 ∈ ℤ → 𝑁 ∈ ℂ)
1211adantl 484 . . . . . . . 8 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → 𝑁 ∈ ℂ)
1312mul02d 10838 . . . . . . 7 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (0 · 𝑁) = 0)
1413abs00bd 14651 . . . . . 6 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (abs‘(0 · 𝑁)) = 0)
153, 10, 143eqtr4d 2866 . . . . 5 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((0 lcm 𝑁) · (𝑀 gcd 𝑁)) = (abs‘(0 · 𝑁)))
1615adantr 483 . . . 4 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑀 = 0) → ((0 lcm 𝑁) · (𝑀 gcd 𝑁)) = (abs‘(0 · 𝑁)))
17 simpr 487 . . . . . 6 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑀 = 0) → 𝑀 = 0)
1817oveq1d 7171 . . . . 5 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑀 = 0) → (𝑀 lcm 𝑁) = (0 lcm 𝑁))
1918oveq1d 7171 . . . 4 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑀 = 0) → ((𝑀 lcm 𝑁) · (𝑀 gcd 𝑁)) = ((0 lcm 𝑁) · (𝑀 gcd 𝑁)))
2017oveq1d 7171 . . . . 5 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑀 = 0) → (𝑀 · 𝑁) = (0 · 𝑁))
2120fveq2d 6674 . . . 4 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑀 = 0) → (abs‘(𝑀 · 𝑁)) = (abs‘(0 · 𝑁)))
2216, 19, 213eqtr4d 2866 . . 3 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑀 = 0) → ((𝑀 lcm 𝑁) · (𝑀 gcd 𝑁)) = (abs‘(𝑀 · 𝑁)))
23 lcm0val 15938 . . . . . . . 8 (𝑀 ∈ ℤ → (𝑀 lcm 0) = 0)
2423adantr 483 . . . . . . 7 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 lcm 0) = 0)
2524oveq1d 7171 . . . . . 6 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 lcm 0) · (𝑀 gcd 𝑁)) = (0 · (𝑀 gcd 𝑁)))
26 zcn 11987 . . . . . . . . 9 (𝑀 ∈ ℤ → 𝑀 ∈ ℂ)
2726adantr 483 . . . . . . . 8 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → 𝑀 ∈ ℂ)
2827mul01d 10839 . . . . . . 7 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 · 0) = 0)
2928abs00bd 14651 . . . . . 6 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (abs‘(𝑀 · 0)) = 0)
303, 25, 293eqtr4d 2866 . . . . 5 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 lcm 0) · (𝑀 gcd 𝑁)) = (abs‘(𝑀 · 0)))
3130adantr 483 . . . 4 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑁 = 0) → ((𝑀 lcm 0) · (𝑀 gcd 𝑁)) = (abs‘(𝑀 · 0)))
32 simpr 487 . . . . . 6 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑁 = 0) → 𝑁 = 0)
3332oveq2d 7172 . . . . 5 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑁 = 0) → (𝑀 lcm 𝑁) = (𝑀 lcm 0))
3433oveq1d 7171 . . . 4 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑁 = 0) → ((𝑀 lcm 𝑁) · (𝑀 gcd 𝑁)) = ((𝑀 lcm 0) · (𝑀 gcd 𝑁)))
3532oveq2d 7172 . . . . 5 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑁 = 0) → (𝑀 · 𝑁) = (𝑀 · 0))
3635fveq2d 6674 . . . 4 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑁 = 0) → (abs‘(𝑀 · 𝑁)) = (abs‘(𝑀 · 0)))
3731, 34, 363eqtr4d 2866 . . 3 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ 𝑁 = 0) → ((𝑀 lcm 𝑁) · (𝑀 gcd 𝑁)) = (abs‘(𝑀 · 𝑁)))
3822, 37jaodan 954 . 2 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∨ 𝑁 = 0)) → ((𝑀 lcm 𝑁) · (𝑀 gcd 𝑁)) = (abs‘(𝑀 · 𝑁)))
39 neanior 3109 . . . . 5 ((𝑀 ≠ 0 ∧ 𝑁 ≠ 0) ↔ ¬ (𝑀 = 0 ∨ 𝑁 = 0))
40 nnabscl 14685 . . . . . . 7 ((𝑀 ∈ ℤ ∧ 𝑀 ≠ 0) → (abs‘𝑀) ∈ ℕ)
41 nnabscl 14685 . . . . . . 7 ((𝑁 ∈ ℤ ∧ 𝑁 ≠ 0) → (abs‘𝑁) ∈ ℕ)
4240, 41anim12i 614 . . . . . 6 (((𝑀 ∈ ℤ ∧ 𝑀 ≠ 0) ∧ (𝑁 ∈ ℤ ∧ 𝑁 ≠ 0)) → ((abs‘𝑀) ∈ ℕ ∧ (abs‘𝑁) ∈ ℕ))
4342an4s 658 . . . . 5 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 ≠ 0 ∧ 𝑁 ≠ 0)) → ((abs‘𝑀) ∈ ℕ ∧ (abs‘𝑁) ∈ ℕ))
4439, 43sylan2br 596 . . . 4 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∨ 𝑁 = 0)) → ((abs‘𝑀) ∈ ℕ ∧ (abs‘𝑁) ∈ ℕ))
45 lcmgcdlem 15950 . . . . 5 (((abs‘𝑀) ∈ ℕ ∧ (abs‘𝑁) ∈ ℕ) → ((((abs‘𝑀) lcm (abs‘𝑁)) · ((abs‘𝑀) gcd (abs‘𝑁))) = (abs‘((abs‘𝑀) · (abs‘𝑁))) ∧ ((0 ∈ ℕ ∧ ((abs‘𝑀) ∥ 0 ∧ (abs‘𝑁) ∥ 0)) → ((abs‘𝑀) lcm (abs‘𝑁)) ∥ 0)))
4645simpld 497 . . . 4 (((abs‘𝑀) ∈ ℕ ∧ (abs‘𝑁) ∈ ℕ) → (((abs‘𝑀) lcm (abs‘𝑁)) · ((abs‘𝑀) gcd (abs‘𝑁))) = (abs‘((abs‘𝑀) · (abs‘𝑁))))
4744, 46syl 17 . . 3 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∨ 𝑁 = 0)) → (((abs‘𝑀) lcm (abs‘𝑁)) · ((abs‘𝑀) gcd (abs‘𝑁))) = (abs‘((abs‘𝑀) · (abs‘𝑁))))
48 lcmabs 15949 . . . . 5 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((abs‘𝑀) lcm (abs‘𝑁)) = (𝑀 lcm 𝑁))
49 gcdabs 15877 . . . . 5 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((abs‘𝑀) gcd (abs‘𝑁)) = (𝑀 gcd 𝑁))
5048, 49oveq12d 7174 . . . 4 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((abs‘𝑀) lcm (abs‘𝑁)) · ((abs‘𝑀) gcd (abs‘𝑁))) = ((𝑀 lcm 𝑁) · (𝑀 gcd 𝑁)))
5150adantr 483 . . 3 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∨ 𝑁 = 0)) → (((abs‘𝑀) lcm (abs‘𝑁)) · ((abs‘𝑀) gcd (abs‘𝑁))) = ((𝑀 lcm 𝑁) · (𝑀 gcd 𝑁)))
52 absidm 14683 . . . . . . 7 (𝑀 ∈ ℂ → (abs‘(abs‘𝑀)) = (abs‘𝑀))
53 absidm 14683 . . . . . . 7 (𝑁 ∈ ℂ → (abs‘(abs‘𝑁)) = (abs‘𝑁))
5452, 53oveqan12d 7175 . . . . . 6 ((𝑀 ∈ ℂ ∧ 𝑁 ∈ ℂ) → ((abs‘(abs‘𝑀)) · (abs‘(abs‘𝑁))) = ((abs‘𝑀) · (abs‘𝑁)))
5526, 11, 54syl2an 597 . . . . 5 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((abs‘(abs‘𝑀)) · (abs‘(abs‘𝑁))) = ((abs‘𝑀) · (abs‘𝑁)))
56 nn0abscl 14672 . . . . . . . 8 (𝑀 ∈ ℤ → (abs‘𝑀) ∈ ℕ0)
5756nn0cnd 11958 . . . . . . 7 (𝑀 ∈ ℤ → (abs‘𝑀) ∈ ℂ)
5857adantr 483 . . . . . 6 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (abs‘𝑀) ∈ ℂ)
59 nn0abscl 14672 . . . . . . . 8 (𝑁 ∈ ℤ → (abs‘𝑁) ∈ ℕ0)
6059nn0cnd 11958 . . . . . . 7 (𝑁 ∈ ℤ → (abs‘𝑁) ∈ ℂ)
6160adantl 484 . . . . . 6 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (abs‘𝑁) ∈ ℂ)
6258, 61absmuld 14814 . . . . 5 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (abs‘((abs‘𝑀) · (abs‘𝑁))) = ((abs‘(abs‘𝑀)) · (abs‘(abs‘𝑁))))
6327, 12absmuld 14814 . . . . 5 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (abs‘(𝑀 · 𝑁)) = ((abs‘𝑀) · (abs‘𝑁)))
6455, 62, 633eqtr4d 2866 . . . 4 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (abs‘((abs‘𝑀) · (abs‘𝑁))) = (abs‘(𝑀 · 𝑁)))
6564adantr 483 . . 3 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∨ 𝑁 = 0)) → (abs‘((abs‘𝑀) · (abs‘𝑁))) = (abs‘(𝑀 · 𝑁)))
6647, 51, 653eqtr3d 2864 . 2 (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∨ 𝑁 = 0)) → ((𝑀 lcm 𝑁) · (𝑀 gcd 𝑁)) = (abs‘(𝑀 · 𝑁)))
6738, 66pm2.61dan 811 1 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 lcm 𝑁) · (𝑀 gcd 𝑁)) = (abs‘(𝑀 · 𝑁)))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wa 398  wo 843   = wceq 1537  wcel 2114  wne 3016   class class class wbr 5066  cfv 6355  (class class class)co 7156  cc 10535  0cc0 10537   · cmul 10542  cn 11638  cz 11982  abscabs 14593  cdvds 15607   gcd cgcd 15843   lcm clcm 15932
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1796  ax-4 1810  ax-5 1911  ax-6 1970  ax-7 2015  ax-8 2116  ax-9 2124  ax-10 2145  ax-11 2161  ax-12 2177  ax-ext 2793  ax-sep 5203  ax-nul 5210  ax-pow 5266  ax-pr 5330  ax-un 7461  ax-cnex 10593  ax-resscn 10594  ax-1cn 10595  ax-icn 10596  ax-addcl 10597  ax-addrcl 10598  ax-mulcl 10599  ax-mulrcl 10600  ax-mulcom 10601  ax-addass 10602  ax-mulass 10603  ax-distr 10604  ax-i2m1 10605  ax-1ne0 10606  ax-1rid 10607  ax-rnegex 10608  ax-rrecex 10609  ax-cnre 10610  ax-pre-lttri 10611  ax-pre-lttrn 10612  ax-pre-ltadd 10613  ax-pre-mulgt0 10614  ax-pre-sup 10615
This theorem depends on definitions:  df-bi 209  df-an 399  df-or 844  df-3or 1084  df-3an 1085  df-tru 1540  df-ex 1781  df-nf 1785  df-sb 2070  df-mo 2622  df-eu 2654  df-clab 2800  df-cleq 2814  df-clel 2893  df-nfc 2963  df-ne 3017  df-nel 3124  df-ral 3143  df-rex 3144  df-reu 3145  df-rmo 3146  df-rab 3147  df-v 3496  df-sbc 3773  df-csb 3884  df-dif 3939  df-un 3941  df-in 3943  df-ss 3952  df-pss 3954  df-nul 4292  df-if 4468  df-pw 4541  df-sn 4568  df-pr 4570  df-tp 4572  df-op 4574  df-uni 4839  df-iun 4921  df-br 5067  df-opab 5129  df-mpt 5147  df-tr 5173  df-id 5460  df-eprel 5465  df-po 5474  df-so 5475  df-fr 5514  df-we 5516  df-xp 5561  df-rel 5562  df-cnv 5563  df-co 5564  df-dm 5565  df-rn 5566  df-res 5567  df-ima 5568  df-pred 6148  df-ord 6194  df-on 6195  df-lim 6196  df-suc 6197  df-iota 6314  df-fun 6357  df-fn 6358  df-f 6359  df-f1 6360  df-fo 6361  df-f1o 6362  df-fv 6363  df-riota 7114  df-ov 7159  df-oprab 7160  df-mpo 7161  df-om 7581  df-2nd 7690  df-wrecs 7947  df-recs 8008  df-rdg 8046  df-er 8289  df-en 8510  df-dom 8511  df-sdom 8512  df-sup 8906  df-inf 8907  df-pnf 10677  df-mnf 10678  df-xr 10679  df-ltxr 10680  df-le 10681  df-sub 10872  df-neg 10873  df-div 11298  df-nn 11639  df-2 11701  df-3 11702  df-n0 11899  df-z 11983  df-uz 12245  df-rp 12391  df-fl 13163  df-mod 13239  df-seq 13371  df-exp 13431  df-cj 14458  df-re 14459  df-im 14460  df-sqrt 14594  df-abs 14595  df-dvds 15608  df-gcd 15844  df-lcm 15934
This theorem is referenced by:  lcmid  15953  lcm1  15954  lcmgcdnn  15955  nzprmdif  40671
  Copyright terms: Public domain W3C validator