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

Theorem gcdval 16311
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 2742 . . . 4 (𝑥 = 𝑀 → (𝑥 = 0 ↔ 𝑀 = 0))
21anbi1d 631 . . 3 (𝑥 = 𝑀 → ((𝑥 = 0 ∧ 𝑦 = 0) ↔ (𝑀 = 0 ∧ 𝑦 = 0)))
3 breq2 5108 . . . . . 6 (𝑥 = 𝑀 → (𝑛𝑥𝑛𝑀))
43anbi1d 631 . . . . 5 (𝑥 = 𝑀 → ((𝑛𝑥𝑛𝑦) ↔ (𝑛𝑀𝑛𝑦)))
54rabbidv 3414 . . . 4 (𝑥 = 𝑀 → {𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)} = {𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)})
65supeq1d 9316 . . 3 (𝑥 = 𝑀 → sup({𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)}, ℝ, < ) = sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < ))
72, 6ifbieq2d 4511 . 2 (𝑥 = 𝑀 → if((𝑥 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)}, ℝ, < )) = if((𝑀 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < )))
8 eqeq1 2742 . . . 4 (𝑦 = 𝑁 → (𝑦 = 0 ↔ 𝑁 = 0))
98anbi2d 630 . . 3 (𝑦 = 𝑁 → ((𝑀 = 0 ∧ 𝑦 = 0) ↔ (𝑀 = 0 ∧ 𝑁 = 0)))
10 breq2 5108 . . . . . 6 (𝑦 = 𝑁 → (𝑛𝑦𝑛𝑁))
1110anbi2d 630 . . . . 5 (𝑦 = 𝑁 → ((𝑛𝑀𝑛𝑦) ↔ (𝑛𝑀𝑛𝑁)))
1211rabbidv 3414 . . . 4 (𝑦 = 𝑁 → {𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)} = {𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)})
1312supeq1d 9316 . . 3 (𝑦 = 𝑁 → sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < ) = sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < ))
149, 13ifbieq2d 4511 . 2 (𝑦 = 𝑁 → if((𝑀 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑦)}, ℝ, < )) = if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < )))
15 df-gcd 16310 . 2 gcd = (𝑥 ∈ ℤ, 𝑦 ∈ ℤ ↦ if((𝑥 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑥𝑛𝑦)}, ℝ, < )))
16 c0ex 11083 . . 3 0 ∈ V
17 ltso 11169 . . . 4 < Or ℝ
1817supex 9333 . . 3 sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < ) ∈ V
1916, 18ifex 4535 . 2 if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < )) ∈ V
207, 14, 15, 19ovmpo 7508 1 ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) = if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛𝑀𝑛𝑁)}, ℝ, < )))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 397   = wceq 1542  wcel 2107  {crab 3406  ifcif 4485   class class class wbr 5104  (class class class)co 7350  supcsup 9310  cr 10984  0cc0 10985   < clt 11123  cz 12433  cdvds 16071   gcd cgcd 16309
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 1914  ax-6 1972  ax-7 2012  ax-8 2109  ax-9 2117  ax-10 2138  ax-11 2155  ax-12 2172  ax-ext 2709  ax-sep 5255  ax-nul 5262  ax-pow 5319  ax-pr 5383  ax-un 7663  ax-resscn 11042  ax-1cn 11043  ax-icn 11044  ax-addcl 11045  ax-mulcl 11047  ax-i2m1 11053  ax-pre-lttri 11059  ax-pre-lttrn 11060
This theorem depends on definitions:  df-bi 206  df-an 398  df-or 847  df-3or 1089  df-3an 1090  df-tru 1545  df-fal 1555  df-ex 1783  df-nf 1787  df-sb 2069  df-mo 2540  df-eu 2569  df-clab 2716  df-cleq 2730  df-clel 2816  df-nfc 2888  df-ne 2943  df-nel 3049  df-ral 3064  df-rex 3073  df-rmo 3352  df-rab 3407  df-v 3446  df-sbc 3739  df-csb 3855  df-dif 3912  df-un 3914  df-in 3916  df-ss 3926  df-nul 4282  df-if 4486  df-pw 4561  df-sn 4586  df-pr 4588  df-op 4592  df-uni 4865  df-br 5105  df-opab 5167  df-mpt 5188  df-id 5529  df-po 5543  df-so 5544  df-xp 5637  df-rel 5638  df-cnv 5639  df-co 5640  df-dm 5641  df-rn 5642  df-res 5643  df-ima 5644  df-iota 6444  df-fun 6494  df-fn 6495  df-f 6496  df-f1 6497  df-fo 6498  df-f1o 6499  df-fv 6500  df-ov 7353  df-oprab 7354  df-mpo 7355  df-er 8582  df-en 8818  df-dom 8819  df-sdom 8820  df-sup 9312  df-pnf 11125  df-mnf 11126  df-ltxr 11128  df-gcd 16310
This theorem is referenced by:  gcd0val  16312  gcdn0val  16313  gcdf  16327  gcdcom  16328  dfgcd2  16362  gcdass  16363
  Copyright terms: Public domain W3C validator