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

theorem Th46:
  2<len sc & vs1 is_vertex_seq_of sc & vs2 is_vertex_seq_of sc implies vs1=vs2
proof
  assume that
A1: 2<len sc and
A2: vs1 is_vertex_seq_of sc and
A3: vs2 is_vertex_seq_of sc;
A4: len vs1 = len sc +1 by A2;
  defpred P[Nat] means $1 in dom vs1 & vs1.$1<>vs2.$1;
  set TG = the Target of G;
  set SG = the Source of G;
A5: Seg len vs1 = dom vs1 by FINSEQ_1:def 3;
A6: Seg len vs2 = dom vs2 by FINSEQ_1:def 3;
A7: len vs2 = len sc +1 by A3;
  assume
A8: vs1 <> vs2;
  then
A9: ex j being Nat st P[j] by A4,A7,FINSEQ_2:9;
  consider k be Nat such that
A10: P[k] and
A11: for n be Nat st P[n] holds k<=n from NAT_1:sch 5 (A9);
A12: 1<=k by A10,FINSEQ_3:25;
  per cases by A12,XXREAL_0:1;
  suppose
A13: k=1;
    set v23=vs2/.(1+1+1);
    set v22=vs2/.(1+1);
    set v21=vs2/.1;
    set v13=vs1/.(1+1+1);
    set v12=vs1/.(1+1);
    set v11=vs1/.1;
A14: 1+1+1<=len vs1 by A1,A4,XREAL_1:6;
    then
A15: v13=vs1.(1+1+1) by FINSEQ_4:15;
A16: 1<=len vs1 by A14,XXREAL_0:2;
    then
A17: v11=vs1.1 by FINSEQ_4:15;
A18: 1<=len sc by A1,XXREAL_0:2;
    then
A19: sc.1 joins v21,v22 by A3;
    sc.1 joins v11,v12 by A2,A18;
    then
A20: v11=v21 & v12=v22 or v11=v22 & v12=v21 by A19;
A21: v21=vs2.1 by A4,A7,A16,FINSEQ_4:15;
    consider vs such that
A22: vs is_vertex_seq_of sc and
A23: for n,m st 1<=n & n<m & m<=len vs & vs.n=vs.m holds n=1 & m=len
    vs by Def9;
    sc <>{} by A1;
    then
A24: vs = vs1 or vs = vs2 by A2,A3,A8,A22,Th34;
A25: v23=vs2.(1+1+1) by A4,A7,A14,FINSEQ_4:15;
A26: sc.2 joins v22,v23 by A1,A3;
A27: sc.2 joins v12,v13 by A1,A2;
    then
A28: v21=v23 by A10,A13,A17,A21,A26,A20;
    v11=v13 by A10,A13,A17,A21,A27,A26,A20;
    then 1+1+1 = len vs by A4,A7,A14,A17,A15,A21,A25,A28,A23,A24;
    hence contradiction by A1,A4,A7,A24;
  end;
  suppose
    1<k;
    then 1+1<=k by NAT_1:13;
    then consider k1 being Nat such that
A29: 1<=k1 and
A30: k1<k and
A31: k=k1+1 by FINSEQ_6:127;
A32: k<=len vs1 by A10,FINSEQ_3:25;
    then
A33: k1<=len vs1 by A30,XXREAL_0:2;
    then
A34: k1 in dom vs1 by A29,FINSEQ_3:25;
A35: vs1/.k1=vs1.k1 by A29,A33,FINSEQ_4:15;
A36: vs2/.k=vs2.k by A4,A7,A5,A6,A10,PARTFUN1:def 6;
A37: vs1/.k=vs1.k by A10,PARTFUN1:def 6;
A38: k1<=len sc by A4,A31,A32,XREAL_1:6;
    then sc.k1 joins vs1/.k1, vs1/.(k1+1) by A2,A29;
    then
A39: SG.(sc.k1)=vs1/.k1 & TG.(sc.k1)=vs1/.k or SG.(sc.k1)=vs1/.k & TG.(sc.
    k1)=vs1/.k1 by A31;
    sc.k1 joins vs2/.k1, vs2/.(k1+1) by A3,A29,A38;
    then
A40: SG.(sc.k1)=vs2/.k1 & TG.(sc.k1)=vs2/.k or SG.(sc.k1)=vs2/.k & TG.(sc.
    k1)=vs2/.k1 by A31;
    vs2/.k1=vs2.k1 by A4,A7,A29,A33,FINSEQ_4:15;
    hence contradiction by A10,A11,A30,A34,A35,A37,A36,A39,A40;
  end;
end;
