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 Th4:
  l in dom M & i in dom M & M1 = ScalarXLine(M,l,a) implies (i = l
  implies Line(M1,i) = a*Line(M,l)) & (i <> l implies Line(M1,i) = Line(M,i))
proof
  assume that
A1: l in dom M and
A2: i in dom M and
A3: M1 = ScalarXLine(M,l,a);
  thus i = l implies Line(M1,i) = a*Line(M,l)
  proof
A4: width M1 = width M by Th1;
A5: len Line(M1,i) = width M1 by MATRIX_0:def 7;
    assume
A6: i=l;
A7: now
      let j be Nat such that
A8:   1 <=j & j <= len Line(M1,i);
A9:   j in Seg width M1 by A5,A8;
      hence Line(M1,i).j = M1*(i,j) by MATRIX_0:def 7
        .= a*(M*(l,j)) by A1,A3,A6,A4,A9,Def2
        .= (a*Line(M,l)).j by A1,A4,A9,Th3;
    end;
    len (a*Line(M,l)) = len Line(M,l) & len Line(M,l) = width M by MATRIXR1:16
,MATRIX_0:def 7;
    hence thesis by A5,A7,Th1;
  end;
A10: len Line(M1,i) = width M1 by MATRIX_0:def 7;
A11: width M1 = width M by Th1;
  assume
A12: i <> l;
A13: now
    let j be Nat such that
A14: 1 <=j & j <= len Line(M1,i);
A15: j in Seg width M1 by A10,A14;
    hence Line(M1,i).j = M1*(i,j) by MATRIX_0:def 7
      .= M*(i,j) by A2,A3,A12,A11,A15,Def2
      .= Line(M,i).j by A11,A15,MATRIX_0:def 7;
  end;
  len Line(M,i) = width M by MATRIX_0:def 7;
  hence thesis by A10,A13,Th1;
end;
