(** * Greatest common divisor (gcd). *)
   
(** There is no unicity of the gcd; hence we define the
    predicate [gcd a b d] expressing that [d] is a gcd of 
    [a] and [b]. (We show later that the [gcd] is actually
    unique if we discard its sign.) *)

Inductive gcd (a b d : Z) : Prop :=
    gcd_intro :
      (d | a)%Z ->
      (d | b)%Z ->
      (forall x : Z, (x | a)%Z -> (x | b)%Z -> (x | d)%Z) -> gcd a b d.(** * Greatest common divisor (gcd). *)
   
(** There is no unicity of the gcd; hence we define the
    predicate [gcd a b d] expressing that [d] is a gcd of 
    [a] and [b]. (We show later that the [gcd] is actually
    unique if we discard its sign.) *)

Inductive gcd (a b d : Z) : Prop :=
    gcd_intro :
      (d | a)%Z ->
      (d | b)%Z ->
      (forall x : Z, (x | a)%Z -> (x | b)%Z -> (x | d)%Z) -> gcd a b d.

Lemma gcd_opp : forall a b d : Z, gcd a b d -> gcd b a (- d).