reserve i,j,m,n,k for Nat,
  x,y for set,
  K for Field,
  a,a1,a2 for Element of K,
  D for non empty set,
  d,d1,d2 for Element of D,
  M,M1,M2 for (Matrix of D),
  A,A1,A2,B1,B2 for (Matrix of K),
  f,g for FinSequence of NAT;
reserve F,F1,F2 for FinSequence_of_Matrix of D,
  G,G9,G1,G2 for FinSequence_of_Matrix of K;

theorem Th44:
  i in Seg width A implies DelCol(block_diagonal(G^<*A*>,a),i+Sum
  Width G) = block_diagonal(G^<*DelCol(A,i)*>,a)
proof
  assume
A1: i in Seg width A;
  set iS=i+Sum Width G;
  set bG=block_diagonal(G,a);
  set Da=DelCol(A,i);
  set AA=<*A*>;
  set DA=<*Da*>;
  set BG=<*bG*>;
  set BGA=block_diagonal(<*bG,A*>,a);
  set BGD=block_diagonal(<*bG,Da*>,a);
A2: len Da=len A by MATRIX_0:def 13;
  len BGA=Sum Len (BG^AA) by Def5;
  then
A3: len BGA=len bG+len A by Th16;
A4: width bG=Sum Width G by Def5;
A5: len BGD=Sum Len (BG^DA) by Def5;
  then
A6: len BGD=len bG+len Da by Th16;
A7: now
    width A <> 0 by A1;
    then width A >= 1 by NAT_1:14;
    then width A-'1=width A-1 by XREAL_1:233;
    then
A8: width A=(width A-'1)+1;
A9: dom (width A|->a)=Seg width A by FINSEQ_2:124;
A10: len (width bG|->a)=width bG by CARD_1:def 7;
    reconsider Da9=Da as Matrix of len Da,width Da,K by MATRIX_0:51;
    let j such that
A11: 1<=j and
A12: j<= len BGD;
A13: j in Seg len BGD by A11,A12;
A14: len Line(bG,j)=width bG by MATRIX_0:def 7;
A15: now
      per cases;
      suppose
        j<=len bG;
        then
A16:    j in dom bG by A11,FINSEQ_3:25;
        then Line(BGA,j)=Line(bG,j)^(width A|->a) by Th23;
        hence
        Del(Line(BGA,j),iS) = Line(bG,j)^Del(width A|->a,i) by A1,A4,A9,A14,Th3
          .= Line(bG,j)^((width A-'1) |->a) by A1,A8,Th4
          .= Line(bG,j)^(width Da|->a) by A1,LAPLACE:3
          .= Line(BGD,j) by A16,Th23
          .= BGD.j by A5,A13,MATRIX_0:52;
      end;
      suppose
A17:    j>len bG;
        then reconsider jL=j-len bG as Element of NAT by NAT_1:21;
        jL<>0 by A17;
        then
A18:    jL>=1 by NAT_1:14;
        jL+len bG <=len bG+len A by A6,A12,MATRIX_0:def 13;
        then
A19:    jL<=len A by XREAL_1:8;
        then
A20:    jL in dom Da by A2,A18,FINSEQ_3:25;
A21:    jL in Seg len A by A18,A19;
A22:    jL in dom A by A18,A19,FINSEQ_3:25;
        then
A23:    Del(Line(A,jL),i) = Da9.jL by MATRIX_0:def 13
          .= Line(Da,jL) by A2,A21,MATRIX_0:52;
A24:    dom Line(A,jL)=Seg width A by FINSEQ_2:124;
        Line(BGA,jL+len bG)=(width bG |-> a)^Line(A,jL) by A22,Th23;
        hence Del(Line(BGA,j),iS) = (width bG|->a)^Del(Line(A,jL),i) by A1,A4
,A10,A24,Th3
          .= Line(BGD,len bG+jL) by A20,A23,Th23
          .= BGD.j by A5,A13,MATRIX_0:52;
      end;
    end;
    j in dom BGA by A2,A6,A3,A11,A12,FINSEQ_3:25;
    hence DelCol(BGA,iS).j=BGD.j by A15,MATRIX_0:def 13;
  end;
A25: block_diagonal(G^DA,a)=BGD by Th35;
A26: len DelCol(BGA,iS)=len BGA by MATRIX_0:def 13;
  block_diagonal(G^AA,a)=BGA by Th35;
  hence thesis by A2,A26,A5,A3,A7,A25,Th16,FINSEQ_1:14;
end;
