reserve D for non empty set,
  i,j,k,l for Nat,
  n for Nat,
  x for set,
  a,b,c,r,r1,r2 for Real,
  p,q for FinSequence of REAL,
  MR,MR1 for Matrix of REAL;

theorem Th54:
  for M being m-nonnegative Matrix of REAL for M1 being Matrix of
REAL holds M1 = Infor_FinSeq_of M iff len M1 = len M & width M1 = width M & for
  i,j st [i,j] in Indices M1 holds M1*(i,j)=M*(i,j)*log(2,M*(i,j))
proof
  let M be m-nonnegative Matrix of REAL;
  let M1 be Matrix of REAL;
  hereby
    assume
A1: M1 = Infor_FinSeq_of M;
    then
A2: width M1 = width M by Def8;
A3: len M1 = len M by A1,Def8;
    now
      let i,j such that
A4:   [i,j] in Indices M1;
A5:   j in Seg width M1 by A4,MATRPROB:12;
      i in Seg len M1 by A4,MATRPROB:12;
      then
A6:   i in dom M by A3,FINSEQ_1:def 3;
      then reconsider p=Line(M,i) as nonnegative FinSequence of REAL by Th19;
A7:   len p = width M by MATRIX_0:def 7;
      len p = len Infor_FinSeq_of p by Th47;
      then
A8:   j in dom Infor_FinSeq_of p by A2,A5,A7,FINSEQ_1:def 3;
A9:   p.j = M*(i,j) by A2,A5,MATRIX_0:def 7;
      thus M1*(i,j) = Line(M1,i).j by A5,MATRIX_0:def 7
        .= (Infor_FinSeq_of p).j by A1,A6,Th53
        .= M*(i,j)*log(2,M*(i,j)) by A9,A8,Th47;
    end;
    hence len M1 = len M & width M1 = width M & for i,j st [i,j] in Indices M1
    holds M1*(i,j)=M*(i,j)*log(2,M*(i,j)) by A1,Def8;
  end;
  assume that
A10: len M1 = len M and
A11: width M1 = width M and
A12: for i,j st [i,j] in Indices M1 holds M1*(i,j)=M*(i,j)*log(2,M*(i,j) );
A13: dom M1 = dom M by A10,FINSEQ_3:29;
  for k st k in dom M1 holds M1.k = mlt(Line(M,k),FinSeq_log(2,Line(M,k)) )
  proof
    let k such that
A14: k in dom M1;
A15: len (M1.k) = width M1 by A14,MATRIX_0:36;
    reconsider p=Line(M,k) as nonnegative FinSequence of REAL by A13,A14,Th19;
A16: len p = width M by MATRIX_0:def 7;
A17: len FinSeq_log(2,p) = len p by Def6;
    then len mlt(p,FinSeq_log(2,p)) = len p by MATRPROB:30;
    then
A18: dom (M1.k) = dom mlt(p,FinSeq_log(2,p)) by A11,A16,A15,FINSEQ_3:29;
A19: k in Seg len M by A10,A14,FINSEQ_1:def 3;
    now
      let j be Nat such that
A20:  j in dom (M1.k);
A21:  j in Seg width M by A11,A15,A20,FINSEQ_1:def 3;
      then
A22:  p.j=M*(k,j) by MATRIX_0:def 7;
A23:  [k,j] in Indices M by A19,A21,MATRPROB:12;
A24:  (mlt(p,FinSeq_log(2,p))).j = p.j * (FinSeq_log(2,p)).j by RVSUM_1:59
        .= M*(k,j)*(FinSeq_log(2,p)).j by A21,MATRIX_0:def 7;
A25:  j in dom FinSeq_log(2,p) by A16,A17,A21,FINSEQ_1:def 3;
A26:  [k,j] in Indices M1 by A14,A20,MATRPROB:13;
      then
A27:  (M1.k).j = M1*(k,j) by MATRPROB:14
        .= M*(k,j)*log(2,M*(k,j)) by A12,A26;
      per cases by A23,MATRPROB:def 6;
      suppose
        M*(k,j)=0;
        hence (M1.k).j = (mlt(p,FinSeq_log(2,p))).j by A27,A24;
      end;
      suppose
        M*(k,j)>0;
        hence (mlt(p,FinSeq_log(2,p))).j = (M1.k).j by A25,A27,A22,A24,Def6;
      end;
    end;
    hence thesis by A18,FINSEQ_1:13;
  end;
  hence thesis by A10,A11,Def8;
end;
