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
  (f is_right_divergent_to+infty_in x0 & r>0 implies r(#)f
is_right_divergent_to+infty_in x0 ) & (f is_right_divergent_to+infty_in x0 & r<
  0 implies r(#)f is_right_divergent_to-infty_in x0 ) & (f
  is_right_divergent_to-infty_in x0 & r>0 implies r(#)f
is_right_divergent_to-infty_in x0 ) & (f is_right_divergent_to-infty_in x0 & r<
  0 implies r(#)f is_right_divergent_to+infty_in x0)
proof
A1: dom f/\right_open_halfline(x0)c=dom f by XBOOLE_1:17;
  thus f is_right_divergent_to+infty_in x0 & r>0 implies r(#)f
  is_right_divergent_to+infty_in x0
  proof
    assume that
A2: f is_right_divergent_to+infty_in x0 and
A3: r>0;
    thus for r1 st x0<r1 ex g st g<r1 & x0<g & g in dom(r(#)f)
    proof
      let r1;
      assume x0<r1;
      then consider g such that
A4:   g<r1 and
A5:   x0<g and
A6:   g in dom f by A2;
      take g;
      thus thesis by A4,A5,A6,VALUED_1:def 5;
    end;
    let seq;
    assume that
A7: seq is convergent and
A8: lim seq=x0 and
A9: rng seq c=dom(r(#)f)/\right_open_halfline(x0);
A10: dom f/\right_open_halfline(x0)c=dom f by XBOOLE_1:17;
A11: rng seq c=dom f/\right_open_halfline(x0) by A9,VALUED_1:def 5;
    then f/*seq is divergent_to+infty by A2,A7,A8;
    then r(#)(f/*seq) is divergent_to+infty by A3,LIMFUNC1:13;
    hence thesis by A11,A10,RFUNCT_2:9,XBOOLE_1:1;
  end;
  thus f is_right_divergent_to+infty_in x0 & r<0 implies r(#)f
  is_right_divergent_to-infty_in x0
  proof
    assume that
A12: f is_right_divergent_to+infty_in x0 and
A13: r<0;
    thus for r1 st x0<r1 ex g st g<r1 & x0<g & g in dom(r(#)f)
    proof
      let r1;
      assume x0<r1;
      then consider g such that
A14:  g<r1 and
A15:  x0<g and
A16:  g in dom f by A12;
      take g;
      thus thesis by A14,A15,A16,VALUED_1:def 5;
    end;
    let seq;
    assume that
A17: seq is convergent and
A18: lim seq=x0 and
A19: rng seq c=dom(r(#)f)/\right_open_halfline(x0);
A20: dom f/\right_open_halfline(x0)c=dom f by XBOOLE_1:17;
A21: rng seq c=dom f/\right_open_halfline(x0) by A19,VALUED_1:def 5;
    then f/*seq is divergent_to+infty by A12,A17,A18;
    then r(#)(f/*seq) is divergent_to-infty by A13,LIMFUNC1:13;
    hence thesis by A21,A20,RFUNCT_2:9,XBOOLE_1:1;
  end;
  thus f is_right_divergent_to-infty_in x0 & r>0 implies r(#)f
  is_right_divergent_to-infty_in x0
  proof
    assume that
A22: f is_right_divergent_to-infty_in x0 and
A23: r>0;
    thus for r1 st x0<r1 ex g st g<r1 & x0<g & g in dom(r(#)f)
    proof
      let r1;
      assume x0<r1;
      then consider g such that
A24:  g<r1 and
A25:  x0<g and
A26:  g in dom f by A22;
      take g;
      thus thesis by A24,A25,A26,VALUED_1:def 5;
    end;
    let seq;
    assume that
A27: seq is convergent and
A28: lim seq=x0 and
A29: rng seq c=dom(r(#)f)/\right_open_halfline(x0);
A30: dom f/\right_open_halfline(x0)c=dom f by XBOOLE_1:17;
A31: rng seq c=dom f/\right_open_halfline(x0) by A29,VALUED_1:def 5;
    then f/*seq is divergent_to-infty by A22,A27,A28;
    then r(#)(f/*seq) is divergent_to-infty by A23,LIMFUNC1:14;
    hence thesis by A31,A30,RFUNCT_2:9,XBOOLE_1:1;
  end;
  assume that
A32: f is_right_divergent_to-infty_in x0 and
A33: r<0;
  thus for r1 st x0<r1 ex g st g<r1 & x0<g & g in dom(r(#)f)
  proof
    let r1;
    assume x0<r1;
    then consider g such that
A34: g<r1 and
A35: x0<g and
A36: g in dom f by A32;
    take g;
    thus thesis by A34,A35,A36,VALUED_1:def 5;
  end;
  let seq;
  assume that
A37: seq is convergent and
A38: lim seq=x0 and
A39: rng seq c=dom(r(#)f)/\right_open_halfline(x0);
A40: rng seq c=dom f/\right_open_halfline(x0) by A39,VALUED_1:def 5;
  then f/*seq is divergent_to-infty by A32,A37,A38;
  then r(#)(f/*seq) is divergent_to+infty by A33,LIMFUNC1:14;
  hence thesis by A40,A1,RFUNCT_2:9,XBOOLE_1:1;
end;
