(* This program 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 2.1   *)
(* of the License, or (at your option) any later version.             *)
(*                                                                    *)
(* This program 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      *)
(* GNU General Public License for more details.                       *)
(*                                                                    *)
(* You should have received a copy of the GNU Lesser General Public   *)
(* License along with this program; if not, write to the Free         *)
(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *)
(* 02110-1301 USA                                                     *)
(** lemmas. Some nice lemmas, mostly about le, lt, and mult.  @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *)
Global Set Asymmetric Patterns.

(* Specifications: *)
Lemma predminus1 : forall n : nat, pred n = n - 1.
Lemma le_mult_l : forall p q : nat, p <= q -> forall r : nat, r * p <= r * q.
Lemma lt_plus_plus : forall n m p q : nat, n < m -> p < q -> n + p < m + q.
Lemma lt_mult_l :
forall p q : nat, p < q -> forall r : nat, S r * p < S r * q.
Lemma le_mult_r : forall p q : nat, p <= q -> forall r : nat, p * r <= q * r.
Lemma sqrbound : forall p q : nat, p * p <= p * q \/ q * q <= p * q.
Lemma le_n_nm : forall n m : nat, n <= n * S m.
Lemma le_n_mn : forall n m : nat, n <= S m * n.
Lemma le_n_nn : forall n : nat, n <= n * n.
Lemma lt_n_nm : forall n m : nat, 0 < n -> 1 < m -> n < n * m.
Lemma sqr_ascend : forall n : nat, n > 1 -> n < n * n.
Lemma witness_le : forall x y : nat, (exists q : nat, x + q = y) -> x <= y.
Lemma le_witness : forall x y : nat, x <= y -> exists q : nat, x + q = y.
Lemma lt_witness :
forall x y : nat, x < y -> exists q : nat, x + q = y /\ 0 < q.
Lemma le_le_mult : forall b a c d : nat, a <= b -> c <= d -> a * c <= b * d.
Lemma lt_lt_mult : forall a b c d : nat, a < b -> c < d -> a * c < b * d.
Lemma lt_n_nm_m_gt_1 : forall a b : nat, a < a * b -> b > 1.
Lemma n0n1_or_gt : forall n : nat, n = 0 \/ n = 1 \/ n > 1.
Lemma lt_multpred_pp : forall p : nat, p > 1 -> pred p * pred p < p * p.
Lemma le_diff0 : forall b a c : nat, a <= b -> a = b + c -> c = 0.
Lemma simpl_lt_mult_l : forall a b c : nat, a * b < a * c -> b < c.
Lemma simpl_le_mult_l : forall a b c : nat, 0 < a -> a * b <= a * c -> b <= c.
Lemma simpl_eq_mult_l : forall a b c : nat, 0 < a -> a * b = a * c -> b = c.
Lemma mult_ppq_p0q1 : forall p q : nat, p = p * q -> p = 0 \/ q = 1.
Lemma mult_pq1_p1q1 : forall p q : nat, p * q = 1 -> p = 1 /\ q = 1.
Lemma Zmult_ab0a0b0 : forall a b : Z, (a * b)%Z = 0%Z -> a = 0%Z \/ b = 0%Z.
Lemma Zle_minus : forall a b : Z, (b <= a)%Z -> (0 <= a - b)%Z.
Lemma Zopp_lt_gt_0 : forall x : Z, (x < 0)%Z -> (- x > 0)%Z.
Lemma Zlt_neq : forall x y : Z, (x < y)%Z -> x <> y.
Lemma Zgt_neq : forall x y : Z, (x > y)%Z -> x <> y.
Lemma S_inj : forall n m : nat, S n = S m -> n = m.
intros n m H; injection H; trivial.