reserve n,n1,m,m1,k for Nat;
reserve x,X,X1 for set;
reserve g,g1,g2,t,x0,x1,x2 for Complex;
reserve s1,s2,q1,seq,seq1,seq2,seq3 for Complex_Sequence;
reserve Y for Subset of COMPLEX;
reserve f,f1,f2,h,h1,h2 for PartFunc of COMPLEX,COMPLEX;
reserve p,r,s for Real;
reserve Ns,Nseq for increasing sequence of NAT;

theorem Th38:
  for X,f holds f is_continuous_on X iff X c= dom f & for s1 st
  rng s1 c= X & s1 is convergent & lim s1 in X holds f/*s1 is convergent & f/.(
  lim s1) = lim (f/*s1)
proof
  let X,f;
  thus f is_continuous_on X implies X c= dom f & for s1 st rng s1 c= X & s1 is
convergent & lim s1 in X holds f/*s1 is convergent & f/.(lim s1) = lim (f/*s1)
  proof
    assume
A1: f is_continuous_on X;
    then
A2: X c= dom f;
    now
      let s1 such that
A3:   rng s1 c= X and
A4:   s1 is convergent and
A5:   lim s1 in X;
A6:   f|X is_continuous_in (lim s1) by A1,A5;
A7:   dom (f|X) = dom f /\ X by RELAT_1:61
        .= X by A2,XBOOLE_1:28;
      now
        let n be Element of NAT;
A8:     s1.n in rng s1 by VALUED_0:28;
        thus ((f|X)/*s1).n = (f|X)/.(s1.n) by A3,A7,FUNCT_2:109
          .= f/.(s1.n) by A3,A7,A8,PARTFUN2:15
          .= (f/*s1).n by A2,A3,FUNCT_2:109,XBOOLE_1:1;
      end;
      then
A9:   (f|X)/*s1 = f/*s1 by FUNCT_2:63;
      f/.(lim s1) = (f|X)/.(lim s1) by A5,A7,PARTFUN2:15
        .= lim (f/*s1) by A3,A4,A7,A6,A9;
      hence
      f/*s1 is convergent & f/.(lim s1) = lim (f/*s1) by A3,A4,A7,A6,A9;
    end;
    hence thesis by A1;
  end;
  assume that
A10: X c= dom f and
A11: for s1 st rng s1 c= X & s1 is convergent & lim s1 in X holds f/*s1
  is convergent & f/.(lim s1) = lim (f/*s1);
  now
A12: dom (f|X) = dom f /\ X by RELAT_1:61
      .= X by A10,XBOOLE_1:28;
    let x1 such that
A13: x1 in X;
    now
      let s1 such that
A14:  rng s1 c= dom (f|X) and
A15:  s1 is convergent and
A16:  lim s1 = x1;
      now
        let n be Element of NAT;
A17:    s1.n in rng s1 by VALUED_0:28;
        thus ((f|X)/*s1).n = (f|X)/.(s1.n) by A14,FUNCT_2:109
          .= f/.(s1.n) by A14,A17,PARTFUN2:15
          .= (f/*s1).n by A10,A12,A14,FUNCT_2:109,XBOOLE_1:1;
      end;
      then
A18:  (f|X)/*s1 = f/*s1 by FUNCT_2:63;
      (f|X)/.(lim s1) = f/.(lim s1) by A13,A12,A16,PARTFUN2:15
        .= lim ((f|X)/*s1) by A11,A13,A12,A14,A15,A16,A18;
      hence (f|X)/*s1 is convergent & (f|X)/.x1 = lim ((f|X)/*s1) by A11,A13
,A12,A14,A15,A16,A18;
    end;
    hence f|X is_continuous_in x1 by A13,A12;
  end;
  hence thesis by A10;
end;
