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 & lim(f,x0)=0 & (for r1,r2 st r1<x0 & x0<r2 ex
g1,g2 st r1<g1 & g1<x0 & g1 in dom f & g2<r2 & x0<g2 & g2 in dom f & f.g1<>0 &
  f.g2<>0) & (ex r st 0<r & for g st g in dom f /\ (].x0-r,x0.[ \/ ].x0,x0+r.[)
  holds f.g<=0) implies f^ is_divergent_to-infty_in x0
proof
  assume that
A1: f is_convergent_in x0 and
A2: lim(f,x0)=0 and
A3: for r1,r2 st r1<x0 & x0<r2 ex g1,g2 st r1<g1 & g1<x0 & g1 in dom f &
  g2<r2 & x0<g2 & g2 in dom f & f.g1<>0 & f.g2<>0;
  given r such that
A4: 0<r and
A5: for g st g in dom f/\(].x0-r,x0.[\/].x0,x0+r.[) holds f.g<=0;
  thus for r1,r2 st r1<x0 & x0<r2 ex g1,g2 st r1<g1 & g1<x0 & g1 in dom(f^) &
  g2<r2 & x0<g2 & g2 in dom(f^)
  proof
    let r1,r2;
    assume that
A6: r1<x0 and
A7: x0<r2;
    consider g1,g2 such that
A8: r1<g1 and
A9: g1<x0 and
A10: g1 in dom f and
A11: g2<r2 and
A12: x0<g2 and
A13: g2 in dom f and
A14: f.g1<>0 and
A15: f.g2<>0 by A3,A6,A7;
    not f.g2 in {0} by A15,TARSKI:def 1;
    then not g2 in f"{0} by FUNCT_1:def 7;
    then
A16: g2 in dom f\f"{0} by A13,XBOOLE_0:def 5;
    take g1,g2;
    not f.g1 in {0} by A14,TARSKI:def 1;
    then not g1 in f"{0} by FUNCT_1:def 7;
    then g1 in dom f\f"{0} by A10,XBOOLE_0:def 5;
    hence thesis by A8,A9,A11,A12,A16,RFUNCT_1:def 2;
  end;
  let s be Real_Sequence;
  assume that
A17: s is convergent and
A18: lim s=x0 and
A19: rng s c=dom(f^)\{x0};
  consider k such that
A20: for n st k<=n holds x0-r<s.n & s.n<x0+r by A4,A17,A18,Th7;
A21: rng s c=dom(f^) by A19,XBOOLE_1:1;
A22: dom(f^)=dom f\f"{0} by RFUNCT_1:def 2;
  then
A23: (f/*(s^\k))"=((f/*s)^\k)" by A21,VALUED_0:27,XBOOLE_1:1
    .=((f/*s)")^\k by SEQM_3:18
    .=((f^)/*s)^\k by A19,RFUNCT_2:12,XBOOLE_1:1;
A24: rng(s^\k)c=rng s by VALUED_0:21;
A25: rng s c=dom f by A21,A22,XBOOLE_1:1;
  then
A26: rng(s^\k)c=dom f by A24;
A27: rng(s^\k)c=dom (f^)\{x0} by A19,A24;
A28: rng(s^\k)c=dom f\{x0}
  proof
    let x be object;
    assume
A29: x in rng(s^\k);
    then not x in {x0} by A27,XBOOLE_0:def 5;
    hence thesis by A26,A29,XBOOLE_0:def 5;
  end;
A30: lim(s^\k)=x0 by A17,A18,SEQ_4:20;
  then
A31: lim(f/*(s^\k))=0 by A1,A2,A17,A28,Def4;
A32: f/*(s^\k) is non-zero by A21,A24,RFUNCT_2:11,XBOOLE_1:1;
A33:
  now
    let n;
A34: k<=n+k by NAT_1:12;
    then s.(n+k)<x0+r by A20;
    then
A35: (s^\k).n<x0+r by NAT_1:def 3;
    x0-r<s.(n+k) by A20,A34;
    then x0-r<(s^\k).n by NAT_1:def 3;
    then (s^\k).n in {g1: x0-r<g1 & g1<x0+r} by A35;
    then
A36: (s^\k).n in ].x0-r,x0+r .[ by RCOMP_1:def 2;
A37: (s^\k).n in rng(s^\k) by VALUED_0:28;
    then not (s^\k).n in {x0} by A27,XBOOLE_0:def 5;
    then (s^\k).n in ].x0-r,x0+r.[\{x0} by A36,XBOOLE_0:def 5;
    then (s^\k).n in ].x0-r,x0.[\/].x0,x0+r.[ by A4,Th4;
    then (s^\k).n in dom f/\(].x0-r,x0.[\/].x0,x0+r.[) by A26,A37,
XBOOLE_0:def 4;
    then
A38: f.((s^\k).n)<=0 by A5;
    (f/*(s^\k)).n<>0 by A32,SEQ_1:5;
    hence (f/*(s^\k)).n<0 by A25,A24,A38,FUNCT_2:108,XBOOLE_1:1;
  end;
A39: for n being Nat holds 0<=n implies (f/*(s^\k)).n<0
   proof let n be Nat;
    n in NAT by ORDINAL1:def 12;
    hence thesis by A33;
  end;
  f/*(s^\k) is convergent by A1,A17,A30,A28;
  then (f/*(s^\k))" is divergent_to-infty by A31,A39,LIMFUNC1:36;
  hence thesis by A23,LIMFUNC1:7;
end;
