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;

theorem Th9:
  s is Matrix of D iff ex n st for x st x in rng s ex p st x = p & len p = n
proof
  thus s is Matrix of D implies ex n st for x st x in rng s ex p st x=p & len
  p = n
  proof
    assume s is Matrix of D;
    then reconsider s as tabular FinSequence of D*;
    consider n such that
A1: for x st x in rng s ex t st t=x & len t = n by Def1;
    take n;
    for x st x in rng s ex p st x=p & len p = n
    proof
      let x;
      assume
A2:   x in rng s;
      then consider v being FinSequence such that
A3:   v=x and
A4:   len v=n by A1;
      rng s c= D* by FINSEQ_1:def 4;
      then reconsider p=v as FinSequence of D by A2,A3,FINSEQ_1:def 11;
      take p;
      thus thesis by A3,A4;
    end;
    hence thesis;
  end;
  given n such that
A5: for x st x in rng s ex p st x = p & len p = n;
A6: s is tabular
  proof
    consider n such that
A7: for x st x in rng s ex p st x = p & len p = n by A5;
    take n;
    for x st x in rng s ex t st t= x & len t= n
    proof
      let x;
      assume x in rng s;
      then consider p such that
A8:   x = p & len p = n by A7;
      reconsider t=p as FinSequence;
      take t;
      thus thesis by A8;
    end;
    hence thesis;
  end;
  rng s c= D*
  proof
    let x be object;
    assume x in rng s;
    then ex p st x=p & len p = n by A5;
    then reconsider q=x as FinSequence of D;
    q in D* by FINSEQ_1:def 11;
    hence thesis;
  end;
  hence thesis by A6,FINSEQ_1:def 4;
end;
