Metamath Proof Explorer


Theorem blennnt2

Description: The binary length of a positive integer, doubled and increased by 1, is the binary length of the integer plus 1. (Contributed by AV, 30-May-2010)

Ref Expression
Assertion blennnt2 N # b 2 N = # b N + 1

Proof

Step Hyp Ref Expression
1 2nn 2
2 1 a1i N 2
3 id N N
4 2 3 nnmulcld N 2 N
5 blennn 2 N # b 2 N = log 2 2 N + 1
6 4 5 syl N # b 2 N = log 2 2 N + 1
7 2cn 2
8 7 a1i N 2
9 nncn N N
10 8 9 mulcomd N 2 N = N 2
11 10 oveq2d N log 2 2 N = log 2 N 2
12 2z 2
13 uzid 2 2 2
14 12 13 ax-mp 2 2
15 eluz2cnn0n1 2 2 2 0 1
16 14 15 mp1i N 2 0 1
17 nnrp N N +
18 2rp 2 +
19 18 a1i N 2 +
20 relogbmul 2 0 1 N + 2 + log 2 N 2 = log 2 N + log 2 2
21 16 17 19 20 syl12anc N log 2 N 2 = log 2 N + log 2 2
22 2ne0 2 0
23 1ne2 1 2
24 23 necomi 2 1
25 7 22 24 3pm3.2i 2 2 0 2 1
26 logbid1 2 2 0 2 1 log 2 2 = 1
27 25 26 mp1i N log 2 2 = 1
28 27 oveq2d N log 2 N + log 2 2 = log 2 N + 1
29 11 21 28 3eqtrd N log 2 2 N = log 2 N + 1
30 29 fveq2d N log 2 2 N = log 2 N + 1
31 24 a1i N 2 1
32 relogbcl 2 + N + 2 1 log 2 N
33 19 17 31 32 syl3anc N log 2 N
34 1zzd N 1
35 fladdz log 2 N 1 log 2 N + 1 = log 2 N + 1
36 33 34 35 syl2anc N log 2 N + 1 = log 2 N + 1
37 30 36 eqtrd N log 2 2 N = log 2 N + 1
38 37 oveq1d N log 2 2 N + 1 = log 2 N + 1 + 1
39 blennn N # b N = log 2 N + 1
40 39 eqcomd N log 2 N + 1 = # b N
41 40 oveq1d N log 2 N + 1 + 1 = # b N + 1
42 6 38 41 3eqtrd N # b 2 N = # b N + 1