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

theorem
  f1 is_right_convergent_in x0 & f2 is_right_convergent_in lim_right(f1,
x0) & (for r st x0<r ex g st g<r & x0<g & g in dom(f2*f1)) & (ex g st 0<g & for
  r st r in dom f1 /\ ].x0,x0+g.[ holds lim_right(f1,x0)<f1.r) implies f2*f1
is_right_convergent_in x0 & lim_right(f2*f1,x0)=lim_right(f2,lim_right(f1,x0))
proof
  assume that
A1: f1 is_right_convergent_in x0 and
A2: f2 is_right_convergent_in lim_right(f1,x0) and
A3: for r st x0<r ex g st g<r & x0<g & g in dom(f2*f1);
  given g such that
A4: 0<g and
A5: for r st r in dom f1/\].x0,x0+g.[ holds lim_right(f1,x0)<f1.r;
A6: now
    let s be Real_Sequence;
    assume that
A7: s is convergent & lim s=x0 and
A8: rng s c=dom(f2*f1)/\right_open_halfline(x0);
    consider k being Nat such that
A9: for n being Nat st k<=n holds s.n<x0+g by A4,A7,Lm1,LIMFUNC2:2;
A10: rng s c=dom f1 by A8,Th1;
    set q=(f1/*s)^\k;
A11: rng s c=dom(f2*f1) by A8,Th1;
A12: rng s c=right_open_halfline(x0) by A8,Th1;
    now
      let x be object;
      assume x in rng q;
      then consider n be Element of NAT such that
A13:  q.n=x by FUNCT_2:113;
A14:   n+k in NAT by ORDINAL1:def 12;
A15:  f1.(s.(n+k))=(f1/*s).(n+k) by A10,FUNCT_2:108,A14
        .=x by A13,NAT_1:def 3;
A16:  s.(n+k)<x0+g by A9,NAT_1:12;
A17:  s.(n+k) in rng s by VALUED_0:28;
      then s.(n+k) in right_open_halfline(x0) by A12;
      then s.(n+k) in {g1: x0<g1} by XXREAL_1:230;
      then ex g1 st g1=s.(n+k) & x0<g1;
      then s.(n+k) in {g2: x0<g2 & g2<x0+g} by A16;
      then s.(n+k) in ].x0,x0+g.[ by RCOMP_1:def 2;
      then s.(n+k) in dom f1/\].x0,x0+g.[ by A10,A17,XBOOLE_0:def 4;
      then lim_right(f1,x0)<f1.(s.(n+k)) by A5;
      then f1.(s.(n+k)) in {r1: lim_right(f1,x0)<r1};
      then
A18:  f1.(s.(n+k)) in right_open_halfline(lim_right(f1,x0)) by XXREAL_1:230;
      f1.(s.(n+k)) in dom f2 by A11,A17,FUNCT_1:11;
      hence x in dom f2/\right_open_halfline(lim_right(f1,x0)) by A18,A15,
XBOOLE_0:def 4;
    end;
    then
A19: rng q c=dom f2/\ right_open_halfline(lim_right(f1,x0));
    rng(f1/*s)c=dom f2 by A8,Th1;
    then
A20: f2/*q=(f2/*(f1/*s))^\k by VALUED_0:27
      .=((f2*f1)/*s)^\k by A11,VALUED_0:31;
A21: rng s c=dom f1/\right_open_halfline(x0) by A8,Th1;
    then
A22: f1/*s is convergent by A1,A2,A7,LIMFUNC2:def 8;
    lim(f1/*s)=lim_right(f1,x0) by A1,A7,A21,LIMFUNC2:def 8;
    then
A23: lim q=lim_right(f1,x0) by A22,SEQ_4:20;
    lim_right(f2,lim_right(f1,x0))=lim_right(f2,lim_right(f1,x0));
    then
A24: f2/*q is convergent by A2,A22,A23,A19,LIMFUNC2:def 8;
    hence (f2*f1)/*s is convergent by A20,SEQ_4:21;
    lim(f2/*q)=lim_right(f2,lim_right(f1,x0)) by A2,A22,A23,A19,LIMFUNC2:def 8;
    hence lim((f2*f1)/*s)=lim_right(f2,lim_right(f1,x0)) by A24,A20,SEQ_4:22;
  end;
  hence f2*f1 is_right_convergent_in x0 by A3,LIMFUNC2:def 4;
  hence thesis by A6,LIMFUNC2:def 8;
end;
