(* 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                                                     *)
(** divides. The division predicate.  @author Olga Caprotti and Martijn Oostdijk @version $Revision$ *)
(** * Division on nat *)
Definition Divides (n m : nat) : Prop := exists q : nat, m = n * q.

(* Specifications: *)
Lemma div_refl : forall a : nat, Divides a a.
Lemma div_trans :
forall p q r : nat, Divides p q -> Divides q r -> Divides p r.
Lemma div_antisym : forall a b : nat, Divides a b -> Divides b a -> a = b.
Lemma div_le1 : forall n d : nat, Divides d (S n) -> d <= S n.
Lemma div_le : forall d n : nat, 0 < n -> Divides d n -> d <= n.
Definition bDivides (d n : nat) :=
n = 0 \/ (exists q : nat, q < S n /\ n = d * q).