
theorem Th5:
  for x,y be Integer st |.y.| <> 0 holds
  |.x mod y.| < |.y.|
  proof
    let x,y be Integer;
    assume A1: |.y.| <> 0;
    per cases;
    suppose A2: 0 < y;
      then x mod y < y by INT_1:58;
      then
      A4: |.x mod y.| < y by ABSVALUE:def 1,A2,INT_1:57;
      y <= |.y.| by ABSVALUE:4;
      hence |.x mod y.| < |.y.| by A4,XXREAL_0:2;
    end;
    suppose A5: y <= 0;
      A6:y <> 0 by A1,ABSVALUE:2; then
      A7: -(x mod y) < -y by Th4,A5;
      A8: (x mod y) <=0 by A5,Th3;
      |.x mod y.| = -(x mod y)
      proof
        per cases;
        suppose x mod y = 0;
          hence |.x mod y.| = -(x mod y) by ABSVALUE:2;
        end;
        suppose x mod y <> 0;
          hence |.x mod y.| = -(x mod y) by A8,ABSVALUE:def 1;
        end;
      end;
      hence |.x mod y.| < |.y.| by A7,A6,A5,ABSVALUE:def 1;
    end;
  end;
