(*********************************************************)
(** * Definition of arccosine based on arctangent        *)
(*********************************************************)
(** acos is defined by cases so that it is defined in the full range from -1 .. 1 *)
Definition acos x :=
if Rle_dec x (-1) then PI else
if Rle_dec 1 x then 0 else
PI/2 - atan (x/sqrt(1 - x²)).
(** ** Relation between arccosine, arcsine and arctangent *)

(* Specifications: *)
Lemma acos_atan : forall x, 0 < x ->
acos x = atan (sqrt (1 - x²) / x).
Lemma acos_asin : forall x, -1 <= x <= 1 ->
acos x = PI/2 - asin x.
Lemma asin_acos : forall x, -1 <= x <= 1 ->
asin x = PI/2 - acos x.