Metamath Proof Explorer


Theorem bitsp1

Description: The M + 1 -th bit of N is the M -th bit of |_ ( N / 2 ) . (Contributed by Mario Carneiro, 5-Sep-2016)

Ref Expression
Assertion bitsp1 N M 0 M + 1 bits N M bits N 2

Proof

Step Hyp Ref Expression
1 2nn 2
2 1 a1i N M 0 2
3 2 nncnd N M 0 2
4 simpr N M 0 M 0
5 3 4 expp1d N M 0 2 M + 1 = 2 M 2
6 2 4 nnexpcld N M 0 2 M
7 6 nncnd N M 0 2 M
8 7 3 mulcomd N M 0 2 M 2 = 2 2 M
9 5 8 eqtrd N M 0 2 M + 1 = 2 2 M
10 9 oveq2d N M 0 N 2 M + 1 = N 2 2 M
11 simpl N M 0 N
12 11 zcnd N M 0 N
13 2 nnne0d N M 0 2 0
14 6 nnne0d N M 0 2 M 0
15 12 3 7 13 14 divdiv1d N M 0 N 2 2 M = N 2 2 M
16 10 15 eqtr4d N M 0 N 2 M + 1 = N 2 2 M
17 16 fveq2d N M 0 N 2 M + 1 = N 2 2 M
18 11 zred N M 0 N
19 18 rehalfcld N M 0 N 2
20 fldiv N 2 2 M N 2 2 M = N 2 2 M
21 19 6 20 syl2anc N M 0 N 2 2 M = N 2 2 M
22 17 21 eqtr4d N M 0 N 2 M + 1 = N 2 2 M
23 22 breq2d N M 0 2 N 2 M + 1 2 N 2 2 M
24 23 notbid N M 0 ¬ 2 N 2 M + 1 ¬ 2 N 2 2 M
25 peano2nn0 M 0 M + 1 0
26 bitsval2 N M + 1 0 M + 1 bits N ¬ 2 N 2 M + 1
27 25 26 sylan2 N M 0 M + 1 bits N ¬ 2 N 2 M + 1
28 19 flcld N M 0 N 2
29 bitsval2 N 2 M 0 M bits N 2 ¬ 2 N 2 2 M
30 28 29 sylancom N M 0 M bits N 2 ¬ 2 N 2 2 M
31 24 27 30 3bitr4d N M 0 M + 1 bits N M bits N 2