Proof of Theorem modremain
Step | Hyp | Ref
| Expression |
1 | | eqcom 2745 |
. 2
⊢ ((𝑁 mod 𝐷) = 𝑅 ↔ 𝑅 = (𝑁 mod 𝐷)) |
2 | | divalgmodcl 16116 |
. . . 4
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ 𝑅 ∈ ℕ0)
→ (𝑅 = (𝑁 mod 𝐷) ↔ (𝑅 < 𝐷 ∧ 𝐷 ∥ (𝑁 − 𝑅)))) |
3 | 2 | 3adant3r 1180 |
. . 3
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → (𝑅 = (𝑁 mod 𝐷) ↔ (𝑅 < 𝐷 ∧ 𝐷 ∥ (𝑁 − 𝑅)))) |
4 | | ibar 529 |
. . . . 5
⊢ (𝑅 < 𝐷 → (𝐷 ∥ (𝑁 − 𝑅) ↔ (𝑅 < 𝐷 ∧ 𝐷 ∥ (𝑁 − 𝑅)))) |
5 | 4 | adantl 482 |
. . . 4
⊢ ((𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷) → (𝐷 ∥ (𝑁 − 𝑅) ↔ (𝑅 < 𝐷 ∧ 𝐷 ∥ (𝑁 − 𝑅)))) |
6 | 5 | 3ad2ant3 1134 |
. . 3
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → (𝐷 ∥ (𝑁 − 𝑅) ↔ (𝑅 < 𝐷 ∧ 𝐷 ∥ (𝑁 − 𝑅)))) |
7 | | nnz 12342 |
. . . . . 6
⊢ (𝐷 ∈ ℕ → 𝐷 ∈
ℤ) |
8 | 7 | 3ad2ant2 1133 |
. . . . 5
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → 𝐷 ∈ ℤ) |
9 | | simp1 1135 |
. . . . . 6
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → 𝑁 ∈ ℤ) |
10 | | nn0z 12343 |
. . . . . . . 8
⊢ (𝑅 ∈ ℕ0
→ 𝑅 ∈
ℤ) |
11 | 10 | adantr 481 |
. . . . . . 7
⊢ ((𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷) → 𝑅 ∈ ℤ) |
12 | 11 | 3ad2ant3 1134 |
. . . . . 6
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → 𝑅 ∈ ℤ) |
13 | 9, 12 | zsubcld 12431 |
. . . . 5
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → (𝑁 − 𝑅) ∈ ℤ) |
14 | | divides 15965 |
. . . . 5
⊢ ((𝐷 ∈ ℤ ∧ (𝑁 − 𝑅) ∈ ℤ) → (𝐷 ∥ (𝑁 − 𝑅) ↔ ∃𝑧 ∈ ℤ (𝑧 · 𝐷) = (𝑁 − 𝑅))) |
15 | 8, 13, 14 | syl2anc 584 |
. . . 4
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → (𝐷 ∥ (𝑁 − 𝑅) ↔ ∃𝑧 ∈ ℤ (𝑧 · 𝐷) = (𝑁 − 𝑅))) |
16 | | eqcom 2745 |
. . . . . 6
⊢ ((𝑧 · 𝐷) = (𝑁 − 𝑅) ↔ (𝑁 − 𝑅) = (𝑧 · 𝐷)) |
17 | | zcn 12324 |
. . . . . . . . 9
⊢ (𝑁 ∈ ℤ → 𝑁 ∈
ℂ) |
18 | 17 | 3ad2ant1 1132 |
. . . . . . . 8
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → 𝑁 ∈ ℂ) |
19 | 18 | adantr 481 |
. . . . . . 7
⊢ (((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) ∧ 𝑧 ∈ ℤ) → 𝑁 ∈ ℂ) |
20 | | nn0cn 12243 |
. . . . . . . . . 10
⊢ (𝑅 ∈ ℕ0
→ 𝑅 ∈
ℂ) |
21 | 20 | adantr 481 |
. . . . . . . . 9
⊢ ((𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷) → 𝑅 ∈ ℂ) |
22 | 21 | 3ad2ant3 1134 |
. . . . . . . 8
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → 𝑅 ∈ ℂ) |
23 | 22 | adantr 481 |
. . . . . . 7
⊢ (((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) ∧ 𝑧 ∈ ℤ) → 𝑅 ∈ ℂ) |
24 | | simpr 485 |
. . . . . . . . 9
⊢ (((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) ∧ 𝑧 ∈ ℤ) → 𝑧 ∈ ℤ) |
25 | 8 | adantr 481 |
. . . . . . . . 9
⊢ (((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) ∧ 𝑧 ∈ ℤ) → 𝐷 ∈ ℤ) |
26 | 24, 25 | zmulcld 12432 |
. . . . . . . 8
⊢ (((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) ∧ 𝑧 ∈ ℤ) → (𝑧 · 𝐷) ∈ ℤ) |
27 | 26 | zcnd 12427 |
. . . . . . 7
⊢ (((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) ∧ 𝑧 ∈ ℤ) → (𝑧 · 𝐷) ∈ ℂ) |
28 | 19, 23, 27 | subadd2d 11351 |
. . . . . 6
⊢ (((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) ∧ 𝑧 ∈ ℤ) → ((𝑁 − 𝑅) = (𝑧 · 𝐷) ↔ ((𝑧 · 𝐷) + 𝑅) = 𝑁)) |
29 | 16, 28 | bitrid 282 |
. . . . 5
⊢ (((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) ∧ 𝑧 ∈ ℤ) → ((𝑧 · 𝐷) = (𝑁 − 𝑅) ↔ ((𝑧 · 𝐷) + 𝑅) = 𝑁)) |
30 | 29 | rexbidva 3225 |
. . . 4
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → (∃𝑧 ∈ ℤ (𝑧 · 𝐷) = (𝑁 − 𝑅) ↔ ∃𝑧 ∈ ℤ ((𝑧 · 𝐷) + 𝑅) = 𝑁)) |
31 | 15, 30 | bitrd 278 |
. . 3
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → (𝐷 ∥ (𝑁 − 𝑅) ↔ ∃𝑧 ∈ ℤ ((𝑧 · 𝐷) + 𝑅) = 𝑁)) |
32 | 3, 6, 31 | 3bitr2d 307 |
. 2
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → (𝑅 = (𝑁 mod 𝐷) ↔ ∃𝑧 ∈ ℤ ((𝑧 · 𝐷) + 𝑅) = 𝑁)) |
33 | 1, 32 | bitrid 282 |
1
⊢ ((𝑁 ∈ ℤ ∧ 𝐷 ∈ ℕ ∧ (𝑅 ∈ ℕ0
∧ 𝑅 < 𝐷)) → ((𝑁 mod 𝐷) = 𝑅 ↔ ∃𝑧 ∈ ℤ ((𝑧 · 𝐷) + 𝑅) = 𝑁)) |