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

theorem
  r < s & ].r,s.[ c= [.p,q.] implies [.r,s.] c= [.p,q.]
proof
  assume that
A1: r < s and
A2: ].r,s.[ c= [.p,q.];
  let t;
  assume
A3: t in [.r,s.];
  per cases by A3,Th5;
  suppose t in ].r,s.[;
    hence thesis by A2;
  end;
  suppose
A4: t = r;
    then
A5: p <= t by A1,A2,Th51;
    s <= q by A1,A2,Th51;
    then t <= q by A1,A4,XXREAL_0:2;
    hence thesis by A5,Th1;
  end;
  suppose
A6: t = s;
A7: s <= q by A1,A2,Th51;
    p <= r by A1,A2,Th51;
    then p <= t by A1,A6,XXREAL_0:2;
    hence thesis by A6,A7,Th1;
  end;
end;
