reserve x,y,z for object,
  i,j,n,m for Nat,
  D for non empty set,
  s,t for FinSequence,
  a,a1,a2,b1,b2,d for Element of D,
  p, p1,p2,q,r for FinSequence of D;
reserve M,M1,M2 for Matrix of D;

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;
