reserve D for non empty set,
  i,j,k for Nat,
  n,m for Nat,
  r for Real,
  e for real-valued FinSequence;

theorem
  for M being non empty-yielding with_line_sum=1 Matrix of REAL holds
  SumAll M = len M
proof
  let M be non empty-yielding with_line_sum=1 Matrix of REAL;
  set n = len M;
A1: len Sum M = n & for i be Nat st i in dom Sum M holds (Sum M).i = 1
  proof
    thus len Sum M = n by Def1;
    hereby
      let i be Nat;
      assume
A2:   i in dom Sum M;
      then i in Seg len Sum M by FINSEQ_1:def 3;
      then i in Seg len M by Def1;
      then i in dom M by FINSEQ_1:def 3;
      then Sum(M.i) = 1 by Def9;
      hence (Sum M).i = 1 by A2,Def1;
    end;
  end;
  n > 0 by Th54;
  then Sum M = n |-> jj by A1,Th1;
  hence SumAll M = n * 1 by RVSUM_1:80
    .= n;
end;
