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 Th31:
  (ex r st f|].x0,x0+r.[ is non-decreasing & not f|].x0,x0+r.[ is
  bounded_below) & (for r st x0<r ex g st g<r & x0<g & g in dom f) implies f
  is_right_divergent_to-infty_in x0
proof
  given r such that
A1: f|].x0,x0+r.[ is non-decreasing and
A2: not f|].x0,x0+r.[ is bounded_below;
  assume for r st x0<r ex g st g<r & x0<g & g in dom f;
  hence for r st x0<r ex g st g<r & x0<g & g in dom f;
  let seq such that
A3: seq is convergent and
A4: lim seq=x0 and
A5: rng seq c=dom f/\right_open_halfline(x0);
  now
    let t;
A6: dom f/\right_open_halfline(x0)c=dom f by XBOOLE_1:17;
    consider g1 being object such that
A7: g1 in ].x0,x0+r.[/\dom f and
A8: f.g1<t by A2,RFUNCT_1:71;
    reconsider g1 as Real by A7;
    g1 in ].x0,x0+r.[ by A7,XBOOLE_0:def 4;
    then g1 in {r1: x0<r1 & r1<x0+r} by RCOMP_1:def 2;
    then
A9: ex r1 st r1=g1 & x0<r1 & r1<x0+r;
    then consider n such that
A10: for k st n<=k holds seq.k<g1 by A3,A4,Th2;
    take n;
    let k;
    seq.k in rng seq by VALUED_0:28;
    then
A11: seq.k in dom f/\right_open_halfline(x0) by A5;
    dom f/\right_open_halfline(x0)c=right_open_halfline(x0) by XBOOLE_1:17;
    then seq.k in right_open_halfline(x0) by A11;
    then seq.k in {r2: x0<r2} by XXREAL_1:230;
    then
A12: ex r2 st r2=seq.k & x0<r2;
A13: k in NAT by ORDINAL1:def 12;
    assume n<=k;
    then
A14: seq.k<g1 by A10;
    then seq.k<x0+r by A9,XXREAL_0:2;
    then seq.k in {g2: x0<g2 & g2<x0+r} by A12;
    then seq.k in ].x0,x0+r.[ by RCOMP_1:def 2;
    then seq.k in ].x0,x0+r.[/\dom f by A11,A6,XBOOLE_0:def 4;
    then f.(seq.k)<=f.g1 by A1,A7,A14,RFUNCT_2:22;
    then f.(seq.k)<t by A8,XXREAL_0:2;
    hence (f/*seq).k<t by A5,A6,FUNCT_2:108,XBOOLE_1:1,A13;
  end;
  hence thesis;
end;
