reserve d,i,j,k,m,n,p,q,x,k1,k2 for Nat,
  a,c,i1,i2,i3,i5 for Integer;

theorem
  k^2 < j & i mod j = k implies i^2 mod j = k^2
proof
  assume that
A1: k^2 < j and
A2: i mod j = k;
  consider n being Nat such that
A3: i = j*n + k and
  k < j by A1,A2,NAT_D:def 2;
  i^2 = j*((n*j*n) + (k*n) + (n*k)) + k^2 by A3;
  then i^2 mod j = k^2 mod j by NAT_D:21;
  hence thesis by A1,NAT_D:24;
end;
