reserve n,m,i,j,k for Nat,
  x,y,e,X,V,U for set,
  W,f,g for Function;
reserve p,q for FinSequence;
reserve G for Graph,
  pe,qe for FinSequence of the carrier' of G;

theorem Th18:
  not vertices pe c= V implies ex i being Element of NAT, q,r
being FinSequence of the carrier' of G st i+1 <= len pe & not vertices(pe/.(i+1
  )) c= V & len q=i & pe=q^r & vertices q c= V
proof
  defpred P[Nat] means $1 in dom pe & not vertices(pe/.$1) c= V;
  assume not vertices pe c= V;
  then
A1: ex i be Nat st P[i] by Th17;
  consider k be Nat such that
A2: P[k] & for n be Nat st P[n] holds k <= n from NAT_1:sch 5(A1);
  k <= len pe by A2,FINSEQ_3:25;
  then consider j being Nat such that
A3: len pe=k+j by NAT_1:10;
  reconsider j as Element of NAT by ORDINAL1:def 12;
  1 <= k by A2,FINSEQ_3:25;
  then consider i being Nat such that
A4: k=1+i by NAT_1:10;
  reconsider i as Element of NAT by ORDINAL1:def 12;
  len pe=i+(1+j) by A4,A3;
  then consider q,r being FinSequence such that
A5: len q = i and
  len r = 1+j and
A6: pe = q^r by FINSEQ_2:22;
  reconsider q,r as FinSequence of the carrier' of G by A6,FINSEQ_1:36;
  take i,q,r;
  thus i+1 <= len pe & not vertices(pe/.(i+1)) c= V by A2,A4,FINSEQ_3:25;
  thus len q=i & pe=q^r by A5,A6;
  now
    let m be Nat;
    assume
A7: m in dom q;
    then
A8: m <= len q by FINSEQ_3:25;
A9: dom q c= dom pe by A6,FINSEQ_1:26;
    assume
A10: not vertices(q/.m) c= V;
    q/.m=q.m by A7,PARTFUN1:def 6
      .=pe.m by A6,A7,FINSEQ_1:def 7
      .=pe/.m by A7,A9,PARTFUN1:def 6;
    then k <= m by A2,A7,A10,A9;
    hence contradiction by A4,A5,A8,NAT_1:13;
  end;
  hence thesis by Th17;
end;
