
theorem Th23:
for n,m,k be Nat, M1 be Matrix of n,k,ExtREAL, M2 be Matrix of m,k,ExtREAL
  holds Sum (M1^M2) = (Sum M1)^(Sum M2)
proof
   let n,m,k be Nat;
   let M1 be Matrix of n,k,ExtREAL;
   let M2 be Matrix of m,k,ExtREAL;
A1:dom Sum(M1^M2) = Seg len Sum(M1^M2) by FINSEQ_1:def 3;
A2:now let i be Nat;
    assume
A3: i in dom Sum(M1^M2); then
    i in Seg len (M1^M2) by A1,Def5; then
A4: i in dom (M1^M2) by FINSEQ_1:def 3;
A8: len M1 = len Sum M1 & len M2 = len Sum M2 by Def5; then
A6: dom M1 = dom Sum M1 & dom M2 = dom Sum M2 by FINSEQ_3:29;
    per cases by A4,FINSEQ_1:25;
    suppose A5: i in dom M1;
     thus Sum(M1^M2).i = Sum ((M1^M2).i) by A3,Def5
          .= Sum (M1.i) by A5,FINSEQ_1:def 7
          .= (Sum M1).i by A5,A6,Def5
          .= ((Sum M1)^(Sum M2)).i by A5,A6,FINSEQ_1:def 7;
    end;
    suppose ex n be Nat st n in dom M2 & i = len M1 + n; then
     consider n be Nat such that
A10:  n in dom M2 & i = len M1 + n;
     thus Sum(M1^M2).i = Sum ((M1^M2).i) by A3,Def5
         .= Sum (M2.n) by A10,FINSEQ_1:def 7
         .= (Sum M2).n by A10,A6,Def5
         .= ((Sum M1)^(Sum M2)).i by A10,A8,A6,FINSEQ_1:def 7;
    end;
   end;
   len Sum(M1^M2) = len (M1^M2) by Def5
    .= len M1 + len M2 by FINSEQ_1:22
    .= len Sum M1 + len M2 by Def5
    .= len Sum M1 + len Sum M2 by Def5
    .= len ((Sum M1)^(Sum M2)) by FINSEQ_1:22;
   hence thesis by A2,FINSEQ_2:9;
end;
