(** The other components of ggcd are indeed the correct factors. *)

Ltac destr_pggcdn IHn :=
 match goal with |- context [ ggcdn _ ?x ?y ] =>
  generalize (IHn x y); destruct ggcdn as (?g,(?u,?v)); simpl
 end.

Lemma gcd_greatest : forall a b p, (p|a) -> (p|b) -> (p|gcd a b).