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 Th109:
  for M st M is without_repeated_line holds ( for i st i in Seg m
holds Line(M,i) <> n |-> 0.K ) & ( for M1 st (for i st i in Seg m ex a st Line(
M1,i) = a * Line(M,i))& for j st j in Seg n holds Sum Col(M1,j) = 0.K holds M1
  = 0.(K,m,n) ) iff lines M is linearly-independent
proof
  set V=n-VectSp_over K;
  set n0=n|->0.K;
A1: len n0=n by CARD_1:def 7;
  let M such that
A2: M is without_repeated_line;
  thus (for i st i in Seg m holds Line(M,i) <> n |-> 0.K ) & (for M1 st (for i
st i in Seg m ex a st Line(M1,i) = a * Line(M,i)) & (for j st j in Seg n holds
  Sum Col(M1,j)=0.K) holds M1 = 0.(K,m,n) ) implies lines M is
  linearly-independent
  proof
    set MX=MX2FinS M;
    set V=n-VectSp_over K;
    assume that
A3: for i st i in Seg m holds Line(M,i) <> n |-> 0.K and
A4: for M1 st (for i st i in Seg m ex a st Line(M1,i)=a*Line(M,i))&
    for j st j in Seg n holds Sum Col(M1,j)=0.K holds M1 = 0.(K,m,n);
    let L be Linear_Combination of lines M such that
A5: Sum L = 0.V;
    set LM=L (#) MX;
    set FLM = FinS2MX LM;
A6: len LM= len MX by VECTSP_6:def 5;
A7: len M=m by MATRIX_0:def 2;
    then reconsider flm=FLM as Matrix of m,n,K by A6;
A8: for i st i in Seg m ex a st Line(flm,i)=a*Line(M,i)
    proof
      let i such that
A9:   i in Seg m;
      Line(M,i) in lines M by A9,Th103;
      then reconsider LM=Line(M,i) as Element of V;
      reconsider LLM=L.LM as Element of K;
      Line(M,i)=M.i by A9,MATRIX_0:52;
      then Line(flm,i)=LLM*Line(M,i) by A7,A9,Th106;
      hence thesis;
    end;
A10: len (n|->0.K)=n by CARD_1:def 7;
    assume Carrier L<>{};
    then consider x being object such that
A11: x in Carrier L by XBOOLE_0:def 1;
    Carrier L c= lines M by VECTSP_6:def 4;
    then consider i such that
A12: i in Seg m and
A13: x=Line(M,i) by A11,Th103;
    consider v such that
A14: x=v and
A15: L.v<>0.K by A11,VECTSP_6:1;
    reconsider LM=Line(M,i) as Element of n-tuples_on the carrier of K by A13
,A14,Th102;
    Line(M,i)=M.i by A12,MATRIX_0:52;
    then
A16: Line(flm,i) = (L.v) * LM by A7,A12,A13,A14,Th106;
    now
      let j such that
A17:  j in Seg n;
A18:  (n|->0.K).j=0.K by A17,FINSEQ_2:57;
      Carrier L c= lines M by VECTSP_6:def 4;
      then (Sum L).j = Sum Col(flm,j) by A2,A17,Th107;
      hence Sum Col(flm,j) = 0.K by A5,A18,Th102;
    end;
    then flm=0.(K,m,n) by A4,A8;
    then
A19: flm.i=n|->0.K by A12,FUNCOP_1:7;
A20: dom LM=Seg n by FINSEQ_2:124;
    len LM=n by CARD_1:def 7;
    then consider j such that
A21: 1<=j and
A22: j<= n and
A23: LM.j <> (n|->0.K).j by A3,A12,A10,FINSEQ_1:14;
A24: j in Seg n by A21,A22;
    then
A25: LM.j<>0.K by A23,FINSEQ_2:57;
    j in Seg n by A21,A22;
    then
A26: LM.j in rng LM by A20,FUNCT_1:def 3;
    rng LM c= the carrier of K by RELAT_1:def 19;
    then reconsider LMj=LM.j as Element of K by A26;
A27: ((L.v) * LM).j=(L.v)*LMj by A24,FVSUM_1:51;
    flm.i = Line(flm,i) by A12,MATRIX_0:52;
    then Line(flm,i).j=0.K by A19,A24,FINSEQ_2:57;
    hence thesis by A15,A25,A27,A16,VECTSP_1:12;
  end;
  assume
A28: lines M is linearly-independent;
  hereby
    let i;
    assume i in Seg m;
    then Line(M,i) in lines M by Th103;
    then Line(M,i)<>0.V by A28,VECTSP_7:2;
    hence Line(M,i) <> n |-> 0.K by Th102;
  end;
  let M1 such that
A29: for i st i in Seg m ex a st Line(M1,i) = a * Line(M,i) and
A30: for j st j in Seg n holds Sum Col(M1,j)=0.K;
  consider L be Linear_Combination of lines M such that
A31: L (#) MX2FinS M = M1 by A2,A29,Th108;
A32: Carrier L c= lines M by VECTSP_6:def 4;
A33: now
    let j such that
A34: 1<=j and
A35: j<=n;
A36: j in Seg n by A34,A35;
    hence (Sum L).j = Sum Col(FinS2MX(L (#) MX2FinS M),j) by A2,A32,Th107
      .= 0.K by A30,A31,A36
      .= n0.j by A36,FINSEQ_2:57;
  end;
  reconsider SumL=Sum L as Element of n-tuples_on the carrier of K by Th102;
  len SumL=n by CARD_1:def 7;
  then SumL = n0 by A1,A33
    .= 0.V by Th102;
  then
A37: Carrier L={} by A28;
  assume M1 <> 0.(K,m,n);
  then consider I,J be Nat such that
A38: [I,J] in Indices M1 and
A39: M1*(I,J)<>(0.(K,m,n))*(I,J) by MATRIX_0:27;
  [I,J] in Indices 0.(K,m,n) by A38,MATRIX_0:26;
  then
A40: M1*(I,J)<>0.K by A39,MATRIX_3:1;
  reconsider ii=I,jj=J as Element of NAT by ORDINAL1:def 12;
A41: Indices M1=Indices M by MATRIX_0:26;
  then Indices M1 = [:Seg len M, Seg width M :] by FINSEQ_1:def 3;
  then
A42: ii in Seg len M by A38,ZFMISC_1:87;
A43: len M=m by MATRIX_0:def 2;
  then Line(M,ii) in lines M by A42,Th103;
  then reconsider Mii=M.ii as Element of V by A42,A43,MATRIX_0:52;
A44: jj in Seg width M by A38,A41,ZFMISC_1:87;
  then
A45: Line(M,ii).jj=M*(ii,jj) by MATRIX_0:def 7;
  jj in Seg width M1 by A38,ZFMISC_1:87;
  then M1*(I,J) = Line(FinS2MX(L (#) MX2FinS M),ii).jj by A31,MATRIX_0:def 7
    .= ((L.Mii)* Line(M,ii)).jj by A42,Th106
    .= (L.Mii) *(M*(ii,jj)) by A44,A45,FVSUM_1:51;
  then L.Mii<>0.K by A40;
  hence thesis by A37,VECTSP_6:1;
end;
