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

Theorem gcdass 15487
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 684 . . 3 (((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0) ↔ (𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0)))
2 anass 684 . . . . 5 (((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃) ↔ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃)))
32rabbii 3326 . . . 4 {𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)} = {𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}
43supeq1i 8521 . . 3 sup({𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)}, ℝ, < ) = sup({𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}, ℝ, < )
51, 4ifbieq2i 4255 . 2 if(((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)}, ℝ, < )) = if((𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0)), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}, ℝ, < ))
6 gcdcl 15451 . . . . . 6 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ) → (𝑁 gcd 𝑀) ∈ ℕ0)
763adant3 1127 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑁 gcd 𝑀) ∈ ℕ0)
87nn0zd 11693 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑁 gcd 𝑀) ∈ ℤ)
9 simp3 1133 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → 𝑃 ∈ ℤ)
10 gcdval 15441 . . . 4 (((𝑁 gcd 𝑀) ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 gcd 𝑀) gcd 𝑃) = if(((𝑁 gcd 𝑀) = 0 ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)}, ℝ, < )))
118, 9, 10syl2anc 696 . . 3 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 gcd 𝑀) gcd 𝑃) = if(((𝑁 gcd 𝑀) = 0 ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)}, ℝ, < )))
12 gcdeq0 15461 . . . . . . 7 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ) → ((𝑁 gcd 𝑀) = 0 ↔ (𝑁 = 0 ∧ 𝑀 = 0)))
13123adant3 1127 . . . . . 6 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 gcd 𝑀) = 0 ↔ (𝑁 = 0 ∧ 𝑀 = 0)))
1413anbi1d 743 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (((𝑁 gcd 𝑀) = 0 ∧ 𝑃 = 0) ↔ ((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0)))
1514bicomd 213 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0) ↔ ((𝑁 gcd 𝑀) = 0 ∧ 𝑃 = 0)))
16 simpr 479 . . . . . . . 8 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → 𝑥 ∈ ℤ)
17 simpl1 1228 . . . . . . . 8 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → 𝑁 ∈ ℤ)
18 simpl2 1230 . . . . . . . 8 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → 𝑀 ∈ ℤ)
19 dvdsgcdb 15485 . . . . . . . 8 ((𝑥 ∈ ℤ ∧ 𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ) → ((𝑥𝑁𝑥𝑀) ↔ 𝑥 ∥ (𝑁 gcd 𝑀)))
2016, 17, 18, 19syl3anc 1477 . . . . . . 7 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → ((𝑥𝑁𝑥𝑀) ↔ 𝑥 ∥ (𝑁 gcd 𝑀)))
2120anbi1d 743 . . . . . 6 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → (((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃) ↔ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)))
2221rabbidva 3329 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → {𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)} = {𝑥 ∈ ℤ ∣ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)})
2322supeq1d 8520 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → sup({𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)}, ℝ, < ) = sup({𝑥 ∈ ℤ ∣ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)}, ℝ, < ))
2415, 23ifbieq2d 4256 . . 3 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → if(((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)}, ℝ, < )) = if(((𝑁 gcd 𝑀) = 0 ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥 ∥ (𝑁 gcd 𝑀) ∧ 𝑥𝑃)}, ℝ, < )))
2511, 24eqtr4d 2798 . 2 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 gcd 𝑀) gcd 𝑃) = if(((𝑁 = 0 ∧ 𝑀 = 0) ∧ 𝑃 = 0), 0, sup({𝑥 ∈ ℤ ∣ ((𝑥𝑁𝑥𝑀) ∧ 𝑥𝑃)}, ℝ, < )))
26 simp1 1131 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → 𝑁 ∈ ℤ)
27 gcdcl 15451 . . . . . 6 ((𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑀 gcd 𝑃) ∈ ℕ0)
28273adant1 1125 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑀 gcd 𝑃) ∈ ℕ0)
2928nn0zd 11693 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑀 gcd 𝑃) ∈ ℤ)
30 gcdval 15441 . . . 4 ((𝑁 ∈ ℤ ∧ (𝑀 gcd 𝑃) ∈ ℤ) → (𝑁 gcd (𝑀 gcd 𝑃)) = if((𝑁 = 0 ∧ (𝑀 gcd 𝑃) = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))}, ℝ, < )))
3126, 29, 30syl2anc 696 . . 3 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑁 gcd (𝑀 gcd 𝑃)) = if((𝑁 = 0 ∧ (𝑀 gcd 𝑃) = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))}, ℝ, < )))
32 gcdeq0 15461 . . . . . . 7 ((𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑀 gcd 𝑃) = 0 ↔ (𝑀 = 0 ∧ 𝑃 = 0)))
33323adant1 1125 . . . . . 6 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑀 gcd 𝑃) = 0 ↔ (𝑀 = 0 ∧ 𝑃 = 0)))
3433anbi2d 742 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 = 0 ∧ (𝑀 gcd 𝑃) = 0) ↔ (𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0))))
3534bicomd 213 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0)) ↔ (𝑁 = 0 ∧ (𝑀 gcd 𝑃) = 0)))
36 simpl3 1232 . . . . . . . 8 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → 𝑃 ∈ ℤ)
37 dvdsgcdb 15485 . . . . . . . 8 ((𝑥 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑥𝑀𝑥𝑃) ↔ 𝑥 ∥ (𝑀 gcd 𝑃)))
3816, 18, 36, 37syl3anc 1477 . . . . . . 7 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → ((𝑥𝑀𝑥𝑃) ↔ 𝑥 ∥ (𝑀 gcd 𝑃)))
3938anbi2d 742 . . . . . 6 (((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) ∧ 𝑥 ∈ ℤ) → ((𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃)) ↔ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))))
4039rabbidva 3329 . . . . 5 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → {𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))} = {𝑥 ∈ ℤ ∣ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))})
4140supeq1d 8520 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → sup({𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}, ℝ, < ) = sup({𝑥 ∈ ℤ ∣ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))}, ℝ, < ))
4235, 41ifbieq2d 4256 . . 3 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → if((𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0)), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}, ℝ, < )) = if((𝑁 = 0 ∧ (𝑀 gcd 𝑃) = 0), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁𝑥 ∥ (𝑀 gcd 𝑃))}, ℝ, < )))
4331, 42eqtr4d 2798 . 2 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → (𝑁 gcd (𝑀 gcd 𝑃)) = if((𝑁 = 0 ∧ (𝑀 = 0 ∧ 𝑃 = 0)), 0, sup({𝑥 ∈ ℤ ∣ (𝑥𝑁 ∧ (𝑥𝑀𝑥𝑃))}, ℝ, < )))
445, 25, 433eqtr4a 2821 1 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑃 ∈ ℤ) → ((𝑁 gcd 𝑀) gcd 𝑃) = (𝑁 gcd (𝑀 gcd 𝑃)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 196  wa 383  w3a 1072   = wceq 1632  wcel 2140  {crab 3055  ifcif 4231   class class class wbr 4805  (class class class)co 6815  supcsup 8514  cr 10148  0cc0 10149   < clt 10287  0cn0 11505  cz 11590  cdvds 15203   gcd cgcd 15439
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1871  ax-4 1886  ax-5 1989  ax-6 2055  ax-7 2091  ax-8 2142  ax-9 2149  ax-10 2169  ax-11 2184  ax-12 2197  ax-13 2392  ax-ext 2741  ax-sep 4934  ax-nul 4942  ax-pow 4993  ax-pr 5056  ax-un 7116  ax-cnex 10205  ax-resscn 10206  ax-1cn 10207  ax-icn 10208  ax-addcl 10209  ax-addrcl 10210  ax-mulcl 10211  ax-mulrcl 10212  ax-mulcom 10213  ax-addass 10214  ax-mulass 10215  ax-distr 10216  ax-i2m1 10217  ax-1ne0 10218  ax-1rid 10219  ax-rnegex 10220  ax-rrecex 10221  ax-cnre 10222  ax-pre-lttri 10223  ax-pre-lttrn 10224  ax-pre-ltadd 10225  ax-pre-mulgt0 10226  ax-pre-sup 10227
This theorem depends on definitions:  df-bi 197  df-or 384  df-an 385  df-3or 1073  df-3an 1074  df-tru 1635  df-ex 1854  df-nf 1859  df-sb 2048  df-eu 2612  df-mo 2613  df-clab 2748  df-cleq 2754  df-clel 2757  df-nfc 2892  df-ne 2934  df-nel 3037  df-ral 3056  df-rex 3057  df-reu 3058  df-rmo 3059  df-rab 3060  df-v 3343  df-sbc 3578  df-csb 3676  df-dif 3719  df-un 3721  df-in 3723  df-ss 3730  df-pss 3732  df-nul 4060  df-if 4232  df-pw 4305  df-sn 4323  df-pr 4325  df-tp 4327  df-op 4329  df-uni 4590  df-iun 4675  df-br 4806  df-opab 4866  df-mpt 4883  df-tr 4906  df-id 5175  df-eprel 5180  df-po 5188  df-so 5189  df-fr 5226  df-we 5228  df-xp 5273  df-rel 5274  df-cnv 5275  df-co 5276  df-dm 5277  df-rn 5278  df-res 5279  df-ima 5280  df-pred 5842  df-ord 5888  df-on 5889  df-lim 5890  df-suc 5891  df-iota 6013  df-fun 6052  df-fn 6053  df-f 6054  df-f1 6055  df-fo 6056  df-f1o 6057  df-fv 6058  df-riota 6776  df-ov 6818  df-oprab 6819  df-mpt2 6820  df-om 7233  df-2nd 7336  df-wrecs 7578  df-recs 7639  df-rdg 7677  df-er 7914  df-en 8125  df-dom 8126  df-sdom 8127  df-sup 8516  df-inf 8517  df-pnf 10289  df-mnf 10290  df-xr 10291  df-ltxr 10292  df-le 10293  df-sub 10481  df-neg 10482  df-div 10898  df-nn 11234  df-2 11292  df-3 11293  df-n0 11506  df-z 11591  df-uz 11901  df-rp 12047  df-fl 12808  df-mod 12884  df-seq 13017  df-exp 13076  df-cj 14059  df-re 14060  df-im 14061  df-sqrt 14195  df-abs 14196  df-dvds 15204  df-gcd 15440
This theorem is referenced by:  rpmulgcd  15498  coprimeprodsq  15736  gcd32  31966  gcdabsorb  31967
  Copyright terms: Public domain W3C validator