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;
reserve v,v1,v2,v3 for Element of G;
reserve p,q for oriented Chain of G;

theorem Th31:
  len p >= 1 & p is_orientedpath_of v1,v2 & pe.1 orientedly_joins
  v2,v3 & len pe=1 implies ex q st q=p^pe & q is_orientedpath_of v1,v3
proof
  assume that
A1: len p >= 1 and
A2: p is_orientedpath_of v1,v2 and
A3: pe.1 orientedly_joins v2,v3 and
A4: len pe=1;
  set FT=the Target of G, FS=the Source of G;
A5: pe is oriented Chain of G by A4,Th13;
  FT.(p.len p)=v2 & FS.(pe.1)=v2 by A2,A3,GRAPH_4:def 1;
  then reconsider q=p^pe as oriented Chain of G by A5,Th10;
A6: len q=len p +1 by A4,FINSEQ_1:22;
  FT.(pe.1)=v3 by A3,GRAPH_4:def 1;
  then
A7: FT.(q.(len q))=v3 by A4,A6,Lm2;
  FS.(p.1)=v1 by A2;
  then
A8: FS.(q.1)=v1 by A1,Lm1;
  take q;
  q <> {} by A6;
  hence thesis by A8,A7;
end;
