reserve a,b,k,m,n,s for Nat;
reserve c,c1,c2,c3 for Complex;
reserve i,j,z for Integer;
reserve p for Prime;
reserve x for object;

theorem Th21:
  n is positive & p is prime & p divides n implies
    ex k,m be positive Nat st 0 < k & n = m * p|^k & m,p are_coprime
proof
  assume
A1: n is positive & p is prime & p divides n;
    then 1+1 <= p by NAT_1:13;
    then consider up be positive Nat such that
A2: n <= p|^up by LIOUVIL2:1;
    defpred P[Nat] means  p|^$1 divides n;
A3: for k being Nat st P[k] holds k <= up
    proof
      let k be Nat;
      assume P[k];
      then p|^k <= n by A1,NAT_D:7;
      then p|^k <= p|^up by A2,XXREAL_0:2;
      then p|^k < p|^up or p|^k = p|^up by XXREAL_0:1;
      hence thesis by A1,PREPOWER:93, PEPIN:30;
    end;
    p=p|^1;
    then
A4: ex k being Nat st P[k] by A1;
    consider k be Nat such that
A5: P[k] & for n being Nat st P[n]
    holds n <= k from NAT_1:sch 6(A3,A4);
    consider m be Nat such that
A6: n = (p|^k)*m by A5,NAT_D:def 3;
    P[1] by A1;
    then reconsider k,m as positive Nat by A5,A6,A1;
    take k,m;
    thus 0 < k & n = m * p|^k by A6;
    assume not m,p are_coprime;
    then m gcd p = p by PEPIN:2;
    then p divides m by NAT_D:def 5;
    then consider m1 be Nat such that
A7: m = p*m1 by NAT_D:def 3;
    p*(p|^k) = p |^(k+1) by NEWTON:6;
    then n = m1*(p|^(k+1)) by A6,A7;
    then p|^(k+1) divides n;
    then k+1 <= k by A5;
    hence thesis by NAT_1:13;
  end;
