reserve x,y,z,r,s for ExtReal;
reserve A,B for ext-real-membered set;
reserve A,B for ext-real-membered set;

theorem Th78:
  for A being non left_end non right_end non empty interval
  ext-real-membered set holds A =].inf A,sup A.[
proof
  let A be non left_end non right_end non empty interval ext-real-membered
  set;
  let x;
  defpred P[ExtReal] means $1 in A & $1 < x;
  defpred Q[ExtReal] means $1 in A & $1 > x;
  thus x in A implies x in ].inf A,sup A.[
  proof
    assume
A1: x in A;
    then
A2: x <> sup A by Def6;
    x <= sup A by A1,Th4;
    then
A3: x < sup A by A2,XXREAL_0:1;
A4: x <> inf A by A1,Def5;
    inf A <= x by A1,Th3;
    then inf A < x by A4,XXREAL_0:1;
    hence thesis by A3,XXREAL_1:4;
  end;
  assume
A5: x in ].inf A,sup A.[;
  per cases;
  suppose
    not ex r st P[r];
    then x is LowerBound of A by Def2;
    then x <= inf A by Def4;
    hence thesis by A5,XXREAL_1:4;
  end;
  suppose
    not ex r st Q[r];
    then x is UpperBound of A by Def1;
    then sup A <= x by Def3;
    hence thesis by A5,XXREAL_1:4;
  end;
  suppose that
A6: ex r st P[r] and
A7: ex r st Q[r];
    consider r such that
A8: r in A and
A9: r < x by A6;
    consider s such that
A10: s in A and
A11: s > x by A7;
A12: x in [.r,s.] by A9,A11,XXREAL_1:1;
    [.r,s.] c= A by A8,A10,Def12;
    hence thesis by A12;
  end;
end;
