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

Theorem gcdass 15044
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 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 gcd 𝑀) gcd 𝑃) = (𝑁 gcd (𝑀 gcd 𝑃)))

Proof of Theorem gcdass
Dummy variable 𝑥 is distinct from all other variables.
StepHypRef Expression
1 anass 678 . . 3 (((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0) ↔ (𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0)))
2 anass 678 . . . . . 6 (((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃) ↔ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃)))
32a1i 11 . . . . 5 (𝑥 ∈ ℤ → (((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃) ↔ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))))
43rabbiia 3156 . . . 4 {𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)} = {𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}
54supeq1i 8209 . . 3 sup({𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)}, ℝ, < ) = sup({𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}, ℝ, < )
61, 5ifbieq2i 4055 . 2 if(((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)}, ℝ, < )) = if((𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0)), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}, ℝ, < ))
7 gcdcl 15008 . . . . . 6 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ) → (𝑁 gcd 𝑀) ∈ ℕ0)
873adant3 1073 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑁 gcd 𝑀) ∈ ℕ0)
98nn0zd 11308 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑁 gcd 𝑀) ∈ ℤ)
10 simp3 1055 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → 𝑃 ∈ ℤ)
11 gcdval 14998 . . . 4 (((𝑁 gcd 𝑀) ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 gcd 𝑀) gcd 𝑃) = if(((𝑁 gcd 𝑀) = 0 ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)}, ℝ, < )))
129, 10, 11syl2anc 690 . . 3 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 gcd 𝑀) gcd 𝑃) = if(((𝑁 gcd 𝑀) = 0 ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)}, ℝ, < )))
13 gcdeq0 15018 . . . . . . 7 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ) → ((𝑁 gcd 𝑀) = 0 ↔ (𝑁 = 0 ∧ 𝑀 = 0)))
14133adant3 1073 . . . . . 6 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 gcd 𝑀) = 0 ↔ (𝑁 = 0 ∧ 𝑀 = 0)))
1514anbi1d 736 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (((𝑁 gcd 𝑀) = 0 ∧ 𝑃 = 0) ↔ ((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0)))
1615bicomd 211 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0) ↔ ((𝑁 gcd 𝑀) = 0 ∧ 𝑃 = 0)))
17 simpr 475 . . . . . . . 8 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → 𝑥 ∈ ℤ)
18 simpl1 1056 . . . . . . . 8 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → 𝑁 ∈ ℤ)
19 simpl2 1057 . . . . . . . 8 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → 𝑀 ∈ ℤ)
20 dvdsgcdb 15042 . . . . . . . 8 ((𝑥 ∈ ℤ ∧ 𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ) → ((𝑥𝑁𝑥𝑀) ↔ 𝑥 ∥ (𝑁 gcd 𝑀)))
2117, 18, 19, 20syl3anc 1317 . . . . . . 7 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → ((𝑥𝑁𝑥𝑀) ↔ 𝑥 ∥ (𝑁 gcd 𝑀)))
2221anbi1d 736 . . . . . 6 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → (((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃) ↔ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)))
2322rabbidva 3158 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → {𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)} = {𝑥 ∈ ℤ ∣ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)})
2423supeq1d 8208 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → sup({𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)}, ℝ, < ) = sup({𝑥 ∈ ℤ ∣ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)}, ℝ, < ))
2516, 24ifbieq2d 4056 . . 3 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → if(((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)}, ℝ, < )) = if(((𝑁 gcd 𝑀) = 0 ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)}, ℝ, < )))
2612, 25eqtr4d 2642 . 2 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 gcd 𝑀) gcd 𝑃) = if(((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)}, ℝ, < )))
27 simp1 1053 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → 𝑁 ∈ ℤ)
28 gcdcl 15008 . . . . . 6 ((𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑀 gcd 𝑃) ∈ ℕ0)
29283adant1 1071 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑀 gcd 𝑃) ∈ ℕ0)
3029nn0zd 11308 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑀 gcd 𝑃) ∈ ℤ)
31 gcdval 14998 . . . 4 ((𝑁 ∈ ℤ ∧ (𝑀 gcd 𝑃) ∈ ℤ) → (𝑁 gcd (𝑀 gcd 𝑃)) = if((𝑁 = 0 ∧ (𝑀 gcd 𝑃) = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))}, ℝ, < )))
3227, 30, 31syl2anc 690 . . 3 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑁 gcd (𝑀 gcd 𝑃)) = if((𝑁 = 0 ∧ (𝑀 gcd 𝑃) = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))}, ℝ, < )))
33 gcdeq0 15018 . . . . . . 7 ((𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑀 gcd 𝑃) = 0 ↔ (𝑀 = 0 ∧ 𝑃 = 0)))
34333adant1 1071 . . . . . 6 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑀 gcd 𝑃) = 0 ↔ (𝑀 = 0 ∧ 𝑃 = 0)))
3534anbi2d 735 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 = 0 ∧ (𝑀 gcd 𝑃) = 0) ↔ (𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0))))
3635bicomd 211 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0)) ↔ (𝑁 = 0 ∧ (𝑀 gcd 𝑃) = 0)))
37 simpl3 1058 . . . . . . . 8 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → 𝑃 ∈ ℤ)
38 dvdsgcdb 15042 . . . . . . . 8 ((𝑥 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑥𝑀𝑥𝑃) ↔ 𝑥 ∥ (𝑀 gcd 𝑃)))
3917, 19, 37, 38syl3anc 1317 . . . . . . 7 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → ((𝑥𝑀𝑥𝑃) ↔ 𝑥 ∥ (𝑀 gcd 𝑃)))
4039anbi2d 735 . . . . . 6 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → ((𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃)) ↔ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))))
4140rabbidva 3158 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → {𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))} = {𝑥 ∈ ℤ ∣ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))})
4241supeq1d 8208 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → sup({𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}, ℝ, < ) = sup({𝑥 ∈ ℤ ∣ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))}, ℝ, < ))
4336, 42ifbieq2d 4056 . . 3 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → if((𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0)), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}, ℝ, < )) = if((𝑁 = 0 ∧ (𝑀 gcd 𝑃) = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))}, ℝ, < )))
4432, 43eqtr4d 2642 . 2 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑁 gcd (𝑀 gcd 𝑃)) = if((𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0)), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}, ℝ, < )))
456, 26, 443eqtr4a 2665 1 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 gcd 𝑀) gcd 𝑃) = (𝑁 gcd (𝑀 gcd 𝑃)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 194  wa 382  w3a 1030   = wceq 1474  wcel 1975  {crab 2895  ifcif 4031   class class class wbr 4573  (class class class)co 6523  supcsup 8202  cr 9787  0cc0 9788   < clt 9926  0cn0 11135  cz 11206  cdvds 14763   gcd cgcd 14996
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1711  ax-4 1726  ax-5 1825  ax-6 1873  ax-7 1920  ax-8 1977  ax-9 1984  ax-10 2004  ax-11 2019  ax-12 2031  ax-13 2228  ax-ext 2585  ax-sep 4699  ax-nul 4708  ax-pow 4760  ax-pr 4824  ax-un 6820  ax-cnex 9844  ax-resscn 9845  ax-1cn 9846  ax-icn 9847  ax-addcl 9848  ax-addrcl 9849  ax-mulcl 9850  ax-mulrcl 9851  ax-mulcom 9852  ax-addass 9853  ax-mulass 9854  ax-distr 9855  ax-i2m1 9856  ax-1ne0 9857  ax-1rid 9858  ax-rnegex 9859  ax-rrecex 9860  ax-cnre 9861  ax-pre-lttri 9862  ax-pre-lttrn 9863  ax-pre-ltadd 9864  ax-pre-mulgt0 9865  ax-pre-sup 9866
This theorem depends on definitions:  df-bi 195  df-or 383  df-an 384  df-3or 1031  df-3an 1032  df-tru 1477  df-ex 1695  df-nf 1700  df-sb 1866  df-eu 2457  df-mo 2458  df-clab 2592  df-cleq 2598  df-clel 2601  df-nfc 2735  df-ne 2777  df-nel 2778  df-ral 2896  df-rex 2897  df-reu 2898  df-rmo 2899  df-rab 2900  df-v 3170  df-sbc 3398  df-csb 3495  df-dif 3538  df-un 3540  df-in 3542  df-ss 3549  df-pss 3551  df-nul 3870  df-if 4032  df-pw 4105  df-sn 4121  df-pr 4123  df-tp 4125  df-op 4127  df-uni 4363  df-iun 4447  df-br 4574  df-opab 4634  df-mpt 4635  df-tr 4671  df-eprel 4935  df-id 4939  df-po 4945  df-so 4946  df-fr 4983  df-we 4985  df-xp 5030  df-rel 5031  df-cnv 5032  df-co 5033  df-dm 5034  df-rn 5035  df-res 5036  df-ima 5037  df-pred 5579  df-ord 5625  df-on 5626  df-lim 5627  df-suc 5628  df-iota 5750  df-fun 5788  df-fn 5789  df-f 5790  df-f1 5791  df-fo 5792  df-f1o 5793  df-fv 5794  df-riota 6485  df-ov 6526  df-oprab 6527  df-mpt2 6528  df-om 6931  df-2nd 7033  df-wrecs 7267  df-recs 7328  df-rdg 7366  df-er 7602  df-en 7815  df-dom 7816  df-sdom 7817  df-sup 8204  df-inf 8205  df-pnf 9928  df-mnf 9929  df-xr 9930  df-ltxr 9931  df-le 9932  df-sub 10115  df-neg 10116  df-div 10530  df-nn 10864  df-2 10922  df-3 10923  df-n0 11136  df-z 11207  df-uz 11516  df-rp 11661  df-fl 12406  df-mod 12482  df-seq 12615  df-exp 12674  df-cj 13629  df-re 13630  df-im 13631  df-sqrt 13765  df-abs 13766  df-dvds 14764  df-gcd 14997
This theorem is referenced by:  rpmulgcd  15055  coprimeprodsq  15293  gcd32  30692  gcdabsorb  30693
  Copyright terms: Public domain W3C validator