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 Th60:
  block_diagonal(<*1.(K,i),1.(K,j)*>,0.K)=1.(K,i+j)
proof
  set I=1.(K,i);
  set J=1.(K,j);
  set B=block_diagonal(<*I,J*>,0.K);
A1: len I=i by MATRIX_0:24;
A2: Sum Len <*J*>=len J by Lm4;
A3: len J=j by MATRIX_0:24;
  then
A4: Indices block_diagonal(<*J*>,0.K)=[:Seg j,Seg j:] by A2,MATRIX_0:24;
  Sum Len <*I,J*>=len I+len J by Th16;
  then reconsider B as Matrix of i+j,K by A1,A3;
A5: Indices B=[:Seg (i+j),Seg (i+j):] by MATRIX_0:24;
A6: Indices J=[:Seg j,Seg j:] by MATRIX_0:24;
A7: width I=i by MATRIX_0:24;
A8: Indices I=[:Seg i,Seg i:] by MATRIX_0:24;
A9: Sum Width <*I*>=width I by Lm5;
A10: Sum Len <*I*>=len I by Lm4;
  then
A11: Indices block_diagonal(<*I*>,0.K) =[:Seg i,Seg i:] by A1,MATRIX_0:24;
A12: now
    let n,m such that
A13: [n,m] in Indices B and
A14: n <> m;
 m in Seg (i+j) by A5,A13,ZFMISC_1:87;
    then
A15: m>=1 by FINSEQ_1:1;
 n in Seg (i+j) by A5,A13,ZFMISC_1:87;
    then
A16: n>=1 by FINSEQ_1:1;
    now
      per cases;
      suppose
A17:    n<=i & m<=i;
        then
A18:    m in Seg i by A15;
        n in Seg i by A16,A17;
        then
A19:    [n,m] in [:Seg i,Seg i:] by A18,ZFMISC_1:87;
        hence B*(n,m) = block_diagonal(<*I*>,0.K)*(n,m) by A2,A11,Th26
          .= I*(n,m) by Th34
          .= 0.K by A8,A14,A19,MATRIX_1:def 3;
      end;
      suppose
A20:    n>i & m>i;
        then
A21:    m-i<>0;
        n-'i=n-i by A20,XREAL_1:233;
        then
A22:    n=n-'i+i;
        m-'i=m-i by A20,XREAL_1:233;
        then
A23:    m=m-'i+i;
        n-i<>0 by A20;
        then
A24:    [n-'i,m-'i] in [:Seg j,Seg j:] by A10,A9,A1,A7,A4,A13,A21,A22,A23,Th27;
        hence B*(n,m) = block_diagonal(<*J*>,0.K)*(n-'i,m-'i) by A10,A9,A1,A7
,A4,A22,A23,Th28
          .= J*(n-'i,m-'i) by Th34
          .= 0.K by A6,A14,A22,A23,A24,MATRIX_1:def 3;
      end;
      suppose
        n<=i & m>i or n>i & m<=i;
        hence B*(n,m)=0.K by A10,A9,A2,A1,A7,A13,Th29;
      end;
    end;
    hence B*(n,m) = 0.K;
  end;
  now
    let n such that
A25: [n,n] in Indices B;
 n in Seg (i+j) by A5,A25,ZFMISC_1:87;
    then
A26: n >= 1 by FINSEQ_1:1;
    now
      per cases;
      suppose
        n<=i;
        then n in Seg i by A26;
        then
A27:    [n,n] in [:Seg i,Seg i:] by ZFMISC_1:87;
        hence B*(n,n) = block_diagonal(<*I*>,0.K)*(n,n) by A2,A11,Th26
          .= I*(n,n) by Th34
          .= 1_K by A8,A27,MATRIX_1:def 3;
      end;
      suppose
A28:    n>i;
        then n-'i=n-i by XREAL_1:233;
        then
A29:    n=n-'i+i;
        n-i<>0 by A28;
        then
A30:    [n-'i,n-'i] in [:Seg j,Seg j:] by A10,A9,A1,A7,A4,A25,A29,Th27;
        hence B*(n,n) = block_diagonal(<*J*>,0.K)*(n-'i,n-'i) by A10,A9,A1,A7
,A4,A29,Th28
          .= J*(n-'i,n-'i) by Th34
          .= 1_K by A6,A30,MATRIX_1:def 3;
      end;
    end;
    hence B*(n,n) = 1_K;
  end;
  hence thesis by A12,MATRIX_1:def 3 ;
end;
