
theorem Th39:
  for T being _Tree for a, b, c being Vertex of T holds c in T
.pathBetween(a,b).vertices() iff T.pathBetween(a,c).vertices() /\ T.pathBetween
  (c,b).vertices() = {c}
proof
  let T be _Tree, a, b, c be Vertex of T;
  set Pac = T.pathBetween(a,c), Pcb = T.pathBetween(c,b), Pab = T.pathBetween(
  a,b);
A1: Pac.last() = c by Th28
    .= Pcb.first() by Th28;
  thus c in Pab.vertices() implies Pac.vertices() /\ Pcb.vertices() = {c}
  proof
    assume
A2: c in T.pathBetween(a,b).vertices();
    thus Pac.vertices() /\ Pcb.vertices() c= {c}
    proof
      let x be object;
      assume
A3:   x in Pac.vertices() /\ Pcb.vertices();
      then
A4:   x in Pac.vertices() by XBOOLE_0:def 4;
A5:   x in Pcb.vertices() by A3,XBOOLE_0:def 4;
A6:   Pcb.first() = c by Th28;
A7:   Pab = Pac.append(Pcb) by A2,Th36;
A8:   Pab.first() = a & Pab.last() = b by Th28;
A9:   Pac.last() = c by Th28;
      per cases;
      suppose
        Pab is trivial;
        then Pab.first() = Pab.last() by GLIB_001:127;
        then
A10:    Pab.vertices() = {a} by A8,Th30;
        x in Pac.vertices() \/ Pcb.vertices() by A4,XBOOLE_0:def 3;
        then x in Pab.vertices() by A7,A9,A6,GLIB_001:93;
        hence thesis by A2,A10,TARSKI:def 1;
      end;
      suppose
A11:    Pab is non trivial;
        consider n being odd Element of NAT such that
A12:    n <= len Pcb and
A13:    Pcb.n = x by A5,GLIB_001:87;
        1 <= n by ABIAN:12;
        then 1-1 <= n-1 by XREAL_1:9;
        then reconsider n1 = n-1 as even Element of NAT by INT_1:3;
        consider m being odd Element of NAT such that
A14:    m <= len Pac and
A15:    Pac.m = x by A4,GLIB_001:87;
A16:    m <= len Pac + n1 by A14,NAT_1:12;
        1 <= m by ABIAN:12;
        then m in dom Pac by A14,FINSEQ_3:25;
        then
A17:    Pab.m = x by A7,A15,GLIB_001:32;
        len Pac + (n1+1) <= len Pac + len Pcb by A12,XREAL_1:6;
        then len Pac + n1+1 -1 <= len Pac + len Pcb -1 by XREAL_1:9;
        then
A18:    len Pac + n1+1-1 <= len Pab +1 -1 by A7,A9,A6,GLIB_001:28;
A19:    n1+1 = n;
        then n1 < len Pcb by A12,NAT_1:13;
        then
A20:    Pab.(len Pac + n1) = x by A7,A9,A6,A13,A19,GLIB_001:33;
        per cases by A16,XXREAL_0:1;
        suppose
A21:      m < len Pac + n1;
          then Pab.first() = x by A17,A20,A18,GLIB_001:def 28
            .= Pab.last() by A17,A20,A18,A21,GLIB_001:def 28;
          hence thesis by A11,GLIB_001:def 24;
        end;
        suppose
A22:      m = len Pac + n1;
          then n1 = 0 by A14,NAT_1:16;
          hence thesis by A9,A15,A22,TARSKI:def 1;
        end;
      end;
    end;
    let x be object;
    assume x in {c};
    then
A23: x = c by TARSKI:def 1;
    then x = Pcb.first() by Th28;
    then
A24: x in Pcb.vertices() by GLIB_001:88;
    x = Pac.last() by A23,Th28;
    then x in Pac.vertices() by GLIB_001:88;
    hence thesis by A24,XBOOLE_0:def 4;
  end;
  Pac.first() = a & Pcb.last() = b by Th28;
  then
A25: Pac.append(Pcb) is_Walk_from a, b by A1,GLIB_001:30;
  assume Pac.vertices() /\ Pcb.vertices() = {c};
  then Pac.vertices() /\ Pcb.vertices() = {Pac.last()} by Th28;
  then Pac.append(Pcb) is Path-like by A1,Th38;
  then Pab = Pac.append(Pcb) by A25,Def2;
  hence thesis by Th36;
end;
