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;

theorem Th34:
  c <>{} & vs1 is_vertex_seq_of c & vs2 is_vertex_seq_of c & vs1
<> vs2 implies vs1.1<>vs2.1 & for vs st vs is_vertex_seq_of c holds vs = vs1 or
  vs = vs2
proof
  assume that
A1: c <>{} and
A2: vs1 is_vertex_seq_of c and
A3: vs2 is_vertex_seq_of c;
A4: len vs1 = len c +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 c +1 by A3;
  assume vs1 <> vs2;
  then
A8: ex j being Nat st P[j] by A4,A7,FINSEQ_2:9;
  consider k be Nat such that
A9: P[k] and
A10: for n be Nat st P[n] holds k<=n from NAT_1:sch 5 (A8);
A11: 1<=k by A9,FINSEQ_3:25;
  per cases by A11,XXREAL_0:1;
  suppose
A12: k=1;
    hence vs1.1 <> vs2.1 by A9;
    set v21 = vs2/.1;
    set v12 = vs1/.(1+1);
    set v11 = vs1/.1;
    let vs;
    set v1 = vs/.1;
    set v2 = vs/.(1+1);
    assume
A13: vs is_vertex_seq_of c;
    then
A14: len vs = len c +1;
    0+1=1;
    then
A15: 1<=len c by A1,NAT_1:13;
    then
A16: c.1 joins vs/.1, vs/.(1+1) by A13;
    c.1 joins vs1/.1, vs1/.(1+1) by A2,A15;
    then
A17: v1=v11 & v2=v12 or v1=v12 & v2=v11 by A16;
A18: 1<=len vs1 by A4,NAT_1:12;
    then
A19: v11=vs1.1 by FINSEQ_4:15;
A20: v21=vs2.1 by A4,A7,A18,FINSEQ_4:15;
A21: c.1 joins vs2/.1, vs2/.(1+1) by A3,A15;
    thus vs = vs1 or vs = vs2
    proof
      per cases by A9,A12,A19,A20,A16,A21,A17;
      suppose
A22:    v1 = v11;
        now
          defpred P[Nat] means $1 in dom vs implies vs.$1=vs1.$1;
          thus len vs = len vs;
          thus len vs1 = len vs by A4,A13;
A23:      for i being Nat st P[i] holds P[i+1]
          proof
A24:        0+1=1;
            let i be Nat;
            assume
A25:        i in dom vs implies vs.i=vs1.i;
            assume
A26:        i+1 in dom vs;
            reconsider i as Element of NAT by ORDINAL1:def 12;
A27:        1<=i+1 by A26,FINSEQ_3:25;
A28:        i+1<=len vs by A26,FINSEQ_3:25;
            per cases by A24,NAT_1:13;
            suppose
              i=0;
              hence thesis by A4,A14,A18,A19,A22,FINSEQ_4:15;
            end;
            suppose
A29:          1<=i;
              set v12 = vs1/.(i+1);
              set v11 = vs1/.i;
              set v2 = vs/.(i+1);
A30:          v2=vs.(i+1) by A27,A28,FINSEQ_4:15;
              set v1 = vs/.i;
A31:          i<=len c by A14,A28,XREAL_1:6;
              then
A32:          c.i joins vs1/.i, vs1/.(i+1) by A2,A29;
A33:          i<=len vs by A14,A31,NAT_1:12;
              then
A34:          v1 =vs.i by A29,FINSEQ_4:15;
              c.i joins vs/.i, vs/.(i+1) by A13,A29,A31;
              then
A35:          v1=v11 & v2=v12 or v1=v12 & v2=v11 by A32;
              v11=vs1.i by A4,A14,A29,A33,FINSEQ_4:15;
              hence thesis by A4,A14,A25,A27,A28,A29,A33,A34,A30,A35,
FINSEQ_3:25,FINSEQ_4:15;
            end;
          end;
A36:      P[0] by FINSEQ_3:25;
          thus for i being Nat holds P[i] from NAT_1:sch 2(A36, A23);
        end;
        hence thesis by FINSEQ_2:9;
      end;
      suppose
A37:    v1 = v21;
        now
          defpred P[Nat] means $1 in dom vs implies vs.$1=vs2.$1;
          thus len vs = len vs;
          thus len vs2 = len vs by A7,A13;
A38:      for i being Nat st P[i] holds P[i+1]
          proof
A39:        0+1=1;
            let i be Nat;
            assume
A40:        i in dom vs implies vs.i=vs2.i;
            assume
A41:        i+1 in dom vs;
            then
A42:        1<=i+1 by FINSEQ_3:25;
A43:        i+1<=len vs by A41,FINSEQ_3:25;
            reconsider i as Element of NAT by ORDINAL1:def 12;
            per cases by A39,NAT_1:13;
            suppose
              i=0;
              hence thesis by A4,A14,A18,A20,A37,FINSEQ_4:15;
            end;
            suppose
A44:          1<=i;
              set v12 = vs2/.(i+1);
              set v11 = vs2/.i;
              set v2 = vs/.(i+1);
A45:          v2=vs.(i+1) by A42,A43,FINSEQ_4:15;
              set v1 = vs/.i;
A46:          i<=len c by A14,A43,XREAL_1:6;
              then
A47:          c.i joins vs2/.i, vs2/.(i+1) by A3,A44;
A48:          i<=len vs by A14,A46,NAT_1:12;
              then
A49:          v1 =vs.i by A44,FINSEQ_4:15;
              c.i joins vs/.i, vs/.(i+1) by A13,A44,A46;
              then
A50:          v1=v11 & v2=v12 or v1=v12 & v2=v11 by A47;
              v11=vs2.i by A7,A14,A44,A48,FINSEQ_4:15;
              hence thesis by A7,A14,A40,A42,A43,A44,A48,A49,A45,A50,
FINSEQ_3:25,FINSEQ_4:15;
            end;
          end;
A51:      P[0] by FINSEQ_3:25;
          thus for i being Nat holds P[i] from NAT_1:sch 2(A51, A38);
        end;
        hence thesis by FINSEQ_2:9;
      end;
    end;
  end;
  suppose
    1<k;
    then 1+1<=k by NAT_1:13;
    then consider k1 being Nat such that
A52: 1<=k1 and
A53: k1<k and
A54: k=k1+1 by FINSEQ_6:127;
A55: k<=len vs1 by A9,FINSEQ_3:25;
    then
A56: k1<=len vs1 by A53,XXREAL_0:2;
    then
A57: k1 in dom vs1 by A52,FINSEQ_3:25;
A58: vs1/.k1=vs1.k1 by A52,A56,FINSEQ_4:15;
A59: vs2/.k=vs2.k by A4,A7,A5,A6,A9,PARTFUN1:def 6;
A60: vs1/.k=vs1.k by A9,PARTFUN1:def 6;
A61: k1<=len c by A4,A54,A55,XREAL_1:6;
    then c.k1 joins vs1/.k1, vs1/.(k1+1) by A2,A52;
    then
A62: SG.(c.k1)=vs1/.k1 & TG.(c.k1)=vs1/.k or SG.(c.k1)=vs1/.k & TG.(c.k1)=
    vs1/.k1 by A54;
    c.k1 joins vs2/.k1, vs2/.(k1+1) by A3,A52,A61;
    then
A63: SG.(c.k1)=vs2/.k1 & TG.(c.k1)=vs2/.k or SG.(c.k1)=vs2/.k & TG.(c.k1)=
    vs2/.k1 by A54;
    vs2/.k1=vs2.k1 by A4,A7,A52,A56,FINSEQ_4:15;
    hence thesis by A9,A10,A53,A57,A58,A60,A59,A62,A63;
  end;
end;
