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 Th97:
  the_rank_of M = 1 iff (ex i,j st [i,j] in Indices M & M*(i,j) <>
0.K) & for i,j,n,m st [:{i,j},{n,m}:] c= Indices M holds M*(i,n) * (M*(j,m)) =
  M*(i,m) * (M*(j,n))
proof
  thus the_rank_of M=1 implies (ex i,j st [i,j] in Indices M & M*(i,j)<>0.K)&
for i,j,n,m st [:{i,j},{n,m}:]c=Indices M holds M*(i,n)*(M*(j,m))=M*(i,m)*(M*(j
  ,n))
  proof
    assume
A1: the_rank_of M=1;
    hence ex i,j st [i,j] in Indices M & M*(i,j)<>0.K by Th96;
    let i,j,n,p be Nat such that
A2: [:{i,j},{n,p}:] c= Indices M;
    per cases;
    suppose
      i=j or n=p;
      hence thesis;
    end;
    suppose
A3:   i<>j & n<>p;
      Indices M=[:Seg len M,Seg width M:] by FINSEQ_1:def 3;
      then
A4:   {i,j}c=Seg len M by A2,ZFMISC_1:114;
A5:   i in {i,j} by TARSKI:def 2;
A6:   n in {n,p} by TARSKI:def 2;
A7:   p in {n,p} by TARSKI:def 2;
A8:   j in {i,j} by TARSKI:def 2;
      {n,p}c=Seg width M by A2,ZFMISC_1:114;
      then reconsider I=i,J=j,P=p,N=n as non zero Element of NAT by A4,A5,A8,A7
,A6;
A9:   card {I,J}=2 by A3,CARD_2:57;
      set JP=M*(J,P);
      set JN=M*(J,N);
      set IP=M*(I,P);
      set IN=M*(I,N);
A10:  Det EqSegm(M,{I,J},{N,P}) = 0.K by A1,A2,A3,Th96;
      card {N,P}=2 by A3,CARD_2:57;
      then
A11:  EqSegm(M,{I,J},{N,P})=Segm(M,{I,J},{N,P}) by A9,Def3;
      per cases by A3,XXREAL_0:1;
      suppose
        I<J & N<P;
        then 0.K = Det(IN,IP)][(JN,JP) by A9,A11,A10,Th45
          .= IN*JP-IP*JN by MATRIX_9:13;
        hence thesis by VECTSP_1:19;
      end;
      suppose
        I<J & N>P;
        then 0.K = Det(IP,IN)][(JP,JN) by A9,A11,A10,Th45
          .= IP*JN-IN*JP by MATRIX_9:13;
        hence thesis by VECTSP_1:19;
      end;
      suppose
        I>J & N<P;
        then 0.K = Det(JN,JP)][(IN,IP) by A9,A11,A10,Th45
          .= JN*IP-JP*IN by MATRIX_9:13;
        hence thesis by VECTSP_1:19;
      end;
      suppose
        I>J & N>P;
        then 0.K = Det(JP,JN)][(IP,IN) by A9,A11,A10,Th45
          .= JP*IN-JN*IP by MATRIX_9:13;
        hence thesis by VECTSP_1:19;
      end;
    end;
  end;
  assume that
A12: ex i,j st [i,j] in Indices M & M*(i,j) <> 0.K and
A13: for i,j,n,m st [:{i,j},{n,m}:] c= Indices M holds M*(i,n)*(M*(j,m))
  =M*(i,m)*(M*(j,n));
  now
    let i0,j0,n0,m0 such that
A14: i0<>j0 and
A15: n0<>m0 and
A16: [:{i0,j0},{n0,m0}:] c= Indices M;
A17: card {i0,j0}=2 by A14,CARD_2:57;
    set JM=M*(j0,m0);
    set JN=M*(j0,n0);
    set IM=M*(i0,m0);
    set IN=M*(i0,n0);
A18: IN*JM=IM*JN by A13,A16;
    card {n0,m0}=2 by A15,CARD_2:57;
    then
A19: EqSegm(M,{i0,j0},{n0,m0})=Segm(M,{i0,j0},{n0,m0}) by A17,Def3;
    per cases by A14,A15,XXREAL_0:1;
    suppose
      i0<j0 & n0<m0;
      then EqSegm(M,{i0,j0},{n0,m0}) = (IN,IM)][(JN,JM) by A19,Th45;
      hence Det EqSegm(M,{i0,j0},{n0,m0}) = IN*JM-IM*JN by A17,MATRIX_9:13
        .= 0.K by A18,VECTSP_1:19;
    end;
    suppose
      i0<j0 & n0>m0;
      then EqSegm(M,{i0,j0},{n0,m0} )= (IM,IN)][(JM,JN) by A19,Th45;
      hence Det EqSegm(M,{i0,j0},{n0,m0}) = IM*JN-IN*JM by A17,MATRIX_9:13
        .= 0.K by A18,VECTSP_1:19;
    end;
    suppose
      i0>j0 & n0<m0;
      then EqSegm(M,{i0,j0},{n0,m0}) = (JN,JM)][(IN,IM) by A19,Th45;
      hence Det EqSegm(M,{i0,j0},{n0,m0}) = JN*IM-JM*IN by A17,MATRIX_9:13
        .= 0.K by A18,VECTSP_1:19;
    end;
    suppose
      i0>j0 & n0>m0;
      then EqSegm(M,{i0,j0},{n0,m0})=(JM,JN)][(IM,IN) by A19,Th45;
      hence Det EqSegm(M,{i0,j0},{n0,m0}) = JM*IN-JN*IM by A17,MATRIX_9:13
        .= 0.K by A18,VECTSP_1:19;
    end;
  end;
  hence thesis by A12,Th96;
end;
