(** * Greatest common divisor. *)

Definition common_div (x y : Z) (d : nat) :=
  Divides d (Zabs_nat x) /\ Divides d (Zabs_nat y).Definition gcd (x y : Z) (d : nat) :=
  common_div x y d /\ (forall e : nat, common_div x y e -> e <= d).

Lemma gcd_lincomb_nat : forall x y d : nat, x > 0 -> gcd (Z_of_nat x) (Z_of_nat y) d -> LinComb (Z_of_nat d) (Z_of_nat x) (Z_of_nat y).