Metamath Proof Explorer


Theorem stirlinglem11

Description: B is decreasing. (Contributed by Glauco Siliprandi, 29-Jun-2017)

Ref Expression
Hypotheses stirlinglem11.1 A = n n ! 2 n n e n
stirlinglem11.2 B = n log A n
stirlinglem11.3 K = k 1 2 k + 1 1 2 N + 1 2 k
Assertion stirlinglem11 N B N + 1 < B N

Proof

Step Hyp Ref Expression
1 stirlinglem11.1 A = n n ! 2 n n e n
2 stirlinglem11.2 B = n log A n
3 stirlinglem11.3 K = k 1 2 k + 1 1 2 N + 1 2 k
4 0red N 0
5 3 a1i N K = k 1 2 k + 1 1 2 N + 1 2 k
6 simpr N k = 1 k = 1
7 6 oveq2d N k = 1 2 k = 2 1
8 7 oveq1d N k = 1 2 k + 1 = 2 1 + 1
9 8 oveq2d N k = 1 1 2 k + 1 = 1 2 1 + 1
10 7 oveq2d N k = 1 1 2 N + 1 2 k = 1 2 N + 1 2 1
11 9 10 oveq12d N k = 1 1 2 k + 1 1 2 N + 1 2 k = 1 2 1 + 1 1 2 N + 1 2 1
12 1nn 1
13 12 a1i N 1
14 2cnd N 2
15 1cnd N 1
16 14 15 mulcld N 2 1
17 16 15 addcld N 2 1 + 1
18 2t1e2 2 1 = 2
19 18 oveq1i 2 1 + 1 = 2 + 1
20 2p1e3 2 + 1 = 3
21 19 20 eqtri 2 1 + 1 = 3
22 3ne0 3 0
23 21 22 eqnetri 2 1 + 1 0
24 23 a1i N 2 1 + 1 0
25 17 24 reccld N 1 2 1 + 1
26 nncn N N
27 14 26 mulcld N 2 N
28 27 15 addcld N 2 N + 1
29 1red N 1
30 2re 2
31 30 a1i N 2
32 nnre N N
33 31 32 remulcld N 2 N
34 33 29 readdcld N 2 N + 1
35 0lt1 0 < 1
36 35 a1i N 0 < 1
37 2rp 2 +
38 37 a1i N 2 +
39 nnrp N N +
40 38 39 rpmulcld N 2 N +
41 29 40 ltaddrp2d N 1 < 2 N + 1
42 4 29 34 36 41 lttrd N 0 < 2 N + 1
43 42 gt0ne0d N 2 N + 1 0
44 28 43 reccld N 1 2 N + 1
45 2nn0 2 0
46 45 a1i N 2 0
47 1nn0 1 0
48 47 a1i N 1 0
49 46 48 nn0mulcld N 2 1 0
50 44 49 expcld N 1 2 N + 1 2 1
51 25 50 mulcld N 1 2 1 + 1 1 2 N + 1 2 1
52 5 11 13 51 fvmptd N K 1 = 1 2 1 + 1 1 2 N + 1 2 1
53 1re 1
54 30 53 remulcli 2 1
55 54 53 readdcli 2 1 + 1
56 55 23 rereccli 1 2 1 + 1
57 56 a1i N 1 2 1 + 1
58 34 43 rereccld N 1 2 N + 1
59 58 49 reexpcld N 1 2 N + 1 2 1
60 57 59 remulcld N 1 2 1 + 1 1 2 N + 1 2 1
61 52 60 eqeltrd N K 1
62 1 stirlinglem2 N A N +
63 62 relogcld N log A N
64 nfcv _ n N
65 nfcv _ n log
66 nfmpt1 _ n n n ! 2 n n e n
67 1 66 nfcxfr _ n A
68 67 64 nffv _ n A N
69 65 68 nffv _ n log A N
70 2fveq3 n = N log A n = log A N
71 64 69 70 2 fvmptf N log A N B N = log A N
72 63 71 mpdan N B N = log A N
73 72 63 eqeltrd N B N
74 peano2nn N N + 1
75 1 stirlinglem2 N + 1 A N + 1 +
76 74 75 syl N A N + 1 +
77 76 relogcld N log A N + 1
78 nfcv _ n N + 1
79 67 78 nffv _ n A N + 1
80 65 79 nffv _ n log A N + 1
81 2fveq3 n = N + 1 log A n = log A N + 1
82 78 80 81 2 fvmptf N + 1 log A N + 1 B N + 1 = log A N + 1
83 74 77 82 syl2anc N B N + 1 = log A N + 1
84 83 77 eqeltrd N B N + 1
85 73 84 resubcld N B N B N + 1
86 31 29 remulcld N 2 1
87 0le2 0 2
88 87 a1i N 0 2
89 0le1 0 1
90 89 a1i N 0 1
91 31 29 88 90 mulge0d N 0 2 1
92 86 91 ge0p1rpd N 2 1 + 1 +
93 92 rpreccld N 1 2 1 + 1 +
94 39 rpge0d N 0 N
95 31 32 88 94 mulge0d N 0 2 N
96 33 95 ge0p1rpd N 2 N + 1 +
97 96 rpreccld N 1 2 N + 1 +
98 2z 2
99 98 a1i N 2
100 1z 1
101 100 a1i N 1
102 99 101 zmulcld N 2 1
103 97 102 rpexpcld N 1 2 N + 1 2 1 +
104 93 103 rpmulcld N 1 2 1 + 1 1 2 N + 1 2 1 +
105 52 104 eqeltrd N K 1 +
106 105 rpgt0d N 0 < K 1
107 85 61 resubcld N B N - B N + 1 - K 1
108 eqid 1 + 1 = 1 + 1
109 101 peano2zd N 1 + 1
110 nnuz = 1
111 3 a1i N j K = k 1 2 k + 1 1 2 N + 1 2 k
112 oveq2 k = j 2 k = 2 j
113 112 oveq1d k = j 2 k + 1 = 2 j + 1
114 113 oveq2d k = j 1 2 k + 1 = 1 2 j + 1
115 112 oveq2d k = j 1 2 N + 1 2 k = 1 2 N + 1 2 j
116 114 115 oveq12d k = j 1 2 k + 1 1 2 N + 1 2 k = 1 2 j + 1 1 2 N + 1 2 j
117 116 adantl N j k = j 1 2 k + 1 1 2 N + 1 2 k = 1 2 j + 1 1 2 N + 1 2 j
118 simpr N j j
119 2cnd N j 2
120 nncn j j
121 120 adantl N j j
122 119 121 mulcld N j 2 j
123 1cnd N j 1
124 122 123 addcld N j 2 j + 1
125 0red N j 0
126 1red N j 1
127 30 a1i N j 2
128 nnre j j
129 128 adantl N j j
130 127 129 remulcld N j 2 j
131 130 126 readdcld N j 2 j + 1
132 35 a1i N j 0 < 1
133 37 a1i N j 2 +
134 nnrp j j +
135 134 adantl N j j +
136 133 135 rpmulcld N j 2 j +
137 126 136 ltaddrp2d N j 1 < 2 j + 1
138 125 126 131 132 137 lttrd N j 0 < 2 j + 1
139 138 gt0ne0d N j 2 j + 1 0
140 124 139 reccld N j 1 2 j + 1
141 26 adantr N j N
142 119 141 mulcld N j 2 N
143 142 123 addcld N j 2 N + 1
144 43 adantr N j 2 N + 1 0
145 143 144 reccld N j 1 2 N + 1
146 45 a1i N j 2 0
147 nnnn0 j j 0
148 147 adantl N j j 0
149 146 148 nn0mulcld N j 2 j 0
150 145 149 expcld N j 1 2 N + 1 2 j
151 140 150 mulcld N j 1 2 j + 1 1 2 N + 1 2 j
152 111 117 118 151 fvmptd N j K j = 1 2 j + 1 1 2 N + 1 2 j
153 0red j 0
154 1red j 1
155 30 a1i j 2
156 155 128 remulcld j 2 j
157 156 154 readdcld j 2 j + 1
158 35 a1i j 0 < 1
159 37 a1i j 2 +
160 159 134 rpmulcld j 2 j +
161 154 160 ltaddrp2d j 1 < 2 j + 1
162 153 154 157 158 161 lttrd j 0 < 2 j + 1
163 162 gt0ne0d j 2 j + 1 0
164 163 adantl N j 2 j + 1 0
165 124 164 reccld N j 1 2 j + 1
166 165 150 mulcld N j 1 2 j + 1 1 2 N + 1 2 j
167 152 166 eqeltrd N j K j
168 eqid n 1 + 2 n 2 log n + 1 n 1 = n 1 + 2 n 2 log n + 1 n 1
169 1 2 168 3 stirlinglem9 N seq 1 + K B N B N + 1
170 110 13 167 169 clim2ser N seq 1 + 1 + K B N - B N + 1 - seq 1 + K 1
171 peano2nn 1 1 + 1
172 uznnssnn 1 + 1 1 + 1
173 12 171 172 mp2b 1 + 1
174 173 a1i N 1 + 1
175 174 sseld N j 1 + 1 j
176 175 imdistani N j 1 + 1 N j
177 176 152 syl N j 1 + 1 K j = 1 2 j + 1 1 2 N + 1 2 j
178 30 a1i j 1 + 1 2
179 eluzelre j 1 + 1 j
180 178 179 remulcld j 1 + 1 2 j
181 1red j 1 + 1 1
182 180 181 readdcld j 1 + 1 2 j + 1
183 173 sseli j 1 + 1 j
184 183 163 syl j 1 + 1 2 j + 1 0
185 182 184 rereccld j 1 + 1 1 2 j + 1
186 185 adantl N j 1 + 1 1 2 j + 1
187 34 adantr N j 1 + 1 2 N + 1
188 43 adantr N j 1 + 1 2 N + 1 0
189 187 188 rereccld N j 1 + 1 1 2 N + 1
190 176 149 syl N j 1 + 1 2 j 0
191 189 190 reexpcld N j 1 + 1 1 2 N + 1 2 j
192 186 191 remulcld N j 1 + 1 1 2 j + 1 1 2 N + 1 2 j
193 177 192 eqeltrd N j 1 + 1 K j
194 1red N j 1 + 1 1
195 30 a1i N j 1 + 1 2
196 176 129 syl N j 1 + 1 j
197 195 196 remulcld N j 1 + 1 2 j
198 87 a1i N j 1 + 1 0 2
199 0red j 1 + 1 0
200 87 a1i j 1 + 1 0 2
201 1p1e2 1 + 1 = 2
202 eluzle j 1 + 1 1 + 1 j
203 201 202 eqbrtrrid j 1 + 1 2 j
204 199 178 179 200 203 letrd j 1 + 1 0 j
205 204 adantl N j 1 + 1 0 j
206 195 196 198 205 mulge0d N j 1 + 1 0 2 j
207 197 206 ge0p1rpd N j 1 + 1 2 j + 1 +
208 89 a1i N j 1 + 1 0 1
209 194 207 208 divge0d N j 1 + 1 0 1 2 j + 1
210 32 adantr N j 1 + 1 N
211 195 210 remulcld N j 1 + 1 2 N
212 94 adantr N j 1 + 1 0 N
213 195 210 198 212 mulge0d N j 1 + 1 0 2 N
214 211 213 ge0p1rpd N j 1 + 1 2 N + 1 +
215 194 214 208 divge0d N j 1 + 1 0 1 2 N + 1
216 189 190 215 expge0d N j 1 + 1 0 1 2 N + 1 2 j
217 186 191 209 216 mulge0d N j 1 + 1 0 1 2 j + 1 1 2 N + 1 2 j
218 217 177 breqtrrd N j 1 + 1 0 K j
219 108 109 170 193 218 iserge0 N 0 B N - B N + 1 - seq 1 + K 1
220 seq1 1 seq 1 + K 1 = K 1
221 100 220 mp1i N seq 1 + K 1 = K 1
222 221 oveq2d N B N - B N + 1 - seq 1 + K 1 = B N - B N + 1 - K 1
223 219 222 breqtrd N 0 B N - B N + 1 - K 1
224 4 107 61 223 leadd1dd N 0 + K 1 B N B N + 1 - K 1 + K 1
225 52 51 eqeltrd N K 1
226 225 addid2d N 0 + K 1 = K 1
227 73 recnd N B N
228 84 recnd N B N + 1
229 227 228 subcld N B N B N + 1
230 229 225 npcand N B N B N + 1 - K 1 + K 1 = B N B N + 1
231 224 226 230 3brtr3d N K 1 B N B N + 1
232 4 61 85 106 231 ltletrd N 0 < B N B N + 1
233 84 73 posdifd N B N + 1 < B N 0 < B N B N + 1
234 232 233 mpbird N B N + 1 < B N