
theorem Th6:
  for T being non _trivial Tree-like _Graph, v being Vertex of T
  for F being removeVertex of T,v holds F.numComponents() = v.degree()
proof
  let T be non _trivial Tree-like _Graph, v being Vertex of T;
  let F be removeVertex of T,v;
  deffunc H(Vertex of F) = F.reachableFrom($1);
  A1: for w being Vertex of F holds H(w) in F.componentSet() by GLIB_002:def 8;
  consider h9 being Function of the_Vertices_of F, F.componentSet() such that
    A2: for w being Vertex of F holds h9.w = H(w) from FUNCT_2:sch 8(A1);
  set h = h9|v.allNeighbors();
  now
    let x be object;
    assume A3: x in v.allNeighbors();
    x <> v by A3, GLIB_000:112;
    then x in the_Vertices_of T \ {v} by A3, ZFMISC_1:56;
    then x in the_Vertices_of F by GLIB_000:47;
    hence x in dom h9 by FUNCT_2:def 1;
  end;
  then A5: dom h = v.allNeighbors() by TARSKI:def 3, RELAT_1:62;
  now
    let y be object;
    assume y in F.componentSet();
    then consider w being Vertex of F such that
      A7: y = F.reachableFrom(w) by GLIB_002:def 8;
    the_Vertices_of F c= the_Vertices_of T;
    then reconsider u = w as Vertex of T by TARSKI:def 3;
    consider W being Walk of T such that
      A8: W is_Walk_from u,v by GLIB_002:def 1;
    set P = the Path of W;
    A9: P is_Walk_from u,v by A8, GLIB_001:160;
    the_Vertices_of F = the_Vertices_of T \ {v} &
      v in the_Vertices_of T by GLIB_000:47;
    then u <> v by ZFMISC_1:56;
    then A10: P.first() <> v by A9, GLIB_001:def 23;
    then P.first() <> P.last() by A9, GLIB_001:def 23;
    then A11: 3 <= len P by GLIB_001:125, GLIB_001:127;
    then reconsider m = len P - 2 as Element of NAT by XXREAL_0:2, INT_1:5;
    A12: m < len P - 0 by XREAL_1:15;
    A13: m is odd & 1 is odd by POLYFORM:4, POLYFORM:5;
    then P.(m+1) Joins P.m,P.(m+2),T by A12, GLIB_001:def 3;
    then P.(m+1) Joins P.last(),P.m,T by GLIB_000:14;
    then P.(m+1) Joins v,P.m,T by A9, GLIB_001:def 23;
    then A14: P.m in dom h by A5, GLIB_000:71;
    set P9 = P.cut(1,m);
    A15: 3-2 <= m by A11, XREAL_1:9;
    A16: m <= len P - 0 by XREAL_1:10;
    A17: P9 is_Walk_from P.1,P.m by A13, A15, A16, GLIB_001:37;
    not v in P9.vertices()
    proof
      assume v in P9.vertices();
      then consider n being odd Element of NAT such that
        A18: n <= len P9 & P9.n = v by GLIB_001:87;
      reconsider n1 = n-1 as Nat by CHORD:1;
      reconsider n1 as Element of NAT by ORDINAL1:def 12;
      A19: n1+1 < len P9 + 1 by A18, NAT_1:13;
      then n1 < len P9 by XREAL_1:6;
      then A20: P9.(n1+1) = P.(1+n1) by A13, A15, A16, GLIB_001:36;
      A21: len P9 + 1 = m + 1 by A13, A15, A16, GLIB_001:36;
      m + 1 <= len P by A12, NAT_1:13;
      then A22: n < len P by A19, A21, XXREAL_0:2;
      P.len P = P.last()
        .= P.n by A9, A18, A20, GLIB_001:def 23;
      hence contradiction by A10, A18, A20, A22, GLIB_001:def 28;
    end;
    then reconsider P9 as Walk of F by GLIB_001:171;
    P9 is_Walk_from P.first(),P.m by A17, GLIB_001:19;
    then A23: P9 is_Walk_from u,P.m by A9, GLIB_001:def 23;
    then reconsider z = P.m as Vertex of F by GLIB_001:18;
    z in F.reachableFrom(w) by A23, GLIB_002:def 5;
    then y = F.reachableFrom(z) by A7, GLIB_002:12;
    then h9.(P.m) = y by A2;
    then h.(P.m) = y by A14, FUNCT_1:47;
    hence y in rng h by A14, FUNCT_1:def 3;
  end;
  then F.componentSet() c= rng h by TARSKI:def 3;
  then A24: F.componentSet() = rng h by XBOOLE_0:def 10;
  now
    let x1,x2 be object;
    assume A25: x1 in dom h & x2 in dom h & h.x1 = h.x2 & x1 <> x2;
    then reconsider x1, x2 as Vertex of F;
    A26: h.x1 = h9.x1 & h.x2 = h9.x2 by A25, FUNCT_1:47;
    h9.x1 = H(x1) & h9.x2 = H(x2) by A2;
    then A27: x2 in H(x1) by A25, A26, GLIB_002:9;
    set C = the inducedSubgraph of F, H(x1);
    the_Vertices_of C = H(x1) by GLIB_000:def 37;
    then x2 in the_Vertices_of C & x1 in the_Vertices_of C by A27, GLIB_002:9;
    hence contradiction by A5, A25, Lm1;
  end;
  then A29: h is one-to-one by FUNCT_1:def 4;
  thus F.numComponents() = card F.componentSet() by GLIB_002:def 9
    .= card dom h by A24, A29, CARD_1:70
    .= v.degree() by A5, GLIB_000:111;
end;
