Metamath Proof Explorer


Theorem lcmgcd

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 valueis the least common multiple of two coprime numbers, for which ( M gcd N ) = 1 .

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

Ref Expression
Assertion lcmgcd MNMlcmNMgcdN= M N

Proof

Step Hyp Ref Expression
1 gcdcl MNMgcdN0
2 1 nn0cnd MNMgcdN
3 2 mul02d MN0MgcdN=0
4 0z 0
5 lcmcom N0Nlcm0=0lcmN
6 4 5 mpan2 NNlcm0=0lcmN
7 lcm0val NNlcm0=0
8 6 7 eqtr3d N0lcmN=0
9 8 adantl MN0lcmN=0
10 9 oveq1d MN0lcmNMgcdN=0MgcdN
11 zcn NN
12 11 adantl MNN
13 12 mul02d MN0 N=0
14 13 abs00bd MN0 N=0
15 3 10 14 3eqtr4d MN0lcmNMgcdN=0 N
16 15 adantr MNM=00lcmNMgcdN=0 N
17 simpr MNM=0M=0
18 17 oveq1d MNM=0MlcmN=0lcmN
19 18 oveq1d MNM=0MlcmNMgcdN=0lcmNMgcdN
20 17 oveq1d MNM=0 M N=0 N
21 20 fveq2d MNM=0 M N=0 N
22 16 19 21 3eqtr4d MNM=0MlcmNMgcdN= M N
23 lcm0val MMlcm0=0
24 23 adantr MNMlcm0=0
25 24 oveq1d MNMlcm0MgcdN=0MgcdN
26 zcn MM
27 26 adantr MNM
28 27 mul01d MN M0=0
29 28 abs00bd MN M0=0
30 3 25 29 3eqtr4d MNMlcm0MgcdN= M0
31 30 adantr MNN=0Mlcm0MgcdN= M0
32 simpr MNN=0N=0
33 32 oveq2d MNN=0MlcmN=Mlcm0
34 33 oveq1d MNN=0MlcmNMgcdN=Mlcm0MgcdN
35 32 oveq2d MNN=0 M N= M0
36 35 fveq2d MNN=0 M N= M0
37 31 34 36 3eqtr4d MNN=0MlcmNMgcdN= M N
38 22 37 jaodan MNM=0N=0MlcmNMgcdN= M N
39 neanior M0N0¬M=0N=0
40 nnabscl MM0M
41 nnabscl NN0N
42 40 41 anim12i MM0NN0MN
43 42 an4s MNM0N0MN
44 39 43 sylan2br MN¬M=0N=0MN
45 lcmgcdlem MNMlcmNMgcdN=MN0M0N0MlcmN0
46 45 simpld MNMlcmNMgcdN=MN
47 44 46 syl MN¬M=0N=0MlcmNMgcdN=MN
48 lcmabs MNMlcmN=MlcmN
49 gcdabs MNMgcdN=MgcdN
50 48 49 oveq12d MNMlcmNMgcdN=MlcmNMgcdN
51 50 adantr MN¬M=0N=0MlcmNMgcdN=MlcmNMgcdN
52 absidm MM=M
53 absidm NN=N
54 52 53 oveqan12d MNMN=MN
55 26 11 54 syl2an MNMN=MN
56 nn0abscl MM0
57 56 nn0cnd MM
58 57 adantr MNM
59 nn0abscl NN0
60 59 nn0cnd NN
61 60 adantl MNN
62 58 61 absmuld MNMN=MN
63 27 12 absmuld MN M N=MN
64 55 62 63 3eqtr4d MNMN= M N
65 64 adantr MN¬M=0N=0MN= M N
66 47 51 65 3eqtr3d MN¬M=0N=0MlcmNMgcdN= M N
67 38 66 pm2.61dan MNMlcmNMgcdN= M N