1
(************************************************************************)
2
(* v * The Coq Proof Assistant / The Coq Development Team *)
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
4
(* \VV/ **************************************************************)
5
(* // * This file is distributed under the terms of the *)
6
(* * GNU Lesser General Public License Version 2.1 *)
7
(************************************************************************)
9
(*i $Id: Ranalysis3.v 10710 2008-03-23 09:24:09Z herbelin $ i*)
12
Require Import Rfunctions.
13
Require Import Ranalysis1.
14
Require Import Ranalysis2.
15
Open Local Scope R_scope.
18
Theorem derivable_pt_lim_div :
19
forall (f1 f2:R -> R) (x l1 l2:R),
20
derivable_pt_lim f1 x l1 ->
21
derivable_pt_lim f2 x l2 ->
23
derivable_pt_lim (f1 / f2) x ((l1 * f2 x - l2 * f1 x) / Rsqr (f2 x)).
25
intros f1 f2 x l1 l2 H H0 H1.
26
cut (derivable_pt f2 x);
27
[ intro X | unfold derivable_pt in |- *; exists l2; exact H0 ].
28
assert (H2 := continuous_neq_0 _ _ (derivable_continuous_pt _ _ X) H1).
29
elim H2; clear H2; intros eps_f2 H2.
30
unfold div_fct in |- *.
31
assert (H3 := derivable_continuous_pt _ _ X).
32
unfold continuity_pt in H3; unfold continue_in in H3; unfold limit1_in in H3;
33
unfold limit_in in H3; unfold dist in H3.
34
simpl in H3; unfold R_dist in H3.
35
elim (H3 (Rabs (f2 x) / 2));
37
| unfold Rdiv in |- *; change (0 < Rabs (f2 x) * / 2) in |- *;
38
apply Rmult_lt_0_compat;
39
[ apply Rabs_pos_lt; assumption | apply Rinv_0_lt_compat; prove_sup0 ] ].
40
clear H3; intros alp_f2 H3.
43
Rabs (x0 - x) < alp_f2 -> Rabs (f2 x0 - f2 x) < Rabs (f2 x) / 2).
45
cut (forall a:R, Rabs (a - x) < alp_f2 -> Rabs (f2 x) / 2 < Rabs (f2 a)).
49
Rabs a < Rmin eps_f2 alp_f2 -> / Rabs (f2 (x + a)) < 2 / Rabs (f2 x)).
51
unfold derivable_pt_lim in |- *; intros.
52
elim (H (Rabs (eps * f2 x / 8)));
54
| unfold Rdiv in |- *; change (0 < Rabs (eps * f2 x * / 8)) in |- *;
55
apply Rabs_pos_lt; repeat apply prod_neq_R0;
56
[ red in |- *; intro H7; rewrite H7 in H6; elim (Rlt_irrefl _ H6)
58
| apply Rinv_neq_0_compat; discrR ] ].
60
case (Req_dec (f1 x) 0); intro.
61
case (Req_dec l1 0); intro.
62
(***********************************)
65
(***********************************)
66
cut (0 < Rmin eps_f2 (Rmin alp_f2 alp_f1d));
68
| repeat apply Rmin_pos;
69
[ apply (cond_pos eps_f2)
70
| elim H3; intros; assumption
71
| apply (cond_pos alp_f1d) ] ].
72
exists (mkposreal (Rmin eps_f2 (Rmin alp_f2 alp_f1d)) H10).
73
simpl in |- *; intros.
74
assert (H13 := Rlt_le_trans _ _ _ H12 (Rmin_r _ _)).
75
assert (H14 := Rlt_le_trans _ _ _ H12 (Rmin_l _ _)).
76
assert (H15 := Rlt_le_trans _ _ _ H13 (Rmin_r _ _)).
77
assert (H16 := Rlt_le_trans _ _ _ H13 (Rmin_l _ _)).
78
assert (H17 := H7 _ H11 H15).
79
rewrite formule; [ idtac | assumption | assumption | apply H2; apply H14 ].
80
apply Rle_lt_trans with
81
(Rabs (/ f2 (x + h) * ((f1 (x + h) - f1 x) / h - l1)) +
82
Rabs (l1 / (f2 x * f2 (x + h)) * (f2 x - f2 (x + h))) +
83
Rabs (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) - f2 x) / h - l2)) +
84
Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h)) * (f2 (x + h) - f2 x))).
85
unfold Rminus in |- *.
87
(Rabs_Ropp (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) + - f2 x) / h + - l2)))
90
repeat rewrite Rabs_mult.
91
apply Rlt_le_trans with (eps / 4 + eps / 4 + eps / 4 + eps / 4).
92
cut (Rabs (/ f2 (x + h)) * Rabs ((f1 (x + h) - f1 x) / h - l1) < eps / 4).
93
cut (Rabs (l1 / (f2 x * f2 (x + h))) * Rabs (f2 x - f2 (x + h)) < eps / 4).
95
(Rabs (f1 x / (f2 x * f2 (x + h))) * Rabs ((f2 (x + h) - f2 x) / h - l2) <
98
(Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h))) * Rabs (f2 (x + h) - f2 x) <
101
apply Rlt_4; assumption.
103
unfold Rdiv in |- *; repeat rewrite Rmult_0_r || rewrite Rmult_0_l.
104
rewrite Rabs_R0; rewrite Rmult_0_l.
105
apply Rmult_lt_0_compat; [ assumption | apply Rinv_0_lt_compat; prove_sup ].
107
unfold Rdiv in |- *; repeat rewrite Rmult_0_r || rewrite Rmult_0_l.
108
rewrite Rabs_R0; rewrite Rmult_0_l.
109
apply Rmult_lt_0_compat; [ assumption | apply Rinv_0_lt_compat; prove_sup ].
111
unfold Rdiv in |- *; repeat rewrite Rmult_0_r || rewrite Rmult_0_l.
112
rewrite Rabs_R0; rewrite Rmult_0_l.
113
apply Rmult_lt_0_compat; [ assumption | apply Rinv_0_lt_compat; prove_sup ].
114
rewrite <- Rabs_mult.
115
apply (maj_term1 x h eps l1 alp_f2 eps_f2 alp_f1d f1 f2);
116
try assumption || apply H2.
118
apply Rmin_2; assumption.
119
right; symmetry in |- *; apply quadruple_var.
120
(***********************************)
123
(***********************************)
124
assert (H10 := derivable_continuous_pt _ _ X).
125
unfold continuity_pt in H10.
126
unfold continue_in in H10.
127
unfold limit1_in in H10.
128
unfold limit_in in H10.
131
unfold R_dist in H10.
132
elim (H10 (Rabs (eps * Rsqr (f2 x) / (8 * l1)))).
133
clear H10; intros alp_f2t2 H10.
137
Rabs (f2 (x + a) - f2 x) < Rabs (eps * Rsqr (f2 x) / (8 * l1))).
139
cut (0 < Rmin (Rmin eps_f2 alp_f1d) (Rmin alp_f2 alp_f2t2)).
141
exists (mkposreal (Rmin (Rmin eps_f2 alp_f1d) (Rmin alp_f2 alp_f2t2)) H12).
144
assert (H15 := Rlt_le_trans _ _ _ H14 (Rmin_r _ _)).
145
assert (H16 := Rlt_le_trans _ _ _ H14 (Rmin_l _ _)).
146
assert (H17 := Rlt_le_trans _ _ _ H15 (Rmin_l _ _)).
147
assert (H18 := Rlt_le_trans _ _ _ H15 (Rmin_r _ _)).
148
assert (H19 := Rlt_le_trans _ _ _ H16 (Rmin_l _ _)).
149
assert (H20 := Rlt_le_trans _ _ _ H16 (Rmin_r _ _)).
151
rewrite formule; try assumption.
152
apply Rle_lt_trans with
153
(Rabs (/ f2 (x + h) * ((f1 (x + h) - f1 x) / h - l1)) +
154
Rabs (l1 / (f2 x * f2 (x + h)) * (f2 x - f2 (x + h))) +
155
Rabs (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) - f2 x) / h - l2)) +
156
Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h)) * (f2 (x + h) - f2 x))).
157
unfold Rminus in |- *.
159
(Rabs_Ropp (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) + - f2 x) / h + - l2)))
162
repeat rewrite Rabs_mult.
163
apply Rlt_le_trans with (eps / 4 + eps / 4 + eps / 4 + eps / 4).
164
cut (Rabs (/ f2 (x + h)) * Rabs ((f1 (x + h) - f1 x) / h - l1) < eps / 4).
165
cut (Rabs (l1 / (f2 x * f2 (x + h))) * Rabs (f2 x - f2 (x + h)) < eps / 4).
167
(Rabs (f1 x / (f2 x * f2 (x + h))) * Rabs ((f2 (x + h) - f2 x) / h - l2) <
170
(Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h))) * Rabs (f2 (x + h) - f2 x) <
173
apply Rlt_4; assumption.
175
unfold Rdiv in |- *; repeat rewrite Rmult_0_r || rewrite Rmult_0_l.
176
rewrite Rabs_R0; rewrite Rmult_0_l.
177
apply Rmult_lt_0_compat; [ assumption | apply Rinv_0_lt_compat; prove_sup ].
179
unfold Rdiv in |- *; repeat rewrite Rmult_0_r || rewrite Rmult_0_l.
180
rewrite Rabs_R0; rewrite Rmult_0_l.
181
apply Rmult_lt_0_compat; [ assumption | apply Rinv_0_lt_compat; prove_sup ].
182
rewrite <- Rabs_mult.
183
apply (maj_term2 x h eps l1 alp_f2 alp_f2t2 eps_f2 f2); try assumption.
184
apply H2; assumption.
185
apply Rmin_2; assumption.
186
rewrite <- Rabs_mult.
187
apply (maj_term1 x h eps l1 alp_f2 eps_f2 alp_f1d f1 f2); try assumption.
188
apply H2; assumption.
189
apply Rmin_2; assumption.
190
right; symmetry in |- *; apply quadruple_var.
191
apply H2; assumption.
192
repeat apply Rmin_pos.
193
apply (cond_pos eps_f2).
194
apply (cond_pos alp_f1d).
195
elim H3; intros; assumption.
196
elim H10; intros; assumption.
199
case (Req_dec a 0); intro.
200
rewrite H14; rewrite Rplus_0_r.
201
unfold Rminus in |- *; rewrite Rplus_opp_r.
204
unfold Rdiv, Rsqr in |- *; repeat rewrite Rmult_assoc.
205
repeat apply prod_neq_R0; try assumption.
206
red in |- *; intro; rewrite H15 in H6; elim (Rlt_irrefl _ H6).
207
apply Rinv_neq_0_compat; repeat apply prod_neq_R0; discrR || assumption.
210
apply D_x_no_cond; assumption.
211
replace (x + a - x) with a; [ assumption | ring ].
212
change (0 < Rabs (eps * Rsqr (f2 x) / (8 * l1))) in |- *.
213
apply Rabs_pos_lt; unfold Rdiv, Rsqr in |- *; repeat rewrite Rmult_assoc;
214
repeat apply prod_neq_R0.
215
red in |- *; intro; rewrite H11 in H6; elim (Rlt_irrefl _ H6).
218
apply Rinv_neq_0_compat; repeat apply prod_neq_R0;
219
[ discrR | discrR | discrR | assumption ].
220
(***********************************)
222
(* (f1 x)<>0 l1=0 l2=0 *)
223
(***********************************)
224
case (Req_dec l1 0); intro.
225
case (Req_dec l2 0); intro.
226
elim (H0 (Rabs (Rsqr (f2 x) * eps / (8 * f1 x))));
228
| apply Rabs_pos_lt; unfold Rdiv, Rsqr in |- *; repeat rewrite Rmult_assoc;
229
repeat apply prod_neq_R0;
232
| red in |- *; intro; rewrite H11 in H6; elim (Rlt_irrefl _ H6)
233
| apply Rinv_neq_0_compat; repeat apply prod_neq_R0; discrR || assumption ] ].
235
cut (0 < Rmin (Rmin eps_f2 alp_f2) (Rmin alp_f1d alp_f2d)).
237
exists (mkposreal (Rmin (Rmin eps_f2 alp_f2) (Rmin alp_f1d alp_f2d)) H11).
240
assert (H15 := Rlt_le_trans _ _ _ H14 (Rmin_l _ _)).
241
assert (H16 := Rlt_le_trans _ _ _ H14 (Rmin_r _ _)).
242
assert (H17 := Rlt_le_trans _ _ _ H15 (Rmin_l _ _)).
243
assert (H18 := Rlt_le_trans _ _ _ H15 (Rmin_r _ _)).
244
assert (H19 := Rlt_le_trans _ _ _ H16 (Rmin_l _ _)).
245
assert (H20 := Rlt_le_trans _ _ _ H16 (Rmin_r _ _)).
247
rewrite formule; try assumption.
248
apply Rle_lt_trans with
249
(Rabs (/ f2 (x + h) * ((f1 (x + h) - f1 x) / h - l1)) +
250
Rabs (l1 / (f2 x * f2 (x + h)) * (f2 x - f2 (x + h))) +
251
Rabs (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) - f2 x) / h - l2)) +
252
Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h)) * (f2 (x + h) - f2 x))).
253
unfold Rminus in |- *.
255
(Rabs_Ropp (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) + - f2 x) / h + - l2)))
258
repeat rewrite Rabs_mult.
259
apply Rlt_le_trans with (eps / 4 + eps / 4 + eps / 4 + eps / 4).
260
cut (Rabs (/ f2 (x + h)) * Rabs ((f1 (x + h) - f1 x) / h - l1) < eps / 4).
261
cut (Rabs (l1 / (f2 x * f2 (x + h))) * Rabs (f2 x - f2 (x + h)) < eps / 4).
263
(Rabs (f1 x / (f2 x * f2 (x + h))) * Rabs ((f2 (x + h) - f2 x) / h - l2) <
266
(Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h))) * Rabs (f2 (x + h) - f2 x) <
269
apply Rlt_4; assumption.
271
unfold Rdiv in |- *; repeat rewrite Rmult_0_r || rewrite Rmult_0_l.
272
rewrite Rabs_R0; rewrite Rmult_0_l.
273
apply Rmult_lt_0_compat; [ assumption | apply Rinv_0_lt_compat; prove_sup ].
274
rewrite <- Rabs_mult.
275
apply (maj_term3 x h eps l2 alp_f2 eps_f2 alp_f2d f1 f2); try assumption.
276
apply H2; assumption.
277
apply Rmin_2; assumption.
279
unfold Rdiv in |- *; repeat rewrite Rmult_0_r || rewrite Rmult_0_l.
280
rewrite Rabs_R0; rewrite Rmult_0_l.
281
apply Rmult_lt_0_compat; [ assumption | apply Rinv_0_lt_compat; prove_sup ].
282
rewrite <- Rabs_mult.
283
apply (maj_term1 x h eps l1 alp_f2 eps_f2 alp_f1d f1 f2); assumption || idtac.
284
apply H2; assumption.
285
apply Rmin_2; assumption.
286
right; symmetry in |- *; apply quadruple_var.
287
apply H2; assumption.
288
repeat apply Rmin_pos.
289
apply (cond_pos eps_f2).
290
elim H3; intros; assumption.
291
apply (cond_pos alp_f1d).
292
apply (cond_pos alp_f2d).
293
(***********************************)
295
(* (f1 x)<>0 l1=0 l2<>0 *)
296
(***********************************)
297
elim (H0 (Rabs (Rsqr (f2 x) * eps / (8 * f1 x))));
299
| apply Rabs_pos_lt; unfold Rsqr, Rdiv in |- *;
300
repeat rewrite Rinv_mult_distr; repeat apply prod_neq_R0;
301
try assumption || discrR ].
303
assert (H12 := derivable_continuous_pt _ _ X).
304
unfold continuity_pt in H12.
305
unfold continue_in in H12.
306
unfold limit1_in in H12.
307
unfold limit_in in H12.
310
unfold R_dist in H12.
311
elim (H12 (Rabs (Rsqr (f2 x) * f2 x * eps / (8 * f1 x * l2)))).
313
cut (0 < Rmin (Rmin eps_f2 alp_f2) (Rmin alp_f1d (Rmin alp_f2d alp_f2c))).
316
(mkposreal (Rmin (Rmin eps_f2 alp_f2) (Rmin alp_f1d (Rmin alp_f2d alp_f2c)))
318
simpl in |- *; intros.
319
assert (H17 := Rlt_le_trans _ _ _ H16 (Rmin_l _ _)).
320
assert (H18 := Rlt_le_trans _ _ _ H16 (Rmin_r _ _)).
321
assert (H19 := Rlt_le_trans _ _ _ H18 (Rmin_r _ _)).
322
assert (H20 := Rlt_le_trans _ _ _ H19 (Rmin_l _ _)).
323
assert (H21 := Rlt_le_trans _ _ _ H19 (Rmin_r _ _)).
324
assert (H22 := Rlt_le_trans _ _ _ H18 (Rmin_l _ _)).
325
assert (H23 := Rlt_le_trans _ _ _ H17 (Rmin_l _ _)).
326
assert (H24 := Rlt_le_trans _ _ _ H17 (Rmin_r _ _)).
327
clear H16 H17 H18 H19.
331
Rabs (f2 (x + a) - f2 x) <
332
Rabs (Rsqr (f2 x) * f2 x * eps / (8 * f1 x * l2))).
334
rewrite formule; try assumption.
335
apply Rle_lt_trans with
336
(Rabs (/ f2 (x + h) * ((f1 (x + h) - f1 x) / h - l1)) +
337
Rabs (l1 / (f2 x * f2 (x + h)) * (f2 x - f2 (x + h))) +
338
Rabs (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) - f2 x) / h - l2)) +
339
Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h)) * (f2 (x + h) - f2 x))).
340
unfold Rminus in |- *.
342
(Rabs_Ropp (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) + - f2 x) / h + - l2)))
345
repeat rewrite Rabs_mult.
346
apply Rlt_le_trans with (eps / 4 + eps / 4 + eps / 4 + eps / 4).
347
cut (Rabs (/ f2 (x + h)) * Rabs ((f1 (x + h) - f1 x) / h - l1) < eps / 4).
348
cut (Rabs (l1 / (f2 x * f2 (x + h))) * Rabs (f2 x - f2 (x + h)) < eps / 4).
350
(Rabs (f1 x / (f2 x * f2 (x + h))) * Rabs ((f2 (x + h) - f2 x) / h - l2) <
353
(Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h))) * Rabs (f2 (x + h) - f2 x) <
356
apply Rlt_4; assumption.
357
rewrite <- Rabs_mult.
358
apply (maj_term4 x h eps l2 alp_f2 alp_f2c eps_f2 f1 f2); try assumption.
359
apply H2; assumption.
360
apply Rmin_2; assumption.
361
rewrite <- Rabs_mult.
362
apply (maj_term3 x h eps l2 alp_f2 eps_f2 alp_f2d f1 f2); try assumption.
363
apply H2; assumption.
364
apply Rmin_2; assumption.
366
unfold Rdiv in |- *; repeat rewrite Rmult_0_r || rewrite Rmult_0_l.
367
rewrite Rabs_R0; rewrite Rmult_0_l.
368
apply Rmult_lt_0_compat; [ assumption | apply Rinv_0_lt_compat; prove_sup ].
369
rewrite <- Rabs_mult.
370
apply (maj_term1 x h eps l1 alp_f2 eps_f2 alp_f1d f1 f2); try assumption.
371
apply H2; assumption.
372
apply Rmin_2; assumption.
373
right; symmetry in |- *; apply quadruple_var.
374
apply H2; assumption.
376
case (Req_dec a 0); intro.
377
rewrite H17; rewrite Rplus_0_r.
378
unfold Rminus in |- *; rewrite Rplus_opp_r; rewrite Rabs_R0.
380
unfold Rdiv, Rsqr in |- *.
381
repeat rewrite Rinv_mult_distr; try assumption.
382
repeat apply prod_neq_R0; try assumption.
383
red in |- *; intro H18; rewrite H18 in H6; elim (Rlt_irrefl _ H6).
384
apply Rinv_neq_0_compat; discrR.
385
apply Rinv_neq_0_compat; discrR.
386
apply Rinv_neq_0_compat; discrR.
387
apply Rinv_neq_0_compat; assumption.
388
apply Rinv_neq_0_compat; assumption.
394
apply prod_neq_R0; [ discrR | assumption ].
398
apply D_x_no_cond; assumption.
399
replace (x + a - x) with a; [ assumption | ring ].
400
repeat apply Rmin_pos.
401
apply (cond_pos eps_f2).
402
elim H3; intros; assumption.
403
apply (cond_pos alp_f1d).
404
apply (cond_pos alp_f2d).
405
elim H13; intros; assumption.
406
change (0 < Rabs (Rsqr (f2 x) * f2 x * eps / (8 * f1 x * l2))) in |- *.
408
unfold Rsqr, Rdiv in |- *.
409
repeat rewrite Rinv_mult_distr; try assumption || discrR.
410
repeat apply prod_neq_R0; try assumption.
411
red in |- *; intro H13; rewrite H13 in H6; elim (Rlt_irrefl _ H6).
412
apply Rinv_neq_0_compat; discrR.
413
apply Rinv_neq_0_compat; discrR.
414
apply Rinv_neq_0_compat; discrR.
415
apply Rinv_neq_0_compat; assumption.
416
apply Rinv_neq_0_compat; assumption.
417
apply prod_neq_R0; [ discrR | assumption ].
418
red in |- *; intro H11; rewrite H11 in H6; elim (Rlt_irrefl _ H6).
419
apply Rinv_neq_0_compat; discrR.
420
apply Rinv_neq_0_compat; discrR.
421
apply Rinv_neq_0_compat; discrR.
422
apply Rinv_neq_0_compat; assumption.
423
(***********************************)
425
(* (f1 x)<>0 l1<>0 l2=0 *)
426
(***********************************)
427
case (Req_dec l2 0); intro.
428
assert (H11 := derivable_continuous_pt _ _ X).
429
unfold continuity_pt in H11.
430
unfold continue_in in H11.
431
unfold limit1_in in H11.
432
unfold limit_in in H11.
435
unfold R_dist in H11.
436
elim (H11 (Rabs (eps * Rsqr (f2 x) / (8 * l1)))).
437
clear H11; intros alp_f2t2 H11.
438
elim (H0 (Rabs (Rsqr (f2 x) * eps / (8 * f1 x)))).
440
cut (0 < Rmin (Rmin eps_f2 alp_f2) (Rmin alp_f1d (Rmin alp_f2d alp_f2t2))).
444
(Rmin (Rmin eps_f2 alp_f2) (Rmin alp_f1d (Rmin alp_f2d alp_f2t2))) H13).
450
Rabs (f2 (x + a) - f2 x) < Rabs (eps * Rsqr (f2 x) / (8 * l1))).
452
assert (H17 := Rlt_le_trans _ _ _ H15 (Rmin_l _ _)).
453
assert (H18 := Rlt_le_trans _ _ _ H15 (Rmin_r _ _)).
454
assert (H19 := Rlt_le_trans _ _ _ H17 (Rmin_r _ _)).
455
assert (H20 := Rlt_le_trans _ _ _ H17 (Rmin_l _ _)).
456
assert (H21 := Rlt_le_trans _ _ _ H18 (Rmin_r _ _)).
457
assert (H22 := Rlt_le_trans _ _ _ H18 (Rmin_l _ _)).
458
assert (H23 := Rlt_le_trans _ _ _ H21 (Rmin_l _ _)).
459
assert (H24 := Rlt_le_trans _ _ _ H21 (Rmin_r _ _)).
460
clear H15 H17 H18 H21.
461
rewrite formule; try assumption.
462
apply Rle_lt_trans with
463
(Rabs (/ f2 (x + h) * ((f1 (x + h) - f1 x) / h - l1)) +
464
Rabs (l1 / (f2 x * f2 (x + h)) * (f2 x - f2 (x + h))) +
465
Rabs (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) - f2 x) / h - l2)) +
466
Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h)) * (f2 (x + h) - f2 x))).
467
unfold Rminus in |- *.
469
(Rabs_Ropp (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) + - f2 x) / h + - l2)))
472
repeat rewrite Rabs_mult.
473
apply Rlt_le_trans with (eps / 4 + eps / 4 + eps / 4 + eps / 4).
474
cut (Rabs (/ f2 (x + h)) * Rabs ((f1 (x + h) - f1 x) / h - l1) < eps / 4).
475
cut (Rabs (l1 / (f2 x * f2 (x + h))) * Rabs (f2 x - f2 (x + h)) < eps / 4).
477
(Rabs (f1 x / (f2 x * f2 (x + h))) * Rabs ((f2 (x + h) - f2 x) / h - l2) <
480
(Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h))) * Rabs (f2 (x + h) - f2 x) <
483
apply Rlt_4; assumption.
485
unfold Rdiv in |- *; repeat rewrite Rmult_0_r || rewrite Rmult_0_l.
486
rewrite Rabs_R0; rewrite Rmult_0_l.
487
apply Rmult_lt_0_compat; [ assumption | apply Rinv_0_lt_compat; prove_sup ].
488
rewrite <- Rabs_mult.
489
apply (maj_term3 x h eps l2 alp_f2 eps_f2 alp_f2d f1 f2); try assumption.
490
apply H2; assumption.
491
apply Rmin_2; assumption.
492
rewrite <- Rabs_mult.
493
apply (maj_term2 x h eps l1 alp_f2 alp_f2t2 eps_f2 f2); try assumption.
494
apply H2; assumption.
495
apply Rmin_2; assumption.
496
rewrite <- Rabs_mult.
497
apply (maj_term1 x h eps l1 alp_f2 eps_f2 alp_f1d f1 f2); try assumption.
498
apply H2; assumption.
499
apply Rmin_2; assumption.
500
right; symmetry in |- *; apply quadruple_var.
501
apply H2; assumption.
503
case (Req_dec a 0); intro.
504
rewrite H17; rewrite Rplus_0_r; unfold Rminus in |- *; rewrite Rplus_opp_r;
507
unfold Rdiv in |- *; rewrite Rinv_mult_distr; try discrR || assumption.
509
repeat apply prod_neq_R0;
511
(apply Rinv_neq_0_compat; assumption) ||
512
(apply Rinv_neq_0_compat; discrR) ||
513
(red in |- *; intro H18; rewrite H18 in H6; elim (Rlt_irrefl _ H6)).
517
apply D_x_no_cond; assumption.
518
replace (x + a - x) with a; [ assumption | ring ].
519
repeat apply Rmin_pos.
520
apply (cond_pos eps_f2).
521
elim H3; intros; assumption.
522
apply (cond_pos alp_f1d).
523
apply (cond_pos alp_f2d).
524
elim H11; intros; assumption.
526
unfold Rdiv, Rsqr in |- *; rewrite Rinv_mult_distr; try discrR || assumption.
527
repeat apply prod_neq_R0;
529
(apply Rinv_neq_0_compat; assumption) ||
530
(apply Rinv_neq_0_compat; discrR) ||
531
(red in |- *; intro H12; rewrite H12 in H6; elim (Rlt_irrefl _ H6)).
532
change (0 < Rabs (eps * Rsqr (f2 x) / (8 * l1))) in |- *.
534
unfold Rdiv, Rsqr in |- *; rewrite Rinv_mult_distr; try discrR || assumption.
535
repeat apply prod_neq_R0;
537
(apply Rinv_neq_0_compat; assumption) ||
538
(apply Rinv_neq_0_compat; discrR) ||
539
(red in |- *; intro H12; rewrite H12 in H6; elim (Rlt_irrefl _ H6)).
540
(***********************************)
542
(* (f1 x)<>0 l1<>0 l2<>0 *)
543
(***********************************)
544
elim (H0 (Rabs (Rsqr (f2 x) * eps / (8 * f1 x)))).
546
assert (H12 := derivable_continuous_pt _ _ X).
547
unfold continuity_pt in H12.
548
unfold continue_in in H12.
549
unfold limit1_in in H12.
550
unfold limit_in in H12.
553
unfold R_dist in H12.
554
elim (H12 (Rabs (Rsqr (f2 x) * f2 x * eps / (8 * f1 x * l2)))).
556
elim (H12 (Rabs (eps * Rsqr (f2 x) / (8 * l1)))).
560
Rmin (Rmin (Rmin eps_f2 alp_f2) (Rmin alp_f1d alp_f2d))
561
(Rmin alp_f2c alp_f2t2)).
565
(Rmin (Rmin (Rmin eps_f2 alp_f2) (Rmin alp_f1d alp_f2d))
566
(Rmin alp_f2c alp_f2t2)) H15).
569
assert (H18 := Rlt_le_trans _ _ _ H17 (Rmin_l _ _)).
570
assert (H19 := Rlt_le_trans _ _ _ H17 (Rmin_r _ _)).
571
assert (H20 := Rlt_le_trans _ _ _ H18 (Rmin_l _ _)).
572
assert (H21 := Rlt_le_trans _ _ _ H18 (Rmin_r _ _)).
573
assert (H22 := Rlt_le_trans _ _ _ H19 (Rmin_l _ _)).
574
assert (H23 := Rlt_le_trans _ _ _ H19 (Rmin_r _ _)).
575
assert (H24 := Rlt_le_trans _ _ _ H20 (Rmin_l _ _)).
576
assert (H25 := Rlt_le_trans _ _ _ H20 (Rmin_r _ _)).
577
assert (H26 := Rlt_le_trans _ _ _ H21 (Rmin_l _ _)).
578
assert (H27 := Rlt_le_trans _ _ _ H21 (Rmin_r _ _)).
579
clear H17 H18 H19 H20 H21.
583
Rabs (f2 (x + a) - f2 x) < Rabs (eps * Rsqr (f2 x) / (8 * l1))).
587
Rabs (f2 (x + a) - f2 x) <
588
Rabs (Rsqr (f2 x) * f2 x * eps / (8 * f1 x * l2))).
590
rewrite formule; try assumption.
591
apply Rle_lt_trans with
592
(Rabs (/ f2 (x + h) * ((f1 (x + h) - f1 x) / h - l1)) +
593
Rabs (l1 / (f2 x * f2 (x + h)) * (f2 x - f2 (x + h))) +
594
Rabs (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) - f2 x) / h - l2)) +
595
Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h)) * (f2 (x + h) - f2 x))).
596
unfold Rminus in |- *.
598
(Rabs_Ropp (f1 x / (f2 x * f2 (x + h)) * ((f2 (x + h) + - f2 x) / h + - l2)))
601
repeat rewrite Rabs_mult.
602
apply Rlt_le_trans with (eps / 4 + eps / 4 + eps / 4 + eps / 4).
603
cut (Rabs (/ f2 (x + h)) * Rabs ((f1 (x + h) - f1 x) / h - l1) < eps / 4).
604
cut (Rabs (l1 / (f2 x * f2 (x + h))) * Rabs (f2 x - f2 (x + h)) < eps / 4).
606
(Rabs (f1 x / (f2 x * f2 (x + h))) * Rabs ((f2 (x + h) - f2 x) / h - l2) <
609
(Rabs (l2 * f1 x / (Rsqr (f2 x) * f2 (x + h))) * Rabs (f2 (x + h) - f2 x) <
612
apply Rlt_4; assumption.
613
rewrite <- Rabs_mult.
614
apply (maj_term4 x h eps l2 alp_f2 alp_f2c eps_f2 f1 f2); try assumption.
615
apply H2; assumption.
616
apply Rmin_2; assumption.
617
rewrite <- Rabs_mult.
618
apply (maj_term3 x h eps l2 alp_f2 eps_f2 alp_f2d f1 f2); try assumption.
619
apply H2; assumption.
620
apply Rmin_2; assumption.
621
rewrite <- Rabs_mult.
622
apply (maj_term2 x h eps l1 alp_f2 alp_f2t2 eps_f2 f2); try assumption.
623
apply H2; assumption.
624
apply Rmin_2; assumption.
625
rewrite <- Rabs_mult.
626
apply (maj_term1 x h eps l1 alp_f2 eps_f2 alp_f1d f1 f2); try assumption.
627
apply H2; assumption.
628
apply Rmin_2; assumption.
629
right; symmetry in |- *; apply quadruple_var.
630
apply H2; assumption.
632
case (Req_dec a 0); intro.
633
rewrite H18; rewrite Rplus_0_r; unfold Rminus in |- *; rewrite Rplus_opp_r;
634
rewrite Rabs_R0; apply Rabs_pos_lt.
635
unfold Rdiv, Rsqr in |- *; rewrite Rinv_mult_distr.
636
repeat apply prod_neq_R0;
638
(apply Rinv_neq_0_compat; assumption) ||
639
(apply Rinv_neq_0_compat; discrR) ||
640
(red in |- *; intro H28; rewrite H28 in H6; elim (Rlt_irrefl _ H6)).
641
apply prod_neq_R0; [ discrR | assumption ].
642
apply prod_neq_R0; [ discrR | assumption ].
647
apply D_x_no_cond; assumption.
648
replace (x + a - x) with a; [ assumption | ring ].
650
case (Req_dec a 0); intro.
651
rewrite H18; rewrite Rplus_0_r; unfold Rminus in |- *; rewrite Rplus_opp_r;
652
rewrite Rabs_R0; apply Rabs_pos_lt.
653
unfold Rdiv, Rsqr in |- *; rewrite Rinv_mult_distr.
654
repeat apply prod_neq_R0;
656
(apply Rinv_neq_0_compat; assumption) ||
657
(apply Rinv_neq_0_compat; discrR) ||
658
(red in |- *; intro H28; rewrite H28 in H6; elim (Rlt_irrefl _ H6)).
664
unfold D_x, no_cond in |- *; split.
666
apply Rminus_not_eq_right.
667
replace (x + a - x) with a; [ assumption | ring ].
668
replace (x + a - x) with a; [ assumption | ring ].
669
repeat apply Rmin_pos.
670
apply (cond_pos eps_f2).
671
elim H3; intros; assumption.
672
apply (cond_pos alp_f1d).
673
apply (cond_pos alp_f2d).
674
elim H13; intros; assumption.
675
elim H14; intros; assumption.
676
change (0 < Rabs (eps * Rsqr (f2 x) / (8 * l1))) in |- *; apply Rabs_pos_lt.
677
unfold Rdiv, Rsqr in |- *; rewrite Rinv_mult_distr; try discrR || assumption.
678
repeat apply prod_neq_R0;
680
(apply Rinv_neq_0_compat; assumption) ||
681
(apply Rinv_neq_0_compat; discrR) ||
682
(red in |- *; intro H14; rewrite H14 in H6; elim (Rlt_irrefl _ H6)).
683
change (0 < Rabs (Rsqr (f2 x) * f2 x * eps / (8 * f1 x * l2))) in |- *;
685
unfold Rdiv, Rsqr in |- *; rewrite Rinv_mult_distr.
686
repeat apply prod_neq_R0;
688
(apply Rinv_neq_0_compat; assumption) ||
689
(apply Rinv_neq_0_compat; discrR) ||
690
(red in |- *; intro H13; rewrite H13 in H6; elim (Rlt_irrefl _ H6)).
691
apply prod_neq_R0; [ discrR | assumption ].
692
apply prod_neq_R0; [ discrR | assumption ].
695
unfold Rdiv, Rsqr in |- *; rewrite Rinv_mult_distr;
696
[ idtac | discrR | assumption ].
697
repeat apply prod_neq_R0;
699
(apply Rinv_neq_0_compat; assumption) ||
700
(apply Rinv_neq_0_compat; discrR) ||
701
(red in |- *; intro H11; rewrite H11 in H6; elim (Rlt_irrefl _ H6)).
704
apply Rmult_lt_reg_l with (Rabs (f2 (x + a))).
705
apply Rabs_pos_lt; apply H2.
706
apply Rlt_le_trans with (Rmin eps_f2 alp_f2).
709
rewrite <- Rinv_r_sym.
710
apply Rmult_lt_reg_l with (Rabs (f2 x)).
711
apply Rabs_pos_lt; assumption.
713
rewrite (Rmult_comm (Rabs (f2 x))).
714
repeat rewrite Rmult_assoc.
715
rewrite <- Rinv_l_sym.
717
apply Rmult_lt_reg_l with (/ 2).
718
apply Rinv_0_lt_compat; prove_sup0.
719
repeat rewrite (Rmult_comm (/ 2)).
720
repeat rewrite Rmult_assoc.
721
rewrite <- Rinv_r_sym.
723
unfold Rdiv in H5; apply H5.
724
replace (x + a - x) with a.
725
assert (H7 := Rlt_le_trans _ _ _ H6 (Rmin_r _ _)); assumption.
728
apply Rabs_no_R0; assumption.
729
apply Rabs_no_R0; apply H2.
730
assert (H7 := Rlt_le_trans _ _ _ H6 (Rmin_l _ _)); assumption.
732
assert (H6 := H4 a H5).
733
rewrite <- (Rabs_Ropp (f2 a - f2 x)) in H6.
734
rewrite Ropp_minus_distr in H6.
735
assert (H7 := Rle_lt_trans _ _ _ (Rabs_triang_inv _ _) H6).
736
apply Rplus_lt_reg_r with (- Rabs (f2 a) + Rabs (f2 x) / 2).
738
rewrite <- double_var.
739
do 2 rewrite (Rplus_comm (- Rabs (f2 a))).
740
rewrite Rplus_assoc; rewrite Rplus_opp_l; rewrite Rplus_0_r.
741
unfold Rminus in H7; assumption.
743
case (Req_dec x x0); intro.
744
rewrite <- H5; unfold Rminus in |- *; rewrite Rplus_opp_r; rewrite Rabs_R0;
745
unfold Rdiv in |- *; apply Rmult_lt_0_compat;
746
[ apply Rabs_pos_lt; assumption | apply Rinv_0_lt_compat; prove_sup0 ].
750
unfold D_x, no_cond in |- *; split.
756
Lemma derivable_pt_div :
757
forall (f1 f2:R -> R) (x:R),
759
derivable_pt f2 x -> f2 x <> 0 -> derivable_pt (f1 / f2) x.
761
unfold derivable_pt in |- *.
762
intros f1 f2 x X X0 H.
765
exists ((x0 * f2 x - x1 * f1 x) / Rsqr (f2 x)).
766
apply derivable_pt_lim_div; assumption.
769
Lemma derivable_div :
772
derivable f2 -> (forall x:R, f2 x <> 0) -> derivable (f1 / f2).
774
unfold derivable in |- *; intros f1 f2 X X0 H x.
775
apply (derivable_pt_div _ _ _ (X x) (X0 x) (H x)).
778
Lemma derive_pt_div :
779
forall (f1 f2:R -> R) (x:R) (pr1:derivable_pt f1 x)
780
(pr2:derivable_pt f2 x) (na:f2 x <> 0),
781
derive_pt (f1 / f2) x (derivable_pt_div _ _ _ pr1 pr2 na) =
782
(derive_pt f1 x pr1 * f2 x - derive_pt f2 x pr2 * f1 x) / Rsqr (f2 x).
785
assert (H := derivable_derive f1 x pr1).
786
assert (H0 := derivable_derive f2 x pr2).
788
(H1 := derivable_derive (f1 / f2)%F x (derivable_pt_div _ _ _ pr1 pr2 na)).
789
elim H; clear H; intros l1 H.
790
elim H0; clear H0; intros l2 H0.
791
elim H1; clear H1; intros l H1.
792
rewrite H; rewrite H0; apply derive_pt_eq_0.
793
assert (H3 := proj2_sig pr1).
794
unfold derive_pt in H; rewrite H in H3.
795
assert (H4 := proj2_sig pr2).
796
unfold derive_pt in H0; rewrite H0 in H4.
797
apply derivable_pt_lim_div; assumption.