16959
|
1 |
(* Title: Ln.thy
|
|
2 |
Author: Jeremy Avigad
|
16963
|
3 |
ID: $Id$
|
16959
|
4 |
*)
|
|
5 |
|
|
6 |
header {* Properties of ln *}
|
|
7 |
|
|
8 |
theory Ln
|
|
9 |
|
|
10 |
imports Transcendental
|
|
11 |
begin
|
|
12 |
|
|
13 |
lemma exp_first_two_terms: "exp x = 1 + x + suminf (%n.
|
|
14 |
inverse(real (fact (n+2))) * (x ^ (n+2)))"
|
|
15 |
proof -
|
|
16 |
have "exp x = suminf (%n. inverse(real (fact n)) * (x ^ n))"
|
|
17 |
by (unfold exp_def, simp)
|
|
18 |
also from summable_exp have "... = (SUM n : {0..<2}.
|
|
19 |
inverse(real (fact n)) * (x ^ n)) + suminf (%n.
|
|
20 |
inverse(real (fact (n+2))) * (x ^ (n+2)))" (is "_ = ?a + _")
|
|
21 |
by (rule suminf_split_initial_segment)
|
|
22 |
also have "?a = 1 + x"
|
|
23 |
by (simp add: numerals)
|
|
24 |
finally show ?thesis .
|
|
25 |
qed
|
|
26 |
|
|
27 |
lemma exp_tail_after_first_two_terms_summable:
|
|
28 |
"summable (%n. inverse(real (fact (n+2))) * (x ^ (n+2)))"
|
|
29 |
proof -
|
|
30 |
note summable_exp
|
|
31 |
thus ?thesis
|
|
32 |
by (frule summable_ignore_initial_segment)
|
|
33 |
qed
|
|
34 |
|
|
35 |
lemma aux1: assumes a: "0 <= x" and b: "x <= 1"
|
|
36 |
shows "inverse (real (fact (n + 2))) * x ^ (n + 2) <= (x^2/2) * ((1/2)^n)"
|
|
37 |
proof (induct n)
|
|
38 |
show "inverse (real (fact (0 + 2))) * x ^ (0 + 2) <=
|
|
39 |
x ^ 2 / 2 * (1 / 2) ^ 0"
|
|
40 |
apply (simp add: power2_eq_square)
|
|
41 |
apply (subgoal_tac "real (Suc (Suc 0)) = 2")
|
|
42 |
apply (erule ssubst)
|
|
43 |
apply simp
|
|
44 |
apply simp
|
|
45 |
done
|
|
46 |
next
|
|
47 |
fix n
|
|
48 |
assume c: "inverse (real (fact (n + 2))) * x ^ (n + 2)
|
|
49 |
<= x ^ 2 / 2 * (1 / 2) ^ n"
|
|
50 |
show "inverse (real (fact (Suc n + 2))) * x ^ (Suc n + 2)
|
|
51 |
<= x ^ 2 / 2 * (1 / 2) ^ Suc n"
|
|
52 |
proof -
|
|
53 |
have "inverse(real (fact (Suc n + 2))) <=
|
|
54 |
(1 / 2) *inverse (real (fact (n+2)))"
|
|
55 |
proof -
|
|
56 |
have "Suc n + 2 = Suc (n + 2)" by simp
|
|
57 |
then have "fact (Suc n + 2) = Suc (n + 2) * fact (n + 2)"
|
|
58 |
by simp
|
|
59 |
then have "real(fact (Suc n + 2)) = real(Suc (n + 2) * fact (n + 2))"
|
|
60 |
apply (rule subst)
|
|
61 |
apply (rule refl)
|
|
62 |
done
|
|
63 |
also have "... = real(Suc (n + 2)) * real(fact (n + 2))"
|
|
64 |
by (rule real_of_nat_mult)
|
|
65 |
finally have "real (fact (Suc n + 2)) =
|
|
66 |
real (Suc (n + 2)) * real (fact (n + 2))" .
|
|
67 |
then have "inverse(real (fact (Suc n + 2))) =
|
|
68 |
inverse(real (Suc (n + 2))) * inverse(real (fact (n + 2)))"
|
|
69 |
apply (rule ssubst)
|
|
70 |
apply (rule inverse_mult_distrib)
|
|
71 |
done
|
|
72 |
also have "... <= (1/2) * inverse(real (fact (n + 2)))"
|
|
73 |
apply (rule mult_right_mono)
|
|
74 |
apply (subst inverse_eq_divide)
|
|
75 |
apply simp
|
|
76 |
apply (rule inv_real_of_nat_fact_ge_zero)
|
|
77 |
done
|
|
78 |
finally show ?thesis .
|
|
79 |
qed
|
|
80 |
moreover have "x ^ (Suc n + 2) <= x ^ (n + 2)"
|
|
81 |
apply (simp add: mult_compare_simps)
|
|
82 |
apply (simp add: prems)
|
|
83 |
apply (subgoal_tac "0 <= x * (x * x^n)")
|
|
84 |
apply force
|
|
85 |
apply (rule mult_nonneg_nonneg, rule a)+
|
|
86 |
apply (rule zero_le_power, rule a)
|
|
87 |
done
|
|
88 |
ultimately have "inverse (real (fact (Suc n + 2))) * x ^ (Suc n + 2) <=
|
|
89 |
(1 / 2 * inverse (real (fact (n + 2)))) * x ^ (n + 2)"
|
|
90 |
apply (rule mult_mono)
|
|
91 |
apply (rule mult_nonneg_nonneg)
|
|
92 |
apply simp
|
|
93 |
apply (subst inverse_nonnegative_iff_nonnegative)
|
|
94 |
apply (rule real_of_nat_fact_ge_zero)
|
|
95 |
apply (rule zero_le_power)
|
|
96 |
apply assumption
|
|
97 |
done
|
|
98 |
also have "... = 1 / 2 * (inverse (real (fact (n + 2))) * x ^ (n + 2))"
|
|
99 |
by simp
|
|
100 |
also have "... <= 1 / 2 * (x ^ 2 / 2 * (1 / 2) ^ n)"
|
|
101 |
apply (rule mult_left_mono)
|
|
102 |
apply (rule prems)
|
|
103 |
apply simp
|
|
104 |
done
|
|
105 |
also have "... = x ^ 2 / 2 * (1 / 2 * (1 / 2) ^ n)"
|
|
106 |
by auto
|
|
107 |
also have "(1::real) / 2 * (1 / 2) ^ n = (1 / 2) ^ (Suc n)"
|
|
108 |
by (rule realpow_Suc [THEN sym])
|
|
109 |
finally show ?thesis .
|
|
110 |
qed
|
|
111 |
qed
|
|
112 |
|
|
113 |
lemma aux2: "(%n. x ^ 2 / 2 * (1 / 2) ^ n) sums x^2"
|
|
114 |
proof -
|
|
115 |
have "(%n. (1 / 2)^n) sums (1 / (1 - (1/2)))"
|
|
116 |
apply (rule geometric_sums)
|
|
117 |
by (simp add: abs_interval_iff)
|
|
118 |
also have "(1::real) / (1 - 1/2) = 2"
|
|
119 |
by simp
|
|
120 |
finally have "(%n. (1 / 2)^n) sums 2" .
|
|
121 |
then have "(%n. x ^ 2 / 2 * (1 / 2) ^ n) sums (x^2 / 2 * 2)"
|
|
122 |
by (rule sums_mult)
|
|
123 |
also have "x^2 / 2 * 2 = x^2"
|
|
124 |
by simp
|
|
125 |
finally show ?thesis .
|
|
126 |
qed
|
|
127 |
|
|
128 |
lemma exp_bound: "0 <= x ==> x <= 1 ==> exp x <= 1 + x + x^2"
|
|
129 |
proof -
|
|
130 |
assume a: "0 <= x"
|
|
131 |
assume b: "x <= 1"
|
|
132 |
have c: "exp x = 1 + x + suminf (%n. inverse(real (fact (n+2))) *
|
|
133 |
(x ^ (n+2)))"
|
|
134 |
by (rule exp_first_two_terms)
|
|
135 |
moreover have "suminf (%n. inverse(real (fact (n+2))) * (x ^ (n+2))) <= x^2"
|
|
136 |
proof -
|
|
137 |
have "suminf (%n. inverse(real (fact (n+2))) * (x ^ (n+2))) <=
|
|
138 |
suminf (%n. (x^2/2) * ((1/2)^n))"
|
|
139 |
apply (rule summable_le)
|
|
140 |
apply (auto simp only: aux1 prems)
|
|
141 |
apply (rule exp_tail_after_first_two_terms_summable)
|
|
142 |
by (rule sums_summable, rule aux2)
|
|
143 |
also have "... = x^2"
|
|
144 |
by (rule sums_unique [THEN sym], rule aux2)
|
|
145 |
finally show ?thesis .
|
|
146 |
qed
|
|
147 |
ultimately show ?thesis
|
|
148 |
by auto
|
|
149 |
qed
|
|
150 |
|
|
151 |
lemma aux3: "(0::real) <= x ==> (1 + x + x^2)/(1 + x^2) <= 1 + x"
|
|
152 |
apply (subst pos_divide_le_eq)
|
|
153 |
apply (simp add: zero_compare_simps)
|
|
154 |
apply (simp add: ring_eq_simps zero_compare_simps)
|
|
155 |
done
|
|
156 |
|
|
157 |
lemma aux4: "0 <= x ==> x <= 1 ==> exp (x - x^2) <= 1 + x"
|
|
158 |
proof -
|
|
159 |
assume a: "0 <= x" and b: "x <= 1"
|
|
160 |
have "exp (x - x^2) = exp x / exp (x^2)"
|
|
161 |
by (rule exp_diff)
|
|
162 |
also have "... <= (1 + x + x^2) / exp (x ^2)"
|
|
163 |
apply (rule divide_right_mono)
|
|
164 |
apply (rule exp_bound)
|
|
165 |
apply (rule a, rule b)
|
|
166 |
apply simp
|
|
167 |
done
|
|
168 |
also have "... <= (1 + x + x^2) / (1 + x^2)"
|
|
169 |
apply (rule divide_left_mono)
|
|
170 |
apply auto
|
|
171 |
apply (rule add_nonneg_nonneg)
|
|
172 |
apply (insert prems, auto)
|
|
173 |
apply (rule mult_pos_pos)
|
|
174 |
apply auto
|
|
175 |
apply (rule add_pos_nonneg)
|
|
176 |
apply auto
|
|
177 |
done
|
|
178 |
also from a have "... <= 1 + x"
|
|
179 |
by (rule aux3)
|
|
180 |
finally show ?thesis .
|
|
181 |
qed
|
|
182 |
|
|
183 |
lemma ln_one_plus_pos_lower_bound: "0 <= x ==> x <= 1 ==>
|
|
184 |
x - x^2 <= ln (1 + x)"
|
|
185 |
proof -
|
|
186 |
assume a: "0 <= x" and b: "x <= 1"
|
|
187 |
then have "exp (x - x^2) <= 1 + x"
|
|
188 |
by (rule aux4)
|
|
189 |
also have "... = exp (ln (1 + x))"
|
|
190 |
proof -
|
|
191 |
from a have "0 < 1 + x" by auto
|
|
192 |
thus ?thesis
|
|
193 |
by (auto simp only: exp_ln_iff [THEN sym])
|
|
194 |
qed
|
|
195 |
finally have "exp (x - x ^ 2) <= exp (ln (1 + x))" .
|
|
196 |
thus ?thesis by (auto simp only: exp_le_cancel_iff)
|
|
197 |
qed
|
|
198 |
|
|
199 |
lemma ln_one_minus_pos_upper_bound: "0 <= x ==> x < 1 ==> ln (1 - x) <= - x"
|
|
200 |
proof -
|
|
201 |
assume a: "0 <= (x::real)" and b: "x < 1"
|
|
202 |
have "(1 - x) * (1 + x + x^2) = (1 - x^3)"
|
|
203 |
by (simp add: ring_eq_simps power2_eq_square power3_eq_cube)
|
|
204 |
also have "... <= 1"
|
|
205 |
by (auto intro: zero_le_power simp add: a)
|
|
206 |
finally have "(1 - x) * (1 + x + x ^ 2) <= 1" .
|
|
207 |
moreover have "0 < 1 + x + x^2"
|
|
208 |
apply (rule add_pos_nonneg)
|
|
209 |
apply (insert a, auto)
|
|
210 |
done
|
|
211 |
ultimately have "1 - x <= 1 / (1 + x + x^2)"
|
|
212 |
by (elim mult_imp_le_div_pos)
|
|
213 |
also have "... <= 1 / exp x"
|
|
214 |
apply (rule divide_left_mono)
|
|
215 |
apply (rule exp_bound, rule a)
|
|
216 |
apply (insert prems, auto)
|
|
217 |
apply (rule mult_pos_pos)
|
|
218 |
apply (rule add_pos_nonneg)
|
|
219 |
apply auto
|
|
220 |
done
|
|
221 |
also have "... = exp (-x)"
|
|
222 |
by (auto simp add: exp_minus real_divide_def)
|
|
223 |
finally have "1 - x <= exp (- x)" .
|
|
224 |
also have "1 - x = exp (ln (1 - x))"
|
|
225 |
proof -
|
|
226 |
have "0 < 1 - x"
|
|
227 |
by (insert b, auto)
|
|
228 |
thus ?thesis
|
|
229 |
by (auto simp only: exp_ln_iff [THEN sym])
|
|
230 |
qed
|
|
231 |
finally have "exp (ln (1 - x)) <= exp (- x)" .
|
|
232 |
thus ?thesis by (auto simp only: exp_le_cancel_iff)
|
|
233 |
qed
|
|
234 |
|
|
235 |
lemma aux5: "x < 1 ==> ln(1 - x) = - ln(1 + x / (1 - x))"
|
|
236 |
proof -
|
|
237 |
assume a: "x < 1"
|
|
238 |
have "ln(1 - x) = - ln(1 / (1 - x))"
|
|
239 |
proof -
|
|
240 |
have "ln(1 - x) = - (- ln (1 - x))"
|
|
241 |
by auto
|
|
242 |
also have "- ln(1 - x) = ln 1 - ln(1 - x)"
|
|
243 |
by simp
|
|
244 |
also have "... = ln(1 / (1 - x))"
|
|
245 |
apply (rule ln_div [THEN sym])
|
|
246 |
by (insert a, auto)
|
|
247 |
finally show ?thesis .
|
|
248 |
qed
|
|
249 |
also have " 1 / (1 - x) = 1 + x / (1 - x)"
|
|
250 |
proof -
|
|
251 |
have "1 / (1 - x) = (1 - x + x) / (1 - x)"
|
|
252 |
by auto
|
|
253 |
also have "... = (1 - x) / (1 - x) + x / (1 - x)"
|
|
254 |
by (rule add_divide_distrib)
|
|
255 |
also have "... = 1 + x / (1-x)"
|
|
256 |
apply (subst add_right_cancel)
|
|
257 |
apply (insert a, simp)
|
|
258 |
done
|
|
259 |
finally show ?thesis .
|
|
260 |
qed
|
|
261 |
finally show ?thesis .
|
|
262 |
qed
|
|
263 |
|
|
264 |
lemma ln_one_minus_pos_lower_bound: "0 <= x ==> x <= (1 / 2) ==>
|
|
265 |
- x - 2 * x^2 <= ln (1 - x)"
|
|
266 |
proof -
|
|
267 |
assume a: "0 <= x" and b: "x <= (1 / 2)"
|
|
268 |
from b have c: "x < 1"
|
|
269 |
by auto
|
|
270 |
then have "ln (1 - x) = - ln (1 + x / (1 - x))"
|
|
271 |
by (rule aux5)
|
|
272 |
also have "- (x / (1 - x)) <= ..."
|
|
273 |
proof -
|
|
274 |
have "ln (1 + x / (1 - x)) <= x / (1 - x)"
|
|
275 |
apply (rule ln_add_one_self_le_self)
|
|
276 |
apply (rule divide_nonneg_pos)
|
|
277 |
by (insert a c, auto)
|
|
278 |
thus ?thesis
|
|
279 |
by auto
|
|
280 |
qed
|
|
281 |
also have "- (x / (1 - x)) = -x / (1 - x)"
|
|
282 |
by auto
|
|
283 |
finally have d: "- x / (1 - x) <= ln (1 - x)" .
|
|
284 |
have e: "-x - 2 * x^2 <= - x / (1 - x)"
|
|
285 |
apply (rule mult_imp_le_div_pos)
|
|
286 |
apply (insert prems, force)
|
|
287 |
apply (auto simp add: ring_eq_simps power2_eq_square)
|
|
288 |
apply (subgoal_tac "- (x * x) + x * (x * (x * 2)) = x^2 * (2 * x - 1)")
|
|
289 |
apply (erule ssubst)
|
|
290 |
apply (rule mult_nonneg_nonpos)
|
|
291 |
apply auto
|
|
292 |
apply (auto simp add: ring_eq_simps power2_eq_square)
|
|
293 |
done
|
|
294 |
from e d show "- x - 2 * x^2 <= ln (1 - x)"
|
|
295 |
by (rule order_trans)
|
|
296 |
qed
|
|
297 |
|
|
298 |
lemma exp_ge_add_one_self2: "1 + x <= exp x"
|
|
299 |
apply (case_tac "0 <= x")
|
|
300 |
apply (erule exp_ge_add_one_self)
|
|
301 |
apply (case_tac "x <= -1")
|
|
302 |
apply (subgoal_tac "1 + x <= 0")
|
|
303 |
apply (erule order_trans)
|
|
304 |
apply simp
|
|
305 |
apply simp
|
|
306 |
apply (subgoal_tac "1 + x = exp(ln (1 + x))")
|
|
307 |
apply (erule ssubst)
|
|
308 |
apply (subst exp_le_cancel_iff)
|
|
309 |
apply (subgoal_tac "ln (1 - (- x)) <= - (- x)")
|
|
310 |
apply simp
|
|
311 |
apply (rule ln_one_minus_pos_upper_bound)
|
|
312 |
apply auto
|
|
313 |
apply (rule sym)
|
|
314 |
apply (subst exp_ln_iff)
|
|
315 |
apply auto
|
|
316 |
done
|
|
317 |
|
|
318 |
lemma ln_add_one_self_le_self2: "-1 < x ==> ln(1 + x) <= x"
|
|
319 |
apply (subgoal_tac "x = ln (exp x)")
|
|
320 |
apply (erule ssubst)back
|
|
321 |
apply (subst ln_le_cancel_iff)
|
|
322 |
apply auto
|
|
323 |
apply (rule exp_ge_add_one_self2)
|
|
324 |
done
|
|
325 |
|
|
326 |
lemma abs_ln_one_plus_x_minus_x_bound_nonneg:
|
|
327 |
"0 <= x ==> x <= 1 ==> abs(ln (1 + x) - x) <= x^2"
|
|
328 |
proof -
|
|
329 |
assume "0 <= x"
|
|
330 |
assume "x <= 1"
|
|
331 |
have "ln (1 + x) <= x"
|
|
332 |
by (rule ln_add_one_self_le_self)
|
|
333 |
then have "ln (1 + x) - x <= 0"
|
|
334 |
by simp
|
|
335 |
then have "abs(ln(1 + x) - x) = - (ln(1 + x) - x)"
|
|
336 |
by (rule abs_of_nonpos)
|
|
337 |
also have "... = x - ln (1 + x)"
|
|
338 |
by simp
|
|
339 |
also have "... <= x^2"
|
|
340 |
proof -
|
|
341 |
from prems have "x - x^2 <= ln (1 + x)"
|
|
342 |
by (intro ln_one_plus_pos_lower_bound)
|
|
343 |
thus ?thesis
|
|
344 |
by simp
|
|
345 |
qed
|
|
346 |
finally show ?thesis .
|
|
347 |
qed
|
|
348 |
|
|
349 |
lemma abs_ln_one_plus_x_minus_x_bound_nonpos:
|
|
350 |
"-(1 / 2) <= x ==> x <= 0 ==> abs(ln (1 + x) - x) <= 2 * x^2"
|
|
351 |
proof -
|
|
352 |
assume "-(1 / 2) <= x"
|
|
353 |
assume "x <= 0"
|
|
354 |
have "abs(ln (1 + x) - x) = x - ln(1 - (-x))"
|
|
355 |
apply (subst abs_of_nonpos)
|
|
356 |
apply simp
|
|
357 |
apply (rule ln_add_one_self_le_self2)
|
|
358 |
apply (insert prems, auto)
|
|
359 |
done
|
|
360 |
also have "... <= 2 * x^2"
|
|
361 |
apply (subgoal_tac "- (-x) - 2 * (-x)^2 <= ln (1 - (-x))")
|
|
362 |
apply (simp add: compare_rls)
|
|
363 |
apply (rule ln_one_minus_pos_lower_bound)
|
|
364 |
apply (insert prems, auto)
|
|
365 |
done
|
|
366 |
finally show ?thesis .
|
|
367 |
qed
|
|
368 |
|
|
369 |
lemma abs_ln_one_plus_x_minus_x_bound:
|
|
370 |
"abs x <= 1 / 2 ==> abs(ln (1 + x) - x) <= 2 * x^2"
|
|
371 |
apply (case_tac "0 <= x")
|
|
372 |
apply (rule order_trans)
|
|
373 |
apply (rule abs_ln_one_plus_x_minus_x_bound_nonneg)
|
|
374 |
apply auto
|
|
375 |
apply (rule abs_ln_one_plus_x_minus_x_bound_nonpos)
|
|
376 |
apply auto
|
|
377 |
done
|
|
378 |
|
|
379 |
lemma DERIV_ln: "0 < x ==> DERIV ln x :> 1 / x"
|
|
380 |
apply (unfold deriv_def, unfold LIM_def, clarsimp)
|
|
381 |
apply (rule exI)
|
|
382 |
apply (rule conjI)
|
|
383 |
prefer 2
|
|
384 |
apply clarsimp
|
|
385 |
apply (subgoal_tac "(ln (x + xa) + - ln x) / xa + - (1 / x) =
|
|
386 |
(ln (1 + xa / x) - xa / x) / xa")
|
|
387 |
apply (erule ssubst)
|
|
388 |
apply (subst abs_divide)
|
|
389 |
apply (rule mult_imp_div_pos_less)
|
|
390 |
apply force
|
|
391 |
apply (rule order_le_less_trans)
|
|
392 |
apply (rule abs_ln_one_plus_x_minus_x_bound)
|
|
393 |
apply (subst abs_divide)
|
|
394 |
apply (subst abs_of_pos, assumption)
|
|
395 |
apply (erule mult_imp_div_pos_le)
|
|
396 |
apply (subgoal_tac "abs xa < min (x / 2) (r * x^2 / 2)")
|
|
397 |
apply force
|
|
398 |
apply assumption
|
|
399 |
apply (simp add: power2_eq_square mult_compare_simps)
|
|
400 |
apply (rule mult_imp_div_pos_less)
|
|
401 |
apply (rule mult_pos_pos, assumption, assumption)
|
|
402 |
apply (subgoal_tac "xa * xa = abs xa * abs xa")
|
|
403 |
apply (erule ssubst)
|
|
404 |
apply (subgoal_tac "abs xa * (abs xa * 2) < abs xa * (r * (x * x))")
|
|
405 |
apply (simp only: mult_ac)
|
|
406 |
apply (rule mult_strict_left_mono)
|
|
407 |
apply (erule conjE, assumption)
|
|
408 |
apply force
|
|
409 |
apply simp
|
|
410 |
apply (subst diff_minus [THEN sym])+
|
|
411 |
apply (subst ln_div [THEN sym])
|
|
412 |
apply arith
|
|
413 |
apply (auto simp add: ring_eq_simps add_frac_eq frac_eq_eq
|
|
414 |
add_divide_distrib power2_eq_square)
|
|
415 |
apply (rule mult_pos_pos, assumption)+
|
|
416 |
apply assumption
|
|
417 |
done
|
|
418 |
|
|
419 |
lemma ln_x_over_x_mono: "exp 1 <= x ==> x <= y ==> (ln y / y) <= (ln x / x)"
|
|
420 |
proof -
|
|
421 |
assume "exp 1 <= x" and "x <= y"
|
|
422 |
have a: "0 < x" and b: "0 < y"
|
|
423 |
apply (insert prems)
|
|
424 |
apply (subgoal_tac "0 < exp 1")
|
|
425 |
apply arith
|
|
426 |
apply auto
|
|
427 |
apply (subgoal_tac "0 < exp 1")
|
|
428 |
apply arith
|
|
429 |
apply auto
|
|
430 |
done
|
|
431 |
have "x * ln y - x * ln x = x * (ln y - ln x)"
|
|
432 |
by (simp add: ring_eq_simps)
|
|
433 |
also have "... = x * ln(y / x)"
|
|
434 |
apply (subst ln_div)
|
|
435 |
apply (rule b, rule a, rule refl)
|
|
436 |
done
|
|
437 |
also have "y / x = (x + (y - x)) / x"
|
|
438 |
by simp
|
|
439 |
also have "... = 1 + (y - x) / x"
|
|
440 |
apply (simp only: add_divide_distrib)
|
|
441 |
apply (simp add: prems)
|
|
442 |
apply (insert a, arith)
|
|
443 |
done
|
|
444 |
also have "x * ln(1 + (y - x) / x) <= x * ((y - x) / x)"
|
|
445 |
apply (rule mult_left_mono)
|
|
446 |
apply (rule ln_add_one_self_le_self)
|
|
447 |
apply (rule divide_nonneg_pos)
|
|
448 |
apply (insert prems a, simp_all)
|
|
449 |
done
|
|
450 |
also have "... = y - x"
|
|
451 |
by (insert a, simp)
|
|
452 |
also have "... = (y - x) * ln (exp 1)"
|
|
453 |
by simp
|
|
454 |
also have "... <= (y - x) * ln x"
|
|
455 |
apply (rule mult_left_mono)
|
|
456 |
apply (subst ln_le_cancel_iff)
|
|
457 |
apply force
|
|
458 |
apply (rule a)
|
|
459 |
apply (rule prems)
|
|
460 |
apply (insert prems, simp)
|
|
461 |
done
|
|
462 |
also have "... = y * ln x - x * ln x"
|
|
463 |
by (rule left_diff_distrib)
|
|
464 |
finally have "x * ln y <= y * ln x"
|
|
465 |
by arith
|
|
466 |
then have "ln y <= (y * ln x) / x"
|
|
467 |
apply (subst pos_le_divide_eq)
|
|
468 |
apply (rule a)
|
|
469 |
apply (simp add: mult_ac)
|
|
470 |
done
|
|
471 |
also have "... = y * (ln x / x)"
|
|
472 |
by simp
|
|
473 |
finally show ?thesis
|
|
474 |
apply (subst pos_divide_le_eq)
|
|
475 |
apply (rule b)
|
|
476 |
apply (simp add: mult_ac)
|
|
477 |
done
|
|
478 |
qed
|
|
479 |
|
|
480 |
end
|
|
481 |
|