reserve i,j,k,l for natural Number;
reserve A for set, a,b,x,x1,x2,x3 for object;
reserve D,D9,E for non empty set;
reserve d,d1,d2,d3 for Element of D;
reserve d9,d19,d29,d39 for Element of D9;
reserve p,q,r for FinSequence;

theorem Th17:
  for p being FinSequence of A st len p <> 0 ex q being
  FinSequence of A, d being Element of A st p = q^<*d*>
proof
  let p be FinSequence of A;
  assume
A1: len p <> 0;
  then p <> {};
  then consider q being FinSequence,d being object such that
A2: p = q^<*d*> by FINSEQ_1:46;
  for i be Nat st i in dom q holds q.i in A
  proof
    let i be Nat;
    assume i in dom q;
    then p.i = q.i & i in dom p by A2,Th13,FINSEQ_1:def 7;
    hence thesis by Th9;
  end;
  then
A3: q is FinSequence of A by Th10;
  len p in Seg len p by A1,FINSEQ_1:3;
  then
A4: len p in dom p by FINSEQ_1:def 3;
  len p = len q + 1 by A2,Th14;
  then p.(len p) = d by A2,FINSEQ_1:42;
  then d is Element of A by A4,Th9;
  hence thesis by A2,A3;
end;
