Metamath Proof Explorer


Theorem bitsp1o

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

Ref Expression
Assertion bitsp1o NM0M+1bits2 N+1MbitsN

Proof

Step Hyp Ref Expression
1 2z 2
2 1 a1i N2
3 id NN
4 2 3 zmulcld N2 N
5 4 peano2zd N2 N+1
6 bitsp1 2 N+1M0M+1bits2 N+1Mbits2 N+12
7 5 6 sylan NM0M+1bits2 N+1Mbits2 N+12
8 2re 2
9 8 a1i N2
10 zre NN
11 9 10 remulcld N2 N
12 11 recnd N2 N
13 1cnd N1
14 2cnd N2
15 2ne0 20
16 15 a1i N20
17 12 13 14 16 divdird N2 N+12=2 N2+12
18 zcn NN
19 18 14 16 divcan3d N2 N2=N
20 19 oveq1d N2 N2+12=N+12
21 17 20 eqtrd N2 N+12=N+12
22 21 fveq2d N2 N+12=N+12
23 halfge0 012
24 halflt1 12<1
25 23 24 pm3.2i 01212<1
26 halfre 12
27 flbi2 N12N+12=N01212<1
28 26 27 mpan2 NN+12=N01212<1
29 25 28 mpbiri NN+12=N
30 22 29 eqtrd N2 N+12=N
31 30 adantr NM02 N+12=N
32 31 fveq2d NM0bits2 N+12=bitsN
33 32 eleq2d NM0Mbits2 N+12MbitsN
34 7 33 bitrd NM0M+1bits2 N+1MbitsN