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;

theorem Th92:
  j in Seg len M9 & (i=j implies a <> - 1_K) implies the_rank_of
  M9 = the_rank_of RLine(M9,i,Line(M9,i)+a*Line(M9,j))
proof
  assume that
A1: j in Seg len M9 and
A2: i=j implies a <> - 1_K;
  per cases;
  suppose
    not i in Seg len M9;
    hence thesis by Th40;
  end;
  suppose
A3: i in Seg len M9;
    set KK=the carrier of K;
    set W=width M9;
    set Lj=Line(M9,j);
    set Li=Line(M9,i);
    set R=RLine(M9,i,Li+a*Lj);
    reconsider Li9=Li,Lj9=Lj,LL=Li+a*Lj as Element of KK* by FINSEQ_1:def 11;
A4: len Li=W by CARD_1:def 7;
    then
A5: dom Li=Seg W by FINSEQ_1:def 3;
A6: len (Li+a*Lj)=W by CARD_1:def 7;
    then
A7: W=width R by MATRIX11:def 3;
    then
A8: RLine(R,i,Li) = Replace(R,i,Li9) by A4,MATRIX11:29
      .= Replace(Replace(M9,i,LL),i,Li9) by A6,MATRIX11:29
      .= Replace(M9,i,Li9) by FUNCT_7:34
      .= RLine(M9,i,Li) by A4,MATRIX11:29
      .= M9 by MATRIX11:30;
A9: len M9=n9 by MATRIX_0:def 2;
    then
A10: Line(R,i)=Li + a*Lj by A3,A6,MATRIX11:28;
A11: len Lj=W by CARD_1:def 7;
    then
A12: dom Lj=Seg W by FINSEQ_1:def 3;
    len (a*Lj)=W by CARD_1:def 7;
    then
A13: dom (a*Lj)=Seg W by FINSEQ_1:def 3;
A14: Indices R=Indices M9 by MATRIX_0:26;
    consider P1,Q1 such that
A15: [:P1,Q1:] c= Indices M9 and
A16: card P1 = card Q1 and
A17: card P1=the_rank_of M9 and
A18: Det EqSegm(M9,P1,Q1)<>0.K by Def4;
A19: EqSegm(M9,P1,Q1)=Segm(M9,P1,Q1) by A16,Def3;
A20: EqSegm(R,P1,Q1)=Segm(R,P1,Q1) by A16,Def3;
A21: RLine(R,i,Lj) = Replace(R,i,Lj9) by A11,A7,MATRIX11:29
      .= Replace(Replace(M9,i,LL),i,Lj9) by A6,MATRIX11:29
      .= Replace(M9,i,Lj9) by FUNCT_7:34
      .= RLine(M9,i,Lj) by A11,MATRIX11:29;
A22: now
      per cases;
      suppose
        not i in P1;
        then Segm(M9,P1,Q1) = Segm(R,P1,Q1) by A15,Th60;
        hence the_rank_of R>=the_rank_of M9
        by A14,A15,A16,A17,A18,A20,A19,Def4;
      end;
      suppose
A23:    i in P1;
        set SM=EqSegm(M9,P1,Q1);
        set SR=EqSegm(R,P1,Q1);
A24:    rng Lj c= KK by FINSEQ_1:def 4;
A26:    dom Sgm P1=Seg card P1 by FINSEQ_3:40;
A27:    Q1 c= Seg W by A15,A16,Th67;
A28:    dom Sgm Q1=Seg card Q1 by FINSEQ_3:40;
A29:    rng Sgm Q1 c= Seg W by A27,FINSEQ_1:def 14;
        then
A30:    dom (Lj*Sgm Q1)=dom Sgm Q1 by A12,RELAT_1:27;
        then reconsider LjQ=Lj*Sgm Q1 as FinSequence by A28,FINSEQ_1:def 2;
        rng LjQ c= rng Lj by RELAT_1:26;
        then rng LjQ c= the carrier of K by A24;
        then reconsider LjQ as FinSequence of K by FINSEQ_1:def 4;
A31:    len LjQ=card P1 by A16,A30,A28,FINSEQ_1:def 3;
        rng Sgm P1=P1 by FINSEQ_1:def 14;
        then consider m be object such that
A32:    m in dom Sgm P1 and
A33:    Sgm P1.m=i by A23,FUNCT_1:def 3;
        reconsider m as Element of NAT by A32;
A34:    len Line(SM,m)=width SM by MATRIX_0:def 7;
A35:    Line(SM,m)=Line(M9,i)*Sgm Q1 by A19,A32,A33,A26,A27,Th47;
        then
A36:    RLine(SR,m,Line(SM,m))=Segm(M9,P1,Q1) by A4,A7,A8,A14,A15,A16,A20,A33
,Th59;
        Q1 c= Seg width R by A14,A15,A16,Th67;
        then
A37:    Line(SR,m) = Line(R,i)*Sgm Q1 by A20,A32,A33,A26,Th47;
A38:    RLine(SR,m,LjQ)=Segm(RLine(M9,i,Lj),P1,Q1) by A11,A7,A21,A14,A15,A16
,A20,A33,Th59;
A39:    a *LjQ=(a*Lj)*Sgm Q1 by A12,A29,Th87;
A40:    len LjQ=len(a*LjQ) by MATRIXR1:16;
A41:    width SM=card P1 by MATRIX_0:24;
A42:    Segm(RLine(M9,i,Lj),P1,Q1)=EqSegm(RLine(M9,i,Lj),P1,Q1) by A16,Def3;
        SR = RLine(SR,m,Line(SR,m)) by MATRIX11:30
          .= RLine(SR,m,Line(SM,m) + a *LjQ) by A10,A5,A13,A29,A37,A35,A39,Th88
;
        then
A43:    Det SR = Det RLine(SR,m,Line(SM,m)) + Det RLine(SR,m,a * LjQ) by A32
,A26,A31,A40,A34,A41,MATRIX11:36
          .= Det RLine(SR,m,Line(SM,m)) + a*Det RLine(SR,m,LjQ) by A32,A26,A31,
MATRIX11:34
          .= Det SM+a*Det EqSegm(RLine(M9,i,Lj),P1,Q1) by A16,A36,A38,A42,Def3;
        per cases;
        suppose
          Det SR <>0.K;
          hence the_rank_of M9<=the_rank_of R by A14,A15,A16,A17,Def4;
        end;
        suppose
A44:      Det SR = 0.K;
          reconsider j0=j as non zero Element of NAT by A1;
          per cases;
          suppose
A45:        i=j;
            then Det SR = Det SM + a * Det SM by A43,MATRIX11:30
              .= 1_K * Det SM + a * Det SM
              .= (1_K+a)*Det SM by VECTSP_1:def 7;
            then 1_K+a=0.K by A18,A44,VECTSP_1:12;
            then a = 0.K - 1_K by VECTSP_2:2
              .= 0.K+(-1_K)
              .= -1_K by RLVECT_1:def 4;
            hence the_rank_of R>=the_rank_of M9 by A2,A45;
          end;
          suppose
A46:        i<>j & j in P1;
            rng Sgm P1=P1 by FINSEQ_1:def 14;
            then consider l be object such that
A47:        l in dom Sgm P1 and
A48:        Sgm P1.l=j0 by A46,FUNCT_1:def 3;
            reconsider l as Element of NAT by A47;
            0.K=Det RLine(SM,m,Line(SM,l))by A32,A33,A26,A46,A47,A48,
MATRIX11:51;
            then
A49:        0.K = a * Det RLine(SM,m,Line(SM,l));
            RLine(SM,m,Line(SM,l))=EqSegm(RLine(M9,i,Lj),P1,Q1) by A11,A15,A16
,A19,A33,A26,A27,A38,A42,A47,A48,Th47,Th59;
            hence the_rank_of R >= the_rank_of M9 by A18,A43,A44,A49,
RLVECT_1:def 4;
          end;
          suppose
A50:        i<>j & not j in P1;
            set Pij=P1\{i}\/{j0};
A51:        not i in P1\{i} by ZFMISC_1:56;
A52:        [:Pij,Q1:] c= Indices R by A1,A9,A14,A15,A16,A23,A50,Th68;
            a*Det EqSegm(RLine(M9,i,Lj),P1,Q1)<>0.K by A18,A43,A44,
RLVECT_1:def 4;
            then
A53:        Det EqSegm(RLine(M9,i,Lj),P1,Q1)<>0.K;
            Det EqSegm(RLine(M9,i,Lj),P1,Q1)=Det EqSegm(M9,Pij,Q1) or
Det EqSegm(RLine(M9,i,Lj),P1,Q1)=-Det EqSegm(M9,Pij,Q1) by A1,A9,A15,A16,A23
,A50,Th68;
            then
A54:        Det EqSegm(M9,Pij,Q1)<>0.K by A53,VECTSP_2:3;
            not i in {j} by A50,TARSKI:def 1;
            then
A55:        not i in Pij by A51,XBOOLE_0:def 3;
A56:        card P1 = card Pij by A1,A9,A15,A16,A23,A50,Th68;
            then EqSegm(M9,Pij,Q1) = Segm(M9,Pij,Q1) by A16,Def3
              .= Segm(R,Pij,Q1) by A14,A52,A55,Th60
              .= EqSegm(R,Pij,Q1) by A16,A56,Def3;
            hence the_rank_of R >= the_rank_of M9 by A16,A17,A54,A56,A52,Def4;
          end;
        end;
      end;
    end;
    consider P,Q such that
A57: [:P,Q:] c= Indices R and
A58: card P = card Q and
A59: card P = the_rank_of R and
A60: Det EqSegm(R,P,Q)<>0.K by Def4;
A61: EqSegm(R,P,Q)=Segm(R,P,Q) by A58,Def3;
A62: EqSegm(M9,P,Q)=Segm(M9,P,Q) by A58,Def3;
    now
      per cases;
      suppose
        not i in P;
        then Segm(M9,P,Q) = Segm(R,P,Q) by A57,A14,Th60;
        hence the_rank_of R<=the_rank_of M9
        by A57,A58,A59,A60,A61,A62,A14,Def4;
      end;
      suppose
A63:    i in P;
        set SM=EqSegm(M9,P,Q);
        set SR=EqSegm(R,P,Q);
A64:    rng Lj c= KK by FINSEQ_1:def 4;
A66:    dom Sgm P=Seg card P by FINSEQ_3:40;
A67:    Q c= Seg W by A57,A58,A14,Th67;
A68:    dom Sgm Q=Seg card Q by FINSEQ_3:40;
A69:    rng Sgm Q c= Seg W by A67,FINSEQ_1:def 14;
        then
A70:    dom (Lj*Sgm Q)=dom Sgm Q by A12,RELAT_1:27;
        then reconsider LjQ=Lj*Sgm Q as FinSequence by A68,FINSEQ_1:def 2;
        rng LjQ c= rng Lj by RELAT_1:26;
        then rng LjQ c= the carrier of K by A64;
        then reconsider LjQ as FinSequence of K by FINSEQ_1:def 4;
A71:    len LjQ=card P by A58,A70,A68,FINSEQ_1:def 3;
        rng Sgm P=P by FINSEQ_1:def 14;
        then consider m be object such that
A72:    m in dom Sgm P and
A73:    Sgm P.m=i by A63,FUNCT_1:def 3;
        reconsider m as Element of NAT by A72;
A74:    len Line(SM,m)=width SM by MATRIX_0:def 7;
A75:    Line(SM,m) = Line(M9,i) * Sgm Q by A62,A72,A73,A66,A67,Th47;
        then
A76:    RLine(SR,m,Line(SM,m))=Segm(M9,P,Q) by A4,A7,A8,A57,A58,A61,A73,Th59;
        Q c= Seg width R by A57,A58,Th67;
        then
A77:    Line(SR,m) = Line(R,i) * Sgm Q by A61,A72,A73,A66,Th47;
A78:    RLine(SR,m,LjQ)=Segm(RLine(M9,i,Lj),P,Q) by A11,A7,A21,A57,A58,A61,A73
,Th59;
A79:    a *LjQ=(a*Lj)*Sgm Q by A12,A69,Th87;
A80:    len LjQ=len(a*LjQ) by MATRIXR1:16;
A81:    width SM=card P by MATRIX_0:24;
A82:    Segm(RLine(M9,i,Lj),P,Q)=EqSegm(RLine(M9,i,Lj),P,Q) by A58,Def3;
        SR = RLine(SR,m,Line(SR,m)) by MATRIX11:30
          .= RLine(SR,m,Line(SM,m) + a *LjQ) by A10,A5,A13,A69,A77,A75,A79,Th88
;
        then
A83:    Det SR = Det RLine(SR,m,Line(SM,m)) + Det RLine(SR,m,a * LjQ) by A72
,A66,A71,A80,A74,A81,MATRIX11:36
          .= Det RLine(SR,m,Line(SM,m)) + a*Det RLine(SR,m,LjQ) by A72,A66,A71,
MATRIX11:34
          .= Det SM+a*Det EqSegm(RLine(M9,i,Lj),P,Q) by A58,A76,A78,A82,Def3;
        per cases;
        suppose
          Det EqSegm(M9,P,Q) <>0.K;
          hence the_rank_of R<=the_rank_of M9 by A57,A58,A59,A14,Def4;
        end;
        suppose
A84:      Det EqSegm(M9,P,Q) =0.K;
          reconsider j0=j as non zero Element of NAT by A1;
          per cases;
          suppose
            i=j;
            then Det SR = Det SM + a * Det SM by A83,MATRIX11:30
              .= 1_K * Det SM + a * Det SM
              .= (1_K+a)*Det SM by VECTSP_1:def 7;
            hence the_rank_of R<=the_rank_of M9 by A60,A84;
          end;
          suppose
A85:        i<>j & j in P;
            rng Sgm P=P by FINSEQ_1:def 14;
            then consider l be object such that
A86:        l in dom Sgm P and
A87:        Sgm P.l=j0 by A85,FUNCT_1:def 3;
            reconsider l as Element of NAT by A86;
A88:        RLine(SM,m,Line(SM,l)) = EqSegm(RLine(M9,i,Lj),P,Q) by A11,A57,A58
,A62,A14,A73,A66,A67,A78,A82,A86,A87,Th47,Th59;
            0.K=Det RLine(SM,m,Line(SM,l))by A72,A73,A66,A85,A86,A87,
MATRIX11:51;
            then 0.K = a * Det RLine(SM,m,Line(SM,l))
              .= Det SM + a* Det EqSegm(RLine(M9,i,Lj),P,Q) by A84,A88,
RLVECT_1:def 4;
            hence the_rank_of R <= the_rank_of M9 by A60,A83;
          end;
          suppose
A89:        i<>j & not j in P;
            set Pij=P\{i}\/{j0};
A90:        card P = card Pij by A1,A9,A57,A58,A63,A89,Th68;
            a*Det EqSegm(RLine(M9,i,Lj),P,Q)<>0.K by A60,A83,A84,RLVECT_1:def 4
;
            then
A91:        Det EqSegm(RLine(M9,i,Lj),P,Q)<>0.K;
            Det EqSegm(RLine(M9,i,Lj),P,Q)=Det EqSegm(M9,Pij,Q) or Det
EqSegm(RLine(M9,i,Lj),P,Q)=-Det EqSegm(M9,Pij,Q) by A1,A9,A57,A58,A14,A63,A89
,Th68;
            then
A92:        Det EqSegm(M9,Pij,Q)<>0.K by A91,VECTSP_2:3;
            [:Pij,Q:] c= Indices M9 by A1,A9,A57,A58,A14,A63,A89,Th68;
            hence the_rank_of R <= the_rank_of M9 by A58,A59,A92,A90,Def4;
          end;
        end;
      end;
    end;
    hence thesis by A22,XXREAL_0:1;
  end;
end;
