reserve
  j, k, l, n, m, t,i for Nat,
  K for comRing, 
  a for Element of K,
  M,M1,M2 for Matrix of n,m,K,
  pK,qK for FinSequence of K,
  A for Matrix of n,K;

theorem Th5:
  l in dom M & k in dom M & i in dom M & M1 = RlineXScalar(M,l,k,a)
implies (i = l implies Line(M1,i) = a*Line(M,k) + Line(M,l)) & (i <> l implies
  Line(M1,i) = Line(M,i))
proof
  assume that
A1: l in dom M and
A2: k in dom M and
A3: i in dom M and
A4: M1 = RlineXScalar(M,l,k,a);
  thus i = l implies Line(M1,i) = a*Line(M,k) + Line(M,l)
  proof
A5: len (a*Line(M,k)+Line(M,l)) = width M by CARD_1:def 7;
A6: len Line(M1,i) = width M1 by MATRIX_0:def 7;
A7: width M1 = width M by Th1;
    assume
A8: i=l;
    now
      let j be Nat such that
A9:   1 <=j & j <= len Line(M1,i);
A10:  j in Seg width M1 by A6,A9;
      then
A11:  (Line(M,l)).j = M*(l,j) by A7,MATRIX_0:def 7;
      then consider a2 being Element of K such that
A12:  a2 = (Line(M,l)).j;
      (a*Line(M,k)).j = a*(M*(k,j)) by A2,A7,A10,Th3;
      then consider a1 being Element of K such that
A13:  a1 = (a*Line(M,k)).j;
      j in dom (a*Line(M,k) + Line(M,l)) by A7,A5,A10,FINSEQ_1:def 3;
      then
A14:  ((a*Line(M,k)) + Line(M,l)).j = (the addF of K).(a1,a2) by A13,A12,
FUNCOP_1:22
        .= a*(M*(k,j)) + M*(l,j) by A2,A7,A10,A11,A13,A12,Th3;
      thus Line(M1,i).j = M1*(i,j) by A10,MATRIX_0:def 7
        .= ((a*Line(M,k)) + Line(M,l)).j by A1,A2,A4,A8,A7,A10,A14,Def3;
    end;
    hence thesis by A6,A5,Th1;
  end;
  thus i <> l implies Line(M1,i) = Line(M,i)
  proof
A15: width M1 = width M by Th1;
A16: len Line(M1,i) = width M1 by MATRIX_0:def 7;
    assume
A17: i <> l;
A18: now
      let j be Nat such that
A19:  1 <=j & j <= len Line(M1,i);
A20:  j in Seg width M1 by A16,A19;
      hence Line(M1,i).j = M1*(i,j) by MATRIX_0:def 7
        .= M*(i,j) by A2,A3,A4,A17,A15,A20,Def3
        .= Line(M,i).j by A15,A20,MATRIX_0:def 7;
    end;
    len Line(M,i) = width M by MATRIX_0:def 7;
    hence thesis by A16,A18,Th1;
  end;
end;
