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
  Det block_diagonal(R,0.K) = Product (Det R)
proof
  defpred P[Nat] means for R st len R=$1 holds Det block_diagonal(R,0.K) =
  Product (Det R);
A1: for n st P[n] holds P[n+1]
  proof
    let n such that
A2: P[n];
    set n1=n+1;
    let R such that
A3: len R=n1;
    set Rn=R|n;
A4: len Rn=n by A3,FINSEQ_1:59,NAT_1:11;
    set R1=R.n1;
    set bR=block_diagonal(Rn,0.K);
A5: R=Rn^<*R1*> by A3,FINSEQ_3:55;
    then
A6: block_diagonal(R,0.K)=block_diagonal(<*bR,R1*>,0.K) by Th35;
    Sum Len <*bR,R1*> = len bR +len R1 by Th16
      .= Sum Len Rn+len R1 by Def5
      .= Sum (Len Rn^<*len R1*>) by RVSUM_1:74
      .= Sum (Len Rn^Len <*R1*>) by Th15
      .= Sum Len R by A5,Th14;
    hence Det block_diagonal(R,0.K) = Det bR * Det R1 by A6,Th52
      .= (Product Det Rn)*Det R1 by A2,A4
      .= Product ((Det Rn)^<*Det R1*>)by GROUP_4:6
      .= Product((Det Rn)^(Det <*R1*>)) by Th49
      .= Product Det R by A5,Th50;
  end;
A7: P[0]
  proof
    let R such that
A8: len R=0;
    Len R = {} by A8;
    hence Det block_diagonal(R,0.K) = 1_K by MATRIXR2:41,RVSUM_1:72
      .= Product Det R by A8,FVSUM_1:80;
  end;
  for n holds P[n] from NAT_1:sch 2(A7,A1);
  hence thesis;
end;
