Metamath Proof Explorer


Theorem blennn

Description: The binary length of a positive integer. (Contributed by AV, 21-May-2020)

Ref Expression
Assertion blennn N#b N = log2N+1

Proof

Step Hyp Ref Expression
1 nnne0 NN0
2 blenn0 NN0#b N = log2N+1
3 1 2 mpdan N#b N = log2N+1
4 nnre NN
5 nnnn0 NN0
6 5 nn0ge0d N0N
7 4 6 absidd NN=N
8 7 oveq2d Nlog2N=log2N
9 8 fveq2d Nlog2N=log2N
10 9 oveq1d Nlog2N+1=log2N+1
11 3 10 eqtrd N#b N = log2N+1