reserve p, q for FinSequence,
  e,X for set,
  i, j, k, m, n for Nat,
  G for Graph;
reserve x,y,v,v1,v2,v3,v4 for Element of G;
reserve vs, vs1, vs2 for FinSequence of the carrier of G,
  c, c1, c2 for oriented Chain of G;
reserve sc for oriented simple Chain of G;
reserve x,y for set;

theorem Th23:
  sc is OrientedPath of G
proof
  assume not sc is OrientedPath of G;
  then consider m, n such that
A1: 1<=m and
A2: m<n and
A3: n<=len sc and
A4: sc.m = sc.n by GRAPH_1:def 16;
  sc is Simple by Th18;
  then consider vs such that
A5: vs is_oriented_vertex_seq_of sc and
A6: for n, m st 1<=n & n<m & m<=len vs & vs.n=vs.m holds n=1 & m=len vs;
A7: len vs = len sc + 1 by A5;
A8: m<=len sc by A2,A3,XXREAL_0:2;
A9: 1<=n by A1,A2,XXREAL_0:2;
A10: n<=len vs by A3,A7,NAT_1:12;
A11: m+1<n+1 by A2,XREAL_1:6;
A12: n+1<=len vs by A3,A7,XREAL_1:6;
A13: m<n+1 by A11,NAT_1:12;
  set v1 = vs/.m;
  set v2 = vs/.(m+1);
A14: sc.m orientedly_joins v1, v2 by A1,A5,A8;
  set v19 = vs/.n;
  set v29 = vs/.(n+1);
A15: sc.n orientedly_joins v19, v29 by A3,A5,A9;
  then
A16: v1=v19 by A4,A14;
A17: v2=v29 by A4,A14,A15;
A18: m<=len vs by A12,A13,XXREAL_0:2;
A19: m+1<=len vs by A11,A12,XXREAL_0:2;
A20: v1=vs.m by A1,A18,FINSEQ_4:15;
A21: v2=vs.(m+1) by A19,FINSEQ_4:15,NAT_1:12;
A22: v19=vs.n by A9,A10,FINSEQ_4:15;
A23: v29=vs.(n+1) by A12,FINSEQ_4:15,NAT_1:12;
  m=1 by A1,A2,A6,A10,A16,A20,A22;
  hence contradiction by A6,A11,A12,A17,A21,A23;
end;
