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 be Matrix of REAL st width M > 0 holds LineSum M = ColSum(M@)
proof
  let M be Matrix of REAL;
  assume width M > 0;
  then
A1: len M = width (M@) by MATRIX_0:54;
A2: len LineSum M = len M by Th20;
A3: len ColSum (M@) = width (M@) by Def2;
A4: now
    let i be Nat;
    assume that
A5: 1 <= i and
A6: i <= len ColSum (M@);
    i <= len LineSum M by A2,A1,A6,Def2;
    then i in Seg len LineSum M by A5;
    then
A7: i in Seg len M by Th20;
    then
A8: i in dom M by FINSEQ_1:def 3;
    i in Seg width (M@) by A3,A5,A6;
    hence (ColSum (M@)).i = Sum Col((M@),i) by Def2
      .= Sum (Line(M,i)) by A8,MATRIX_0:58
      .= (LineSum M).i by A7,Th20;
  end;
  len ColSum (M@)=len LineSum M by A2,A1,Def2;
  hence thesis by A4;
end;
