MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  bitsp1o Structured version   Visualization version   GIF version

Theorem bitsp1o 15561
Description: The 𝑀 + 1-th bit of 2𝑁 + 1 is the 𝑀-th bit of 𝑁. (Contributed by Mario Carneiro, 5-Sep-2016.)
Assertion
Ref Expression
bitsp1o ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘𝑁)))

Proof of Theorem bitsp1o
StepHypRef Expression
1 2z 11761 . . . . . 6 2 ∈ ℤ
21a1i 11 . . . . 5 (𝑁 ∈ ℤ → 2 ∈ ℤ)
3 id 22 . . . . 5 (𝑁 ∈ ℤ → 𝑁 ∈ ℤ)
42, 3zmulcld 11840 . . . 4 (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℤ)
54peano2zd 11837 . . 3 (𝑁 ∈ ℤ → ((2 · 𝑁) + 1) ∈ ℤ)
6 bitsp1 15559 . . 3 ((((2 · 𝑁) + 1) ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2)))))
75, 6sylan 575 . 2 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2)))))
8 2re 11449 . . . . . . . . . . . 12 2 ∈ ℝ
98a1i 11 . . . . . . . . . . 11 (𝑁 ∈ ℤ → 2 ∈ ℝ)
10 zre 11732 . . . . . . . . . . 11 (𝑁 ∈ ℤ → 𝑁 ∈ ℝ)
119, 10remulcld 10407 . . . . . . . . . 10 (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℝ)
1211recnd 10405 . . . . . . . . 9 (𝑁 ∈ ℤ → (2 · 𝑁) ∈ ℂ)
13 1cnd 10371 . . . . . . . . 9 (𝑁 ∈ ℤ → 1 ∈ ℂ)
14 2cnd 11453 . . . . . . . . 9 (𝑁 ∈ ℤ → 2 ∈ ℂ)
15 2ne0 11486 . . . . . . . . . 10 2 ≠ 0
1615a1i 11 . . . . . . . . 9 (𝑁 ∈ ℤ → 2 ≠ 0)
1712, 13, 14, 16divdird 11189 . . . . . . . 8 (𝑁 ∈ ℤ → (((2 · 𝑁) + 1) / 2) = (((2 · 𝑁) / 2) + (1 / 2)))
18 zcn 11733 . . . . . . . . . 10 (𝑁 ∈ ℤ → 𝑁 ∈ ℂ)
1918, 14, 16divcan3d 11156 . . . . . . . . 9 (𝑁 ∈ ℤ → ((2 · 𝑁) / 2) = 𝑁)
2019oveq1d 6937 . . . . . . . 8 (𝑁 ∈ ℤ → (((2 · 𝑁) / 2) + (1 / 2)) = (𝑁 + (1 / 2)))
2117, 20eqtrd 2813 . . . . . . 7 (𝑁 ∈ ℤ → (((2 · 𝑁) + 1) / 2) = (𝑁 + (1 / 2)))
2221fveq2d 6450 . . . . . 6 (𝑁 ∈ ℤ → (⌊‘(((2 · 𝑁) + 1) / 2)) = (⌊‘(𝑁 + (1 / 2))))
23 halfge0 11599 . . . . . . . 8 0 ≤ (1 / 2)
24 halflt1 11600 . . . . . . . 8 (1 / 2) < 1
2523, 24pm3.2i 464 . . . . . . 7 (0 ≤ (1 / 2) ∧ (1 / 2) < 1)
26 halfre 11596 . . . . . . . 8 (1 / 2) ∈ ℝ
27 flbi2 12937 . . . . . . . 8 ((𝑁 ∈ ℤ ∧ (1 / 2) ∈ ℝ) → ((⌊‘(𝑁 + (1 / 2))) = 𝑁 ↔ (0 ≤ (1 / 2) ∧ (1 / 2) < 1)))
2826, 27mpan2 681 . . . . . . 7 (𝑁 ∈ ℤ → ((⌊‘(𝑁 + (1 / 2))) = 𝑁 ↔ (0 ≤ (1 / 2) ∧ (1 / 2) < 1)))
2925, 28mpbiri 250 . . . . . 6 (𝑁 ∈ ℤ → (⌊‘(𝑁 + (1 / 2))) = 𝑁)
3022, 29eqtrd 2813 . . . . 5 (𝑁 ∈ ℤ → (⌊‘(((2 · 𝑁) + 1) / 2)) = 𝑁)
3130adantr 474 . . . 4 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (⌊‘(((2 · 𝑁) + 1) / 2)) = 𝑁)
3231fveq2d 6450 . . 3 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))) = (bits‘𝑁))
3332eleq2d 2844 . 2 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → (𝑀 ∈ (bits‘(⌊‘(((2 · 𝑁) + 1) / 2))) ↔ 𝑀 ∈ (bits‘𝑁)))
347, 33bitrd 271 1 ((𝑁 ∈ ℤ ∧ 𝑀 ∈ ℕ0) → ((𝑀 + 1) ∈ (bits‘((2 · 𝑁) + 1)) ↔ 𝑀 ∈ (bits‘𝑁)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 198  wa 386   = wceq 1601  wcel 2106  wne 2968   class class class wbr 4886  cfv 6135  (class class class)co 6922  cr 10271  0cc0 10272  1c1 10273   + caddc 10275   · cmul 10277   < clt 10411  cle 10412   / cdiv 11032  2c2 11430  0cn0 11642  cz 11728  cfl 12910  bitscbits 15547
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1839  ax-4 1853  ax-5 1953  ax-6 2021  ax-7 2054  ax-8 2108  ax-9 2115  ax-10 2134  ax-11 2149  ax-12 2162  ax-13 2333  ax-ext 2753  ax-sep 5017  ax-nul 5025  ax-pow 5077  ax-pr 5138  ax-un 7226  ax-cnex 10328  ax-resscn 10329  ax-1cn 10330  ax-icn 10331  ax-addcl 10332  ax-addrcl 10333  ax-mulcl 10334  ax-mulrcl 10335  ax-mulcom 10336  ax-addass 10337  ax-mulass 10338  ax-distr 10339  ax-i2m1 10340  ax-1ne0 10341  ax-1rid 10342  ax-rnegex 10343  ax-rrecex 10344  ax-cnre 10345  ax-pre-lttri 10346  ax-pre-lttrn 10347  ax-pre-ltadd 10348  ax-pre-mulgt0 10349  ax-pre-sup 10350
This theorem depends on definitions:  df-bi 199  df-an 387  df-or 837  df-3or 1072  df-3an 1073  df-tru 1605  df-ex 1824  df-nf 1828  df-sb 2012  df-mo 2550  df-eu 2586  df-clab 2763  df-cleq 2769  df-clel 2773  df-nfc 2920  df-ne 2969  df-nel 3075  df-ral 3094  df-rex 3095  df-reu 3096  df-rmo 3097  df-rab 3098  df-v 3399  df-sbc 3652  df-csb 3751  df-dif 3794  df-un 3796  df-in 3798  df-ss 3805  df-pss 3807  df-nul 4141  df-if 4307  df-pw 4380  df-sn 4398  df-pr 4400  df-tp 4402  df-op 4404  df-uni 4672  df-iun 4755  df-br 4887  df-opab 4949  df-mpt 4966  df-tr 4988  df-id 5261  df-eprel 5266  df-po 5274  df-so 5275  df-fr 5314  df-we 5316  df-xp 5361  df-rel 5362  df-cnv 5363  df-co 5364  df-dm 5365  df-rn 5366  df-res 5367  df-ima 5368  df-pred 5933  df-ord 5979  df-on 5980  df-lim 5981  df-suc 5982  df-iota 6099  df-fun 6137  df-fn 6138  df-f 6139  df-f1 6140  df-fo 6141  df-f1o 6142  df-fv 6143  df-riota 6883  df-ov 6925  df-oprab 6926  df-mpt2 6927  df-om 7344  df-2nd 7446  df-wrecs 7689  df-recs 7751  df-rdg 7789  df-er 8026  df-en 8242  df-dom 8243  df-sdom 8244  df-sup 8636  df-inf 8637  df-pnf 10413  df-mnf 10414  df-xr 10415  df-ltxr 10416  df-le 10417  df-sub 10608  df-neg 10609  df-div 11033  df-nn 11375  df-2 11438  df-n0 11643  df-z 11729  df-uz 11993  df-fl 12912  df-seq 13120  df-exp 13179  df-bits 15550
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator