(* 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                                                     *)
Unset Standard Proposition Elimination Names.
(** Divisibility *)
Inductive divide (a b : Z) : Prop :=
divide_intro : forall q : Z, b = (q * a)%Z -> divide a b.
Notation "( x | y )" := (divide x y) (at level 0) : Z_scope.
Local Open Scope Z_scope.
(** Results *)
Hint Resolve divide_refl one_divide divide_0.
Hint Resolve divide_mult_left divide_mult_right.
Hint Resolve divide_plus divide_opp divide_opp_rev divide_opp_left
divide_opp_left_rev divide_minus divide_left divide_right divide_a_ab
divide_a_ba.
(** Trivial lemmas to do case analysis over [x:Z]. *)
(** If [a] divides [b] and [b] divides [a] then [a] is [b] or [-b]. *)
(** If [a] divides [b] and [b<>0] then [|a| <= |b|]. *)

Lemma divide_bounds : forall a b : Z, (a | b) -> b <> 0 -> Z.abs a <= Z.abs b.