reserve x,y for object,X,Y for set,
  D for non empty set,
  i,j,k,l,m,n,m9,n9 for Nat,
  i0,j0,n0,m0 for non zero Nat,
  K for Field,
  a,b for Element of K,
  p for FinSequence of K,
  M for Matrix of n,K;
reserve A for (Matrix of D),
  A9 for Matrix of n9,m9,D,
  M9 for Matrix of n9, m9,K,
  nt,nt1,nt2 for Element of n-tuples_on NAT,
  mt,mt1 for Element of m -tuples_on NAT,
  M for Matrix of K;
reserve P,P1,P2,Q,Q1,Q2 for without_zero finite Subset of NAT;
reserve v,v1,v2,u,w for Vector of n-VectSp_over K,
  t,t1,t2 for Element of n -tuples_on the carrier of K,

  L for Linear_Combination of n-VectSp_over K,
  M,M1 for Matrix of m,n,K;

theorem Th117:
  for M st lines M is linearly-independent & M is
without_repeated_line for i,j st j in Seg len M & i <> j holds RLine(M,i,Line(M
  ,i) + a*Line(M,j)) is without_repeated_line & lines RLine(M,i,Line(M,i) + a*
  Line(M,j)) is linearly-independent
proof
  let M such that
A1: lines M is linearly-independent and
A2: M is without_repeated_line;
  set V=n-VectSp_over K;
  let i,j such that
A3: j in Seg len M and
A4: i<>j;
  set Lj=Line(M,j);
  set Li=Line(M,i);
  set R=RLine(M,i,Li+a*Lj);
  per cases;
  suppose
    not i in Seg len M;
    hence thesis by A1,A2,Th40;
  end;
  suppose
A5: i in Seg len M;
    reconsider N=n as Element of NAT by ORDINAL1:def 12;
A6: dom M=Seg len M by FINSEQ_1:def 3;
    then
A7: M.i<>M.j by A2,A3,A4,A5;
A8: len M=m by MATRIX_0:def 2;
    then
A9: Lj in lines M by A3,Th103;
A10: Li in lines M by A5,A8,Th103;
    then reconsider LI=Li,LJ=Lj as Vector of V by A9;
    reconsider li=LI,lj=LJ as Element of N-tuples_on the carrier of K by Th102;
A11: M.i=Li by A5,A8,MATRIX_0:52;
    m <> 0 by A5,A8;
    then
A12: n=width M by Th1;
A13: M.j=Lj by A3,A8,MATRIX_0:52;
A14: for k st k in Seg m & k<>i holds Line(R,k)<>Li + a*Lj
    proof
      a*lj = a*LJ by Th102;
      then li+a*lj = LI+a*LJ by Th102
        .= (1_K)*LI+a*LJ;
      then
A15:  li+a*lj in Lin {LI,LJ} by Th116;
      let k such that
A16:  k in Seg m and
A17:  k<>i;
      set Lk=Line(M,k);
      assume
A18:  Line(R,k)=Li+a*Lj;
A19:  Line(R,k) = Line(M,k) by A16,A17,MATRIX11:28;
A20:  Lj<>Lk
      proof
        {LI,LJ} c= lines M by A10,A9,ZFMISC_1:32;
        then
A21:    {LI,LJ} is linearly-independent by A1,VECTSP_7:1;
        assume
A22:    Lj=Lk;
A23:    (1_K+(-1_K)*a)*LJ=(1_K+(-1_K)*a)*lj by Th102;
A24:    (-1_K)*LI=(-1_K)*li by Th102;
        0.V = n|->0.K by Th102
          .= lj+-(li+a*lj) by A19,A18,A22,FVSUM_1:26
          .= lj+(-li+-a*lj) by FVSUM_1:31
          .= lj+((-1_K)*li+-a*lj) by FVSUM_1:59
          .= lj+((-1_K)*li+(-1_K)*(a*lj)) by FVSUM_1:59
          .= lj+((-1_K)*li+((-1_K)*a)*lj) by FVSUM_1:54
          .= lj+(((-1_K)*a)*lj+(-1_K)*li) by FINSEQOP:33
          .= lj+((-1_K)*a)*lj+(-1_K)*li by FINSEQOP:28
          .= 1_K*lj+((-1_K)*a)*lj+(-1_K)*li by FVSUM_1:57
          .= (1_K+(-1_K)*a)*lj+(-1_K)*li by FVSUM_1:55
          .= (1_K+(-1_K)*a)*LJ+(-1_K)*LI by A24,A23,Th102;
        then -1_K=0.K by A7,A11,A13,A21,VECTSP_7:6;
        hence thesis by VECTSP_1:28;
      end;
A25:  Lk in lines M by A16,Th103;
      then reconsider LK=Lk as Vector of V;
      reconsider KIJ={LK,LI,LJ} as Subset of V;
A26:  KIJ is linearly-independent by A1,A10,A9,A25,VECTSP_7:1,ZFMISC_1:133;
A27:  Lk in KIJ by ENUMSET1:def 1;
A28:  M.k=Lk by A16,MATRIX_0:52;
      M.i<>M.k by A2,A5,A8,A6,A16,A17;
      then KIJ \ {LK} = {LI, LJ} by A11,A20,A28,ENUMSET1:86;
      hence thesis by A19,A18,A15,A27,A26,VECTSP_9:14;
    end;
    reconsider LiaLj=li+a*lj as Element of (the carrier of K)* by
FINSEQ_1:def 11;
    reconsider LL=LiaLj as set;
    set iLL=i.-->LL;
A29: len (li+a*lj)=n by CARD_1:def 7;
    then RLine(M,i,li+a*lj) = Replace(M, i, LiaLj) by A12,MATRIX11:29
      .= M+*iLL by A5,A6,FUNCT_7:def 3;
    then
A30: lines RLine(M,i,Li+a*Lj) = M.:(dom M\dom iLL)\/rng iLL by FRECHET:12
      .= M.:(dom M\{i})\/rng iLL
      .= M.:(dom M\{i})\/{LL} by FUNCOP_1:8
      .= (M.:dom M\M.:{i})\/{LL} by A2,FUNCT_1:64
      .= (lines M\Im(M,i))\/{LL} by RELAT_1:113
      .= (lines M\{LI})\/{li+a*lj} by A5,A6,A11,FUNCT_1:59;
A31: Line(R,i)=Li+a*Lj by A5,A8,A29,A12,MATRIX11:28;
    now
A32:  len R=m by MATRIX_0:def 2;
      let x1,x2 be object such that
A33:  x1 in dom R and
A34:  x2 in dom R and
A35:  R.x1=R.x2;
      reconsider i1=x1,i2=x2 as Element of NAT by A33,A34;
A36:  dom R=Seg len R by FINSEQ_1:def 3;
      then
A37:  R.i1=Line(R,i1) by A33,A32,MATRIX_0:52;
A38:  R.i2=Line(R,i2) by A34,A36,A32,MATRIX_0:52;
      per cases;
      suppose
        i1=i & i2=i;
        hence x1=x2;
      end;
      suppose
        i1=i & i2<>i or i1<>i & i2=i;
        hence x1=x2 by A14,A31,A33,A34,A35,A36,A32,A37,A38;
      end;
      suppose
A39:    i1<>i & i2<>i;
        then
A40:    R.i2=Line(M,i2) by A34,A36,A32,A38,MATRIX11:28;
A41:    Line(M,i1) = M.i1 by A33,A36,A32,MATRIX_0:52;
A42:    Line(M,i2) = M.i2 by A34,A36,A32,MATRIX_0:52;
        R.i1=Line(M,i1) by A33,A36,A32,A37,A39,MATRIX11:28;
        hence x1=x2 by A2,A8,A6,A33,A34,A35,A36,A32,A41,A40,A42;
      end;
    end;
    hence R is without_repeated_line;
A43: a*lj = a*LJ by Th102;
    lines M\{LI}\/{LI+a*LJ} is linearly-independent by A1,A7,A11,A13,A10,A9
,Th115;
    hence thesis by A43,A30,Th102;
  end;
end;
