
theorem
for f be PartFunc of REAL,REAL, a,b be Real st [.a,b.[ = dom f holds
 ex F be Functional_Sequence of REAL,REAL st
  (for n be Nat holds dom(F.n) = dom f
   & (for x be Real st x in [.a,b-1/(n+1).] holds (F.n).x = f.x)
   & (for x be Real st not x in [.a,b-1/(n+1).] holds (F.n).x = 0))
& lim(R_EAL F) = f
proof
    let f be PartFunc of REAL,REAL, a,b be Real;
    assume that
A1:  [.a,b.[ = dom f;

A2: for n be Element of NAT holds [.a,b-1/(n+1).] c= dom f
    proof
     let n be Element of NAT;
     b-1/(n+1) < b by XREAL_1:44;
     hence [.a,b-1/(n+1).] c= dom f by A1,XXREAL_1:43;
    end;

    defpred P1[Element of NAT,object] means $2 = chi([.a,b-1/($1+1).],dom f);

A3: for n be Element of NAT ex ch be Element of PFuncs(REAL,REAL) st P1[n,ch]
    proof
     let n be Element of NAT;
     dom chi([.a,b-1/(n+1).],dom f) = dom f by FUNCT_3:def 3; then
     reconsider ch = chi([.a,b-1/(n+1).],dom f) as PartFunc of REAL,REAL
       by RELSET_1:5;
     reconsider ch as Element of PFuncs(REAL,REAL) by PARTFUN1:45;
     take ch;
     thus thesis;
    end;

    consider CH be sequence of PFuncs(REAL,REAL) such that
A4:  for n be Element of NAT holds P1[n,CH.n] from FUNCT_2:sch 3(A3);

    defpred P2[Element of NAT, object] means $2 = f(#)(CH.$1);

A5: for n be Element of NAT ex F be Element of PFuncs(REAL,REAL) st P2[n,F]
    proof
     let n be Element of NAT;
     reconsider F = f(#)(CH.n) as Element of PFuncs(REAL,REAL) by PARTFUN1:45;
     take F;
     thus thesis;
    end;

    consider F be sequence of PFuncs(REAL,REAL) such that
A6:  for n be Element of NAT holds P2[n,F.n] from FUNCT_2:sch 3(A5);
    take F;

    thus
A7: for n be Nat holds dom(F.n) = dom f
     & (for x be Real st x in [.a,b-1/(n+1).] holds (F.n).x = f.x)
     & (for x be Real st not x in [.a,b-1/(n+1).] holds (F.n).x = 0)
    proof
     let n be Nat;
A8:  n is Element of NAT by ORDINAL1:def 12; then
A9:  CH.n = chi([.a,b-1/(n+1).],dom f) by A4; then
A10:  dom(CH.n) = dom f by FUNCT_3:def 3;
A11: F.n = f(#)(CH.n) by A6,A8; then
A12: dom(F.n) = dom f /\ dom(CH.n) by VALUED_1:def 4;
     hence dom(F.n) = dom f by A10;
     thus for x be Real st x in [.a,b-1/(n+1).] holds (F.n).x = f.x
     proof
      let x be Real;
      assume A13: x in [.a,b-1/(n+1).];
A14:  [.a,b-1/(n+1).] c= dom f by A8,A2; then
      (CH.n).x = 1 by A9,A13,FUNCT_3:def 3; then
      (F.n).x = (f.x) * 1 by A11,A12,A10,A13,A14,VALUED_1:def 4;
      hence thesis;
     end;
     thus for x be Real st not x in [.a,b-1/(n+1).] holds (F.n).x = 0
     proof
      let x be Real;
      assume A15: not x in [.a,b-1/(n+1).];
      per cases;
      suppose A16: x in dom f; then
       (CH.n).x = 0 by A9,A15,FUNCT_3:def 3; then
       (F.n).x = (f.x) * 0 by A11,A12,A10,A16,VALUED_1:def 4;
       hence (F.n).x = 0;
      end;
      suppose not x in dom f;
       hence (F.n).x = 0 by A12,A10,FUNCT_1:def 2;
      end;
     end;
    end;

    dom(lim(R_EAL F)) = dom((R_EAL F).0) by MESFUNC8:def 9; then
    dom(lim(R_EAL F)) = dom(F.0) by MESFUN7C:def 1; then
A17: dom(lim(R_EAL F)) = dom f by A7; then
A18: dom(lim (R_EAL F)) = dom(R_EAL f) by MESFUNC5:def 7;
A19: for x be Element of REAL st x in dom (lim (R_EAL F)) holds
     (lim (R_EAL F)).x = (R_EAL f).x
    proof
     let x be Element of REAL;
     assume
A20:   x in dom(lim(R_EAL F)); then
A21:  a <= x < b by A1,A17,XXREAL_1:3; then
A22:  0 < b-x by XREAL_1:50;

A23:  (lim(R_EAL F)).x = lim((R_EAL F)#x) by A20,MESFUNC8:def 9;

A24:  for p be Real st 0<p ex n be Nat st for m be Nat st n<=m holds
      |. ((R_EAL F)#x).m - f.x qua ExtReal .| < p
     proof
      let p be Real;
      assume A25: 0<p;
      consider n be Nat such that
A26:    1/(b-x) < n by SEQ_4:3;
      n <= n+1 by NAT_1:13; then
      1/(b-x) < 1*(n+1) by A26,XXREAL_0:2; then
      1/(n+1) < 1*(b-x) by A22,XREAL_1:113; then
      x+1/(n+1) < b by XREAL_1:20; then
A27:  x < b-1/(n+1) by XREAL_1:20;

      take n;
      hereby let m be Nat;
       assume n<=m; then
       n+1 <= m+1 by XREAL_1:6; then
       1/(m+1) <= 1/(n+1) by XREAL_1:118; then
       b-1/(n+1) <= b-1/(m+1) by XREAL_1:10; then
       x < b-1/(m+1) by A27,XXREAL_0:2; then
       x in [.a,b-1/(m+1).] by A21,XXREAL_1:1; then
       (F.m).x = f.x by A7; then
       ((R_EAL F).m).x = f.x by MESFUN7C:def 1; then
       ((R_EAL F)#x).m = f.x by MESFUNC5:def 13; then
       ((R_EAL F)#x).m - f.x qua ExtReal
        = ((R_EAL F)#x).m + (- ((R_EAL F)#x).m) by XXREAL_3:def 4;
       hence |. ((R_EAL F)#x).m - f.x qua ExtReal .| < p
         by A25,EXTREAL1:16,XXREAL_3:7;
      end;
     end; then
     (R_EAL F)#x is convergent_to_finite_number by MESFUNC5:def 8; then
     lim((R_EAL F)#x) = f.x by A24,MESFUNC5:def 12;
     hence (lim(R_EAL F)).x = (R_EAL f).x by A23,MESFUNC5:def 7;
    end;
    lim (R_EAL F) = (R_EAL f) by A18,A19,PARTFUN1:5;
    hence lim(R_EAL F) = f by MESFUNC5:def 7;
end;
