(*****************************************************************)
(** * Using series definitions of cos and sin                    *)
(*****************************************************************)
Definition sin_ub (a:R) : R := sin_approx a 4.
Definition cos_lb (a:R) : R := cos_approx a 3.
Definition cos_ub (a:R) : R := cos_approx a 4.

(* Specifications: *)
Lemma sin_lb_gt_0 : forall a:R, 0 < a -> a <= PI / 2 -> 0 < sin_lb a.
Lemma SIN : forall a:R, 0 <= a -> a <= PI -> sin_lb a <= sin a <= sin_ub a.
Lemma COS :
forall a:R, - PI / 2 <= a -> a <= PI / 2 -> cos_lb a <= cos a <= cos_ub a.
(**********)
Lemma _PI2_RLT_0 : - (PI / 2) < 0.
Lemma PI4_RLT_PI2 : PI / 4 < PI / 2.
Lemma PI2_Rlt_PI : PI / 2 < PI.
(***************************************************)
(** * Increasing and decreasing of [cos] and [sin] *)
(***************************************************)
Theorem sin_gt_0 : forall x:R, 0 < x -> x < PI -> 0 < sin x.
Theorem cos_gt_0 : forall x:R, - (PI / 2) < x -> x < PI / 2 -> 0 < cos x.
Lemma sin_ge_0 : forall x:R, 0 <= x -> x <= PI -> 0 <= sin x.
Lemma cos_ge_0 : forall x:R, - (PI / 2) <= x -> x <= PI / 2 -> 0 <= cos x.
Lemma sin_le_0 : forall x:R, PI <= x -> x <= 2 * PI -> sin x <= 0.
Lemma cos_le_0 : forall x:R, PI / 2 <= x -> x <= 3 * (PI / 2) -> cos x <= 0.
Lemma sin_lt_0 : forall x:R, PI < x -> x < 2 * PI -> sin x < 0.
Lemma sin_lt_0_var : forall x:R, - PI < x -> x < 0 -> sin x < 0.
Lemma cos_lt_0 : forall x:R, PI / 2 < x -> x < 3 * (PI / 2) -> cos x < 0.
Lemma tan_gt_0 : forall x:R, 0 < x -> x < PI / 2 -> 0 < tan x.
Lemma tan_lt_0 : forall x:R, - (PI / 2) < x -> x < 0 -> tan x < 0.
Lemma cos_ge_0_3PI2 :
forall x:R, 3 * (PI / 2) <= x -> x <= 2 * PI -> 0 <= cos x.
Lemma form1 :
forall p q:R, cos p + cos q = 2 * cos ((p - q) / 2) * cos ((p + q) / 2).
Lemma form2 :
forall p q:R, cos p - cos q = -2 * sin ((p - q) / 2) * sin ((p + q) / 2).
Lemma form3 :
forall p q:R, sin p + sin q = 2 * cos ((p - q) / 2) * sin ((p + q) / 2).
Lemma form4 :
forall p q:R, sin p - sin q = 2 * cos ((p + q) / 2) * sin ((p - q) / 2).
Lemma sin_increasing_0 :
forall x y:R,
- (PI / 2) <= x ->
x <= PI / 2 -> - (PI / 2) <= y -> y <= PI / 2 -> sin x < sin y -> x < y.
Lemma sin_increasing_1 :
forall x y:R,
- (PI / 2) <= x ->
x <= PI / 2 -> - (PI / 2) <= y -> y <= PI / 2 -> x < y -> sin x < sin y.
Lemma sin_decreasing_0 :
forall x y:R,
x <= 3 * (PI / 2) ->
PI / 2 <= x -> y <= 3 * (PI / 2) -> PI / 2 <= y -> sin x < sin y -> y < x.
Lemma sin_decreasing_1 :
forall x y:R,
x <= 3 * (PI / 2) ->
PI / 2 <= x -> y <= 3 * (PI / 2) -> PI / 2 <= y -> x < y -> sin y < sin x.
Lemma sin_inj x y : -(PI/2)  <= x <= PI/2 -> -(PI/2) <= y <= PI/2 -> sin x = sin y -> x = y.
Lemma cos_increasing_0 :
forall x y:R,
PI <= x -> x <= 2 * PI -> PI <= y -> y <= 2 * PI -> cos x < cos y -> x < y.
Lemma cos_increasing_1 :
forall x y:R,
PI <= x -> x <= 2 * PI -> PI <= y -> y <= 2 * PI -> x < y -> cos x < cos y.
Lemma cos_decreasing_0 :
forall x y:R,
0 <= x -> x <= PI -> 0 <= y -> y <= PI -> cos x < cos y -> y < x.
Lemma cos_decreasing_1 :
forall x y:R,
0 <= x -> x <= PI -> 0 <= y -> y <= PI -> x < y -> cos y < cos x.
Lemma cos_inj x y : 0 <= x <= PI -> 0 <= y <= PI -> cos x = cos y -> x = y.
Lemma tan_diff :
forall x y:R,
cos x <> 0 -> cos y <> 0 -> tan x - tan y = sin (x - y) / (cos x * cos y).
Lemma tan_increasing_0 :
forall x y:R,
- (PI / 4) <= x ->
x <= PI / 4 -> - (PI / 4) <= y -> y <= PI / 4 -> tan x < tan y -> x < y.
Lemma tan_increasing_1 :
forall x y:R,
- (PI / 4) <= x ->
x <= PI / 4 -> - (PI / 4) <= y -> y <= PI / 4 -> x < y -> tan x < tan y.
Lemma sin_incr_0 :
forall x y:R,
- (PI / 2) <= x ->
x <= PI / 2 -> - (PI / 2) <= y -> y <= PI / 2 -> sin x <= sin y -> x <= y.
Lemma sin_incr_1 :
forall x y:R,
- (PI / 2) <= x ->
x <= PI / 2 -> - (PI / 2) <= y -> y <= PI / 2 -> x <= y -> sin x <= sin y.
Lemma sin_decr_0 :
forall x y:R,
x <= 3 * (PI / 2) ->
PI / 2 <= x ->
y <= 3 * (PI / 2) -> PI / 2 <= y -> sin x <= sin y -> y <= x.
Lemma sin_decr_1 :
forall x y:R,
x <= 3 * (PI / 2) ->
PI / 2 <= x ->
y <= 3 * (PI / 2) -> PI / 2 <= y -> x <= y -> sin y <= sin x.
Lemma cos_incr_0 :
forall x y:R,
PI <= x ->
x <= 2 * PI -> PI <= y -> y <= 2 * PI -> cos x <= cos y -> x <= y.
Lemma cos_incr_1 :
forall x y:R,
PI <= x ->
x <= 2 * PI -> PI <= y -> y <= 2 * PI -> x <= y -> cos x <= cos y.
Lemma cos_decr_0 :
forall x y:R,
0 <= x -> x <= PI -> 0 <= y -> y <= PI -> cos x <= cos y -> y <= x.
Lemma cos_decr_1 :
forall x y:R,
0 <= x -> x <= PI -> 0 <= y -> y <= PI -> x <= y -> cos y <= cos x.
Lemma tan_incr_0 :
forall x y:R,
- (PI / 4) <= x ->
x <= PI / 4 -> - (PI / 4) <= y -> y <= PI / 4 -> tan x <= tan y -> x <= y.
Lemma tan_incr_1 :
forall x y:R,
- (PI / 4) <= x ->
x <= PI / 4 -> - (PI / 4) <= y -> y <= PI / 4 -> x <= y -> tan x <= tan y.
(**********)
Lemma sin_eq_0_1 : forall x:R, (exists k : Z, x = IZR k * PI) -> sin x = 0.
Lemma sin_eq_0_0 (x:R) : sin x = 0 ->  exists k : Z, x = IZR k * PI.
Lemma cos_eq_0_0 (x:R) :
cos x = 0 ->  exists k : Z, x = IZR k * PI + PI / 2.
Lemma cos_eq_0_1 (x:R) :
(exists k : Z, x = IZR k * PI + PI / 2) -> cos x = 0.
Lemma sin_eq_O_2PI_0 (x:R) :
0 <= x -> x <= 2 * PI -> sin x = 0 ->
x = 0 \/ x = PI \/ x = 2 * PI.
Lemma sin_eq_O_2PI_1 (x:R) :
0 <= x -> x <= 2 * PI ->
x = 0 \/ x = PI \/ x = 2 * PI -> sin x = 0.
Lemma cos_eq_0_2PI_0 (x:R) :
0 <= x -> x <= 2 * PI -> cos x = 0 ->
x = PI / 2 \/ x = 3 * (PI / 2).
Lemma cos_eq_0_2PI_1 (x:R) :
0 <= x -> x <= 2 * PI ->
x = PI / 2 \/ x = 3 * (PI / 2) -> cos x = 0.