Proof of Theorem modqmuladd
Step | Hyp | Ref
| Expression |
1 | | modqmuladd.a |
. . . . . . 7
⊢ (𝜑 → 𝐴 ∈ ℤ) |
2 | | zq 9585 |
. . . . . . 7
⊢ (𝐴 ∈ ℤ → 𝐴 ∈
ℚ) |
3 | 1, 2 | syl 14 |
. . . . . 6
⊢ (𝜑 → 𝐴 ∈ ℚ) |
4 | | modqmuladd.m |
. . . . . 6
⊢ (𝜑 → 𝑀 ∈ ℚ) |
5 | | modqmuladd.mgt0 |
. . . . . . 7
⊢ (𝜑 → 0 < 𝑀) |
6 | 5 | gt0ne0d 8431 |
. . . . . 6
⊢ (𝜑 → 𝑀 ≠ 0) |
7 | | qdivcl 9602 |
. . . . . 6
⊢ ((𝐴 ∈ ℚ ∧ 𝑀 ∈ ℚ ∧ 𝑀 ≠ 0) → (𝐴 / 𝑀) ∈ ℚ) |
8 | 3, 4, 6, 7 | syl3anc 1233 |
. . . . 5
⊢ (𝜑 → (𝐴 / 𝑀) ∈ ℚ) |
9 | 8 | flqcld 10233 |
. . . 4
⊢ (𝜑 → (⌊‘(𝐴 / 𝑀)) ∈ ℤ) |
10 | | oveq1 5860 |
. . . . . . 7
⊢ (𝑘 = (⌊‘(𝐴 / 𝑀)) → (𝑘 · 𝑀) = ((⌊‘(𝐴 / 𝑀)) · 𝑀)) |
11 | 10 | oveq1d 5868 |
. . . . . 6
⊢ (𝑘 = (⌊‘(𝐴 / 𝑀)) → ((𝑘 · 𝑀) + (𝐴 mod 𝑀)) = (((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀))) |
12 | 11 | eqeq2d 2182 |
. . . . 5
⊢ (𝑘 = (⌊‘(𝐴 / 𝑀)) → (𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀)) ↔ 𝐴 = (((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀)))) |
13 | 12 | adantl 275 |
. . . 4
⊢ ((𝜑 ∧ 𝑘 = (⌊‘(𝐴 / 𝑀))) → (𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀)) ↔ 𝐴 = (((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀)))) |
14 | | flqpmodeq 10283 |
. . . . . 6
⊢ ((𝐴 ∈ ℚ ∧ 𝑀 ∈ ℚ ∧ 0 <
𝑀) →
(((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀)) = 𝐴) |
15 | 3, 4, 5, 14 | syl3anc 1233 |
. . . . 5
⊢ (𝜑 → (((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀)) = 𝐴) |
16 | 15 | eqcomd 2176 |
. . . 4
⊢ (𝜑 → 𝐴 = (((⌊‘(𝐴 / 𝑀)) · 𝑀) + (𝐴 mod 𝑀))) |
17 | 9, 13, 16 | rspcedvd 2840 |
. . 3
⊢ (𝜑 → ∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀))) |
18 | | oveq2 5861 |
. . . . . 6
⊢ (𝐵 = (𝐴 mod 𝑀) → ((𝑘 · 𝑀) + 𝐵) = ((𝑘 · 𝑀) + (𝐴 mod 𝑀))) |
19 | 18 | eqeq2d 2182 |
. . . . 5
⊢ (𝐵 = (𝐴 mod 𝑀) → (𝐴 = ((𝑘 · 𝑀) + 𝐵) ↔ 𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀)))) |
20 | 19 | eqcoms 2173 |
. . . 4
⊢ ((𝐴 mod 𝑀) = 𝐵 → (𝐴 = ((𝑘 · 𝑀) + 𝐵) ↔ 𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀)))) |
21 | 20 | rexbidv 2471 |
. . 3
⊢ ((𝐴 mod 𝑀) = 𝐵 → (∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + 𝐵) ↔ ∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + (𝐴 mod 𝑀)))) |
22 | 17, 21 | syl5ibrcom 156 |
. 2
⊢ (𝜑 → ((𝐴 mod 𝑀) = 𝐵 → ∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + 𝐵))) |
23 | | oveq1 5860 |
. . . . . 6
⊢ (𝐴 = ((𝑘 · 𝑀) + 𝐵) → (𝐴 mod 𝑀) = (((𝑘 · 𝑀) + 𝐵) mod 𝑀)) |
24 | 23 | adantl 275 |
. . . . 5
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → (𝐴 mod 𝑀) = (((𝑘 · 𝑀) + 𝐵) mod 𝑀)) |
25 | | simplr 525 |
. . . . . 6
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → 𝑘 ∈ ℤ) |
26 | 4 | ad2antrr 485 |
. . . . . 6
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → 𝑀 ∈ ℚ) |
27 | | modqmuladd.bq |
. . . . . . 7
⊢ (𝜑 → 𝐵 ∈ ℚ) |
28 | 27 | ad2antrr 485 |
. . . . . 6
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → 𝐵 ∈ ℚ) |
29 | | modqmuladd.b |
. . . . . . 7
⊢ (𝜑 → 𝐵 ∈ (0[,)𝑀)) |
30 | 29 | ad2antrr 485 |
. . . . . 6
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → 𝐵 ∈ (0[,)𝑀)) |
31 | | mulqaddmodid 10320 |
. . . . . 6
⊢ (((𝑘 ∈ ℤ ∧ 𝑀 ∈ ℚ) ∧ (𝐵 ∈ ℚ ∧ 𝐵 ∈ (0[,)𝑀))) → (((𝑘 · 𝑀) + 𝐵) mod 𝑀) = 𝐵) |
32 | 25, 26, 28, 30, 31 | syl22anc 1234 |
. . . . 5
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → (((𝑘 · 𝑀) + 𝐵) mod 𝑀) = 𝐵) |
33 | 24, 32 | eqtrd 2203 |
. . . 4
⊢ (((𝜑 ∧ 𝑘 ∈ ℤ) ∧ 𝐴 = ((𝑘 · 𝑀) + 𝐵)) → (𝐴 mod 𝑀) = 𝐵) |
34 | 33 | ex 114 |
. . 3
⊢ ((𝜑 ∧ 𝑘 ∈ ℤ) → (𝐴 = ((𝑘 · 𝑀) + 𝐵) → (𝐴 mod 𝑀) = 𝐵)) |
35 | 34 | rexlimdva 2587 |
. 2
⊢ (𝜑 → (∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + 𝐵) → (𝐴 mod 𝑀) = 𝐵)) |
36 | 22, 35 | impbid 128 |
1
⊢ (𝜑 → ((𝐴 mod 𝑀) = 𝐵 ↔ ∃𝑘 ∈ ℤ 𝐴 = ((𝑘 · 𝑀) + 𝐵))) |