reserve r,r1,g for Real,
  n,m,k for Nat,
  seq,seq1, seq2 for Real_Sequence,
  f,f1,f2 for PartFunc of REAL,REAL,
  x for set;
reserve r,r1,r2,g,g1,g2 for Real;

theorem Th64:
  (ex r st f|right_open_halfline r is non-increasing & not f|
  right_open_halfline r is bounded_below) & (for r ex g st r<g & g in dom f)
  implies f is divergent_in+infty_to-infty
proof
  given r1 such that
A1: f|right_open_halfline r1 is non-increasing and
A2: not f|right_open_halfline r1 is bounded_below;
A3: now
    let seq such that
A4: seq is divergent_to+infty and
A5: rng seq c=dom f;
    now
      let r;
      consider g1 being object such that
A6:   g1 in right_open_halfline(r1)/\dom f and
A7:   f.g1<r by A2,RFUNCT_1:71;
      reconsider g1 as Real by A6;
      consider n such that
A8:   for m st n<=m holds |.g1.|+|.r1.|<seq.m by A4;
      take n;
      let m;
A9: m in NAT by ORDINAL1:def 12;
      assume n<=m;
      then
A10:   |.g1.|+|.r1.|<seq.m by A8;
      r1<=|.r1.| & 0<=|.g1.| by ABSVALUE:4,COMPLEX1:46;
      then 0+r1<=|.g1.|+|.r1.| by XREAL_1:7;
      then r1<seq.m by A10,XXREAL_0:2;
      then seq.m in {g2: r1<g2};
      then seq.m in rng seq & seq.m in right_open_halfline(r1) by VALUED_0:28
,XXREAL_1:230;
      then
A11:  seq.m in right_open_halfline(r1)/\dom f by A5,XBOOLE_0:def 4;
      g1<=|.g1.| & 0<=|.r1.| by ABSVALUE:4,COMPLEX1:46;
      then g1+0<=|.g1.|+|.r1.| by XREAL_1:7;
      then g1<seq.m by A10,XXREAL_0:2;
      then f.(seq.m)<=f.g1 by A1,A6,A11,RFUNCT_2:23;
      then f.(seq.m)<r by A7,XXREAL_0:2;
      hence (f/*seq).m<r by A5,FUNCT_2:108,A9;
    end;
    hence f/*seq is divergent_to-infty;
  end;
  assume for r ex g st r<g & g in dom f;
  hence thesis by A3;
end;
