reserve a, b, r, s for Real;

theorem Th21:
  for X being interval Subset of REAL st X is not bounded_below &
  X is bounded_above & upper_bound X in X holds X = left_closed_halfline(
  upper_bound X)
proof
  let X be interval Subset of REAL such that
A1: X is not bounded_below and
A2: X is bounded_above and
A3: upper_bound X in X;
  thus X c= left_closed_halfline(upper_bound X) by A2,Th20;
  let x be object;
  assume
A4: x in left_closed_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 and
A6: x > r by XXREAL_2:def 2;
  reconsider r as Real by A5;
  x <= upper_bound X by A4,XXREAL_1:234;
  then
A7: x in [.r,upper_bound X.] by A6,XXREAL_1:1;
  [.r,upper_bound X.] c= X by A3,A5,XXREAL_2:def 12;
  hence thesis by A7;
end;
