Proof of Theorem gcdneg
Step | Hyp | Ref
| Expression |
1 | | oveq12 5862 |
. . . . 5
⊢ ((𝑀 = 0 ∧ 𝑁 = 0) → (𝑀 gcd 𝑁) = (0 gcd 0)) |
2 | 1 | adantl 275 |
. . . 4
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (0 gcd 0)) |
3 | | zcn 9217 |
. . . . . . . . 9
⊢ (𝑁 ∈ ℤ → 𝑁 ∈
ℂ) |
4 | 3 | negeq0d 8222 |
. . . . . . . 8
⊢ (𝑁 ∈ ℤ → (𝑁 = 0 ↔ -𝑁 = 0)) |
5 | 4 | anbi2d 461 |
. . . . . . 7
⊢ (𝑁 ∈ ℤ → ((𝑀 = 0 ∧ 𝑁 = 0) ↔ (𝑀 = 0 ∧ -𝑁 = 0))) |
6 | 5 | adantl 275 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 = 0 ∧ 𝑁 = 0) ↔ (𝑀 = 0 ∧ -𝑁 = 0))) |
7 | | oveq12 5862 |
. . . . . 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 2206 |
. . 3
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ (𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
11 | | gcddvds 11918 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ 𝑁)) |
12 | | gcdcl 11921 |
. . . . . . . . . 10
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈
ℕ0) |
13 | 12 | nn0zd 9332 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈ ℤ) |
14 | | dvdsnegb 11770 |
. . . . . . . . 9
⊢ (((𝑀 gcd 𝑁) ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑁 ↔ (𝑀 gcd 𝑁) ∥ -𝑁)) |
15 | 13, 14 | sylancom 418 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑁 ↔ (𝑀 gcd 𝑁) ∥ -𝑁)) |
16 | 15 | anbi2d 461 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ 𝑁) ↔ ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁))) |
17 | 11, 16 | mpbid 146 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd 𝑁) ∥ 𝑀 ∧ (𝑀 gcd 𝑁) ∥ -𝑁)) |
18 | 6 | notbid 662 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (¬
(𝑀 = 0 ∧ 𝑁 = 0) ↔ ¬ (𝑀 = 0 ∧ -𝑁 = 0))) |
19 | | simpl 108 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → 𝑀 ∈
ℤ) |
20 | | znegcl 9243 |
. . . . . . . . . 10
⊢ (𝑁 ∈ ℤ → -𝑁 ∈
ℤ) |
21 | 20 | adantl 275 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → -𝑁 ∈
ℤ) |
22 | | dvdslegcd 11919 |
. . . . . . . . . 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 1233 |
. . . . . . . 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 11918 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁)) |
30 | 20, 29 | sylan2 284 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁)) |
31 | | gcdcl 11921 |
. . . . . . . . . . 11
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈
ℕ0) |
32 | 31 | nn0zd 9332 |
. . . . . . . . . 10
⊢ ((𝑀 ∈ ℤ ∧ -𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℤ) |
33 | 20, 32 | sylan2 284 |
. . . . . . . . 9
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℤ) |
34 | | dvdsnegb 11770 |
. . . . . . . . 9
⊢ (((𝑀 gcd -𝑁) ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑁 ↔ (𝑀 gcd -𝑁) ∥ -𝑁)) |
35 | 33, 34 | sylancom 418 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑁 ↔ (𝑀 gcd -𝑁) ∥ -𝑁)) |
36 | 35 | anbi2d 461 |
. . . . . . 7
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁) ↔ ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ -𝑁))) |
37 | 30, 36 | mpbird 166 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 gcd -𝑁) ∥ 𝑀 ∧ (𝑀 gcd -𝑁) ∥ 𝑁)) |
38 | | simpr 109 |
. . . . . . . 8
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → 𝑁 ∈
ℤ) |
39 | | dvdslegcd 11919 |
. . . . . . . . 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 1233 |
. . . . . . 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 9334 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) ∈ ℝ) |
46 | 33 | zred 9334 |
. . . . . 6
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) ∈ ℝ) |
47 | 45, 46 | letri3d 8035 |
. . . . 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 939 |
. . 3
⊢ (((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) ∧ ¬
(𝑀 = 0 ∧ 𝑁 = 0)) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
50 | | gcdmndc 11899 |
. . . 4
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) →
DECID (𝑀 = 0
∧ 𝑁 =
0)) |
51 | | exmiddc 831 |
. . . 4
⊢
(DECID (𝑀 = 0 ∧ 𝑁 = 0) → ((𝑀 = 0 ∧ 𝑁 = 0) ∨ ¬ (𝑀 = 0 ∧ 𝑁 = 0))) |
52 | 50, 51 | syl 14 |
. . 3
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → ((𝑀 = 0 ∧ 𝑁 = 0) ∨ ¬ (𝑀 = 0 ∧ 𝑁 = 0))) |
53 | 10, 49, 52 | mpjaodan 793 |
. 2
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd 𝑁) = (𝑀 gcd -𝑁)) |
54 | 53 | eqcomd 2176 |
1
⊢ ((𝑀 ∈ ℤ ∧ 𝑁 ∈ ℤ) → (𝑀 gcd -𝑁) = (𝑀 gcd 𝑁)) |