(************************************************************************)
(*         *      The Rocq Prover / The Rocq Development Team           *)
(*  v      *   INRIA, CNRS and contributors - Copyright 1999-2019       *)
(* <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)         *)
(************************************************************************)
(************************************************************************)
Local Open Scope ConstructiveReals.
(** Definition and properties of minimum and maximum.  WARNING: this file is experimental and likely to change in future releases. *)
(* Minimum *)
Definition CRmin {R : ConstructiveReals} (x y : CRcarrier R) : CRcarrier R
:= (x + y - CRabs _ (y - x)) * CR_of_Q _ (1#2).

(* Specifications: *)
Lemma CRmin_lt_r : forall {R : ConstructiveReals} (x y : CRcarrier R),
CRmin x y < y -> CRmin x y == x.