reserve a,b,p,k,l,m,n,s,h,i,j,t,i1,i2 for natural Number;

theorem
  n mod k = k - 1 implies (n+1) mod k = 0
proof
  per cases;
  suppose
    k <> 0;
    then k >= 1 by NAT_1:14;
    then reconsider K = k - 1 as Element of NAT by INT_1:3,XREAL_1:48;
A1: K + 1 = k - 0;
    assume n mod k = k-1;
    then (n+1) mod k = k mod k by A1,Th22;
    hence thesis by Th25;
  end;
  suppose
    k=0;
    hence thesis;
  end;
end;
