reserve i,n for Nat,
  K for Field,
  M1,M2,M3,M4 for Matrix of n,K;

theorem
  Trace M1=Trace M1@
proof
A1: for i be Nat st i in Seg n holds (diagonal_of_Matrix M1).i=(
  diagonal_of_Matrix M1@).i
  proof
    let i be Nat;
    assume
A2: i in Seg n;
    then
A3: (diagonal_of_Matrix M1).i=M1*(i,i) & (diagonal_of_Matrix M1@).i=M1@*(i
    ,i) by MATRIX_3:def 10;
    Indices M1=[:Seg n, Seg n:] by MATRIX_0:24;
    then [i,i] in Indices M1 by A2,ZFMISC_1:87;
    hence thesis by A3,MATRIX_0:def 6;
  end;
  len diagonal_of_Matrix M1@ = n by MATRIX_3:def 10;
  then
A4: dom (diagonal_of_Matrix M1@) = Seg n by FINSEQ_1:def 3;
  len diagonal_of_Matrix M1 = n by MATRIX_3:def 10;
  then dom (diagonal_of_Matrix M1) = Seg n by FINSEQ_1:def 3;
  hence thesis by A1,A4,FINSEQ_1:13;
end;
