reserve x,y,X for set,
  i,j,k,m,n for Nat,
  p for FinSequence of X,
  ii for Integer;
reserve G for Graph,
  pe,qe for FinSequence of the carrier' of G,
  p,q for oriented Chain of G,
  W for Function,
  U,V,e,ee for set,
  v1,v2,v3,v4 for Vertex of G;

theorem Th12:
  the carrier of G= U \/ V & v1 in U & (for v3,v4 st v3 in U & v4
in V holds not (ex e st e in the carrier' of G & e orientedly_joins v3,v4)) & p
  is_orientedpath_of v1,v2 implies p is_orientedpath_of v1,v2,U
proof
  assume that
A1: the carrier of G= U \/ V and
A2: v1 in U and
A3: for v3,v4 st v3 in U & v4 in V holds not (ex e st e in the carrier'
  of G & e orientedly_joins v3,v4) and
A4: p is_orientedpath_of v1,v2;
  set FS=the Source of G, FT=the Target of G;
A5: now
    assume not vertices p c= U;
    then consider
    i being Element of NAT, q,r being FinSequence of the carrier' of
    G such that
A6: i+1 <= len p and
A7: not vertices(p/.(i+1)) c= U and
A8: len q=i and
A9: p=q^r and
A10: vertices q c= U by GRAPH_5:20;
A11: p.(i+1) in the carrier' of G by A6,Th2,NAT_1:12;
    p/.(i+1)=p.(i+1) by A6,FINSEQ_4:15,NAT_1:12;
    then
A12: vertices(p/.(i+1))={FS.(p.(i+1)),FT.(p.(i+1))} by GRAPH_5:def 1;
A13: now
      assume FS.(p.(i+1)) in U & FT.(p.(i+1)) in U;
      then vertices(p/.(i+1)) \/ U = U by A12,ZFMISC_1:42;
      hence contradiction by A7,XBOOLE_1:7;
    end;
A14: 1 <= i+ 1 by NAT_1:12;
    then reconsider vy=FT.(p.(i+1)) as Vertex of G by A6,Lm3;
A15: vy in U or vy in V by A1,A2,XBOOLE_0:def 3;
    per cases;
    suppose
A16:  i=0;
      then FS.(p.(i+1))=v1 by A4,GRAPH_5:def 3;
      then p.(i+1) orientedly_joins v1,vy by GRAPH_4:def 1;
      hence contradiction by A2,A3,A4,A13,A11,A15,A16,GRAPH_5:def 3;
    end;
    suppose
A17:  i<>0;
      reconsider vx=FS.(p.(i+1)) as Vertex of G by A6,A14,Lm3;
      hereby
        per cases;
        suppose
A18:      vx in U;
          p.(i+1) orientedly_joins vx,vy by GRAPH_4:def 1;
          hence contradiction by A3,A6,A14,A13,A15,A18,Th2;
        end;
        suppose
A19:      not vx in U;
A20:      i < len p by A6,NAT_1:13;
A21:      i >= 1+0 by A17,INT_1:7;
          then reconsider vq=FT.(q.i) as Vertex of G by A8,Lm3;
A22:      vq in vertices(q) by A8,A21,Lm4;
          FT.(q.i)=FT.(p.i) by A8,A9,A21,Lm1
            .=FS.(p.(i+1)) by A21,A20,GRAPH_1:def 15;
          hence contradiction by A10,A19,A22;
        end;
      end;
    end;
  end;
  vertices p \ {v2} c= vertices p by XBOOLE_1:36;
  then vertices(p) \ {v2} c= U by A5;
  hence thesis by A4,GRAPH_5:def 4;
end;
