defpred S1[ Nat] means for T being _finite non _trivial _Tree
for v being Vertex of T st T .order() = $1 + 2 holds
ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() );
A1: S1[ 0 ]
proof
let T be _finite non _trivial _Tree; :: thesis: for v being Vertex of T st T .order() = 0 + 2 holds
ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

let v be Vertex of T; :: thesis: ( T .order() = 0 + 2 implies ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() ) )

assume A2: T .order() = 0 + 2 ; :: thesis: ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

then card (the_Vertices_of T) = 2 by GLIB_000:def 24;
then consider v1, v2 being object such that
A3: ( v1 <> v2 & the_Vertices_of T = {v1,v2} ) by CARD_2:60;
reconsider v1 = v1, v2 = v2 as Vertex of T by A3, TARSKI:def 2;
take v1 ; :: thesis: ex v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

take v2 ; :: thesis: ( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )
thus v1 <> v2 by A3; :: thesis: ( v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )
thus ( v1 is endvertex & v2 is endvertex ) by A2, Th27; :: thesis: v in (T .pathBetween (v1,v2)) .vertices()
( v = v1 or v = v2 ) by A3, TARSKI:def 2;
hence v in (T .pathBetween (v1,v2)) .vertices() by HELLY:29; :: thesis: verum
end;
A4: for k being Nat st S1[k] holds
S1[k + 1]
proof
let k be Nat; :: thesis: ( S1[k] implies S1[k + 1] )
assume A5: S1[k] ; :: thesis: S1[k + 1]
let T be _finite non _trivial _Tree; :: thesis: for v being Vertex of T st T .order() = (k + 1) + 2 holds
ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

let v be Vertex of T; :: thesis: ( T .order() = (k + 1) + 2 implies ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() ) )

assume A6: T .order() = (k + 1) + 2 ; :: thesis: ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

set v0 = the endvertex Vertex of T;
per cases ( v = the endvertex Vertex of T or v <> the endvertex Vertex of T ) ;
suppose A7: v = the endvertex Vertex of T ; :: thesis: ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

consider v1, v2 being Vertex of T such that
A8: ( v1 <> v2 & v1 is endvertex & v2 is endvertex ) by GLIB_002:45;
per cases ( v <> v1 or v = v1 ) ;
suppose A9: v <> v1 ; :: thesis: ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

take v ; :: thesis: ex v2 being Vertex of T st
( v <> v2 & v is endvertex & v2 is endvertex & v in (T .pathBetween (v,v2)) .vertices() )

take v1 ; :: thesis: ( v <> v1 & v is endvertex & v1 is endvertex & v in (T .pathBetween (v,v1)) .vertices() )
thus ( v <> v1 & v is endvertex & v1 is endvertex ) by A7, A8, A9; :: thesis: v in (T .pathBetween (v,v1)) .vertices()
thus v in (T .pathBetween (v,v1)) .vertices() by HELLY:29; :: thesis: verum
end;
suppose A10: v = v1 ; :: thesis: ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

take v ; :: thesis: ex v2 being Vertex of T st
( v <> v2 & v is endvertex & v2 is endvertex & v in (T .pathBetween (v,v2)) .vertices() )

take v2 ; :: thesis: ( v <> v2 & v is endvertex & v2 is endvertex & v in (T .pathBetween (v,v2)) .vertices() )
thus ( v <> v2 & v is endvertex & v2 is endvertex ) by A8, A10; :: thesis: v in (T .pathBetween (v,v2)) .vertices()
thus v in (T .pathBetween (v,v2)) .vertices() by HELLY:29; :: thesis: verum
end;
end;
end;
suppose A11: v <> the endvertex Vertex of T ; :: thesis: ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

set T0 = the removeVertex of T, the endvertex Vertex of T;
a12: ( the removeVertex of T, the endvertex Vertex of T .order()) + 1 = (k + 2) + 1 by A6, GLIB_000:48;
the removeVertex of T, the endvertex Vertex of T .order() <> 1
proof
assume the removeVertex of T, the endvertex Vertex of T .order() = 1 ; :: thesis: contradiction
then 0 + 1 = (k + 1) + 1 by a12;
hence contradiction ; :: thesis: verum
end;
then reconsider T0 = the removeVertex of T, the endvertex Vertex of T as _finite non _trivial _Tree by GLIB_000:26;
not v in { the endvertex Vertex of T} by A11, TARSKI:def 1;
then v in (the_Vertices_of T) \ { the endvertex Vertex of T} by XBOOLE_0:def 5;
then v in the_Vertices_of T0 by GLIB_000:47;
then consider v1, v2 being Vertex of T0 such that
A13: ( v1 <> v2 & v1 is endvertex & v2 is endvertex ) and
A14: v in (T0 .pathBetween (v1,v2)) .vertices() by A5, a12;
the_Vertices_of T0 c= the_Vertices_of T by GLIB_000:def 32;
then reconsider w1 = v1, w2 = v2 as Vertex of T by TARSKI:def 3;
consider e0 being object such that
A15: ( the endvertex Vertex of T .edgesInOut() = {e0} & not e0 Joins the endvertex Vertex of T, the endvertex Vertex of T,T ) by GLIB_000:def 51;
A16: the_Edges_of T0 = T .edgesBetween ((the_Vertices_of T) \ { the endvertex Vertex of T}) by GLIB_000:47
.= (T .edgesBetween (the_Vertices_of T)) \ ( the endvertex Vertex of T .edgesInOut()) by GLIB_000:107
.= (the_Edges_of T) \ {e0} by A15, GLIB_000:34 ;
consider e1 being object such that
A17: ( v1 .edgesInOut() = {e1} & not e1 Joins v1,v1,T0 ) by A13, GLIB_000:def 51;
consider e2 being object such that
A18: ( v2 .edgesInOut() = {e2} & not e2 Joins v2,v2,T0 ) by A13, GLIB_000:def 51;
the endvertex Vertex of T in { the endvertex Vertex of T} by TARSKI:def 1;
then not the endvertex Vertex of T in (the_Vertices_of T) \ { the endvertex Vertex of T} by XBOOLE_0:def 5;
then A19: not the endvertex Vertex of T in the_Vertices_of T0 by GLIB_000:47;
A20: ( w1 <> the endvertex Vertex of T .adj e0 implies w1 is endvertex )
proof end;
A26: ( w2 <> the endvertex Vertex of T .adj e0 implies w2 is endvertex )
proof end;
A32: T0 .pathBetween (v1,v2) = T .pathBetween (w1,w2) by HELLY:33;
per cases ( w1 = the endvertex Vertex of T .adj e0 or w2 = the endvertex Vertex of T .adj e0 or ( w1 <> the endvertex Vertex of T .adj e0 & w2 <> the endvertex Vertex of T .adj e0 ) ) ;
suppose A33: w1 = the endvertex Vertex of T .adj e0 ; :: thesis: ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

then A34: w2 <> the endvertex Vertex of T .adj e0 by A13;
take the endvertex Vertex of T ; :: thesis: ex v2 being Vertex of T st
( the endvertex Vertex of T <> v2 & the endvertex Vertex of T is endvertex & v2 is endvertex & v in (T .pathBetween ( the endvertex Vertex of T,v2)) .vertices() )

take w2 ; :: thesis: ( the endvertex Vertex of T <> w2 & the endvertex Vertex of T is endvertex & w2 is endvertex & v in (T .pathBetween ( the endvertex Vertex of T,w2)) .vertices() )
thus ( the endvertex Vertex of T <> w2 & the endvertex Vertex of T is endvertex & w2 is endvertex ) by A19, A26, A34; :: thesis: v in (T .pathBetween ( the endvertex Vertex of T,w2)) .vertices()
e0 in the endvertex Vertex of T .edgesInOut() by A15, TARSKI:def 1;
then A35: e0 Joins the endvertex Vertex of T,w1,T by A33, GLIB_000:67;
then A36: T .walkOf ( the endvertex Vertex of T,e0,w1) = T .pathBetween ( the endvertex Vertex of T,w1) by Th29;
set P1 = T .pathBetween ( the endvertex Vertex of T,w1);
set P2 = T .pathBetween (w1,w2);
set P = (T .pathBetween ( the endvertex Vertex of T,w1)) .append (T .pathBetween (w1,w2));
A37: ( (T .pathBetween ( the endvertex Vertex of T,w1)) .last() = w1 & (T .pathBetween (w1,w2)) .first() = w1 ) by HELLY:28;
for x being object holds
( x in ((T .pathBetween ( the endvertex Vertex of T,w1)) .vertices()) /\ ((T .pathBetween (w1,w2)) .vertices()) iff x = w1 )
proof
let x be object ; :: thesis: ( x in ((T .pathBetween ( the endvertex Vertex of T,w1)) .vertices()) /\ ((T .pathBetween (w1,w2)) .vertices()) iff x = w1 )
assume x = w1 ; :: thesis: x in ((T .pathBetween ( the endvertex Vertex of T,w1)) .vertices()) /\ ((T .pathBetween (w1,w2)) .vertices())
then ( x = (T .pathBetween ( the endvertex Vertex of T,w1)) .last() & x = (T .pathBetween (w1,w2)) .first() ) by HELLY:28;
then ( x in (T .pathBetween ( the endvertex Vertex of T,w1)) .vertices() & x in (T .pathBetween (w1,w2)) .vertices() ) by GLIB_001:88;
hence x in ((T .pathBetween ( the endvertex Vertex of T,w1)) .vertices()) /\ ((T .pathBetween (w1,w2)) .vertices()) by XBOOLE_0:def 4; :: thesis: verum
end;
then ((T .pathBetween ( the endvertex Vertex of T,w1)) .vertices()) /\ ((T .pathBetween (w1,w2)) .vertices()) = {((T .pathBetween ( the endvertex Vertex of T,w1)) .last())} by A37, TARSKI:def 1;
then reconsider P = (T .pathBetween ( the endvertex Vertex of T,w1)) .append (T .pathBetween (w1,w2)) as Path of T by A37, HELLY:38;
( T .pathBetween ( the endvertex Vertex of T,w1) is_Walk_from the endvertex Vertex of T,w1 & T .pathBetween (w1,w2) is_Walk_from w1,w2 ) by HELLY:def 2;
then A40: P = T .pathBetween ( the endvertex Vertex of T,w2) by GLIB_001:31, HELLY:def 2;
(T0 .pathBetween (v1,v2)) .vertices() = (T .pathBetween (w1,w2)) .vertices() by HELLY:33, GLIB_001:98;
then v in ((T .pathBetween ( the endvertex Vertex of T,w1)) .vertices()) \/ ((T .pathBetween (w1,w2)) .vertices()) by A14, XBOOLE_0:def 3;
hence v in (T .pathBetween ( the endvertex Vertex of T,w2)) .vertices() by A37, A40, GLIB_001:93; :: thesis: verum
end;
suppose A41: w2 = the endvertex Vertex of T .adj e0 ; :: thesis: ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

then A42: w1 <> the endvertex Vertex of T .adj e0 by A13;
take w1 ; :: thesis: ex v2 being Vertex of T st
( w1 <> v2 & w1 is endvertex & v2 is endvertex & v in (T .pathBetween (w1,v2)) .vertices() )

take the endvertex Vertex of T ; :: thesis: ( w1 <> the endvertex Vertex of T & w1 is endvertex & the endvertex Vertex of T is endvertex & v in (T .pathBetween (w1, the endvertex Vertex of T)) .vertices() )
thus ( w1 <> the endvertex Vertex of T & w1 is endvertex & the endvertex Vertex of T is endvertex ) by A19, A20, A42; :: thesis: v in (T .pathBetween (w1, the endvertex Vertex of T)) .vertices()
e0 in the endvertex Vertex of T .edgesInOut() by A15, TARSKI:def 1;
then A43: e0 Joins w2, the endvertex Vertex of T,T by A41, GLIB_000:67, GLIB_000:14;
then A44: T .walkOf (w2,e0, the endvertex Vertex of T) = T .pathBetween (w2, the endvertex Vertex of T) by Th29;
set P1 = T .pathBetween (w1,w2);
set P2 = T .pathBetween (w2, the endvertex Vertex of T);
set P = (T .pathBetween (w1,w2)) .append (T .pathBetween (w2, the endvertex Vertex of T));
A45: ( (T .pathBetween (w1,w2)) .last() = w2 & (T .pathBetween (w2, the endvertex Vertex of T)) .first() = w2 ) by HELLY:28;
for x being object holds
( x in ((T .pathBetween (w1,w2)) .vertices()) /\ ((T .pathBetween (w2, the endvertex Vertex of T)) .vertices()) iff x = w2 )
proof
let x be object ; :: thesis: ( x in ((T .pathBetween (w1,w2)) .vertices()) /\ ((T .pathBetween (w2, the endvertex Vertex of T)) .vertices()) iff x = w2 )
assume x = w2 ; :: thesis: x in ((T .pathBetween (w1,w2)) .vertices()) /\ ((T .pathBetween (w2, the endvertex Vertex of T)) .vertices())
then ( x in (T .pathBetween (w1,w2)) .vertices() & x in (T .pathBetween (w2, the endvertex Vertex of T)) .vertices() ) by GLIB_001:88, A45;
hence x in ((T .pathBetween (w1,w2)) .vertices()) /\ ((T .pathBetween (w2, the endvertex Vertex of T)) .vertices()) by XBOOLE_0:def 4; :: thesis: verum
end;
then ((T .pathBetween (w1,w2)) .vertices()) /\ ((T .pathBetween (w2, the endvertex Vertex of T)) .vertices()) = {((T .pathBetween (w1,w2)) .last())} by A45, TARSKI:def 1;
then reconsider P = (T .pathBetween (w1,w2)) .append (T .pathBetween (w2, the endvertex Vertex of T)) as Path of T by A45, HELLY:38;
( T .pathBetween (w1,w2) is_Walk_from w1,w2 & T .pathBetween (w2, the endvertex Vertex of T) is_Walk_from w2, the endvertex Vertex of T ) by HELLY:def 2;
then A48: P = T .pathBetween (w1, the endvertex Vertex of T) by GLIB_001:31, HELLY:def 2;
(T0 .pathBetween (v1,v2)) .vertices() = (T .pathBetween (w1,w2)) .vertices() by HELLY:33, GLIB_001:98;
then v in ((T .pathBetween (w1,w2)) .vertices()) \/ ((T .pathBetween (w2, the endvertex Vertex of T)) .vertices()) by A14, XBOOLE_0:def 3;
hence v in (T .pathBetween (w1, the endvertex Vertex of T)) .vertices() by A45, A48, GLIB_001:93; :: thesis: verum
end;
suppose A49: ( w1 <> the endvertex Vertex of T .adj e0 & w2 <> the endvertex Vertex of T .adj e0 ) ; :: thesis: ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

take w1 ; :: thesis: ex v2 being Vertex of T st
( w1 <> v2 & w1 is endvertex & v2 is endvertex & v in (T .pathBetween (w1,v2)) .vertices() )

take w2 ; :: thesis: ( w1 <> w2 & w1 is endvertex & w2 is endvertex & v in (T .pathBetween (w1,w2)) .vertices() )
thus ( w1 <> w2 & w1 is endvertex & w2 is endvertex ) by A13, A20, A26, A49; :: thesis: v in (T .pathBetween (w1,w2)) .vertices()
thus v in (T .pathBetween (w1,w2)) .vertices() by A14, GLIB_001:98, HELLY:33; :: thesis: verum
end;
end;
end;
end;
end;
A50: for k being Nat holds S1[k] from NAT_1:sch 2(A1, A4);
let T be _finite non _trivial _Tree; :: thesis: for v being Vertex of T ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

let v be Vertex of T; :: thesis: ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() )

( T .order() >= 1 & T .order() <> 1 ) by GLIB_000:25, GLIB_000:26;
then T .order() > 1 by XXREAL_0:1;
then T .order() >= 1 + 1 by INT_1:7;
then consider k being Nat such that
A51: T .order() = 2 + k by NAT_1:10;
thus ex v1, v2 being Vertex of T st
( v1 <> v2 & v1 is endvertex & v2 is endvertex & v in (T .pathBetween (v1,v2)) .vertices() ) by A50, A51; :: thesis: verum