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

Theorem gcdval 15888
 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 2763 . . . 4 (𝑥 = 𝑀 → (𝑥 = 0 ↔ 𝑀 = 0))
21anbi1d 633 . . 3 (𝑥 = 𝑀 → ((𝑥 = 0 ∧ 𝑦 = 0) ↔ (𝑀 = 0 ∧ 𝑦 = 0)))
3 breq2 5037 . . . . . 6 (𝑥 = 𝑀 → (𝑛𝑥𝑛𝑀))
43anbi1d 633 . . . . 5 (𝑥 = 𝑀 → ((𝑛𝑥𝑛𝑦) ↔ (𝑛𝑀𝑛𝑦)))
54rabbidv 3393 . . . 4 (𝑥 = 𝑀 → {𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)} = {𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)})
65supeq1d 8936 . . 3 (𝑥 = 𝑀 → sup({𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)}, ℝ, < ) = sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < ))
72, 6ifbieq2d 4447 . 2 (𝑥 = 𝑀 → if((𝑥 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)}, ℝ, < )) = if((𝑀 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < )))
8 eqeq1 2763 . . . 4 (𝑦 = 𝑁 → (𝑦 = 0 ↔ 𝑁 = 0))
98anbi2d 632 . . 3 (𝑦 = 𝑁 → ((𝑀 = 0 ∧ 𝑦 = 0) ↔ (𝑀 = 0 ∧ 𝑁 = 0)))
10 breq2 5037 . . . . . 6 (𝑦 = 𝑁 → (𝑛𝑦𝑛𝑁))
1110anbi2d 632 . . . . 5 (𝑦 = 𝑁 → ((𝑛𝑀𝑛𝑦) ↔ (𝑛𝑀𝑛𝑁)))
1211rabbidv 3393 . . . 4 (𝑦 = 𝑁 → {𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)} = {𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)})
1312supeq1d 8936 . . 3 (𝑦 = 𝑁 → sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < ) = sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < ))
149, 13ifbieq2d 4447 . 2 (𝑦 = 𝑁 → if((𝑀 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < )) = if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < )))
15 df-gcd 15887 . 2 gcd = (𝑥 ∈ ℤ, 𝑦 ∈ ℤ ↦ if((𝑥 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)}, ℝ, < )))
16 c0ex 10666 . . 3 0 ∈ V
17 ltso 10752 . . . 4 < Or ℝ
1817supex 8953 . . 3 sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < ) ∈ V
1916, 18ifex 4471 . 2 if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < )) ∈ V
207, 14, 15, 19ovmpo 7306 1 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) = if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < )))
 Colors of variables: wff setvar class Syntax hints:   → wi 4   ∧ wa 400   = wceq 1539   ∈ wcel 2112  {crab 3075  ifcif 4421   class class class wbr 5033  (class class class)co 7151  supcsup 8930  ℝcr 10567  0cc0 10568   < clt 10706  ℤcz 12013   ∥ cdvds 15648   gcd cgcd 15886 This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1798  ax-4 1812  ax-5 1912  ax-6 1971  ax-7 2016  ax-8 2114  ax-9 2122  ax-10 2143  ax-11 2159  ax-12 2176  ax-ext 2730  ax-sep 5170  ax-nul 5177  ax-pow 5235  ax-pr 5299  ax-un 7460  ax-resscn 10625  ax-1cn 10626  ax-icn 10627  ax-addcl 10628  ax-mulcl 10630  ax-i2m1 10636  ax-pre-lttri 10642  ax-pre-lttrn 10643 This theorem depends on definitions:  df-bi 210  df-an 401  df-or 846  df-3or 1086  df-3an 1087  df-tru 1542  df-fal 1552  df-ex 1783  df-nf 1787  df-sb 2071  df-mo 2558  df-eu 2589  df-clab 2737  df-cleq 2751  df-clel 2831  df-nfc 2902  df-ne 2953  df-nel 3057  df-ral 3076  df-rex 3077  df-rmo 3079  df-rab 3080  df-v 3412  df-sbc 3698  df-csb 3807  df-dif 3862  df-un 3864  df-in 3866  df-ss 3876  df-nul 4227  df-if 4422  df-pw 4497  df-sn 4524  df-pr 4526  df-op 4530  df-uni 4800  df-br 5034  df-opab 5096  df-mpt 5114  df-id 5431  df-po 5444  df-so 5445  df-xp 5531  df-rel 5532  df-cnv 5533  df-co 5534  df-dm 5535  df-rn 5536  df-res 5537  df-ima 5538  df-iota 6295  df-fun 6338  df-fn 6339  df-f 6340  df-f1 6341  df-fo 6342  df-f1o 6343  df-fv 6344  df-ov 7154  df-oprab 7155  df-mpo 7156  df-er 8300  df-en 8529  df-dom 8530  df-sdom 8531  df-sup 8932  df-pnf 10708  df-mnf 10709  df-ltxr 10711  df-gcd 15887 This theorem is referenced by:  gcd0val  15889  gcdn0val  15890  gcdf  15904  gcdcom  15905  dfgcd2  15938  gcdass  15939
 Copyright terms: Public domain W3C validator