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

Theorem gcdabs 12992
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 10246 . . 3  |-  ( M  e.  ZZ  ->  M  e.  RR )
2 zre 10246 . . 3  |-  ( N  e.  ZZ  ->  N  e.  RR )
3 absor 12064 . . . 4  |-  ( M  e.  RR  ->  (
( abs `  M
)  =  M  \/  ( abs `  M )  =  -u M ) )
4 absor 12064 . . . 4  |-  ( N  e.  RR  ->  (
( abs `  N
)  =  N  \/  ( abs `  N )  =  -u N ) )
53, 4anim12i 550 . . 3  |-  ( ( M  e.  RR  /\  N  e.  RR )  ->  ( ( ( abs `  M )  =  M  \/  ( abs `  M
)  =  -u M
)  /\  ( ( abs `  N )  =  N  \/  ( abs `  N )  =  -u N ) ) )
61, 2, 5syl2an 464 . 2  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( ( abs `  M )  =  M  \/  ( abs `  M
)  =  -u M
)  /\  ( ( abs `  N )  =  N  \/  ( abs `  N )  =  -u N ) ) )
7 oveq12 6053 . . . 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 6053 . . . . 5  |-  ( ( ( abs `  M
)  =  -u M  /\  ( abs `  N
)  =  N )  ->  ( ( abs `  M )  gcd  ( abs `  N ) )  =  ( -u M  gcd  N ) )
10 neggcd 12986 . . . . 5  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( -u M  gcd  N )  =  ( M  gcd  N ) )
119, 10sylan9eqr 2462 . . . 4  |-  ( ( ( M  e.  ZZ  /\  N  e.  ZZ )  /\  ( ( abs `  M )  =  -u M  /\  ( abs `  N
)  =  N ) )  ->  ( ( abs `  M )  gcd  ( abs `  N
) )  =  ( M  gcd  N ) )
1211ex 424 . . 3  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( ( abs `  M )  =  -u M  /\  ( abs `  N
)  =  N )  ->  ( ( abs `  M )  gcd  ( abs `  N ) )  =  ( M  gcd  N ) ) )
13 oveq12 6053 . . . . 5  |-  ( ( ( abs `  M
)  =  M  /\  ( abs `  N )  =  -u N )  -> 
( ( abs `  M
)  gcd  ( abs `  N ) )  =  ( M  gcd  -u N
) )
14 gcdneg 12985 . . . . 5  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( M  gcd  -u N
)  =  ( M  gcd  N ) )
1513, 14sylan9eqr 2462 . . . 4  |-  ( ( ( M  e.  ZZ  /\  N  e.  ZZ )  /\  ( ( abs `  M )  =  M  /\  ( abs `  N
)  =  -u N
) )  ->  (
( abs `  M
)  gcd  ( abs `  N ) )  =  ( M  gcd  N
) )
1615ex 424 . . 3  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( ( abs `  M )  =  M  /\  ( abs `  N
)  =  -u N
)  ->  ( ( abs `  M )  gcd  ( abs `  N
) )  =  ( M  gcd  N ) ) )
17 oveq12 6053 . . . . 5  |-  ( ( ( abs `  M
)  =  -u M  /\  ( abs `  N
)  =  -u N
)  ->  ( ( abs `  M )  gcd  ( abs `  N
) )  =  (
-u M  gcd  -u N
) )
18 znegcl 10273 . . . . . . 7  |-  ( M  e.  ZZ  ->  -u M  e.  ZZ )
19 gcdneg 12985 . . . . . . 7  |-  ( (
-u M  e.  ZZ  /\  N  e.  ZZ )  ->  ( -u M  gcd  -u N )  =  ( -u M  gcd  N ) )
2018, 19sylan 458 . . . . . 6  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( -u M  gcd  -u N )  =  (
-u M  gcd  N
) )
2120, 10eqtrd 2440 . . . . 5  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( -u M  gcd  -u N )  =  ( M  gcd  N ) )
2217, 21sylan9eqr 2462 . . . 4  |-  ( ( ( M  e.  ZZ  /\  N  e.  ZZ )  /\  ( ( abs `  M )  =  -u M  /\  ( abs `  N
)  =  -u N
) )  ->  (
( abs `  M
)  gcd  ( abs `  N ) )  =  ( M  gcd  N
) )
2322ex 424 . . 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 914 . 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 358    /\ wa 359    = wceq 1649    e. wcel 1721   ` cfv 5417  (class class class)co 6044   RRcr 8949   -ucneg 9252   ZZcz 10242   abscabs 11998    gcd cgcd 12965
This theorem is referenced by:  absmulgcd  13006  zgcdsq  13104  lgsne0  21074
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1552  ax-5 1563  ax-17 1623  ax-9 1662  ax-8 1683  ax-13 1723  ax-14 1725  ax-6 1740  ax-7 1745  ax-11 1757  ax-12 1946  ax-ext 2389  ax-sep 4294  ax-nul 4302  ax-pow 4341  ax-pr 4367  ax-un 4664  ax-cnex 9006  ax-resscn 9007  ax-1cn 9008  ax-icn 9009  ax-addcl 9010  ax-addrcl 9011  ax-mulcl 9012  ax-mulrcl 9013  ax-mulcom 9014  ax-addass 9015  ax-mulass 9016  ax-distr 9017  ax-i2m1 9018  ax-1ne0 9019  ax-1rid 9020  ax-rnegex 9021  ax-rrecex 9022  ax-cnre 9023  ax-pre-lttri 9024  ax-pre-lttrn 9025  ax-pre-ltadd 9026  ax-pre-mulgt0 9027  ax-pre-sup 9028
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1325  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2262  df-mo 2263  df-clab 2395  df-cleq 2401  df-clel 2404  df-nfc 2533  df-ne 2573  df-nel 2574  df-ral 2675  df-rex 2676  df-reu 2677  df-rmo 2678  df-rab 2679  df-v 2922  df-sbc 3126  df-csb 3216  df-dif 3287  df-un 3289  df-in 3291  df-ss 3298  df-pss 3300  df-nul 3593  df-if 3704  df-pw 3765  df-sn 3784  df-pr 3785  df-tp 3786  df-op 3787  df-uni 3980  df-iun 4059  df-br 4177  df-opab 4231  df-mpt 4232  df-tr 4267  df-eprel 4458  df-id 4462  df-po 4467  df-so 4468  df-fr 4505  df-we 4507  df-ord 4548  df-on 4549  df-lim 4550  df-suc 4551  df-om 4809  df-xp 4847  df-rel 4848  df-cnv 4849  df-co 4850  df-dm 4851  df-rn 4852  df-res 4853  df-ima 4854  df-iota 5381  df-fun 5419  df-fn 5420  df-f 5421  df-f1 5422  df-fo 5423  df-f1o 5424  df-fv 5425  df-ov 6047  df-oprab 6048  df-mpt2 6049  df-2nd 6313  df-riota 6512  df-recs 6596  df-rdg 6631  df-er 6868  df-en 7073  df-dom 7074  df-sdom 7075  df-sup 7408  df-pnf 9082  df-mnf 9083  df-xr 9084  df-ltxr 9085  df-le 9086  df-sub 9253  df-neg 9254  df-div 9638  df-nn 9961  df-2 10018  df-3 10019  df-n0 10182  df-z 10243  df-uz 10449  df-rp 10573  df-seq 11283  df-exp 11342  df-cj 11863  df-re 11864  df-im 11865  df-sqr 11999  df-abs 12000  df-dvds 12812  df-gcd 12966
  Copyright terms: Public domain W3C validator