theorem Th20:
  len M > 0 implies for n holds M is Matrix of len M, n, D iff n = width M
proof
  assume
A1: len M > 0;
  let n;
  thus M is Matrix of len M, n, D implies n = width M
  proof
    consider s such that
A2: s in rng M and
A3: len s=width M by A1,Def3;
    rng M c= D* by FINSEQ_1:def 4;
    then reconsider q=s as FinSequence of D by A2,FINSEQ_1:def 11;
    assume M is Matrix of len M, n, D;
    then len q= n by A2,Def2;
    hence thesis by A3;
  end;
  assume n=width M;
  then for p st p in rng M holds len p=n by A1,Def3;
  hence thesis by Def2;
end;
