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