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
  (for r st inf A < r & r < sup A holds r in A) implies A is interval
proof
  assume
A1: for r st inf A < r & r < sup A holds r in A;
  let x,y such that
A2: x in A and
A3: y in A;
  let r;
  assume r in [.x,y.];
  then r in ].x,y.[ \/ {x,y} by XXREAL_1:29,128;
  then
A4: r in ].x,y.[ or r in {x,y} by XBOOLE_0:def 3;
  per cases by A4,TARSKI:def 2;
  suppose
    r = x;
    hence thesis by A2;
  end;
  suppose
    r = y;
    hence thesis by A3;
  end;
  suppose
A5: r in ].x,y.[;
    then
A6: r < y by XXREAL_1:4;
    y <= sup A by A3,Th4;
    then
A7: r < sup A by A6,XXREAL_0:2;
A8: x < r by A5,XXREAL_1:4;
    inf A <= x by A2,Th3;
    then inf A < r by A8,XXREAL_0:2;
    hence thesis by A1,A7;
  end;
end;
