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
  f1 is convergent_in-infty & f2 is convergent_in-infty & (ex r st ((dom
f1 /\ left_open_halfline(r) c= dom f2 /\ left_open_halfline(r) & for g st g in
  dom f1 /\ left_open_halfline(r) holds f1.g<=f2.g) or (dom f2 /\
left_open_halfline(r) c= dom f1 /\ left_open_halfline(r) & for g st g in dom f2
  /\ left_open_halfline(r) holds f1.g<=f2.g))) implies lim_in-infty f1<=
  lim_in-infty f2
proof
  assume that
A1: f1 is convergent_in-infty and
A2: f2 is convergent_in-infty;
  given r such that
A3: (dom f1/\left_open_halfline(r)c=dom f2/\left_open_halfline(r) & for
  g st g in dom f1/\left_open_halfline(r) holds f1.g<=f2.g) or (dom f2/\
  left_open_halfline(r)c=dom f1/\left_open_halfline(r) & for g st g in dom f2/\
  left_open_halfline(r) holds f1.g<=f2.g);
  now
    per cases by A3;
    suppose
A4:   dom f1/\left_open_halfline(r)c=dom f2/\left_open_halfline(r) &
      for g st g in dom f1/\left_open_halfline(r) holds f1.g<=f2.g;
      deffunc U(Nat) = -$1;
      defpred X[Nat,Real] means $2<-$1 & $2 in dom f1/\
      left_open_halfline r;
      consider s1 be Real_Sequence such that
A5:   for n holds s1.n=U(n) from SEQ_1:sch 1;
A6:   now
        let n being Element of NAT ;
        0<=|.r.| by COMPLEX1:46;
        then
A7:     -n-|.r.|<=-n-0 by XREAL_1:13;
        consider g such that
A8:     g<-n-|.r.| and
A9:     g in dom f1 by A1;
         reconsider g as Element of REAL by XREAL_0:def 1;
        take g;
        0<=n & -|.r.|<=r by ABSVALUE:4;
        then -|.r.|-n<=r-0 by XREAL_1:13;
        then g<r by A8,XXREAL_0:2;
        then g in {g2: g2<r};
        then g in left_open_halfline(r) by XXREAL_1:229;
        hence X[n,g] by A8,A9,A7,XBOOLE_0:def 4,XXREAL_0:2;
      end;
      consider s2 be Real_Sequence such that
A10:  for n being Element of NAT holds X[n,s2.n] from FUNCT_2:sch 3(A6);
      now
        let n;
 n in NAT by ORDINAL1:def 12;
        then s2.n<-n by A10;
        hence s2.n<=s1.n by A5;
      end;
      then
A11:  s2 is divergent_to-infty by A5,Th21,Th43;
A12:  rng s2 c=dom f2
      proof
        let x be Real;
        assume x in rng s2;
        then ex n being Element of NAT st x=s2.n by FUNCT_2:113;
        then x in dom f1/\left_open_halfline(r) by A10;
        hence thesis by A4,XBOOLE_0:def 4;
      end;
      then
A13:  lim(f2/*s2)=lim_in-infty f2 by A2,A11,Def13;
A14:  rng s2 c=dom f1
      proof
        let x be Real;
        assume x in rng s2;
        then ex n being Element of NAT st x=s2.n by FUNCT_2:113;
        then x in dom f1/\left_open_halfline(r) by A10;
        hence thesis by XBOOLE_0:def 4;
      end;
A15:  now
        let n;
A16: n in NAT by ORDINAL1:def 12;
        f1.(s2.n)<=f2.(s2.n) by A4,A10,A16;
        then (f1/*s2).n<=f2.(s2.n) by A14,FUNCT_2:108,A16;
        hence (f1/*s2).n<=(f2/*s2).n by A12,FUNCT_2:108,A16;
      end;
A17:  f2/*s2 is convergent by A2,A11,A12;
A18:  f1/*s2 is convergent by A1,A11,A14;
      lim(f1/*s2)=lim_in-infty f1 by A1,A11,A14,Def13;
      hence thesis by A18,A17,A13,A15,SEQ_2:18;
    end;
    suppose
A19:  dom f2/\left_open_halfline(r)c=dom f1/\left_open_halfline(r) &
      for g st g in dom f2/\left_open_halfline(r) holds f1.g<=f2.g;
      deffunc U(Nat) = -$1;
      defpred X[Nat,Real] means $2<-$1 & $2 in dom f2/\
      left_open_halfline r;
      consider s1 be Real_Sequence such that
A20:  for n holds s1.n=U(n) from SEQ_1:sch 1;
A21:  now
        let n being Element of NAT ;
        0<=|.r.| by COMPLEX1:46;
        then
A22:    -n-|.r.|<=-n-0 by XREAL_1:13;
        consider g such that
A23:    g<-n-|.r.| and
A24:    g in dom f2 by A2;
         reconsider g as Element of REAL by XREAL_0:def 1;
        take g;
        0<=n & -|.r.|<=r by ABSVALUE:4;
        then -|.r.|-n<=r-0 by XREAL_1:13;
        then g<r by A23,XXREAL_0:2;
        then g in {g2: g2<r};
        then g in left_open_halfline(r) by XXREAL_1:229;
        hence X[n,g] by A23,A24,A22,XBOOLE_0:def 4,XXREAL_0:2;
      end;
      consider s2 be Real_Sequence such that
A25:  for n being Element of NAT holds X[n,s2.n] from FUNCT_2:sch 3(A21);
      now
        let n;
 n in NAT by ORDINAL1:def 12;
        then s2.n<-n by A25;
        hence s2.n<=s1.n by A20;
      end;
      then
A26:  s2 is divergent_to-infty by A20,Th21,Th43;
A27:  rng s2 c=dom f1
      proof
        let x be Real;
        assume x in rng s2;
        then ex n being Element of NAT st x=s2.n by FUNCT_2:113;
        then x in dom f2/\left_open_halfline(r) by A25;
        hence thesis by A19,XBOOLE_0:def 4;
      end;
      then
A28:  lim(f1/*s2)=lim_in-infty f1 by A1,A26,Def13;
A29:  rng s2 c=dom f2
      proof
        let x be Real;
        assume x in rng s2;
        then ex n being Element of NAT st x=s2.n by FUNCT_2:113;
        then x in dom f2/\left_open_halfline(r) by A25;
        hence thesis by XBOOLE_0:def 4;
      end;
A30:  now
        let n;
A31: n in NAT by ORDINAL1:def 12;
        f1.(s2.n)<=f2.(s2.n) by A19,A25,A31;
        then (f1/*s2).n<=f2.(s2.n) by A27,FUNCT_2:108,A31;
        hence (f1/*s2).n<=(f2/*s2).n by A29,FUNCT_2:108,A31;
      end;
A32:  f1/*s2 is convergent by A1,A26,A27;
A33:  f2/*s2 is convergent by A2,A26,A29;
      lim(f2/*s2)=lim_in-infty f2 by A2,A26,A29,Def13;
      hence thesis by A33,A32,A28,A30,SEQ_2:18;
    end;
  end;
  hence thesis;
end;
