Proof of Theorem moddvds
Step | Hyp | Ref
| Expression |
1 | | nnq 9571 |
. . . . . 6
⊢ (𝑁 ∈ ℕ → 𝑁 ∈
ℚ) |
2 | 1 | adantr 274 |
. . . . 5
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → 𝑁 ∈
ℚ) |
3 | | nngt0 8882 |
. . . . . 6
⊢ (𝑁 ∈ ℕ → 0 <
𝑁) |
4 | 3 | adantr 274 |
. . . . 5
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → 0 <
𝑁) |
5 | | q0mod 10290 |
. . . . 5
⊢ ((𝑁 ∈ ℚ ∧ 0 <
𝑁) → (0 mod 𝑁) = 0) |
6 | 2, 4, 5 | syl2anc 409 |
. . . 4
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → (0 mod
𝑁) = 0) |
7 | 6 | eqeq2d 2177 |
. . 3
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) →
(((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁) ↔ ((𝐴 − 𝐵) mod 𝑁) = 0)) |
8 | | zq 9564 |
. . . . . . . . 9
⊢ (𝐴 ∈ ℤ → 𝐴 ∈
ℚ) |
9 | 8 | ad2antrl 482 |
. . . . . . . 8
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → 𝐴 ∈
ℚ) |
10 | 9 | adantr 274 |
. . . . . . 7
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ (𝐴 mod 𝑁) = (𝐵 mod 𝑁)) → 𝐴 ∈ ℚ) |
11 | | zq 9564 |
. . . . . . . . 9
⊢ (𝐵 ∈ ℤ → 𝐵 ∈
ℚ) |
12 | 11 | ad2antll 483 |
. . . . . . . 8
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → 𝐵 ∈
ℚ) |
13 | 12 | adantr 274 |
. . . . . . 7
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ (𝐴 mod 𝑁) = (𝐵 mod 𝑁)) → 𝐵 ∈ ℚ) |
14 | | qnegcl 9574 |
. . . . . . . 8
⊢ (𝐵 ∈ ℚ → -𝐵 ∈
ℚ) |
15 | 13, 14 | syl 14 |
. . . . . . 7
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ (𝐴 mod 𝑁) = (𝐵 mod 𝑁)) → -𝐵 ∈ ℚ) |
16 | 2 | adantr 274 |
. . . . . . 7
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ (𝐴 mod 𝑁) = (𝐵 mod 𝑁)) → 𝑁 ∈ ℚ) |
17 | 4 | adantr 274 |
. . . . . . 7
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ (𝐴 mod 𝑁) = (𝐵 mod 𝑁)) → 0 < 𝑁) |
18 | | simpr 109 |
. . . . . . 7
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ (𝐴 mod 𝑁) = (𝐵 mod 𝑁)) → (𝐴 mod 𝑁) = (𝐵 mod 𝑁)) |
19 | 10, 13, 15, 16, 17, 18 | modqadd1 10296 |
. . . . . 6
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ (𝐴 mod 𝑁) = (𝐵 mod 𝑁)) → ((𝐴 + -𝐵) mod 𝑁) = ((𝐵 + -𝐵) mod 𝑁)) |
20 | 19 | ex 114 |
. . . . 5
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → ((𝐴 mod 𝑁) = (𝐵 mod 𝑁) → ((𝐴 + -𝐵) mod 𝑁) = ((𝐵 + -𝐵) mod 𝑁))) |
21 | | simprl 521 |
. . . . . . . . 9
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → 𝐴 ∈
ℤ) |
22 | 21 | zcnd 9314 |
. . . . . . . 8
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → 𝐴 ∈
ℂ) |
23 | | simprr 522 |
. . . . . . . . 9
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → 𝐵 ∈
ℤ) |
24 | 23 | zcnd 9314 |
. . . . . . . 8
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → 𝐵 ∈
ℂ) |
25 | 22, 24 | negsubd 8215 |
. . . . . . 7
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → (𝐴 + -𝐵) = (𝐴 − 𝐵)) |
26 | 25 | oveq1d 5857 |
. . . . . 6
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → ((𝐴 + -𝐵) mod 𝑁) = ((𝐴 − 𝐵) mod 𝑁)) |
27 | 24 | negidd 8199 |
. . . . . . 7
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → (𝐵 + -𝐵) = 0) |
28 | 27 | oveq1d 5857 |
. . . . . 6
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → ((𝐵 + -𝐵) mod 𝑁) = (0 mod 𝑁)) |
29 | 26, 28 | eqeq12d 2180 |
. . . . 5
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) →
(((𝐴 + -𝐵) mod 𝑁) = ((𝐵 + -𝐵) mod 𝑁) ↔ ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁))) |
30 | 20, 29 | sylibd 148 |
. . . 4
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → ((𝐴 mod 𝑁) = (𝐵 mod 𝑁) → ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁))) |
31 | 9 | adantr 274 |
. . . . . . . 8
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁)) → 𝐴 ∈ ℚ) |
32 | 12 | adantr 274 |
. . . . . . . 8
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁)) → 𝐵 ∈ ℚ) |
33 | | qsubcl 9576 |
. . . . . . . 8
⊢ ((𝐴 ∈ ℚ ∧ 𝐵 ∈ ℚ) → (𝐴 − 𝐵) ∈ ℚ) |
34 | 31, 32, 33 | syl2anc 409 |
. . . . . . 7
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁)) → (𝐴 − 𝐵) ∈ ℚ) |
35 | | 0z 9202 |
. . . . . . . 8
⊢ 0 ∈
ℤ |
36 | | zq 9564 |
. . . . . . . 8
⊢ (0 ∈
ℤ → 0 ∈ ℚ) |
37 | 35, 36 | mp1i 10 |
. . . . . . 7
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁)) → 0 ∈ ℚ) |
38 | 2 | adantr 274 |
. . . . . . 7
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁)) → 𝑁 ∈ ℚ) |
39 | 4 | adantr 274 |
. . . . . . 7
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁)) → 0 < 𝑁) |
40 | | simpr 109 |
. . . . . . 7
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁)) → ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁)) |
41 | 34, 37, 32, 38, 39, 40 | modqadd1 10296 |
. . . . . 6
⊢ (((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) ∧ ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁)) → (((𝐴 − 𝐵) + 𝐵) mod 𝑁) = ((0 + 𝐵) mod 𝑁)) |
42 | 41 | ex 114 |
. . . . 5
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) →
(((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁) → (((𝐴 − 𝐵) + 𝐵) mod 𝑁) = ((0 + 𝐵) mod 𝑁))) |
43 | 22, 24 | npcand 8213 |
. . . . . . 7
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → ((𝐴 − 𝐵) + 𝐵) = 𝐴) |
44 | 43 | oveq1d 5857 |
. . . . . 6
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) →
(((𝐴 − 𝐵) + 𝐵) mod 𝑁) = (𝐴 mod 𝑁)) |
45 | 24 | addid2d 8048 |
. . . . . . 7
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → (0 +
𝐵) = 𝐵) |
46 | 45 | oveq1d 5857 |
. . . . . 6
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → ((0 +
𝐵) mod 𝑁) = (𝐵 mod 𝑁)) |
47 | 44, 46 | eqeq12d 2180 |
. . . . 5
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) →
((((𝐴 − 𝐵) + 𝐵) mod 𝑁) = ((0 + 𝐵) mod 𝑁) ↔ (𝐴 mod 𝑁) = (𝐵 mod 𝑁))) |
48 | 42, 47 | sylibd 148 |
. . . 4
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) →
(((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁) → (𝐴 mod 𝑁) = (𝐵 mod 𝑁))) |
49 | 30, 48 | impbid 128 |
. . 3
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → ((𝐴 mod 𝑁) = (𝐵 mod 𝑁) ↔ ((𝐴 − 𝐵) mod 𝑁) = (0 mod 𝑁))) |
50 | | zsubcl 9232 |
. . . 4
⊢ ((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → (𝐴 − 𝐵) ∈ ℤ) |
51 | | dvdsval3 11731 |
. . . 4
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 − 𝐵) ∈ ℤ) → (𝑁 ∥ (𝐴 − 𝐵) ↔ ((𝐴 − 𝐵) mod 𝑁) = 0)) |
52 | 50, 51 | sylan2 284 |
. . 3
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → (𝑁 ∥ (𝐴 − 𝐵) ↔ ((𝐴 − 𝐵) mod 𝑁) = 0)) |
53 | 7, 49, 52 | 3bitr4d 219 |
. 2
⊢ ((𝑁 ∈ ℕ ∧ (𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ)) → ((𝐴 mod 𝑁) = (𝐵 mod 𝑁) ↔ 𝑁 ∥ (𝐴 − 𝐵))) |
54 | 53 | 3impb 1189 |
1
⊢ ((𝑁 ∈ ℕ ∧ 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → ((𝐴 mod 𝑁) = (𝐵 mod 𝑁) ↔ 𝑁 ∥ (𝐴 − 𝐵))) |