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
  block_diagonal(1.(K,f),0.K) = 1.(K,Sum f)
proof
  defpred P[Nat] means for f st len f=$1 holds block_diagonal(1.(K,f),0.K) =
  1.(K,Sum f);
A1: for n st P[n] holds P[n+1]
  proof
    let n such that
A2: P[n];
    set n1=n+1;
    let f such that
A3: len f=n1;
A4: len (f|n)=n by A3,FINSEQ_1:59,NAT_1:11;
    1 <= n1 by NAT_1:11;
    then n1 in dom f by A3,FINSEQ_3:25;
    then
A5: f/.n1 = f.n1 by PARTFUN1:def 6;
A6: f=(f|n)^<*f.n1*> by A3,FINSEQ_3:55;
    hence block_diagonal(1.(K,f),0.K) = block_diagonal(1.(K,f|n)^(1.(K,<*f/.n1
    *>)),0.K) by A5,Th58
      .= block_diagonal(1.(K,f|n)^<*1.(K,f.n1)*>,0.K) by A5,Th57
      .= block_diagonal(<*block_diagonal(1.(K,f|n),0.K)*>^<*1.(K,f.n1)*>,0.K
    ) by Th35
      .= block_diagonal(<*1.(K,Sum (f|n)),1.(K,f.n1)*>,0.K) by A2,A4
      .= 1.(K,Sum (f|n)+f.n1) by Th60
      .= 1.(K,Sum f) by A6,RVSUM_1:74;
  end;
A7: P[0]
  proof
    let f such that
A8: len f=0;
    dom 1.(K,f)=dom f by Def8;
    then len 1.(K,f)=0 by A8,FINSEQ_3:29;
    then
A9: Sum Len 1.(K,f)=0 by RVSUM_1:72;
    f = {} by A8;
    hence thesis by A9,MATRIX_0:45,RVSUM_1:72;
  end;
  for n holds P[n] from NAT_1:sch 2(A7,A1);
  then P[len f];
  hence thesis;
end;
