(* 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                                                     *)
(** Relative primality *)
Definition rel_prime (a b : Z) : Prop := gcd a b 1.
(** Bezout's theorem: [a] and [b] are relatively prime if and only if there exist [u] and [v] such that [ua+vb = 1]. *)

(* Specifications: *)
Lemma rel_prime_bezout : forall a b : Z, rel_prime a b -> Bezout a b 1.
Lemma bezout_rel_prime : forall a b : Z, Bezout a b 1 -> rel_prime a b.
(** Gauss's theorem: if [a] divides [bc] and if [a] and [b] are relatively prime, then [a] divides [c]. *)
Theorem Gauss : forall a b c : Z, (a | b * c)%Z -> rel_prime a b -> (a | c)%Z.
(** If [a] is relatively prime to [b] and [c], then it is to [bc] *)
Lemma rel_prime_mult :
forall a b c : Z, rel_prime a b -> rel_prime a c -> rel_prime a (b * c).