generalize (gcd_is_gcd a p);intro.
case (prime_gcd (gcd a p) p a H H1);intro;rewrite H2 in H1.
right;apply gauss with a;trivial.
red in H1;elim H1;intros.
red in H3;tauto.
Qed.

(** corollary: if p is prime and p | a^2 then p | a *)
Lemma prime_square : forall (p a:nat),(is_prime p)->(divides (square a) p)->(divides a p).
unfold square.