
theorem Th10:
  for a, b being Real, X being Subset of REAL st a < b & not a in
X & not b in X holds X in Family_open_set Closed-Interval-MSpace(a,b) implies X
  is open
proof
  let a, b be Real, X be Subset of REAL;
  assume that
A1: a < b and
A2: not a in X and
A3: not b in X;
  assume
A4: X in Family_open_set Closed-Interval-MSpace(a,b);
  then reconsider V = X as Subset of Closed-Interval-MSpace(a,b);
  for r be Element of REAL st r in X holds ex N be Neighbourhood of r st N c= X
  proof
    let r be Element of REAL;
    assume
A5: r in X;
    reconsider r as Real;
    r in V by A5;
    then reconsider x = r as Element of Closed-Interval-MSpace(a,b);
    the carrier of Closed-Interval-MSpace(a,b) = [.a,b.] by A1,TOPMETR:10;
    then x in [.a,b.];
    then x in {l where l is Real: a <= l & l <= b } by RCOMP_1:def 1;
    then
A6: ex r2 be Real st r2 = x & a <= r2 & r2 <= b;
A7: r-a <> 0 by A2,A5;
    ex N be Neighbourhood of r st N c= X
    proof
      consider r1 be Real such that
A8:   r1 > 0 and
A9:   Ball(x,r1) c= X by A4,A5,PCOMPS_1:def 4;
      per cases;
      suppose
A10:    r <= (a+b)/2;
        set gg = min(r-a, r1);
        gg > 0
        proof
          per cases by XXREAL_0:15;
          suppose
            gg = r-a;
            hence thesis by A7,A6,XREAL_1:48;
          end;
          suppose
            gg = r1;
            hence thesis by A8;
          end;
        end;
        then reconsider N = ].r-gg,r+gg.[ as Neighbourhood of r by
RCOMP_1:def 6;
        take N;
        ].r-gg,r+gg.[ c= [.a,b.]
        proof
          2*r <= 2*((a+b)/2) by A10,XREAL_1:64;
          then
A11:      2*r - a <= a+b -a by XREAL_1:13;
          let i be object;
          assume i in ].r-gg,r+gg.[;
          then i in {l where l is Real: r-gg<l & l<r+gg }
            by RCOMP_1:def 2;
          then consider j be Real such that
A12:      j = i and
A13:      r-gg < j and
A14:      j < r+gg;
A15:      gg <= r-a by XXREAL_0:17;
          then r + gg <= r + (r - a) by XREAL_1:6;
          then r + gg <= a+b - a by A11,XXREAL_0:2;
          then
A16:      j <= b by A14,XXREAL_0:2;
          gg+a <= r by A15,XREAL_1:19;
          then r-gg >= a by XREAL_1:19;
          then a <= j by A13,XXREAL_0:2;
          then j in {l where l is Real: a <= l & l <= b } by A16;
          hence thesis by A12,RCOMP_1:def 1;
        end;
        then ].r-gg,r+gg.[ = Ball (x, gg) by A1,Th9;
        then ].r-gg,r+gg.[ c= Ball(x,r1) by PCOMPS_1:1,XXREAL_0:17;
        hence thesis by A9;
      end;
      suppose
A17:    r > (a+b)/2;
        set gg = min(b-r, r1);
A18:    b - r <> 0 by A3,A5;
        gg > 0
        proof
          per cases by XXREAL_0:15;
          suppose
            gg = b-r;
            hence thesis by A6,A18,XREAL_1:48;
          end;
          suppose
            gg = r1;
            hence thesis by A8;
          end;
        end;
        then reconsider N = ].r-gg,r+gg.[ as Neighbourhood of r by
RCOMP_1:def 6;
        take N;
        ].r-gg,r+gg.[ c= [.a,b.]
        proof
          2*r >= ((a+b)/2)*2 by A17,XREAL_1:64;
          then
A19:      2*r - b >= a+b - b by XREAL_1:13;
          let i be object;
          assume i in ].r-gg,r+gg.[;
          then i in {l where l is Real: r-gg<l & l<r+gg }
               by RCOMP_1:def 2;
          then consider j be Real such that
A20:      j = i and
A21:      r-gg < j and
A22:      j < r+gg;
A23:      gg <= b - r by XXREAL_0:17;
          then r + gg <= b by XREAL_1:19;
          then
A24:      j <= b by A22,XXREAL_0:2;
          r-gg >= r-(b-r) by A23,XREAL_1:13;
          then r-gg >= a by A19,XXREAL_0:2;
          then a <= j by A21,XXREAL_0:2;
          then j in {l where l is Real: a <= l & l <= b } by A24;
          hence thesis by A20,RCOMP_1:def 1;
        end;
        then ].r-gg,r+gg.[ = Ball (x, gg) by A1,Th9;
        then N c= Ball(x,r1) by PCOMPS_1:1,XXREAL_0:17;
        hence thesis by A9;
      end;
    end;
    hence thesis;
  end;
  hence thesis by RCOMP_1:20;
end;
