Metamath Proof Explorer


Theorem blenpw2m1

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

Ref Expression
Assertion blenpw2m1 I # b 2 I 1 = I

Proof

Step Hyp Ref Expression
1 2nn0 2 0
2 1 a1i I 2 0
3 nnnn0 I I 0
4 2 3 nn0expcld I 2 I 0
5 nnge1 I 1 I
6 2cnd I 2
7 6 exp1d I 2 1 = 2
8 7 eqcomd I 2 = 2 1
9 8 breq1d I 2 2 I 2 1 2 I
10 2re 2
11 10 a1i I 2
12 1zzd I 1
13 nnz I I
14 1lt2 1 < 2
15 14 a1i I 1 < 2
16 11 12 13 15 leexp2d I 1 I 2 1 2 I
17 9 16 bitr4d I 2 2 I 1 I
18 5 17 mpbird I 2 2 I
19 nn0ge2m1nn 2 I 0 2 2 I 2 I 1
20 4 18 19 syl2anc I 2 I 1
21 blennn 2 I 1 # b 2 I 1 = log 2 2 I 1 + 1
22 20 21 syl I # b 2 I 1 = log 2 2 I 1 + 1
23 logbpw2m1 I log 2 2 I 1 = I 1
24 23 oveq1d I log 2 2 I 1 + 1 = I - 1 + 1
25 nncn I I
26 npcan1 I I - 1 + 1 = I
27 25 26 syl I I - 1 + 1 = I
28 22 24 27 3eqtrd I # b 2 I 1 = I