
theorem
  for X, Y be non empty MetrSpace
  for f be Function of TopSpaceMetr X, TopSpaceMetr Y holds
      f is continuous
    iff
      for S be sequence of X, T be sequence of Y
        st S is convergent & T = f * S
      holds T is convergent & lim T = f.(lim S)
  proof
    let X, Y be non empty MetrSpace;
    let f be Function of TopSpaceMetr X, TopSpaceMetr Y;
    hereby
      assume
      A1: f is continuous;
      let S be sequence of X, T be sequence of Y;
      assume that
      A2: S is convergent and
      A3: T = f*S;
      set z0 = lim S;
      reconsider p = z0 as Point of TopSpaceMetr(X);
      A4: dom f = the carrier of X by FUNCT_2:def 1; then
      f.(lim S) in rng f by FUNCT_1:3; then
      reconsider x0 = f.(lim S) as Element of Y;
A5:   for r be Real st r>0
          ex n be Nat st for m be Nat st n<=m holds dist(T.m,x0)<r
      proof
        let r be Real;
        reconsider V = Ball(x0,r) as Subset of TopSpaceMetr(Y);
        assume r > 0; then
        V is open & x0 in V by GOBOARD6:1,TOPMETR:14; then
        consider W be Subset of TopSpaceMetr(X) such that
        A6: p in W & W is open and
        A7: f.:W c= V by A1,JGRAPH_2:10;
        consider r0 be Real such that
        A8: r0 > 0 and
        A9: Ball(z0,r0) c= W by A6,TOPMETR:15;
        reconsider r00 = r0 as Real;
        consider n0 be Nat such that
        A10: for m be Nat st n0<=m holds dist(S.m,z0)<r00
                by A2,A8,TBSP_1:def 3;
        for m be Nat st n0<=m holds dist(T.m,x0)<r
        proof
          let m be Nat;
          assume n0 <= m; then
          dist(S.m,z0) < r0 by A10; then
          S.m in Ball(z0,r0) by METRIC_1:11; then
          A11: f.(S.m) in f.:W by A4,A9,FUNCT_1:def 6;
          dom T = NAT by FUNCT_2:def 1; then
          T.m in f.:W by A3,A11,FUNCT_1:12,ORDINAL1:def 12;
          hence thesis by A7,METRIC_1:11;
        end;
        hence thesis;
      end;
      hence T is convergent;
      hence lim T = f.(lim S) by A5,TBSP_1:def 3;
    end;
    assume
    A12: for S be sequence of X, T be sequence of Y
           st S is convergent & T = f * S
         holds T is convergent & lim T = f.(lim S);
    for B be Subset of TopSpaceMetr Y st B is closed
    holds f " B is closed
    proof
      let B be Subset of TopSpaceMetr Y;
      reconsider A = f " B as Subset of TopSpaceMetr X;
      assume
      A13: B is closed;
      for S be sequence of X
        st (for n be Nat holds S . n in f " B) & S is convergent
      holds lim S in f " B
      proof
        let S be sequence of X;
        assume that
        A14: for n be Nat holds S . n in f " B and
        A15: S is convergent;
        reconsider T = f * S as sequence of Y;
        for n be Nat holds T.n in B
        proof
          let n be Nat;
          S.n in f " B by A14; then
          f.(S.n) in B by FUNCT_1:def 7;
          hence T.n in B by FUNCT_2:15,ORDINAL1:def 12;
        end; then
        lim T in B by A12,A13,A15,Th4; then
        A16: f.(lim S) in B by A12,A15;
        dom f= the carrier of X by FUNCT_2:def 1;
        hence lim S in f " B by A16,FUNCT_1:def 7;
      end;
      hence f " B is closed by Th4;
    end;
    hence f is continuous;
  end;
