
theorem Th1:
  for F,G,H be FinSequence of ExtREAL st F is nonnegative &
  G is nonnegative &
  dom F = dom
  G & H = F + G holds Sum(H)=Sum(F)+Sum(G)
proof
  let F,G,H be FinSequence of ExtREAL;
  assume that
A1: F is nonnegative and 
A2: G is nonnegative and 
A3: dom F = dom G and
A4: H = F + G;
  for y be object st y in rng F holds not y in {-infty}
  proof
    let y be object;
    assume y in rng F;
    then consider x be object such that
A5: x in dom F and
A6: y = F.x by FUNCT_1:def 3;
    reconsider x as Element of NAT by A5;
    0. <= F.x by A1,SUPINF_2:39;
    hence thesis by A6,TARSKI:def 1;
  end;
  then rng F misses {-infty} by XBOOLE_0:3;
  then
A7: F"{-infty} = {} by RELAT_1:138;
  for y be object st y in rng G holds not y in {-infty}
  proof
    let y be object;
    assume y in rng G;
    then consider x be object such that
A8: x in dom G and
A9: y = G.x by FUNCT_1:def 3;
    reconsider x as Element of NAT by A8;
    0. <= G.x by A2,SUPINF_2:39;
    hence thesis by A9,TARSKI:def 1;
  end;
  then rng G misses {-infty} by XBOOLE_0:3;
  then
A10: G"{-infty} = {} by RELAT_1:138;
A11: dom H = (dom F /\ dom G)\((F"{-infty}/\G"{+infty})\/(F"{+infty}/\G"{
  -infty})) by A4,MESFUNC1:def 3
    .= dom F by A3,A7,A10;
  then
A12: len H = len F by FINSEQ_3:29;
  consider h be sequence of ExtREAL such that
A13: Sum(H) = h.(len H) and
A14: h.0 = 0. and
A15: for i be Nat st i < len H holds h.(i+1) = h.i + H.(i+1)
  by EXTREAL1:def 2;
  consider f be sequence of ExtREAL such that
A16: Sum(F) = f.(len F) and
A17: f.0 = 0. and
A18: for i be Nat st i < len F holds f.(i+1) = f.i + F.(i+1)
  by EXTREAL1:def 2;
  consider g be sequence of ExtREAL such that
A19: Sum(G) = g.(len G) and
A20: g.0 = 0. and
A21: for i be Nat st i < len G holds g.(i+1) = g.i + G.(i+1)
  by EXTREAL1:def 2;
  defpred P[Nat] means $1 <= len H implies h.$1 = f.$1 + g.$1;
A22: len H = len G by A3,A11,FINSEQ_3:29;
A23: for k being Nat st P[k] holds P[k + 1]
  proof
    let k be Nat;
    assume
A24: P[k];
    assume
A25: k+1 <= len H;
    reconsider k as Element of NAT by ORDINAL1:def 12;
A26: k < len H by A25,NAT_1:13;
    then
A27: f.(k+1) = f.k + F.(k+1) & g.(k+1) = g.k + G.(k+1) by A18,A21,A12,A22;
    1 <= k+1 by NAT_1:11;
    then
A28: k+1 in dom H by A25,FINSEQ_3:25;
A29: f.k <> -infty & g.k <> -infty & F.(k+1) <> -infty & G.(k+1) <> -infty
    proof
      defpred Pg[Nat] means $1 <= len H implies g.$1 <> -infty;
      defpred Pf[Nat] means $1 <= len H implies f.$1 <> -infty;
A30:  for m be Nat st Pf[m] holds Pf[m+1]
      proof
        let m be Nat;
        assume
A31:    Pf[m];
        assume
A32:    m+1 <= len H;
        reconsider m as Element of NAT by ORDINAL1:def 12;
A33:    0. <= F.(m+1) by A1,SUPINF_2:39;
        m < len H by A32,NAT_1:13;
        then f.(m+1) = f.m + F.(m+1) by A18,A12;
        hence thesis by A31,A32,A33,NAT_1:13,XXREAL_3:17;
      end;
A34:  Pf[0] by A17;
      for i be Nat holds Pf[i] from NAT_1:sch 2(A34,A30);
      hence f.k <> -infty by A26;
A35:  for m be Nat st Pg[m] holds Pg[m+1]
      proof
        let m be Nat;
        assume
A36:    Pg[m];
        assume
A37:    m+1 <= len H;
        reconsider m as Element of NAT by ORDINAL1:def 12;
A38:    0. <= G.(m+1) by A2,SUPINF_2:39;
        m < len H by A37,NAT_1:13;
        then g.(m+1) = g.m + G.(m+1) by A21,A22;
        hence thesis by A36,A37,A38,NAT_1:13,XXREAL_3:17;
      end;
A39:  Pg[0] by A20;
      for i be Nat holds Pg[i] from NAT_1:sch 2(A39,A35);
      hence g.k <> -infty by A26;
      thus F.(k+1) <> -infty by A1,SUPINF_2:51;
      thus thesis by A2,SUPINF_2:51;
    end;
    then
A40: f.k + F.(k+1) <> -infty by XXREAL_3:17;
A41: h.(k+1) = (f.k + g.k) + H.(k+1) by A15,A24,A26
      .= (f.k + g.k) + (F.(k+1) + G.(k+1)) by A4,A28,MESFUNC1:def 3;
    f.k + g.k <> -infty by A29,XXREAL_3:17;
    then h.(k+1) = ((f.k + g.k) + F.(k+1)) + G.(k+1) by A41,A29,XXREAL_3:29
      .= (f.k + F.(k+1) + g.k) + G.(k+1) by A29,XXREAL_3:29
      .= f.(k+1) + g.(k+1) by A27,A29,A40,XXREAL_3:29;
    hence thesis;
  end;
A42: P[0] by A17,A20,A14;
  for i be Nat holds P[i] from NAT_1:sch 2(A42,A23);
  hence thesis by A16,A19,A13,A12,A22;
end;
