Metamath Proof Explorer


Theorem bitsshft

Description: Shifting a bit sequence to the left (toward the more significant bits) causes the number to be multiplied by a power of two. (Contributed by Mario Carneiro, 22-Sep-2016)

Ref Expression
Assertion bitsshft AN0n0|nNbitsA=bitsA2N

Proof

Step Hyp Ref Expression
1 simpll AN0n0A
2 2nn 2
3 2 a1i AN0n02
4 simplr AN0n0N0
5 3 4 nnexpcld AN0n02N
6 5 nnzd AN0n02N
7 dvdsmul2 A2N2NA2N
8 1 6 7 syl2anc AN0n02NA2N
9 1 6 zmulcld AN0n0A2N
10 bitsuz A2NN02NA2NbitsA2NN
11 9 4 10 syl2anc AN0n02NA2NbitsA2NN
12 8 11 mpbid AN0n0bitsA2NN
13 12 sseld AN0n0nbitsA2NnN
14 uznn0sub nNnN0
15 13 14 syl6 AN0n0nbitsA2NnN0
16 bitsss bitsA0
17 16 a1i AN0n0bitsA0
18 17 sseld AN0n0nNbitsAnN0
19 2cnd AN0n0nN02
20 2 a1i AN0n0nN02
21 20 nnne0d AN0n0nN020
22 simplr AN0n0nN0N0
23 22 nn0zd AN0n0nN0N
24 simprl AN0n0nN0n0
25 24 nn0zd AN0n0nN0n
26 19 21 23 25 expsubd AN0n0nN02nN=2n2N
27 26 oveq2d AN0n0nN0A2nN=A2n2N
28 simpl AN0A
29 28 zcnd AN0A
30 29 adantr AN0n0nN0A
31 20 24 nnexpcld AN0n0nN02n
32 31 nncnd AN0n0nN02n
33 20 22 nnexpcld AN0n0nN02N
34 33 nncnd AN0n0nN02N
35 31 nnne0d AN0n0nN02n0
36 33 nnne0d AN0n0nN02N0
37 30 32 34 35 36 divdiv2d AN0n0nN0A2n2N=A2N2n
38 27 37 eqtr2d AN0n0nN0A2N2n=A2nN
39 38 fveq2d AN0n0nN0A2N2n=A2nN
40 39 breq2d AN0n0nN02A2N2n2A2nN
41 40 notbid AN0n0nN0¬2A2N2n¬2A2nN
42 9 adantrr AN0n0nN0A2N
43 bitsval2 A2Nn0nbitsA2N¬2A2N2n
44 42 24 43 syl2anc AN0n0nN0nbitsA2N¬2A2N2n
45 bitsval2 AnN0nNbitsA¬2A2nN
46 45 ad2ant2rl AN0n0nN0nNbitsA¬2A2nN
47 41 44 46 3bitr4d AN0n0nN0nbitsA2NnNbitsA
48 47 expr AN0n0nN0nbitsA2NnNbitsA
49 15 18 48 pm5.21ndd AN0n0nbitsA2NnNbitsA
50 49 rabbi2dva AN00bitsA2N=n0|nNbitsA
51 bitsss bitsA2N0
52 sseqin2 bitsA2N00bitsA2N=bitsA2N
53 51 52 mpbi 0bitsA2N=bitsA2N
54 50 53 eqtr3di AN0n0|nNbitsA=bitsA2N