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

Theorem gcdzeq 16499
Description: A positive integer 𝐴 is equal to its gcd with an integer 𝐵 if and only if 𝐴 divides 𝐵. Generalization of gcdeq 16500. (Contributed by AV, 1-Jul-2020.)
Assertion
Ref Expression
gcdzeq ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → ((𝐴 gcd 𝐵) = 𝐴𝐴𝐵))

Proof of Theorem gcdzeq
StepHypRef Expression
1 nnz 12584 . . . . 5 (𝐴 ∈ ℕ → 𝐴 ∈ ℤ)
2 gcddvds 16449 . . . . 5 ((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → ((𝐴 gcd 𝐵) ∥ 𝐴 ∧ (𝐴 gcd 𝐵) ∥ 𝐵))
31, 2sylan 579 . . . 4 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → ((𝐴 gcd 𝐵) ∥ 𝐴 ∧ (𝐴 gcd 𝐵) ∥ 𝐵))
43simprd 495 . . 3 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → (𝐴 gcd 𝐵) ∥ 𝐵)
5 breq1 5151 . . 3 ((𝐴 gcd 𝐵) = 𝐴 → ((𝐴 gcd 𝐵) ∥ 𝐵𝐴𝐵))
64, 5syl5ibcom 244 . 2 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → ((𝐴 gcd 𝐵) = 𝐴𝐴𝐵))
71adantr 480 . . . . . 6 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → 𝐴 ∈ ℤ)
8 iddvds 16218 . . . . . 6 (𝐴 ∈ ℤ → 𝐴𝐴)
97, 8syl 17 . . . . 5 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → 𝐴𝐴)
10 simpr 484 . . . . . 6 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → 𝐵 ∈ ℤ)
11 nnne0 12251 . . . . . . . 8 (𝐴 ∈ ℕ → 𝐴 ≠ 0)
12 simpl 482 . . . . . . . . 9 ((𝐴 = 0 ∧ 𝐵 = 0) → 𝐴 = 0)
1312necon3ai 2964 . . . . . . . 8 (𝐴 ≠ 0 → ¬ (𝐴 = 0 ∧ 𝐵 = 0))
1411, 13syl 17 . . . . . . 7 (𝐴 ∈ ℕ → ¬ (𝐴 = 0 ∧ 𝐵 = 0))
1514adantr 480 . . . . . 6 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → ¬ (𝐴 = 0 ∧ 𝐵 = 0))
16 dvdslegcd 16450 . . . . . 6 (((𝐴 ∈ ℤ ∧ 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) ∧ ¬ (𝐴 = 0 ∧ 𝐵 = 0)) → ((𝐴𝐴𝐴𝐵) → 𝐴 ≤ (𝐴 gcd 𝐵)))
177, 7, 10, 15, 16syl31anc 1372 . . . . 5 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → ((𝐴𝐴𝐴𝐵) → 𝐴 ≤ (𝐴 gcd 𝐵)))
189, 17mpand 692 . . . 4 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → (𝐴𝐵𝐴 ≤ (𝐴 gcd 𝐵)))
193simpld 494 . . . . 5 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → (𝐴 gcd 𝐵) ∥ 𝐴)
20 gcdcl 16452 . . . . . . . 8 ((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → (𝐴 gcd 𝐵) ∈ ℕ0)
211, 20sylan 579 . . . . . . 7 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → (𝐴 gcd 𝐵) ∈ ℕ0)
2221nn0zd 12589 . . . . . 6 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → (𝐴 gcd 𝐵) ∈ ℤ)
23 simpl 482 . . . . . 6 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → 𝐴 ∈ ℕ)
24 dvdsle 16258 . . . . . 6 (((𝐴 gcd 𝐵) ∈ ℤ ∧ 𝐴 ∈ ℕ) → ((𝐴 gcd 𝐵) ∥ 𝐴 → (𝐴 gcd 𝐵) ≤ 𝐴))
2522, 23, 24syl2anc 583 . . . . 5 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → ((𝐴 gcd 𝐵) ∥ 𝐴 → (𝐴 gcd 𝐵) ≤ 𝐴))
2619, 25mpd 15 . . . 4 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → (𝐴 gcd 𝐵) ≤ 𝐴)
2718, 26jctild 525 . . 3 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → (𝐴𝐵 → ((𝐴 gcd 𝐵) ≤ 𝐴𝐴 ≤ (𝐴 gcd 𝐵))))
2821nn0red 12538 . . . 4 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → (𝐴 gcd 𝐵) ∈ ℝ)
29 nnre 12224 . . . . 5 (𝐴 ∈ ℕ → 𝐴 ∈ ℝ)
3029adantr 480 . . . 4 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → 𝐴 ∈ ℝ)
3128, 30letri3d 11361 . . 3 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → ((𝐴 gcd 𝐵) = 𝐴 ↔ ((𝐴 gcd 𝐵) ≤ 𝐴𝐴 ≤ (𝐴 gcd 𝐵))))
3227, 31sylibrd 259 . 2 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → (𝐴𝐵 → (𝐴 gcd 𝐵) = 𝐴))
336, 32impbid 211 1 ((𝐴 ∈ ℕ ∧ 𝐵 ∈ ℤ) → ((𝐴 gcd 𝐵) = 𝐴𝐴𝐵))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 205  wa 395   = wceq 1540  wcel 2105  wne 2939   class class class wbr 5148  (class class class)co 7412  cr 11112  0cc0 11113  cle 11254  cn 12217  0cn0 12477  cz 12563  cdvds 16202   gcd cgcd 16440
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1796  ax-4 1810  ax-5 1912  ax-6 1970  ax-7 2010  ax-8 2107  ax-9 2115  ax-10 2136  ax-11 2153  ax-12 2170  ax-ext 2702  ax-sep 5299  ax-nul 5306  ax-pow 5363  ax-pr 5427  ax-un 7728  ax-cnex 11169  ax-resscn 11170  ax-1cn 11171  ax-icn 11172  ax-addcl 11173  ax-addrcl 11174  ax-mulcl 11175  ax-mulrcl 11176  ax-mulcom 11177  ax-addass 11178  ax-mulass 11179  ax-distr 11180  ax-i2m1 11181  ax-1ne0 11182  ax-1rid 11183  ax-rnegex 11184  ax-rrecex 11185  ax-cnre 11186  ax-pre-lttri 11187  ax-pre-lttrn 11188  ax-pre-ltadd 11189  ax-pre-mulgt0 11190  ax-pre-sup 11191
This theorem depends on definitions:  df-bi 206  df-an 396  df-or 845  df-3or 1087  df-3an 1088  df-tru 1543  df-fal 1553  df-ex 1781  df-nf 1785  df-sb 2067  df-mo 2533  df-eu 2562  df-clab 2709  df-cleq 2723  df-clel 2809  df-nfc 2884  df-ne 2940  df-nel 3046  df-ral 3061  df-rex 3070  df-rmo 3375  df-reu 3376  df-rab 3432  df-v 3475  df-sbc 3778  df-csb 3894  df-dif 3951  df-un 3953  df-in 3955  df-ss 3965  df-pss 3967  df-nul 4323  df-if 4529  df-pw 4604  df-sn 4629  df-pr 4631  df-op 4635  df-uni 4909  df-iun 4999  df-br 5149  df-opab 5211  df-mpt 5232  df-tr 5266  df-id 5574  df-eprel 5580  df-po 5588  df-so 5589  df-fr 5631  df-we 5633  df-xp 5682  df-rel 5683  df-cnv 5684  df-co 5685  df-dm 5686  df-rn 5687  df-res 5688  df-ima 5689  df-pred 6300  df-ord 6367  df-on 6368  df-lim 6369  df-suc 6370  df-iota 6495  df-fun 6545  df-fn 6546  df-f 6547  df-f1 6548  df-fo 6549  df-f1o 6550  df-fv 6551  df-riota 7368  df-ov 7415  df-oprab 7416  df-mpo 7417  df-om 7859  df-2nd 7979  df-frecs 8269  df-wrecs 8300  df-recs 8374  df-rdg 8413  df-er 8706  df-en 8943  df-dom 8944  df-sdom 8945  df-sup 9440  df-inf 9441  df-pnf 11255  df-mnf 11256  df-xr 11257  df-ltxr 11258  df-le 11259  df-sub 11451  df-neg 11452  df-div 11877  df-nn 12218  df-2 12280  df-3 12281  df-n0 12478  df-z 12564  df-uz 12828  df-rp 12980  df-seq 13972  df-exp 14033  df-cj 15051  df-re 15052  df-im 15053  df-sqrt 15187  df-abs 15188  df-dvds 16203  df-gcd 16441
This theorem is referenced by:  gcdeq  16500  isevengcd2  16671  iseven5  46631
  Copyright terms: Public domain W3C validator