Metamath Proof Explorer


Theorem blennn0em1

Description: The binary length of the half of an even positive integer is the binary length of the integer minus 1. (Contributed by AV, 30-May-2010)

Ref Expression
Assertion blennn0em1 NN20#b N2 = #b N1

Proof

Step Hyp Ref Expression
1 nncn NN
2 2cnd N2
3 2ne0 20
4 3 a1i N20
5 1 2 4 3jca NN220
6 5 adantr NN20N220
7 divcan2 N2202N2=N
8 7 eqcomd N220N=2N2
9 6 8 syl NN20N=2N2
10 9 fveq2d NN20#b N = #b 2N2
11 nn0enne NN20N2
12 11 biimpa NN20N2
13 blennnt2 N2#b 2N2 = #b N2+1
14 12 13 syl NN20#b 2N2 = #b N2+1
15 10 14 eqtr2d NN20#b N2 + 1 = #b N
16 blennnelnn N#b N
17 16 nncnd N#b N
18 17 adantr NN20#b N
19 1cnd NN201
20 blennn0elnn N20#b N2
21 20 nncnd N20#b N2
22 21 adantl NN20#b N2
23 18 19 22 subadd2d NN20#b N 1 = #b N2 #b N2+1=#b N
24 15 23 mpbird NN20#b N 1 = #b N2
25 24 eqcomd NN20#b N2 = #b N1