Proof of Theorem modqmuladd
Step | Hyp | Ref
| Expression |
1 | | modqmuladd.a |
. . . . . . 7
⊢ (𝜑 → 𝐴 ∈ ℤ) |
2 | | zq 9564 |
. . . . . . 7
⊢ (𝐴 ∈ ℤ → 𝐴 ∈
ℚ) |
3 | 1, 2 | syl 14 |
. . . . . 6
⊢ (𝜑 → 𝐴 ∈ ℚ) |
4 | | modqmuladd.m |
. . . . . 6
⊢ (𝜑 → 𝑀 ∈ ℚ) |
5 | | modqmuladd.mgt0 |
. . . . . . 7
⊢ (𝜑 → 0 < 𝑀) |
6 | 5 | gt0ne0d 8410 |
. . . . . 6
⊢ (𝜑 → 𝑀 ≠ 0) |
7 | | qdivcl 9581 |
. . . . . 6
⊢ ((𝐴 ∈ ℚ ∧ 𝑀 ∈ ℚ ∧ 𝑀 ≠ 0) → (𝐴 / 𝑀) ∈ ℚ) |
8 | 3, 4, 6, 7 | syl3anc 1228 |
. . . . 5
⊢ (𝜑 → (𝐴 / 𝑀) ∈ ℚ) |
9 | 8 | flqcld 10212 |
. . . 4
⊢ (𝜑 → (⌊‘(𝐴 / 𝑀)) ∈ ℤ) |
10 | | oveq1 5849 |
. . . . . . 7
⊢ (𝑘 = (⌊‘(𝐴 / 𝑀)) → (𝑘 · 𝑀) = ((⌊‘(𝐴 / 𝑀)) · 𝑀)) |
11 | 10 | oveq1d 5857 |
. . . . . 6
⊢ (𝑘 = (⌊‘(𝐴 / 𝑀)) → ((𝑘 · 𝑀) + (𝐴 mod 𝑀)) = (((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀))) |
12 | 11 | eqeq2d 2177 |
. . . . 5
⊢ (𝑘 = (⌊‘(𝐴 / 𝑀)) → (𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀)) ↔ 𝐴 = (((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀)))) |
13 | 12 | adantl 275 |
. . . 4
⊢ ((𝜑 ∧ 𝑘 = (⌊‘(𝐴 / 𝑀))) → (𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀)) ↔ 𝐴 = (((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀)))) |
14 | | flqpmodeq 10262 |
. . . . . 6
⊢ ((𝐴 ∈ ℚ ∧ 𝑀 ∈ ℚ ∧ 0 <
𝑀) →
(((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀)) = 𝐴) |
15 | 3, 4, 5, 14 | syl3anc 1228 |
. . . . 5
⊢ (𝜑 → (((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀)) = 𝐴) |
16 | 15 | eqcomd 2171 |
. . . 4
⊢ (𝜑 → 𝐴 = (((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀))) |
17 | 9, 13, 16 | rspcedvd 2836 |
. . 3
⊢ (𝜑 → ∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀))) |
18 | | oveq2 5850 |
. . . . . 6
⊢ (𝐵 = (𝐴 mod 𝑀) → ((𝑘 · 𝑀) + 𝐵) = ((𝑘 · 𝑀) + (𝐴 mod 𝑀))) |
19 | 18 | eqeq2d 2177 |
. . . . 5
⊢ (𝐵 = (𝐴 mod 𝑀) → (𝐴 = ((𝑘 · 𝑀) + 𝐵) ↔ 𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀)))) |
20 | 19 | eqcoms 2168 |
. . . 4
⊢ ((𝐴 mod 𝑀) = 𝐵 → (𝐴 = ((𝑘 · 𝑀) + 𝐵) ↔ 𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀)))) |
21 | 20 | rexbidv 2467 |
. . 3
⊢ ((𝐴 mod 𝑀) = 𝐵 → (∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + 𝐵) ↔ ∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀)))) |
22 | 17, 21 | syl5ibrcom 156 |
. 2
⊢ (𝜑 → ((𝐴 mod 𝑀) = 𝐵 → ∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + 𝐵))) |
23 | | oveq1 5849 |
. . . . . 6
⊢ (𝐴 = ((𝑘 · 𝑀) + 𝐵) → (𝐴 mod 𝑀) = (((𝑘 · 𝑀) + 𝐵) mod 𝑀)) |
24 | 23 | adantl 275 |
. . . . 5
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → (𝐴 mod 𝑀) = (((𝑘 · 𝑀) + 𝐵) mod 𝑀)) |
25 | | simplr 520 |
. . . . . 6
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → 𝑘 ∈ ℤ) |
26 | 4 | ad2antrr 480 |
. . . . . 6
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → 𝑀 ∈ ℚ) |
27 | | modqmuladd.bq |
. . . . . . 7
⊢ (𝜑 → 𝐵 ∈ ℚ) |
28 | 27 | ad2antrr 480 |
. . . . . 6
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → 𝐵 ∈ ℚ) |
29 | | modqmuladd.b |
. . . . . . 7
⊢ (𝜑 → 𝐵 ∈ (0[,)𝑀)) |
30 | 29 | ad2antrr 480 |
. . . . . 6
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → 𝐵 ∈ (0[,)𝑀)) |
31 | | mulqaddmodid 10299 |
. . . . . 6
⊢ (((𝑘 ∈ ℤ ∧ 𝑀 ∈ ℚ) ∧ (𝐵 ∈ ℚ ∧ 𝐵 ∈ (0[,)𝑀))) → (((𝑘 · 𝑀) + 𝐵) mod 𝑀) = 𝐵) |
32 | 25, 26, 28, 30, 31 | syl22anc 1229 |
. . . . 5
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → (((𝑘 · 𝑀) + 𝐵) mod 𝑀) = 𝐵) |
33 | 24, 32 | eqtrd 2198 |
. . . 4
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → (𝐴 mod 𝑀) = 𝐵) |
34 | 33 | ex 114 |
. . 3
⊢ ((𝜑 ∧ 𝑘 ∈ ℤ) → (𝐴 = ((𝑘 · 𝑀) + 𝐵) → (𝐴 mod 𝑀) = 𝐵)) |
35 | 34 | rexlimdva 2583 |
. 2
⊢ (𝜑 → (∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + 𝐵) → (𝐴 mod 𝑀) = 𝐵)) |
36 | 22, 35 | impbid 128 |
1
⊢ (𝜑 → ((𝐴 mod 𝑀) = 𝐵 ↔ ∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + 𝐵))) |