reserve X for set, x,y,z for object,
  k,l,n for Nat,
  r for Real;
reserve i,i0,i1,i2,i3,i4,i5,i8,i9,j for Integer;

theorem Th24:
  r <= i1 & i1 < r + 1 & r <= i2 & i2 < r + 1 implies i1 = i2
proof
  assume that
A1: r <= i1 and
A2: i1 < r + 1 and
A3: r <= i2 and
A4: i2 < r + 1;
  i2 = i1 + (i2 - i1);
  then consider i0 such that
A5: i2 = i1 + i0;
A6: now
    assume that
A7: i0 < 0 and
    i1 <> i2;
    i0 <= - 1 by A7,Th8;
    then i1 + i0 < r + 1 + (- 1) by A2,XREAL_1:8;
    hence contradiction by A3,A5;
  end;
A8: now
    assume that
A9: 0 < i0 and
    i1 <> i2;
    1 <= i0 by A9,Lm4;
    hence contradiction by A1,A4,A5,XREAL_1:7;
  end;
  i0 = 0 implies i2 = i1 by A5;
  hence thesis by A6,A8;
end;
