Metamath Proof Explorer


Theorem stirlinglem6

Description: A series that converges to log ( ( N + 1 ) / N ) . (Contributed by Glauco Siliprandi, 29-Jun-2017)

Ref Expression
Hypothesis stirlinglem6.1 H = j 0 2 1 2 j + 1 1 2 N + 1 2 j + 1
Assertion stirlinglem6 N seq 0 + H log N + 1 N

Proof

Step Hyp Ref Expression
1 stirlinglem6.1 H = j 0 2 1 2 j + 1 1 2 N + 1 2 j + 1
2 eqid j 1 j 1 1 2 N + 1 j j = j 1 j 1 1 2 N + 1 j j
3 eqid j 1 2 N + 1 j j = j 1 2 N + 1 j j
4 eqid j 1 j 1 1 2 N + 1 j j + 1 2 N + 1 j j = j 1 j 1 1 2 N + 1 j j + 1 2 N + 1 j j
5 eqid j 0 2 j + 1 = j 0 2 j + 1
6 2re 2
7 6 a1i N 2
8 nnre N N
9 7 8 remulcld N 2 N
10 0le2 0 2
11 10 a1i N 0 2
12 0red N 0
13 nngt0 N 0 < N
14 12 8 13 ltled N 0 N
15 7 8 11 14 mulge0d N 0 2 N
16 9 15 ge0p1rpd N 2 N + 1 +
17 16 rpreccld N 1 2 N + 1 +
18 1red N 1
19 18 renegcld N 1
20 17 rpred N 1 2 N + 1
21 neg1lt0 1 < 0
22 21 a1i N 1 < 0
23 17 rpgt0d N 0 < 1 2 N + 1
24 19 12 20 22 23 lttrd N 1 < 1 2 N + 1
25 1rp 1 +
26 25 a1i N 1 +
27 1cnd N 1
28 27 div1d N 1 1 = 1
29 2rp 2 +
30 29 a1i N 2 +
31 nnrp N N +
32 30 31 rpmulcld N 2 N +
33 18 32 ltaddrp2d N 1 < 2 N + 1
34 28 33 eqbrtrd N 1 1 < 2 N + 1
35 26 16 34 ltrec1d N 1 2 N + 1 < 1
36 20 18 absltd N 1 2 N + 1 < 1 1 < 1 2 N + 1 1 2 N + 1 < 1
37 24 35 36 mpbir2and N 1 2 N + 1 < 1
38 2 3 4 1 5 17 37 stirlinglem5 N seq 0 + H log 1 + 1 2 N + 1 1 1 2 N + 1
39 2cnd N 2
40 nncn N N
41 39 40 mulcld N 2 N
42 41 27 addcld N 2 N + 1
43 9 18 readdcld N 2 N + 1
44 2pos 0 < 2
45 44 a1i N 0 < 2
46 7 8 45 13 mulgt0d N 0 < 2 N
47 9 ltp1d N 2 N < 2 N + 1
48 12 9 43 46 47 lttrd N 0 < 2 N + 1
49 48 gt0ne0d N 2 N + 1 0
50 42 49 dividd N 2 N + 1 2 N + 1 = 1
51 50 eqcomd N 1 = 2 N + 1 2 N + 1
52 51 oveq1d N 1 + 1 2 N + 1 = 2 N + 1 2 N + 1 + 1 2 N + 1
53 51 oveq1d N 1 1 2 N + 1 = 2 N + 1 2 N + 1 1 2 N + 1
54 52 53 oveq12d N 1 + 1 2 N + 1 1 1 2 N + 1 = 2 N + 1 2 N + 1 + 1 2 N + 1 2 N + 1 2 N + 1 1 2 N + 1
55 42 27 42 49 divdird N 2 N + 1 + 1 2 N + 1 = 2 N + 1 2 N + 1 + 1 2 N + 1
56 55 eqcomd N 2 N + 1 2 N + 1 + 1 2 N + 1 = 2 N + 1 + 1 2 N + 1
57 42 27 42 49 divsubdird N 2 N + 1 - 1 2 N + 1 = 2 N + 1 2 N + 1 1 2 N + 1
58 57 eqcomd N 2 N + 1 2 N + 1 1 2 N + 1 = 2 N + 1 - 1 2 N + 1
59 56 58 oveq12d N 2 N + 1 2 N + 1 + 1 2 N + 1 2 N + 1 2 N + 1 1 2 N + 1 = 2 N + 1 + 1 2 N + 1 2 N + 1 - 1 2 N + 1
60 41 27 27 addassd N 2 N + 1 + 1 = 2 N + 1 + 1
61 1p1e2 1 + 1 = 2
62 61 a1i N 1 + 1 = 2
63 62 oveq2d N 2 N + 1 + 1 = 2 N + 2
64 39 mulid1d N 2 1 = 2
65 64 eqcomd N 2 = 2 1
66 65 oveq2d N 2 N + 2 = 2 N + 2 1
67 39 40 27 adddid N 2 N + 1 = 2 N + 2 1
68 66 67 eqtr4d N 2 N + 2 = 2 N + 1
69 60 63 68 3eqtrd N 2 N + 1 + 1 = 2 N + 1
70 69 oveq1d N 2 N + 1 + 1 2 N + 1 = 2 N + 1 2 N + 1
71 41 27 pncand N 2 N + 1 - 1 = 2 N
72 71 oveq1d N 2 N + 1 - 1 2 N + 1 = 2 N 2 N + 1
73 70 72 oveq12d N 2 N + 1 + 1 2 N + 1 2 N + 1 - 1 2 N + 1 = 2 N + 1 2 N + 1 2 N 2 N + 1
74 59 73 eqtrd N 2 N + 1 2 N + 1 + 1 2 N + 1 2 N + 1 2 N + 1 1 2 N + 1 = 2 N + 1 2 N + 1 2 N 2 N + 1
75 40 27 addcld N N + 1
76 39 75 mulcld N 2 N + 1
77 46 gt0ne0d N 2 N 0
78 76 41 42 77 49 divcan7d N 2 N + 1 2 N + 1 2 N 2 N + 1 = 2 N + 1 2 N
79 45 gt0ne0d N 2 0
80 13 gt0ne0d N N 0
81 39 39 75 40 79 80 divmuldivd N 2 2 N + 1 N = 2 N + 1 2 N
82 81 eqcomd N 2 N + 1 2 N = 2 2 N + 1 N
83 39 79 dividd N 2 2 = 1
84 83 oveq1d N 2 2 N + 1 N = 1 N + 1 N
85 75 40 80 divcld N N + 1 N
86 85 mulid2d N 1 N + 1 N = N + 1 N
87 84 86 eqtrd N 2 2 N + 1 N = N + 1 N
88 78 82 87 3eqtrd N 2 N + 1 2 N + 1 2 N 2 N + 1 = N + 1 N
89 54 74 88 3eqtrd N 1 + 1 2 N + 1 1 1 2 N + 1 = N + 1 N
90 89 fveq2d N log 1 + 1 2 N + 1 1 1 2 N + 1 = log N + 1 N
91 38 90 breqtrd N seq 0 + H log N + 1 N