reserve x,y,z for Real,
  R for real non empty RelStr,
  a,b for Element of R;

theorem Th8:
  for R being interval non empty RelStr, X being set holds ex_sup_of X,R
proof
  let R being interval non empty RelStr;
  let X being set;
  consider a,b being Real such that
A1: a <= b and
A2: the carrier of R = [.a,b.] by Def2;
  reconsider a,b as Real;
  reconsider Y = X /\ [.a,b.] as Subset of REAL;
  [.a,b.] is non empty closed_interval by A1,MEASURE5:14;
  then
A3: [.a,b.] is bounded_above by INTEGRA1:3;
  then
A4: Y is bounded_above by XBOOLE_1:17,XXREAL_2:43;
A5: X /\ [.a,b.] c= [.a,b.] by XBOOLE_1:17;
  ex a being Element of R st Y is_<=_than a & for b being Element of R st
  Y is_<=_than b holds a <<= b
  proof
    per cases;
    suppose
A6:   Y is empty;
      reconsider x = a as Element of R by A1,A2,XXREAL_1:1;
      take x;
      thus Y is_<=_than x by A6;
      let y be Element of R;
      x <= y by A2,XXREAL_1:1;
      hence thesis by Th3;
    end;
    suppose
A7:   Y is non empty;
      set c = the Element of Y;
A8:   c in Y by A7;
      reconsider c as Real;
A9:   a<=c by A5,A8,XXREAL_1:1;
      c <= upper_bound Y by A4,A7,SEQ_4:def 1;
      then
A10:  a <= upper_bound Y by A9,XXREAL_0:2;
      upper_bound [.a,b.] = b by A1,JORDAN5A:19;
      then upper_bound Y <= b by A3,A7,SEQ_4:48,XBOOLE_1:17;
      then reconsider x = upper_bound Y as Element of R by A2,A10,XXREAL_1:1;
A11:  for y being Element of R st Y is_<=_than y holds x <<= y
      proof
        let y be Element of R;
        assume
A12:    Y is_<=_than y;
        for z being Real st z in Y holds z <= y
        proof
          let z being Real;
          assume
A13:      z in Y;
          then reconsider z as Element of R by A2,XBOOLE_0:def 4;
          z <<= y by A12,A13;
          hence thesis by Th3;
        end;
        then upper_bound Y <= y by A7,SEQ_4:144;
        hence thesis by Th3;
      end;
      take x;
      for b being Element of R st b in Y holds b <<= x
      proof
        let b be Element of R;
        assume b in Y;
        then b <= upper_bound Y by A4,SEQ_4:def 1;
        hence thesis by Th3;
      end;
      hence thesis by A11;
    end;
  end;
  then ex_sup_of Y,R by YELLOW_0:15;
  hence thesis by A2,YELLOW_0:50;
end;
