
theorem Th12:
  for P being Subset of R^1 holds P is compact implies [#](P) is closed
proof
  let P be Subset of R^1;
  assume
A1: P is compact;
  now
    per cases;
    case
A2:   [#](P) <> {};
A3:   R^1 is T_2 by PCOMPS_1:34,TOPMETR:def 6;
      for s1 being Real_Sequence st (rng s1) c= [#](P) & s1 is convergent
      holds lim s1 in [#](P)
      proof
        let s1 be Real_Sequence;
        assume that
A4:     (rng s1) c= [#](P) and
A5:     s1 is convergent;
        set x = lim s1;
        x in REAL by XREAL_0:def 1;
        then reconsider x as Point of R^1 by TOPMETR:17;
        thus lim s1 in [#](P)
        proof
          assume not lim s1 in [#](P);
          then x in P` by SUBSET_1:29;
          then consider Otx,OtP being Subset of R^1 such that
A6:       Otx is open and
          OtP is open and
A7:       x in Otx and
A8:       P c= OtP & Otx misses OtP by A1,A2,A3,COMPTS_1:6;
A9:       R^1 = TopStruct (#the carrier of RealSpace, Family_open_set(
            RealSpace)#) by PCOMPS_1:def 5,TOPMETR:def 6;
          then reconsider x as Point of RealSpace;
          consider r being Real such that
A10:      r>0 and
A11:      Ball(x,r) c= Otx by A6,A7,TOPMETR:15,def 6;
          reconsider r as Real;
A12:      Ball(x,r) = {q where q is Element of RealSpace :dist(x,q)<r} by
METRIC_1:17;
          (rng s1) misses Otx by A4,A8,XBOOLE_1:1,63;
          then
A13:      Ball(x,r) misses (rng s1) by A11,XBOOLE_1:63;
          not ex n being Nat st for m being Nat st
          n<=m holds |.s1.m-(lim s1).| < r
          proof
            given n being Nat such that
A14:        for m being Nat st n<=m holds |.s1.m-(lim s1 ).| < r;
            set m = n + 1;
            reconsider ls = lim s1 as Element of REAL by XREAL_0:def 1;
            |.s1.m-(ls).| < r by A14,NAT_1:11;
            then real_dist.(s1.m,ls) < r by METRIC_1:def 12;
            then
A15:        real_dist.(ls,s1.m) < r by METRIC_1:9;
            reconsider y = s1.m as Element of RealSpace by A9,TOPMETR:17;
A16:        s1.m in rng s1 by FUNCT_2:4;
            dist(x,y) = (the distance of RealSpace).(x,y) by METRIC_1:def 1;
            then y in Ball(x,r) by A12,A15,METRIC_1:def 13;
            then y in Ball(x,r) /\ (rng s1) by A16,XBOOLE_0:def 4;
            hence thesis by A13,XBOOLE_0:def 7;
          end;
          hence thesis by A5,A10,SEQ_2:def 7;
        end;
      end;
      hence thesis by RCOMP_1:def 4;
    end;
    case
A17:  [#](P) = {};
      for s1 being Real_Sequence st (rng s1) c= [#](P) & s1 is convergent
      holds lim s1 in [#](P)
      proof
        let s1 be Real_Sequence;
        assume that
A18:    (rng s1) c= [#](P) and
        s1 is convergent;
         0 in NAT;
        hence thesis by A17,A18,FUNCT_2:4;
      end;
      hence thesis by RCOMP_1:def 4;
    end;
  end;
  hence thesis;
end;
