Proof of Theorem modifeq2int
Step | Hyp | Ref
| Expression |
1 | | simp1 992 |
. . . . . 6
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐴 ∈
ℕ0) |
2 | | nn0z 9225 |
. . . . . . 7
⊢ (𝐴 ∈ ℕ0
→ 𝐴 ∈
ℤ) |
3 | | zq 9578 |
. . . . . . 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 9585 |
. . . . . 6
⊢ (𝐵 ∈ ℕ → 𝐵 ∈
ℚ) |
8 | 7 | 3ad2ant2 1014 |
. . . . 5
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐵 ∈
ℚ) |
9 | 8 | adantr 274 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → 𝐵 ∈ ℚ) |
10 | 1 | nn0ge0d 9184 |
. . . . 5
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 0 ≤ 𝐴) |
11 | 10 | adantr 274 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → 0 ≤ 𝐴) |
12 | | simpr 109 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → 𝐴 < 𝐵) |
13 | | modqid 10298 |
. . . 4
⊢ (((𝐴 ∈ ℚ ∧ 𝐵 ∈ ℚ) ∧ (0 ≤
𝐴 ∧ 𝐴 < 𝐵)) → (𝐴 mod 𝐵) = 𝐴) |
14 | 6, 9, 11, 12, 13 | syl22anc 1234 |
. . 3
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → (𝐴 mod 𝐵) = 𝐴) |
15 | | iftrue 3530 |
. . . . 5
⊢ (𝐴 < 𝐵 → if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵)) = 𝐴) |
16 | 15 | eqcomd 2176 |
. . . 4
⊢ (𝐴 < 𝐵 → 𝐴 = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |
17 | 16 | adantl 275 |
. . 3
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → 𝐴 = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |
18 | 14, 17 | eqtrd 2203 |
. 2
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ 𝐴 < 𝐵) → (𝐴 mod 𝐵) = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |
19 | 5 | adantr 274 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 𝐴 ∈ ℚ) |
20 | 8 | adantr 274 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 𝐵 ∈ ℚ) |
21 | | simp2 993 |
. . . . . 6
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐵 ∈
ℕ) |
22 | 21 | adantr 274 |
. . . . 5
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 𝐵 ∈ ℕ) |
23 | 22 | nngt0d 8915 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 0 < 𝐵) |
24 | 21 | nnred 8884 |
. . . . . 6
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐵 ∈
ℝ) |
25 | 1 | nn0red 9182 |
. . . . . 6
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐴 ∈
ℝ) |
26 | 24, 25 | lenltd 8030 |
. . . . 5
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → (𝐵 ≤ 𝐴 ↔ ¬ 𝐴 < 𝐵)) |
27 | 26 | biimpar 295 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 𝐵 ≤ 𝐴) |
28 | | simpl3 997 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → 𝐴 < (2 · 𝐵)) |
29 | | q2submod 10334 |
. . . 4
⊢ (((𝐴 ∈ ℚ ∧ 𝐵 ∈ ℚ ∧ 0 <
𝐵) ∧ (𝐵 ≤ 𝐴 ∧ 𝐴 < (2 · 𝐵))) → (𝐴 mod 𝐵) = (𝐴 − 𝐵)) |
30 | 19, 20, 23, 27, 28, 29 | syl32anc 1241 |
. . 3
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → (𝐴 mod 𝐵) = (𝐴 − 𝐵)) |
31 | | iffalse 3533 |
. . . . 5
⊢ (¬
𝐴 < 𝐵 → if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵)) = (𝐴 − 𝐵)) |
32 | 31 | adantl 275 |
. . . 4
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵)) = (𝐴 − 𝐵)) |
33 | 32 | eqcomd 2176 |
. . 3
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → (𝐴 − 𝐵) = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |
34 | 30, 33 | eqtrd 2203 |
. 2
⊢ (((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) ∧ ¬ 𝐴 < 𝐵) → (𝐴 mod 𝐵) = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |
35 | 1, 2 | syl 14 |
. . 3
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐴 ∈
ℤ) |
36 | 21 | nnzd 9326 |
. . 3
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → 𝐵 ∈
ℤ) |
37 | | zdclt 9282 |
. . . 4
⊢ ((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) →
DECID 𝐴 <
𝐵) |
38 | | exmiddc 831 |
. . . 4
⊢
(DECID 𝐴 < 𝐵 → (𝐴 < 𝐵 ∨ ¬ 𝐴 < 𝐵)) |
39 | 37, 38 | syl 14 |
. . 3
⊢ ((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → (𝐴 < 𝐵 ∨ ¬ 𝐴 < 𝐵)) |
40 | 35, 36, 39 | syl2anc 409 |
. 2
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → (𝐴 < 𝐵 ∨ ¬ 𝐴 < 𝐵)) |
41 | 18, 34, 40 | mpjaodan 793 |
1
⊢ ((𝐴 ∈ ℕ0
∧ 𝐵 ∈ ℕ
∧ 𝐴 < (2 ·
𝐵)) → (𝐴 mod 𝐵) = if(𝐴 < 𝐵, 𝐴, (𝐴 − 𝐵))) |