reserve r,r1,r2,g,g1,g2,x0 for Real;
reserve f1,f2 for PartFunc of REAL,REAL;

theorem
  f1 is convergent_in-infty & f2 is_right_convergent_in lim_in-infty f1
  & (for r ex g st g<r & g in dom(f2*f1)) & (ex r st for g st g in dom f1 /\
  left_open_halfline(r) holds lim_in-infty f1<f1.g) implies f2*f1 is
  convergent_in-infty & lim_in-infty(f2*f1)=lim_right(f2,lim_in-infty f1)
proof
  assume that
A1: f1 is convergent_in-infty and
A2: f2 is_right_convergent_in lim_in-infty f1 and
A3: for r ex g st g<r & g in dom(f2*f1);
  given r such that
A4: for g st g in dom f1/\left_open_halfline(r) holds lim_in-infty f1<f1 .g;
A5: now
    set L=lim_right(f2,lim_in-infty f1);
    let s be Real_Sequence;
    assume that
A6: s is divergent_to-infty and
A7: rng s c=dom(f2*f1);
    consider k being Nat such that
A8: for n being Nat st k<=n holds s.n<r by A6;
    set q=s^\k;
A9: q is divergent_to-infty by A6,LIMFUNC1:27;
A10: rng s c=dom f1 by A7,Lm2;
A11: rng q c=rng s by VALUED_0:21;
    then rng q c=dom f1 by A10;
    then
A12: f1/*q is convergent & lim(f1/*q)=lim_in-infty f1 by A1,A9,
LIMFUNC1:def 13;
A13: rng(f1/*s)c=dom f2 by A7,Lm2;
A14: rng(f1/*q)c=dom f2/\right_open_halfline(lim_in-infty f1)
    proof
      let x be object;
      assume x in rng(f1/*q);
      then consider n be Element of NAT such that
A15:  (f1/*q).n=x by FUNCT_2:113;
A16:  x=f1.(q.n) by A10,A11,A15,FUNCT_2:108,XBOOLE_1:1
        .=f1.(s.(n+k)) by NAT_1:def 3;
      s.(n+k)<r by A8,NAT_1:12;
      then s.(n+k) in {r2: r2<r};
      then
A17:  s.(n+k) in left_open_halfline(r) by XXREAL_1:229;
      s.(n+k) in rng s by VALUED_0:28;
      then s.(n+k) in dom f1/\left_open_halfline(r) by A10,A17,XBOOLE_0:def 4;
      then lim_in-infty f1<f1.(s.(n+k)) by A4;
      then x in {g1: lim_in-infty f1<g1} by A16;
      then
A18:  x in right_open_halfline(lim_in-infty f1) by XXREAL_1:230;
A19:   n+k in NAT by ORDINAL1:def 12;
      (f1/*s).(n+k) in rng(f1/*s) by VALUED_0:28;
      then (f1/*s).(n+k) in dom f2 by A13;
      then x in dom f2 by A10,A16,FUNCT_2:108,A19;
      hence thesis by A18,XBOOLE_0:def 4;
    end;
A20: f2/*(f1/*q)=f2/*((f1/*s)^\k) by A10,VALUED_0:27
      .=(f2/*(f1/*s))^\k by A13,VALUED_0:27
      .=((f2*f1)/*s)^\k by A7,VALUED_0:31;
    L=L;
    then
A21: f2/*(f1/*q) is convergent by A2,A12,A14,LIMFUNC2:def 8;
    hence (f2*f1)/*s is convergent by A20,SEQ_4:21;
    lim(f2/*(f1/*q))=L by A2,A12,A14,LIMFUNC2:def 8;
    hence lim((f2*f1)/*s)=L by A21,A20,SEQ_4:22;
  end;
  hence f2*f1 is convergent_in-infty by A3;
  hence thesis by A5,LIMFUNC1:def 13;
end;
