reserve k,t,i,j,m,n for Nat,
  x,y,y1,y2 for object,
  D for non empty set;
reserve K for Field,
  V for VectSp of K,
  a for Element of K,
  W for Element of V;
reserve KL1,KL2,KL3 for Linear_Combination of V,
  X for Subset of V;
reserve s for FinSequence,
  V1,V2,V3 for finite-dimensional VectSp of K,
  f,f1,f2 for Function of V1,V2,
  g for Function of V2,V3,
  b1 for OrdBasis of V1,
  b2 for OrdBasis of V2,
  b3 for OrdBasis of V3,
  v1,v2 for Vector of V2,
  v,w for Element of V1;
reserve p2,F for FinSequence of V1,
  p1,d for FinSequence of K,
  KL for Linear_Combination of V1;

theorem Th27:
  for M1 be Matrix of n,k,the carrier of V, M2 be Matrix of m,k,
  the carrier of V holds Sum(M1^M2) = (Sum M1)^(Sum M2)
proof
  let M1 be Matrix of n,k,the carrier of V;
  let M2 be Matrix of m,k,the carrier of V;
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,Def6;
    then
A4: i in dom (M1^M2) by FINSEQ_1:def 3;
    now
      per cases by A4,FINSEQ_1:25;
      suppose
A5:     i in dom M1;
        len M1 = len Sum M1 by Def6;
        then
A6:     dom M1 = dom Sum M1 by FINSEQ_3:29;
        thus Sum(M1^M2).i = (Sum(M1^M2))/.i by A3,PARTFUN1:def 6
          .= Sum ((M1^M2)/.i) by A3,Def6
          .= Sum (M1/.i) by A5,FINSEQ_4:68
          .= (Sum M1)/.i by A5,A6,Def6
          .= (Sum M1).i by A5,A6,PARTFUN1:def 6
          .= ((Sum M1)^(Sum M2)).i by A5,A6,FINSEQ_1:def 7;
      end;
      suppose
A7:     ex n be Nat st n in dom M2 & i = len M1 + n;
A8:     len M1 = len Sum M1 by Def6;
        len M2 = len Sum M2 by Def6;
        then
A9:     dom M2 = dom Sum M2 by FINSEQ_3:29;
        consider n be Nat such that
A10:    n in dom M2 and
A11:    i = len M1 + n by A7;
        thus Sum(M1^M2).i = (Sum(M1^M2))/.i by A3,PARTFUN1:def 6
          .= Sum ((M1^M2)/.i) by A3,Def6
          .= Sum (M2/.n) by A10,A11,FINSEQ_4:69
          .= (Sum M2)/.n by A10,A9,Def6
          .= (Sum M2).n by A10,A9,PARTFUN1:def 6
          .= ((Sum M1)^(Sum M2)).i by A10,A11,A8,A9,FINSEQ_1:def 7;
      end;
    end;
    hence Sum(M1^M2).i = ((Sum M1)^(Sum M2)).i;
  end;
  len Sum(M1^M2) = len (M1^M2) by Def6
    .= len M1 + len M2 by FINSEQ_1:22
    .= len Sum M1 + len M2 by Def6
    .= len Sum M1 + len Sum M2 by Def6
    .= len ((Sum M1)^(Sum M2)) by FINSEQ_1:22;
  hence thesis by A2,FINSEQ_2:9;
end;
