reserve a, b, r, s for Real;

theorem Th23:
  for X being non empty interval Subset of REAL st X is not
  bounded_below & X is bounded_above & not upper_bound X in X holds X =
  left_open_halfline(upper_bound X)
proof
  let X be non empty interval Subset of REAL such that
A1: X is not bounded_below and
A2: X is bounded_above and
A3: not upper_bound X in X;
  thus X c= left_open_halfline(upper_bound X) by A2,A3,Th22;
  let x be object;
  assume
A4: x in left_open_halfline(upper_bound X);
  then reconsider x as Real;
  x is not LowerBound of X by A1;
  then consider r being ExtReal such that
A5: r in X & x > r by XXREAL_2:def 2;
  reconsider r as Real by A5;
  x < upper_bound X by A4,XXREAL_1:233;
  then x - x < upper_bound X - x by XREAL_1:14;
  then consider s such that
A6: s in X & upper_bound X - (upper_bound X - x) < s by A2,SEQ_4:def 1;
  [.r,s.] c= X & x in [.r,s.] by A5,A6,XXREAL_1:1,XXREAL_2:def 12;
  hence thesis;
end;
