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

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