Metamath Proof Explorer


Theorem bitsfzolem

Description: Lemma for bitsfzo . (Contributed by Mario Carneiro, 5-Sep-2016) (Revised by AV, 1-Oct-2020)

Ref Expression
Hypotheses bitsfzo.1 φ N 0
bitsfzo.2 φ M 0
bitsfzo.3 φ bits N 0 ..^ M
bitsfzo.4 S = sup n 0 | N < 2 n <
Assertion bitsfzolem φ N 0 ..^ 2 M

Proof

Step Hyp Ref Expression
1 bitsfzo.1 φ N 0
2 bitsfzo.2 φ M 0
3 bitsfzo.3 φ bits N 0 ..^ M
4 bitsfzo.4 S = sup n 0 | N < 2 n <
5 nn0uz 0 = 0
6 1 5 eleqtrdi φ N 0
7 2nn 2
8 7 a1i φ 2
9 8 2 nnexpcld φ 2 M
10 9 nnzd φ 2 M
11 3 adantr φ 2 M N bits N 0 ..^ M
12 n2dvds1 ¬ 2 1
13 7 a1i φ 2 M N 2
14 ssrab2 n 0 | N < 2 n 0
15 14 5 sseqtri n 0 | N < 2 n 0
16 nnssnn0 0
17 1 nn0red φ N
18 2re 2
19 18 a1i φ 2
20 1lt2 1 < 2
21 20 a1i φ 1 < 2
22 expnbnd N 2 1 < 2 n N < 2 n
23 17 19 21 22 syl3anc φ n N < 2 n
24 ssrexv 0 n N < 2 n n 0 N < 2 n
25 16 23 24 mpsyl φ n 0 N < 2 n
26 rabn0 n 0 | N < 2 n n 0 N < 2 n
27 25 26 sylibr φ n 0 | N < 2 n
28 infssuzcl n 0 | N < 2 n 0 n 0 | N < 2 n sup n 0 | N < 2 n < n 0 | N < 2 n
29 15 27 28 sylancr φ sup n 0 | N < 2 n < n 0 | N < 2 n
30 4 29 eqeltrid φ S n 0 | N < 2 n
31 14 30 sselid φ S 0
32 31 nn0zd φ S
33 32 adantr φ 2 M N S
34 0red φ 2 M N 0
35 2 nn0zd φ M
36 35 adantr φ 2 M N M
37 36 zred φ 2 M N M
38 33 zred φ 2 M N S
39 2 adantr φ 2 M N M 0
40 39 nn0ge0d φ 2 M N 0 M
41 18 a1i φ 2 M N 2
42 41 39 reexpcld φ 2 M N 2 M
43 17 adantr φ 2 M N N
44 8 31 nnexpcld φ 2 S
45 44 adantr φ 2 M N 2 S
46 45 nnred φ 2 M N 2 S
47 simpr φ 2 M N 2 M N
48 30 adantr φ 2 M N S n 0 | N < 2 n
49 oveq2 m = S 2 m = 2 S
50 49 breq2d m = S N < 2 m N < 2 S
51 oveq2 n = m 2 n = 2 m
52 51 breq2d n = m N < 2 n N < 2 m
53 52 cbvrabv n 0 | N < 2 n = m 0 | N < 2 m
54 50 53 elrab2 S n 0 | N < 2 n S 0 N < 2 S
55 54 simprbi S n 0 | N < 2 n N < 2 S
56 48 55 syl φ 2 M N N < 2 S
57 42 43 46 47 56 lelttrd φ 2 M N 2 M < 2 S
58 20 a1i φ 2 M N 1 < 2
59 41 36 33 58 ltexp2d φ 2 M N M < S 2 M < 2 S
60 57 59 mpbird φ 2 M N M < S
61 34 37 38 40 60 lelttrd φ 2 M N 0 < S
62 elnnz S S 0 < S
63 33 61 62 sylanbrc φ 2 M N S
64 nnm1nn0 S S 1 0
65 63 64 syl φ 2 M N S 1 0
66 13 65 nnexpcld φ 2 M N 2 S 1
67 66 nncnd φ 2 M N 2 S 1
68 67 mulid2d φ 2 M N 1 2 S 1 = 2 S 1
69 66 nnred φ 2 M N 2 S 1
70 38 ltm1d φ 2 M N S 1 < S
71 65 nn0red φ 2 M N S 1
72 71 38 ltnled φ 2 M N S 1 < S ¬ S S 1
73 70 72 mpbid φ 2 M N ¬ S S 1
74 oveq2 m = S 1 2 m = 2 S 1
75 74 breq2d m = S 1 N < 2 m N < 2 S 1
76 75 53 elrab2 S 1 n 0 | N < 2 n S 1 0 N < 2 S 1
77 infssuzle n 0 | N < 2 n 0 S 1 n 0 | N < 2 n sup n 0 | N < 2 n < S 1
78 15 77 mpan S 1 n 0 | N < 2 n sup n 0 | N < 2 n < S 1
79 4 78 eqbrtrid S 1 n 0 | N < 2 n S S 1
80 79 a1i φ 2 M N S 1 n 0 | N < 2 n S S 1
81 76 80 syl5bir φ 2 M N S 1 0 N < 2 S 1 S S 1
82 65 81 mpand φ 2 M N N < 2 S 1 S S 1
83 73 82 mtod φ 2 M N ¬ N < 2 S 1
84 69 43 83 nltled φ 2 M N 2 S 1 N
85 68 84 eqbrtrd φ 2 M N 1 2 S 1 N
86 1red φ 2 M N 1
87 2rp 2 +
88 87 a1i φ 2 M N 2 +
89 1z 1
90 89 a1i φ 2 M N 1
91 33 90 zsubcld φ 2 M N S 1
92 88 91 rpexpcld φ 2 M N 2 S 1 +
93 86 43 92 lemuldivd φ 2 M N 1 2 S 1 N 1 N 2 S 1
94 85 93 mpbid φ 2 M N 1 N 2 S 1
95 2cn 2
96 expm1t 2 S 2 S = 2 S 1 2
97 95 63 96 sylancr φ 2 M N 2 S = 2 S 1 2
98 56 97 breqtrd φ 2 M N N < 2 S 1 2
99 43 41 92 ltdivmuld φ 2 M N N 2 S 1 < 2 N < 2 S 1 2
100 98 99 mpbird φ 2 M N N 2 S 1 < 2
101 df-2 2 = 1 + 1
102 100 101 breqtrdi φ 2 M N N 2 S 1 < 1 + 1
103 43 92 rerpdivcld φ 2 M N N 2 S 1
104 flbi N 2 S 1 1 N 2 S 1 = 1 1 N 2 S 1 N 2 S 1 < 1 + 1
105 103 89 104 sylancl φ 2 M N N 2 S 1 = 1 1 N 2 S 1 N 2 S 1 < 1 + 1
106 94 102 105 mpbir2and φ 2 M N N 2 S 1 = 1
107 106 breq2d φ 2 M N 2 N 2 S 1 2 1
108 12 107 mtbiri φ 2 M N ¬ 2 N 2 S 1
109 1 nn0zd φ N
110 bitsval2 N S 1 0 S 1 bits N ¬ 2 N 2 S 1
111 109 65 110 syl2an2r φ 2 M N S 1 bits N ¬ 2 N 2 S 1
112 108 111 mpbird φ 2 M N S 1 bits N
113 11 112 sseldd φ 2 M N S 1 0 ..^ M
114 elfzolt2 S 1 0 ..^ M S 1 < M
115 113 114 syl φ 2 M N S 1 < M
116 zlem1lt S M S M S 1 < M
117 32 36 116 syl2an2r φ 2 M N S M S 1 < M
118 115 117 mpbird φ 2 M N S M
119 37 38 ltnled φ 2 M N M < S ¬ S M
120 60 119 mpbid φ 2 M N ¬ S M
121 118 120 pm2.65da φ ¬ 2 M N
122 9 nnred φ 2 M
123 17 122 ltnled φ N < 2 M ¬ 2 M N
124 121 123 mpbird φ N < 2 M
125 elfzo2 N 0 ..^ 2 M N 0 2 M N < 2 M
126 6 10 124 125 syl3anbrc φ N 0 ..^ 2 M