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

Theorem gcdval 15425
 Description: The value of the gcd operator. (𝑀 gcd 𝑁) is the greatest common divisor of 𝑀 and 𝑁. If 𝑀 and 𝑁 are both 0, the result is defined conventionally as 0. (Contributed by Paul Chapman, 21-Mar-2011.) (Revised by Mario Carneiro, 10-Nov-2013.)
Assertion
Ref Expression
gcdval ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) = if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < )))
Distinct variable groups:   𝑛,𝑀   𝑛,𝑁

Proof of Theorem gcdval
Dummy variables 𝑥 𝑦 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 eqeq1 2774 . . . 4 (𝑥 = 𝑀 → (𝑥 = 0 ↔ 𝑀 = 0))
21anbi1d 607 . . 3 (𝑥 = 𝑀 → ((𝑥 = 0 ∧ 𝑦 = 0) ↔ (𝑀 = 0 ∧ 𝑦 = 0)))
3 breq2 4788 . . . . . 6 (𝑥 = 𝑀 → (𝑛𝑥𝑛𝑀))
43anbi1d 607 . . . . 5 (𝑥 = 𝑀 → ((𝑛𝑥𝑛𝑦) ↔ (𝑛𝑀𝑛𝑦)))
54rabbidv 3338 . . . 4 (𝑥 = 𝑀 → {𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)} = {𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)})
65supeq1d 8507 . . 3 (𝑥 = 𝑀 → sup({𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)}, ℝ, < ) = sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < ))
72, 6ifbieq2d 4248 . 2 (𝑥 = 𝑀 → if((𝑥 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)}, ℝ, < )) = if((𝑀 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < )))
8 eqeq1 2774 . . . 4 (𝑦 = 𝑁 → (𝑦 = 0 ↔ 𝑁 = 0))
98anbi2d 606 . . 3 (𝑦 = 𝑁 → ((𝑀 = 0 ∧ 𝑦 = 0) ↔ (𝑀 = 0 ∧ 𝑁 = 0)))
10 breq2 4788 . . . . . 6 (𝑦 = 𝑁 → (𝑛𝑦𝑛𝑁))
1110anbi2d 606 . . . . 5 (𝑦 = 𝑁 → ((𝑛𝑀𝑛𝑦) ↔ (𝑛𝑀𝑛𝑁)))
1211rabbidv 3338 . . . 4 (𝑦 = 𝑁 → {𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)} = {𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)})
1312supeq1d 8507 . . 3 (𝑦 = 𝑁 → sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < ) = sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < ))
149, 13ifbieq2d 4248 . 2 (𝑦 = 𝑁 → if((𝑀 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < )) = if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < )))
15 df-gcd 15424 . 2 gcd = (𝑥 ∈ ℤ, 𝑦 ∈ ℤ ↦ if((𝑥 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)}, ℝ, < )))
16 c0ex 10235 . . 3 0 ∈ V
17 ltso 10319 . . . 4 < Or ℝ
1817supex 8524 . . 3 sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < ) ∈ V
1916, 18ifex 4293 . 2 if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < )) ∈ V
207, 14, 15, 19ovmpt2 6942 1 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) = if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < )))
 Colors of variables: wff setvar class Syntax hints:   → wi 4   ∧ wa 382   = wceq 1630   ∈ wcel 2144  {crab 3064  ifcif 4223   class class class wbr 4784  (class class class)co 6792  supcsup 8501  ℝcr 10136  0cc0 10137   < clt 10275  ℤcz 11578   ∥ cdvds 15188   gcd cgcd 15423 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1869  ax-4 1884  ax-5 1990  ax-6 2056  ax-7 2092  ax-8 2146  ax-9 2153  ax-10 2173  ax-11 2189  ax-12 2202  ax-13 2407  ax-ext 2750  ax-sep 4912  ax-nul 4920  ax-pow 4971  ax-pr 5034  ax-un 7095  ax-resscn 10194  ax-1cn 10195  ax-icn 10196  ax-addcl 10197  ax-mulcl 10199  ax-i2m1 10205  ax-pre-lttri 10211  ax-pre-lttrn 10212 This theorem depends on definitions:  df-bi 197  df-an 383  df-or 827  df-3or 1071  df-3an 1072  df-tru 1633  df-ex 1852  df-nf 1857  df-sb 2049  df-eu 2621  df-mo 2622  df-clab 2757  df-cleq 2763  df-clel 2766  df-nfc 2901  df-ne 2943  df-nel 3046  df-ral 3065  df-rex 3066  df-rmo 3068  df-rab 3069  df-v 3351  df-sbc 3586  df-csb 3681  df-dif 3724  df-un 3726  df-in 3728  df-ss 3735  df-nul 4062  df-if 4224  df-pw 4297  df-sn 4315  df-pr 4317  df-op 4321  df-uni 4573  df-br 4785  df-opab 4845  df-mpt 4862  df-id 5157  df-po 5170  df-so 5171  df-xp 5255  df-rel 5256  df-cnv 5257  df-co 5258  df-dm 5259  df-rn 5260  df-res 5261  df-ima 5262  df-iota 5994  df-fun 6033  df-fn 6034  df-f 6035  df-f1 6036  df-fo 6037  df-f1o 6038  df-fv 6039  df-ov 6795  df-oprab 6796  df-mpt2 6797  df-er 7895  df-en 8109  df-dom 8110  df-sdom 8111  df-sup 8503  df-pnf 10277  df-mnf 10278  df-ltxr 10280  df-gcd 15424 This theorem is referenced by:  gcd0val  15426  gcdn0val  15427  gcdf  15441  gcdcom  15442  dfgcd2  15470  gcdass  15471
 Copyright terms: Public domain W3C validator