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

theorem
  p <= r & r <= s & s <= q implies [.p,r.] \/ ].r,s.[ \/ [.s,q.] = [.p,q.]
proof
  assume that
A1: p <= r and
A2: r <= s and
A3: s <= q;
A4: p <= s by A1,A2,XXREAL_0:2;
A5: r <= q by A2,A3,XXREAL_0:2;
  per cases;
  suppose r < s;
    hence [.p,r.] \/ ].r,s.[ \/ [.s,q.] = [.p,s.[ \/ [.s,q.] by A1,Th169
      .= [.p,q.] by A3,A4,Th166;
  end;
  suppose
A6: s <= r;
    hence [.p,r.] \/ ].r,s.[ \/ [.s,q.] = [.p,r.] \/ {} \/ [.s,q.] by Th28
      .= [.p,q.] by A4,A5,A6,Th174;
  end;
end;
