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 Th114:
  for M,i st M is without_repeated_line & lines M is
linearly-independent & for j st j in Seg m holds M*(j,i) = 0.K holds lines Segm
  (M,Seg len M,Seg width M\{i}) is linearly-independent
proof
  let M,i;
  assume that
A1: M is without_repeated_line and
A2: lines M is linearly-independent and
A3: for j st j in Seg m holds M*(j,i) = 0.K;
  set SMi=Seg width M\{i};
  set Sl=Seg len M;
  set S=Segm(M,Sl,SMi);
A5: card Sl=len M by FINSEQ_1:57;
A6: len M=m by MATRIX_0:def 2;
  per cases;
  suppose
    m=0;
    then len S=0 by A6,MATRIX_0:def 2;
    then S = {};
    hence thesis;
  end;
  suppose
    m<>0;
    then
A7: width M=n by Th1;
A8: now
      set n0=n|->0.K;
A9:   len n0=n by CARD_1:def 7;
A10:  dom Sgm SMi=Seg card SMi by FINSEQ_3:40;
      let k such that
A11:  k in Seg card Sl;
      Line(M,k) in lines M by A5,A6,A11,Th103;
      then reconsider
      LM=Line(M,k) as Element of n-tuples_on the carrier of K by Th102;
A12:  len LM=n by CARD_1:def 7;
      LM <> n0 by A1,A2,A5,A6,A11,Th109;
      then consider n9 be Nat such that
A13:  1<=n9 and
A14:  n9<=n and
A15:  LM.n9 <> n0.n9 by A12,A9;
A16:  n9 in Seg n by A13,A14;
      then
A17:  n0.n9=0.K by FINSEQ_2:57;
      Sgm Sl =idseq m by A6,FINSEQ_3:48;
      then
A18:  Sgm Sl.k = k by A5,A6,A11,FINSEQ_2:49;
A19:  rng Sgm SMi=SMi by FINSEQ_1:def 14;
      LM.n9=M*(k,n9) by A7,A16,MATRIX_0:def 7;
      then n9<>i by A3,A5,A6,A11,A15,A17;
      then n9 in SMi by A7,A16,ZFMISC_1:56;
      then consider x being object such that
A20:  x in dom Sgm SMi and
A21:  Sgm SMi.x = n9 by A19,FUNCT_1:def 3;
      assume
A22:  Line(S,k) = card SMi |-> 0.K;
      reconsider x as Element of NAT by A20;
      Line(S,k) = Line(M,Sgm Sl.k) * Sgm SMi by A11,Th47,XBOOLE_1:36;
      then Line(S,k).x=Line(M,Sgm Sl.k).n9 by A20,A21,FUNCT_1:13;
      hence contradiction by A22,A15,A17,A20,A10,A18,FINSEQ_2:57;
    end;
A23: now
      set NULL=0.(K,card Sl,card SMi);
      let M1 be Matrix of card Sl,card SMi,K such that
A24:  for i st i in Seg card Sl ex a st Line(M1,i) = a * Line(S,i) and
A25:  for j st j in Seg card SMi holds Sum Col(M1,j) = 0.K;
      defpred P[set,set] means for i st $1=i ex a st a=$2 & Line(M1,i) = a *
      Line(S,i);
A26:  for k st k in Seg m ex x be Element of K st P[k,x]
      proof
        let k;
        assume k in Seg m;
        then consider a such that
A27:    Line(M1,k) = a * Line(S,k) by A5,A6,A24;
        take a;
        thus thesis by A27;
      end;
      consider p such that
A28:  dom p = Seg m and
A29:  for k st k in Seg m holds P[k,p.k] from FINSEQ_1:sch 5(A26);
      deffunc F(Nat)=p/.$1 * Line(M,$1);
      consider f be FinSequence of (width M)-tuples_on the carrier of K such
      that
A30:  len f = m and
A31:  for j st j in dom f holds f.j = F(j) from FINSEQ_2:sch 1;
      reconsider f9=f as FinSequence of the carrier of n-VectSp_over K by A7
,Th102;
      FinS2MX f9 is Matrix of m,n,K by A30;
      then reconsider Mf=f as Matrix of m,n,K;
A32:  dom f = Seg m by A30,FINSEQ_1:def 3;
      len Mf = m by MATRIX_0:def 2;
      then
A33:  dom Mf = Seg m by FINSEQ_1:def 3;
A34:  now
A35:    len M1=m by A5,A6,MATRIX_0:def 2;
A36:    len Mf=m by MATRIX_0:def 2;
A37:    dom Mf=Seg len Mf by FINSEQ_1:def 3;
A38:    dom M1=Seg len M1 by FINSEQ_1:def 3;
        let j such that
A39:    j in Seg n;
        set C=Col(Mf,j);
A40:    len C = len Mf by MATRIX_0:def 8
          .= m by MATRIX_0:def 2;
        per cases;
        suppose
A41:      j=i;
          set m0=m|->0.K;
A42:      now
            let n9 be Nat such that
A43:        1<=n9 and
A44:        n9<=m;
A45:        width M = n by A43,A44,Th1;
A46:        width Mf=n by A43,A44,Th1;
A47:        n9 in Seg m by A43,A44;
            then
A48:        Mf.n9 = Mf/.n9 by A33,PARTFUN1:def 6;
            0.K = M*(n9,i) by A3,A47
              .= Line(M,n9).i by A39,A41,A45,MATRIX_0:def 7;
            then p/.n9*0.K = (p/.n9 * Line(M,n9)).i by A39,A41,A45,FVSUM_1:51
              .= (Mf/.n9).i by A31,A32,A47,A48
              .= Line(Mf,n9).i by A47,A48,MATRIX_0:52
              .= Mf*(n9,i) by A39,A41,A46,MATRIX_0:def 7
              .= Col(Mf,i).n9 by A36,A37,A47,MATRIX_0:def 8;
            hence Col(Mf,j).n9 = 0.K by A41
              .= m0.n9 by A47,FINSEQ_2:57;
          end;
          len m0=m by CARD_1:def 7;
          then C=m0 by A40,A42;
          hence Sum C=0.K by MATRIX_3:11;
        end;
        suppose
A49:      j<>i;
A50:      rng Sgm SMi=SMi by FINSEQ_1:def 14;
          j in SMi by A7,A39,A49,ZFMISC_1:56;
          then consider x being object such that
A51:      x in dom Sgm SMi and
A52:      Sgm SMi.x=j by A50,FUNCT_1:def 3;
          reconsider x as Element of NAT by A51;
          set C1=Col(M1,x);
A53:      dom Sgm SMi =Seg card SMi by FINSEQ_3:40;
A54:      now
            let n9 be Nat such that
A55:        1<=n9 and
A56:        n9<=m;
A57:        width Mf=n by A55,A56,Th1;
A58:        width S=card SMi by A6,A55,A56,Th1;
A59:        Sgm Sl=idseq m by A6,FINSEQ_3:48;
A60:        width M1=card SMi by A6,A55,A56,Th1;
A61:        Line(M,n9).j=M*(n9,j ) by A7,A39,MATRIX_0:def 7;
A62:        n9 in Seg m by A55,A56;
            then consider a such that
A63:        a=p.n9 and
A64:        Line(M1,n9) = a * Line(S,n9) by A29;
A65:        Mf.n9 = Mf/.n9 by A33,A62,PARTFUN1:def 6;
            (idseq m).n9=n9 by A62,FINSEQ_2:49;
            then Line(M,n9) * Sgm SMi=Line(S,n9) by A5,A6,A62,A59,Th47,
XBOOLE_1:36;
            then
A66:        Line(S,n9).x = Line(M,n9).j by A51,A52,FUNCT_1:13;
            thus C.n9 = Mf*(n9,j) by A36,A37,A62,MATRIX_0:def 8
              .= Line(Mf,n9).j by A39,A57,MATRIX_0:def 7
              .= (Mf/.n9).j by A62,A65,MATRIX_0:52
              .= (p/.n9 * Line(M,n9)).j by A31,A32,A62,A65
              .= (a * Line(M,n9)).j by A28,A62,A63,PARTFUN1:def 6
              .= a* (M*(n9,j)) by A7,A39,A61,FVSUM_1:51
              .= (a*Line(S,n9)).x by A51,A53,A58,A66,A61,FVSUM_1:51
              .= M1*(n9,x) by A51,A53,A60,A64,MATRIX_0:def 7
              .= C1.n9 by A35,A38,A62,MATRIX_0:def 8;
          end;
A67:      len C=len Mf by MATRIX_0:def 8;
          len C1=len M1 by MATRIX_0:def 8;
          then C=C1 by A36,A35,A67,A54;
          hence Sum C=0.K by A25,A51,A53;
        end;
      end;
      now
        let j such that
A68:    j in Seg m;
        take pj=p/.j;
        thus Line(Mf,j) = Mf.j by A68,MATRIX_0:52
          .= pj * Line(M,j) by A31,A32,A68;
      end;
      then
A69:  Mf = 0.(K,m,n) by A1,A2,A34,Th109;
A70:  now
        let j such that
A71:    1<=j and
A72:    j<=m;
A73:    j in Seg m by A71,A72;
        then consider a such that
A74:    a=p.j and
A75:    Line(M1,j) = a * Line(S,j) by A29;
A76:    Line(0.(K,m,n),j) = 0.(K,m,n).j by A73,MATRIX_0:52
          .= n |-> 0.K by A73,FUNCOP_1:7;
        p.j=p/.j by A28,A73,PARTFUN1:def 6;
        then
A77:    a * Line(M,j) = Mf.j by A31,A32,A73,A74
          .= Line(Mf,j) by A73,MATRIX_0:52;
A78:    rng Sgm SMi =SMi by FINSEQ_1:def 14;
        Sgm Sl =idseq m by A6,FINSEQ_3:48;
        then Sgm Sl.j = j by A73,FINSEQ_2:49;
        then
A79:    Line(S,j) = Line(M,j) * Sgm SMi by A5,A6,A73,Th47,XBOOLE_1:36;
        Seg n /\ SMi = SMi by A7,XBOOLE_1:28,36;
        then
A80:    Sgm SMi " (Seg n) = Sgm SMi "(rng Sgm SMi) by A78,RELAT_1:133
          .= dom Sgm SMi by RELAT_1:134
          .= Seg card SMi by FINSEQ_3:40;
        dom Line(M,j) = Seg len Line(M,j) by FINSEQ_1:def 3
          .= Seg width M by CARD_1:def 7;
        then Line(M1,j) = Line(0.(K,m,n),j)*Sgm SMi by A69,A75,A77,A78,A79,Th87
,XBOOLE_1:36
          .= card SMi |-> 0.K by A80,A76,FUNCOP_1:19
          .= NULL.j by A5,A6,A73,FUNCOP_1:7;
        hence M1.j = NULL.j by A5,A6,A73,MATRIX_0:52;
      end;
A81:  len NULL=m by A5,A6,MATRIX_0:def 2;
      len M1=m by A5,A6,MATRIX_0:def 2;
      hence M1 = NULL by A81,A70;
    end;
    S is without_repeated_line by A1,A3,Th113;
    hence thesis by A8,A23,Th109;
  end;
end;
