
theorem Th71:
  for G being _finite Tree-like _Graph, H being connected Subgraph of G
  ex p being non empty _finite Tree-like Graph-yielding FinSequence
  st p.1 == H & p.len p = G & len p = G.order() - H.order() + 1 &
    for n being Element of dom p st n <= len p - 1
    ex v1,v2 being Vertex of G, e being object
    st p.(n+1) is addAdjVertex of p.n,v1,e,v2 &
      e in the_Edges_of G \ the_Edges_of p.n &
      ((v1 in the_Vertices_of p.n & not v2 in the_Vertices_of p.n) or
        (not v1 in the_Vertices_of p.n & v2 in the_Vertices_of p.n))
proof
  defpred P[Nat] means for G being _finite Tree-like _Graph
    for H being connected Subgraph of G st $1 = G.order() - H.order()
    ex p being non empty _finite Tree-like Graph-yielding FinSequence
    st p.1 == H & p.len p = G & len p = G.order() - H.order() + 1 &
      for n being Element of dom p st n <= len p - 1
      ex v1,v2 being Vertex of G, e being object
      st p.(n+1) is addAdjVertex of p.n,v1,e,v2 &
        e in the_Edges_of G \ the_Edges_of p.n &
        ((v1 in the_Vertices_of p.n & not v2 in the_Vertices_of p.n) or
          (not v1 in the_Vertices_of p.n & v2 in the_Vertices_of p.n));
  A1: P[0]
  proof
    let G be _finite Tree-like _Graph, H be connected Subgraph of G;
    assume A2: 0 = G.order() - H.order();
    then H is spanning by GLIB_000:117;
    then A3: G == H by Th21;
    reconsider p = <* G *>
      as non empty _finite Tree-like Graph-yielding FinSequence;
    take p;
    thus p.1 == H by A3;
    thus p.len p = p.1 by FINSEQ_1:40
      .= G;
    thus len p = G.order() - H.order() + 1 by A2, FINSEQ_1:40;
    let n be Element of dom p;
    1 <= n & n <= len p by FINSEQ_3:25;
    then 1 <= n & n <= 1 by FINSEQ_1:40;
    then A4: n = 1 by XXREAL_0:1;
    assume n <= len p - 1;
    then n <= 1 - 1 by FINSEQ_1:40;
    hence thesis by A4; :: by contradiction
  end;
  A5: for k being Nat st P[k] holds P[k+1]
  proof
    let k be Nat;
    assume A6: P[k];
    let G be _finite Tree-like _Graph, H be connected Subgraph of G;
    assume A7: k+1 = G.order() - H.order();
    then A8: G.order() = H.order() + k + 1;
    G.order() <> H.order()
    proof
      assume G.order() = H.order();
      then 0 + H.order() = k+1 + H.order() by A8;
      hence contradiction;
    end;
    then A9: H is non spanning by GLIB_000:117;
    G.order() <> 1 by A8, NAT_1:7;
    then A10: G is non _trivial by GLIB_000:26;
    then consider v being Vertex of G such that
      A11: v is endvertex & not v in the_Vertices_of H by A9, Th31;
    consider e0 being object such that
      A12: v.edgesInOut() = {e0} & not e0 Joins v,v,G by A11, GLIB_000:def 51;
    set G2 = the removeVertex of G, v;
    A13: G2.order() + 1 = G.order() by A10, GLIB_000:48;
    then A14: k = G2.order() - H.order() by A7;
    A15: the_Edges_of G2 = G.edgesBetween(the_Vertices_of G \ {v})
        by A10, GLIB_000:47
      .= G.edgesBetween(the_Vertices_of G) \ v.edgesInOut() by GLIB_000:107
      .= the_Edges_of G \ {e0} by A12, GLIB_000:34;
    A16: H is Subgraph of G2
    proof
      the_Vertices_of H misses {v} by A11, ZFMISC_1:50;
      then the_Vertices_of H c= the_Vertices_of G \ {v} by XBOOLE_1:86;
      then A17: the_Vertices_of H c= the_Vertices_of G2 by A10, GLIB_000:47;
      not e0 in the_Edges_of H
      proof
        assume A18: e0 in the_Edges_of H;
        e0 in v.edgesInOut() by A12, TARSKI:def 1;
        then per cases by GLIB_000:61;
        suppose (the_Source_of G).e0 = v;
          then (the_Source_of H).e0 = v by A18, GLIB_000:def 32;
          hence contradiction by A11, A18, FUNCT_2:5;
        end;
        suppose (the_Target_of G).e0 = v;
          then (the_Target_of H).e0 = v by A18, GLIB_000:def 32;
          hence contradiction by A11, A18, FUNCT_2:5;
        end;
      end;
      then the_Edges_of H misses {e0} by ZFMISC_1:50;
      hence thesis by A15, A17, GLIB_000:44, XBOOLE_1:86;
    end;
    consider p being non empty _finite Tree-like Graph-yielding FinSequence
      such that
      A19: p.1 == H & p.len p = G2 & len p = G2.order() - H.order() + 1 and
      A20: for n being Element of dom p st n <= len p - 1
        ex v1,v2 being Vertex of G2, e being object
        st p.(n+1) is addAdjVertex of p.n,v1,e,v2 &
          e in the_Edges_of G2 \ the_Edges_of p.n &
          ((v1 in the_Vertices_of p.n & not v2 in the_Vertices_of p.n) or
            (not v1 in the_Vertices_of p.n & v2 in the_Vertices_of p.n))
      by A6, A14, A16, A10, A11;
    reconsider q = p ^ <* G *>
      as non empty _finite Tree-like Graph-yielding FinSequence;
    take q;
    1 in dom p by FINSEQ_5:6;
    hence q.1 == H by A19, FINSEQ_1:def 7;
    A21: len q = len p + len <* G *> by FINSEQ_1:22
      .= len p + 1 by FINSEQ_1:40;
    hence A22: q.len q = G by FINSEQ_1:42;
    thus len q = G.order() - H.order() + 1 by A13, A19, A21;
    let n be Element of dom q;
    assume n <= len q - 1;
    then per cases by Lm12;
    suppose A23: n = len q - 1;
      then A24: q.(n+1) = G by A22;
      1 <= n by FINSEQ_3:25;
      then n in dom p by A21, A23, FINSEQ_3:25;
      then A27: q.n = G2 by A19, A21, A23, FINSEQ_1:def 7;
      A28: e0 in v.edgesInOut() by A12, TARSKI:def 1;
      then A29: e0 in the_Edges_of G;
      e0 in {e0} by TARSKI:def 1;
      then A30: not e0 in the_Edges_of q.n by A15, A27, XBOOLE_0:def 5;
      v in {v} by TARSKI:def 1;
      then not v in the_Vertices_of G \ {v} by XBOOLE_0:def 5;
      then A31: not v in the_Vertices_of q.n by A10, A27, GLIB_000:47;
      v.adj(e0) <> v by A12, A28, GLIB_000:67;
      then not v.adj(e0) in {v} by TARSKI:def 1;
      then v.adj(e0) in the_Vertices_of G \ {v} by XBOOLE_0:def 5;
      then A32: v.adj(e0) in the_Vertices_of q.n by A10, A27, GLIB_000:47;
      per cases by A10, A12, Th38;
      suppose A33: G is addAdjVertex of G2, v.adj(e0), e0, v;
        take v.adj(e0), v, e0;
        thus q.(n+1) is addAdjVertex of q.n, v.adj(e0), e0, v by A24, A27, A33;
        thus thesis by A29, A30, A31, A32, XBOOLE_0:def 5;
      end;
      suppose A34: G is addAdjVertex of G2, v, e0, v.adj(e0);
        take v, v.adj(e0), e0;
        thus q.(n+1) is addAdjVertex of q.n, v, e0, v.adj(e0) by A24, A27, A34;
        thus thesis by A29, A30, A31, A32, XBOOLE_0:def 5;
      end;
    end;
    suppose A35: n <= len p - 1;
      then A36: n+0 <= len p - 1 + 1 by XREAL_1:7;
      1 <= n by FINSEQ_3:25;
      then reconsider m = n as Element of dom p by A36, FINSEQ_3:25;
      consider v1,v2 being Vertex of G2, e being object
        such that A37: p.(m+1) is addAdjVertex of p.m,v1,e,v2 &
          e in the_Edges_of G2 \ the_Edges_of p.m &
          ((v1 in the_Vertices_of p.m & not v2 in the_Vertices_of p.m) or
            (not v1 in the_Vertices_of p.m & v2 in the_Vertices_of p.m))
        by A20, A35;
      1+0 <= n+1 & n+1 <= len p - 1 + 1 by A35, XREAL_1:6;
      then n+1 in dom p by FINSEQ_3:25;
      then A38: q.(n+1) = p.(m+1) by FINSEQ_1:def 7;
      A39: q.n = p.m by FINSEQ_1:def 7;
      the_Vertices_of G2 c= the_Vertices_of G;
      then reconsider v1,v2 as Vertex of G by TARSKI:def 3;
      take v1,v2,e;
      the_Edges_of G2 \ the_Edges_of p.m c= the_Edges_of G \ the_Edges_of p.m
        by XBOOLE_1:33;
      hence thesis by A37, A38, A39;
    end;
  end;
  A40: for k being Nat holds P[k] from NAT_1:sch 2(A1,A5);
  let G be _finite Tree-like _Graph;
  let H be connected Subgraph of G;
  G.order() - H.order() is Nat by GLIB_000:75, NAT_1:21;
  hence thesis by A40;
end;
