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

theorem Th5:
  x in [.p,q.] implies x in ].p,q.[ or x = p or x = q
proof
  assume
A1: x in [. p, q .];
  then reconsider s = x as ExtReal;
A2: p <= s by A1,Th1;
A3: s <= q by A1,Th1;
A4: p = s or p < s by A2,XXREAL_0:1;
  s = q or s < q by A3,XXREAL_0:1;
  hence thesis by A4,Th4;
end;
