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 Th31:
  for M being Matrix of D for p being FinSequence of D* st len p =
len M & p.1 = M.1 & (for k st k >= 1 & k < len M holds p.(k+1) = (p.k) ^ M.(k+1
)) holds len (p.1) = width M & for j st [1,j] in Indices M holds j in dom (p.1)
  & (p.1).j = M*(1,j)
proof
  let M be Matrix of D;
  let p be FinSequence of D* such that
A1: len p = len M and
A2: p.1 = M.1 and
A3: for k st k >= 1 & k < len M holds p.(k+1) = (p.k) ^ M.(k+1);
  per cases;
  suppose
A4: len M = 0;
    then p = {} by A1;
    then p.1 = {} by FUNCT_1:def 2,RELAT_1:38;
    hence len(p.1)=width M by A4,MATRIX_0:def 3;
    let j;
A5: Seg len M = {} by A4;
    assume [1,j] in Indices M;
    hence thesis by A5,MATRPROB:12;
  end;
  suppose
    len M > 0;
    then 1 <= len p by A1,NAT_1:14;
    then 1 in Seg len p by FINSEQ_1:1;
    then 1 in dom p by FINSEQ_1:def 3;
    hence
A6: len (p.1) = 1 * width M by A1,A2,A3,Th29
      .= width M;
    let j such that
A7: [1,j] in Indices M;
    j in Seg width M by A7,MATRPROB:12;
    hence thesis by A2,A6,A7,FINSEQ_1:def 3,MATRPROB:14;
  end;
end;
