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

theorem
  f1 is_right_divergent_to+infty_in x0 & (for r st x0<r ex g st g<r & x0
<g & g in dom(f1+f2)) & (ex r st 0<r & f2|].x0,x0+r.[ is bounded_below) implies
  f1+f2 is_right_divergent_to+infty_in x0
proof
  assume that
A1: f1 is_right_divergent_to+infty_in x0 and
A2: for r st x0<r ex g st g<r & x0<g & g in dom(f1+f2);
  given r such that
A3: 0<r and
A4: f2|].x0,x0+r.[ is bounded_below;
  now
    let seq such that
A5: seq is convergent and
A6: lim seq=x0 and
A7: rng seq c=dom(f1+f2)/\right_open_halfline(x0);
    x0<x0+r by A3,Lm1;
    then consider k such that
A8: for n st k<=n holds seq.n<x0+r by A5,A6,Th2;
A9: dom(f1+f2)/\right_open_halfline(x0) c=dom(f1+f2) by XBOOLE_1:17;
    rng(seq^\k)c=rng seq by VALUED_0:21;
    then
A10: rng(seq^\k)c=dom(f1+f2)/\right_open_halfline(x0) by A7,XBOOLE_1:1;
    then
A11: rng(seq^\k)c=dom(f1+f2) by A9,XBOOLE_1:1;
A12: dom(f1+f2)=dom f1/\dom f2 by VALUED_1:def 1;
    then
A13: dom(f1+f2)c=dom f2 by XBOOLE_1:17;
    then
A14: rng(seq^\k)c=dom f2 by A11,XBOOLE_1:1;
    dom(f1+f2)c=dom f1 by A12,XBOOLE_1:17;
    then
A15: rng(seq^\k)c=dom f1 by A11,XBOOLE_1:1;
    then rng(seq^\k)c=dom f1/\dom f2 by A14,XBOOLE_1:19;
    then
A16: f1/*(seq^\k)+f2/*(seq^\k)=(f1+f2)/*(seq^\k) by RFUNCT_2:8
      .=((f1+f2)/*seq)^\k by A7,A9,VALUED_0:27,XBOOLE_1:1;
    dom(f1+f2)/\ right_open_halfline(x0) c=right_open_halfline(x0) by
XBOOLE_1:17;
    then
A17: rng(seq^\k)c=right_open_halfline(x0) by A10,XBOOLE_1:1;
    then
A18: rng(seq^\k)c=dom f1/\right_open_halfline(x0) by A15,XBOOLE_1:19;
    now
      consider r1 be Real such that
A19:  for g being object st g in ].x0,x0+r.[/\dom f2 holds r1<=f2.g by A4,
RFUNCT_1:71;
      take r2=r1-1;
      let n;
A20: n in NAT by ORDINAL1:def 12;
      seq.(n+k)<x0+r by A8,NAT_1:12;
      then
A21:  (seq^\k).n<x0+r by NAT_1:def 3;
A22:  (seq^\k).n in rng(seq^\k) by VALUED_0:28;
      then (seq^\k).n in right_open_halfline(x0) by A17;
      then (seq^\k).n in {g1: x0<g1} by XXREAL_1:230;
      then ex g st g=(seq^\k).n & x0<g;
      then (seq^\k).n in {g2: x0<g2 & g2<x0+r} by A21;
      then (seq^\k).n in ].x0,x0+r.[ by RCOMP_1:def 2;
      then (seq^\k).n in ].x0,x0+r.[/\dom f2 by A14,A22,XBOOLE_0:def 4;
      then r1-1<f2.((seq^\k).n)-0 by A19,XREAL_1:15;
      hence r2<(f2/*(seq^\k)).n by A11,A13,FUNCT_2:108,XBOOLE_1:1,A20;
    end;
    then
A23: f2/*(seq^\k) is bounded_below by SEQ_2:def 4;
    lim(seq^\k)=x0 by A5,A6,SEQ_4:20;
    then f1/*(seq^\k) is divergent_to+infty by A1,A5,A18;
    then f1/*(seq^\k)+f2/*(seq^\k) is divergent_to+infty by A23,LIMFUNC1:9;
    hence (f1+f2)/*seq is divergent_to+infty by A16,LIMFUNC1:7;
  end;
  hence thesis by A2;
end;
