Metamath Proof Explorer


Theorem nnolog2flm1

Description: The floor of the binary logarithm of an odd integer greater than 1 is the floor of the binary logarithm of the integer decreased by 1. (Contributed by AV, 2-Jun-2020)

Ref Expression
Assertion nnolog2flm1 N 2 N + 1 2 log 2 N = log 2 N 1

Proof

Step Hyp Ref Expression
1 eluz2nn N 2 N
2 nnpw2blenfzo2 N N = 2 # b N 1 N 2 # b N 1 + 1 ..^ 2 # b N
3 1 2 syl N 2 N = 2 # b N 1 N 2 # b N 1 + 1 ..^ 2 # b N
4 1 adantl N = 2 # b N 1 N 2 N
5 nneo N N 2 ¬ N + 1 2
6 5 bicomd N ¬ N + 1 2 N 2
7 4 6 syl N = 2 # b N 1 N 2 ¬ N + 1 2 N 2
8 notnotb N 2 ¬ ¬ N 2
9 7 8 bitrdi N = 2 # b N 1 N 2 ¬ N + 1 2 ¬ ¬ N 2
10 9 con4bid N = 2 # b N 1 N 2 N + 1 2 ¬ N 2
11 simpl N = 2 # b N 1 N 2 N = 2 # b N 1
12 11 oveq1d N = 2 # b N 1 N 2 N 2 = 2 # b N 1 2
13 blennnelnn N # b N
14 13 nnnn0d N # b N 0
15 1 14 syl N 2 # b N 0
16 2m1e1 2 1 = 1
17 2cn 2
18 2ne0 2 0
19 1ne2 1 2
20 19 necomi 2 1
21 logbid1 2 2 0 2 1 log 2 2 = 1
22 17 18 20 21 mp3an log 2 2 = 1
23 eluzle N 2 2 N
24 2z 2
25 uzid 2 2 2
26 24 25 mp1i N 2 2 2
27 2rp 2 +
28 27 a1i N 2 2 +
29 1 nnrpd N 2 N +
30 logbleb 2 2 2 + N + 2 N log 2 2 log 2 N
31 26 28 29 30 syl3anc N 2 2 N log 2 2 log 2 N
32 23 31 mpbid N 2 log 2 2 log 2 N
33 22 32 eqbrtrrid N 2 1 log 2 N
34 20 a1i N 2 2 1
35 relogbcl 2 + N + 2 1 log 2 N
36 28 29 34 35 syl3anc N 2 log 2 N
37 1zzd N 2 1
38 flge log 2 N 1 1 log 2 N 1 log 2 N
39 36 37 38 syl2anc N 2 1 log 2 N 1 log 2 N
40 33 39 mpbid N 2 1 log 2 N
41 16 40 eqbrtrid N 2 2 1 log 2 N
42 2re 2
43 42 a1i N 2 2
44 1red N 2 1
45 36 flcld N 2 log 2 N
46 45 zred N 2 log 2 N
47 43 44 46 lesubaddd N 2 2 1 log 2 N 2 log 2 N + 1
48 41 47 mpbid N 2 2 log 2 N + 1
49 blennn N # b N = log 2 N + 1
50 1 49 syl N 2 # b N = log 2 N + 1
51 48 50 breqtrrd N 2 2 # b N
52 nn0ge2m1nn # b N 0 2 # b N # b N 1
53 15 51 52 syl2anc N 2 # b N 1
54 53 adantl N = 2 # b N 1 N 2 # b N 1
55 nnpw2even # b N 1 2 # b N 1 2
56 54 55 syl N = 2 # b N 1 N 2 2 # b N 1 2
57 12 56 eqeltrd N = 2 # b N 1 N 2 N 2
58 57 pm2.24d N = 2 # b N 1 N 2 ¬ N 2 log 2 N = log 2 N 1
59 10 58 sylbid N = 2 # b N 1 N 2 N + 1 2 log 2 N = log 2 N 1
60 59 ex N = 2 # b N 1 N 2 N + 1 2 log 2 N = log 2 N 1
61 1 13 syl N 2 # b N
62 nnm1nn0 # b N # b N 1 0
63 61 62 syl N 2 # b N 1 0
64 63 ad2antlr N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 # b N 1 0
65 1 ad2antlr N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 N
66 nnpw2blenfzo N N 2 # b N 1 ..^ 2 # b N
67 65 66 syl N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 N 2 # b N 1 ..^ 2 # b N
68 61 nncnd N 2 # b N
69 68 ad2antlr N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 # b N
70 npcan1 # b N # b N - 1 + 1 = # b N
71 69 70 syl N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 # b N - 1 + 1 = # b N
72 71 oveq2d N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 2 # b N - 1 + 1 = 2 # b N
73 72 oveq2d N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 2 # b N 1 ..^ 2 # b N - 1 + 1 = 2 # b N 1 ..^ 2 # b N
74 67 73 eleqtrrd N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 N 2 # b N 1 ..^ 2 # b N - 1 + 1
75 fllog2 # b N 1 0 N 2 # b N 1 ..^ 2 # b N - 1 + 1 log 2 N = # b N 1
76 64 74 75 syl2anc N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 log 2 N = # b N 1
77 61 ad2antlr N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 # b N
78 77 62 syl N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 # b N 1 0
79 elfzo2 N 2 # b N 1 + 1 ..^ 2 # b N N 2 # b N 1 + 1 2 # b N N < 2 # b N
80 eluz2 N 2 # b N 1 + 1 2 # b N 1 + 1 N 2 # b N 1 + 1 N
81 80 3anbi1i N 2 # b N 1 + 1 2 # b N N < 2 # b N 2 # b N 1 + 1 N 2 # b N 1 + 1 N 2 # b N N < 2 # b N
82 79 81 bitri N 2 # b N 1 + 1 ..^ 2 # b N 2 # b N 1 + 1 N 2 # b N 1 + 1 N 2 # b N N < 2 # b N
83 2nn 2
84 83 a1i N 2 2
85 84 63 jca N 2 2 # b N 1 0
86 85 adantl 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 2 # b N 1 0
87 nnexpcl 2 # b N 1 0 2 # b N 1
88 86 87 syl 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 2 # b N 1
89 88 nnzd 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 2 # b N 1
90 peano2zm N N 1
91 90 3ad2ant2 2 # b N 1 + 1 N 2 # b N 1 + 1 N N 1
92 91 adantr 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 1
93 92 adantr 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 N 1
94 84 63 nnexpcld N 2 2 # b N 1
95 94 nnred N 2 2 # b N 1
96 1 nnred N 2 N
97 leaddsub 2 # b N 1 1 N 2 # b N 1 + 1 N 2 # b N 1 N 1
98 95 44 96 97 syl3anc N 2 2 # b N 1 + 1 N 2 # b N 1 N 1
99 98 biimpcd 2 # b N 1 + 1 N N 2 2 # b N 1 N 1
100 99 3ad2ant3 2 # b N 1 + 1 N 2 # b N 1 + 1 N N 2 2 # b N 1 N 1
101 100 adantr 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 2 # b N 1 N 1
102 101 imp 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 2 # b N 1 N 1
103 eluz2 N 1 2 # b N 1 2 # b N 1 N 1 2 # b N 1 N 1
104 89 93 102 103 syl3anbrc 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 N 1 2 # b N 1
105 70 eleq1d # b N # b N - 1 + 1 0 # b N 0
106 68 105 syl N 2 # b N - 1 + 1 0 # b N 0
107 15 106 mpbird N 2 # b N - 1 + 1 0
108 84 107 jca N 2 2 # b N - 1 + 1 0
109 108 adantl 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 2 # b N - 1 + 1 0
110 nnexpcl 2 # b N - 1 + 1 0 2 # b N - 1 + 1
111 109 110 syl 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 2 # b N - 1 + 1
112 111 nnzd 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 2 # b N - 1 + 1
113 ltle N 2 # b N N < 2 # b N N 2 # b N
114 nnre N N
115 42 a1i N 2
116 115 14 reexpcld N 2 # b N
117 114 116 jca N N 2 # b N
118 1 117 syl N 2 N 2 # b N
119 113 118 syl11 N < 2 # b N N 2 N 2 # b N
120 119 adantl 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 N 2 # b N
121 120 imp 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 N 2 # b N
122 simpll2 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 N
123 84 15 nnexpcld N 2 2 # b N
124 123 nnzd N 2 2 # b N
125 124 adantl 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 2 # b N
126 zlem1lt N 2 # b N N 2 # b N N 1 < 2 # b N
127 122 125 126 syl2anc 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 N 2 # b N N 1 < 2 # b N
128 121 127 mpbid 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 N 1 < 2 # b N
129 68 70 syl N 2 # b N - 1 + 1 = # b N
130 129 oveq2d N 2 2 # b N - 1 + 1 = 2 # b N
131 130 adantl 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 2 # b N - 1 + 1 = 2 # b N
132 128 131 breqtrrd 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 N 1 < 2 # b N - 1 + 1
133 104 112 132 3jca 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 N 1 2 # b N 1 2 # b N - 1 + 1 N 1 < 2 # b N - 1 + 1
134 133 ex 2 # b N 1 + 1 N 2 # b N 1 + 1 N N < 2 # b N N 2 N 1 2 # b N 1 2 # b N - 1 + 1 N 1 < 2 # b N - 1 + 1
135 134 3adant2 2 # b N 1 + 1 N 2 # b N 1 + 1 N 2 # b N N < 2 # b N N 2 N 1 2 # b N 1 2 # b N - 1 + 1 N 1 < 2 # b N - 1 + 1
136 82 135 sylbi N 2 # b N 1 + 1 ..^ 2 # b N N 2 N 1 2 # b N 1 2 # b N - 1 + 1 N 1 < 2 # b N - 1 + 1
137 136 imp N 2 # b N 1 + 1 ..^ 2 # b N N 2 N 1 2 # b N 1 2 # b N - 1 + 1 N 1 < 2 # b N - 1 + 1
138 elfzo2 N 1 2 # b N 1 ..^ 2 # b N - 1 + 1 N 1 2 # b N 1 2 # b N - 1 + 1 N 1 < 2 # b N - 1 + 1
139 137 138 sylibr N 2 # b N 1 + 1 ..^ 2 # b N N 2 N 1 2 # b N 1 ..^ 2 # b N - 1 + 1
140 139 adantr N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 N 1 2 # b N 1 ..^ 2 # b N - 1 + 1
141 fllog2 # b N 1 0 N 1 2 # b N 1 ..^ 2 # b N - 1 + 1 log 2 N 1 = # b N 1
142 78 140 141 syl2anc N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 log 2 N 1 = # b N 1
143 76 142 eqtr4d N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 log 2 N = log 2 N 1
144 143 exp31 N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 log 2 N = log 2 N 1
145 60 144 jaoi N = 2 # b N 1 N 2 # b N 1 + 1 ..^ 2 # b N N 2 N + 1 2 log 2 N = log 2 N 1
146 3 145 mpcom N 2 N + 1 2 log 2 N = log 2 N 1
147 146 imp N 2 N + 1 2 log 2 N = log 2 N 1