Proof of Theorem gcdneg
Step | Hyp | Ref
| Expression |
1 | | oveq12 7264 |
. . . . 5
⊢ ((𝑀 = 0 ∧ 𝑁 = 0) → (𝑀 gcd 𝑁) = (0 gcd 0)) |
2 | 1 | adantl 481 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (0 gcd 0)) |
3 | | zcn 12254 |
. . . . . . . . 9
⊢ (𝑁 ∈ ℤ → 𝑁 ∈
ℂ) |
4 | 3 | negeq0d 11254 |
. . . . . . . 8
⊢ (𝑁 ∈ ℤ → (𝑁 = 0 ↔ -𝑁 = 0)) |
5 | 4 | anbi2d 628 |
. . . . . . 7
⊢ (𝑁 ∈ ℤ → ((𝑀 = 0 ∧ 𝑁 = 0) ↔ (𝑀 = 0 ∧ -𝑁 = 0))) |
6 | 5 | adantl 481 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 = 0 ∧ 𝑁 = 0) ↔ (𝑀 = 0 ∧ -𝑁 = 0))) |
7 | | oveq12 7264 |
. . . . . 6
⊢ ((𝑀 = 0 ∧ -𝑁 = 0) → (𝑀 gcd -𝑁) = (0 gcd 0)) |
8 | 6, 7 | syl6bi 252 |
. . . . 5
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 = 0 ∧ 𝑁 = 0) → (𝑀 gcd -𝑁) = (0 gcd 0))) |
9 | 8 | imp 406 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd -𝑁) = (0 gcd 0)) |
10 | 2, 9 | eqtr4d 2781 |
. . 3
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
11 | | gcddvds 16138 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ 𝑁)) |
12 | | gcdcl 16141 |
. . . . . . . . . 10
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈
ℕ0) |
13 | 12 | nn0zd 12353 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈ ℤ) |
14 | | dvdsnegb 15911 |
. . . . . . . . 9
⊢ (((𝑀 gcd 𝑁) ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑁 ↔ (𝑀 gcd 𝑁) ∥ -𝑁)) |
15 | 13, 14 | sylancom 587 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑁 ↔ (𝑀 gcd 𝑁) ∥ -𝑁)) |
16 | 15 | anbi2d 628 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ 𝑁) ↔ ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁))) |
17 | 11, 16 | mpbid 231 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁)) |
18 | 6 | notbid 317 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬
(𝑀 = 0 ∧ 𝑁 = 0) ↔ ¬ (𝑀 = 0 ∧ -𝑁 = 0))) |
19 | | simpl 482 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → 𝑀 ∈
ℤ) |
20 | | znegcl 12285 |
. . . . . . . . . 10
⊢ (𝑁 ∈ ℤ → -𝑁 ∈
ℤ) |
21 | 20 | adantl 481 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → -𝑁 ∈
ℤ) |
22 | | dvdslegcd 16139 |
. . . . . . . . . 10
⊢ ((((𝑀 gcd 𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∧ -𝑁 = 0)) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁))) |
23 | 22 | ex 412 |
. . . . . . . . 9
⊢ (((𝑀 gcd 𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → (¬ (𝑀 = 0 ∧ -𝑁 = 0) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)))) |
24 | 13, 19, 21, 23 | syl3anc 1369 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬
(𝑀 = 0 ∧ -𝑁 = 0) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)))) |
25 | 18, 24 | sylbid 239 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬
(𝑀 = 0 ∧ 𝑁 = 0) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)))) |
26 | 25 | com12 32 |
. . . . . 6
⊢ (¬
(𝑀 = 0 ∧ 𝑁 = 0) → ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)))) |
27 | 17, 26 | mpdi 45 |
. . . . 5
⊢ (¬
(𝑀 = 0 ∧ 𝑁 = 0) → ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁))) |
28 | 27 | impcom 407 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)) |
29 | | gcddvds 16138 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁)) |
30 | 20, 29 | sylan2 592 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁)) |
31 | | gcdcl 16141 |
. . . . . . . . . . 11
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈
ℕ0) |
32 | 31 | nn0zd 12353 |
. . . . . . . . . 10
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℤ) |
33 | 20, 32 | sylan2 592 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℤ) |
34 | | dvdsnegb 15911 |
. . . . . . . . 9
⊢ (((𝑀 gcd -𝑁) ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑁 ↔ (𝑀 gcd -𝑁) ∥ -𝑁)) |
35 | 33, 34 | sylancom 587 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑁 ↔ (𝑀 gcd -𝑁) ∥ -𝑁)) |
36 | 35 | anbi2d 628 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) ↔ ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁))) |
37 | 30, 36 | mpbird 256 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁)) |
38 | | simpr 484 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → 𝑁 ∈
ℤ) |
39 | | dvdslegcd 16139 |
. . . . . . . . 9
⊢ ((((𝑀 gcd -𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∧ 𝑁 = 0)) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁))) |
40 | 39 | ex 412 |
. . . . . . . 8
⊢ (((𝑀 gcd -𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬ (𝑀 = 0 ∧ 𝑁 = 0) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
41 | 33, 19, 38, 40 | syl3anc 1369 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬
(𝑀 = 0 ∧ 𝑁 = 0) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
42 | 41 | com12 32 |
. . . . . 6
⊢ (¬
(𝑀 = 0 ∧ 𝑁 = 0) → ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
43 | 37, 42 | mpdi 45 |
. . . . 5
⊢ (¬
(𝑀 = 0 ∧ 𝑁 = 0) → ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁))) |
44 | 43 | impcom 407 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)) |
45 | 13 | zred 12355 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈ ℝ) |
46 | 33 | zred 12355 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℝ) |
47 | 45, 46 | letri3d 11047 |
. . . . 5
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) = (𝑀 gcd -𝑁) ↔ ((𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁) ∧ (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
48 | 47 | adantr 480 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → ((𝑀 gcd 𝑁) = (𝑀 gcd -𝑁) ↔ ((𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁) ∧ (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
49 | 28, 44, 48 | mpbir2and 709 |
. . 3
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
50 | 10, 49 | pm2.61dan 809 |
. 2
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
51 | 50 | eqcomd 2744 |
1
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) = (𝑀 gcd 𝑁)) |