reserve V for RealLinearSpace,
  W for Subspace of V,
  x, y, y1, y2 for set,
  i, n for Element of NAT,
  v for VECTOR of V,
  KL1, KL2 for Linear_Combination of V,
  X for Subset of V;

theorem Th4:
  for L being Linear_Combination of V for F, G being FinSequence of
the carrier of V for P being Permutation of dom F st G = F*P holds Sum(L (#) F)
  = Sum(L (#) G)
proof
  let L be Linear_Combination of V;
  let F, G be FinSequence of the carrier of V;
  set p = L (#) F, q = L (#) G;
  let P be Permutation of dom F such that
A1: G = F*P;
A2: len G = len F by A1,FINSEQ_2:44;
  len F = len(L (#) F) by RLVECT_2:def 7;
  then
A3: dom F = dom(L (#) F) by FINSEQ_3:29;
  then reconsider r = (L (#) F)*P as FinSequence of the carrier of V by
FINSEQ_2:47;
  len r = len(L (#) F) by A3,FINSEQ_2:44;
  then
A4: dom r = dom(L (#) F) by FINSEQ_3:29;
A5: len p = len F by RLVECT_2:def 7;
  then
A6: dom F = dom p by FINSEQ_3:29;
  len q = len G by RLVECT_2:def 7;
  then
A7: dom p = dom q by A5,A2,FINSEQ_3:29;
A8: dom F = dom G by A2,FINSEQ_3:29;
A9: now
    let k be Nat;
    assume
A10: k in dom q;
    set l = P.k;
    dom P = dom F & rng P = dom F by FUNCT_2:52,def 3;
    then
A11: l in dom F by A7,A6,A10,FUNCT_1:def 3;
    then reconsider l as Element of NAT;
    G/.k = G.k by A7,A8,A6,A10,PARTFUN1:def 6
      .= F.(P.k) by A1,A7,A8,A6,A10,FUNCT_1:12
      .= F/.l by A11,PARTFUN1:def 6;
    then q.k = L.(F/.l) * (F/.l) by A10,RLVECT_2:def 7
      .= (L (#) F).(P.k) by A6,A11,RLVECT_2:def 7
      .= r.k by A7,A4,A10,FUNCT_1:12;
    hence q.k = r.k;
  end;
  thus Sum(p) = Sum(r) by A3,RLVECT_2:7
    .= Sum(q) by A7,A4,A9,FINSEQ_1:13;
end;
