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 NM0M+1bitsNMbitsN2

Proof

Step Hyp Ref Expression
1 2nn 2
2 1 a1i NM02
3 2 nncnd NM02
4 simpr NM0M0
5 3 4 expp1d NM02M+1=2M2
6 2 4 nnexpcld NM02M
7 6 nncnd NM02M
8 7 3 mulcomd NM02M2=22M
9 5 8 eqtrd NM02M+1=22M
10 9 oveq2d NM0N2M+1=N22M
11 simpl NM0N
12 11 zcnd NM0N
13 2 nnne0d NM020
14 6 nnne0d NM02M0
15 12 3 7 13 14 divdiv1d NM0N22M=N22M
16 10 15 eqtr4d NM0N2M+1=N22M
17 16 fveq2d NM0N2M+1=N22M
18 11 zred NM0N
19 18 rehalfcld NM0N2
20 fldiv N22MN22M=N22M
21 19 6 20 syl2anc NM0N22M=N22M
22 17 21 eqtr4d NM0N2M+1=N22M
23 22 breq2d NM02N2M+12N22M
24 23 notbid NM0¬2N2M+1¬2N22M
25 peano2nn0 M0M+10
26 bitsval2 NM+10M+1bitsN¬2N2M+1
27 25 26 sylan2 NM0M+1bitsN¬2N2M+1
28 19 flcld NM0N2
29 bitsval2 N2M0MbitsN2¬2N22M
30 28 29 sylancom NM0MbitsN2¬2N22M
31 24 27 30 3bitr4d NM0M+1bitsNMbitsN2