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
  A is interval & B is left_end interval & sup A = inf B implies A \/
  B is interval
proof
  assume that
A1: A is interval and
A2: B is left_end interval and
A3: sup A = inf B;
  set z = inf B;
  for x,y,r st x in A \/ B & y in A \/ B & x < r & r < y holds r in A \/ B
  proof
    let x,y,r such that
A4: x in A \/ B and
A5: y in A \/ B and
A6: x < r and
A7: r < y;
    per cases by A4,A5,XBOOLE_0:def 3;
    suppose
      x in A & y in A;
      then r in A by A1,A6,A7,Th80;
      hence thesis by XBOOLE_0:def 3;
    end;
    suppose that
A8:   x in A and
A9:  y in B;
      per cases;
      suppose
        r < z;
        then r in A by A1,A3,A6,A8,Th81;
        hence thesis by XBOOLE_0:def 3;
      end;
      suppose
        z <= r;
        then r in B by A2,A7,A9,Th80;
        hence thesis by XBOOLE_0:def 3;
      end;
    end;
    suppose that
A10:  x in B and
A11:  y in A;
      per cases;
      suppose
A12:    z < r;
        y <= z by A3,A11,Th4;
        hence thesis by A7,A12,XXREAL_0:2;
      end;
      suppose
        r <= z;
        then r in B by A2,A6,A10,Th80;
        hence thesis by XBOOLE_0:def 3;
      end;
    end;
    suppose
      x in B & y in B;
      then r in B by A2,A6,A7,Th80;
      hence thesis by XBOOLE_0:def 3;
    end;
  end;
  hence thesis by Th84;
end;
