(**
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 describes basic missing facts about the standard library of reals and a few concerning ssreflect.seq. It also contains a definition of the [sign] function. *)

(** Tactic for changing the last argument of a property to an evar,
    in order to apply theorems modulo equality. *)

Ltac evar_last :=
  match goal with
  | |- ?f ?x =>
    let tx := type of x in
    let tx := eval simpl in tx in
    let tmp := fresh "tmp" in
    evar (tmp : tx) ;
    refine (@eq_ind tx tmp f _ x _) ;
    unfold tmp ; clear tmp
  end.

(* Specifications: *)
Lemma neq_succ_0 (n : nat) : S n <> 0.
Lemma sub_succ (n m : nat) : S n - S m = n - m.
Lemma sub_succ_l (n m : nat) : n <= m -> S m - n = S (m - n).
Lemma lt_neq (n m : nat) : n < m -> n <> m.
Lemma minus_0_le (n m : nat) : n <= m -> n - m = 0.
Lemma sub_succ_r (n m : nat) : n - S m = pred (n - m).
Lemma sub_add (n m : nat) : n <= m -> m - n + n = m.
Lemma le_pred_le_succ (n m : nat) : pred n <= m <-> n <= S m.
Lemma floor_ex : forall x : R, {n : Z | IZR n <= x < IZR n + 1}.