Step | Hyp | Ref
| Expression |
1 | | oveq2 7263 |
. . . . . . . . . . 11
⊢ (𝑥 = 0 → (0..^𝑥) = (0..^0)) |
2 | | fzo0 13339 |
. . . . . . . . . . 11
⊢ (0..^0) =
∅ |
3 | 1, 2 | eqtrdi 2795 |
. . . . . . . . . 10
⊢ (𝑥 = 0 → (0..^𝑥) = ∅) |
4 | 3 | ineq2d 4143 |
. . . . . . . . 9
⊢ (𝑥 = 0 → ((bits‘𝑁) ∩ (0..^𝑥)) = ((bits‘𝑁) ∩ ∅)) |
5 | | in0 4322 |
. . . . . . . . 9
⊢
((bits‘𝑁)
∩ ∅) = ∅ |
6 | 4, 5 | eqtrdi 2795 |
. . . . . . . 8
⊢ (𝑥 = 0 → ((bits‘𝑁) ∩ (0..^𝑥)) = ∅) |
7 | 6 | sumeq1d 15341 |
. . . . . . 7
⊢ (𝑥 = 0 → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = Σ𝑛 ∈ ∅ (2↑𝑛)) |
8 | | sum0 15361 |
. . . . . . 7
⊢
Σ𝑛 ∈
∅ (2↑𝑛) =
0 |
9 | 7, 8 | eqtrdi 2795 |
. . . . . 6
⊢ (𝑥 = 0 → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = 0) |
10 | | oveq2 7263 |
. . . . . . . 8
⊢ (𝑥 = 0 → (2↑𝑥) = (2↑0)) |
11 | | 2cn 11978 |
. . . . . . . . 9
⊢ 2 ∈
ℂ |
12 | | exp0 13714 |
. . . . . . . . 9
⊢ (2 ∈
ℂ → (2↑0) = 1) |
13 | 11, 12 | ax-mp 5 |
. . . . . . . 8
⊢
(2↑0) = 1 |
14 | 10, 13 | eqtrdi 2795 |
. . . . . . 7
⊢ (𝑥 = 0 → (2↑𝑥) = 1) |
15 | 14 | oveq2d 7271 |
. . . . . 6
⊢ (𝑥 = 0 → (𝑁 mod (2↑𝑥)) = (𝑁 mod 1)) |
16 | 9, 15 | eqeq12d 2754 |
. . . . 5
⊢ (𝑥 = 0 → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥)) ↔ 0 = (𝑁 mod 1))) |
17 | 16 | imbi2d 340 |
. . . 4
⊢ (𝑥 = 0 → ((𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥))) ↔ (𝑁 ∈ ℕ0 → 0 =
(𝑁 mod
1)))) |
18 | | oveq2 7263 |
. . . . . . . 8
⊢ (𝑥 = 𝑘 → (0..^𝑥) = (0..^𝑘)) |
19 | 18 | ineq2d 4143 |
. . . . . . 7
⊢ (𝑥 = 𝑘 → ((bits‘𝑁) ∩ (0..^𝑥)) = ((bits‘𝑁) ∩ (0..^𝑘))) |
20 | 19 | sumeq1d 15341 |
. . . . . 6
⊢ (𝑥 = 𝑘 → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛)) |
21 | | oveq2 7263 |
. . . . . . 7
⊢ (𝑥 = 𝑘 → (2↑𝑥) = (2↑𝑘)) |
22 | 21 | oveq2d 7271 |
. . . . . 6
⊢ (𝑥 = 𝑘 → (𝑁 mod (2↑𝑥)) = (𝑁 mod (2↑𝑘))) |
23 | 20, 22 | eqeq12d 2754 |
. . . . 5
⊢ (𝑥 = 𝑘 → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥)) ↔ Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛) = (𝑁 mod (2↑𝑘)))) |
24 | 23 | imbi2d 340 |
. . . 4
⊢ (𝑥 = 𝑘 → ((𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥))) ↔ (𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑘))(2↑𝑛) = (𝑁 mod (2↑𝑘))))) |
25 | | oveq2 7263 |
. . . . . . . 8
⊢ (𝑥 = (𝑘 + 1) → (0..^𝑥) = (0..^(𝑘 + 1))) |
26 | 25 | ineq2d 4143 |
. . . . . . 7
⊢ (𝑥 = (𝑘 + 1) → ((bits‘𝑁) ∩ (0..^𝑥)) = ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) |
27 | 26 | sumeq1d 15341 |
. . . . . 6
⊢ (𝑥 = (𝑘 + 1) → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))(2↑𝑛)) |
28 | | oveq2 7263 |
. . . . . . 7
⊢ (𝑥 = (𝑘 + 1) → (2↑𝑥) = (2↑(𝑘 + 1))) |
29 | 28 | oveq2d 7271 |
. . . . . 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 340 |
. . . 4
⊢ (𝑥 = (𝑘 + 1) → ((𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥))) ↔ (𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^(𝑘 + 1)))(2↑𝑛) = (𝑁 mod (2↑(𝑘 + 1)))))) |
32 | | oveq2 7263 |
. . . . . . . 8
⊢ (𝑥 = 𝑁 → (0..^𝑥) = (0..^𝑁)) |
33 | 32 | ineq2d 4143 |
. . . . . . 7
⊢ (𝑥 = 𝑁 → ((bits‘𝑁) ∩ (0..^𝑥)) = ((bits‘𝑁) ∩ (0..^𝑁))) |
34 | 33 | sumeq1d 15341 |
. . . . . 6
⊢ (𝑥 = 𝑁 → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑁))(2↑𝑛)) |
35 | | oveq2 7263 |
. . . . . . 7
⊢ (𝑥 = 𝑁 → (2↑𝑥) = (2↑𝑁)) |
36 | 35 | oveq2d 7271 |
. . . . . 6
⊢ (𝑥 = 𝑁 → (𝑁 mod (2↑𝑥)) = (𝑁 mod (2↑𝑁))) |
37 | 34, 36 | eqeq12d 2754 |
. . . . 5
⊢ (𝑥 = 𝑁 → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥)) ↔ Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑁))(2↑𝑛) = (𝑁 mod (2↑𝑁)))) |
38 | 37 | imbi2d 340 |
. . . 4
⊢ (𝑥 = 𝑁 → ((𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑥))(2↑𝑛) = (𝑁 mod (2↑𝑥))) ↔ (𝑁 ∈ ℕ0 →
Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑁))(2↑𝑛) = (𝑁 mod (2↑𝑁))))) |
39 | | nn0z 12273 |
. . . . . 6
⊢ (𝑁 ∈ ℕ0
→ 𝑁 ∈
ℤ) |
40 | | zmod10 13535 |
. . . . . 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 7262 |
. . . . . . 7
⊢
(Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑘))(2↑𝑛) = (𝑁 mod (2↑𝑘)) → (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛) + Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛)) = ((𝑁 mod (2↑𝑘)) + Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛))) |
44 | | fzonel 13329 |
. . . . . . . . . . . . 13
⊢ ¬
𝑘 ∈ (0..^𝑘) |
45 | 44 | a1i 11 |
. . . . . . . . . . . 12
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ¬ 𝑘 ∈ (0..^𝑘)) |
46 | | disjsn 4644 |
. . . . . . . . . . . 12
⊢
(((0..^𝑘) ∩
{𝑘}) = ∅ ↔ ¬
𝑘 ∈ (0..^𝑘)) |
47 | 45, 46 | sylibr 233 |
. . . . . . . . . . 11
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ((0..^𝑘) ∩ {𝑘}) = ∅) |
48 | 47 | ineq2d 4143 |
. . . . . . . . . 10
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ((bits‘𝑁) ∩ ((0..^𝑘) ∩ {𝑘})) = ((bits‘𝑁) ∩ ∅)) |
49 | | inindi 4157 |
. . . . . . . . . 10
⊢
((bits‘𝑁)
∩ ((0..^𝑘) ∩ {𝑘})) = (((bits‘𝑁) ∩ (0..^𝑘)) ∩ ((bits‘𝑁) ∩ {𝑘})) |
50 | 48, 49, 5 | 3eqtr3g 2802 |
. . . . . . . . 9
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → (((bits‘𝑁) ∩ (0..^𝑘)) ∩ ((bits‘𝑁) ∩ {𝑘})) = ∅) |
51 | | simpr 484 |
. . . . . . . . . . . . 13
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → 𝑘 ∈ ℕ0) |
52 | | nn0uz 12549 |
. . . . . . . . . . . . 13
⊢
ℕ0 = (ℤ≥‘0) |
53 | 51, 52 | eleqtrdi 2849 |
. . . . . . . . . . . 12
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → 𝑘 ∈
(ℤ≥‘0)) |
54 | | fzosplitsn 13423 |
. . . . . . . . . . . 12
⊢ (𝑘 ∈
(ℤ≥‘0) → (0..^(𝑘 + 1)) = ((0..^𝑘) ∪ {𝑘})) |
55 | 53, 54 | syl 17 |
. . . . . . . . . . 11
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → (0..^(𝑘 + 1)) = ((0..^𝑘) ∪ {𝑘})) |
56 | 55 | ineq2d 4143 |
. . . . . . . . . 10
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ((bits‘𝑁) ∩ (0..^(𝑘 + 1))) = ((bits‘𝑁) ∩ ((0..^𝑘) ∪ {𝑘}))) |
57 | | indi 4204 |
. . . . . . . . . 10
⊢
((bits‘𝑁)
∩ ((0..^𝑘) ∪ {𝑘})) = (((bits‘𝑁) ∩ (0..^𝑘)) ∪ ((bits‘𝑁) ∩ {𝑘})) |
58 | 56, 57 | eqtrdi 2795 |
. . . . . . . . 9
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ((bits‘𝑁) ∩ (0..^(𝑘 + 1))) = (((bits‘𝑁) ∩ (0..^𝑘)) ∪ ((bits‘𝑁) ∩ {𝑘}))) |
59 | | fzofi 13622 |
. . . . . . . . . . 11
⊢
(0..^(𝑘 + 1)) ∈
Fin |
60 | | inss2 4160 |
. . . . . . . . . . 11
⊢
((bits‘𝑁)
∩ (0..^(𝑘 + 1)))
⊆ (0..^(𝑘 +
1)) |
61 | | ssfi 8918 |
. . . . . . . . . . 11
⊢
(((0..^(𝑘 + 1))
∈ Fin ∧ ((bits‘𝑁) ∩ (0..^(𝑘 + 1))) ⊆ (0..^(𝑘 + 1))) → ((bits‘𝑁) ∩ (0..^(𝑘 + 1))) ∈ Fin) |
62 | 59, 60, 61 | mp2an 688 |
. . . . . . . . . 10
⊢
((bits‘𝑁)
∩ (0..^(𝑘 + 1))) ∈
Fin |
63 | 62 | a1i 11 |
. . . . . . . . 9
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → ((bits‘𝑁) ∩ (0..^(𝑘 + 1))) ∈ Fin) |
64 | | 2nn 11976 |
. . . . . . . . . . . 12
⊢ 2 ∈
ℕ |
65 | 64 | a1i 11 |
. . . . . . . . . . 11
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → 2 ∈
ℕ) |
66 | | simpr 484 |
. . . . . . . . . . . . . 14
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) |
67 | 66 | elin2d 4129 |
. . . . . . . . . . . . 13
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → 𝑛 ∈ (0..^(𝑘 + 1))) |
68 | | elfzouz 13320 |
. . . . . . . . . . . . 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 13888 |
. . . . . . . . . 10
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → (2↑𝑛) ∈ ℕ) |
72 | 71 | nncnd 11919 |
. . . . . . . . 9
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))) → (2↑𝑛) ∈ ℂ) |
73 | 50, 58, 63, 72 | fsumsplit 15381 |
. . . . . . . 8
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^(𝑘 + 1)))(2↑𝑛) = (Σ𝑛 ∈ ((bits‘𝑁) ∩ (0..^𝑘))(2↑𝑛) + Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛))) |
74 | | bitsinv1lem 16076 |
. . . . . . . . . 10
⊢ ((𝑁 ∈ ℤ ∧ 𝑘 ∈ ℕ0)
→ (𝑁 mod
(2↑(𝑘 + 1))) = ((𝑁 mod (2↑𝑘)) + if(𝑘 ∈ (bits‘𝑁), (2↑𝑘), 0))) |
75 | 39, 74 | sylan 579 |
. . . . . . . . 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 484 |
. . . . . . . . . . . . . . 15
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → 𝑘 ∈ (bits‘𝑁)) |
79 | 78 | snssd 4739 |
. . . . . . . . . . . . . 14
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → {𝑘} ⊆ (bits‘𝑁)) |
80 | | sseqin2 4146 |
. . . . . . . . . . . . . 14
⊢ ({𝑘} ⊆ (bits‘𝑁) ↔ ((bits‘𝑁) ∩ {𝑘}) = {𝑘}) |
81 | 79, 80 | sylib 217 |
. . . . . . . . . . . . 13
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → ((bits‘𝑁) ∩ {𝑘}) = {𝑘}) |
82 | 81 | sumeq1d 15341 |
. . . . . . . . . . . 12
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = Σ𝑛 ∈ {𝑘} (2↑𝑛)) |
83 | | simplr 765 |
. . . . . . . . . . . . 13
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → 𝑘 ∈ ℕ0) |
84 | 64 | a1i 11 |
. . . . . . . . . . . . . . 15
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → 2 ∈ ℕ) |
85 | 84, 83 | nnexpcld 13888 |
. . . . . . . . . . . . . 14
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → (2↑𝑘) ∈ ℕ) |
86 | 85 | nncnd 11919 |
. . . . . . . . . . . . 13
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → (2↑𝑘) ∈ ℂ) |
87 | | oveq2 7263 |
. . . . . . . . . . . . . 14
⊢ (𝑛 = 𝑘 → (2↑𝑛) = (2↑𝑘)) |
88 | 87 | sumsn 15386 |
. . . . . . . . . . . . 13
⊢ ((𝑘 ∈ ℕ0
∧ (2↑𝑘) ∈
ℂ) → Σ𝑛
∈ {𝑘} (2↑𝑛) = (2↑𝑘)) |
89 | 83, 86, 88 | syl2anc 583 |
. . . . . . . . . . . 12
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → Σ𝑛 ∈ {𝑘} (2↑𝑛) = (2↑𝑘)) |
90 | 82, 89 | eqtrd 2778 |
. . . . . . . . . . 11
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ 𝑘 ∈ (bits‘𝑁)) → Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = (2↑𝑘)) |
91 | | simpr 484 |
. . . . . . . . . . . . . 14
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝑁)) → ¬ 𝑘 ∈ (bits‘𝑁)) |
92 | | disjsn 4644 |
. . . . . . . . . . . . . 14
⊢
(((bits‘𝑁)
∩ {𝑘}) = ∅ ↔
¬ 𝑘 ∈
(bits‘𝑁)) |
93 | 91, 92 | sylibr 233 |
. . . . . . . . . . . . 13
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝑁)) → ((bits‘𝑁) ∩ {𝑘}) = ∅) |
94 | 93 | sumeq1d 15341 |
. . . . . . . . . . . 12
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝑁)) → Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = Σ𝑛 ∈ ∅ (2↑𝑛)) |
95 | 94, 8 | eqtrdi 2795 |
. . . . . . . . . . 11
⊢ (((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) ∧ ¬ 𝑘 ∈ (bits‘𝑁)) → Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = 0) |
96 | 76, 77, 90, 95 | ifbothda 4494 |
. . . . . . . . . 10
⊢ ((𝑁 ∈ ℕ0
∧ 𝑘 ∈
ℕ0) → Σ𝑛 ∈ ((bits‘𝑁) ∩ {𝑘})(2↑𝑛) = if(𝑘 ∈ (bits‘𝑁), (2↑𝑘), 0)) |
97 | 96 | oveq2d 7271 |
. . . . . . . . 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 413 |
. . . . 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 12345 |
. . 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 13888 |
. . . . . . 7
⊢ (𝑁 ∈ ℕ0
→ (2↑𝑁) ∈
ℕ) |
109 | 108 | nnzd 12354 |
. . . . . 6
⊢ (𝑁 ∈ ℕ0
→ (2↑𝑁) ∈
ℤ) |
110 | | 2z 12282 |
. . . . . . . 8
⊢ 2 ∈
ℤ |
111 | | uzid 12526 |
. . . . . . . 8
⊢ (2 ∈
ℤ → 2 ∈ (ℤ≥‘2)) |
112 | 110, 111 | ax-mp 5 |
. . . . . . 7
⊢ 2 ∈
(ℤ≥‘2) |
113 | | bernneq3 13874 |
. . . . . . 7
⊢ ((2
∈ (ℤ≥‘2) ∧ 𝑁 ∈ ℕ0) → 𝑁 < (2↑𝑁)) |
114 | 112, 113 | mpan 686 |
. . . . . 6
⊢ (𝑁 ∈ ℕ0
→ 𝑁 < (2↑𝑁)) |
115 | | elfzo2 13319 |
. . . . . 6
⊢ (𝑁 ∈ (0..^(2↑𝑁)) ↔ (𝑁 ∈ (ℤ≥‘0)
∧ (2↑𝑁) ∈
ℤ ∧ 𝑁 <
(2↑𝑁))) |
116 | 106, 109,
114, 115 | syl3anbrc 1341 |
. . . . 5
⊢ (𝑁 ∈ ℕ0
→ 𝑁 ∈
(0..^(2↑𝑁))) |
117 | | bitsfzo 16070 |
. . . . . 6
⊢ ((𝑁 ∈ ℤ ∧ 𝑁 ∈ ℕ0)
→ (𝑁 ∈
(0..^(2↑𝑁)) ↔
(bits‘𝑁) ⊆
(0..^𝑁))) |
118 | 39, 105, 117 | syl2anc 583 |
. . . . 5
⊢ (𝑁 ∈ ℕ0
→ (𝑁 ∈
(0..^(2↑𝑁)) ↔
(bits‘𝑁) ⊆
(0..^𝑁))) |
119 | 116, 118 | mpbid 231 |
. . . 4
⊢ (𝑁 ∈ ℕ0
→ (bits‘𝑁)
⊆ (0..^𝑁)) |
120 | | df-ss 3900 |
. . . 4
⊢
((bits‘𝑁)
⊆ (0..^𝑁) ↔
((bits‘𝑁) ∩
(0..^𝑁)) =
(bits‘𝑁)) |
121 | 119, 120 | sylib 217 |
. . 3
⊢ (𝑁 ∈ ℕ0
→ ((bits‘𝑁)
∩ (0..^𝑁)) =
(bits‘𝑁)) |
122 | 121 | sumeq1d 15341 |
. 2
⊢ (𝑁 ∈ ℕ0
→ Σ𝑛 ∈
((bits‘𝑁) ∩
(0..^𝑁))(2↑𝑛) = Σ𝑛 ∈ (bits‘𝑁)(2↑𝑛)) |
123 | | nn0re 12172 |
. . 3
⊢ (𝑁 ∈ ℕ0
→ 𝑁 ∈
ℝ) |
124 | | 2rp 12664 |
. . . . 5
⊢ 2 ∈
ℝ+ |
125 | 124 | a1i 11 |
. . . 4
⊢ (𝑁 ∈ ℕ0
→ 2 ∈ ℝ+) |
126 | 125, 39 | rpexpcld 13890 |
. . 3
⊢ (𝑁 ∈ ℕ0
→ (2↑𝑁) ∈
ℝ+) |
127 | | nn0ge0 12188 |
. . 3
⊢ (𝑁 ∈ ℕ0
→ 0 ≤ 𝑁) |
128 | | modid 13544 |
. . 3
⊢ (((𝑁 ∈ ℝ ∧
(2↑𝑁) ∈
ℝ+) ∧ (0 ≤ 𝑁 ∧ 𝑁 < (2↑𝑁))) → (𝑁 mod (2↑𝑁)) = 𝑁) |
129 | 123, 126,
127, 114, 128 | syl22anc 835 |
. 2
⊢ (𝑁 ∈ ℕ0
→ (𝑁 mod (2↑𝑁)) = 𝑁) |
130 | 104, 122,
129 | 3eqtr3d 2786 |
1
⊢ (𝑁 ∈ ℕ0
→ Σ𝑛 ∈
(bits‘𝑁)(2↑𝑛) = 𝑁) |