reserve a,b,m,x,y,i1,i2,i3,i for Integer,
  k,p,q,n for Nat,
  c,c1,c2 for Element of NAT,
  z for set;

theorem Th13:
  for b st b>0 for a ex q,r being Integer st a=(b*q)+r & r>=0 & r< b
proof
  let b;
  assume
A1: b>0;
  let a be Integer;
  per cases;
  suppose
A2: a>=0;
A3: b in NAT by A1,INT_1:3;
    a in NAT by A2,INT_1:3;
    then consider k,t being Nat such that
A4: a=(b*k)+t & t<b by A1,A3,NAT_1:17;
    take k,t;
    thus thesis by A4;
  end;
  suppose
A5: a<0;
A6: b in NAT by A1,INT_1:3;
    -a in NAT by A5,INT_1:3;
    then consider k,t being Nat such that
A7: -a=(b*k)+t and
A8: t<b by A1,A6,NAT_1:17;
    per cases;
    suppose
A9:   t=0;
      take q=-k,r=0;
      a=b*(-k) by A7,A9;
      hence a=b*q+r;
      thus thesis by A1;
    end;
    suppose
A10:  t<>0;
      take q=-k-1,r=b-t;
      a=b*(-k-1)+(b-t) by A7;
      hence a=b*q+r;
      thus thesis by A8,A10,XREAL_1:44,50;
    end;
  end;
end;
