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;

theorem Th15:
  vs1 is_oriented_vertex_seq_of c1 & vs2 is_oriented_vertex_seq_of c2
  & vs1.len vs1 = vs2.1 & c = c1^c2 & vs = vs1^'vs2
  implies vs is_oriented_vertex_seq_of c
proof
  assume that
A1: vs1 is_oriented_vertex_seq_of c1 and
A2: vs2 is_oriented_vertex_seq_of c2 and
A3: vs1.len vs1 = vs2.1;
  assume that
A4: c = c1^c2 and
A5: vs = vs1^'vs2;
A6: len vs1 = len c1 + 1 by A1;
A7: len vs2 = len c2 + 1 by A2;
  then
A8: vs2 <> {};
  set q=c1^c2;
  set p=vs1^'vs2;
  len p +1 = len vs1 +len vs2 by A8,FINSEQ_6:139;
  then
A9: len p = len c1 + len c2 + 1 by A6,A7
    .= len q + 1 by FINSEQ_1:22;
  reconsider p as FinSequence of the carrier of G;
  now
    let n be Nat;
    assume that
A10: 1<=n and
A11: n<=len q;
A12: n<=len p by A9,A11,NAT_1:12;
A13: 1<=n+1 by NAT_1:12;
A14: p/.n=p.n by A10,A12,FINSEQ_4:15;
A15: p/.(n+1)=p.(n+1) by A9,A11,A13,FINSEQ_4:15,XREAL_1:7;
A16: n in dom q by A10,A11,FINSEQ_3:25;
    per cases by A16,FINSEQ_1:25;
    suppose
A17:  n in dom c1;
      set v1=vs1/.n;
      set v2=vs1/.(n+1);
A18:  1<=n by A17,FINSEQ_3:25;
A19:  n<=len c1 by A17,FINSEQ_3:25;
      then
A20:  c1.n orientedly_joins v1, v2 by A1,A18;
A21:  n<=len vs1 by A6,A19,NAT_1:12;
      n+1<=len c1+1 by A19,XREAL_1:6;
      then
A22:  n+1<=len vs1 by A1;
A23:  vs1/.n=vs1.n by A18,A21,FINSEQ_4:15;
A24:  vs1/.(n+1)=vs1.(n+1) by A22,FINSEQ_4:15,NAT_1:12;
A25:  p.n = vs1.n by A18,A21,FINSEQ_6:140;
      p.(n+1) = vs1.(n+1) by A22,FINSEQ_6:140,NAT_1:12;
      hence q.n orientedly_joins p/.n, p/.(n+1)
      by A14,A15,A17,A20,A23,A24,A25,FINSEQ_1:def 7;
    end;
    suppose ex k being Nat st k in dom c2 & n=len c1 + k;
      then consider k being Nat such that
A26:  k in dom c2 and
A27:  n = len c1 + k;
      reconsider k as Element of NAT by ORDINAL1:def 12;
A28:  q.n = c2.k by A26,A27,FINSEQ_1:def 7;
A29:  1<=k by A26,FINSEQ_3:25;
A30:  k<=len c2 by A26,FINSEQ_3:25;
A31:  1<=k+1 by NAT_1:12;
      k<=len vs2 by A7,A30,NAT_1:12;
      then
A32:  vs2/.k=vs2.k by A29,FINSEQ_4:15;
A33:  vs2/.(k+1)=vs2.(k+1) by A7,A30,A31,FINSEQ_4:15,XREAL_1:7;
A34:  k<=len vs2 by A7,A30,NAT_1:12;
      0+1<=k by A26,FINSEQ_3:25;
      then consider j such that
      0<=j and
A35:  j<len vs2 and
A36:  k=j+1 by A34,FINSEQ_6:127;
A37:  p.n = vs2.k proof per cases by A29,XXREAL_0:1;
        suppose
A38:      1=k;
A39:      0+1<=len vs1 by A6,NAT_1:13;
          thus p.n = p.(len vs1) by A1,A27,A38
            .= vs2.k by A3,A38,A39,FINSEQ_6:140;
        end;
        suppose 1<k;
          then
A40:      1<=j by A36,NAT_1:13;
          thus p.n = p.(len c1 +1+j) by A27,A36
            .= p.(len vs1 +j) by A1
            .= vs2.k by A35,A36,A40,FINSEQ_6:141;
        end;
      end;
A41:  k<len vs2 by A7,A30,NAT_1:13;
      p.(n+1) = p.(len c1 +1+k) by A27
        .= p.(len vs1+k) by A1
        .= vs2.(k+1) by A29,A41,FINSEQ_6:141;
      hence q.n orientedly_joins p/.n,p/.(n+1) by A2,A14,A15,A28,A29,A30,A32
,A33,A37;
    end;
  end;
  hence thesis by A4,A5,A9;
end;
