
theorem MOD:
  for a be Integer, b be non zero Integer holds
    not b divides a iff (a mod b) + ((-a) mod b) = b
  proof
    let a be Integer, b be non zero Integer;
    A2: a mod b = a - (a div b)*b & (-a) mod b = -a - ((-a) div b)*b
      by INT_1:def 10;
    thus not b divides a implies (a mod b) + ((-a) mod b) = b
    proof
      assume not b divides a; then
      (-b)*(-1) = (-b)*((a div b) + ((-a) div b)) by DIV
      .= (a - (a div b)*b) + (-a - ((-a) div b)*b);
      hence thesis by A2;
    end;
    b divides a implies (a mod b) + (-a mod b) = 0
    proof
      assume b divides a; then
      a mod b = 0 & -a mod b = 0 by INT162,INT_2:10;
      hence thesis;
    end;
    hence thesis;
  end;
