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 Th58:
  for M be Matrix of n,K holds Segm(M,Seg n\{i},Seg n\{j}) = Deleting(M,i,j)
proof
  let M be Matrix of n,K;
A1: width M=n by MATRIX_0:24;
A2: len M = n by MATRIX_0:24;
  then
A3: dom M=Seg n by FINSEQ_1:def 3;
  per cases;
  suppose
A4: not i in Seg n;
    then
A5: Seg n=Seg n\{i} by ZFMISC_1:57;
    Del(M,i)=M by A3,A4,FINSEQ_3:104;
    hence thesis by A2,A1,A5,Th52;
  end;
  suppose
A6: i in Seg n;
    set Q1=Seg n;
    set Q=Seg n\{j};
    set P=Seg n\{i};
    set SS=Segm(M,P,Q1);
    consider m such that
A7: len M = m + 1 and
A8: len Del(M,i) = m by A3,A6,FINSEQ_3:104;
    per cases;
    suppose
A9:   m=0;
      then len Deleting(M,i,j) = 0 by A8,MATRIX_0:def 13;
      then
A10:  Deleting(M,i,j) = {};
A11:  Q1\{1} = {} by A2,A7,A9,FINSEQ_1:2,XBOOLE_1:37;
      i = 1 by A2,A6,A7,A9,FINSEQ_1:2,TARSKI:def 1;
      then len Segm(M,P,Q) = 0 by A11,MATRIX_0:def 2;
      hence thesis by A10;
    end;
    suppose
      m>0;
      then n > 1+0 by A2,A7,XREAL_1:8;
      then
A12:  n = width DelLine(M,i) by A2,A1,LAPLACE:4;
A13:  Q c= Seg n by XBOOLE_1:36;
A14:  rng Sgm P = P by FINSEQ_1:def 14;
      dom Sgm P = Seg card P by FINSEQ_3:40;
      then
A15:  Sgm P"P = Seg card P by A14,RELAT_1:134
        .= Seg len SS by MATRIX_0:def 2;
A16:  SS = Del(M,i) by A2,A1,Th51;
      then
A17:  Deleting(M,i,j)=Segm(SS,Seg len SS,Seg width SS\{j}) by Th52;
      Sgm Q1 =idseq n by FINSEQ_3:48;
      then Sgm Q1"Q =Seg width SS\{j} by A13,A12,A16,FUNCT_2:94;
      hence thesis by A13,A15,A17,Th56;
    end;
  end;
end;
