(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *   INRIA, CNRS and contributors - Copyright 1999-2018       *)
(* <O___,, *       (see CREDITS file for the list of authors)           *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
(*i Due to L.Thery i*)
(************************************************************)
(* Definitions of log and Rpower : R->R->R; main properties *)
(************************************************************)
Local Open Scope R_scope.
(******************************************************************)
(** *                     Properties of  Exp                      *)
(******************************************************************)
(* Definition of log R+* -> R *)
Definition Rln (y:posreal) : R :=
let (a,_) := ln_exists (pos y) (cond_pos y) in a.
(* Extension on R *)
Definition ln (x:R) : R :=
match Rlt_dec 0 x with
| left a => Rln (mkposreal x a)
| right a => 0
end.
(******************************************************************)
(** *                     Properties of  Ln                       *)
(******************************************************************)
(******************************************************************)
(** *                     Definition of  Rpower                   *)
(******************************************************************)
Definition Rpower (x y:R) := exp (y * ln x).
Local Infix "^R" := Rpower (at level 30, right associativity) : R_scope.
(******************************************************************)
(** *                     Properties of  Rpower                   *)
(******************************************************************)
(** Note: [Rpower] is prolongated to [1] on negative real numbers and it thus does not extend integer power. The next two lemmas, which hold for integer power, accidentally hold on negative real numbers as a side effect of the default value taken on negative real numbers. Contrastingly, the lemmas that do not hold for the integer power of a negative number are stated for [Rpower] on the positive numbers only (even if they accidentally hold due to the default value of [Rpower] on the negative side, as it is the case for [Rpower_O]). *)
(*****************************************)
(** * Differentiability of Ln and Rpower *)
(*****************************************)
(* added later. *)
intros x y z x0 y0; unfold Rpower.
rewrite <- exp_plus, ln_mult, Rmult_plus_distr_l; auto.
Qed.

Lemma Rle_Rpower_l a b c: 0 <= c -> 0 < a <= b -> a ^R c <= b ^R c.