Metamath Proof Explorer


Theorem blenpw2

Description: The binary length of a power of 2 is the exponent plus 1. (Contributed by AV, 30-May-2020)

Ref Expression
Assertion blenpw2 I 0 # b 2 I = I + 1

Proof

Step Hyp Ref Expression
1 2nn 2
2 nnexpcl 2 I 0 2 I
3 1 2 mpan I 0 2 I
4 blennn 2 I # b 2 I = log 2 2 I + 1
5 3 4 syl I 0 # b 2 I = log 2 2 I + 1
6 2z 2
7 uzid 2 2 2
8 6 7 mp1i I 0 2 2
9 nn0z I 0 I
10 nnlogbexp 2 2 I log 2 2 I = I
11 8 9 10 syl2anc I 0 log 2 2 I = I
12 11 fveq2d I 0 log 2 2 I = I
13 flid I I = I
14 9 13 syl I 0 I = I
15 12 14 eqtrd I 0 log 2 2 I = I
16 15 oveq1d I 0 log 2 2 I + 1 = I + 1
17 5 16 eqtrd I 0 # b 2 I = I + 1