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

theorem
  p <= s & s <= r & r < q implies [.p,r.] \/ [.s,q.[ = [.p,q.[
proof
  assume that
A1: p <= s and
A2: s <= r and
A3: r < q;
  let t;
  thus t in [.p,r.] \/ [.s,q.[ implies t in [.p,q.[
  proof
    assume t in [.p,r.] \/ [.s,q.[;
    then t in [.p,r.] or t in [.s,q.[ by XBOOLE_0:def 3;
    then
A4: p <= t & t <= r or s <= t & t < q by Th1,Th3;
    then
A5: p <= t by A1,XXREAL_0:2;
    t < q by A3,A4,XXREAL_0:2;
    hence thesis by A5,Th3;
  end;
  assume t in [.p,q.[;
  then p <= t & t <= r or s <= t & t < q by A2,Th3,XXREAL_0:2;
  then t in [.p,r.] or t in [.s,q.[ by Th1,Th3;
  hence thesis by XBOOLE_0:def 3;
end;
