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: Cos_plus.v 10710 2008-03-23 09:24:09Z herbelin $ i*)
12
Require Import Rfunctions.
13
Require Import SeqSeries.
14
Require Import Rtrigo_def.
15
Require Import Cos_rel.
17
Open Local Scope nat_scope.
18
Open Local Scope R_scope.
20
Definition Majxy (x y:R) (n:nat) : R :=
21
Rmax 1 (Rmax (Rabs x) (Rabs y)) ^ (4 * S n) / INR (fact n).
23
Lemma Majxy_cv_R0 : forall x y:R, Un_cv (Majxy x y) 0.
26
set (C := Rmax 1 (Rmax (Rabs x) (Rabs y))).
32
assert (H1 := cv_speed_pow_fact C0).
33
unfold Un_cv in H1; unfold R_dist in H1.
34
unfold Un_cv in |- *; unfold R_dist in |- *; intros.
37
| unfold Rdiv in |- *; apply Rmult_lt_0_compat;
38
[ assumption | apply Rinv_0_lt_compat; assumption ] ].
39
elim (H1 (eps / C0) H3); intros N0 H4.
41
replace (Majxy x y n) with (C0 ^ S n / INR (fact n)).
43
apply Rmult_lt_reg_l with (Rabs (/ C0)).
45
apply Rinv_neq_0_compat.
46
red in |- *; intro; rewrite H6 in H0; elim (Rlt_irrefl _ H0).
48
unfold Rminus in |- *; rewrite Rmult_plus_distr_l.
49
rewrite Ropp_0; rewrite Rmult_0_r.
50
unfold Rdiv in |- *; repeat rewrite <- Rmult_assoc.
51
rewrite <- Rinv_l_sym.
53
rewrite (Rabs_right (/ C0)).
54
rewrite <- (Rmult_comm eps).
55
replace (C0 ^ n * / INR (fact n) + 0) with (C0 ^ n * / INR (fact n) - 0);
57
unfold Rdiv in H4; apply H4; assumption.
58
apply Rle_ge; left; apply Rinv_0_lt_compat; assumption.
59
red in |- *; intro; rewrite H6 in H0; elim (Rlt_irrefl _ H0).
63
unfold C in |- *; reflexivity.
64
unfold C0 in |- *; apply pow_lt; assumption.
65
apply Rlt_le_trans with 1.
72
forall (x y:R) (N:nat),
73
(0 < N)%nat -> Rabs (Reste1 x y N) <= Majxy x y (pred N).
76
set (C := Rmax 1 (Rmax (Rabs x) (Rabs y))).
77
unfold Reste1 in |- *.
84
(-1) ^ S (l + k) / INR (fact (2 * S (l + k))) *
86
((-1) ^ (N - l) / INR (fact (2 * (N - l)))) *
87
y ^ (2 * (N - l))) (pred (N - k)))) (
94
(-1) ^ S (l + k) / INR (fact (2 * S (l + k))) *
95
x ^ (2 * S (l + k)) * ((-1) ^ (N - l) / INR (fact (2 * (N - l)))) *
96
y ^ (2 * (N - l))) (pred (N - k))) (pred N)).
103
((-1) ^ S (l + k) / INR (fact (2 * S (l + k))) *
104
x ^ (2 * S (l + k)) *
105
((-1) ^ (N - l) / INR (fact (2 * (N - l)))) *
106
y ^ (2 * (N - l)))) (pred (N - k))) (
113
(-1) ^ S (l + n) / INR (fact (2 * S (l + n))) * x ^ (2 * S (l + n)) *
114
((-1) ^ (N - l) / INR (fact (2 * (N - l)))) *
115
y ^ (2 * (N - l))) (pred (N - n))).
121
/ INR (fact (2 * S (l + k)) * fact (2 * (N - l))) *
122
C ^ (2 * S (N + k))) (pred (N - k))) (pred N)).
123
apply sum_Rle; intros.
124
apply sum_Rle; intros.
125
unfold Rdiv in |- *; repeat rewrite Rabs_mult.
126
do 2 rewrite pow_1_abs.
127
do 2 rewrite Rmult_1_l.
128
rewrite (Rabs_right (/ INR (fact (2 * S (n0 + n))))).
129
rewrite (Rabs_right (/ INR (fact (2 * (N - n0))))).
131
rewrite Rinv_mult_distr.
132
repeat rewrite Rmult_assoc.
133
apply Rmult_le_compat_l.
134
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
135
rewrite <- Rmult_assoc.
136
rewrite <- (Rmult_comm (/ INR (fact (2 * (N - n0))))).
138
apply Rmult_le_compat_l.
139
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
140
do 2 rewrite <- RPow_abs.
141
apply Rle_trans with (Rabs x ^ (2 * S (n0 + n)) * C ^ (2 * (N - n0))).
142
apply Rmult_le_compat_l.
143
apply pow_le; apply Rabs_pos.
148
apply Rle_trans with (Rmax (Rabs x) (Rabs y)); apply RmaxLess2.
149
apply Rle_trans with (C ^ (2 * S (n0 + n)) * C ^ (2 * (N - n0))).
150
do 2 rewrite <- (Rmult_comm (C ^ (2 * (N - n0)))).
151
apply Rmult_le_compat_l.
153
apply Rle_trans with 1.
155
unfold C in |- *; apply RmaxLess1.
159
unfold C in |- *; apply Rle_trans with (Rmax (Rabs x) (Rabs y)).
163
replace (2 * S (N + n))%nat with (2 * (N - n0) + 2 * S (n0 + n))%nat.
166
apply INR_eq; rewrite plus_INR; do 3 rewrite mult_INR.
168
repeat rewrite S_INR; do 2 rewrite plus_INR; ring.
169
apply le_trans with (pred (N - n)).
172
replace (S (pred (N - n))) with (N - n)%nat.
173
apply le_trans with N.
174
apply (fun p n m:nat => plus_le_reg_l n m p) with n.
175
rewrite <- le_plus_minus.
177
apply le_trans with (pred N).
181
apply S_pred with 0%nat.
182
apply plus_lt_reg_l with n.
183
rewrite <- le_plus_minus.
184
replace (n + 0)%nat with n; [ idtac | ring ].
185
apply le_lt_trans with (pred N).
187
apply lt_pred_n_n; assumption.
188
apply le_trans with (pred N).
191
apply INR_fact_neq_0.
192
apply INR_fact_neq_0.
193
apply Rle_ge; left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
194
apply Rle_ge; left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
200
/ INR (fact (2 * S (l + k)) * fact (2 * (N - l))) * C ^ (4 * N))
201
(pred (N - k))) (pred N)).
202
apply sum_Rle; intros.
203
apply sum_Rle; intros.
204
apply Rmult_le_compat_l.
205
left; apply Rinv_0_lt_compat.
206
rewrite mult_INR; apply Rmult_lt_0_compat; apply INR_fact_lt_0.
208
unfold C in |- *; apply RmaxLess1.
209
replace (4 * N)%nat with (2 * (2 * N))%nat; [ idtac | ring ].
210
apply (fun m n p:nat => mult_le_compat_l p n m).
211
replace (2 * N)%nat with (S (N + pred N)).
213
apply plus_le_compat_l; assumption.
214
rewrite pred_of_minus.
219
sum_f_R0 (fun l:nat => C ^ (4 * N) * Rsqr (/ INR (fact (S (N + k)))))
220
(pred (N - k))) (pred N)).
221
apply sum_Rle; intros.
222
apply sum_Rle; intros.
223
rewrite <- (Rmult_comm (C ^ (4 * N))).
224
apply Rmult_le_compat_l.
226
left; apply Rlt_le_trans with 1.
228
unfold C in |- *; apply RmaxLess1.
229
replace (/ INR (fact (2 * S (n0 + n)) * fact (2 * (N - n0)))) with
230
(Binomial.C (2 * S (N + n)) (2 * S (n0 + n)) / INR (fact (2 * S (N + n)))).
232
(Binomial.C (2 * S (N + n)) (S (N + n)) / INR (fact (2 * S (N + n)))).
234
do 2 rewrite <- (Rmult_comm (/ INR (fact (2 * S (N + n))))).
235
apply Rmult_le_compat_l.
236
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
240
unfold Rdiv in |- *; rewrite Rmult_comm.
241
unfold Binomial.C in |- *.
242
unfold Rdiv in |- *; repeat rewrite <- Rmult_assoc.
243
rewrite <- Rinv_l_sym.
245
replace (2 * S (N + n) - S (N + n))%nat with (S (N + n)).
246
rewrite Rinv_mult_distr.
247
unfold Rsqr in |- *; reflexivity.
248
apply INR_fact_neq_0.
249
apply INR_fact_neq_0.
251
apply INR_fact_neq_0.
252
unfold Rdiv in |- *; rewrite Rmult_comm.
253
unfold Binomial.C in |- *.
254
unfold Rdiv in |- *; repeat rewrite <- Rmult_assoc.
255
rewrite <- Rinv_l_sym.
257
replace (2 * S (N + n) - 2 * S (n0 + n))%nat with (2 * (N - n0))%nat.
261
apply INR_fact_neq_0.
263
(sum_f_R0 (fun k:nat => INR N / INR (fact (S N)) * C ^ (4 * N)) (pred N)).
264
apply sum_Rle; intros.
266
(scal_sum (fun _:nat => C ^ (4 * N)) (pred (N - n))
267
(Rsqr (/ INR (fact (S (N + n)))))).
269
rewrite <- Rmult_assoc.
270
do 2 rewrite <- (Rmult_comm (C ^ (4 * N))).
272
apply Rmult_le_compat_l.
274
left; apply Rlt_le_trans with 1.
276
unfold C in |- *; apply RmaxLess1.
277
apply Rle_trans with (Rsqr (/ INR (fact (S (N + n)))) * INR N).
278
apply Rmult_le_compat_l.
282
rewrite Rmult_comm; unfold Rdiv in |- *; apply Rmult_le_compat_l.
284
apply Rle_trans with (/ INR (fact (S (N + n)))).
285
pattern (/ INR (fact (S (N + n)))) at 2 in |- *; rewrite <- Rmult_1_r.
287
apply Rmult_le_compat_l.
288
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
289
apply Rmult_le_reg_l with (INR (fact (S (N + n)))).
291
rewrite <- Rinv_r_sym.
293
replace 1 with (INR 1).
296
apply INR_lt; apply INR_fact_lt_0.
298
apply INR_fact_neq_0.
299
apply Rmult_le_reg_l with (INR (fact (S (N + n)))).
301
rewrite <- Rinv_r_sym.
302
apply Rmult_le_reg_l with (INR (fact (S N))).
305
rewrite (Rmult_comm (INR (fact (S N)))).
307
rewrite <- Rinv_l_sym.
313
apply INR_fact_neq_0.
314
apply INR_fact_neq_0.
316
apply Rle_trans with (C ^ (4 * N) / INR (fact (pred N))).
317
rewrite <- (Rmult_comm (C ^ (4 * N))).
318
unfold Rdiv in |- *; rewrite Rmult_assoc; apply Rmult_le_compat_l.
320
left; apply Rlt_le_trans with 1.
322
unfold C in |- *; apply RmaxLess1.
323
cut (S (pred N) = N).
325
pattern N at 2 in |- *; rewrite <- H0.
326
do 2 rewrite fact_simpl.
328
repeat rewrite mult_INR.
329
repeat rewrite Rinv_mult_distr.
330
rewrite (Rmult_comm (/ INR (S N))).
331
repeat rewrite <- Rmult_assoc.
332
rewrite <- Rinv_r_sym.
334
pattern (/ INR (fact (pred N))) at 2 in |- *; rewrite <- Rmult_1_r.
336
apply Rmult_le_compat_l.
337
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
338
apply Rmult_le_reg_l with (INR (S N)).
339
apply lt_INR_0; apply lt_O_Sn.
340
rewrite <- Rmult_assoc; rewrite <- Rinv_r_sym.
341
rewrite Rmult_1_r; rewrite Rmult_1_l.
342
apply le_INR; apply le_n_Sn.
343
apply not_O_INR; discriminate.
345
red in |- *; intro; rewrite H1 in H; elim (lt_irrefl _ H).
347
red in |- *; intro; rewrite H1 in H; elim (lt_irrefl _ H).
348
apply INR_fact_neq_0.
349
apply not_O_INR; discriminate.
352
red in |- *; intro; rewrite H1 in H; elim (lt_irrefl _ H).
353
apply INR_fact_neq_0.
354
symmetry in |- *; apply S_pred with 0%nat; assumption.
356
unfold Majxy in |- *.
358
replace (S (pred N)) with N.
360
apply S_pred with 0%nat; assumption.
364
forall (x y:R) (N:nat), (0 < N)%nat -> Rabs (Reste2 x y N) <= Majxy x y N.
367
set (C := Rmax 1 (Rmax (Rabs x) (Rabs y))).
368
unfold Reste2 in |- *.
375
(-1) ^ S (l + k) / INR (fact (2 * S (l + k) + 1)) *
376
x ^ (2 * S (l + k) + 1) *
377
((-1) ^ (N - l) / INR (fact (2 * (N - l) + 1))) *
378
y ^ (2 * (N - l) + 1)) (pred (N - k)))) (
385
(-1) ^ S (l + k) / INR (fact (2 * S (l + k) + 1)) *
386
x ^ (2 * S (l + k) + 1) *
387
((-1) ^ (N - l) / INR (fact (2 * (N - l) + 1))) *
388
y ^ (2 * (N - l) + 1)) (pred (N - k))) (
396
((-1) ^ S (l + k) / INR (fact (2 * S (l + k) + 1)) *
397
x ^ (2 * S (l + k) + 1) *
398
((-1) ^ (N - l) / INR (fact (2 * (N - l) + 1))) *
399
y ^ (2 * (N - l) + 1))) (pred (N - k))) (
406
(-1) ^ S (l + n) / INR (fact (2 * S (l + n) + 1)) *
407
x ^ (2 * S (l + n) + 1) *
408
((-1) ^ (N - l) / INR (fact (2 * (N - l) + 1))) *
409
y ^ (2 * (N - l) + 1)) (pred (N - n))).
415
/ INR (fact (2 * S (l + k) + 1) * fact (2 * (N - l) + 1)) *
416
C ^ (2 * S (S (N + k)))) (pred (N - k))) (
418
apply sum_Rle; intros.
419
apply sum_Rle; intros.
420
unfold Rdiv in |- *; repeat rewrite Rabs_mult.
421
do 2 rewrite pow_1_abs.
422
do 2 rewrite Rmult_1_l.
423
rewrite (Rabs_right (/ INR (fact (2 * S (n0 + n) + 1)))).
424
rewrite (Rabs_right (/ INR (fact (2 * (N - n0) + 1)))).
426
rewrite Rinv_mult_distr.
427
repeat rewrite Rmult_assoc.
428
apply Rmult_le_compat_l.
429
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
430
rewrite <- Rmult_assoc.
431
rewrite <- (Rmult_comm (/ INR (fact (2 * (N - n0) + 1)))).
433
apply Rmult_le_compat_l.
434
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
435
do 2 rewrite <- RPow_abs.
436
apply Rle_trans with (Rabs x ^ (2 * S (n0 + n) + 1) * C ^ (2 * (N - n0) + 1)).
437
apply Rmult_le_compat_l.
438
apply pow_le; apply Rabs_pos.
443
apply Rle_trans with (Rmax (Rabs x) (Rabs y)); apply RmaxLess2.
444
apply Rle_trans with (C ^ (2 * S (n0 + n) + 1) * C ^ (2 * (N - n0) + 1)).
445
do 2 rewrite <- (Rmult_comm (C ^ (2 * (N - n0) + 1))).
446
apply Rmult_le_compat_l.
448
apply Rle_trans with 1.
450
unfold C in |- *; apply RmaxLess1.
454
unfold C in |- *; apply Rle_trans with (Rmax (Rabs x) (Rabs y)).
458
replace (2 * S (S (N + n)))%nat with
459
(2 * (N - n0) + 1 + (2 * S (n0 + n) + 1))%nat.
460
repeat rewrite pow_add.
463
apply INR_fact_neq_0.
464
apply INR_fact_neq_0.
465
apply Rle_ge; left; apply Rinv_0_lt_compat.
467
apply Rle_ge; left; apply Rinv_0_lt_compat.
474
/ INR (fact (2 * S (l + k) + 1) * fact (2 * (N - l) + 1)) *
475
C ^ (4 * S N)) (pred (N - k))) (pred N)).
476
apply sum_Rle; intros.
477
apply sum_Rle; intros.
478
apply Rmult_le_compat_l.
479
left; apply Rinv_0_lt_compat.
480
rewrite mult_INR; apply Rmult_lt_0_compat; apply INR_fact_lt_0.
482
unfold C in |- *; apply RmaxLess1.
483
replace (4 * S N)%nat with (2 * (2 * S N))%nat; [ idtac | ring ].
484
apply (fun m n p:nat => mult_le_compat_l p n m).
485
replace (2 * S N)%nat with (S (S (N + N))).
487
apply plus_le_compat_l.
488
apply le_trans with (pred N).
496
(fun l:nat => C ^ (4 * S N) * Rsqr (/ INR (fact (S (S (N + k))))))
497
(pred (N - k))) (pred N)).
498
apply sum_Rle; intros.
499
apply sum_Rle; intros.
500
rewrite <- (Rmult_comm (C ^ (4 * S N))).
501
apply Rmult_le_compat_l.
503
left; apply Rlt_le_trans with 1.
505
unfold C in |- *; apply RmaxLess1.
506
replace (/ INR (fact (2 * S (n0 + n) + 1) * fact (2 * (N - n0) + 1))) with
507
(Binomial.C (2 * S (S (N + n))) (2 * S (n0 + n) + 1) /
508
INR (fact (2 * S (S (N + n))))).
510
(Binomial.C (2 * S (S (N + n))) (S (S (N + n))) /
511
INR (fact (2 * S (S (N + n))))).
513
do 2 rewrite <- (Rmult_comm (/ INR (fact (2 * S (S (N + n)))))).
514
apply Rmult_le_compat_l.
515
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
517
apply le_trans with (2 * S (S (n0 + n)))%nat.
518
replace (2 * S (S (n0 + n)))%nat with (S (2 * S (n0 + n) + 1)).
523
unfold Rdiv in |- *; rewrite Rmult_comm.
524
unfold Binomial.C in |- *.
525
unfold Rdiv in |- *; repeat rewrite <- Rmult_assoc.
526
rewrite <- Rinv_l_sym.
528
replace (2 * S (S (N + n)) - S (S (N + n)))%nat with (S (S (N + n))).
529
rewrite Rinv_mult_distr.
530
unfold Rsqr in |- *; reflexivity.
531
apply INR_fact_neq_0.
532
apply INR_fact_neq_0.
534
apply INR_fact_neq_0.
535
unfold Rdiv in |- *; rewrite Rmult_comm.
536
unfold Binomial.C in |- *.
537
unfold Rdiv in |- *; repeat rewrite <- Rmult_assoc.
538
rewrite <- Rinv_l_sym.
540
replace (2 * S (S (N + n)) - (2 * S (n0 + n) + 1))%nat with
541
(2 * (N - n0) + 1)%nat.
545
apply INR_fact_neq_0.
547
(sum_f_R0 (fun k:nat => INR N / INR (fact (S (S N))) * C ^ (4 * S N))
549
apply sum_Rle; intros.
551
(scal_sum (fun _:nat => C ^ (4 * S N)) (pred (N - n))
552
(Rsqr (/ INR (fact (S (S (N + n))))))).
554
rewrite <- Rmult_assoc.
555
do 2 rewrite <- (Rmult_comm (C ^ (4 * S N))).
557
apply Rmult_le_compat_l.
559
left; apply Rlt_le_trans with 1.
561
unfold C in |- *; apply RmaxLess1.
562
apply Rle_trans with (Rsqr (/ INR (fact (S (S (N + n))))) * INR N).
563
apply Rmult_le_compat_l.
565
replace (S (pred (N - n))) with (N - n)%nat.
569
rewrite Rmult_comm; unfold Rdiv in |- *; apply Rmult_le_compat_l.
571
apply Rle_trans with (/ INR (fact (S (S (N + n))))).
572
pattern (/ INR (fact (S (S (N + n))))) at 2 in |- *; rewrite <- Rmult_1_r.
574
apply Rmult_le_compat_l.
575
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
576
apply Rmult_le_reg_l with (INR (fact (S (S (N + n))))).
578
rewrite <- Rinv_r_sym.
580
replace 1 with (INR 1).
583
apply INR_lt; apply INR_fact_lt_0.
585
apply INR_fact_neq_0.
586
apply Rmult_le_reg_l with (INR (fact (S (S (N + n))))).
588
rewrite <- Rinv_r_sym.
589
apply Rmult_le_reg_l with (INR (fact (S (S N)))).
592
rewrite (Rmult_comm (INR (fact (S (S N))))).
594
rewrite <- Rinv_l_sym.
599
apply INR_fact_neq_0.
600
apply INR_fact_neq_0.
602
apply Rle_trans with (C ^ (4 * S N) / INR (fact N)).
603
rewrite <- (Rmult_comm (C ^ (4 * S N))).
604
unfold Rdiv in |- *; rewrite Rmult_assoc; apply Rmult_le_compat_l.
606
left; apply Rlt_le_trans with 1.
608
unfold C in |- *; apply RmaxLess1.
609
cut (S (pred N) = N).
611
do 2 rewrite fact_simpl.
612
repeat rewrite mult_INR.
613
repeat rewrite Rinv_mult_distr.
615
(INR (S (S N)) * (/ INR (S (S N)) * (/ INR (S N) * / INR (fact N))) * INR N).
616
repeat rewrite Rmult_assoc.
617
rewrite (Rmult_comm (INR N)).
618
rewrite (Rmult_comm (INR (S (S N)))).
619
apply Rmult_le_compat_l.
620
repeat apply Rmult_le_pos.
621
left; apply Rinv_0_lt_compat; apply lt_INR_0; apply lt_O_Sn.
622
left; apply Rinv_0_lt_compat; apply lt_INR_0; apply lt_O_Sn.
623
left; apply Rinv_0_lt_compat.
627
apply le_trans with (S N); apply le_n_Sn.
628
repeat rewrite <- Rmult_assoc.
629
rewrite <- Rinv_r_sym.
631
apply Rle_trans with (/ INR (S N) * / INR (fact N) * INR (S N)).
632
repeat rewrite Rmult_assoc.
633
repeat apply Rmult_le_compat_l.
634
left; apply Rinv_0_lt_compat; apply lt_INR_0; apply lt_O_Sn.
635
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
636
apply le_INR; apply le_n_Sn.
637
rewrite (Rmult_comm (/ INR (S N))).
639
rewrite <- Rinv_l_sym.
640
rewrite Rmult_1_r; right; reflexivity.
641
apply not_O_INR; discriminate.
642
apply not_O_INR; discriminate.
643
apply not_O_INR; discriminate.
644
apply INR_fact_neq_0.
645
apply not_O_INR; discriminate.
646
apply prod_neq_R0; [ apply not_O_INR; discriminate | apply INR_fact_neq_0 ].
647
symmetry in |- *; apply S_pred with 0%nat; assumption.
649
unfold Majxy in |- *.
654
Lemma reste1_cv_R0 : forall x y:R, Un_cv (Reste1 x y) 0.
657
assert (H := Majxy_cv_R0 x y).
658
unfold Un_cv in H; unfold R_dist in H.
659
unfold Un_cv in |- *; unfold R_dist in |- *; intros.
660
elim (H eps H0); intros N0 H1.
661
exists (S N0); intros.
662
unfold Rminus in |- *; rewrite Ropp_0; rewrite Rplus_0_r.
663
apply Rle_lt_trans with (Rabs (Majxy x y (pred n))).
664
rewrite (Rabs_right (Majxy x y (pred n))).
666
apply lt_le_trans with (S N0).
670
unfold Majxy in |- *.
671
unfold Rdiv in |- *; apply Rmult_le_pos.
673
apply Rle_trans with 1.
676
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
677
replace (Majxy x y (pred n)) with (Majxy x y (pred n) - 0); [ idtac | ring ].
679
unfold ge in |- *; apply le_S_n.
680
replace (S (pred n)) with n.
682
apply S_pred with 0%nat.
683
apply lt_le_trans with (S N0); [ apply lt_O_Sn | assumption ].
686
Lemma reste2_cv_R0 : forall x y:R, Un_cv (Reste2 x y) 0.
689
assert (H := Majxy_cv_R0 x y).
690
unfold Un_cv in H; unfold R_dist in H.
691
unfold Un_cv in |- *; unfold R_dist in |- *; intros.
692
elim (H eps H0); intros N0 H1.
693
exists (S N0); intros.
694
unfold Rminus in |- *; rewrite Ropp_0; rewrite Rplus_0_r.
695
apply Rle_lt_trans with (Rabs (Majxy x y n)).
696
rewrite (Rabs_right (Majxy x y n)).
698
apply lt_le_trans with (S N0).
702
unfold Majxy in |- *.
703
unfold Rdiv in |- *; apply Rmult_le_pos.
705
apply Rle_trans with 1.
708
left; apply Rinv_0_lt_compat; apply INR_fact_lt_0.
709
replace (Majxy x y n) with (Majxy x y n - 0); [ idtac | ring ].
711
unfold ge in |- *; apply le_trans with (S N0).
716
Lemma reste_cv_R0 : forall x y:R, Un_cv (Reste x y) 0.
719
unfold Reste in |- *.
720
set (An := fun n:nat => Reste2 x y n).
721
set (Bn := fun n:nat => Reste1 x y (S n)).
723
(Un_cv (fun n:nat => An n - Bn n) (0 - 0) ->
724
Un_cv (fun N:nat => Reste2 x y N - Reste1 x y (S N)) 0).
729
replace (fun n:nat => Reste2 x y n) with (Reste2 x y).
733
assert (H0 := reste1_cv_R0 x y).
734
unfold Un_cv in H0; unfold R_dist in H0.
735
unfold Un_cv in |- *; unfold R_dist in |- *; intros.
736
elim (H0 eps H1); intros N0 H2.
739
unfold ge in |- *; apply le_trans with (S N0).
741
apply le_n_S; assumption.
742
unfold An, Bn in |- *.
744
replace 0 with (0 - 0); [ idtac | ring ].
748
Theorem cos_plus : forall x y:R, cos (x + y) = cos x * cos y - sin x * sin y.
751
cut (Un_cv (C1 x y) (cos x * cos y - sin x * sin y)).
752
cut (Un_cv (C1 x y) (cos (x + y))).
754
apply UL_sequence with (C1 x y); assumption.
756
unfold Un_cv in |- *; unfold R_dist in |- *.
758
assert (H0 := A1_cvg x).
759
assert (H1 := A1_cvg y).
760
assert (H2 := B1_cvg x).
761
assert (H3 := B1_cvg y).
762
assert (H4 := CV_mult _ _ _ _ H0 H1).
763
assert (H5 := CV_mult _ _ _ _ H2 H3).
764
assert (H6 := reste_cv_R0 x y).
765
unfold Un_cv in H4; unfold Un_cv in H5; unfold Un_cv in H6.
766
unfold R_dist in H4; unfold R_dist in H5; unfold R_dist in H6.
769
| unfold Rdiv in |- *; apply Rmult_lt_0_compat;
770
[ assumption | apply Rinv_0_lt_compat; prove_sup0 ] ].
771
elim (H4 (eps / 3) H7); intros N1 H8.
772
elim (H5 (eps / 3) H7); intros N2 H9.
773
elim (H6 (eps / 3) H7); intros N3 H10.
774
set (N := S (S (max (max N1 N2) N3))).
777
cut (n = S (pred n)).
779
rewrite <- cos_plus_form.
781
apply Rle_lt_trans with
782
(Rabs (A1 x n * A1 y n - cos x * cos y) +
783
Rabs (sin x * sin y - B1 x (pred n) * B1 y (pred n) + Reste x y (pred n))).
785
(A1 x n * A1 y n - B1 x (pred n) * B1 y (pred n) + Reste x y (pred n) -
786
(cos x * cos y - sin x * sin y)) with
787
(A1 x n * A1 y n - cos x * cos y +
788
(sin x * sin y - B1 x (pred n) * B1 y (pred n) + Reste x y (pred n)));
789
[ apply Rabs_triang | ring ].
790
replace eps with (eps / 3 + (eps / 3 + eps / 3)).
791
apply Rplus_lt_compat.
793
unfold ge in |- *; apply le_trans with N.
795
apply le_trans with (max N1 N2).
797
apply le_trans with (max (max N1 N2) N3).
799
apply le_trans with (S (max (max N1 N2) N3)); apply le_n_Sn.
801
apply Rle_lt_trans with
802
(Rabs (sin x * sin y - B1 x (pred n) * B1 y (pred n)) +
803
Rabs (Reste x y (pred n))).
805
apply Rplus_lt_compat.
806
rewrite <- Rabs_Ropp.
807
rewrite Ropp_minus_distr.
809
unfold ge in |- *; apply le_trans with (max N1 N2).
813
apply le_trans with N.
816
apply le_trans with (max (max N1 N2) N3).
820
replace (Reste x y (pred n)) with (Reste x y (pred n) - 0).
825
apply le_trans with N.
828
apply le_trans with (max (max N1 N2) N3).
833
pattern eps at 4 in |- *; replace eps with (3 * (eps / 3)).
836
rewrite <- Rmult_assoc.
837
apply Rinv_r_simpl_m.
839
apply lt_le_trans with (pred N).
840
unfold N in |- *; simpl in |- *; apply lt_O_Sn.
843
replace (S (pred N)) with N.
845
unfold N in |- *; simpl in |- *; reflexivity.
850
apply S_pred with 0%nat; assumption.
851
apply lt_le_trans with N; assumption.
852
unfold N in |- *; apply lt_O_Sn.