
theorem Th22: :: Walk03
  for G being _Graph, a,b be set st a<>b for W being Walk of G st
  W.vertices() = {a,b} holds ex e being set st e Joins a,b,G
proof
  let G be _Graph, a,b be set such that
A1: a<>b;
  let W be Walk of G such that
A2: W.vertices() = {a,b};
A3: W.first() in W.vertices() by GLIB_001:88;
A4: now
    let x be set such that
A5: W.first() = x;
A6: x = a or x = b by A2,A3,A5,TARSKI:def 2;
A7: x in {x} by TARSKI:def 1;
    let y be set such that
A8: y in {a,b} \ {x};
A9: y = a or y = b by A8,TARSKI:def 2;
    set k = W.find(y);
A10: W.k = y by A2,A8,GLIB_001:def 19;
    then k <> 1 by A5,A8,A7,XBOOLE_0:def 5;
    then consider m being odd Nat such that
A11: m+2 = k by Th5;
A12: m < k by A11,NAT_1:16;
    k <= len W by A2,A8,GLIB_001:def 19;
    then
A13: m < len W by A11,NAT_1:16,XXREAL_0:2;
A14: m in NAT by ORDINAL1:def 12;
    then W.m in {a,b} by A2,A13,GLIB_001:87;
    then
A15: W.m = a or W.m = b by TARSKI:def 2;
    W.(m+1) Joins W.m,W.k,G by A11,A13,A14,GLIB_001:def 3;
    hence ex e being set st e Joins x,y,G by A2,A8,A7,A6,A10,A12,A13,A15,A9,
GLIB_001:def 19,XBOOLE_0:def 5;
  end;
  per cases by A2,A3,TARSKI:def 2;
  suppose
A16: W.first() = a;
    b in {b} by TARSKI:def 1;
    then b in {a,b}\{a} by A1,ZFMISC_1:17;
    hence thesis by A4,A16;
  end;
  suppose
A17: W.first() = b;
    a in {a} by TARSKI:def 1;
    then a in {a,b}\{b} by A1,ZFMISC_1:17;
    then ex e be set st e Joins b,a,G by A4,A17;
    hence thesis by GLIB_000:14;
  end;
end;
