reserve i,j,n,n1,n2,m,k,u for Nat,
        r,r1,r2 for Real,
        x,y for Integer,
        a,b for non trivial Nat;

theorem Th39:
  k >0 & Py(a,k) divides Py(a,n) implies k divides n
proof
  set Pk=Py(a,k),Pn=Py(a,n);
  set r=n mod k,q = n div k;
  assume
A1: k>0 & Pk divides Pn;
  reconsider r,q as Element of NAT;
A2: r = n - q*k by A1,INT_1:def 10;
  then n = r+q*k;
  then sgn(n)*Py(a,|.n.|) = Px(a,|.r.|)*sgn(q*k)*Py(a,|.q*k.|) +
  sgn(r)*Py(a,|.r.|)*Px(a,|.q*k.|) by Th25;
  then
A3:Py(a,n) = Px(a,|.r.|)*(sgn(q*k)*Py(a,|.q*k.|)) +
  sgn(r)*Py(a,|.r.|)*Px(a,|.q*k.|) by Th23
    .= Px(a,|.r.|)*Py(a,q*k) +
  sgn(r)*Py(a,|.r.|)*Px(a,|.q*k.|) by Th23
    .= Px(a,r)*Py(a,q*k) + Py(a,r)*Px(a,q*k) by Th23;
A4: Pk divides Py(a,q*k) by Th37;
  Pk divides Px(a,r)*Py(a,q*k) by Th37,INT_2:2;
  then
A5: Pk divides Py(a,r)*Px(a,q*k) by INT_2:1,A1,A3;
A6: Pk,Px(a,k*q) are_coprime
  proof
    Pk gcd Px(a,k*q) divides Py(a,k) by INT_2:def 2;
    then
A7:   Py(a,k) gcd Px(a,k*q) divides Py(a,q*k) by A4, INT_2:9;
    Pk gcd Px(a,k*q) divides Px(a,k*q) by INT_2:def 2;
    then Pk gcd Px(a,k*q) divides Py(a,q*k) gcd Px(a,k*q) by A7,INT_2:22;
    then Pk gcd Px(a,k*q) divides 1 by Th26,INT_2:def 3;
    then Pk gcd Px(a,k*q) = 1 by INT_2:13;
    hence thesis by INT_2:def 3;
  end;
  r=0
  proof
    assume r<>0;
    then |.Pk.| <= |.Py(a,r).| by A6,INT_4:6,A5,INT_2:25;
    hence thesis by Th14,INT_1:58,A1;
  end;
  hence thesis by A2,INT_1:def 3;
end;
