reserve k,m,n for Nat,
  i1,i2,i3 for Integer,
  e for set;
reserve i,k,m,n,p,x,y for Nat;

theorem Th5:
  i <> 0 & k <> 0 implies (n mod (i |^ k)) div (i |^ (k -'1)) < i
proof
  assume that
A1: i <> 0 and
A2: k <> 0;
A3: n mod (i |^ k) < (i |^ k) by A1,NAT_D:1,PREPOWER:6;
  reconsider n,i,k as Element of NAT by ORDINAL1:def 12;
  set I1 = i |^ (k -'1);
  set T = n mod (i |^ k);
  i |^ k = i*(i |^ (k -'1)) by A1,A2,PEPIN:26;
  then T mod I1 = n mod I1 by A1,Th3
    .= n - I1*(n div I1) by A1,NEWTON:63,PREPOWER:6;
  then T = I1*(T div I1) + (n - I1*(n div I1)) by A1,NAT_D:2,PREPOWER:6;
  then
A4: I1*(T div I1) + (n - I1*(n div I1)) < i*I1 by A1,A2,A3,PEPIN:26;
A5: I1 <> 0 by A1,PREPOWER:6;
  [\n/I1/] <= n/I1 by INT_1:def 6;
  then n div I1 = [\n/I1/] & (T div I1) + [\n/I1/] <= (T div I1) + n/I1 by
INT_1:def 9,XREAL_1:6;
  then
A6: (T div I1) + [\n/I1/] - [\n/I1/] <= (T div I1) + n/I1 - (n div I1) by
XREAL_1:9;
  I1 > 0 by A1,PREPOWER:6;
  then (I1*(T div I1) + n - I1*(n div I1))/I1 < i*I1/I1 by A4,XREAL_1:74;
  then I1*(T div I1)/I1 + n/I1 - I1*(n div I1)/I1 < i*I1/I1 by XCMPLX_1:124;
  then (T div I1) + n/I1 - I1*(n div I1)/I1 < i*I1/I1 by A5,XCMPLX_1:89;
  then (T div I1) + n/I1 - (n div I1) < i*I1/I1 by A5,XCMPLX_1:89;
  then (T div I1) + n/I1 - (n div I1) < i by A5,XCMPLX_1:89;
  hence thesis by A6,XXREAL_0:2;
end;
