![]() |
Intuitionistic Logic Explorer |
< Previous
Next >
Nearby theorems |
|
Mirrors > Home > ILE Home > Th. List > gcdval | GIF version |
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.) |
Ref | Expression |
---|---|
gcdval | ⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) = if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < ))) |
Step | Hyp | Ref | Expression |
---|---|---|---|
1 | simpr 109 | . . . . 5 ⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 = 0 ∧ 𝑁 = 0)) | |
2 | 1 | iftrued 3445 | . . . 4 ⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < )) = 0) |
3 | 0nn0 8889 | . . . 4 ⊢ 0 ∈ ℕ0 | |
4 | 2, 3 | syl6eqel 2203 | . . 3 ⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < )) ∈ ℕ0) |
5 | simpr 109 | . . . . . 6 ⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∧ 𝑁 = 0)) → ¬ (𝑀 = 0 ∧ 𝑁 = 0)) | |
6 | 5 | iffalsed 3448 | . . . . 5 ⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∧ 𝑁 = 0)) → if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < )) = sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < )) |
7 | gcdsupcl 11488 | . . . . 5 ⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∧ 𝑁 = 0)) → sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < ) ∈ ℕ) | |
8 | 6, 7 | eqeltrd 2189 | . . . 4 ⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∧ 𝑁 = 0)) → if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < )) ∈ ℕ) |
9 | 8 | nnnn0d 8927 | . . 3 ⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∧ 𝑁 = 0)) → if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < )) ∈ ℕ0) |
10 | gcdmndc 11478 | . . . 4 ⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → DECID (𝑀 = 0 ∧ 𝑁 = 0)) | |
11 | exmiddc 804 | . . . 4 ⊢ (DECID (𝑀 = 0 ∧ 𝑁 = 0) → ((𝑀 = 0 ∧ 𝑁 = 0) ∨ ¬ (𝑀 = 0 ∧ 𝑁 = 0))) | |
12 | 10, 11 | syl 14 | . . 3 ⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 = 0 ∧ 𝑁 = 0) ∨ ¬ (𝑀 = 0 ∧ 𝑁 = 0))) |
13 | 4, 9, 12 | mpjaodan 770 | . 2 ⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < )) ∈ ℕ0) |
14 | eqeq1 2119 | . . . . 5 ⊢ (𝑥 = 𝑀 → (𝑥 = 0 ↔ 𝑀 = 0)) | |
15 | 14 | anbi1d 458 | . . . 4 ⊢ (𝑥 = 𝑀 → ((𝑥 = 0 ∧ 𝑦 = 0) ↔ (𝑀 = 0 ∧ 𝑦 = 0))) |
16 | breq2 3897 | . . . . . . 7 ⊢ (𝑥 = 𝑀 → (𝑛 ∥ 𝑥 ↔ 𝑛 ∥ 𝑀)) | |
17 | 16 | anbi1d 458 | . . . . . 6 ⊢ (𝑥 = 𝑀 → ((𝑛 ∥ 𝑥 ∧ 𝑛 ∥ 𝑦) ↔ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑦))) |
18 | 17 | rabbidv 2644 | . . . . 5 ⊢ (𝑥 = 𝑀 → {𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑥 ∧ 𝑛 ∥ 𝑦)} = {𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑦)}) |
19 | 18 | supeq1d 6823 | . . . 4 ⊢ (𝑥 = 𝑀 → sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑥 ∧ 𝑛 ∥ 𝑦)}, ℝ, < ) = sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑦)}, ℝ, < )) |
20 | 15, 19 | ifbieq2d 3460 | . . 3 ⊢ (𝑥 = 𝑀 → if((𝑥 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑥 ∧ 𝑛 ∥ 𝑦)}, ℝ, < )) = if((𝑀 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑦)}, ℝ, < ))) |
21 | eqeq1 2119 | . . . . 5 ⊢ (𝑦 = 𝑁 → (𝑦 = 0 ↔ 𝑁 = 0)) | |
22 | 21 | anbi2d 457 | . . . 4 ⊢ (𝑦 = 𝑁 → ((𝑀 = 0 ∧ 𝑦 = 0) ↔ (𝑀 = 0 ∧ 𝑁 = 0))) |
23 | breq2 3897 | . . . . . . 7 ⊢ (𝑦 = 𝑁 → (𝑛 ∥ 𝑦 ↔ 𝑛 ∥ 𝑁)) | |
24 | 23 | anbi2d 457 | . . . . . 6 ⊢ (𝑦 = 𝑁 → ((𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑦) ↔ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁))) |
25 | 24 | rabbidv 2644 | . . . . 5 ⊢ (𝑦 = 𝑁 → {𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑦)} = {𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}) |
26 | 25 | supeq1d 6823 | . . . 4 ⊢ (𝑦 = 𝑁 → sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑦)}, ℝ, < ) = sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < )) |
27 | 22, 26 | ifbieq2d 3460 | . . 3 ⊢ (𝑦 = 𝑁 → if((𝑀 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑦)}, ℝ, < )) = if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < ))) |
28 | df-gcd 11477 | . . 3 ⊢ gcd = (𝑥 ∈ ℤ, 𝑦 ∈ ℤ ↦ if((𝑥 = 0 ∧ 𝑦 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑥 ∧ 𝑛 ∥ 𝑦)}, ℝ, < ))) | |
29 | 20, 27, 28 | ovmpog 5857 | . 2 ⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ ∧ if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < )) ∈ ℕ0) → (𝑀 gcd 𝑁) = if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < ))) |
30 | 13, 29 | mpd3an3 1297 | 1 ⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) = if((𝑀 = 0 ∧ 𝑁 = 0), 0, sup({𝑛 ∈ ℤ ∣ (𝑛 ∥ 𝑀 ∧ 𝑛 ∥ 𝑁)}, ℝ, < ))) |
Colors of variables: wff set class |
Syntax hints: ¬ wn 3 → wi 4 ∧ wa 103 ∨ wo 680 DECID wdc 802 = wceq 1312 ∈ wcel 1461 {crab 2392 ifcif 3438 class class class wbr 3893 (class class class)co 5726 supcsup 6818 ℝcr 7539 0cc0 7540 < clt 7717 ℕcn 8623 ℕ0cn0 8874 ℤcz 8951 ∥ cdvds 11334 gcd cgcd 11476 |
This theorem was proved from axioms: ax-1 5 ax-2 6 ax-mp 7 ax-ia1 105 ax-ia2 106 ax-ia3 107 ax-in1 586 ax-in2 587 ax-io 681 ax-5 1404 ax-7 1405 ax-gen 1406 ax-ie1 1450 ax-ie2 1451 ax-8 1463 ax-10 1464 ax-11 1465 ax-i12 1466 ax-bndl 1467 ax-4 1468 ax-13 1472 ax-14 1473 ax-17 1487 ax-i9 1491 ax-ial 1495 ax-i5r 1496 ax-ext 2095 ax-coll 4001 ax-sep 4004 ax-nul 4012 ax-pow 4056 ax-pr 4089 ax-un 4313 ax-setind 4410 ax-iinf 4460 ax-cnex 7629 ax-resscn 7630 ax-1cn 7631 ax-1re 7632 ax-icn 7633 ax-addcl 7634 ax-addrcl 7635 ax-mulcl 7636 ax-mulrcl 7637 ax-addcom 7638 ax-mulcom 7639 ax-addass 7640 ax-mulass 7641 ax-distr 7642 ax-i2m1 7643 ax-0lt1 7644 ax-1rid 7645 ax-0id 7646 ax-rnegex 7647 ax-precex 7648 ax-cnre 7649 ax-pre-ltirr 7650 ax-pre-ltwlin 7651 ax-pre-lttrn 7652 ax-pre-apti 7653 ax-pre-ltadd 7654 ax-pre-mulgt0 7655 ax-pre-mulext 7656 ax-arch 7657 ax-caucvg 7658 |
This theorem depends on definitions: df-bi 116 df-dc 803 df-3or 944 df-3an 945 df-tru 1315 df-fal 1318 df-nf 1418 df-sb 1717 df-eu 1976 df-mo 1977 df-clab 2100 df-cleq 2106 df-clel 2109 df-nfc 2242 df-ne 2281 df-nel 2376 df-ral 2393 df-rex 2394 df-reu 2395 df-rmo 2396 df-rab 2397 df-v 2657 df-sbc 2877 df-csb 2970 df-dif 3037 df-un 3039 df-in 3041 df-ss 3048 df-nul 3328 df-if 3439 df-pw 3476 df-sn 3497 df-pr 3498 df-op 3500 df-uni 3701 df-int 3736 df-iun 3779 df-br 3894 df-opab 3948 df-mpt 3949 df-tr 3985 df-id 4173 df-po 4176 df-iso 4177 df-iord 4246 df-on 4248 df-ilim 4249 df-suc 4251 df-iom 4463 df-xp 4503 df-rel 4504 df-cnv 4505 df-co 4506 df-dm 4507 df-rn 4508 df-res 4509 df-ima 4510 df-iota 5044 df-fun 5081 df-fn 5082 df-f 5083 df-f1 5084 df-fo 5085 df-f1o 5086 df-fv 5087 df-riota 5682 df-ov 5729 df-oprab 5730 df-mpo 5731 df-1st 5989 df-2nd 5990 df-recs 6153 df-frec 6239 df-sup 6820 df-pnf 7719 df-mnf 7720 df-xr 7721 df-ltxr 7722 df-le 7723 df-sub 7851 df-neg 7852 df-reap 8248 df-ap 8255 df-div 8339 df-inn 8624 df-2 8682 df-3 8683 df-4 8684 df-n0 8875 df-z 8952 df-uz 9222 df-q 9307 df-rp 9337 df-fz 9677 df-fzo 9806 df-fl 9929 df-mod 9982 df-seqfrec 10105 df-exp 10179 df-cj 10500 df-re 10501 df-im 10502 df-rsqrt 10655 df-abs 10656 df-dvds 11335 df-gcd 11477 |
This theorem is referenced by: gcd0val 11490 gcdn0val 11491 gcdf 11502 gcdcom 11503 dfgcd2 11541 gcdass 11542 |
Copyright terms: Public domain | W3C validator |