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 Th25:
  p = q^pe & len q >= 1 & len pe = 1 implies vertices(p) =
  vertices(q) \/ {(the Target of G).(pe.1)}
proof
  assume that
A1: p = q^pe and
A2: len q >= 1 and
A3: len pe = 1;
  set FS=the Source of G, FT=the Target of G, V3={FT.(pe.1)};
A4: len p = len q + 1 by A1,A3,FINSEQ_1:22;
  now
    let x be object;
    hereby
      assume x in vertices p;
      then consider y being Vertex of G such that
A5:   y=x and
A6:   ex i st i in dom p & y in vertices(p/.i);
      consider i such that
A7:   i in dom p and
A8:   y in vertices(p/.i) by A6;
A9:   1<=i by A7,FINSEQ_3:25;
A10:  i <= len p by A7,FINSEQ_3:25;
      per cases;
      suppose
A11:    i <= len q;
        then
A12:    i in dom q by A9,FINSEQ_3:25;
        p/.i=p.i by A9,A10,FINSEQ_4:15
          .=q.i by A1,A9,A11,Lm1
          .=q/.i by A9,A11,FINSEQ_4:15;
        then y in {v where v is Vertex of G : ex j st j in dom q & v in
        vertices(q/.j)} by A8,A12;
        hence x in vertices(q) \/ V3 by A5,XBOOLE_0:def 3;
      end;
      suppose
A13:    i > len q;
        reconsider z=y as Vertex of G;
        i >= len q+1 by A13,NAT_1:13;
        then
A14:    i = len q+1 by A4,A10,XXREAL_0:1;
A15:    y=FS.(p/.i) or y=FT.(p/.i) by A8,TARSKI:def 2;
        hereby
          per cases by A9,A10,A15,FINSEQ_4:15;
          suppose
A16:        z=FS.(p.i);
            len q < len p by A4,NAT_1:13;
            then z=FT.(p.(len q)) by A2,A14,A16,GRAPH_1:def 15
              .=FT.(q.(len q)) by A1,A2,Lm1
              .=FT.(q/.(len q)) by A2,FINSEQ_4:15;
            then
A17:        z in vertices(q/.(len q)) by TARSKI:def 2;
            len q in dom q by A2,FINSEQ_3:25;
            then z in {v where v is Vertex of G : ex j st j in dom q & v in
            vertices(q/.j)} by A17;
            hence x in vertices(q) \/ V3 by A5,XBOOLE_0:def 3;
          end;
          suppose
            z=FT.(p.i);
            then z=FT.(pe.1) by A1,A3,A14,Lm2;
            then z in V3 by TARSKI:def 1;
            hence x in vertices(q) \/ V3 by A5,XBOOLE_0:def 3;
          end;
        end;
      end;
    end;
    assume
A18: x in vertices(q) \/ V3;
    per cases by A18,XBOOLE_0:def 3;
    suppose
A19:  x in vertices q;
      vertices q c= vertices p by A1,Th24;
      hence x in vertices p by A19;
    end;
    suppose
A20:  x in V3;
      1 in dom pe by A3,FINSEQ_3:25;
      then reconsider y=FT.(pe.1) as Vertex of G by FINSEQ_2:11,FUNCT_2:5;
A21:  1 <= len p by A4,NAT_1:12;
      then
A22:  len p in dom p by FINSEQ_3:25;
      y=FT.(p.(len p)) by A1,A3,A4,Lm2
        .=FT.(p/.(len p)) by A21,FINSEQ_4:15;
      then
A23:  y in vertices(p/.(len p)) by TARSKI:def 2;
      x = FT.(pe.1) by A20,TARSKI:def 1;
      hence x in vertices(p) by A23,A22;
    end;
  end;
  hence thesis by TARSKI:2;
end;
