
theorem Th79:
for f be without-infty Function of [:NAT,NAT:],ExtREAL holds
  Partial_Sums f is convergent_in_cod1_to_finite iff
    Partial_Sums_in_cod1 f is convergent_in_cod1_to_finite
proof
   let f be without-infty Function of [:NAT,NAT:],ExtREAL;
   hereby assume A1: Partial_Sums f is convergent_in_cod1_to_finite;
    now let m be Element of NAT;
     defpred P[Nat] means
      for k be Element of NAT st k = $1 holds
       ProjMap2(Partial_Sums_in_cod1 f,k) is convergent_to_finite_number;
     now let k be Element of NAT;
      assume k = 0; then
      ProjMap2(Partial_Sums f,k) = ProjMap2(Partial_Sums_in_cod1 f,k)
        by Th54;
      hence
       ProjMap2(Partial_Sums_in_cod1 f,k) is convergent_to_finite_number by A1;
     end; then
A3:  P[0];
A4:  for m1 be Nat st P[m1] holds P[m1+1]
     proof
      let m1 be Nat;
      reconsider m=m1 as Element of NAT by ORDINAL1:def 12;
      assume X1: P[m1];
      hereby let k be Element of NAT;
       assume B2: k = m1+1; then
       reconsider k1 = k-1 as Element of NAT by NAT_1:11,21;
F1:    ProjMap2(Partial_Sums_in_cod1 f,m) is convergent_to_finite_number by X1;
       not ProjMap2(Partial_Sums_in_cod1 f,m) is convergent_to_+infty
     & not ProjMap2(Partial_Sums_in_cod1 f,m) is convergent_to_-infty
         by X1,MESFUNC5:50,51; then
       consider G0 be Real such that
F3:     lim(ProjMap2(Partial_Sums_in_cod1 f,m)) = G0
      & (for e be Real st 0<e ex N be Nat st for n be Nat st N<=n holds
          |.ProjMap2(Partial_Sums_in_cod1 f,m).n
             - lim(ProjMap2(Partial_Sums_in_cod1 f,m)).| < e)
      & ProjMap2(Partial_Sums_in_cod1 f,m) is convergent_to_finite_number
          by F1,MESFUNC5:def 12;
       consider G1 be Real such that
E3:     lim(ProjMap2(Partial_Sums f,m)) = G1
      & (for e be Real st 0<e ex N be Nat st for n be Nat st N<=n holds
          |.ProjMap2(Partial_Sums f,m).n
             - lim(ProjMap2(Partial_Sums f,m)).| < e)
           by A1,MESFUNC9:7;
       consider G2 be Real such that
E4:     lim(ProjMap2(Partial_Sums f,k)) = G2
      & (for e be Real st 0<e ex N be Nat st for n be Nat st N<=n holds
          |.ProjMap2(Partial_Sums f,k).n
             - lim(ProjMap2(Partial_Sums f,k)).| < e)
           by A1,MESFUNC9:7;
E7:    -G1 = -lim(ProjMap2(Partial_Sums f,m))
     & -G2 = -lim(ProjMap2(Partial_Sums f,k)) by E3,E4,XXREAL_3:def 3; then
E5:    G2+ -G1
        = lim(ProjMap2(Partial_Sums f,k)) + - lim(ProjMap2(Partial_Sums f,m))
                   by E4,XXREAL_3:def 2;
       now let e be Real;
        assume B6: 0<e; then
        consider N1 be Nat such that
B7:      for n be Nat st n>=N1 holds
          |.ProjMap2(Partial_Sums f,m).n
             - lim(ProjMap2(Partial_Sums f,m)).| < e/2 by E3;
        consider N2 be Nat such that
B8:      for n be Nat st n>=N2 holds
          |.ProjMap2(Partial_Sums f,k).n
             - lim(ProjMap2(Partial_Sums f,k)).| < e/2 by B6,E4;
        consider N0 be Nat such that
B10:     for n be Nat st n>=N0 holds
          |.ProjMap2(Partial_Sums_in_cod1 f,m).n
             - lim(ProjMap2(Partial_Sums_in_cod1 f,m)).| < e by B6,F3;
        reconsider N=max(max(N1,N2),N0) as Nat by TARSKI:1;
        take N;
        hereby let n be Nat;
         assume B9: n>=N;
         N >= max(N1,N2) & N >= N0 & max(N1,N2) >= N1 & max(N1,N2) >= N2
           by XXREAL_0:25; then
         N >= N1 & N >= N2 & N >= N0 by XXREAL_0:2; then
K0:      n >= N1 & n >= N2 & n >= N0 by B9,XXREAL_0:2; then
         |.ProjMap2(Partial_Sums f,m).n
             - lim(ProjMap2(Partial_Sums f,m)).| < e/2
       & |.ProjMap2(Partial_Sums f,k).n
             - lim(ProjMap2(Partial_Sums f,k)).| < e/2
       & |.ProjMap2(Partial_Sums_in_cod1 f,m).n
             - lim(ProjMap2(Partial_Sums_in_cod1 f,m)).| < e by B7,B8,B10; then
B12:     |.ProjMap2(Partial_Sums f,m).n
             - lim(ProjMap2(Partial_Sums f,m)).|
          + |.ProjMap2(Partial_Sums f,k).n
               - lim(ProjMap2(Partial_Sums f,k)).| < (e/2) qua ExtReal + e/2
               by XXREAL_3:64;
K2:      now assume ProjMap2(Partial_Sums f,m).n = +infty; then
          ProjMap2(Partial_Sums f,m).n
             - lim(ProjMap2(Partial_Sums f,m)) = +infty
                 by E3,XXREAL_3:13;
          hence contradiction by K0,B7,XXREAL_0:3,EXTREAL1:30;
         end;
KK2:     now assume ProjMap2(Partial_Sums f,m).n = -infty; then
          ProjMap2(Partial_Sums f,m).n
             - lim(ProjMap2(Partial_Sums f,m)) = -infty
                 by E3,XXREAL_3:14;
          hence contradiction by K0,B7,XXREAL_0:3,EXTREAL1:30;
         end;
K5:      now assume ProjMap2(Partial_Sums f,k).n = +infty; then
          ProjMap2(Partial_Sums f,k).n
             - lim(ProjMap2(Partial_Sums f,k)) = +infty
                 by E4,XXREAL_3:13;
          hence contradiction by K0,B8,XXREAL_0:3,EXTREAL1:30;
         end;
KK5:     now assume ProjMap2(Partial_Sums f,k).n = -infty; then
          ProjMap2(Partial_Sums f,k).n
             - lim(ProjMap2(Partial_Sums f,k)) = -infty
                 by E4,XXREAL_3:14;
          hence contradiction by K0,B8,XXREAL_0:3,EXTREAL1:30;
         end;
         reconsider n1=n as Element of NAT by ORDINAL1:def 12;
XX2:     ProjMap2(Partial_Sums f,k).n
          = (Partial_Sums f).(n1,k) by MESFUNC9:def 7
         .= (Partial_Sums f).(n1,m)
              + (Partial_Sums_in_cod1 f).(n1,k) by B2,DefCSM
         .= ProjMap2(Partial_Sums f,m).n
              + (Partial_Sums_in_cod1 f).(n1,k) by MESFUNC9:def 7
         .= ProjMap2(Partial_Sums f,m).n
              + ProjMap2(Partial_Sums_in_cod1 f,k).n by MESFUNC9:def 7;
         ProjMap2(Partial_Sums f,k).n in REAL by K5,KK5,XXREAL_0:14; then
         reconsider r4=ProjMap2(Partial_Sums f,k).n as Real;
         ProjMap2(Partial_Sums f,m).n in REAL by K2,KK2,XXREAL_0:14; then
         reconsider r5=ProjMap2(Partial_Sums f,m).n as Real;
         r4 = r5 + ProjMap2(Partial_Sums_in_cod1 f,k).n by XX2; then
         ProjMap2(Partial_Sums_in_cod1 f,k).n <> +infty
       & ProjMap2(Partial_Sums_in_cod1 f,k).n <> -infty; then
         ProjMap2(Partial_Sums_in_cod1 f,k).n in REAL by XXREAL_0:14; then
         reconsider r1=ProjMap2(Partial_Sums_in_cod1 f,k).n as Real;
T1:      ProjMap2(Partial_Sums_in_cod1 f,k).n
              - ( lim(ProjMap2(Partial_Sums f,k))
              - lim(ProjMap2(Partial_Sums f,m)) )
         = ProjMap2(Partial_Sums_in_cod1 f,k).n - (G2 - G1) by E5
        .= r1 + - (G2 - G1) by XXREAL_3:def 2;
T2:      r5 + r1 = ProjMap2(Partial_Sums f,m).n
                 + ProjMap2(Partial_Sums_in_cod1 f,k).n by XXREAL_3:def 2;
E8:       ProjMap2(Partial_Sums f,k).n
                   + - lim(ProjMap2(Partial_Sums f,k)) = r4 + -G2 &
          ProjMap2(Partial_Sums f,m).n
                  + - lim(ProjMap2(Partial_Sums f,m)) = r5 + -G1
                     by E7,XXREAL_3:def 2; then
         -( ProjMap2(Partial_Sums f,m).n
                  - lim(ProjMap2(Partial_Sums f,m)) )= -(r5 -G1)
                   by XXREAL_3:def 3; then
         ( ProjMap2(Partial_Sums f,k).n
                    - lim(ProjMap2(Partial_Sums f,k)) )
             +  -( ProjMap2(Partial_Sums f,m).n
                   - lim(ProjMap2(Partial_Sums f,m)) )
           = (r4 - G2) + - (r5 - G1) by E8,XXREAL_3:def 2; then
T3:         ( ProjMap2(Partial_Sums f,k).n
                    - lim(ProjMap2(Partial_Sums f,k)) )
               -( ProjMap2(Partial_Sums f,m).n
                   - lim(ProjMap2(Partial_Sums f,m)) )
           = (r4 - G2) - (r5 - G1);
         |.ProjMap2(Partial_Sums_in_cod1 f,k).n
             - ( lim(ProjMap2(Partial_Sums f,k))
                - lim(ProjMap2(Partial_Sums f,m)) ).|
           <= |.ProjMap2(Partial_Sums f,k).n
                   - lim(ProjMap2(Partial_Sums f,k)).|
              + |.ProjMap2(Partial_Sums f,m).n
                   - lim(ProjMap2(Partial_Sums f,m)).|
                     by T1,T2,XX2,T3,EXTREAL1:32;
         hence |.ProjMap2(Partial_Sums_in_cod1 f,k).n
             - ( G2-G1 ).| < e by B12,E5,XXREAL_0:2;
        end;
       end;
       hence
        ProjMap2(Partial_Sums_in_cod1 f,k) is convergent_to_finite_number
         by MESFUNC5:def 8;
      end;
     end;
     for m1 be Nat holds P[m1] from NAT_1:sch 2(A3,A4);
     hence
      ProjMap2(Partial_Sums_in_cod1 f,m) is convergent_to_finite_number;
    end;
    hence Partial_Sums_in_cod1 f is convergent_in_cod1_to_finite;
   end;
   assume C0: Partial_Sums_in_cod1 f is convergent_in_cod1_to_finite;
   now let m be Element of NAT;
    defpred P[Nat] means
     for k be Element of NAT st k = $1 holds
     ProjMap2(Partial_Sums f,k) is convergent_to_finite_number;
    ProjMap2(Partial_Sums f,0) = ProjMap2(Partial_Sums_in_cod1 f,0)
      by Th54; then
C1: P[0] by C0;
C2: for m be Nat st P[m] holds P[m+1]
    proof
     let m be Nat;
     assume C3: P[m];
     reconsider m1=m as Element of NAT by ORDINAL1:def 12;
     hereby let k be Element of NAT;
      assume C4: k=m+1; then
      reconsider k1=k-1 as Element of NAT by NAT_1:11,21;
      reconsider f1 = ProjMap2(Partial_Sums f,m1),
        f2 = ProjMap2(Partial_Sums_in_cod1 f,m1+1)
        as without-infty ExtREAL_sequence;
      for n be Element of NAT holds
       ProjMap2(Partial_Sums f,k).n
       = (ProjMap2(Partial_Sums f,m1)
         + ProjMap2(Partial_Sums_in_cod1 f,m1+1)).n
      proof
       let n be Element of NAT;
       ProjMap2(Partial_Sums f,k).n
        = (Partial_Sums f).(n,m1+1) by C4,MESFUNC9:def 7
       .= (Partial_Sums_in_cod1(Partial_Sums_in_cod2 f)).(n,m1+1)
             by Lm8
       .= (Partial_Sums_in_cod1 f).(n,m1+1)
            + (Partial_Sums_in_cod1(Partial_Sums_in_cod2 f)).(n,m1) by Th47
       .= (Partial_Sums_in_cod1 f).(n,m1+1)
            + (Partial_Sums f).(n,m1) by Lm8
       .= ProjMap2(Partial_Sums_in_cod1 f,m1+1).n
            + (Partial_Sums f).(n,m1) by MESFUNC9:def 7
       .= ProjMap2(Partial_Sums_in_cod1 f,m1+1).n
            + ProjMap2(Partial_Sums f,m1).n by MESFUNC9:def 7;
       hence thesis by Th7;
      end; then
C5:   ProjMap2(Partial_Sums f,k) = f1+f2 by FUNCT_2:def 8;
      ProjMap2(Partial_Sums f,m1) is convergent_to_finite_number
    & ProjMap2(Partial_Sums_in_cod1 f,m1+1) is convergent_to_finite_number
        by C3,C0;
      hence ProjMap2(Partial_Sums f,k) is convergent_to_finite_number
        by C5,Th23;
     end;
    end;
    for m be Nat holds P[m] from NAT_1:sch 2(C1,C2);
    hence ProjMap2(Partial_Sums f,m) is convergent_to_finite_number;
   end;
   hence thesis;
end;
