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;
reserve f for FinSequence of D;
reserve i,j,i1,j1 for Nat;
reserve k for Nat, G for Matrix of D;
reserve x,y,x1,x2,y1,y2 for object,
  i,j,k,l,n,m for Nat,
  D for non empty set,
  s,s2 for FinSequence,
  a,b,c,d for Element of D,
  q,r for FinSequence of D,
  a9,b9 for Element of D;

theorem Th54:
  for M being Matrix of D st width M > 0 holds len (M@)=width M &
  width (M@)=len M
proof
  let M be Matrix of D;
  assume
A1: width M>0;
  thus len (M@)=width M by Def6;
  per cases;
  suppose
    len M=0;
    hence thesis by A1,Def3;
  end;
  suppose
A2: len M>0;
A3: width (M@) in NAT by ORDINAL1:def 12;
    for i,j being object holds [i,j]in [:dom (M@),Seg width (M@):] iff [i,j]
    in [:Seg width M,dom M:]
    proof
      let i,j be object;
      thus [i,j] in [:dom (M@),Seg width (M@):] implies [i,j] in [:Seg width M
      ,dom M:]
      proof
        assume
A4:     [i,j]in [:dom (M@),Seg width (M@):];
        then i in dom (M@) & j in Seg width (M@) by ZFMISC_1:87;
        then reconsider i,j as Nat;
        [i,j] in Indices (M@) by A4;
        then [j,i] in Indices M by Def6;
        hence thesis by ZFMISC_1:88;
      end;
      assume
A5:   [i,j] in [:Seg width M,dom M:];
      then i in Seg width M & j in dom M by ZFMISC_1:87;
      then reconsider i,j as Nat;
      [j,i] in Indices M by A5,ZFMISC_1:88;
      then [i,j] in Indices (M@) by Def6;
      hence thesis;
    end;
    then
    dom M = Seg len M & [:Seg width M,dom M:]=[:dom (M@),Seg width (M@):]
    by FINSEQ_1:def 3,ZFMISC_1:89;
    then dom M=Seg width (M@) by A1,A2,ZFMISC_1:110;
    hence thesis by FINSEQ_1:def 3,A3;
  end;
end;
