reserve x for set,
  p,q,r,s,t,u for ExtReal,
  g for Real,
  a for Element of ExtREAL;

theorem Th304:
  r <= s & p <= q implies [.r,q.] \ [.p,s.[ = [.r,p.[ \/ [.s,q.]
proof
  assume that
A1: r <= s and
A2: p <= q;
  let x be ExtReal;
  thus x in [.r,q.] \ [.p,s.[ implies x in [.r,p.[ \/ [.s,q.]
  proof
    assume
A3: x in [.r,q.] \ [.p,s.[;
    then
A4: not x in [.p,s.[ by XBOOLE_0:def 5;
A5: r <= x by A3,Th1;
A6: x <= q by A3,Th1;
    not(p <= x & x < s) by A4,Th3;
    then x in [.r,p.[ or x in [.s,q.] by A5,A6,Th1,Th3;
    hence thesis by XBOOLE_0:def 3;
  end;
  assume x in [.r,p.[ \/ [.s,q.];
  then x in [.r,p.[ or x in [.s,q.] by XBOOLE_0:def 3;
  then
A7: r <= x & x < p or s <= x & x <= q by Th1,Th3;
  then
A8: r <= x by A1,XXREAL_0:2;
  x <= q by A2,A7,XXREAL_0:2;
  then
A9: x in [.r,q.] by A8,Th1;
  not x in [.p,s.[ by A7,Th3;
  hence thesis by A9,XBOOLE_0:def 5;
end;
