(** This file is part of the Flocq formalization of floating-point arithmetic in Coq: http://flocq.gforge.inria.fr/  Copyright (C) 2010-2013 Sylvie Boldo #<br /># Copyright (C) 2010-2013 Guillaume Melquiond  This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the COPYING file for more details. *)
(** * Missing definitions/lemmas *)
Require Export Reals.
Require Export ZArith.
Require Export Fcore_Zaux.
Section Rmissing.

(* Specifications: *)
(** About R *)
Theorem Rle_0_minus :
forall x y, (x <= y)%R -> (0 <= y - x)%R.
Theorem Rabs_eq_Rabs :
forall x y : R,
Rabs x = Rabs y -> x = y \/ x = Ropp y.
Theorem Rabs_minus_le:
forall x y : R,
(0 <= y)%R -> (y <= 2*x)%R ->
(Rabs (x-y) <= x)%R.
Theorem Rplus_eq_reg_r :
forall r r1 r2 : R,
(r1 + r = r2 + r)%R -> (r1 = r2)%R.
Theorem Rplus_lt_reg_l :
forall r r1 r2 : R,
(r + r1 < r + r2)%R -> (r1 < r2)%R.
Theorem Rplus_lt_reg_r :
forall r r1 r2 : R,
(r1 + r < r2 + r)%R -> (r1 < r2)%R.
Theorem Rplus_le_reg_r :
forall r r1 r2 : R,
(r1 + r <= r2 + r)%R -> (r1 <= r2)%R.
Theorem Rmult_lt_reg_r :
forall r r1 r2 : R, (0 < r)%R ->
(r1 * r < r2 * r)%R -> (r1 < r2)%R.
Theorem Rmult_le_reg_r :
forall r r1 r2 : R, (0 < r)%R ->
(r1 * r <= r2 * r)%R -> (r1 <= r2)%R.
Theorem Rmult_lt_compat :
forall r1 r2 r3 r4,
(0 <= r1)%R -> (0 <= r3)%R -> (r1 < r2)%R -> (r3 < r4)%R ->
(r1 * r3 < r2 * r4)%R.
Theorem Rmult_eq_reg_r :
forall r r1 r2 : R, (r1 * r)%R = (r2 * r)%R ->
r <> 0%R -> r1 = r2.
Theorem Rmult_minus_distr_r :
forall r r1 r2 : R,
((r1 - r2) * r = r1 * r - r2 * r)%R.
Lemma Rmult_neq_reg_r: forall  r1 r2 r3:R, (r2 * r1 <> r3 * r1)%R -> r2 <> r3.
intros r1 r2 r3 H1 H2.
(** About R *)
Theorem Rle_0_minus :
forall x y, (x <= y)%R -> (0 <= y - x)%R.
Theorem Rabs_eq_Rabs :
forall x y : R,
Rabs x = Rabs y -> x = y \/ x = Ropp y.
Theorem Rabs_minus_le:
forall x y : R,
(0 <= y)%R -> (y <= 2*x)%R ->
(Rabs (x-y) <= x)%R.
Theorem Rplus_eq_reg_r :
forall r r1 r2 : R,
(r1 + r = r2 + r)%R -> (r1 = r2)%R.
Theorem Rplus_lt_reg_l :
forall r r1 r2 : R,
(r + r1 < r + r2)%R -> (r1 < r2)%R.
Theorem Rplus_lt_reg_r :
forall r r1 r2 : R,
(r1 + r < r2 + r)%R -> (r1 < r2)%R.
Theorem Rplus_le_reg_r :
forall r r1 r2 : R,
(r1 + r <= r2 + r)%R -> (r1 <= r2)%R.
Theorem Rmult_lt_reg_r :
forall r r1 r2 : R, (0 < r)%R ->
(r1 * r < r2 * r)%R -> (r1 < r2)%R.
Theorem Rmult_le_reg_r :
forall r r1 r2 : R, (0 < r)%R ->
(r1 * r <= r2 * r)%R -> (r1 <= r2)%R.
Theorem Rmult_lt_compat :
forall r1 r2 r3 r4,
(0 <= r1)%R -> (0 <= r3)%R -> (r1 < r2)%R -> (r3 < r4)%R ->
(r1 * r3 < r2 * r4)%R.
Theorem Rmult_eq_reg_r :
forall r r1 r2 : R, (r1 * r)%R = (r2 * r)%R ->
r <> 0%R -> r1 = r2.
Theorem Rmult_minus_distr_r :
forall r r1 r2 : R,
((r1 - r2) * r = r1 * r - r2 * r)%R.
Lemma Rmult_neq_reg_r: forall  r1 r2 r3:R, (r2 * r1 <> r3 * r1)%R -> r2 <> r3.
intros r1 r2 r3 H1 H2.