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 12002 | . . . . . 6 ⊢ 2 ∈ ℤ | |
2 | 1 | a1i 11 | . . . . 5 ⊢ (𝑁 ∈ ℤ → 2 ∈ ℤ) |
3 | id 22 | . . . . 5 ⊢ (𝑁 ∈ ℤ → 𝑁 ∈ ℤ) | |
4 | 2, 3 | zmulcld 12081 | . . . 4 ⊢ (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℤ) |
5 | 4 | peano2zd 12078 | . . 3 ⊢ (𝑁 ∈ ℤ → ((2 · 𝑁) + 1) ∈ ℤ) |
6 | bitsp1 15768 | . . 3 ⊢ ((((2 · 𝑁) + 1) ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))))) | |
7 | 5, 6 | sylan 580 | . 2 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))))) |
8 | 2re 11699 | . . . . . . . . . . . 12 ⊢ 2 ∈ ℝ | |
9 | 8 | a1i 11 | . . . . . . . . . . 11 ⊢ (𝑁 ∈ ℤ → 2 ∈ ℝ) |
10 | zre 11973 | . . . . . . . . . . 11 ⊢ (𝑁 ∈ ℤ → 𝑁 ∈ ℝ) | |
11 | 9, 10 | remulcld 10659 | . . . . . . . . . 10 ⊢ (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℝ) |
12 | 11 | recnd 10657 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℂ) |
13 | 1cnd 10624 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → 1 ∈ ℂ) | |
14 | 2cnd 11703 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → 2 ∈ ℂ) | |
15 | 2ne0 11729 | . . . . . . . . . 10 ⊢ 2 ≠ 0 | |
16 | 15 | a1i 11 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → 2 ≠ 0) |
17 | 12, 13, 14, 16 | divdird 11442 | . . . . . . . 8 ⊢ (𝑁 ∈ ℤ → (((2 · 𝑁) + 1) / 2) = (((2 · 𝑁) / 2) + (1 / 2))) |
18 | zcn 11974 | . . . . . . . . . 10 ⊢ (𝑁 ∈ ℤ → 𝑁 ∈ ℂ) | |
19 | 18, 14, 16 | divcan3d 11409 | . . . . . . . . 9 ⊢ (𝑁 ∈ ℤ → ((2 · 𝑁) / 2) = 𝑁) |
20 | 19 | oveq1d 7160 | . . . . . . . 8 ⊢ (𝑁 ∈ ℤ → (((2 · 𝑁) / 2) + (1 / 2)) = (𝑁 + (1 / 2))) |
21 | 17, 20 | eqtrd 2853 | . . . . . . 7 ⊢ (𝑁 ∈ ℤ → (((2 · 𝑁) + 1) / 2) = (𝑁 + (1 / 2))) |
22 | 21 | fveq2d 6667 | . . . . . 6 ⊢ (𝑁 ∈ ℤ → (⌊‘(((2 · 𝑁) + 1) / 2)) = (⌊‘(𝑁 + (1 / 2)))) |
23 | halfge0 11842 | . . . . . . . 8 ⊢ 0 ≤ (1 / 2) | |
24 | halflt1 11843 | . . . . . . . 8 ⊢ (1 / 2) < 1 | |
25 | 23, 24 | pm3.2i 471 | . . . . . . 7 ⊢ (0 ≤ (1 / 2) ∧ (1 / 2) < 1) |
26 | halfre 11839 | . . . . . . . 8 ⊢ (1 / 2) ∈ ℝ | |
27 | flbi2 13175 | . . . . . . . 8 ⊢ ((𝑁 ∈ ℤ ∧ (1 / 2) ∈ ℝ) → ((⌊‘(𝑁 + (1 / 2))) = 𝑁 ↔ (0 ≤ (1 / 2) ∧ (1 / 2) < 1))) | |
28 | 26, 27 | mpan2 687 | . . . . . . 7 ⊢ (𝑁 ∈ ℤ → ((⌊‘(𝑁 + (1 / 2))) = 𝑁 ↔ (0 ≤ (1 / 2) ∧ (1 / 2) < 1))) |
29 | 25, 28 | mpbiri 259 | . . . . . 6 ⊢ (𝑁 ∈ ℤ → (⌊‘(𝑁 + (1 / 2))) = 𝑁) |
30 | 22, 29 | eqtrd 2853 | . . . . 5 ⊢ (𝑁 ∈ ℤ → (⌊‘(((2 · 𝑁) + 1) / 2)) = 𝑁) |
31 | 30 | adantr 481 | . . . 4 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (⌊‘(((2 · 𝑁) + 1) / 2)) = 𝑁) |
32 | 31 | fveq2d 6667 | . . 3 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))) = (bits‘𝑁)) |
33 | 32 | eleq2d 2895 | . 2 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))) ↔ 𝑀 ∈ (bits‘𝑁))) |
34 | 7, 33 | bitrd 280 | 1 ⊢ ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘𝑁))) |
Colors of variables: wff setvar class |
Syntax hints: → wi 4 ↔ wb 207 ∧ wa 396 = wceq 1528 ∈ wcel 2105 ≠ wne 3013 class class class wbr 5057 ‘cfv 6348 (class class class)co 7145 ℝcr 10524 0cc0 10525 1c1 10526 + caddc 10528 · cmul 10530 < clt 10663 ≤ cle 10664 / cdiv 11285 2c2 11680 ℕ0cn0 11885 ℤcz 11969 ⌊cfl 13148 bitscbits 15756 |
This theorem was proved from axioms: ax-mp 5 ax-1 6 ax-2 7 ax-3 8 ax-gen 1787 ax-4 1801 ax-5 1902 ax-6 1961 ax-7 2006 ax-8 2107 ax-9 2115 ax-10 2136 ax-11 2151 ax-12 2167 ax-ext 2790 ax-sep 5194 ax-nul 5201 ax-pow 5257 ax-pr 5320 ax-un 7450 ax-cnex 10581 ax-resscn 10582 ax-1cn 10583 ax-icn 10584 ax-addcl 10585 ax-addrcl 10586 ax-mulcl 10587 ax-mulrcl 10588 ax-mulcom 10589 ax-addass 10590 ax-mulass 10591 ax-distr 10592 ax-i2m1 10593 ax-1ne0 10594 ax-1rid 10595 ax-rnegex 10596 ax-rrecex 10597 ax-cnre 10598 ax-pre-lttri 10599 ax-pre-lttrn 10600 ax-pre-ltadd 10601 ax-pre-mulgt0 10602 ax-pre-sup 10603 |
This theorem depends on definitions: df-bi 208 df-an 397 df-or 842 df-3or 1080 df-3an 1081 df-tru 1531 df-ex 1772 df-nf 1776 df-sb 2061 df-mo 2615 df-eu 2647 df-clab 2797 df-cleq 2811 df-clel 2890 df-nfc 2960 df-ne 3014 df-nel 3121 df-ral 3140 df-rex 3141 df-reu 3142 df-rmo 3143 df-rab 3144 df-v 3494 df-sbc 3770 df-csb 3881 df-dif 3936 df-un 3938 df-in 3940 df-ss 3949 df-pss 3951 df-nul 4289 df-if 4464 df-pw 4537 df-sn 4558 df-pr 4560 df-tp 4562 df-op 4564 df-uni 4831 df-iun 4912 df-br 5058 df-opab 5120 df-mpt 5138 df-tr 5164 df-id 5453 df-eprel 5458 df-po 5467 df-so 5468 df-fr 5507 df-we 5509 df-xp 5554 df-rel 5555 df-cnv 5556 df-co 5557 df-dm 5558 df-rn 5559 df-res 5560 df-ima 5561 df-pred 6141 df-ord 6187 df-on 6188 df-lim 6189 df-suc 6190 df-iota 6307 df-fun 6350 df-fn 6351 df-f 6352 df-f1 6353 df-fo 6354 df-f1o 6355 df-fv 6356 df-riota 7103 df-ov 7148 df-oprab 7149 df-mpo 7150 df-om 7570 df-2nd 7679 df-wrecs 7936 df-recs 7997 df-rdg 8035 df-er 8278 df-en 8498 df-dom 8499 df-sdom 8500 df-sup 8894 df-inf 8895 df-pnf 10665 df-mnf 10666 df-xr 10667 df-ltxr 10668 df-le 10669 df-sub 10860 df-neg 10861 df-div 11286 df-nn 11627 df-2 11688 df-n0 11886 df-z 11970 df-uz 12232 df-fl 13150 df-seq 13358 df-exp 13418 df-bits 15759 |
This theorem is referenced by: (None) |
Copyright terms: Public domain | W3C validator |