Proof of Theorem gcdneg
Step | Hyp | Ref
| Expression |
1 | | oveq12 5851 |
. . . . 5
⊢ ((𝑀 = 0 ∧ 𝑁 = 0) → (𝑀 gcd 𝑁) = (0 gcd 0)) |
2 | 1 | adantl 275 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (0 gcd 0)) |
3 | | zcn 9196 |
. . . . . . . . 9
⊢ (𝑁 ∈ ℤ → 𝑁 ∈
ℂ) |
4 | 3 | negeq0d 8201 |
. . . . . . . 8
⊢ (𝑁 ∈ ℤ → (𝑁 = 0 ↔ -𝑁 = 0)) |
5 | 4 | anbi2d 460 |
. . . . . . 7
⊢ (𝑁 ∈ ℤ → ((𝑀 = 0 ∧ 𝑁 = 0) ↔ (𝑀 = 0 ∧ -𝑁 = 0))) |
6 | 5 | adantl 275 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 = 0 ∧ 𝑁 = 0) ↔ (𝑀 = 0 ∧ -𝑁 = 0))) |
7 | | oveq12 5851 |
. . . . . 6
⊢ ((𝑀 = 0 ∧ -𝑁 = 0) → (𝑀 gcd -𝑁) = (0 gcd 0)) |
8 | 6, 7 | syl6bi 162 |
. . . . 5
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 = 0 ∧ 𝑁 = 0) → (𝑀 gcd -𝑁) = (0 gcd 0))) |
9 | 8 | imp 123 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd -𝑁) = (0 gcd 0)) |
10 | 2, 9 | eqtr4d 2201 |
. . 3
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
11 | | gcddvds 11896 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ 𝑁)) |
12 | | gcdcl 11899 |
. . . . . . . . . 10
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈
ℕ0) |
13 | 12 | nn0zd 9311 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈ ℤ) |
14 | | dvdsnegb 11748 |
. . . . . . . . 9
⊢ (((𝑀 gcd 𝑁) ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑁 ↔ (𝑀 gcd 𝑁) ∥ -𝑁)) |
15 | 13, 14 | sylancom 417 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑁 ↔ (𝑀 gcd 𝑁) ∥ -𝑁)) |
16 | 15 | anbi2d 460 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ 𝑁) ↔ ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁))) |
17 | 11, 16 | mpbid 146 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁)) |
18 | 6 | notbid 657 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬
(𝑀 = 0 ∧ 𝑁 = 0) ↔ ¬ (𝑀 = 0 ∧ -𝑁 = 0))) |
19 | | simpl 108 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → 𝑀 ∈
ℤ) |
20 | | znegcl 9222 |
. . . . . . . . . 10
⊢ (𝑁 ∈ ℤ → -𝑁 ∈
ℤ) |
21 | 20 | adantl 275 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → -𝑁 ∈
ℤ) |
22 | | dvdslegcd 11897 |
. . . . . . . . . 10
⊢ ((((𝑀 gcd 𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∧ -𝑁 = 0)) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁))) |
23 | 22 | ex 114 |
. . . . . . . . 9
⊢ (((𝑀 gcd 𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → (¬ (𝑀 = 0 ∧ -𝑁 = 0) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)))) |
24 | 13, 19, 21, 23 | syl3anc 1228 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬
(𝑀 = 0 ∧ -𝑁 = 0) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)))) |
25 | 18, 24 | sylbid 149 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬
(𝑀 = 0 ∧ 𝑁 = 0) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)))) |
26 | 25 | com12 30 |
. . . . . 6
⊢ (¬
(𝑀 = 0 ∧ 𝑁 = 0) → ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)))) |
27 | 17, 26 | mpdi 43 |
. . . . 5
⊢ (¬
(𝑀 = 0 ∧ 𝑁 = 0) → ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁))) |
28 | 27 | impcom 124 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁)) |
29 | | gcddvds 11896 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁)) |
30 | 20, 29 | sylan2 284 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁)) |
31 | | gcdcl 11899 |
. . . . . . . . . . 11
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈
ℕ0) |
32 | 31 | nn0zd 9311 |
. . . . . . . . . 10
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℤ) |
33 | 20, 32 | sylan2 284 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℤ) |
34 | | dvdsnegb 11748 |
. . . . . . . . 9
⊢ (((𝑀 gcd -𝑁) ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑁 ↔ (𝑀 gcd -𝑁) ∥ -𝑁)) |
35 | 33, 34 | sylancom 417 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑁 ↔ (𝑀 gcd -𝑁) ∥ -𝑁)) |
36 | 35 | anbi2d 460 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) ↔ ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁))) |
37 | 30, 36 | mpbird 166 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁)) |
38 | | simpr 109 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → 𝑁 ∈
ℤ) |
39 | | dvdslegcd 11897 |
. . . . . . . . 9
⊢ ((((𝑀 gcd -𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬ (𝑀 = 0 ∧ 𝑁 = 0)) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁))) |
40 | 39 | ex 114 |
. . . . . . . 8
⊢ (((𝑀 gcd -𝑁) ∈ ℤ ∧ 𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬ (𝑀 = 0 ∧ 𝑁 = 0) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
41 | 33, 19, 38, 40 | syl3anc 1228 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬
(𝑀 = 0 ∧ 𝑁 = 0) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
42 | 41 | com12 30 |
. . . . . 6
⊢ (¬
(𝑀 = 0 ∧ 𝑁 = 0) → ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
43 | 37, 42 | mpdi 43 |
. . . . 5
⊢ (¬
(𝑀 = 0 ∧ 𝑁 = 0) → ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁))) |
44 | 43 | impcom 124 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)) |
45 | 13 | zred 9313 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈ ℝ) |
46 | 33 | zred 9313 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℝ) |
47 | 45, 46 | letri3d 8014 |
. . . . 5
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) = (𝑀 gcd -𝑁) ↔ ((𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁) ∧ (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
48 | 47 | adantr 274 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → ((𝑀 gcd 𝑁) = (𝑀 gcd -𝑁) ↔ ((𝑀 gcd 𝑁) ≤ (𝑀 gcd -𝑁) ∧ (𝑀 gcd -𝑁) ≤ (𝑀 gcd 𝑁)))) |
49 | 28, 44, 48 | mpbir2and 934 |
. . 3
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
50 | | gcdmndc 11877 |
. . . 4
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) →
DECID (𝑀 = 0
∧ 𝑁 =
0)) |
51 | | exmiddc 826 |
. . . 4
⊢
(DECID (𝑀 = 0 ∧ 𝑁 = 0) → ((𝑀 = 0 ∧ 𝑁 = 0) ∨ ¬ (𝑀 = 0 ∧ 𝑁 = 0))) |
52 | 50, 51 | syl 14 |
. . 3
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 = 0 ∧ 𝑁 = 0) ∨ ¬ (𝑀 = 0 ∧ 𝑁 = 0))) |
53 | 10, 49, 52 | mpjaodan 788 |
. 2
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
54 | 53 | eqcomd 2171 |
1
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) = (𝑀 gcd 𝑁)) |