intro.
assert (divides a p).
apply prime_power with n;trivial.
generalize (power_divides_lemma1 r p H1);intro.
elim H5;intro q;intros.
rewrite H6 in H4.
rewrite <- H4;exists (q*k*(power b n));ring.
assert (divides b p).
elim H5;intro q;intros.
rewrite H6 in H4.
rewrite power_mult_lemma1 in H4.
assert ((power p n)=(power p (r+(n-r)))).
rewrite <- le_plus_minus;try (auto with arith).
rewrite H7 in H4;rewrite power_plus_lemma1 in H4.
assert ((power p r)<>O).
intro.
apply not_prime_zero.
assert (p=O).
apply power_zero with r;trivial.
rewrite H9 in H;trivial.
rewrite <- mult_assoc in H4;rewrite <- mult_assoc in H4;generalize (mult_lemma6 (k*(power b n)) ((power p (n-r))*(power q n)) (power p r) H8 H4);intro.
assert (divides (power p (n-r)) p).
apply power_divides_lemma1;apply minus_lt_lemma1;trivial.
apply prime_power with n;trivial.
apply gauss with k;try (apply rel_prime_sym;trivial).
rewrite H9;apply divides_mult;trivial.
elim H3;intros.
elim H;intros.
apply H9;apply divides_antisym;try (apply one_min_div).
apply H8;red;tauto.
Qed.

(** generalization of the theorem: if p is a prime number, 0 < r < n and gcd(p,k)=1 then the n-th root of p^r*k is not rationnal! *)
Theorem nth_root_irrat : forall (p k a b n r:nat),(is_prime p)->(rel_prime p k)->(0<r)->(r<n)->(b<>0)->((power p r)*k*(power b n) <> (power a n)).
intros.