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 A N 0 n 0 | n N bits A = bits A 2 N

Proof

Step Hyp Ref Expression
1 simpll A N 0 n 0 A
2 2nn 2
3 2 a1i A N 0 n 0 2
4 simplr A N 0 n 0 N 0
5 3 4 nnexpcld A N 0 n 0 2 N
6 5 nnzd A N 0 n 0 2 N
7 dvdsmul2 A 2 N 2 N A 2 N
8 1 6 7 syl2anc A N 0 n 0 2 N A 2 N
9 1 6 zmulcld A N 0 n 0 A 2 N
10 bitsuz A 2 N N 0 2 N A 2 N bits A 2 N N
11 9 4 10 syl2anc A N 0 n 0 2 N A 2 N bits A 2 N N
12 8 11 mpbid A N 0 n 0 bits A 2 N N
13 12 sseld A N 0 n 0 n bits A 2 N n N
14 uznn0sub n N n N 0
15 13 14 syl6 A N 0 n 0 n bits A 2 N n N 0
16 bitsss bits A 0
17 16 a1i A N 0 n 0 bits A 0
18 17 sseld A N 0 n 0 n N bits A n N 0
19 2cnd A N 0 n 0 n N 0 2
20 2 a1i A N 0 n 0 n N 0 2
21 20 nnne0d A N 0 n 0 n N 0 2 0
22 simplr A N 0 n 0 n N 0 N 0
23 22 nn0zd A N 0 n 0 n N 0 N
24 simprl A N 0 n 0 n N 0 n 0
25 24 nn0zd A N 0 n 0 n N 0 n
26 19 21 23 25 expsubd A N 0 n 0 n N 0 2 n N = 2 n 2 N
27 26 oveq2d A N 0 n 0 n N 0 A 2 n N = A 2 n 2 N
28 simpl A N 0 A
29 28 zcnd A N 0 A
30 29 adantr A N 0 n 0 n N 0 A
31 20 24 nnexpcld A N 0 n 0 n N 0 2 n
32 31 nncnd A N 0 n 0 n N 0 2 n
33 20 22 nnexpcld A N 0 n 0 n N 0 2 N
34 33 nncnd A N 0 n 0 n N 0 2 N
35 31 nnne0d A N 0 n 0 n N 0 2 n 0
36 33 nnne0d A N 0 n 0 n N 0 2 N 0
37 30 32 34 35 36 divdiv2d A N 0 n 0 n N 0 A 2 n 2 N = A 2 N 2 n
38 27 37 eqtr2d A N 0 n 0 n N 0 A 2 N 2 n = A 2 n N
39 38 fveq2d A N 0 n 0 n N 0 A 2 N 2 n = A 2 n N
40 39 breq2d A N 0 n 0 n N 0 2 A 2 N 2 n 2 A 2 n N
41 40 notbid A N 0 n 0 n N 0 ¬ 2 A 2 N 2 n ¬ 2 A 2 n N
42 9 adantrr A N 0 n 0 n N 0 A 2 N
43 bitsval2 A 2 N n 0 n bits A 2 N ¬ 2 A 2 N 2 n
44 42 24 43 syl2anc A N 0 n 0 n N 0 n bits A 2 N ¬ 2 A 2 N 2 n
45 bitsval2 A n N 0 n N bits A ¬ 2 A 2 n N
46 45 ad2ant2rl A N 0 n 0 n N 0 n N bits A ¬ 2 A 2 n N
47 41 44 46 3bitr4d A N 0 n 0 n N 0 n bits A 2 N n N bits A
48 47 expr A N 0 n 0 n N 0 n bits A 2 N n N bits A
49 15 18 48 pm5.21ndd A N 0 n 0 n bits A 2 N n N bits A
50 49 rabbi2dva A N 0 0 bits A 2 N = n 0 | n N bits A
51 bitsss bits A 2 N 0
52 sseqin2 bits A 2 N 0 0 bits A 2 N = bits A 2 N
53 51 52 mpbi 0 bits A 2 N = bits A 2 N
54 50 53 eqtr3di A N 0 n 0 | n N bits A = bits A 2 N