Step | Hyp | Ref
| Expression |
1 | | oveq2 7283 |
. . . . . . . . . . 11
⊢ (𝑥 = 0 → (0..^𝑥) = (0..^0)) |
2 | | fzo0 13411 |
. . . . . . . . . . 11
⊢ (0..^0) =
∅ |
3 | 1, 2 | eqtrdi 2794 |
. . . . . . . . . 10
⊢ (𝑥 = 0 → (0..^𝑥) = ∅) |
4 | 3 | ineq2d 4146 |
. . . . . . . . 9
⊢ (𝑥 = 0 → ((bits‘𝑁) ∩ (0..^𝑥)) = ((bits‘𝑁) ∩ ∅)) |
5 | | in0 4325 |
. . . . . . . . 9
⊢
((bits‘𝑁)
∩ ∅) = ∅ |
6 | 4, 5 | eqtrdi 2794 |
. . . . . . . 8
⊢ (𝑥 = 0 → ((bits‘𝑁) ∩ (0..^𝑥)) = ∅) |
7 | 6 | sumeq1d 15413 |
. . . . . . 7
⊢ (𝑥 = 0 → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = Σ𝑛 ∈ ∅ (2↑𝑛)) |
8 | | sum0 15433 |
. . . . . . 7
⊢
Σ𝑛 ∈
∅ (2↑𝑛) =
0 |
9 | 7, 8 | eqtrdi 2794 |
. . . . . 6
⊢ (𝑥 = 0 → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = 0) |
10 | | oveq2 7283 |
. . . . . . . 8
⊢ (𝑥 = 0 → (2↑𝑥) = (2↑0)) |
11 | | 2cn 12048 |
. . . . . . . . 9
⊢ 2 ∈
ℂ |
12 | | exp0 13786 |
. . . . . . . . 9
⊢ (2 ∈
ℂ → (2↑0) = 1) |
13 | 11, 12 | ax-mp 5 |
. . . . . . . 8
⊢
(2↑0) = 1 |
14 | 10, 13 | eqtrdi 2794 |
. . . . . . 7
⊢ (𝑥 = 0 → (2↑𝑥) = 1) |
15 | 14 | oveq2d 7291 |
. . . . . 6
⊢ (𝑥 = 0 → (𝑁 mod (2↑𝑥)) = (𝑁 mod 1)) |
16 | 9, 15 | eqeq12d 2754 |
. . . . 5
⊢ (𝑥 = 0 → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥)) ↔ 0 = (𝑁 mod 1))) |
17 | 16 | imbi2d 341 |
. . . 4
⊢ (𝑥 = 0 → ((𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥))) ↔ (𝑁 ∈ ℕ0 → 0 =
(𝑁 mod
1)))) |
18 | | oveq2 7283 |
. . . . . . . 8
⊢ (𝑥 = 𝑘 → (0..^𝑥) = (0..^𝑘)) |
19 | 18 | ineq2d 4146 |
. . . . . . 7
⊢ (𝑥 = 𝑘 → ((bits‘𝑁) ∩ (0..^𝑥)) = ((bits‘𝑁) ∩ (0..^𝑘))) |
20 | 19 | sumeq1d 15413 |
. . . . . 6
⊢ (𝑥 = 𝑘 → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛)) |
21 | | oveq2 7283 |
. . . . . . 7
⊢ (𝑥 = 𝑘 → (2↑𝑥) = (2↑𝑘)) |
22 | 21 | oveq2d 7291 |
. . . . . 6
⊢ (𝑥 = 𝑘 → (𝑁 mod (2↑𝑥)) = (𝑁 mod (2↑𝑘))) |
23 | 20, 22 | eqeq12d 2754 |
. . . . 5
⊢ (𝑥 = 𝑘 → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥)) ↔ Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛) = (𝑁 mod (2↑𝑘)))) |
24 | 23 | imbi2d 341 |
. . . 4
⊢ (𝑥 = 𝑘 → ((𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥))) ↔ (𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑘))(2↑𝑛) = (𝑁 mod (2↑𝑘))))) |
25 | | oveq2 7283 |
. . . . . . . 8
⊢ (𝑥 = (𝑘 + 1) → (0..^𝑥) = (0..^(𝑘 + 1))) |
26 | 25 | ineq2d 4146 |
. . . . . . 7
⊢ (𝑥 = (𝑘 + 1) → ((bits‘𝑁) ∩ (0..^𝑥)) = ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) |
27 | 26 | sumeq1d 15413 |
. . . . . 6
⊢ (𝑥 = (𝑘 + 1) → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))(2↑𝑛)) |
28 | | oveq2 7283 |
. . . . . . 7
⊢ (𝑥 = (𝑘 + 1) → (2↑𝑥) = (2↑(𝑘 + 1))) |
29 | 28 | oveq2d 7291 |
. . . . . 6
⊢ (𝑥 = (𝑘 + 1) → (𝑁 mod (2↑𝑥)) = (𝑁 mod (2↑(𝑘 + 1)))) |
30 | 27, 29 | eqeq12d 2754 |
. . . . 5
⊢ (𝑥 = (𝑘 + 1) → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥)) ↔ Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))(2↑𝑛) = (𝑁 mod (2↑(𝑘 + 1))))) |
31 | 30 | imbi2d 341 |
. . . 4
⊢ (𝑥 = (𝑘 + 1) → ((𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥))) ↔ (𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^(𝑘 + 1)))(2↑𝑛) = (𝑁 mod (2↑(𝑘 + 1)))))) |
32 | | oveq2 7283 |
. . . . . . . 8
⊢ (𝑥 = 𝑁 → (0..^𝑥) = (0..^𝑁)) |
33 | 32 | ineq2d 4146 |
. . . . . . 7
⊢ (𝑥 = 𝑁 → ((bits‘𝑁) ∩ (0..^𝑥)) = ((bits‘𝑁) ∩ (0..^𝑁))) |
34 | 33 | sumeq1d 15413 |
. . . . . 6
⊢ (𝑥 = 𝑁 → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑁))(2↑𝑛)) |
35 | | oveq2 7283 |
. . . . . . 7
⊢ (𝑥 = 𝑁 → (2↑𝑥) = (2↑𝑁)) |
36 | 35 | oveq2d 7291 |
. . . . . 6
⊢ (𝑥 = 𝑁 → (𝑁 mod (2↑𝑥)) = (𝑁 mod (2↑𝑁))) |
37 | 34, 36 | eqeq12d 2754 |
. . . . 5
⊢ (𝑥 = 𝑁 → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥)) ↔ Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑁))(2↑𝑛) = (𝑁 mod (2↑𝑁)))) |
38 | 37 | imbi2d 341 |
. . . 4
⊢ (𝑥 = 𝑁 → ((𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥))) ↔ (𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑁))(2↑𝑛) = (𝑁 mod (2↑𝑁))))) |
39 | | nn0z 12343 |
. . . . . 6
⊢ (𝑁 ∈ ℕ0
→ 𝑁 ∈
ℤ) |
40 | | zmod10 13607 |
. . . . . 6
⊢ (𝑁 ∈ ℤ → (𝑁 mod 1) = 0) |
41 | 39, 40 | syl 17 |
. . . . 5
⊢ (𝑁 ∈ ℕ0
→ (𝑁 mod 1) =
0) |
42 | 41 | eqcomd 2744 |
. . . 4
⊢ (𝑁 ∈ ℕ0
→ 0 = (𝑁 mod
1)) |
43 | | oveq1 7282 |
. . . . . . 7
⊢
(Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑘))(2↑𝑛) = (𝑁 mod (2↑𝑘)) → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛) + Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛)) = ((𝑁 mod (2↑𝑘)) + Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛))) |
44 | | fzonel 13401 |
. . . . . . . . . . . . 13
⊢ ¬
𝑘 ∈ (0..^𝑘) |
45 | 44 | a1i 11 |
. . . . . . . . . . . 12
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ¬ 𝑘 ∈ (0..^𝑘)) |
46 | | disjsn 4647 |
. . . . . . . . . . . 12
⊢
(((0..^𝑘) ∩
{𝑘}) = ∅ ↔ ¬
𝑘 ∈ (0..^𝑘)) |
47 | 45, 46 | sylibr 233 |
. . . . . . . . . . 11
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ((0..^𝑘) ∩ {𝑘}) = ∅) |
48 | 47 | ineq2d 4146 |
. . . . . . . . . 10
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ((bits‘𝑁) ∩ ((0..^𝑘) ∩ {𝑘})) = ((bits‘𝑁) ∩ ∅)) |
49 | | inindi 4160 |
. . . . . . . . . 10
⊢
((bits‘𝑁)
∩ ((0..^𝑘) ∩ {𝑘})) = (((bits‘𝑁) ∩ (0..^𝑘)) ∩ ((bits‘𝑁) ∩ {𝑘})) |
50 | 48, 49, 5 | 3eqtr3g 2801 |
. . . . . . . . 9
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → (((bits‘𝑁) ∩ (0..^𝑘)) ∩ ((bits‘𝑁) ∩ {𝑘})) = ∅) |
51 | | simpr 485 |
. . . . . . . . . . . . 13
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → 𝑘 ∈ ℕ0) |
52 | | nn0uz 12620 |
. . . . . . . . . . . . 13
⊢
ℕ0 = (ℤ≥‘0) |
53 | 51, 52 | eleqtrdi 2849 |
. . . . . . . . . . . 12
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → 𝑘 ∈
(ℤ≥‘0)) |
54 | | fzosplitsn 13495 |
. . . . . . . . . . . 12
⊢ (𝑘 ∈
(ℤ≥‘0) → (0..^(𝑘 + 1)) = ((0..^𝑘) ∪ {𝑘})) |
55 | 53, 54 | syl 17 |
. . . . . . . . . . 11
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → (0..^(𝑘 + 1)) = ((0..^𝑘) ∪ {𝑘})) |
56 | 55 | ineq2d 4146 |
. . . . . . . . . 10
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ((bits‘𝑁) ∩ (0..^(𝑘 + 1))) = ((bits‘𝑁) ∩ ((0..^𝑘) ∪ {𝑘}))) |
57 | | indi 4207 |
. . . . . . . . . 10
⊢
((bits‘𝑁)
∩ ((0..^𝑘) ∪ {𝑘})) = (((bits‘𝑁) ∩ (0..^𝑘)) ∪ ((bits‘𝑁) ∩ {𝑘})) |
58 | 56, 57 | eqtrdi 2794 |
. . . . . . . . 9
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ((bits‘𝑁) ∩ (0..^(𝑘 + 1))) = (((bits‘𝑁) ∩ (0..^𝑘)) ∪ ((bits‘𝑁) ∩ {𝑘}))) |
59 | | fzofi 13694 |
. . . . . . . . . . 11
⊢
(0..^(𝑘 + 1)) ∈
Fin |
60 | | inss2 4163 |
. . . . . . . . . . 11
⊢
((bits‘𝑁)
∩ (0..^(𝑘 + 1)))
⊆ (0..^(𝑘 +
1)) |
61 | | ssfi 8956 |
. . . . . . . . . . 11
⊢
(((0..^(𝑘 + 1))
∈ Fin ∧ ((bits‘𝑁) ∩ (0..^(𝑘 + 1))) ⊆ (0..^(𝑘 + 1))) → ((bits‘𝑁) ∩ (0..^(𝑘 + 1))) ∈ Fin) |
62 | 59, 60, 61 | mp2an 689 |
. . . . . . . . . 10
⊢
((bits‘𝑁)
∩ (0..^(𝑘 + 1))) ∈
Fin |
63 | 62 | a1i 11 |
. . . . . . . . 9
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ((bits‘𝑁) ∩ (0..^(𝑘 + 1))) ∈ Fin) |
64 | | 2nn 12046 |
. . . . . . . . . . . 12
⊢ 2 ∈
ℕ |
65 | 64 | a1i 11 |
. . . . . . . . . . 11
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → 2 ∈
ℕ) |
66 | | simpr 485 |
. . . . . . . . . . . . . 14
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) |
67 | 66 | elin2d 4133 |
. . . . . . . . . . . . 13
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → 𝑛 ∈ (0..^(𝑘 + 1))) |
68 | | elfzouz 13391 |
. . . . . . . . . . . . 13
⊢ (𝑛 ∈ (0..^(𝑘 + 1)) → 𝑛 ∈
(ℤ≥‘0)) |
69 | 67, 68 | syl 17 |
. . . . . . . . . . . 12
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → 𝑛 ∈
(ℤ≥‘0)) |
70 | 69, 52 | eleqtrrdi 2850 |
. . . . . . . . . . 11
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → 𝑛 ∈ ℕ0) |
71 | 65, 70 | nnexpcld 13960 |
. . . . . . . . . 10
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → (2↑𝑛) ∈ ℕ) |
72 | 71 | nncnd 11989 |
. . . . . . . . 9
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → (2↑𝑛) ∈ ℂ) |
73 | 50, 58, 63, 72 | fsumsplit 15453 |
. . . . . . . 8
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))(2↑𝑛) = (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛) + Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛))) |
74 | | bitsinv1lem 16148 |
. . . . . . . . . 10
⊢ ((𝑁 ∈ ℤ ∧ 𝑘 ∈ ℕ0)
→ (𝑁 mod
(2↑(𝑘 + 1))) = ((𝑁 mod (2↑𝑘)) + if(𝑘 ∈ (bits‘𝑁), (2↑𝑘), 0))) |
75 | 39, 74 | sylan 580 |
. . . . . . . . 9
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → (𝑁 mod (2↑(𝑘 + 1))) = ((𝑁 mod (2↑𝑘)) + if(𝑘 ∈ (bits‘𝑁), (2↑𝑘), 0))) |
76 | | eqeq2 2750 |
. . . . . . . . . . 11
⊢
((2↑𝑘) =
if(𝑘 ∈
(bits‘𝑁),
(2↑𝑘), 0) →
(Σ𝑛 ∈
((bits‘𝑁) ∩
{𝑘})(2↑𝑛) = (2↑𝑘) ↔ Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = if(𝑘 ∈ (bits‘𝑁), (2↑𝑘), 0))) |
77 | | eqeq2 2750 |
. . . . . . . . . . 11
⊢ (0 =
if(𝑘 ∈
(bits‘𝑁),
(2↑𝑘), 0) →
(Σ𝑛 ∈
((bits‘𝑁) ∩
{𝑘})(2↑𝑛) = 0 ↔ Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = if(𝑘 ∈ (bits‘𝑁), (2↑𝑘), 0))) |
78 | | simpr 485 |
. . . . . . . . . . . . . . 15
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → 𝑘 ∈ (bits‘𝑁)) |
79 | 78 | snssd 4742 |
. . . . . . . . . . . . . 14
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → {𝑘} ⊆ (bits‘𝑁)) |
80 | | sseqin2 4149 |
. . . . . . . . . . . . . 14
⊢ ({𝑘} ⊆ (bits‘𝑁) ↔ ((bits‘𝑁) ∩ {𝑘}) = {𝑘}) |
81 | 79, 80 | sylib 217 |
. . . . . . . . . . . . 13
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → ((bits‘𝑁) ∩ {𝑘}) = {𝑘}) |
82 | 81 | sumeq1d 15413 |
. . . . . . . . . . . 12
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = Σ𝑛 ∈ {𝑘} (2↑𝑛)) |
83 | | simplr 766 |
. . . . . . . . . . . . 13
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → 𝑘 ∈ ℕ0) |
84 | 64 | a1i 11 |
. . . . . . . . . . . . . . 15
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → 2 ∈ ℕ) |
85 | 84, 83 | nnexpcld 13960 |
. . . . . . . . . . . . . 14
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → (2↑𝑘) ∈ ℕ) |
86 | 85 | nncnd 11989 |
. . . . . . . . . . . . 13
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → (2↑𝑘) ∈ ℂ) |
87 | | oveq2 7283 |
. . . . . . . . . . . . . 14
⊢ (𝑛 = 𝑘 → (2↑𝑛) = (2↑𝑘)) |
88 | 87 | sumsn 15458 |
. . . . . . . . . . . . 13
⊢ ((𝑘 ∈ ℕ0
∧ (2↑𝑘) ∈
ℂ) → Σ𝑛
∈ {𝑘} (2↑𝑛) = (2↑𝑘)) |
89 | 83, 86, 88 | syl2anc 584 |
. . . . . . . . . . . 12
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → Σ𝑛 ∈ {𝑘} (2↑𝑛) = (2↑𝑘)) |
90 | 82, 89 | eqtrd 2778 |
. . . . . . . . . . 11
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = (2↑𝑘)) |
91 | | simpr 485 |
. . . . . . . . . . . . . 14
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝑁)) → ¬ 𝑘 ∈ (bits‘𝑁)) |
92 | | disjsn 4647 |
. . . . . . . . . . . . . 14
⊢
(((bits‘𝑁)
∩ {𝑘}) = ∅ ↔
¬ 𝑘 ∈
(bits‘𝑁)) |
93 | 91, 92 | sylibr 233 |
. . . . . . . . . . . . 13
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝑁)) → ((bits‘𝑁) ∩ {𝑘}) = ∅) |
94 | 93 | sumeq1d 15413 |
. . . . . . . . . . . 12
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝑁)) → Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = Σ𝑛 ∈ ∅ (2↑𝑛)) |
95 | 94, 8 | eqtrdi 2794 |
. . . . . . . . . . 11
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝑁)) → Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = 0) |
96 | 76, 77, 90, 95 | ifbothda 4497 |
. . . . . . . . . 10
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = if(𝑘 ∈ (bits‘𝑁), (2↑𝑘), 0)) |
97 | 96 | oveq2d 7291 |
. . . . . . . . 9
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ((𝑁 mod (2↑𝑘)) + Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛)) = ((𝑁 mod (2↑𝑘)) + if(𝑘 ∈ (bits‘𝑁), (2↑𝑘), 0))) |
98 | 75, 97 | eqtr4d 2781 |
. . . . . . . 8
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → (𝑁 mod (2↑(𝑘 + 1))) = ((𝑁 mod (2↑𝑘)) + Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛))) |
99 | 73, 98 | eqeq12d 2754 |
. . . . . . 7
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))(2↑𝑛) = (𝑁 mod (2↑(𝑘 + 1))) ↔ (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛) + Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛)) = ((𝑁 mod (2↑𝑘)) + Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛)))) |
100 | 43, 99 | syl5ibr 245 |
. . . . . 6
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛) = (𝑁 mod (2↑𝑘)) → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))(2↑𝑛) = (𝑁 mod (2↑(𝑘 + 1))))) |
101 | 100 | expcom 414 |
. . . . 5
⊢ (𝑘 ∈ ℕ0
→ (𝑁 ∈
ℕ0 → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛) = (𝑁 mod (2↑𝑘)) → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))(2↑𝑛) = (𝑁 mod (2↑(𝑘 + 1)))))) |
102 | 101 | a2d 29 |
. . . 4
⊢ (𝑘 ∈ ℕ0
→ ((𝑁 ∈
ℕ0 → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛) = (𝑁 mod (2↑𝑘))) → (𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^(𝑘 + 1)))(2↑𝑛) = (𝑁 mod (2↑(𝑘 + 1)))))) |
103 | 17, 24, 31, 38, 42, 102 | nn0ind 12415 |
. . 3
⊢ (𝑁 ∈ ℕ0
→ (𝑁 ∈
ℕ0 → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑁))(2↑𝑛) = (𝑁 mod (2↑𝑁)))) |
104 | 103 | pm2.43i 52 |
. 2
⊢ (𝑁 ∈ ℕ0
→ Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑁))(2↑𝑛) = (𝑁 mod (2↑𝑁))) |
105 | | id 22 |
. . . . . . 7
⊢ (𝑁 ∈ ℕ0
→ 𝑁 ∈
ℕ0) |
106 | 105, 52 | eleqtrdi 2849 |
. . . . . 6
⊢ (𝑁 ∈ ℕ0
→ 𝑁 ∈
(ℤ≥‘0)) |
107 | 64 | a1i 11 |
. . . . . . . 8
⊢ (𝑁 ∈ ℕ0
→ 2 ∈ ℕ) |
108 | 107, 105 | nnexpcld 13960 |
. . . . . . 7
⊢ (𝑁 ∈ ℕ0
→ (2↑𝑁) ∈
ℕ) |
109 | 108 | nnzd 12425 |
. . . . . 6
⊢ (𝑁 ∈ ℕ0
→ (2↑𝑁) ∈
ℤ) |
110 | | 2z 12352 |
. . . . . . . 8
⊢ 2 ∈
ℤ |
111 | | uzid 12597 |
. . . . . . . 8
⊢ (2 ∈
ℤ → 2 ∈ (ℤ≥‘2)) |
112 | 110, 111 | ax-mp 5 |
. . . . . . 7
⊢ 2 ∈
(ℤ≥‘2) |
113 | | bernneq3 13946 |
. . . . . . 7
⊢ ((2
∈ (ℤ≥‘2) ∧ 𝑁 ∈ ℕ0) → 𝑁 < (2↑𝑁)) |
114 | 112, 113 | mpan 687 |
. . . . . 6
⊢ (𝑁 ∈ ℕ0
→ 𝑁 < (2↑𝑁)) |
115 | | elfzo2 13390 |
. . . . . 6
⊢ (𝑁 ∈ (0..^(2↑𝑁)) ↔ (𝑁 ∈ (ℤ≥‘0)
∧ (2↑𝑁) ∈
ℤ ∧ 𝑁 <
(2↑𝑁))) |
116 | 106, 109,
114, 115 | syl3anbrc 1342 |
. . . . 5
⊢ (𝑁 ∈ ℕ0
→ 𝑁 ∈
(0..^(2↑𝑁))) |
117 | | bitsfzo 16142 |
. . . . . 6
⊢ ((𝑁 ∈ ℤ ∧ 𝑁 ∈ ℕ0)
→ (𝑁 ∈
(0..^(2↑𝑁)) ↔
(bits‘𝑁) ⊆
(0..^𝑁))) |
118 | 39, 105, 117 | syl2anc 584 |
. . . . 5
⊢ (𝑁 ∈ ℕ0
→ (𝑁 ∈
(0..^(2↑𝑁)) ↔
(bits‘𝑁) ⊆
(0..^𝑁))) |
119 | 116, 118 | mpbid 231 |
. . . 4
⊢ (𝑁 ∈ ℕ0
→ (bits‘𝑁)
⊆ (0..^𝑁)) |
120 | | df-ss 3904 |
. . . 4
⊢
((bits‘𝑁)
⊆ (0..^𝑁) ↔
((bits‘𝑁) ∩
(0..^𝑁)) =
(bits‘𝑁)) |
121 | 119, 120 | sylib 217 |
. . 3
⊢ (𝑁 ∈ ℕ0
→ ((bits‘𝑁)
∩ (0..^𝑁)) =
(bits‘𝑁)) |
122 | 121 | sumeq1d 15413 |
. 2
⊢ (𝑁 ∈ ℕ0
→ Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑁))(2↑𝑛) = Σ𝑛 ∈ (bits‘𝑁)(2↑𝑛)) |
123 | | nn0re 12242 |
. . 3
⊢ (𝑁 ∈ ℕ0
→ 𝑁 ∈
ℝ) |
124 | | 2rp 12735 |
. . . . 5
⊢ 2 ∈
ℝ+ |
125 | 124 | a1i 11 |
. . . 4
⊢ (𝑁 ∈ ℕ0
→ 2 ∈ ℝ+) |
126 | 125, 39 | rpexpcld 13962 |
. . 3
⊢ (𝑁 ∈ ℕ0
→ (2↑𝑁) ∈
ℝ+) |
127 | | nn0ge0 12258 |
. . 3
⊢ (𝑁 ∈ ℕ0
→ 0 ≤ 𝑁) |
128 | | modid 13616 |
. . 3
⊢ (((𝑁 ∈ ℝ ∧
(2↑𝑁) ∈
ℝ+) ∧ (0 ≤ 𝑁 ∧ 𝑁 < (2↑𝑁))) → (𝑁 mod (2↑𝑁)) = 𝑁) |
129 | 123, 126,
127, 114, 128 | syl22anc 836 |
. 2
⊢ (𝑁 ∈ ℕ0
→ (𝑁 mod (2↑𝑁)) = 𝑁) |
130 | 104, 122,
129 | 3eqtr3d 2786 |
1
⊢ (𝑁 ∈ ℕ0
→ Σ𝑛 ∈
(bits‘𝑁)(2↑𝑛) = 𝑁) |