| 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 12627 | . . . . . 6 ⊢ 2 ∈ ℤ | |
| 2 | 1 | a1i 11 | . . . . 5 ⊢ (𝑁 ∈ ℤ → 2 ∈ ℤ) |
| 3 | id 23 | . . . . 5 ⊢ (𝑁 ∈ ℤ → 𝑁 ∈ ℤ) | |
| 4 | 2, 3 | zmulcld 12707 | . . . 4 ⊢ (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℤ) |
| 5 | 4 | peano2zd 12704 | . . 3 ⊢ (𝑁 ∈ ℤ → ((2 · 𝑁) + 1) ∈ ℤ) |
| 6 | bitsp1 16490 | . . 3 ⊢ ((((2 · 𝑁) + 1) ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))))) | |
| 7 | 5, 6 | sylan 591 | . 2 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))))) |
| 8 | 2re 12316 | . . . . . . . . . . . 12 ⊢ 2 ∈ ℝ | |
| 9 | 8 | a1i 11 | . . . . . . . . . . 11 ⊢ (𝑁 ∈ ℤ → 2 ∈ ℝ) |
| 10 | zre 12596 | . . . . . . . . . . 11 ⊢ (𝑁 ∈ ℤ → 𝑁 ∈ ℝ) | |
| 11 | 9, 10 | remulcld 11240 | . . . . . . . . . 10 ⊢ (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℝ) |
| 12 | 11 | recnd 11238 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℂ) |
| 13 | 1cnd 11203 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → 1 ∈ ℂ) | |
| 14 | 2cnd 12320 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → 2 ∈ ℂ) | |
| 15 | 2ne0 12348 | . . . . . . . . . 10 ⊢ 2 ≠ 0 | |
| 16 | 15 | a1i 11 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → 2 ≠ 0) |
| 17 | 12, 13, 14, 16 | divdird 12030 | . . . . . . . 8 ⊢ (𝑁 ∈ ℤ → (((2 · 𝑁) + 1) / 2) = (((2 · 𝑁) / 2) + (1 / 2))) |
| 18 | zcn 12597 | . . . . . . . . . 10 ⊢ (𝑁 ∈ ℤ → 𝑁 ∈ ℂ) | |
| 19 | 18, 14, 16 | divcan3d 11997 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → ((2 · 𝑁) / 2) = 𝑁) |
| 20 | 19 | oveq1d 7427 | . . . . . . . 8 ⊢ (𝑁 ∈ ℤ → (((2 · 𝑁) / 2) + (1 / 2)) = (𝑁 + (1 / 2))) |
| 21 | 17, 20 | eqtrd 2798 | . . . . . . 7 ⊢ (𝑁 ∈ ℤ → (((2 · 𝑁) + 1) / 2) = (𝑁 + (1 / 2))) |
| 22 | 21 | fveq2d 6887 | . . . . . 6 ⊢ (𝑁 ∈ ℤ → (⌊‘(((2 · 𝑁) + 1) / 2)) = (⌊‘(𝑁 + (1 / 2)))) |
| 23 | halfge0 12461 | . . . . . . . 8 ⊢ 0 ≤ (1 / 2) | |
| 24 | halflt1 12462 | . . . . . . . 8 ⊢ (1 / 2) < 1 | |
| 25 | 23, 24 | pm3.2i 475 | . . . . . . 7 ⊢ (0 ≤ (1 / 2) ∧ (1 / 2) < 1) |
| 26 | halfre 12458 | . . . . . . . 8 ⊢ (1 / 2) ∈ ℝ | |
| 27 | flbi2 13852 | . . . . . . . 8 ⊢ ((𝑁 ∈ ℤ ∧ (1 / 2) ∈ ℝ) → ((⌊‘(𝑁 + (1 / 2))) = 𝑁 ↔ (0 ≤ (1 / 2) ∧ (1 / 2) < 1))) | |
| 28 | 26, 27 | mpan2 703 | . . . . . . 7 ⊢ (𝑁 ∈ ℤ → ((⌊‘(𝑁 + (1 / 2))) = 𝑁 ↔ (0 ≤ (1 / 2) ∧ (1 / 2) < 1))) |
| 29 | 25, 28 | mpbiri 261 | . . . . . 6 ⊢ (𝑁 ∈ ℤ → (⌊‘(𝑁 + (1 / 2))) = 𝑁) |
| 30 | 22, 29 | eqtrd 2798 | . . . . 5 ⊢ (𝑁 ∈ ℤ → (⌊‘(((2 · 𝑁) + 1) / 2)) = 𝑁) |
| 31 | 30 | adantr 485 | . . . 4 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (⌊‘(((2 · 𝑁) + 1) / 2)) = 𝑁) |
| 32 | 31 | fveq2d 6887 | . . 3 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))) = (bits‘𝑁)) |
| 33 | 32 | eleq2d 2849 | . 2 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))) ↔ 𝑀 ∈ (bits‘𝑁))) |
| 34 | 7, 33 | bitrd 282 | 1 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘𝑁))) |
| Colors of variables: wff setvar class |
| Syntax hints: → wi 4 ↔ wb 209 ∧ wa 400 = wceq 1570 ∈ wcel 2143 ≠ wne 2958 class class class wbr 5110 ‘cfv 6538 (class class class)co 7412 ℝcr 11100 0cc0 11101 1c1 11102 + caddc 11104 · cmul 11106 < clt 11244 ≤ cle 11245 / cdiv 11872 2c2 12296 ℕ0cn0 12505 ℤcz 12592 ⌊cfl 13825 bitscbits 16478 |
| This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1825 ax-4 1839 ax-5 1940 ax-6 1997 ax-7 2038 ax-8 2145 ax-9 2153 ax-10 2176 ax-11 2192 ax-12 2213 ax-ext 2735 ax-sep 5258 ax-nul 5270 ax-pow 5338 ax-pr 5406 ax-un 7734 ax-cnex 11157 ax-resscn 11158 ax-1cn 11159 ax-icn 11160 ax-addcl 11161 ax-addrcl 11162 ax-mulcl 11163 ax-mulrcl 11164 ax-mulcom 11165 ax-addass 11166 ax-mulass 11167 ax-distr 11168 ax-i2m1 11169 ax-1ne0 11170 ax-1rid 11171 ax-rnegex 11172 ax-rrecex 11173 ax-cnre 11174 ax-pre-lttri 11175 ax-pre-lttrn 11176 ax-pre-ltadd 11177 ax-pre-mulgt0 11178 ax-pre-sup 11179 |
| This theorem depends on definitions: df-bi 210 df-an 401 df-or 861 df-3or 1104 df-3an 1105 df-tru 1573 df-fal 1583 df-ex 1810 df-nf 1814 df-sb 2097 df-mo 2567 df-eu 2597 df-clab 2742 df-cleq 2755 df-clel 2838 df-nfc 2912 df-ne 2959 df-nel 3065 df-ral 3080 df-rex 3090 df-rmo 3369 df-reu 3370 df-rab 3417 df-v 3457 df-sbc 3746 df-csb 3855 df-dif 3909 df-un 3911 df-in 3913 df-ss 3923 df-pss 3926 df-nul 4288 df-if 4489 df-pw 4565 df-sn 4591 df-pr 4593 df-op 4597 df-uni 4874 df-iun 4959 df-br 5111 df-opab 5175 df-mpt 5194 df-tr 5220 df-id 5558 df-eprel 5563 df-po 5571 df-so 5572 df-fr 5616 df-we 5618 df-xp 5669 df-rel 5670 df-cnv 5671 df-co 5672 df-dm 5673 df-rn 5674 df-res 5675 df-ima 5676 df-pred 6304 df-ord 6365 df-on 6366 df-lim 6367 df-suc 6368 df-iota 6494 df-fun 6540 df-fn 6541 df-f 6542 df-f1 6543 df-fo 6544 df-f1o 6545 df-fv 6546 df-riota 7369 df-ov 7415 df-oprab 7416 df-mpo 7417 df-om 7864 df-2nd 7988 df-frecs 8279 df-wrecs 8310 df-recs 8359 df-rdg 8398 df-er 8695 df-en 8945 df-dom 8946 df-sdom 8947 df-sup 9403 df-inf 9404 df-pnf 11246 df-mnf 11247 df-xr 11248 df-ltxr 11249 df-le 11250 df-sub 11444 df-neg 11445 df-div 11873 df-nn 12235 df-2 12304 df-n0 12506 df-z 12593 df-uz 12864 df-fl 13827 df-seq 14040 df-exp 14100 df-bits 16481 |
| This theorem is referenced by: (None) |
| Copyright terms: Public domain | W3C validator |