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 2I1 = I

Proof

Step Hyp Ref Expression
1 2nn0 20
2 1 a1i I20
3 nnnn0 II0
4 2 3 nn0expcld I2I0
5 nnge1 I1I
6 2cnd I2
7 6 exp1d I21=2
8 7 eqcomd I2=21
9 8 breq1d I22I212I
10 2re 2
11 10 a1i I2
12 1zzd I1
13 nnz II
14 1lt2 1<2
15 14 a1i I1<2
16 11 12 13 15 leexp2d I1I212I
17 9 16 bitr4d I22I1I
18 5 17 mpbird I22I
19 nn0ge2m1nn 2I022I2I1
20 4 18 19 syl2anc I2I1
21 blennn 2I1#b 2I1 = log22I1+1
22 20 21 syl I#b 2I1 = log22I1+1
23 logbpw2m1 Ilog22I1=I1
24 23 oveq1d Ilog22I1+1=I-1+1
25 nncn II
26 npcan1 II-1+1=I
27 25 26 syl II-1+1=I
28 22 24 27 3eqtrd I#b 2I1 = I