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 Th82:
  [:rng nt,rng mt:] = Indices M implies the_rank_of M =
  the_rank_of Segm(M,nt,mt)
proof
  set RM=the_rank_of M;
  set S=Segm(M,nt,mt);
  consider rt1,rt2 be Element of RM-tuples_on NAT such that
A1: [:rng rt1,rng rt2:] c= Indices M and
A2: Det Segm(M,rt1,rt2)<>0.K by Th76;
  assume
A3: [:rng nt,rng mt:] = Indices M;
A4: now
    per cases;
    suppose
      RM=0;
      hence RM <= the_rank_of S;
    end;
    suppose
A5:   RM>0;
      then len rt2>0;
      then
A6:   rt2<>{};
      len rt1>0 by A5;
      then
A7:   rt1<>{};
      then rng nt<>{} by A3,A1,A6;
      then
   dom nt<>{} by RELAT_1:42;
then A8:    n <> 0;
      then
A9:  width S=m by Th1;
A10:  dom mt =Seg m by FINSEQ_2:124;
      set MR=Segm(M,rt1,rt2);
A11:  dom rt2=Seg RM by FINSEQ_2:124;
      rng rt1 c= rng nt by A3,A1,A6,ZFMISC_1:114;
      then consider R1 be Function such that
A12:  dom R1 = dom rt1 and
A13:  rng R1 c= dom nt and
A14:  rt1 = nt*R1 by Th81;
      rng rt2 c= rng mt by A3,A1,A7,ZFMISC_1:114;
      then consider R2 be Function such that
A15:  dom R2 = dom rt2 and
A16:  rng R2 c= dom mt and
A17:  rt2 = mt*R2 by Th81;
A18:  dom rt1=Seg RM by FINSEQ_2:124;
      then reconsider R1,R2 as FinSequence by A12,A15,A11,FINSEQ_1:def 2;
A19:  rng R1 c= NAT by A13,XBOOLE_1:1;
      rng R2 c= NAT by A16,XBOOLE_1:1;
      then reconsider R1,R2 as FinSequence of NAT by A19,FINSEQ_1:def 4;
A20:  len R1=RM by A12,A18,FINSEQ_1:def 3;
      len R2=RM by A15,A11,FINSEQ_1:def 3;
      then reconsider R1,R2 as Element of RM-tuples_on NAT by A20,FINSEQ_2:92;
      set SR=Segm(S,R1,R2);
      len S=n by Th1,A8;
      then
A21:  Indices S=[:Seg n,Seg m:] by A9,FINSEQ_1:def 3;
      now
A22:    dom mt=Seg m by FINSEQ_2:124;
        let i,j such that
A23:    [i,j] in Indices SR;
        reconsider I=i,J=j,RI=R1.i,RJ=R2.j as Element of NAT by ORDINAL1:def 12
;
A24:    dom nt=Seg n by FINSEQ_2:124;
A25:    Indices SR=[:dom R1,dom R2:] by A12,A15,A18,A11,MATRIX_0:24;
        then
A26:    i in dom R1 by A23,ZFMISC_1:87;
A27:    j in dom R2 by A23,A25,ZFMISC_1:87;
        then
A28:    R2.j in rng R2 by FUNCT_1:def 3;
        R1.i in rng R1 by A26,FUNCT_1:def 3;
        then
A29:    [R1.I,R2.J] in Indices S by A13,A16,A21,A28,A24,A22,ZFMISC_1:87;
        [i,j] in Indices MR by A23,MATRIX_0:26;
        hence MR*(i,j) = M*(rt1.I,rt2.J) by Def1
          .= M*(nt.RI,rt2.J) by A12,A14,A26,FUNCT_1:12
          .= M*(nt.RI,mt.RJ) by A15,A17,A27,FUNCT_1:12
          .= S*(R1.I,R2.J) by A29,Def1
          .= SR*(i,j) by A23,Def1;
      end;
      then
A30:  Det SR<>0.K by A2,MATRIX_0:27;
      dom nt=Seg n by FINSEQ_2:124;
      then [:rng R1,rng R2:] c= Indices S by A13,A16,A10,A21,ZFMISC_1:96;
      hence RM <= the_rank_of S by A30,Th76;
    end;
  end;
  RM >= the_rank_of S by A3,Th78;
  hence thesis by A4,XXREAL_0:1;
end;
