MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  gcdabs Structured version   Unicode version

Theorem gcdabs 13064
Description: The gcd of two integers is the same as that of their absolute values. (Contributed by Paul Chapman, 31-Mar-2011.)
Assertion
Ref Expression
gcdabs  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( abs `  M
)  gcd  ( abs `  N ) )  =  ( M  gcd  N
) )

Proof of Theorem gcdabs
StepHypRef Expression
1 zre 10317 . . 3  |-  ( M  e.  ZZ  ->  M  e.  RR )
2 zre 10317 . . 3  |-  ( N  e.  ZZ  ->  N  e.  RR )
3 absor 12136 . . . 4  |-  ( M  e.  RR  ->  (
( abs `  M
)  =  M  \/  ( abs `  M )  =  -u M ) )
4 absor 12136 . . . 4  |-  ( N  e.  RR  ->  (
( abs `  N
)  =  N  \/  ( abs `  N )  =  -u N ) )
53, 4anim12i 551 . . 3  |-  ( ( M  e.  RR  /\  N  e.  RR )  ->  ( ( ( abs `  M )  =  M  \/  ( abs `  M
)  =  -u M
)  /\  ( ( abs `  N )  =  N  \/  ( abs `  N )  =  -u N ) ) )
61, 2, 5syl2an 465 . 2  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( ( abs `  M )  =  M  \/  ( abs `  M
)  =  -u M
)  /\  ( ( abs `  N )  =  N  \/  ( abs `  N )  =  -u N ) ) )
7 oveq12 6119 . . . 4  |-  ( ( ( abs `  M
)  =  M  /\  ( abs `  N )  =  N )  -> 
( ( abs `  M
)  gcd  ( abs `  N ) )  =  ( M  gcd  N
) )
87a1i 11 . . 3  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( ( abs `  M )  =  M  /\  ( abs `  N
)  =  N )  ->  ( ( abs `  M )  gcd  ( abs `  N ) )  =  ( M  gcd  N ) ) )
9 oveq12 6119 . . . . 5  |-  ( ( ( abs `  M
)  =  -u M  /\  ( abs `  N
)  =  N )  ->  ( ( abs `  M )  gcd  ( abs `  N ) )  =  ( -u M  gcd  N ) )
10 neggcd 13058 . . . . 5  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( -u M  gcd  N )  =  ( M  gcd  N ) )
119, 10sylan9eqr 2496 . . . 4  |-  ( ( ( M  e.  ZZ  /\  N  e.  ZZ )  /\  ( ( abs `  M )  =  -u M  /\  ( abs `  N
)  =  N ) )  ->  ( ( abs `  M )  gcd  ( abs `  N
) )  =  ( M  gcd  N ) )
1211ex 425 . . 3  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( ( abs `  M )  =  -u M  /\  ( abs `  N
)  =  N )  ->  ( ( abs `  M )  gcd  ( abs `  N ) )  =  ( M  gcd  N ) ) )
13 oveq12 6119 . . . . 5  |-  ( ( ( abs `  M
)  =  M  /\  ( abs `  N )  =  -u N )  -> 
( ( abs `  M
)  gcd  ( abs `  N ) )  =  ( M  gcd  -u N
) )
14 gcdneg 13057 . . . . 5  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( M  gcd  -u N
)  =  ( M  gcd  N ) )
1513, 14sylan9eqr 2496 . . . 4  |-  ( ( ( M  e.  ZZ  /\  N  e.  ZZ )  /\  ( ( abs `  M )  =  M  /\  ( abs `  N
)  =  -u N
) )  ->  (
( abs `  M
)  gcd  ( abs `  N ) )  =  ( M  gcd  N
) )
1615ex 425 . . 3  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( ( abs `  M )  =  M  /\  ( abs `  N
)  =  -u N
)  ->  ( ( abs `  M )  gcd  ( abs `  N
) )  =  ( M  gcd  N ) ) )
17 oveq12 6119 . . . . 5  |-  ( ( ( abs `  M
)  =  -u M  /\  ( abs `  N
)  =  -u N
)  ->  ( ( abs `  M )  gcd  ( abs `  N
) )  =  (
-u M  gcd  -u N
) )
18 znegcl 10344 . . . . . . 7  |-  ( M  e.  ZZ  ->  -u M  e.  ZZ )
19 gcdneg 13057 . . . . . . 7  |-  ( (
-u M  e.  ZZ  /\  N  e.  ZZ )  ->  ( -u M  gcd  -u N )  =  ( -u M  gcd  N ) )
2018, 19sylan 459 . . . . . 6  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( -u M  gcd  -u N )  =  (
-u M  gcd  N
) )
2120, 10eqtrd 2474 . . . . 5  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( -u M  gcd  -u N )  =  ( M  gcd  N ) )
2217, 21sylan9eqr 2496 . . . 4  |-  ( ( ( M  e.  ZZ  /\  N  e.  ZZ )  /\  ( ( abs `  M )  =  -u M  /\  ( abs `  N
)  =  -u N
) )  ->  (
( abs `  M
)  gcd  ( abs `  N ) )  =  ( M  gcd  N
) )
2322ex 425 . . 3  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( ( abs `  M )  =  -u M  /\  ( abs `  N
)  =  -u N
)  ->  ( ( abs `  M )  gcd  ( abs `  N
) )  =  ( M  gcd  N ) ) )
248, 12, 16, 23ccased 915 . 2  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( ( ( abs `  M )  =  M  \/  ( abs `  M )  = 
-u M )  /\  ( ( abs `  N
)  =  N  \/  ( abs `  N )  =  -u N ) )  ->  ( ( abs `  M )  gcd  ( abs `  N ) )  =  ( M  gcd  N ) ) )
256, 24mpd 15 1  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( abs `  M
)  gcd  ( abs `  N ) )  =  ( M  gcd  N
) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    \/ wo 359    /\ wa 360    = wceq 1653    e. wcel 1727   ` cfv 5483  (class class class)co 6110   RRcr 9020   -ucneg 9323   ZZcz 10313   abscabs 12070    gcd cgcd 13037
This theorem is referenced by:  absmulgcd  13078  zgcdsq  13176  lgsne0  21148
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1556  ax-5 1567  ax-17 1627  ax-9 1668  ax-8 1689  ax-13 1729  ax-14 1731  ax-6 1746  ax-7 1751  ax-11 1763  ax-12 1953  ax-ext 2423  ax-sep 4355  ax-nul 4363  ax-pow 4406  ax-pr 4432  ax-un 4730  ax-cnex 9077  ax-resscn 9078  ax-1cn 9079  ax-icn 9080  ax-addcl 9081  ax-addrcl 9082  ax-mulcl 9083  ax-mulrcl 9084  ax-mulcom 9085  ax-addass 9086  ax-mulass 9087  ax-distr 9088  ax-i2m1 9089  ax-1ne0 9090  ax-1rid 9091  ax-rnegex 9092  ax-rrecex 9093  ax-cnre 9094  ax-pre-lttri 9095  ax-pre-lttrn 9096  ax-pre-ltadd 9097  ax-pre-mulgt0 9098  ax-pre-sup 9099
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 938  df-3an 939  df-tru 1329  df-ex 1552  df-nf 1555  df-sb 1660  df-eu 2291  df-mo 2292  df-clab 2429  df-cleq 2435  df-clel 2438  df-nfc 2567  df-ne 2607  df-nel 2608  df-ral 2716  df-rex 2717  df-reu 2718  df-rmo 2719  df-rab 2720  df-v 2964  df-sbc 3168  df-csb 3268  df-dif 3309  df-un 3311  df-in 3313  df-ss 3320  df-pss 3322  df-nul 3614  df-if 3764  df-pw 3825  df-sn 3844  df-pr 3845  df-tp 3846  df-op 3847  df-uni 4040  df-iun 4119  df-br 4238  df-opab 4292  df-mpt 4293  df-tr 4328  df-eprel 4523  df-id 4527  df-po 4532  df-so 4533  df-fr 4570  df-we 4572  df-ord 4613  df-on 4614  df-lim 4615  df-suc 4616  df-om 4875  df-xp 4913  df-rel 4914  df-cnv 4915  df-co 4916  df-dm 4917  df-rn 4918  df-res 4919  df-ima 4920  df-iota 5447  df-fun 5485  df-fn 5486  df-f 5487  df-f1 5488  df-fo 5489  df-f1o 5490  df-fv 5491  df-ov 6113  df-oprab 6114  df-mpt2 6115  df-2nd 6379  df-riota 6578  df-recs 6662  df-rdg 6697  df-er 6934  df-en 7139  df-dom 7140  df-sdom 7141  df-sup 7475  df-pnf 9153  df-mnf 9154  df-xr 9155  df-ltxr 9156  df-le 9157  df-sub 9324  df-neg 9325  df-div 9709  df-nn 10032  df-2 10089  df-3 10090  df-n0 10253  df-z 10314  df-uz 10520  df-rp 10644  df-seq 11355  df-exp 11414  df-cj 11935  df-re 11936  df-im 11937  df-sqr 12071  df-abs 12072  df-dvds 12884  df-gcd 13038
  Copyright terms: Public domain W3C validator