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 Th29:
  [i,j] in Indices block_diagonal(F1^F2,d) & (i <= Sum Len F1 & j
> Sum Width F1 or i > Sum Len F1 & j <= Sum Width F1) implies block_diagonal(F1
  ^F2,d)*(i,j) = d
proof
  set L1=Len F1;
  set W1=Width F1;
  set L2=Len F2;
  set W2=Width F2;
  set F12=F1^F2;
  set L=Len F12;
  set W=Width F12;
  set B12=block_diagonal(F12,d);
A1: dom B12=Seg len B12 by FINSEQ_1:def 3;
A2: len W1=len F1 by CARD_1:def 7;
A3: len B12=Sum L by Def5;
A4: len F1=len L1 by CARD_1:def 7;
  assume that
A5: [i,j] in Indices block_diagonal(F1^F2,d) and
A6: i <= Sum Len F1 & j > Sum Width F1 or i > Sum Len F1 & j <= Sum Width F1;
  i in dom B12 by A5,ZFMISC_1:87;
  then
A7: 1<=i by FINSEQ_3:25;
A8: W1^W2=W by Th18;
A9: L1^L2=L by Th14;
  then
A10: Sum L=Sum L1+Sum L2 by RVSUM_1:75;
  per cases by A6;
  suppose
A11: i <= Sum Len F1 & j > Sum Width F1;
    then
A12: i in Seg Sum L1 by A7;
    then min(L1,i) in dom L1 by Def1;
    then min(L1,i)<=len L1 by FINSEQ_3:25;
    then
A13: Sum (W|min(L1,i))<= Sum(W| (len L1)) by POLYNOM3:18;
A14: W| (len L1)=W1 by A8,A2,A4,FINSEQ_5:23;
    min(L,i)=min(L1,i) by A9,A12,Th8;
    then Sum(W|min(L,i))<j by A11,A14,A13,XXREAL_0:2;
    hence thesis by A5,Def5;
  end;
  suppose
A15: i > Sum L1 & j <= Sum W1;
A16: i in Seg Sum L by A1,A3,A5,ZFMISC_1:87;
    not i in Seg Sum L1 by A15,FINSEQ_1:1;
    then
A17: i in Seg (Sum L1+Sum L2)\Seg Sum L1 by A10,A16,XBOOLE_0:def 5;
    then
A18: i-'Sum L1=i-Sum L1 by Th9;
    then
A19: i=(i-'Sum L1)+Sum L1;
    i-'Sum L1<>0 by A15,A18;
    then i-'Sum L1 in Seg Sum L2 by A10,A16,A19,FINSEQ_1:61;
    then min(L2,i-'Sum L1) in dom L2 by Def1;
    then
A20: min(L2,i-'Sum L1) >=1 by FINSEQ_3:25;
    min(L,i)=(min(L2,i-'Sum L1))+len L1 by A9,A17,Th9;
    then min(L,i)-'1=(min(L2,i-'Sum L1)-'1)+len L1 by A20,NAT_D:38;
    then min(L,i)-'1>=len L1+0 by XREAL_1:7;
    then
A21: Sum(W| (min(L,i)-'1))>=Sum ((W1^W2) |len W1) by A8,A2,A4,POLYNOM3:18;
    (W1^W2) |len W1=W1 by FINSEQ_5:23;
    then Sum(W| (min(L,i)-'1))>=j by A15,A21,XXREAL_0:2;
    hence thesis by A5,Def5;
  end;
end;
