(* This file was originally generated by why.
   It can be modified; only the generated parts will be overwritten. *)

Require Export Caduceus.
Require Export WhyFloats.

(*Why type*) Definition global: Set.
Admitted.

(*Why logic*) Definition my_log : R -> Z.



Lemma my_log_correct: forall s:R, forall n:Z, s= (Rpower 2 n) ->
           my_log(s)=n.
unfold Rpower; intros.
unfold my_log.
assert (0 < ln 2)%R.
rewrite <- ln_1.
apply ln_increasing; auto with real zarith.
apply IRNDD_eq; [exact bdouble | exact (Zpos xH) | exact O|idtac|idtac].
apply Rmult_le_reg_l with (ln 2); auto with real.
apply Rle_trans with (ln s);[idtac|right; field; auto with real].
apply exp_le_inv; auto with real.
rewrite Rmult_comm; rewrite <- H.
rewrite exp_ln; auto with real.
rewrite H; apply exp_pos.
apply Rmult_lt_reg_l with (ln 2); auto with real.
apply Rle_lt_trans with (ln s);[right; field; auto with real|idtac].
apply Rle_lt_trans with (ln 2 * n)%R.
apply exp_le_inv; auto with real.
rewrite Rmult_comm; rewrite <- H.
rewrite exp_ln; auto with real.
rewrite H; apply exp_pos.
apply Rmult_lt_compat_l; auto with real zarith.
Qed.

