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);
reserve D for non empty set,
  bD for FinSequence of D,
  b,f,g for FinSequence of K,
  MD for Matrix of D;

theorem Th69:
  for M be Matrix of n,m,K, i,j,a st M is without_repeated_line &
  j in dom M & (i = j implies a<>-1_K) holds Lin lines M = Lin lines RLine(M,i,
  Line(M,i)+a*Line(M,j))
proof
  let M be Matrix of n,m,K, i,j,a such that
A1: M is without_repeated_line and
A2: j in dom M and
A3: i = j implies a<>-1_K;
A4: len M=n by MATRIX_0:def 2;
  set L=Line(M,i)+a*Line(M,j);
A5: dom M=Seg len M by FINSEQ_1:def 3;
  set R=RLine(M,i,L);
  per cases;
  suppose
    not i in dom M;
    hence thesis by A5,MATRIX13:40;
  end;
  suppose
A6: i in dom M;
    then n<>0 by A5,A4;
    then
A7: width M=m by MATRIX_0:23;
    then reconsider
    Li=Line(M,i),Lj=Line(M,j) as Vector of m -VectSp_over K by MATRIX13:102;
    a*Lj=a*Line(M,j) by A7,MATRIX13:102;
    then
A8: L=Li+a*Lj by A7,MATRIX13:102;
A9: Li = Lj implies (a <> -1_K or Li = 0.(m -VectSp_over K))
    proof
      assume
A10:  Li=Lj;
      Li=M.i & Lj=M.j by A2,A5,A4,A6,MATRIX_0:52;
      hence thesis by A1,A2,A3,A6,A10,FUNCT_1:def 4;
    end;
    reconsider L9=L as Element of (the carrier of K)* by FINSEQ_1:def 11;
    reconsider LL=L9 as set;
    set iL={i}-->L9;
    len L=width M by CARD_1:def 7;
    then
A11: R = M+*(i,LL) by MATRIX11:29
      .= M+*(i.-->LL) by A6,FUNCT_7:def 3
      .= M+*iL by FUNCOP_1:def 9;
    M.:(dom M\dom iL) = M.:(dom M)\M.:(dom iL) by A1,FUNCT_1:64
      .= rng M \ M.:(dom iL) by RELAT_1:113
      .= rng M \ Im(M,i)
      .= rng M \ {M.i} by A6,FUNCT_1:59
      .= rng M \ {Line(M,i)} by A5,A4,A6,MATRIX_0:52;
    then
A12: lines R = lines M \ {Line(M,i)} \/rng iL by A11,FRECHET:12
      .= lines M \ {Line(M,i)} \/{L} by FUNCOP_1:8;
A13: Lj in lines M by A2,A5,A4,MATRIX13:103;
    Li in lines M by A5,A4,A6,MATRIX13:103;
    hence thesis by A8,A12,A13,A9,Th14;
  end;
end;
