reserve x,y for set,
  i,j,k,l,m,n for Nat,
  K for Field,
  N for without_zero finite Subset of NAT,
  a,b for Element of K,
  A,B,B1,B2,X,X1,X2 for (Matrix of K),
  A9 for (Matrix of m,n,K),
  B9 for (Matrix of m,k,K);

theorem Th7:
  for K be Abelian add-associative right_zeroed
  right_complementable non empty addLoopStr for p be FinSequence of K for i,j
st i in dom p & j in dom p & i<>j & for k st k in dom p & k<>i & k<>j holds p.k
  =0.K holds Sum p = p/.i+p/.j
proof
  let K be Abelian add-associative right_zeroed right_complementable non
  empty addLoopStr;
  let p be FinSequence of K;
A1: now
    let i,j such that
A2: i in dom p and
A3: j in dom p and
A4: i<j and
A5: for k st k in dom p & k<>i & k<>j holds p.k=0.K;
A6: dom p=Seg len p by FINSEQ_1:def 3;
    then i in NAT & 1 <= i by A2,FINSEQ_1:1;
    then
A7: i in Seg i;
    set pI=p|i;
    consider q be FinSequence such that
A8: p = pI^q by FINSEQ_1:80;
    reconsider q as FinSequence of K by A8,FINSEQ_1:36;
A9: i <= len p by A2,A6,FINSEQ_1:1;
    then
A10: len pI=i by FINSEQ_1:17;
A11: dom pI=Seg i by A9,FINSEQ_1:17;
    then not j in dom pI by A4,FINSEQ_1:1;
    then consider ji be Nat such that
A12: ji in dom q and
A13: j=i + ji by A3,A8,A10,FINSEQ_1:25;
    now
      let k such that
A14:  k in dom q and
A15:  k<>ji;
      reconsider kk=k as Element of NAT by ORDINAL1:def 12;
A16:  i+kk <> i+ji by A15;
      dom q = Seg len q by FINSEQ_1:def 3;
      then k >= 1 by A14,FINSEQ_1:1;
      then k+i >= i+1 by XREAL_1:7;
      then
A17:  i+kk<>i by NAT_1:13;
      thus q.k = p.(i+kk) by A8,A10,A14,FINSEQ_1:def 7
        .= 0.K by A5,A8,A10,A13,A14,A17,A16,FINSEQ_1:28;
    end;
    then
A18: Sum q = q.ji by A12,MATRIX_3:12
      .= p.j by A8,A10,A12,A13,FINSEQ_1:def 7
      .= p/.j by A3,PARTFUN1:def 6;
A19: Seg i c= Seg len p by A9,FINSEQ_1:5;
    now
      let k such that
A20:  k in dom pI and
A21:  k<>i;
      reconsider kk=k as Element of NAT by ORDINAL1:def 12;
A22:  k<>j by A4,A11,A20,FINSEQ_1:1;
      thus pI.k = p.kk by A8,A20,FINSEQ_1:def 7
        .= 0.K by A5,A6,A11,A19,A20,A21,A22;
    end;
    then Sum pI = pI.i by A7,A11,MATRIX_3:12
      .= p.i by A8,A7,A11,FINSEQ_1:def 7
      .= p/.i by A6,A7,A19,PARTFUN1:def 6;
    hence Sum p=p/.i+p/.j by A8,A18,RLVECT_1:41;
  end;
  let i,j such that
A23: i in dom p & j in dom p and
A24: i<>j and
A25: for k st k in dom p & k<>i & k<>j holds p.k=0.K;
A26: i<j or j<i by A24,XXREAL_0:1;
  for k st k in dom p & k<>j & k<>i holds p.k=0.K by A25;
  hence thesis by A1,A23,A25,A26;
end;
