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 Th108:
  for M,M1 st M is without_repeated_line & for i st i in Seg m
  holds ex a st Line(M1,i) = a * Line(M,i) holds ex L be Linear_Combination of
  lines M st L (#) MX2FinS M = M1
proof
  let M,M1 such that
A1: M is without_repeated_line and
A2: for i st i in Seg m ex a st Line(M1,i) = a * Line(M,i);
  set V=n-VectSp_over K;
  defpred P[set,set] means for i st $1=i ex a st a=$2 & Line(M1,i) = a * Line(
  M,i);
A3: for k st k in Seg len M ex x be Element of K st P[k,x]
  proof
A4: len M=m by MATRIX_0:def 2;
    let k;
    assume k in Seg len M;
    then consider a such that
A5: Line(M1,k) = a * Line(M,k) by A2,A4;
    take a;
    thus thesis by A5;
  end;
  consider p such that
A6: dom p = Seg len M and
A7: for k st k in Seg len M holds P[k,p.k] from FINSEQ_1:sch 5(A3);
  defpred Q[object,object] means
   for v st $1=v holds (not v in lines M implies $2=0.
  K) & (v in lines M implies for k st k in Seg m & v=Line(M,k) holds $2=p.k);
A8: for x being object st x in the carrier of V
ex y being object st y in the carrier of K & Q[x,y]
  proof
    let x be object;
    assume x in the carrier of V;
    then reconsider v=x as Element of V;
    per cases;
    suppose
A9:   v in lines M;
A10:  rng p c= the carrier of K by FINSEQ_1:def 4;
      consider j such that
A11:  j in Seg m and
A12:  v=Line(M,j) by A9,Th103;
      len M=m by MATRIX_0:def 2;
      then p.j in rng p by A6,A11,FUNCT_1:def 3;
      then reconsider pj=p.j as Element of the carrier of K by A10;
      take pj;
      thus pj in the carrier of K;
      let w such that
A13:  w=x;
      thus not w in lines M implies pj=0.K by A9,A13;
      thus w in lines M implies for k st k in Seg m & w=Line(M,k) holds pj = p
      .k
      proof
        len M=m by MATRIX_0:def 2;
        then
A14:    dom M=Seg m by FINSEQ_1:def 3;
A15:    M.j=Line(M,j) by A11,MATRIX_0:52;
        assume w in lines M;
        let k such that
A16:    k in Seg m and
A17:    w=Line(M,k);
        M.k=Line(M,k) by A16,MATRIX_0:52;
        hence thesis by A1,A11,A12,A13,A16,A17,A14,A15;
      end;
    end;
    suppose
A18:  not v in lines M;
      take 0K=0.K;
      thus 0K in the carrier of K;
      let w such that
A19:  w=x;
      thus not w in lines M implies 0K=0.K;
      thus thesis by A18,A19;
    end;
  end;
  consider l be Function of the carrier of V,the carrier of K such that
A20: for x being object st x in the carrier of V holds Q[x,l.x]
from FUNCT_2:sch 1(A8
  );
  reconsider L=l as Element of Funcs(the carrier of V, the carrier of K) by
FUNCT_2:8;
  for v st not v in lines M holds L.v = 0.K by A20;
  then reconsider L as Linear_Combination of V by VECTSP_6:def 1;
A21: Carrier L c= lines M
  proof
    let x be object;
    assume x in Carrier L;
    then ex v st x = v & L.v <> 0.K by VECTSP_6:1;
    hence thesis by A20;
  end;
  set MX=MX2FinS M;
A22: len M=m by MATRIX_0:def 2;
  reconsider L as Linear_Combination of lines M by A21,VECTSP_6:def 4;
  set LM=L(#)MX;
A23: len LM=len M by VECTSP_6:def 5;
A24: now
    let k such that
A25: 1<=k and
A26: k<=m;
A27: k in Seg m by A25,A26;
    then consider a such that
A28: p.k=a and
A29: Line(M1,k) = a * Line(M,k) by A7,A22;
    dom MX = Seg m by A22,FINSEQ_1:def 3;
    then
A30: MX/.k=M.k by A27,PARTFUN1:def 6;
A31: Line(M,k) in lines M by A27,Th103;
    then reconsider
    LMk=Line(M,k) as Element of n-tuples_on the carrier of K by Th102;
A32: LMk=M.k by A27,MATRIX_0:52;
    dom LM=Seg m by A22,A23,FINSEQ_1:def 3;
    then
A33: LM.k=L.(MX/.k) * MX/.k by A27,VECTSP_6:def 5;
    L.LMk =p.k by A20,A27,A31;
    then LM.k=a * LMk by A28,A33,A30,A32,Th102;
    hence M1.k=LM.k by A27,A29,MATRIX_0:52;
  end;
  len M1=m by MATRIX_0:def 2;
  hence thesis by A22,A23,A24,FINSEQ_1:14;
end;
