Metamath Proof Explorer


Theorem blennngt2o2

Description: The binary length of an odd integer greater than 1 is the binary length of the half of the integer decreased by 1, increased by 1. (Contributed by AV, 3-Jun-2020)

Ref Expression
Assertion blennngt2o2 N 2 N + 1 2 0 # b N = # b N 1 2 + 1

Proof

Step Hyp Ref Expression
1 2rp 2 +
2 1ne2 1 2
3 2 necomi 2 1
4 eldifsn 2 + 1 2 + 2 1
5 1 3 4 mpbir2an 2 + 1
6 uz2m1nn N 2 N 1
7 6 nnrpd N 2 N 1 +
8 7 adantr N 2 N + 1 2 0 N 1 +
9 relogbdivb 2 + 1 N 1 + log 2 N 1 2 = log 2 N 1 1
10 5 8 9 sylancr N 2 N + 1 2 0 log 2 N 1 2 = log 2 N 1 1
11 10 fveq2d N 2 N + 1 2 0 log 2 N 1 2 = log 2 N 1 1
12 11 oveq1d N 2 N + 1 2 0 log 2 N 1 2 + 1 = log 2 N 1 1 + 1
13 1 a1i N 2 2 +
14 3 a1i N 2 2 1
15 relogbcl 2 + N 1 + 2 1 log 2 N 1
16 13 7 14 15 syl3anc N 2 log 2 N 1
17 1z 1
18 16 17 jctir N 2 log 2 N 1 1
19 18 adantr N 2 N + 1 2 0 log 2 N 1 1
20 flsubz log 2 N 1 1 log 2 N 1 1 = log 2 N 1 1
21 19 20 syl N 2 N + 1 2 0 log 2 N 1 1 = log 2 N 1 1
22 21 oveq1d N 2 N + 1 2 0 log 2 N 1 1 + 1 = log 2 N 1 - 1 + 1
23 16 flcld N 2 log 2 N 1
24 23 zcnd N 2 log 2 N 1
25 npcan1 log 2 N 1 log 2 N 1 - 1 + 1 = log 2 N 1
26 24 25 syl N 2 log 2 N 1 - 1 + 1 = log 2 N 1
27 26 adantr N 2 N + 1 2 0 log 2 N 1 - 1 + 1 = log 2 N 1
28 eluz2nn N 2 N
29 28 peano2nnd N 2 N + 1
30 29 nnred N 2 N + 1
31 2re 2
32 31 a1i N 2 2
33 eluzge2nn0 N 2 N 0
34 nn0p1gt0 N 0 0 < N + 1
35 33 34 syl N 2 0 < N + 1
36 2pos 0 < 2
37 36 a1i N 2 0 < 2
38 30 32 35 37 divgt0d N 2 0 < N + 1 2
39 nn0z N + 1 2 0 N + 1 2
40 38 39 anim12ci N 2 N + 1 2 0 N + 1 2 0 < N + 1 2
41 elnnz N + 1 2 N + 1 2 0 < N + 1 2
42 40 41 sylibr N 2 N + 1 2 0 N + 1 2
43 nnolog2flm1 N 2 N + 1 2 log 2 N = log 2 N 1
44 42 43 syldan N 2 N + 1 2 0 log 2 N = log 2 N 1
45 27 44 eqtr4d N 2 N + 1 2 0 log 2 N 1 - 1 + 1 = log 2 N
46 12 22 45 3eqtrd N 2 N + 1 2 0 log 2 N 1 2 + 1 = log 2 N
47 46 oveq1d N 2 N + 1 2 0 log 2 N 1 2 + 1 + 1 = log 2 N + 1
48 nno N 2 N + 1 2 0 N 1 2
49 blennn N 1 2 # b N 1 2 = log 2 N 1 2 + 1
50 49 oveq1d N 1 2 # b N 1 2 + 1 = log 2 N 1 2 + 1 + 1
51 48 50 syl N 2 N + 1 2 0 # b N 1 2 + 1 = log 2 N 1 2 + 1 + 1
52 blennn N # b N = log 2 N + 1
53 28 52 syl N 2 # b N = log 2 N + 1
54 53 adantr N 2 N + 1 2 0 # b N = log 2 N + 1
55 47 51 54 3eqtr4rd N 2 N + 1 2 0 # b N = # b N 1 2 + 1