
theorem Th74:
  for G being _finite connected _Graph
  ex p being non empty _finite connected Graph-yielding FinSequence
  st p.1 is _trivial edgeless & p.len p = G & len p = G.size() + 1 &
    for n being Element of dom p st n <= len p - 1 holds
    (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)) ) or
    (ex v1,v2 being Vertex of G, e being object
     st p.(n+1) is addEdge of p.n,v1,e,v2 &
       e in the_Edges_of G \ the_Edges_of p.n &
       v1 in the_Vertices_of p.n & v2 in the_Vertices_of p.n)
proof
  let G be _finite connected _Graph;
  per cases;
  suppose A1: G is non acyclic;
    set H = the spanning Tree-like Subgraph of G;
    consider p being non empty _finite Tree-like Graph-yielding FinSequence
      such that
      A2: p.1 is _trivial edgeless & p.len p = H & len p = H.order() and
      A3: for n being Element of dom p st n <= len p - 1
        ex v1,v2 being Vertex of H, e being object
        st p.(n+1) is addAdjVertex of p.n,v1,e,v2 &
          e in the_Edges_of H \ 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 Th72;
    consider q being non empty _finite connected Graph-yielding FinSequence
      such that
      A4: q.1 == H & q.len q = G & len q = G.size() - H.size() + 1 and
      A5: for n being Element of dom q st n <= len q - 1 holds
        ex v1,v2 being Vertex of G, e being object
        st q.(n+1) is addEdge of q.n,v1,e,v2 &
          e in the_Edges_of G \ the_Edges_of q.n &
          v1 in the_Vertices_of q.n & v2 in the_Vertices_of q.n by Th66;
    reconsider r = p ^' q
      as non empty _finite connected Graph-yielding FinSequence;
    take r;1 <= len p by FINSEQ_1:20;
    hence r.1 is _trivial edgeless by A2, FINSEQ_6:140;
    A6: 1 < len q
    proof
      assume not 1 < len q;
      then len q <= 1 & 1 <= len q by FINSEQ_1:20;
      then G == H by A4, XXREAL_0:1;
      hence contradiction by A1, GLIB_002:44;
    end;
    hence r.len r = G by A4, FINSEQ_6:142;
    len r + 1 = len p + len q by FINSEQ_6:139
      .= H.order() + G.size() - H.size() + 1 by A2, A4
      .= H.size() + 1 + G.size() - H.size() + 1 by GLIB_002:46
      .= G.size() + 1 + 1;
    hence len r = G.size() + 1;
    let n be Element of dom r;
    assume A7: n <= len r - 1;
    n < len p or n = len p or n > len p by XXREAL_0:1;
    then n+1 <= len p or n = len p or n > len p by INT_1:7;
    then n+1-1 <= len p - 1 or n = len p or n > len p by XREAL_1:9;
    then per cases;
    suppose A8: n <= len p - 1;
      then A9: n+0 <= len p - 1+1 & n+1 <= len p -1+1 by XREAL_1:7;
      A10: 1 <= n by FINSEQ_3:25;
      then reconsider m = n as Element of dom p by A9, FINSEQ_3:25;
      A11: r.n = p.m by A9, A10, FINSEQ_6:140;
      1+0 <= n+1 by XREAL_1:7;
      then A12: r.(n+1) = p.(m+1) by A9, FINSEQ_6:140;
      now
        consider v1,v2 being Vertex of H, e being object such that
          A13: p.(m+1) is addAdjVertex of p.m,v1,e,v2 &
            e in the_Edges_of H \ 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 A3, A8;
        the_Vertices_of H c= the_Vertices_of G;
        then reconsider v1, v2 as Vertex of G by TARSKI:def 3;
        take v1,v2,e;
        the_Edges_of H \ the_Edges_of p.m c= the_Edges_of G \ the_Edges_of p.m
          by XBOOLE_1:33;
        hence r.(n+1) is addAdjVertex of r.n, v1,e,v2 &
          e in the_Edges_of G \ the_Edges_of r.n &
          ((v1 in the_Vertices_of r.n & not v2 in the_Vertices_of r.n) or
            (not v1 in the_Vertices_of r.n & v2 in the_Vertices_of r.n))
          by A11, A12, A13;
      end;
      hence thesis;
    end;
    suppose A14: n = len p;
      then 1 <= n & n <= len p by FINSEQ_1:20;
      then A15: r.n = H by A2, A14, FINSEQ_6:140;
      reconsider m = 1 as Element of dom q by A6, FINSEQ_3:25;
      A16: r.(n+1) = q.(m+1) by A14, A6, FINSEQ_6:141;
      now
        m+1 <= len q by A6, INT_1:7;
        then m+1-1 <= len q - 1 by XREAL_1:9;
        then consider v1,v2 being Vertex of G, e being object such that
          A17: q.(m+1) is addEdge of q.m,v1,e,v2 &
            e in the_Edges_of G \ the_Edges_of q.m &
            v1 in the_Vertices_of q.m & v2 in the_Vertices_of q.m by A5;
        take v1,v2,e;
        thus r.(n+1) is addEdge of r.n,v1,e,v2 by A4, A15, A16, A17, Th36;
        thus e in the_Edges_of G \ the_Edges_of r.n &
          v1 in the_Vertices_of r.n & v2 in the_Vertices_of r.n
          by A4, A15, A17, GLIB_000:def 34;
      end;
      hence thesis;
    end;
    suppose A18: n > len p;
      then reconsider n1 = n-1 as Nat by NAT_1:20;
      n1+1 = n;
      then len p <= n1 by A18, NAT_1:13;
      then reconsider k1 = n1 - len p as Nat by NAT_1:21;
      set k = k1+1;
      A19: k+1 < len q
      proof
        assume len q <= k + 1;
        then len q + len p <= k + 1 + len p by XREAL_1:6;
        then len r + 1 <= n + 1 by FINSEQ_6:139;
        then len r - 1 <= n - 1 by XREAL_1:6, XREAL_1:9;
        then n <= n-1 by A7, XXREAL_0:2;
        then n-n <= n-1-n by XREAL_1:9;
        then 0 <= -1;
        hence contradiction;
      end;
      then k+1-1 < len q - 0 by XREAL_1:14;
      then r.(len p + k) = q.(k+1) by NAT_1:14, FINSEQ_6:141;
      then A20: r.n = q.(k+1);
      1+0 <= k+1 by XREAL_1:7;
      then r.(len p +(k+1)) = q.((k+1)+1) by A19, FINSEQ_6:141;
      then A21: r.(n+1) = q.((k+1)+1);
      1+0 <= k+1 & k+1 <= len q by A19, XREAL_1:7;
      then reconsider m=k+1 as Element of dom q by FINSEQ_3:25;
      now
        m+1 <= len q by A19, INT_1:7;
        then m+1-1 <= len q - 1 by XREAL_1:9;
        then consider v1,v2 being Vertex of G, e being object such that
          A22: q.(m+1) is addEdge of q.m,v1,e,v2 &
            e in the_Edges_of G \ the_Edges_of q.m &
            v1 in the_Vertices_of q.m & v2 in the_Vertices_of q.m by A5;
        take v1,v2,e;
        thus r.(n+1) is addEdge of r.n,v1,e,v2 &
          e in the_Edges_of G \ the_Edges_of r.n &
          v1 in the_Vertices_of r.n & v2 in the_Vertices_of r.n
          by A20, A21, A22;
      end;
      hence thesis;
    end;
  end;
  suppose A23: G is acyclic;
  then consider p being non empty _finite Tree-like Graph-yielding FinSequence
      such that
      A24: p.1 is _trivial edgeless & p.len p = G & len p = G.order() and
      A25: 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))
      by Th72;
    take p;
    thus thesis by A24, A25, A23, GLIB_002:46;
  end;
end;
