![]() |
Metamath Proof Explorer |
< Previous
Next >
Nearby theorems |
|
Mirrors > Home > MPE Home > Th. List > bitsp1o | Structured version Visualization version GIF version |
Description: The 𝑀 + 1-th bit of 2𝑁 + 1 is the 𝑀-th bit of 𝑁. (Contributed by Mario Carneiro, 5-Sep-2016.) |
Ref | Expression |
---|---|
bitsp1o | ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘𝑁))) |
Step | Hyp | Ref | Expression |
---|---|---|---|
1 | 2z 11737 | . . . . . 6 ⊢ 2 ∈ ℤ | |
2 | 1 | a1i 11 | . . . . 5 ⊢ (𝑁 ∈ ℤ → 2 ∈ ℤ) |
3 | id 22 | . . . . 5 ⊢ (𝑁 ∈ ℤ → 𝑁 ∈ ℤ) | |
4 | 2, 3 | zmulcld 11816 | . . . 4 ⊢ (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℤ) |
5 | 4 | peano2zd 11813 | . . 3 ⊢ (𝑁 ∈ ℤ → ((2 · 𝑁) + 1) ∈ ℤ) |
6 | bitsp1 15526 | . . 3 ⊢ ((((2 · 𝑁) + 1) ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))))) | |
7 | 5, 6 | sylan 575 | . 2 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))))) |
8 | 2re 11425 | . . . . . . . . . . . 12 ⊢ 2 ∈ ℝ | |
9 | 8 | a1i 11 | . . . . . . . . . . 11 ⊢ (𝑁 ∈ ℤ → 2 ∈ ℝ) |
10 | zre 11708 | . . . . . . . . . . 11 ⊢ (𝑁 ∈ ℤ → 𝑁 ∈ ℝ) | |
11 | 9, 10 | remulcld 10387 | . . . . . . . . . 10 ⊢ (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℝ) |
12 | 11 | recnd 10385 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℂ) |
13 | 1cnd 10351 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → 1 ∈ ℂ) | |
14 | 2cnd 11429 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → 2 ∈ ℂ) | |
15 | 2ne0 11462 | . . . . . . . . . 10 ⊢ 2 ≠ 0 | |
16 | 15 | a1i 11 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → 2 ≠ 0) |
17 | 12, 13, 14, 16 | divdird 11165 | . . . . . . . 8 ⊢ (𝑁 ∈ ℤ → (((2 · 𝑁) + 1) / 2) = (((2 · 𝑁) / 2) + (1 / 2))) |
18 | zcn 11709 | . . . . . . . . . 10 ⊢ (𝑁 ∈ ℤ → 𝑁 ∈ ℂ) | |
19 | 18, 14, 16 | divcan3d 11132 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → ((2 · 𝑁) / 2) = 𝑁) |
20 | 19 | oveq1d 6920 | . . . . . . . 8 ⊢ (𝑁 ∈ ℤ → (((2 · 𝑁) / 2) + (1 / 2)) = (𝑁 + (1 / 2))) |
21 | 17, 20 | eqtrd 2861 | . . . . . . 7 ⊢ (𝑁 ∈ ℤ → (((2 · 𝑁) + 1) / 2) = (𝑁 + (1 / 2))) |
22 | 21 | fveq2d 6437 | . . . . . 6 ⊢ (𝑁 ∈ ℤ → (⌊‘(((2 · 𝑁) + 1) / 2)) = (⌊‘(𝑁 + (1 / 2)))) |
23 | 0re 10358 | . . . . . . . . 9 ⊢ 0 ∈ ℝ | |
24 | halfre 11572 | . . . . . . . . 9 ⊢ (1 / 2) ∈ ℝ | |
25 | halfgt0 11574 | . . . . . . . . 9 ⊢ 0 < (1 / 2) | |
26 | 23, 24, 25 | ltleii 10479 | . . . . . . . 8 ⊢ 0 ≤ (1 / 2) |
27 | halflt1 11576 | . . . . . . . 8 ⊢ (1 / 2) < 1 | |
28 | 26, 27 | pm3.2i 464 | . . . . . . 7 ⊢ (0 ≤ (1 / 2) ∧ (1 / 2) < 1) |
29 | flbi2 12913 | . . . . . . . 8 ⊢ ((𝑁 ∈ ℤ ∧ (1 / 2) ∈ ℝ) → ((⌊‘(𝑁 + (1 / 2))) = 𝑁 ↔ (0 ≤ (1 / 2) ∧ (1 / 2) < 1))) | |
30 | 24, 29 | mpan2 682 | . . . . . . 7 ⊢ (𝑁 ∈ ℤ → ((⌊‘(𝑁 + (1 / 2))) = 𝑁 ↔ (0 ≤ (1 / 2) ∧ (1 / 2) < 1))) |
31 | 28, 30 | mpbiri 250 | . . . . . 6 ⊢ (𝑁 ∈ ℤ → (⌊‘(𝑁 + (1 / 2))) = 𝑁) |
32 | 22, 31 | eqtrd 2861 | . . . . 5 ⊢ (𝑁 ∈ ℤ → (⌊‘(((2 · 𝑁) + 1) / 2)) = 𝑁) |
33 | 32 | adantr 474 | . . . 4 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (⌊‘(((2 · 𝑁) + 1) / 2)) = 𝑁) |
34 | 33 | fveq2d 6437 | . . 3 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))) = (bits‘𝑁)) |
35 | 34 | eleq2d 2892 | . 2 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))) ↔ 𝑀 ∈ (bits‘𝑁))) |
36 | 7, 35 | bitrd 271 | 1 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘𝑁))) |
Colors of variables: wff setvar class |
Syntax hints: → wi 4 ↔ wb 198 ∧ wa 386 = wceq 1656 ∈ wcel 2164 ≠ wne 2999 class class class wbr 4873 ‘cfv 6123 (class class class)co 6905 ℝcr 10251 0cc0 10252 1c1 10253 + caddc 10255 · cmul 10257 < clt 10391 ≤ cle 10392 / cdiv 11009 2c2 11406 ℕ0cn0 11618 ℤcz 11704 ⌊cfl 12886 bitscbits 15514 |
This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1894 ax-4 1908 ax-5 2009 ax-6 2075 ax-7 2112 ax-8 2166 ax-9 2173 ax-10 2192 ax-11 2207 ax-12 2220 ax-13 2389 ax-ext 2803 ax-sep 5005 ax-nul 5013 ax-pow 5065 ax-pr 5127 ax-un 7209 ax-cnex 10308 ax-resscn 10309 ax-1cn 10310 ax-icn 10311 ax-addcl 10312 ax-addrcl 10313 ax-mulcl 10314 ax-mulrcl 10315 ax-mulcom 10316 ax-addass 10317 ax-mulass 10318 ax-distr 10319 ax-i2m1 10320 ax-1ne0 10321 ax-1rid 10322 ax-rnegex 10323 ax-rrecex 10324 ax-cnre 10325 ax-pre-lttri 10326 ax-pre-lttrn 10327 ax-pre-ltadd 10328 ax-pre-mulgt0 10329 ax-pre-sup 10330 |
This theorem depends on definitions: df-bi 199 df-an 387 df-or 879 df-3or 1112 df-3an 1113 df-tru 1660 df-ex 1879 df-nf 1883 df-sb 2068 df-mo 2605 df-eu 2640 df-clab 2812 df-cleq 2818 df-clel 2821 df-nfc 2958 df-ne 3000 df-nel 3103 df-ral 3122 df-rex 3123 df-reu 3124 df-rmo 3125 df-rab 3126 df-v 3416 df-sbc 3663 df-csb 3758 df-dif 3801 df-un 3803 df-in 3805 df-ss 3812 df-pss 3814 df-nul 4145 df-if 4307 df-pw 4380 df-sn 4398 df-pr 4400 df-tp 4402 df-op 4404 df-uni 4659 df-iun 4742 df-br 4874 df-opab 4936 df-mpt 4953 df-tr 4976 df-id 5250 df-eprel 5255 df-po 5263 df-so 5264 df-fr 5301 df-we 5303 df-xp 5348 df-rel 5349 df-cnv 5350 df-co 5351 df-dm 5352 df-rn 5353 df-res 5354 df-ima 5355 df-pred 5920 df-ord 5966 df-on 5967 df-lim 5968 df-suc 5969 df-iota 6086 df-fun 6125 df-fn 6126 df-f 6127 df-f1 6128 df-fo 6129 df-f1o 6130 df-fv 6131 df-riota 6866 df-ov 6908 df-oprab 6909 df-mpt2 6910 df-om 7327 df-2nd 7429 df-wrecs 7672 df-recs 7734 df-rdg 7772 df-er 8009 df-en 8223 df-dom 8224 df-sdom 8225 df-sup 8617 df-inf 8618 df-pnf 10393 df-mnf 10394 df-xr 10395 df-ltxr 10396 df-le 10397 df-sub 10587 df-neg 10588 df-div 11010 df-nn 11351 df-2 11414 df-n0 11619 df-z 11705 df-uz 11969 df-fl 12888 df-seq 13096 df-exp 13155 df-bits 15517 |
This theorem is referenced by: (None) |
Copyright terms: Public domain | W3C validator |