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;
reserve S,S1,S2 for FinSequence_of_Square-Matrix of D,
  R,R1,R2 for FinSequence_of_Square-Matrix of K;
reserve N for (Matrix of n,K),
  N1 for (Matrix of m,K);

theorem
  Len G <> Width G implies for M be Matrix of n,K st M = block_diagonal(
  G,0.K) holds Det M = 0.K
proof
  set B= block_diagonal(G,0.K);
  defpred P[Nat] means $1 in Seg len G & (Len G).$1<>(Width G).$1;
A1: Seg len G=dom G by FINSEQ_1:def 3;
  assume Len G<>Width G;
  then
A2: ex k st P[k] by FINSEQ_2:119;
  consider k such that
A3: P[k] and
A4: for n st P[n] holds k<=n from NAT_1:sch 5(A2);
  1<=k by A3,FINSEQ_1:1;
  then reconsider k1=k-1 as Element of NAT by NAT_1:21;
  set Gk=G|k1;
A5: len G=len (Width G) by CARD_1:def 7;
  then k in dom (Width G) by A3,FINSEQ_1:def 3;
  then
A6: width (G.k)=(Width G).k by Def4;
  set bGk=block_diagonal(Gk,0.K);
  set bGk1=block_diagonal(G/^k,0.K);
  set bGG=block_diagonal(<*G.k,bGk1*>,0.K);
  k1+1<=len G by A3,FINSEQ_1:1;
  then
A7: k1<len G by NAT_1:13;
  then len((Width G) |k1)=k1 by A5,FINSEQ_1:59;
  then
A8: dom ((Width G) |k1)=Seg k1 by FINSEQ_1:def 3;
A9: len G=len (Len G) by CARD_1:def 7;
  then len((Len G) |k1)=k1 by A7,FINSEQ_1:59;
  then
A10: dom ((Len G) |k1)=Seg k1 by FINSEQ_1:def 3;
A11: Seg k1 c=Seg len G by A7,FINSEQ_1:5;
A12: now
    let j such that
A13: j in Seg k1;
    j<=k1 by A13,FINSEQ_1:1;
    then j < k1+1 by NAT_1:13;
    then
A14: (Len G).j=(Width G).j by A4,A11,A13;
    thus (Len Gk).j = ((Len G) |k1).j by Th17
      .= (Len G).j by A10,A13,FUNCT_1:47
      .= ((Width G) |k1).j by A8,A13,A14,FUNCT_1:47
      .= (Width Gk).j by Th21;
  end;
  len Gk=k1 by A7,FINSEQ_1:59;
  then
 Len Gk = Width Gk by A12,FINSEQ_2:119;
  then reconsider bGk as Matrix of Sum Len Gk,K;
  let M be Matrix of n,K;
  assume M =B;
  then
A15: M = block_diagonal(G| (k1+1)^(G/^k),0.K) by RFINSEQ:8
    .= block_diagonal(Gk^<*G.k*>^(G/^k),0.K) by A3,A1,FINSEQ_5:10
    .= block_diagonal(Gk^(<*G.k*>^(G/^k)),0.K) by FINSEQ_1:32
    .= block_diagonal(<*bGk*>^(<*G.k*>^(G/^k)),0.K) by Th35
    .= block_diagonal(<*bGk*>^<*block_diagonal(<*G.k*>^(G/^k),0.K)*>,0.K) by
Th36
    .= block_diagonal(<*bGk,bGG*>,0.K) by Th36;
  then
A16: len M=Sum Len <*bGk,bGG*> by Def5;
A17: Sum Width <*bGk,bGG*>=width bGk+width bGG by Th20;
A18: width bGk=Sum Len Gk by MATRIX_0:24;
A19: len bGk=Sum Len Gk by Def5;
A20: width M=n by MATRIX_0:24;
A21: Sum Len <*bGk,bGG*>=len bGk+len bGG by Th16;
A22: len M=n by MATRIX_0:24;
  width M=Sum Width <*bGk,bGG*> by A15,Def5;
  then reconsider bGG9=bGG as Matrix of len bGG,K by A16,A22,A20,A21,A19,A18
,A17,MATRIX_0:51;
  k in dom (Len G) by A3,A9,FINSEQ_1:def 3;
  then len (G.k)=(Len G).k by Def3;
  then Det bGG9=0.K by A3,A6,Th54;
  hence Det M = Det bGk * 0.K by A15,A16,A22,Th52
    .= 0.K;
end;
