intros x y z; unfold Rmax.
destruct (Rle_dec y z);
destruct (Rle_dec x y);
destruct (Rle_dec x z);
destruct (Rle_dec y z) ; try intuition.
contradict n.
apply Rle_trans with y ; auto.
contradict r.
apply Rlt_not_le, Rlt_trans with y ; apply Rnot_le_lt ; auto.
Qed.
(** Order *)

(* Specifications: *)
Lemma Rmax_le_compat : forall a b c d, a <= b -> c <= d -> Rmax a c <= Rmax b d.
Lemma Rmax_opp_Rmin : forall a b, Rmax (-a) (-b) = - Rmin a b.
Lemma Rmin_opp_Rmax : forall a b, Rmin (-a) (-b) = - Rmax a b.
Lemma Rmax_mult : forall a b c, 0 <= c -> Rmax a b * c = Rmax (a * c) (b * c).
Lemma Rmax_le_Rplus : forall a b : R, 0 <= a -> 0 <= b -> Rmax a b <= a + b.
Lemma Rplus_le_Rmax : forall a b : R, a + b <= 2*Rmax a b.
Lemma Rmin_Rmax_l : forall a b, Rmin a b <= a <= Rmax a b.
Lemma Rmin_Rmax_r : forall a b, Rmin a b <= b <= Rmax a b.
Lemma Rmin_Rmax : forall a b, Rmin a b <= Rmax a b.
(** * Rabs *)
(** Rewritings *)
Lemma Rabs_div : forall a b : R, b <> 0 -> Rabs (a/b) = (Rabs a) / (Rabs b).
Lemma Rabs_eq_0 : forall x, Rabs x = 0 -> x = 0.
(** Order *)
Lemma Rabs_le_between : forall x y, (Rabs x <= y <-> -y <= x <= y).
Lemma Rabs_le_between' : forall x y z, Rabs (x - y) <= z <-> y-z <= x <= y+z.
Lemma Rabs_lt_between : forall x y, (Rabs x < y <-> -y < x < y).
Lemma Rabs_lt_between' : forall x y z, Rabs (x - y) < z <-> y-z < x < y+z.
Lemma Rabs_le_between_min_max : forall x y z, Rmin x y <= z <= Rmax x y -> Rabs (z - y) <= Rabs (x - y).
Lemma Rabs_le_between_Rmax : forall x m M,
m <= x <= M -> Rabs x <= Rmax M (-m).
Lemma Rabs_lt_between_Rmax : forall x m M,
m < x < M -> Rabs x < Rmax M (-m).
Lemma Rabs_maj2 : forall x, -x <= Rabs x.
(** * Req *)
Lemma Req_lt_aux : forall x y, (forall eps : posreal, Rabs (x - y) < eps) -> x = y.
Lemma Req_le_aux : forall x y, (forall eps : posreal, Rabs (x - y) <= eps) -> x = y.
(** * posreal *)
Lemma is_pos_div_2 (eps : posreal) : 0 < eps / 2.
Definition pos_div_2 (eps : posreal) := mkposreal _ (is_pos_div_2 eps).