(* This code is copyrighted by its authors; it is distributed under  *)
(* the terms of the LGPL license (see LICENSE and description files) *)
(* Contribution to the Coq Library   V6.3 (July 1999)                    *)
(****************************************************************************)
(*                                                                          *)
(*                                                                          *)
(*                   Solange Coupet-Grimal & Line Jakubiec                  *)
(*                                                                          *)
(*                                                                          *)
(*              Laboratoire d'Informatique de Marseille                     *)
(*               CMI-Technopole de Chateau-Gombert                          *)
(*                   39, Rue F. Joliot Curie                                *)
(*                   13453 MARSEILLE Cedex 13                               *)
(*           e-mail:{Solange.Coupet,Line.Jakubiec}@lim.univ-mrs.fr          *)
(*                                                                          *)
(*                                                                          *)
(*                                Coq V5.10                                 *)
(*                              May 30th 1996                               *)
(*                                                                          *)
(****************************************************************************)
(*                               Lib_Mult.v                                 *)
(****************************************************************************)
Require Export Lib_Plus.
intros n; simpl in |- *; elim plus_n_O; auto with arith.
Qed.
Hint Resolve plus_mult.
simple induction n; auto with arith.
Qed.
auto with arith.
Qed.
intros.
apply le_trans with (a * d).
apply le_mult_cst; assumption.
elim mult_comm; elim mult_comm with d b.
apply le_mult_cst; assumption.
Qed.
Hint Resolve le_mult_csts.
simple induction n; simple induction m; auto with arith.
intros; simpl in |- *.
elim plus_n_O; auto with arith.
intro.
elim mult_n_O; elim mult_n_O; auto with arith.
intros; simpl in |- *; apply lt_n_S; auto with arith.
Qed.
Hint Resolve lt_mult_n_Sn.
intros.
elim H.
elim mult_comm; elim mult_comm with (S x) a.
apply lt_mult_n_Sn; assumption.
intros.
apply lt_trans with (a * m).
assumption.
elim mult_comm; elim mult_comm with (S m) a.
apply lt_mult_n_Sn; assumption.
Qed.
Hint Resolve lt_mult_cst.
intros.
apply le_lt_trans with (a * d).
apply le_mult_cst.
apply lt_le_weak; assumption.
elim mult_comm; elim mult_comm with d b.
apply lt_mult_cst.
assumption.
apply lt_O with c; auto with arith.
Qed.
Hint Resolve lt_mult_csts.
intros.
elim H; simpl in |- *; auto with arith.
Qed.
Hint Resolve pred_mult.
intros; apply le_lt_plus; auto with arith.
Qed.
intros.
rewrite (S_pred m 0); trivial with arith.
simpl in |- *; auto with arith.
Qed.
Hint Resolve le_mult_l.
intros n m; elim (mult_comm m n); auto with arith.
Qed.
Hint Resolve le_mult_r.
intros.
pattern n at 1 in |- *.
elim mult_1_r.
apply lt_mult_cst; auto with arith.
Qed.
Hint Resolve lt_mult.
intros.
apply lt_le_trans with (1 * n).
auto with arith.
simpl in |- *.
elim plus_n_O.
apply le_mult_r; auto with arith.
Qed.
simple induction n; simple induction m; simpl in |- *; auto with arith.
Qed.
intros x y H; elim H; clear H; intros H; rewrite H; simpl in |- *;
auto with arith.
Qed.
intros; elim mult_comm.
elim (mult_comm n p).
elim (mult_comm m p).
auto with arith.
Qed.
Hint Resolve mult_plus_distr_left.
intros.
rewrite (mult_comm p (n - m)); rewrite (mult_comm p n);
rewrite (mult_comm p m); auto with arith.
Qed.
Hint Resolve mult_minus_distr_left.
intros a b; elim a.
auto with arith.
intros n H_rec H.
right.
elim (plus_eq_zero (n * b) b); auto with arith.
simpl in H; elim plus_comm.
auto with arith.
Qed.
Hint Resolve mult_eq_zero.
simple induction n; simpl in |- *; auto with arith.
Qed.
Hint Resolve lt_mult_S_S.
intros n m H.
elim (mult_eq_zero (S n) m); auto with arith.
intro; absurd (S n = 0); auto with arith.
Qed.

Lemma mult_reg_l : forall a b p : nat, p * a = p * b -> p = 0 \/ a = b.