
theorem
  for i be Integer holds (i|^2) mod 4 = 0 or (i|^2) mod 4 = 1
  proof
    let i be Integer;
    A1: i|^2 mod 4 = (i*i) mod 4 by NEWTON:81
    .= ((i mod 4)*(i mod 4)) mod 4 by NAT_D:67;
    i mod (3+1) = 0 or ... or i mod (3+1) = 3 by NUMBER03:11; then
    per cases;
    suppose
      i mod (3+1) = 0;
      hence thesis by A1;
    end;
    suppose
      i mod (3+1) = 1;
      hence thesis by A1;
    end;
    suppose
      i mod (3+1)= 2;
      hence thesis by A1;
    end;
    suppose
      i mod (3+1) = 3; then
      (i|^2) mod 4 = (2*4 + 1) mod 4 by A1
      .= 1 mod (1 + 3)
      .= 1;
      hence thesis;
    end;
  end;
