reserve r,r1,r2,g,g1,g2,x0,t for Real;
reserve n,k,m for Element of NAT;
reserve seq for Real_Sequence;
reserve f,f1,f2 for PartFunc of REAL,REAL;

theorem
  f is_convergent_in x0 implies (lim(f,x0)=g iff for g1 st 0<g1 ex g2 st
0<g2 & for r1 st 0<|.x0-r1.| & |.x0-r1.|<g2 & r1 in dom f holds |.f.r1-g.|<
  g1)
proof
  assume
A1: f is_convergent_in x0;
  thus lim(f,x0)=g implies for g1 st 0<g1 ex g2 st 0<g2 & for r1 st 0<|.x0-
  r1.| & |.x0-r1.|<g2 & r1 in dom f holds |.f.r1-g.|<g1
  proof
    assume that
A2: lim(f,x0)=g and
A3: ex g1 st 0<g1 & for g2 st 0<g2 ex r1 st 0<|.x0-r1.| & |.x0-r1.|<
    g2 & r1 in dom f & g1<=|.f.r1-g.|;
    consider g1 such that
A4: 0<g1 and
A5: for g2 st 0<g2 ex r1 st 0<|.x0-r1.| & |.x0-r1.|<g2 & r1 in dom f
    & g1<=|.f.r1-g.| by A3;
    defpred X[Element of NAT,Real] means 0<|.x0-$2.| & |.x0-$2.|<1/(
    $1+1) & $2 in dom f & |.f.($2)-g.|>=g1;
A6: for n ex r1 being Element of REAL st X[n,r1]
     proof let n;
       consider r1 such that
A7:       X[n,r1] by A5,XREAL_1:139;
       reconsider r1 as Element of REAL by XREAL_0:def 1;
      take r1;
      thus thesis by A7;
     end;
    consider s be Real_Sequence such that
A8: for n holds X[n,s.n] from FUNCT_2:sch 3(A6);
A9: rng s c=dom f\{x0} by A8,Th2;
A10: lim s=x0 by A8,Th2;
A11: s is convergent by A8,Th2;
    then
A12: lim(f/*s)=g by A1,A2,A10,A9,Def4;
    f/*s is convergent by A1,A11,A10,A9;
    then consider n being Nat such that
A13: for k being Nat st n<=k holds |.(f/*s).k-g.|<g1 by A4,A12,SEQ_2:def 7;
A14: |.(f/*s).n-g.|<g1 by A13;
A15:    n in NAT by ORDINAL1:def 12;
    rng s c=dom f by A8,Th2;
    then |.f.(s.n)-g.|<g1 by A14,FUNCT_2:108,A15;
    hence contradiction by A8,A15;
  end;
  assume
A16: for g1 st 0<g1 ex g2 st 0<g2 & for r1 st 0<|.x0-r1.| & |.x0-r1.|<
  g2 & r1 in dom f holds |.f.r1-g.|<g1;
  reconsider g as Real;
  now
    let s be Real_Sequence;
    assume that
A17: s is convergent and
A18: lim s=x0 and
A19: rng s c=dom f\{x0};
A20: now
      let g1 be Real;
      assume
A21:  0<g1;
      consider g2 such that
A22:  0<g2 and
A23:  for r1 st 0<|.x0-r1.| & |.x0-r1.|<g2 & r1 in dom f holds
      |.f.r1 -g.|<g1 by A16,A21;
      consider n such that
A24:  for k st n<=k holds 0<|.x0-s.k.| & |.x0-s.k.|<g2 & s.k in dom
      f by A17,A18,A19,A22,Th3;
       reconsider n as Nat;
      take n;
      let k be Nat;
A25:    k in NAT by ORDINAL1:def 12;
      assume
A26:  n<=k;
      then
A27:  |.x0-s.k.|<g2 by A24,A25;
A28:  s.k in dom f by A24,A26,A25;
      0<|.x0-s.k.| by A24,A26,A25;
      then |.f.(s.k)-g.|<g1 by A23,A27,A28;
      hence |.(f/*s).k-g.|<g1 by A19,FUNCT_2:108,XBOOLE_1:1,A25;
    end;
    hence f/*s is convergent by SEQ_2:def 6;
    hence lim(f/*s)=g by A20,SEQ_2:def 7;
  end;
  hence thesis by A1,Def4;
end;
