
theorem
  for G being _finite non _trivial _Graph
  st G is acyclic & G.minDegree() = 1 & card Endvertices G = 2
  holds G is Path-like
proof
  let G be _finite non _trivial _Graph;
  assume A1: G is acyclic & G.minDegree() = 1 & card Endvertices G = 2;
  :: show that G is connected
  now
    :: if G is non connected, it has at least 2 finite Tree-like components,
    :: giving us at least 2 endvertices per component which are also
    :: endvertices of G
    assume G is non connected;
    then consider v,w being Vertex of G such that
      A2: for W being Walk of G holds not W is_Walk_from v,w by GLIB_002:def 1;
    set C1 = the inducedSubgraph of G,G.reachableFrom(v);
    set C2 = the inducedSubgraph of G,G.reachableFrom(w);
    not w in G.reachableFrom(v) by A2, GLIB_002:def 5;
    then A3: G.reachableFrom(v) misses G.reachableFrom(w) by GLIB_008:22;
    A4: the_Vertices_of C1 = G.reachableFrom(v) by GLIB_000:def 37;
    A5: the_Vertices_of C2 = G.reachableFrom(w) by GLIB_000:def 37;
    reconsider v9 = v as Vertex of C1 by A4, GLIB_002:9;
    1 c= C1.minDegree() by A1, Th16;
    then C1.minDegree() <> 0;
    then C1 is non edgeless;
    then C1 is non _trivial & the_Edges_of C1 <> {} by A1;
    then consider v1,v2 being Vertex of C1 such that
      A6: v1 <> v2 & v1 is endvertex & v2 is endvertex and
      v2 in C1.reachableFrom(v1) by A1, GLIB_002:43;
    1 c= C2.minDegree() by A1, Th16;
    then C2.minDegree() <> 0;
    then C2 is non edgeless;
    then C2 is non _trivial & the_Edges_of C2 <> {} by A1;
    then consider w1,w2 being Vertex of C2 such that
      A7: w1 <> w2 & w1 is endvertex & w2 is endvertex and
      w2 in C2.reachableFrom(w1) by A1, GLIB_002:43;
    v1 in Endvertices C1 & v2 in Endvertices C1 by A6, GLIB_006:56;
    then A8: {v1,v2} c= Endvertices C1 by ZFMISC_1:32;
    A9: {w1} c= Endvertices C2 by A7, GLIB_006:56, ZFMISC_1:31;
    Endvertices C1 c= Endvertices G & Endvertices C2 c= Endvertices G by Th12;
    then {v1,v2} c= Endvertices G & {w1} c= Endvertices G
      by A8, A9, XBOOLE_1:1;
    then {v1,v2}\/{w1} c= Endvertices G by XBOOLE_1:8;
    then {v1,v2,w1} c= Endvertices G by ENUMSET1:3;
    then A10: card {v1,v2,w1} c= card Endvertices G by CARD_1:11;
    A11: v1 <> w1 by A3, A4, A5, XBOOLE_0:3;
    v2 <> w1 by A3, A4, A5, XBOOLE_0:3;
    then A12: 3 c= 2 by A1, A6, A10, A11, CARD_2:58;
    2 in 3 by CARD_1:51, ENUMSET1:def 1;
    then 2 in 2 by A12;
    hence contradiction;
  end;
  hence A13: G is Tree-like by A1;
  let v be Vertex of G;
  set F = the removeVertex of G,v;
  :: show that if G has a vertex of degree at least 3
  :: we can remove that vertex and collect at least 3 endvertices of G
  :: from the at least 3 components of G with v removed
  assume not v.degree() c= 2;
  then succ 2 c= v.degree() by ORDINAL1:16, ORDINAL1:21;
  then 3 c= F.numComponents() by A13, Th6;
  then 3 c= card F.componentSet() by GLIB_002:def 9;
  then consider c1,c2,c3 being object such that
    A14: c1 in F.componentSet() & c2 in F.componentSet() and
    A15: c3 in F.componentSet() & c1 <> c2 & c1 <> c3 & c2 <> c3 by PENCIL_1:5;
  consider v1 being Vertex of F such that
    A16: c1 = F.reachableFrom(v1) by A14, GLIB_002:def 8;
  consider v2 being Vertex of F such that
    A17: c2 = F.reachableFrom(v2) by A14, GLIB_002:def 8;
  consider v3 being Vertex of F such that
    A18: c3 = F.reachableFrom(v3) by A15, GLIB_002:def 8;
  set C1 = the inducedSubgraph of F,F.reachableFrom(v1);
  set C2 = the inducedSubgraph of F,F.reachableFrom(v2);
  set C3 = the inducedSubgraph of F,F.reachableFrom(v3);
  A19: the_Vertices_of C1 = F.reachableFrom(v1) by GLIB_000:def 37;
  A20: the_Vertices_of C2 = F.reachableFrom(v2) by GLIB_000:def 37;
  A21: the_Vertices_of C3 = F.reachableFrom(v3) by GLIB_000:def 37;
  consider w1 being Vertex of G such that
    A22: w1 is endvertex & w1 in the_Vertices_of C1 by A13, Th7;
  consider w2 being Vertex of G such that
    A23: w2 is endvertex & w2 in the_Vertices_of C2 by A13, Th7;
  consider w3 being Vertex of G such that
    A24: w3 is endvertex & w3 in the_Vertices_of C3 by A13, Th7;
  :: only thing left to show is that the 3 vertices are in fact mut. distinct
  A25: w1 <> w2
  proof
    reconsider u1 = w1 as Vertex of F by A22;
    F.reachableFrom(v1) = F.reachableFrom(u1) by A19, A22, GLIB_002:12;
    hence thesis by A15, A16, A17, A20, A23, GLIB_002:12;
  end;
  A26: w2 <> w3
  proof
    reconsider u2 = w2 as Vertex of F by A23;
    F.reachableFrom(v2) = F.reachableFrom(u2) by A20, A23, GLIB_002:12;
    hence thesis by A15, A17, A18, A21, A24, GLIB_002:12;
  end;
  w3 <> w1
  proof
    reconsider u3 = w3 as Vertex of F by A24;
    F.reachableFrom(v3) = F.reachableFrom(u3) by A21, A24, GLIB_002:12;
    hence thesis by A15, A16, A18, A19, A22, GLIB_002:12;
  end;
  then A27: card {w1,w2,w3} = 3 by A25, A26, CARD_2:58;
  w1 in Endvertices G & w2 in Endvertices G & w3 in Endvertices G
    by A22, A23, A24, GLIB_006:def 8;
  then A28: 3 c= card Endvertices G by A27, CARD_1:11, ZFMISC_1:133;
  2 in 3 by CARD_1:51, ENUMSET1:def 1;
  then 2 in 2 by A1, A28;
  hence contradiction;
end;
