ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  gcdass Unicode version

Theorem gcdass 10629
Description: Associative law for  gcd operator. Theorem 1.4(b) in [ApostolNT] p. 16. (Contributed by Scott Fenton, 2-Apr-2014.) (Revised by Mario Carneiro, 19-Apr-2014.)
Assertion
Ref Expression
gcdass  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  (
( N  gcd  M
)  gcd  P )  =  ( N  gcd  ( M  gcd  P ) ) )

Proof of Theorem gcdass
Dummy variable  x is distinct from all other variables.
StepHypRef Expression
1 anass 393 . . 3  |-  ( ( ( N  =  0  /\  M  =  0 )  /\  P  =  0 )  <->  ( N  =  0  /\  ( M  =  0  /\  P  =  0 ) ) )
2 anass 393 . . . . . 6  |-  ( ( ( x  ||  N  /\  x  ||  M )  /\  x  ||  P
)  <->  ( x  ||  N  /\  ( x  ||  M  /\  x  ||  P
) ) )
32a1i 9 . . . . 5  |-  ( x  e.  ZZ  ->  (
( ( x  ||  N  /\  x  ||  M
)  /\  x  ||  P
)  <->  ( x  ||  N  /\  ( x  ||  M  /\  x  ||  P
) ) ) )
43rabbiia 2596 . . . 4  |-  { x  e.  ZZ  |  ( ( x  ||  N  /\  x  ||  M )  /\  x  ||  P ) }  =  { x  e.  ZZ  |  ( x 
||  N  /\  (
x  ||  M  /\  x  ||  P ) ) }
54supeq1i 6496 . . 3  |-  sup ( { x  e.  ZZ  |  ( ( x 
||  N  /\  x  ||  M )  /\  x  ||  P ) } ,  RR ,  <  )  =  sup ( { x  e.  ZZ  |  ( x 
||  N  /\  (
x  ||  M  /\  x  ||  P ) ) } ,  RR ,  <  )
61, 5ifbieq2i 3389 . 2  |-  if ( ( ( N  =  0  /\  M  =  0 )  /\  P  =  0 ) ,  0 ,  sup ( { x  e.  ZZ  |  ( ( x 
||  N  /\  x  ||  M )  /\  x  ||  P ) } ,  RR ,  <  ) )  =  if ( ( N  =  0  /\  ( M  =  0  /\  P  =  0 ) ) ,  0 ,  sup ( { x  e.  ZZ  | 
( x  ||  N  /\  ( x  ||  M  /\  x  ||  P ) ) } ,  RR ,  <  ) )
7 gcdcl 10583 . . . . . 6  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ )  ->  ( N  gcd  M
)  e.  NN0 )
873adant3 959 . . . . 5  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  ( N  gcd  M )  e. 
NN0 )
98nn0zd 8618 . . . 4  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  ( N  gcd  M )  e.  ZZ )
10 simp3 941 . . . 4  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  P  e.  ZZ )
11 gcdval 10576 . . . 4  |-  ( ( ( N  gcd  M
)  e.  ZZ  /\  P  e.  ZZ )  ->  ( ( N  gcd  M )  gcd  P )  =  if ( ( ( N  gcd  M
)  =  0  /\  P  =  0 ) ,  0 ,  sup ( { x  e.  ZZ  |  ( x  ||  ( N  gcd  M )  /\  x  ||  P
) } ,  RR ,  <  ) ) )
129, 10, 11syl2anc 403 . . 3  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  (
( N  gcd  M
)  gcd  P )  =  if ( ( ( N  gcd  M )  =  0  /\  P  =  0 ) ,  0 ,  sup ( { x  e.  ZZ  |  ( x  ||  ( N  gcd  M )  /\  x  ||  P
) } ,  RR ,  <  ) ) )
13 gcdeq0 10593 . . . . . . 7  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ )  ->  ( ( N  gcd  M )  =  0  <->  ( N  =  0  /\  M  =  0 ) ) )
14133adant3 959 . . . . . 6  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  (
( N  gcd  M
)  =  0  <->  ( N  =  0  /\  M  =  0 ) ) )
1514anbi1d 453 . . . . 5  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  (
( ( N  gcd  M )  =  0  /\  P  =  0 )  <-> 
( ( N  =  0  /\  M  =  0 )  /\  P  =  0 ) ) )
1615bicomd 139 . . . 4  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  (
( ( N  =  0  /\  M  =  0 )  /\  P  =  0 )  <->  ( ( N  gcd  M )  =  0  /\  P  =  0 ) ) )
17 simpr 108 . . . . . . . 8  |-  ( ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  /\  x  e.  ZZ )  ->  x  e.  ZZ )
18 simpl1 942 . . . . . . . 8  |-  ( ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  /\  x  e.  ZZ )  ->  N  e.  ZZ )
19 simpl2 943 . . . . . . . 8  |-  ( ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  /\  x  e.  ZZ )  ->  M  e.  ZZ )
20 dvdsgcdb 10627 . . . . . . . 8  |-  ( ( x  e.  ZZ  /\  N  e.  ZZ  /\  M  e.  ZZ )  ->  (
( x  ||  N  /\  x  ||  M )  <-> 
x  ||  ( N  gcd  M ) ) )
2117, 18, 19, 20syl3anc 1170 . . . . . . 7  |-  ( ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  /\  x  e.  ZZ )  ->  ( ( x 
||  N  /\  x  ||  M )  <->  x  ||  ( N  gcd  M ) ) )
2221anbi1d 453 . . . . . 6  |-  ( ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  /\  x  e.  ZZ )  ->  ( ( ( x  ||  N  /\  x  ||  M )  /\  x  ||  P )  <->  ( x  ||  ( N  gcd  M
)  /\  x  ||  P
) ) )
2322rabbidva 2598 . . . . 5  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  { x  e.  ZZ  |  ( ( x  ||  N  /\  x  ||  M )  /\  x  ||  P ) }  =  { x  e.  ZZ  |  ( x 
||  ( N  gcd  M )  /\  x  ||  P ) } )
2423supeq1d 6495 . . . 4  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  sup ( { x  e.  ZZ  |  ( ( x 
||  N  /\  x  ||  M )  /\  x  ||  P ) } ,  RR ,  <  )  =  sup ( { x  e.  ZZ  |  ( x 
||  ( N  gcd  M )  /\  x  ||  P ) } ,  RR ,  <  ) )
2516, 24ifbieq2d 3390 . . 3  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  if ( ( ( N  =  0  /\  M  =  0 )  /\  P  =  0 ) ,  0 ,  sup ( { x  e.  ZZ  |  ( ( x 
||  N  /\  x  ||  M )  /\  x  ||  P ) } ,  RR ,  <  ) )  =  if ( ( ( N  gcd  M
)  =  0  /\  P  =  0 ) ,  0 ,  sup ( { x  e.  ZZ  |  ( x  ||  ( N  gcd  M )  /\  x  ||  P
) } ,  RR ,  <  ) ) )
2612, 25eqtr4d 2118 . 2  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  (
( N  gcd  M
)  gcd  P )  =  if ( ( ( N  =  0  /\  M  =  0 )  /\  P  =  0 ) ,  0 ,  sup ( { x  e.  ZZ  |  ( ( x  ||  N  /\  x  ||  M )  /\  x  ||  P ) } ,  RR ,  <  ) ) )
27 simp1 939 . . . 4  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  N  e.  ZZ )
28 gcdcl 10583 . . . . . 6  |-  ( ( M  e.  ZZ  /\  P  e.  ZZ )  ->  ( M  gcd  P
)  e.  NN0 )
29283adant1 957 . . . . 5  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  ( M  gcd  P )  e. 
NN0 )
3029nn0zd 8618 . . . 4  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  ( M  gcd  P )  e.  ZZ )
31 gcdval 10576 . . . 4  |-  ( ( N  e.  ZZ  /\  ( M  gcd  P )  e.  ZZ )  -> 
( N  gcd  ( M  gcd  P ) )  =  if ( ( N  =  0  /\  ( M  gcd  P
)  =  0 ) ,  0 ,  sup ( { x  e.  ZZ  |  ( x  ||  N  /\  x  ||  ( M  gcd  P ) ) } ,  RR ,  <  ) ) )
3227, 30, 31syl2anc 403 . . 3  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  ( N  gcd  ( M  gcd  P ) )  =  if ( ( N  =  0  /\  ( M  gcd  P )  =  0 ) ,  0 ,  sup ( { x  e.  ZZ  | 
( x  ||  N  /\  x  ||  ( M  gcd  P ) ) } ,  RR ,  <  ) ) )
33 gcdeq0 10593 . . . . . . 7  |-  ( ( M  e.  ZZ  /\  P  e.  ZZ )  ->  ( ( M  gcd  P )  =  0  <->  ( M  =  0  /\  P  =  0 ) ) )
34333adant1 957 . . . . . 6  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  (
( M  gcd  P
)  =  0  <->  ( M  =  0  /\  P  =  0 ) ) )
3534anbi2d 452 . . . . 5  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  (
( N  =  0  /\  ( M  gcd  P )  =  0 )  <-> 
( N  =  0  /\  ( M  =  0  /\  P  =  0 ) ) ) )
3635bicomd 139 . . . 4  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  (
( N  =  0  /\  ( M  =  0  /\  P  =  0 ) )  <->  ( N  =  0  /\  ( M  gcd  P )  =  0 ) ) )
37 simpl3 944 . . . . . . . 8  |-  ( ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  /\  x  e.  ZZ )  ->  P  e.  ZZ )
38 dvdsgcdb 10627 . . . . . . . 8  |-  ( ( x  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  (
( x  ||  M  /\  x  ||  P )  <-> 
x  ||  ( M  gcd  P ) ) )
3917, 19, 37, 38syl3anc 1170 . . . . . . 7  |-  ( ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  /\  x  e.  ZZ )  ->  ( ( x 
||  M  /\  x  ||  P )  <->  x  ||  ( M  gcd  P ) ) )
4039anbi2d 452 . . . . . 6  |-  ( ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  /\  x  e.  ZZ )  ->  ( ( x 
||  N  /\  (
x  ||  M  /\  x  ||  P ) )  <-> 
( x  ||  N  /\  x  ||  ( M  gcd  P ) ) ) )
4140rabbidva 2598 . . . . 5  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  { x  e.  ZZ  |  ( x 
||  N  /\  (
x  ||  M  /\  x  ||  P ) ) }  =  { x  e.  ZZ  |  ( x 
||  N  /\  x  ||  ( M  gcd  P
) ) } )
4241supeq1d 6495 . . . 4  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  sup ( { x  e.  ZZ  |  ( x  ||  N  /\  ( x  ||  M  /\  x  ||  P
) ) } ,  RR ,  <  )  =  sup ( { x  e.  ZZ  |  ( x 
||  N  /\  x  ||  ( M  gcd  P
) ) } ,  RR ,  <  ) )
4336, 42ifbieq2d 3390 . . 3  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  if ( ( N  =  0  /\  ( M  =  0  /\  P  =  0 ) ) ,  0 ,  sup ( { x  e.  ZZ  |  ( x  ||  N  /\  ( x  ||  M  /\  x  ||  P
) ) } ,  RR ,  <  ) )  =  if ( ( N  =  0  /\  ( M  gcd  P
)  =  0 ) ,  0 ,  sup ( { x  e.  ZZ  |  ( x  ||  N  /\  x  ||  ( M  gcd  P ) ) } ,  RR ,  <  ) ) )
4432, 43eqtr4d 2118 . 2  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  ( N  gcd  ( M  gcd  P ) )  =  if ( ( N  =  0  /\  ( M  =  0  /\  P  =  0 ) ) ,  0 ,  sup ( { x  e.  ZZ  |  ( x  ||  N  /\  ( x  ||  M  /\  x  ||  P
) ) } ,  RR ,  <  ) ) )
456, 26, 443eqtr4a 2141 1  |-  ( ( N  e.  ZZ  /\  M  e.  ZZ  /\  P  e.  ZZ )  ->  (
( N  gcd  M
)  gcd  P )  =  ( N  gcd  ( M  gcd  P ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 102    <-> wb 103    /\ w3a 920    = wceq 1285    e. wcel 1434   {crab 2357   ifcif 3368   class class class wbr 3805  (class class class)co 5564   supcsup 6490   RRcr 7112   0cc0 7113    < clt 7285   NN0cn0 8425   ZZcz 8502    || cdvds 10421    gcd cgcd 10563
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 104  ax-ia2 105  ax-ia3 106  ax-in1 577  ax-in2 578  ax-io 663  ax-5 1377  ax-7 1378  ax-gen 1379  ax-ie1 1423  ax-ie2 1424  ax-8 1436  ax-10 1437  ax-11 1438  ax-i12 1439  ax-bndl 1440  ax-4 1441  ax-13 1445  ax-14 1446  ax-17 1460  ax-i9 1464  ax-ial 1468  ax-i5r 1469  ax-ext 2065  ax-coll 3913  ax-sep 3916  ax-nul 3924  ax-pow 3968  ax-pr 3992  ax-un 4216  ax-setind 4308  ax-iinf 4357  ax-cnex 7199  ax-resscn 7200  ax-1cn 7201  ax-1re 7202  ax-icn 7203  ax-addcl 7204  ax-addrcl 7205  ax-mulcl 7206  ax-mulrcl 7207  ax-addcom 7208  ax-mulcom 7209  ax-addass 7210  ax-mulass 7211  ax-distr 7212  ax-i2m1 7213  ax-0lt1 7214  ax-1rid 7215  ax-0id 7216  ax-rnegex 7217  ax-precex 7218  ax-cnre 7219  ax-pre-ltirr 7220  ax-pre-ltwlin 7221  ax-pre-lttrn 7222  ax-pre-apti 7223  ax-pre-ltadd 7224  ax-pre-mulgt0 7225  ax-pre-mulext 7226  ax-arch 7227  ax-caucvg 7228
This theorem depends on definitions:  df-bi 115  df-dc 777  df-3or 921  df-3an 922  df-tru 1288  df-fal 1291  df-nf 1391  df-sb 1688  df-eu 1946  df-mo 1947  df-clab 2070  df-cleq 2076  df-clel 2079  df-nfc 2212  df-ne 2250  df-nel 2345  df-ral 2358  df-rex 2359  df-reu 2360  df-rmo 2361  df-rab 2362  df-v 2612  df-sbc 2825  df-csb 2918  df-dif 2984  df-un 2986  df-in 2988  df-ss 2995  df-nul 3268  df-if 3369  df-pw 3402  df-sn 3422  df-pr 3423  df-op 3425  df-uni 3622  df-int 3657  df-iun 3700  df-br 3806  df-opab 3860  df-mpt 3861  df-tr 3896  df-id 4076  df-po 4079  df-iso 4080  df-iord 4149  df-on 4151  df-ilim 4152  df-suc 4154  df-iom 4360  df-xp 4397  df-rel 4398  df-cnv 4399  df-co 4400  df-dm 4401  df-rn 4402  df-res 4403  df-ima 4404  df-iota 4917  df-fun 4954  df-fn 4955  df-f 4956  df-f1 4957  df-fo 4958  df-f1o 4959  df-fv 4960  df-riota 5520  df-ov 5567  df-oprab 5568  df-mpt2 5569  df-1st 5819  df-2nd 5820  df-recs 5975  df-frec 6061  df-sup 6492  df-pnf 7287  df-mnf 7288  df-xr 7289  df-ltxr 7290  df-le 7291  df-sub 7418  df-neg 7419  df-reap 7812  df-ap 7819  df-div 7898  df-inn 8177  df-2 8235  df-3 8236  df-4 8237  df-n0 8426  df-z 8503  df-uz 8771  df-q 8856  df-rp 8886  df-fz 9176  df-fzo 9300  df-fl 9422  df-mod 9475  df-iseq 9592  df-iexp 9643  df-cj 9948  df-re 9949  df-im 9950  df-rsqrt 10103  df-abs 10104  df-dvds 10422  df-gcd 10564
This theorem is referenced by:  rpmulgcd  10640
  Copyright terms: Public domain W3C validator