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

theorem
  f1 is_convergent_in x0 & f2 is_convergent_in x0 & (ex r st 0<r & ((dom
f1 /\ (].x0-r,x0.[ \/ ].x0,x0+r.[) c= dom f2 /\ (].x0-r,x0.[ \/ ].x0,x0+r.[) &
for g st g in dom f1 /\ (].x0-r,x0.[ \/ ].x0,x0+r.[) holds f1.g<=f2.g) or (dom
f2 /\ (].x0-r,x0.[ \/ ].x0,x0+r.[) c= dom f1 /\ (].x0-r,x0.[ \/ ].x0,x0+r.[) &
  for g st g in dom f2 /\ (].x0-r,x0.[ \/ ].x0,x0+r.[) holds f1.g<= f2.g)))
  implies lim(f1,x0)<=lim(f2,x0)
proof
  assume that
A1: f1 is_convergent_in x0 and
A2: f2 is_convergent_in x0;
  given r such that
A3: 0<r and
A4: (dom f1/\(].x0-r,x0.[\/].x0,x0+r.[)c=dom f2/\(].x0-r,x0.[\/].x0,x0+r
  .[) & for g st g in dom f1/\(].x0-r,x0.[\/].x0,x0+r.[) holds f1.g<=f2.g) or (
dom f2/\(].x0-r,x0.[\/].x0,x0+r.[)c=dom f1/\(].x0-r,x0.[\/].x0,x0+r.[) & for g
  st g in dom f2/\(].x0-r,x0.[\/].x0,x0+r.[) holds f1.g<=f2.g);
  now
    per cases by A4;
    suppose
A5:   dom f1/\(].x0-r,x0.[\/].x0,x0+r.[)c=dom f2/\(].x0-r,x0.[\/].x0,
x0+r.[) & for g st g in dom f1/\(].x0-r,x0.[\/].x0,x0+r.[) holds f1.g<=f2.g;
      defpred X[Nat,Real] means x0-1/($1+1)<$2 & $2<x0 & $2
      in dom f1;
A6:   now
        let n be Element of NAT;
A7:     x0<x0+1 by Lm1;
        x0-1/(n+1)<x0 by Lm3;
        then consider g1,g2 such that
A8:    x0-1/(n+1)<g1 and
A9:    g1<x0 and
A10:    g1 in dom f1 and
        g2<x0+1 and
        x0<g2 and
        g2 in dom f1 by A1,A7;
         reconsider g1 as Element of REAL by XREAL_0:def 1;
        take g1;
        thus X[n,g1] by A8,A9,A10;
      end;
      consider s be Real_Sequence such that
A11:  for n holds X[n,s.n] from FUNCT_2:sch 3(A6);
A12:  lim s=x0 by A11,Th6;
A13:  rng s c=dom f1\{x0} by A11,Th6;
A14:  s is convergent by A11,Th6;
      x0-r<x0 by A3,Lm1;
      then consider k being Nat such that
A15:  for n being Nat  st k<=n holds x0-r<s.n by A14,A12,LIMFUNC2:1;
A16:  lim(s^\k)=x0 by A14,A12,SEQ_4:20;
      rng(s^\k)c=rng s by VALUED_0:21;
      then
A17:  rng(s^\k)c=dom f1\{x0} by A13;
      then
A18:  lim(f1/*(s^\k))=lim(f1,x0) by A1,A14,A16,Def4;
      now
        let x be object;
        assume x in rng(s^\k);
        then consider n such that
A19:    (s^\k).n=x by FUNCT_2:113;
A20:    n+k in NAT by ORDINAL1:def 12;
        s.(n+k)<x0 by A11,A20;
        then
A21:    (s^\k).n<x0 by NAT_1:def 3;
        x0-r<s.(n+k) by A15,NAT_1:12;
        then x0-r<(s^\k).n by NAT_1:def 3;
        then (s^\k).n in {g2: x0-r<g2 & g2<x0} by A21;
        then (s^\k).n in ].x0-r,x0 .[ by RCOMP_1:def 2;
        then
A22:    (s^\k).n in ].x0-r,x0.[\/].x0,x0+r.[ by XBOOLE_0:def 3;
        s.(n+k) in dom f1 by A11,A20;
        then (s^\k).n in dom f1 by NAT_1:def 3;
        hence x in dom f1/\(].x0-r,x0.[\/].x0,x0+r.[) by A19,A22,XBOOLE_0:def 4
;
      end;
      then
A23:  rng(s^\k)c=dom f1/\(].x0-r,x0.[\/].x0,x0+r.[);
      then
A24:  rng(s^\k)c=dom f2/\(].x0-r,x0.[\/].x0,x0+r.[) by A5;
A25:  now
        let n be Nat;
A26:    n in NAT by ORDINAL1:def 12;
        (s^\k).n in rng(s^\k) by VALUED_0:28;
        then f1.((s^\k).n)<=f2.((s^\k).n) by A5,A23;
        then f1.((s^\k).n)<=(f2/*(s^\k)).n
by A24,FUNCT_2:108,XBOOLE_1:18,A26;
        hence (f1/*(s^\k)).n<=(f2/*(s^\k)).n
by A23,FUNCT_2:108,XBOOLE_1:18,A26;
      end;
A27:  rng(s^\k)c=dom f2 by A24,XBOOLE_1:18;
A28:  rng(s^\k)c=dom f2\{x0}
      proof
        let x be object;
        assume
A29:    x in rng(s^\k);
        then not x in {x0} by A17,XBOOLE_0:def 5;
        hence thesis by A27,A29,XBOOLE_0:def 5;
      end;
      then
A30:  lim(f2/*(s^\k))=lim(f2,x0) by A2,A14,A16,Def4;
A31:  f2/*(s^\k) is convergent by A2,A14,A16,A28;
      f1/*(s^\k) is convergent by A1,A14,A16,A17;
      hence thesis by A18,A31,A30,A25,SEQ_2:18;
    end;
    suppose
A32:  dom f2/\(].x0-r,x0.[\/].x0,x0+r.[)c=dom f1/\(].x0-r,x0.[\/].x0,
x0+r.[) & for g st g in dom f2/\(].x0-r,x0.[\/].x0,x0+r.[) holds f1.g<=f2.g;
      defpred X[Element of NAT,Real] means x0-1/($1+1)<$2 & $2<x0 & $2
      in dom f2;
A33:  now
        let n;
A34:    x0<x0+1 by Lm1;
        x0-1/(n+1)<x0 by Lm3;
        then consider g1,g2 such that
A35:    x0-1/(n+1)<g1 and
A36:    g1<x0 and
A37:    g1 in dom f2 and
        g2<x0+1 and
        x0<g2 and
        g2 in dom f2 by A2,A34;
         reconsider g1 as Element of REAL by XREAL_0:def 1;
        take g1;
        thus X[n,g1] by A35,A36,A37;
      end;
      consider s be Real_Sequence such that
A38:  for n holds X[n,s.n] from FUNCT_2:sch 3(A33 );
A39:  lim s=x0 by A38,Th6;
A40:  rng s c=dom f2\{x0} by A38,Th6;
A41:  s is convergent by A38,Th6;
      x0-r<x0 by A3,Lm1;
      then consider k being Nat such that
A42:  for n being Nat st k<=n holds x0-r<s.n by A41,A39,LIMFUNC2:1;
A43:  lim(s^\k)=x0 by A41,A39,SEQ_4:20;
      rng(s^\k)c=rng s by VALUED_0:21;
      then
A44:  rng(s^\k)c=dom f2\{x0} by A40;
      then
A45:  lim(f2/*(s^\k))=lim(f2,x0) by A2,A41,A43,Def4;
A46:  now
        let x be object;
        assume x in rng(s^\k);
        then consider n such that
A47:    (s^\k).n=x by FUNCT_2:113;
A48:    n+k in NAT by ORDINAL1:def 12;
        s.(n+k)<x0 by A38,A48;
        then
A49:    (s^\k).n<x0 by NAT_1:def 3;
        x0-r<s.(n+k) by A42,NAT_1:12;
        then x0-r<(s^\k).n by NAT_1:def 3;
        then (s^\k).n in {g2: x0-r<g2 & g2<x0} by A49;
        then (s^\k).n in ].x0-r,x0 .[ by RCOMP_1:def 2;
        then
A50:    (s^\k).n in ].x0-r,x0.[\/].x0,x0+r.[ by XBOOLE_0:def 3;
        s.(n+k) in dom f2 by A38,A48;
        then (s^\k).n in dom f2 by NAT_1:def 3;
        hence x in dom f2/\(].x0-r,x0.[\/].x0,x0+r.[) by A47,A50,XBOOLE_0:def 4
;
      end;
      then
A51:  rng(s^\k)c=dom f2/\(].x0-r,x0.[\/].x0,x0+r.[);
      then
A52:  rng(s^\k)c=dom f1/\(].x0-r,x0.[\/].x0,x0+r.[) by A32;
A53:  now
        let n be Nat;
A54:    n in NAT by ORDINAL1:def 12;
        (s^\k).n in rng(s^\k) by VALUED_0:28;
        then f1.((s^\k).n)<=f2.((s^\k).n) by A32,A46;
        then f1.((s^\k).n)<=(f2/*(s^\k)).n
by A51,FUNCT_2:108,XBOOLE_1:18,A54;
        hence (f1/*(s^\k)).n<=(f2/*(s^\k)).n
by A52,FUNCT_2:108,XBOOLE_1:18,A54;
      end;
A55:  rng(s^\k)c=dom f1 by A52,XBOOLE_1:18;
A56:  rng(s^\k)c=dom f1\{x0}
      proof
        let x be object;
        assume
A57:    x in rng(s^\k);
        then not x in {x0} by A44,XBOOLE_0:def 5;
        hence thesis by A55,A57,XBOOLE_0:def 5;
      end;
      then
A58:  lim(f1/*(s^\k))=lim(f1,x0) by A1,A41,A43,Def4;
A59:  f1/*(s^\k) is convergent by A1,A41,A43,A56;
      f2/*(s^\k) is convergent by A2,A41,A43,A44;
      hence thesis by A45,A59,A58,A53,SEQ_2:18;
    end;
  end;
  hence thesis;
end;
