Proof of Theorem modifeq2int
Step | Hyp | Ref
| Expression |
1 | | simp1 987 |
. . . . . 6
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐴 ∈
ℕ0) |
2 | | nn0z 9211 |
. . . . . . 7
⊢ (𝐴 ∈ ℕ0
→ 𝐴 ∈
ℤ) |
3 | | zq 9564 |
. . . . . . 7
⊢ (𝐴 ∈ ℤ → 𝐴 ∈
ℚ) |
4 | 2, 3 | syl 14 |
. . . . . 6
⊢ (𝐴 ∈ ℕ0
→ 𝐴 ∈
ℚ) |
5 | 1, 4 | syl 14 |
. . . . 5
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐴 ∈
ℚ) |
6 | 5 | adantr 274 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → 𝐴 ∈ ℚ) |
7 | | nnq 9571 |
. . . . . 6
⊢ (𝐵 ∈ ℕ → 𝐵 ∈
ℚ) |
8 | 7 | 3ad2ant2 1009 |
. . . . 5
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐵 ∈
ℚ) |
9 | 8 | adantr 274 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → 𝐵 ∈ ℚ) |
10 | 1 | nn0ge0d 9170 |
. . . . 5
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 0 ≤ 𝐴) |
11 | 10 | adantr 274 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → 0 ≤ 𝐴) |
12 | | simpr 109 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → 𝐴 < 𝐵) |
13 | | modqid 10284 |
. . . 4
⊢ (((𝐴 ∈ ℚ ∧ 𝐵 ∈ ℚ) ∧ (0 ≤
𝐴 ∧ 𝐴 < 𝐵)) → (𝐴 mod 𝐵) = 𝐴) |
14 | 6, 9, 11, 12, 13 | syl22anc 1229 |
. . 3
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → (𝐴 mod 𝐵) = 𝐴) |
15 | | iftrue 3525 |
. . . . 5
⊢ (𝐴 < 𝐵 → if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵)) = 𝐴) |
16 | 15 | eqcomd 2171 |
. . . 4
⊢ (𝐴 < 𝐵 → 𝐴 = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |
17 | 16 | adantl 275 |
. . 3
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → 𝐴 = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |
18 | 14, 17 | eqtrd 2198 |
. 2
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → (𝐴 mod 𝐵) = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |
19 | 5 | adantr 274 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 𝐴 ∈ ℚ) |
20 | 8 | adantr 274 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 𝐵 ∈ ℚ) |
21 | | simp2 988 |
. . . . . 6
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐵 ∈
ℕ) |
22 | 21 | adantr 274 |
. . . . 5
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 𝐵 ∈ ℕ) |
23 | 22 | nngt0d 8901 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 0 < 𝐵) |
24 | 21 | nnred 8870 |
. . . . . 6
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐵 ∈
ℝ) |
25 | 1 | nn0red 9168 |
. . . . . 6
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐴 ∈
ℝ) |
26 | 24, 25 | lenltd 8016 |
. . . . 5
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → (𝐵 ≤ 𝐴 ↔ ¬ 𝐴 < 𝐵)) |
27 | 26 | biimpar 295 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 𝐵 ≤ 𝐴) |
28 | | simpl3 992 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 𝐴 < (2 · 𝐵)) |
29 | | q2submod 10320 |
. . . 4
⊢ (((𝐴 ∈ ℚ ∧ 𝐵 ∈ ℚ ∧ 0 <
𝐵) ∧ (𝐵 ≤ 𝐴 ∧ 𝐴 < (2 · 𝐵))) → (𝐴 mod 𝐵) = (𝐴 − 𝐵)) |
30 | 19, 20, 23, 27, 28, 29 | syl32anc 1236 |
. . 3
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → (𝐴 mod 𝐵) = (𝐴 − 𝐵)) |
31 | | iffalse 3528 |
. . . . 5
⊢ (¬
𝐴 < 𝐵 → if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵)) = (𝐴 − 𝐵)) |
32 | 31 | adantl 275 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵)) = (𝐴 − 𝐵)) |
33 | 32 | eqcomd 2171 |
. . 3
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → (𝐴 − 𝐵) = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |
34 | 30, 33 | eqtrd 2198 |
. 2
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → (𝐴 mod 𝐵) = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |
35 | 1, 2 | syl 14 |
. . 3
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐴 ∈
ℤ) |
36 | 21 | nnzd 9312 |
. . 3
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐵 ∈
ℤ) |
37 | | zdclt 9268 |
. . . 4
⊢ ((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) →
DECID 𝐴 <
𝐵) |
38 | | exmiddc 826 |
. . . 4
⊢
(DECID 𝐴 < 𝐵 → (𝐴 < 𝐵 ∨ ¬ 𝐴 < 𝐵)) |
39 | 37, 38 | syl 14 |
. . 3
⊢ ((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → (𝐴 < 𝐵 ∨ ¬ 𝐴 < 𝐵)) |
40 | 35, 36, 39 | syl2anc 409 |
. 2
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → (𝐴 < 𝐵 ∨ ¬ 𝐴 < 𝐵)) |
41 | 18, 34, 40 | mpjaodan 788 |
1
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → (𝐴 mod 𝐵) = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |