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