(** This file is part of the Coquelicot formalization of real analysis in Coq: http://coquelicot.saclay.inria.fr/  Copyright (C) 2011-2015 Sylvie Boldo #<br /># Copyright (C) 2011-2015 Catherine Lelay #<br /># Copyright (C) 2011-2015 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. *)
(** This file contains the definition and properties of the set [R] # &#8746; {+ &infin;} &#8746; {- &infin;} # denoted by [Rbar]. We have defined: - coercions from [R] to [Rbar] and vice versa ([Finite] gives [R0] at infinity points) - an order [Rbar_lt] and [Rbar_le] - total operations: [Rbar_opp], [Rbar_plus], [Rbar_minus], [Rbar_inv], [Rbar_min] and [Rbar_abs] - lemmas about the decidability of the order and properties of the operations (such as [Rbar_plus_comm] or [Rbar_plus_lt_compat]) *)
Open Scope R_scope.
(** * Definitions *)
Inductive Rbar :=
| Finite : R -> Rbar
| p_infty : Rbar
| m_infty : Rbar.
Definition real (x : Rbar) :=
match x with
| Finite x => x
| _ => 0
end.
Coercion Finite : R >-> Rbar.
Coercion real : Rbar >-> R.
Definition is_finite (x : Rbar) := Finite (real x) = x.

Lemma is_finite_correct (x : Rbar) :
is_finite x <-> exists y : R, x = Finite y.