Proof of Theorem gcdneg
Step | Hyp | Ref
| Expression |
1 | | oveq12 7284 |
. . . . 5
⊢ ((𝑀 = 0 ∧ 𝑁 = 0) → (𝑀 gcd 𝑁) = (0 gcd 0)) |
2 | 1 | adantl 482 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (0 gcd 0)) |
3 | | zcn 12324 |
. . . . . . . . 9
⊢ (𝑁 ∈ ℤ → 𝑁 ∈
ℂ) |
4 | 3 | negeq0d 11324 |
. . . . . . . 8
⊢ (𝑁 ∈ ℤ → (𝑁 = 0 ↔ -𝑁 = 0)) |
5 | 4 | anbi2d 629 |
. . . . . . 7
⊢ (𝑁 ∈ ℤ → ((𝑀 = 0 ∧ 𝑁 = 0) ↔ (𝑀 = 0 ∧ -𝑁 = 0))) |
6 | 5 | adantl 482 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 = 0 ∧ 𝑁 = 0) ↔ (𝑀 = 0 ∧ -𝑁 = 0))) |
7 | | oveq12 7284 |
. . . . . 6
⊢ ((𝑀 = 0 ∧ -𝑁 = 0) → (𝑀 gcd -𝑁) = (0 gcd 0)) |
8 | 6, 7 | syl6bi 252 |
. . . . 5
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 = 0 ∧ 𝑁 = 0) → (𝑀 gcd -𝑁) = (0 gcd 0))) |
9 | 8 | imp 407 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd -𝑁) = (0 gcd 0)) |
10 | 2, 9 | eqtr4d 2781 |
. . 3
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
11 | | gcddvds 16210 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ 𝑁)) |
12 | | gcdcl 16213 |
. . . . . . . . . 10
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈
ℕ0) |
13 | 12 | nn0zd 12424 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈ ℤ) |
14 | | dvdsnegb 15983 |
. . . . . . . . 9
⊢ (((𝑀 gcd 𝑁) ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑁 ↔ (𝑀 gcd 𝑁) ∥ -𝑁)) |
15 | 13, 14 | sylancom 588 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑁 ↔ (𝑀 gcd 𝑁) ∥ -𝑁)) |
16 | 15 | anbi2d 629 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ 𝑁) ↔ ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁))) |
17 | 11, 16 | mpbid 231 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁)) |
18 | 6 | notbid 318 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬
(𝑀 = 0 ∧ 𝑁 = 0) ↔ ¬ (𝑀 = 0 ∧ -𝑁 = 0))) |
19 | | simpl 483 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → 𝑀 ∈
ℤ) |
20 | | znegcl 12355 |
. . . . . . . . . 10
⊢ (𝑁 ∈ ℤ → -𝑁 ∈
ℤ) |
21 | 20 | adantl 482 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → -𝑁 ∈
ℤ) |
22 | | dvdslegcd 16211 |
. . . . . . . . . 10
⊢ ((((𝑀 gcd 𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∧ -𝑁 = 0)) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁))) |
23 | 22 | ex 413 |
. . . . . . . . 9
⊢ (((𝑀 gcd 𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → (¬ (𝑀 = 0 ∧ -𝑁 = 0) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)))) |
24 | 13, 19, 21, 23 | syl3anc 1370 |
. . . . . . . 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 408 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)) |
29 | | gcddvds 16210 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁)) |
30 | 20, 29 | sylan2 593 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁)) |
31 | | gcdcl 16213 |
. . . . . . . . . . 11
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈
ℕ0) |
32 | 31 | nn0zd 12424 |
. . . . . . . . . 10
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℤ) |
33 | 20, 32 | sylan2 593 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℤ) |
34 | | dvdsnegb 15983 |
. . . . . . . . 9
⊢ (((𝑀 gcd -𝑁) ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑁 ↔ (𝑀 gcd -𝑁) ∥ -𝑁)) |
35 | 33, 34 | sylancom 588 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑁 ↔ (𝑀 gcd -𝑁) ∥ -𝑁)) |
36 | 35 | anbi2d 629 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) ↔ ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁))) |
37 | 30, 36 | mpbird 256 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁)) |
38 | | simpr 485 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → 𝑁 ∈
ℤ) |
39 | | dvdslegcd 16211 |
. . . . . . . . 9
⊢ ((((𝑀 gcd -𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∧ 𝑁 = 0)) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁))) |
40 | 39 | ex 413 |
. . . . . . . 8
⊢ (((𝑀 gcd -𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬ (𝑀 = 0 ∧ 𝑁 = 0) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
41 | 33, 19, 38, 40 | syl3anc 1370 |
. . . . . . 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 408 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)) |
45 | 13 | zred 12426 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈ ℝ) |
46 | 33 | zred 12426 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℝ) |
47 | 45, 46 | letri3d 11117 |
. . . . 5
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) = (𝑀 gcd -𝑁) ↔ ((𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁) ∧ (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
48 | 47 | adantr 481 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → ((𝑀 gcd 𝑁) = (𝑀 gcd -𝑁) ↔ ((𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁) ∧ (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
49 | 28, 44, 48 | mpbir2and 710 |
. . 3
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
50 | 10, 49 | pm2.61dan 810 |
. 2
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
51 | 50 | eqcomd 2744 |
1
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) = (𝑀 gcd 𝑁)) |