$$$top.pvs
%-------------------------------------------------------------------------------
%
% Graph Theory
%
%  Authors:
%
%      Jon Sjogren       AFOSR
%      Ricky W. Butler   NASA Langley
%
%  Version 2.0           Last modified 5/21/97
%                        UPDATED to PVS 2.2: 11/17/98
%
%
%  Maintained by:
%
%     Rick Butler        NASA Langley Research Center
%                        R.W.Butler@larc.nasa.gov
%
%  abstract_min          -- abstract definition of min
%  abstract_max          -- abstract definition of max
%  circuit_deg           -- degree of circuits
%  circuits              -- theory of circuits
%  cycle_deg             -- theorem about degree and existence of cycle
%  doubletons            -- theory of doubletons used for definition of edge
%  graphs                -- fundamental definition of a graph
%  graph_complected      -- unusual definition of connected graph
%  graph_conn_defs       -- defs of piece, path, and structural connectedness
%  graph_conn_piece      -- structural connected ==> piece connected
%  graph_connected       -- all connected defs are equivalent
%  graph_path_conn       -- path connected ==> structural connected
%  graph_piece_path      -- piece connected ==> path connected
%  graph_deg             -- definition of degree
%  graph_deg_sum         -- theorem relating vertex degree and number of edges
%  graph_inductions      -- vertex and edge inductions for graphs
%  graph_ops             -- delete vertex and delete edge operations
%  h_menger              -- hard menger
%  ind_paths             -- definition of independent paths
%  max_subgraphs         -- maximal subgraphs with specified property
%  max_subtrees          -- maximal subtrees with specified property
%  meng_scaff            -- scaffolding for hard menger proof
%  meng_scaff_defs       -- scaffolding for hard menger proof
%  meng_scaff_prelude    -- scaffolding for hard menger proof
%  menger                -- menger's theorem
%  min_walk_reduced      -- theorem that minimum walk is reduced
%  min_walks             -- minimum walk satisfying a property
%  path_lems             -- some useful lemmas about paths
%  path_ops              -- deleting vertex and edge operations
%  paths                 -- fundamental definition and properties about paths
%  ramsey_new            -- Ramsey's theorem
%  reduce_walks          -- operation to reduce a walk
%  sep_set_lems          -- properties of separating sets
%  sep_sets              -- definition of separating sets
%  subgraphs             -- generation of subgraphs from vertex sets
%  subgraphs_from_walk   -- generation of subgraphs from walks
%  subtrees              -- subtrees of a graph
%  tree_circ             -- theorem that tree has no circuits
%  tree_paths            -- theorem that tree has only one path between vertices
%  trees                 -- fundamental definition of trees
%  walk_inductions       -- induction on length of a walk
%  walks                 -- fundamental definition and properties of walks
%
%-------------------------------------------------------------------------------
top: THEORY
BEGIN
   IMPORTING graphs,
             graph_deg,
             graph_deg_sum,
             walks,
             paths,
             path_ops,
             path_lems,
             circuits,
             subgraphs,
             subgraphs_from_walk,
             graph_ops,
             max_subgraphs,
             max_subtrees,
             trees,
             tree_circ,
             subtrees,
             graph_connected,
             graph_inductions,
             walk_inductions,
             ramsey_new,
             min_walk_reduced, reduce_walks,
             menger,
             tree_paths,         % Proof incorrect
             circuit_deg,
	     cycle_deg,          % not attempted yet
	     abstract_min      ,
	     abstract_max     ,
	     doubletons        ,
	     graph_complected  ,
	     graph_conn_defs   ,
	     graph_conn_piece  ,
	     graph_connected   ,
	     graph_path_conn   ,
	     graph_piece_path  ,
	     graph_inductions  ,
	     h_menger          ,
	     ind_paths         ,
	     meng_scaff        ,
	     meng_scaff_defs   ,
	     meng_scaff_prelude,
	     menger            ,
	     min_walks         ,
	     sep_set_lems      ,
	     sep_sets
END top
$$$top.prf
(|top| (IMPORTING1_TCC1 "" (REWRITE "zero_identity") NIL)
 (IMPORTING1_TCC2 "" (REWRITE "plus_ac") NIL))
$$$abstract_max.pvs
abstract_max[T: TYPE, N: nat, size: [T -> upto[N]], P: pred[T]]: THEORY
%------------------------------------------------------------------------------
%
%  The need for a function that returns the largest object that
%  satisfies a particular predicate arises in many contexts.  Thus it is
%  useful to develop an "abstract" max theory that can be instantiated in
%  multiple ways to provide different max functions.  Such a theory must
%  be parameterized by
%
%    -------------------------------------------------------------------------
%    | T: TYPE          | the base type over which max is defined            |
%    | size:[T -> nat]  | the size function by which objects are compared    |
%    | P: pred[T]       | the property that the max function must satisfy    |
%    -------------------------------------------------------------------------
%
%  Author:
%
%      Ricky W. Butler   NASA Langley
%
%  Version 2.0           Last modified 10/21/97
%
%  Maintained by:
%
%     Rick Butler        NASA Langley Research Center
%                        R.W.Butler@larc.nasa.gov
%
%------------------------------------------------------------------------------
BEGIN
   ASSUMING
   T_ne: ASSUMPTION EXISTS (t: T): P(t)
   ENDASSUMING
   IMPORTING max_upto
   TP: TYPE = {t: T | P(t)}
   n: VAR upto[N]
   S,SS: VAR T
   is_one(n): bool = (EXISTS (S: T): P(S) AND size(S) = n)
   prep0: LEMMA nonempty?({n: upto[N] | is_one(n)})
   max_f: upto[N] = max({n: upto[N] | is_one(n)})
   prep1: LEMMA nonempty?({S: T | size(S) = max_f AND P(S)})
   maximal?(S): bool = P(S) AND
                       (FORALL (SS: T): P(SS) IMPLIES size(S) >= size(SS))
   max: {S: T | maximal?(S)}
   max_def: LEMMA maximal?(max)
   max_in : LEMMA P(max)
   max_is_max: LEMMA P(SS) IMPLIES size(max) >= size(SS)
END abstract_max
$$$abstract_max.prf
(|abstract_max|
 (|prep0| "" (LEMMA "T_ne")
  (("" (EXPAND "nonempty?")
    (("" (EXPAND "empty?")
      (("" (SKOSIMP*)
        (("" (EXPAND "member")
          (("" (EXPAND "is_one")
            (("" (INST -2 "size(t!1)") (("" (INST 1 "t!1") (("" (ASSERT) NIL)))))))))))))))))
 (|max_f_TCC1| "" (LEMMA "prep0") (("" (PROPAX) NIL)))
 (|prep1| "" (EXPAND "nonempty?")
  (("" (EXPAND "empty?")
    (("" (EXPAND "member")
      (("" (EXPAND "max_f")
        (("" (TYPEPRED "max({n: upto[N] | is_one(n)})")
          (("1" (EXPAND "is_one")
            (("1" (SKOSIMP*) (("1" (INST -5 "S!1") (("1" (ASSERT) NIL)))))))
           ("2" (REWRITE "prep0") NIL)))))))))))
 (|max_TCC1| "" (LEMMA "prep1")
  (("" (EXPAND "nonempty?")
    (("" (EXPAND "empty?")
      (("" (SKOSIMP*)
        (("" (EXPAND "member")
          (("" (INST?)
            (("" (EXPAND "maximal?")
              (("" (FLATTEN)
                (("" (ASSERT)
                  (("" (SKOSIMP*)
                    (("" (EXPAND "max_f")
                      (("" (REPLACE -2)
                        (("" (HIDE -2)
                          (("" (TYPEPRED "max({n: upto[N] | is_one(n)})")
                            (("1" (INST -3 "size(SS!1)")
                              (("1" (ASSERT)
                                (("1" (EXPAND "is_one") (("1" (INST?) (("1" (ASSERT) NIL)))))))))
                             ("2" (LEMMA "prep0")
                              (("2" (PROPAX) NIL)))))))))))))))))))))))))))))))
 (|max_def| "" (TYPEPRED "max") (("" (PROPAX) NIL)))
 (|max_in| "" (TYPEPRED "max") (("" (EXPAND "maximal?") (("" (FLATTEN) (("" (PROPAX) NIL)))))))
 (|max_is_max| "" (SKOSIMP*)
  (("" (TYPEPRED "max")
    (("" (EXPAND "maximal?") (("" (FLATTEN) (("" (INST?) (("" (ASSERT) NIL))))))))))))
$$$cycle_deg.pvs
cycle_deg[T: TYPE]: THEORY
BEGIN
   IMPORTING path_lems[T], trees[T]
   G: VAR graph[T]
   n: VAR nat
   % **** NOT YET PROVED ****
   deg_gt_1_cycle: LEMMA (FORALL (v: T): vert(G)(v) IMPLIES deg(v,G) > 1)
                            IMPLIES (EXISTS (C: Seq(G)): cycle?(G,C))
END cycle_deg
$$$cycle_deg.prf
(|cycle_deg| (|deg_gt_1_cycle| "" (POSTPONE) NIL))
$$$tree_paths.pvs
tree_paths[T: TYPE]: THEORY
BEGIN
   IMPORTING tree_circ[T], paths[T]
   GT: VAR Tree
   u,v: VAR T
   m,n: VAR nat
   G: VAR graph[T]
   tree_path_reduced: LEMMA FORALL (w1,w2: prewalk):  % **** NOT YET PROVED
   			 path_from?(GT, w1, u, v) AND
   			 path_from?(GT, w2, u, v) AND
   			 l(w1) > 1 AND w1 /= w2 AND
                       pre_circuit?(GT, w1 ^ (0, l(w1) - 2) o rev(w2))
         IMPLIES  cyclically_reduced?(GT, w1 ^ (0, l(w1) - 2) o rev(w2))
   w1,w2: VAR prewalk
   tree_one_path: LEMMA FORALL (w1,w2: prewalk): tree?(GT) AND % ** NOT YET PROVED
                               path_from?(GT,w1,u,v) AND
                               path_from?(GT,w2,u,v) IMPLIES
                                    w1 = w2
END tree_paths
$$$tree_paths.prf
(|tree_paths|
 (|tree_path_reduced_TCC1| "" (SKOSIMP*) (("" (TYPEPRED "w1!1") (("" (ASSERT) NIL)))))
 (|tree_path_reduced_TCC2| "" (SKOSIMP*)
  (("" (TYPEPRED "w1!1")
    (("" (TYPEPRED "w2!1")
      (("" (EXPAND "o ") (("" (EXPAND "^") (("" (LIFT-IF) (("" (GROUND) NIL)))))))))))))
 (|tree_path_reduced_TCC3| "" (SKOSIMP*)
  (("" (EXPAND "rev")
    (("" (EXPAND "o ")
      (("" (EXPAND "^")
        (("" (EXPAND "emptyseq")
          (("" (SPLIT 2)
            (("1" (LIFT-IF) (("1" (GROUND) NIL)))
             ("2" (HIDE -1 -2 -3 -5)
              (("2" (EXPAND "verts_in?")
                (("2" (SKOSIMP*)
                  (("2" (TYPEPRED "i!1")
                    (("2" (LIFT-IF)
                      (("2" (GROUND)
                        (("1" (REVEAL -2)
                          (("1" (EXPAND "path_from?")
                            (("1" (FLATTEN)
                              (("1" (EXPAND "path?")
                                (("1" (FLATTEN)
                                  (("1" (EXPAND "walk?")
                                    (("1" (FLATTEN)
                                      (("1" (HIDE -2 -3)
                                        (("1" (EXPAND "verts_in?")
                                          (("1" (INST?) NIL)))))))))))))))))))
                         ("2" (ASSERT)
                          (("2" (LEMMA "path?_verts")
                            (("2" (INST?)
                              (("2" (HIDE -2)
                                (("2" (INST?)
                                  (("2" (REVEAL -4)
                                    (("2" (EXPAND "path_from?")
                                      (("2" (FLATTEN)
                                        (("2" (ASSERT)
                                          (("2" (EXPAND "verts_in?")
                                            (("2" (INST - "i!1")
                                              NIL)))))))))))))))))))))
                         ("3" (ASSERT)
                          (("3" (HIDE -1)
                            (("3" (REVEAL -3)
                              (("3" (EXPAND "path_from?")
                                (("3" (FLATTEN)
                                  (("3" (LEMMA "path?_verts")
                                    (("3" (INST?)
                                      (("3" (ASSERT)
                                        (("3" (EXPAND "verts_in?")
                                          (("3" (INST?)
                                            NIL)))))))))))))))))))))))))))))))))))))))))))
 (|tree_path_reduced| "" (SKOSIMP*)
  (("" (CASE "u!1 = v!1")
    (("1" (HIDE -5 2)
      (("1" (EXPAND "path_from?")
        (("1" (FLATTEN)
          (("1" (EXPAND "from?")
            (("1" (FLATTEN)
              (("1" (EXPAND "path?")
                (("1" (FLATTEN)
                  (("1" (EXPAND "fseq")
                    (("1" (INST -3 "0" "l(w1!1) - 1")
                      (("1" (ASSERT) NIL)))))))))))))))))))
     ("2" (EXPAND "cyclically_reduced?")
      (("2" (EXPAND "fseq")
        (("2" (PROP)
          (("1" (LEMMA "path_from_l")
            (("1" (INST -1 "GT!1" "w2!1" "u!1" "v!1")
              (("1" (ASSERT)
                (("1" (HIDE -2 -3 -5)
                  (("1" (EXPAND "o ")
                    (("1" (EXPAND "^")
                      (("1" (ASSERT)
                        (("1" (EXPAND "rev") (("1" (ASSERT) NIL)))))))))))))))))
           ("2" (EXPAND "reduced?")
            (("2" (EXPAND "reducible?")
              (("2" (EXPAND "fseq")
                (("2" (SKOSIMP*)
                  (("2" (HIDE -6)
                    (("2" (EXPAND "o ")
                      (("2" (EXPAND "^")
                        (("2" (EXPAND "rev")
                          (("2" (LIFT-IF)
                            (("2" (LIFT-IF)
                              (("2" (GROUND)
                                (("2" (LIFT-IF)
                                  (("2" (LIFT-IF)
                                    (("2" (GROUND)
                                      (("1" (EXPAND "path_from?" -5)
                                        (("1" (EXPAND "path?")
                                          (("1" (FLATTEN)
                                            (("1" (INST - "k!1-1" "k!1+1")
                                              (("1" (ASSERT)
                                                (("1"
                                                  (EXPAND "fseq")
                                                  (("1" (ASSERT) NIL)))))))))))))
                                       ("2"
                                        (CASE "k!1 = l(w1!1) - 1 OR k!1 = l(w1!1) - 2")
                                        (("1" (SPLIT -)
                                          (("1" (REPLACE -1)
                                            (("1" (HIDE -1)
                                              (("1" (ASSERT)
                                                (("1"
                                                  (EXPAND "emptyseq")
                                                  (("1"
                                                    (ASSERT)
                                                    (("1"
                                                      (REVEAL -2)
                                                      (("1" (POSTPONE) NIL)))))))))))))
                                           ("2" (POSTPONE) NIL)))
                                         ("2" (FLATTEN) (("2" (ASSERT) NIL)))))
                                       ("3" (POSTPONE) NIL)))))))))))))))))))))))))))))
           ("3" (POSTPONE) NIL)))))))))))
 (|walk_concat_TCC1| "" (SUBTYPE-TCC) NIL)
 (|walk_concat_TCC2| "" (SKOSIMP*)
  (("" (EXPAND "rev")
    (("" (EXPAND "o ")
      (("" (EXPAND "^")
        (("" (EXPAND "emptyseq") (("" (LIFT-IF) (("" (GROUND) NIL)))))))))))))
 (|walk_concat| "" (SKOSIMP*)
  (("" (EXPAND "walk_from?")
    (("" (FLATTEN)
      (("" (ASSERT)
        (("" (EXPAND "o ")
          (("" (EXPAND "rev")
            (("" (EXPAND "^")
              (("" (EXPAND "walk?")
                (("" (EXPAND "fseq")
                  (("" (FLATTEN)
                    (("" (SPLIT +)
                      (("1" (EXPAND "verts_in?")
                        (("1" (SKOSIMP*)
                          (("1" (GROUND)
                            (("1" (INST?) NIL)
                             ("2" (HIDE -2 -3 -4 -5 -6 -7 -9)
                              (("2" (INST - "l(w1!1) + l(w2!1) - 2 - i!1") NIL)))))))))
                       ("2" (SKOSIMP*)
                        (("2" (EXPAND "edge?")
                          (("2" (CASE "n!1 < l(w1!1) - 1")
                            (("1" (ASSERT)
                              (("1" (INST?)
                                (("1" (ASSERT)
                                  (("1" (FLATTEN)
                                    (("1" (ASSERT)
                                      (("1" (CASE "n!1 = l(w1!1) - 1")
                                        (("1" (REPLACE -1)
                                          (("1" (HIDE -1) (("1" (ASSERT) NIL)))))
                                         ("2" (LIFT-IF)
                                          (("2" (ASSERT) NIL)))))))))))))))
                             ("2" (ASSERT)
                              (("2" (HIDE -6)
                                (("2" (INST - "l(w1!1) + l(w2!1) - 3 - n!1")
                                  (("2" (ASSERT)
                                    (("2" (FLATTEN)
                                      (("2" (ASSERT)
                                        (("2" (REWRITE "dbl_comm")
                                          NIL)))))))))))))))))))))))))))))))))))))))))
 (|tree_one_path| "" (SKOSIMP*)
  (("" (LEMMA "tree_no_circuits")
    (("" (INST?)
      (("" (ASSERT)
        (("" (CASE-REPLACE "l(w1!1) = 1")
          (("1" (EXPAND "path_from?")
            (("1" (EXPAND "path?")
              (("1" (FLATTEN)
                (("1" (EXPAND "fseq")
                  (("1" (EXPAND "from?")
                    (("1" (FLATTEN)
                      (("1" (REPLACE -1)
                        (("1" (HIDE -1)
                          (("1" (ASSERT)
                            (("1" (INST -8 "0" "l(w2!1)-1")
                              (("1" (ASSERT)
                                (("1" (CASE-REPLACE "l(w2!1) = 1")
                                  (("1" (ASSERT)
                                    (("1" (HIDE 1)
                                      (("1" (REVEAL -2)
                                        (("1" (APPLY-EXTENSIONALITY 1 :HIDE? T)
                                          (("1" (APPLY-EXTENSIONALITY :HIDE? T)
                                            NIL)))))))))
                                   ("2" (ASSERT) NIL)))))))))))))))))))))))))
           ("2" (CASE "l(w1!1 ^ (0, l(w1!1) - 2) o rev(w2!1)) > 0")
            (("1" (CASE "walk?[T](GT!1, w1!1 ^ (0, l(w1!1) - 2) o rev( w2!1))")
              (("1" (INST - "w1!1 ^ (0, l(w1!1) - 2) o rev( w2!1)")
                (("1" (EXPAND "circuit?")
                  (("1" (ASSERT)
                    (("1"
                      (CASE "pre_circuit?(GT!1, w1!1 ^ (0, l(w1!1) - 2) o rev( w2!1))")
                      (("1" (ASSERT)
                        (("1" (HIDE -2 -3 -4)
                          (("1" (LEMMA "tree_path_reduced")
                            (("1" (INST?) (("1" (INST?) (("1" (ASSERT) NIL)))))))))))
                       ("2" (ASSERT)
                        (("2" (EXPAND "pre_circuit?")
                          (("2" (EXPAND "fseq")
                            (("2" (HIDE -1 -2 -3)
                              (("2" (EXPAND "path_from?")
                                (("2" (FLATTEN)
                                  (("2" (EXPAND "from?")
                                    (("2" (FLATTEN)
                                      (("2" (HIDE 3)
                                        (("2" (EXPAND "o ")
                                          (("2" (EXPAND "rev")
                                            (("2" (EXPAND "^")
                                              (("2" (ASSERT)
                                                NIL)))))))))))))))))))))))))))))))
                 ("2" (ASSERT) NIL) ("3" (ASSERT) NIL)))
               ("2" (LEMMA "walk_concat")
                (("2" (EXPAND "path_from?")
                  (("2" (FLATTEN)
                    (("2" (EXPAND "path?")
                      (("2" (FLATTEN)
                        (("2" (HIDE -6 -9)
                          (("2" (INST -1 "GT!1" "u!1" "u!1" "v!1" "w1!1" "w2!1")
                            (("2" (EXPAND "walk_from?")
                              (("2" (ASSERT)
                                (("2" (EXPAND "from?")
                                  (("2" (FLATTEN)
                                    (("2" (ASSERT) NIL)))))))))))))))))))))))
               ("3" (PROPAX) NIL) ("4" (ASSERT) NIL)))
             ("2" (EXPAND "o ")
              (("2" (EXPAND "rev") (("2" (EXPAND "^") (("2" (ASSERT) NIL)))))))
             ("3" (ASSERT) NIL))))))))))))))
$$$sep_set_lems.pvs
sep_set_lems[T: TYPE]: THEORY
BEGIN
   IMPORTING paths[T], sep_sets[T], path_ops[T]
   G,MM: VAR graph[T]
   v,s,t,w1,w2: VAR T
   e: VAR doubleton[T]
   W: VAR finite_set[T]
   p: VAR prewalk
   sep_num_0: LEMMA separable?(G,s,t) AND sep_num(G, s, t) = 0 IMPLIES
                          separates(G, emptyset[T], s, t)
   sep_num_gt_0: LEMMA vert(G)(s) AND vert(G)(t) AND separable?(G,s,t)
                       AND sep_num(G,s,t) > 0 IMPLIES
                              (EXISTS (w: prewalk): walk_from?(G,w,s,t))
   sep_num_is_1: LEMMA vert(G)(s) AND vert(G)(t) AND v /= s AND v /= t AND
                          (FORALL (p: prewalk): walk_from?(G,p,s,t) IMPLIES
                                  (EXISTS (i: below(l(p))): seq(p)(i) = v))
                             IMPLIES sep_num(G,s,t) <= 1
   av: VAR T
   sep_num_le1: LEMMA vert(G)(s) AND vert(G)(t) AND vert(G)(av) AND
                          av /= s AND av /= t AND
                          separable?(G, s, t) AND
                          sep_num(G,s,t) <= 1 IMPLIES
                             (EXISTS (z: T): vert(G)(z) AND z /= s AND z /= t AND
                                               separates(G,singleton(z),s,t))
   separable?_comm: LEMMA separable?(G,s,t) IMPLIES separable?(G,t,s)
   separates_comm:  LEMMA separates(G, W, s, t) = separates(G, W, t, s)
   sep_num_comm:    LEMMA vert(G)(s) AND vert(G)(t) IMPLIES
                            sep_num(G,s,t) = sep_num(G,t,s)
   v_not_in: LEMMA  walk_from?(del_verts(G, remove(v, W)), p,s,t)
   	           AND W(v) AND NOT verts_of(p)(v)
   	           IMPLIES walk_from?(del_verts(G, W), p, s, t)
   k: VAR nat
   path_thru_each: LEMMA     sep_num(G,s,t) = k
                         AND separates(G, W, s, t)
                         AND card(W) = k AND W(v)
                         AND vert(G)(s) AND vert(G)(t)
              IMPLIES
                 (EXISTS (pv: prewalk): verts_of(pv)(v) AND path_from?(G,pv,s,t))
   one_to_each: LEMMA     sep_num(G,s,t) = 2
                      AND separates(G, dbl(w1, w2), s, t)
                      AND vert(G)(s) AND vert(G)(t)
              IMPLIES
   	         ( (EXISTS (Psw1: prewalk): path_from?(G, Psw1, s, w1)) AND
   		   (EXISTS (Psw2: prewalk): path_from?(G, Psw2, s, w2)))
   walk?_del_verts  : LEMMA walk?(del_verts(G, W), p) IMPLIES walk?[T](G, p)
   del_verts_eq: LEMMA del_vert(del_vert(G, w1), w2) = del_verts(G, dbl(w1, w2))
END sep_set_lems
$$$sep_set_lems.prf
(|sep_set_lems|
 (|sep_num_0| "" (SKOSIMP*)
  (("" (EXPAND "sep_num")
    (("" (LEMMA "min_sep_set_seps")
      (("" (LEMMA "card_is_0[T]")
        (("" (INST?)
          (("" (IFF -1)
            (("" (ASSERT) (("" (INST?) (("" (ASSERT) NIL)))))))))))))))))
 (|sep_num_gt_0| "" (SKOSIMP*)
  (("" (EXPAND "sep_num")
    (("" (CASE "separates(G!1,emptyset[T],s!1,t!1)")
      (("1" (LEMMA "min_sep_set_card")
        (("1" (INST?)
          (("1" (ASSERT)
            (("1" (REWRITE "card_emptyset[T]") (("1" (ASSERT) NIL)))))))))
       ("2" (HIDE -1 -2)
        (("2" (EXPAND "separates")
          (("2" (PROP)
            (("1" (EXPAND "emptyset") (("1" (PROPAX) NIL)))
             ("2" (EXPAND "emptyset") (("2" (PROPAX) NIL)))
             ("3" (SKOSIMP*)
              (("3" (TYPEPRED "w!1")
                (("3" (CASE-REPLACE "del_verts(G!1, emptyset[T]) = G!1")
                  (("1" (HIDE -1) (("1" (INST 1 "w!1") NIL)))
                   ("2" (HIDE -1 -2 -3 2)
                    (("2" (APPLY-EXTENSIONALITY :HIDE? T)
                      (("1" (APPLY-EXTENSIONALITY :HIDE? T)
                        (("1" (EXPAND "emptyset")
                          (("1" (EXPAND "del_verts") (("1" (PROPAX) NIL)))))))
                       ("2" (APPLY-EXTENSIONALITY :HIDE? T)
                        (("2" (EXPAND "del_verts")
                          (("2" (GRIND) NIL)))))))))))))))))))))))))))
 (|sep_num_is_1| "" (SKOSIMP*)
  (("" (CASE "separates(G!1, singleton[T](v!1), s!1, t!1)")
    (("1" (HIDE -2)
      (("1" (EXPAND "sep_num")
        (("1" (LEMMA "min_sep_set_card")
          (("1" (INST?)
            (("1" (ASSERT) (("1" (REWRITE "card_singleton[T]") NIL)))
             ("2" (REVEAL -2) (("2" (PROPAX) NIL)))))))))))
     ("2" (HIDE 2)
      (("2" (EXPAND "separates")
        (("2" (SPLIT 1)
          (("1" (EXPAND "singleton") (("1" (REVEAL 1) (("1" (ASSERT) NIL)))))
           ("2" (EXPAND "singleton") (("2" (ASSERT) NIL)))
           ("3" (SKOSIMP*)
            (("3" (INST -4 "w!1")
              (("3" (EXPAND "walk_from?")
                (("3" (FLATTEN)
                  (("3" (ASSERT)
                    (("3" (SPLIT -6)
                      (("1" (SKOSIMP*)
                        (("1" (EXPAND "walk?")
                          (("1" (FLATTEN)
                            (("1" (HIDE -5)
                              (("1" (EXPAND "verts_in?")
                                (("1" (INST - "i!1")
                                  (("1" (EXPAND "del_verts")
                                    (("1" (EXPAND "difference")
                                      (("1"
                                        (EXPAND "member")
                                        (("1"
                                          (FLATTEN)
                                          (("1"
                                            (EXPAND "singleton")
                                            (("1"
                                              (PROPAX)
                                              NIL)))))))))))))))))))))))
                       ("2" (HIDE -1 -2 3)
                        (("2" (EXPAND "walk?")
                          (("2" (FLATTEN)
                            (("2" (SPLIT 1)
                              (("1" (HIDE -2)
                                (("1" (EXPAND "verts_in?")
                                  (("1" (SKOSIMP*)
                                    (("1" (INST?)
                                      (("1"
                                        (EXPAND "del_verts")
                                        (("1"
                                          (EXPAND "difference")
                                          (("1"
                                            (EXPAND "member")
                                            (("1"
                                              (EXPAND "singleton")
                                              (("1"
                                                (FLATTEN)
                                                (("1"
                                                  (PROPAX)
                                                  NIL)))))))))))))))))))
                               ("2" (SKOSIMP*)
                                (("2" (EXPAND "fseq")
                                  (("2" (INST?)
                                    (("2" (ASSERT)
                                      (("2"
                                        (EXPAND "edge?")
                                        (("2"
                                          (FLATTEN)
                                          (("2"
                                            (EXPAND "del_verts")
                                            (("2"
                                              (FLATTEN)
                                              (("2"
                                                (HIDE -4)
                                                (("2"
                                                  (ASSERT)
                                                  NIL)))))))))))))))))))))))))))))))))))))))))))))
     ("3" (REWRITE "finite_singleton") NIL)))))
 (|sep_num_le1_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_singleton[T]") NIL)))
 (|sep_num_le1| "" (SKOSIMP*)
  (("" (EXPAND "sep_num")
    (("" (LEMMA "min_sep_set_seps")
      (("" (INST?)
        (("" (ASSERT)
          (("" (CASE "card(min_sep_set(G!1, s!1, t!1)) = 1")
            (("1" (LEMMA "card_one[T]")
              (("1" (INST?)
                (("1" (ASSERT)
                  (("1" (SKOSIMP*)
                    (("1" (INST + "x!1")
                      (("1" (LEMMA "min_sep_set_vert")
                        (("1" (INST?)
                          (("1" (INST - "x!1")
                            (("1" (ASSERT)
                              (("1" (REPLACE -2)
                                (("1" (EXPAND "singleton" -1)
                                  (("1" (EXPAND "separable?")
                                    (("1" (FLATTEN)
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (EXPAND "separates")
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (EXPAND "singleton")
                                              (("1"
                                                (ASSERT)
                                                NIL)))))))))))))))))))))))))))))))))))
             ("2" (CASE "card(min_sep_set(G!1, s!1, t!1)) = 0")
              (("1" (HIDE -6 1)
                (("1" (LEMMA "sep_num_0")
                  (("1" (INST -1 "G!1" "s!1" "t!1")
                    (("1" (ASSERT)
                      (("1" (EXPAND "sep_num")
                        (("1" (INST + "av!1")
                          (("1" (ASSERT)
                            (("1" (HIDE -2 -3 -7)
                              (("1" (EXPAND "separates")
                                (("1" (FLATTEN)
                                  (("1" (ASSERT)
                                    (("1" (EXPAND "singleton")
                                      (("1"
                                        (SKOSIMP*)
                                        (("1"
                                          (INST?)
                                          (("1"
                                            (EXPAND "walk_from?")
                                            (("1"
                                              (FLATTEN)
                                              (("1"
                                                (ASSERT)
                                                (("1"
                                                  (EXPAND "walk?")
                                                  (("1"
                                                    (FLATTEN)
                                                    (("1"
                                                      (SPLIT +)
                                                      (("1"
                                                        (EXPAND "verts_in?")
                                                        (("1"
                                                          (EXPAND "del_verts")
                                                          (("1"
                                                            (EXPAND
                                                             "difference")
                                                            (("1"
                                                              (EXPAND
                                                               "member")
                                                              (("1"
                                                                (SKOSIMP*)
                                                                (("1"
                                                                  (INST?)
                                                                  (("1"
                                                                    (ASSERT)
                                                                    (("1"
                                                                      (FLATTEN)
                                                                      (("1"
                                                                        (ASSERT)
                                                                        (("1"
                                                                          (EXPAND
                                                                           "emptyset")
                                                                          (("1"
                                                                            (PROPAX)
                                                                            NIL)))))))))))))))))))))
                                                       ("2"
                                                        (SKOSIMP*)
                                                        (("2"
                                                          (INST?)
                                                          (("2"
                                                            (EXPAND "fseq")
                                                            (("2"
                                                              (EXPAND "edge?")
                                                              (("2"
                                                                (ASSERT)
                                                                (("2"
                                                                  (FLATTEN)
                                                                  (("2"
                                                                    (ASSERT)
                                                                    (("2"
                                                                      (EXPAND
                                                                       "del_verts")
                                                                      (("2"
                                                                        (FLATTEN)
                                                                        (("2"
                                                                          (ASSERT)
                                                                          (("2"
                                                                            (SKOSIMP*)
                                                                            (("2"
                                                                              (EXPAND
                                                                               "emptyset")
                                                                              (("2"
                                                                                (PROPAX)
                                                                                NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
               ("2" (ASSERT) NIL)))))))))))))))
 (|separable?_comm| "" (SKOSIMP*)
  (("" (EXPAND "separable?")
    (("" (FLATTEN)
      (("" (ASSERT)
        (("" (EXPAND "edge?") (("" (REWRITE "dbl_comm") NIL)))))))))))
 (|separates_comm| "" (SKOSIMP*)
  (("" (EXPAND "separates")
    (("" (IFF 1)
      (("" (GROUND)
        (("1" (SKOSIMP*)
          (("1" (LEMMA "walk?_reverse")
            (("1" (INST?)
              (("1" (ASSERT) (("1" (SKOSIMP*) (("1" (INST 3 "w!2") NIL)))))
               ("2" (EXPAND "walk_from?")
                (("2" (FLATTEN) (("2" (PROPAX) NIL)))))))))))
         ("2" (SKOSIMP*)
          (("2" (LEMMA "walk?_reverse")
            (("2" (INST?)
              (("1" (ASSERT) (("1" (SKOSIMP*) (("1" (INST 3 "w!2") NIL)))))
               ("2" (EXPAND "walk_from?")
                (("2" (FLATTEN) (("2" (PROPAX) NIL)))))))))))))))))))
 (|sep_num_comm| "" (SKOSIMP*)
  (("" (CASE "separable?(G!1,s!1,t!1)")
    (("1" (LEMMA "min_sep_set_seps")
      (("1" (INST?)
        (("1" (LEMMA "min_sep_set_seps")
          (("1" (INST -1 "G!1" "t!1" "s!1")
            (("1" (LEMMA "separable?_comm")
              (("1" (INST?)
                (("1" (ASSERT)
                  (("1" (EXPAND "sep_num")
                    (("1" (LEMMA "min_sep_set_card")
                      (("1"
                        (INST -1 "G!1" "min_sep_set(G!1, t!1, s!1)" "s!1"
                         "t!1")
                        (("1" (LEMMA "min_sep_set_card")
                          (("1"
                            (INST -1 "G!1" "min_sep_set(G!1, s!1, t!1)" "t!1"
                             "s!1")
                            (("1" (SPLIT -1)
                              (("1" (SPLIT -2)
                                (("1" (ASSERT) NIL)
                                 ("2" (REWRITE "separates_comm") NIL)))
                               ("2" (REWRITE "separates_comm")
                                NIL)))))))))))))))))))))))))))
     ("2" (EXPAND "sep_num")
      (("2" (LEMMA "min_sep_set_edge")
        (("2" (COPY -1)
          (("2" (INST?)
            (("2" (INST -2 "G!1" "t!1" "s!1")
              (("2" (LEMMA "separable?_comm")
                (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))
 (|v_not_in| "" (SKOSIMP*)
  (("" (EXPAND "walk_from?")
    (("" (FLATTEN)
      (("" (ASSERT)
        (("" (HIDE -1 -2)
          (("" (EXPAND "walk?")
            (("" (FLATTEN)
              (("" (SPLIT 2)
                (("1" (HIDE -2)
                  (("1" (EXPAND "verts_in?")
                    (("1" (SKOSIMP*)
                      (("1" (EXPAND "del_verts")
                        (("1" (EXPAND "difference")
                          (("1" (EXPAND "remove")
                            (("1" (EXPAND "member")
                              (("1" (INST?)
                                (("1" (FLATTEN)
                                  (("1" (ASSERT)
                                    (("1" (EXPAND "verts_of")
                                      (("1"
                                        (INST?)
                                        (("1"
                                          (EXPAND "fseq")
                                          (("1"
                                            (ASSERT)
                                            NIL)))))))))))))))))))))))))))
                 ("2" (SKOSIMP*)
                  (("2" (EXPAND "fseq")
                    (("2" (EXPAND "edge?")
                      (("2" (INST?)
                        (("2" (ASSERT)
                          (("2" (FLATTEN)
                            (("2" (ASSERT)
                              (("2" (HIDE -2)
                                (("2" (EXPAND "del_verts")
                                  (("2" (FLATTEN)
                                    (("2" (ASSERT)
                                      (("2"
                                        (SKOSIMP*)
                                        (("2"
                                          (EXPAND "dbl")
                                          (("2"
                                            (EXPAND "remove")
                                            (("2"
                                              (EXPAND "member")
                                              (("2"
                                                (INST -5 "v!2")
                                                (("2"
                                                  (ASSERT)
                                                  (("2"
                                                    (EXPAND "verts_of")
                                                    (("2"
                                                      (EXPAND "fseq")
                                                      (("2"
                                                        (SPLIT -3)
                                                        (("1"
                                                          (INST?)
                                                          (("1"
                                                            (ASSERT)
                                                            NIL)))
                                                         ("2"
                                                          (INST?)
                                                          (("2"
                                                            (ASSERT)
                                                            NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 (|path_thru_each| "" (SKOSIMP*)
  (("" (CASE "separates(G!1, remove(v!1,W!1) , s!1, t!1)")
    (("1" (HIDE 1)
      (("1" (LEMMA "min_sep_set_card")
        (("1" (INST?)
          (("1" (ASSERT)
            (("1" (EXPAND "sep_num")
              (("1" (REPLACE -3)
                (("1" (HIDE -3)
                  (("1" (HIDE -2 -3 -5 -6 -7)
                    (("1" (REWRITE "card_remove")
                      (("1" (ASSERT) NIL)))))))))))))))))))
     ("2" (EXPAND "separates")
      (("2" (FLATTEN)
        (("2" (SPLIT 1)
          (("1" (EXPAND "remove")
            (("1" (EXPAND "member") (("1" (FLATTEN) (("1" (PROPAX) NIL)))))))
           ("2" (EXPAND "remove")
            (("2" (EXPAND "member") (("2" (FLATTEN) (("2" (PROPAX) NIL)))))))
           ("3" (SKOSIMP*)
            (("3" (CASE "verts_of(w!1)(v!1)")
              (("1" (HIDE 3)
                (("1" (LEMMA "walk_to_path_from")
                  (("1" (INST?)
                    (("1" (ASSERT)
                      (("1" (SKOSIMP*)
                        (("1" (INST 3 "p!1")
                          (("1" (LEMMA "path?_del_verts")
                            (("1" (INST?)
                              (("1" (INST?)
                                (("1" (EXPAND "path_from?")
                                  (("1" (FLATTEN)
                                    (("1" (ASSERT)
                                      (("1"
                                        (REVEAL 2)
                                        (("1"
                                          (INST 1 "p!1")
                                          (("1"
                                            (HIDE -1 -6 -7 -8 -10 2 3)
                                            (("1"
                                              (EXPAND "path?")
                                              (("1"
                                                (FLATTEN)
                                                (("1"
                                                  (HIDE -2)
                                                  (("1"
                                                    (LEMMA "v_not_in")
                                                    (("1"
                                                      (HIDE -5)
                                                      (("1"
                                                        (INST?)
                                                        (("1"
                                                          (INST?)
                                                          (("1"
                                                            (ASSERT)
                                                            (("1"
                                                              (HIDE 2 3)
                                                              (("1"
                                                                (EXPAND
                                                                 "walk_from?")
                                                                (("1"
                                                                  (EXPAND
                                                                   "from?")
                                                                  (("1"
                                                                    (PROPAX)
                                                                    NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))
               ("2" (HIDE 5)
                (("2" (INST + "w!1")
                  (("2" (HIDE -2 -3 -5 -6 2 3)
                    (("2" (LEMMA "v_not_in")
                      (("2" (INST?)
                        (("2" (ASSERT) NIL)))))))))))))))))))))))))
 (|one_to_each_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|one_to_each| "" (SKOSIMP*)
  (("" (LEMMA "path_thru_each")
    (("" (INST?)
      (("" (CASE "w1!1 = w2!1")
        (("1" (HIDE -2 1)
          (("1" (EXPAND "sep_num")
            (("1" (LEMMA "min_sep_set_card")
              (("1" (INST?)
                (("1" (ASSERT)
                  (("1" (REPLACE -3)
                    (("1" (HIDE -3)
                      (("1" (CASE-REPLACE "dbl(w1!1, w2!1) = singleton(w1!1)")
                        (("1" (REWRITE "card_singleton") (("1" (ASSERT) NIL)))
                         ("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
                          (("2" (HIDE -1 -3 -4 -5)
                            (("2" (EXPAND "dbl")
                              (("2" (EXPAND "singleton")
                                (("2" (IFF 1)
                                  (("2" (GROUND)
                                    NIL)))))))))))))))))))))))))))
         ("2" (CASE "card(dbl(w1!1,w2!1)) = 2")
          (("1" (SPLIT 2)
            (("1" (INST - "dbl(w1!1, w2!1)" "w1!1")
              (("1" (ASSERT)
                (("1" (EXPAND "dbl" -2)
                  (("1" (SKOSIMP*)
                    (("1" (EXPAND "verts_of")
                      (("1" (SKOSIMP*)
                        (("1" (EXPAND "fseq")
                          (("1" (INST + "pv!1^(0,i!1)")
                            (("1" (EXPAND "path_from?")
                              (("1" (EXPAND "from?")
                                (("1" (FLATTEN)
                                  (("1" (ASSERT)
                                    (("1" (SPLIT 1)
                                      (("1" (REWRITE "path?_caret") NIL)
                                       ("2" (EXPAND "^") (("2" (PROPAX) NIL)))
                                       ("3"
                                        (EXPAND "^")
                                        (("3" (PROPAX) NIL)))))))))))))
                             ("2" (EXPAND "^")
                              (("2" (ASSERT) NIL)))))))))))))))))
               ("2" (REWRITE "finite_dbl") NIL)))
             ("2" (INST - "dbl(w1!1, w2!1)" "w2!1")
              (("1" (ASSERT)
                (("1" (EXPAND "dbl" -2)
                  (("1" (SKOSIMP*)
                    (("1" (EXPAND "verts_of")
                      (("1" (SKOSIMP*)
                        (("1" (EXPAND "fseq")
                          (("1" (INST + "pv!1^(0,i!1)")
                            (("1" (EXPAND "path_from?")
                              (("1" (EXPAND "from?")
                                (("1" (FLATTEN)
                                  (("1" (ASSERT)
                                    (("1" (SPLIT 1)
                                      (("1" (REWRITE "path?_caret") NIL)
                                       ("2" (EXPAND "^") (("2" (PROPAX) NIL)))
                                       ("3"
                                        (EXPAND "^")
                                        (("3" (PROPAX) NIL)))))))))))))
                             ("2" (EXPAND "^")
                              (("2" (ASSERT) NIL)))))))))))))))))
               ("2" (REWRITE "finite_dbl") NIL)))))
           ("2" (HIDE -1 -2 -3 -4 -5 3) (("2" (REWRITE "card_dbl") NIL)))
           ("3" (REWRITE "finite_dbl") NIL)))))))))))
 (|walk?_del_verts| "" (SKOSIMP*)
  (("" (EXPAND "walk?")
    (("" (SPLIT +)
      (("1" (FLATTEN)
        (("1" (HIDE -2)
          (("1" (EXPAND "verts_in?")
            (("1" (SKOSIMP*)
              (("1" (INST?)
                (("1" (EXPAND "del_verts")
                  (("1" (EXPAND "difference")
                    (("1" (EXPAND "member")
                      (("1" (ASSERT) NIL)))))))))))))))))
       ("2" (SKOSIMP*)
        (("2" (INST?)
          (("2" (EXPAND "fseq")
            (("2" (ASSERT)
              (("2" (HIDE -2)
                (("2" (EXPAND "edge?")
                  (("2" (FLATTEN)
                    (("2" (ASSERT)
                      (("2" (EXPAND "del_verts")
                        (("2" (PROPAX) NIL)))))))))))))))))))))))))
 (|del_verts_eq_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|del_verts_eq| "" (SKOSIMP*)
  (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
    (("1" (APPLY-EXTENSIONALITY 1 :HIDE? T)
      (("1" (IFF 1)
        (("1" (EXPAND "del_vert")
          (("1" (EXPAND "del_verts")
            (("1" (GROUND)
              (("1" (SKOSIMP*) (("1" (EXPAND "dbl") (("1" (GROUND) NIL)))))
               ("2" (INST?) (("2" (EXPAND "dbl") (("2" (PROPAX) NIL)))))
               ("3" (INST?)
                (("3" (EXPAND "dbl") (("3" (PROPAX) NIL)))))))))))))))
     ("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
      (("2" (EXPAND "del_vert")
        (("2" (EXPAND "remove")
          (("2" (EXPAND "member")
            (("2" (IFF 1)
              (("2" (EXPAND "del_verts")
                (("2" (EXPAND "difference")
                  (("2" (EXPAND "member")
                    (("2" (EXPAND "dbl")
                      (("2" (GROUND) NIL))))))))))))))))))))))))
$$$meng_scaff_defs.pvs
meng_scaff_defs[T: TYPE]: THEORY
BEGIN
   IMPORTING paths[T], subgraphs[T], sep_sets[T],
             path_ops[T]
   G,HH: VAR graph[T]
   w1,w2,v,s,t,z: VAR T
   e: VAR doubleton[T]
   V: VAR finite_set[T]
   p: VAR prewalk
   IMPORTING ind_paths[T]
   path_verts(G,(x:T)): set[T] = {v: T | EXISTS (w: prewalk): walk_from?(G,w,x,v)}
   path_comp(G,(x:T)): Subgraph(G) = subgraph(G,path_verts(G,x))
   adjacent(G, (x:T)): finite_set[T] = {y: T| vert(G)(y) AND edge?(G)(x,y)}
   IMPORTING graph_deg[T]
   H(G,(x,w1,w2:T)): Subgraph(G) = path_comp(del_vert(del_vert(G,w1),w2),x)
   incident(v,G,(x,w1,w2:T)): finite_set[doubleton[T]]
              = {e: doubleton[T] | (EXISTS z: edges(G)(e) AND e = dbl(v,z)
                                              AND vert(H(G,x,w1,w2))(z))}
   meng(G,(x,y: (vert(G))),(w1,w2: {t | vert(G)(t) AND t /= y})): graph[T] =
                   (# vert  := add(y,add(w1,add(w2,vert(H(G,x,w1,w2))))),
                      edges := add(dbl(w1,y), add(dbl(w2,y),
                                 union(edges(H(G,x,w1,w2)),
                                       union(incident(w1,G,x,w1,w2),
                                             incident(w2,G,x,w1,w2)))))
                   #)
   in?(G,s,t,w1,w2): bool = vert(G)(s) AND vert(G)(t) AND vert(G)(w1)
                                AND vert(G)(w2)
   disjoint?(s,t,w1,w2): bool = (s /= t AND w1 /= w2 AND w1 /= s AND w2 /= s
                                     AND w1 /= t AND w2 /= t)
   vert_H_s: LEMMA vert(G)(s) AND s /= w1 AND s /= w2
                     IMPLIES vert(H(G, s, w1, w2))(s)
   path_H_W        : LEMMA path?(H(G,s,w1,w2),p) IMPLIES
                              NOT verts_of(p)(w1) AND NOT verts_of(p)(w2)
   walk?_subgraph  : LEMMA subgraph?(HH,G) AND walk?(HH, p)
                               IMPLIES walk?(G, p)
   path?_subgraph  : LEMMA subgraph?(HH,G) AND path?(HH, p)
                                  IMPLIES path?(G, p)
   path_comp_in    : LEMMA path?(H(G,s,w1,w2),p) IMPLIES path?(G,p)
   walk?_H         : LEMMA walk?(G, p) AND seq(p)(0) = s AND
                           NOT verts_of(p)(w1) AND NOT verts_of(p)(w2)
                         IMPLIES walk?(H(G, s, w1, w2), p)
   vert_meng_sub   : LEMMA in?(G, s, t, w1, w2) AND disjoint?(s, t, w1, w2)
                           IMPLIES subset?(vert(meng(G, s, t, w1, w2)), vert(G))
   del_vert_comm   : LEMMA del_vert(del_vert(G,w2),w1) =
                                    del_vert(del_vert(G,w1),w2)
   H_comm          : LEMMA H(G, t, w2, w1) = H(G, t, w1, w2)
   incident_comm   : LEMMA incident(v, G, t, w2, w1) = incident(v, G, t, w1, w2)
   meng_comm       : LEMMA vert(G)(s)  AND vert(G)(t) AND
                              vert(G)(w1) AND w1 /= s    AND
                              vert(G)(w2) AND w2 /= s
                            IMPLIES meng(G, t, s, w1, w2) = meng(G, t, s, w2, w1)
END meng_scaff_defs
$$$meng_scaff_defs.prf
(|meng_scaff_defs|
 (|adjacent_TCC1| "" (SKOSIMP*)
  (("" (LEMMA "finite_subset[T]")
    (("" (INST?)
      (("" (INST -1 "vert(G!1)")
        (("" (ASSERT) (("" (HIDE 2) (("" (GRIND) NIL)))))))))))))
 (H_TCC1 "" (SKOSIMP*)
  (("" (EXPAND "subgraph?")
    (("" (SPLIT 1)
      (("1" (EXPAND "subset?")
        (("1" (SKOSIMP*)
          (("1" (EXPAND "path_comp")
            (("1" (EXPAND "subgraph")
              (("1" (EXPAND "del_vert")
                (("1" (EXPAND "member")
                  (("1" (FLATTEN)
                    (("1" (HIDE -2)
                      (("1" (EXPAND "remove")
                        (("1" (EXPAND "member")
                          (("1" (FLATTEN)
                            (("1" (PROPAX) NIL)))))))))))))))))))))))
       ("2" (EXPAND "subset?")
        (("2" (SKOSIMP*)
          (("2" (EXPAND "member")
            (("2" (EXPAND "path_comp")
              (("2" (EXPAND "subgraph")
                (("2" (FLATTEN)
                  (("2" (HIDE -2)
                    (("2" (EXPAND "del_vert")
                      (("2" (FLATTEN)
                        (("2" (PROPAX) NIL)))))))))))))))))))))))))
 (|incident_TCC1| "" (SKOSIMP*)
  (("" (LEMMA "finite_subset[Dbl]")
    (("" (INST?)
      (("" (INST -1 "edges(G!1)")
        (("" (ASSERT)
          (("" (HIDE 2)
            (("" (EXPAND "subset?")
              (("" (SKOSIMP*)
                (("" (EXPAND "member") (("" (SKOSIMP*) NIL)))))))))))))))))))
 (|meng_TCC1| "" (SKOSIMP*) (("" (INST?) (("" (ASSERT) NIL)))))
 (|meng_TCC2| "" (SKOSIMP*) (("" (INST?) (("" (ASSERT) NIL)))))
 (|meng_TCC3| "" (SKOSIMP*)
  (("" (EXPAND "add")
    (("" (FLATTEN)
      (("" (EXPAND "member")
        (("" (FLATTEN)
          (("" (SPLIT -1)
            (("1" (REPLACE -1 * RL)
              (("1" (HIDE -1) (("1" (EXPAND "dbl") (("1" (GROUND) NIL)))))))
             ("2" (REPLACE -1 * RL)
              (("2" (HIDE -1) (("2" (EXPAND "dbl") (("2" (GROUND) NIL)))))))
             ("3" (EXPAND "union")
              (("3" (EXPAND "member")
                (("3" (SPLIT -1)
                  (("1" (TYPEPRED "H(G!1, x!1, w1!1, w2!1)")
                    (("1" (INST?)
                      (("1" (ASSERT) (("1" (INST?) (("1" (ASSERT) NIL)))))))))
                   ("2" (EXPAND "incident")
                    (("2" (SKOSIMP*)
                      (("2" (REPLACE -2)
                        (("2" (HIDE -2)
                          (("2" (EXPAND "dbl")
                            (("2" (SPLIT -)
                              (("1" (REPLACE -1) (("1" (PROPAX) NIL)))
                               ("2" (REPLACE -1)
                                (("2" (PROPAX) NIL)))))))))))))))
                   ("3" (EXPAND "incident")
                    (("3" (SKOSIMP*)
                      (("3" (REPLACE -2)
                        (("3" (HIDE -2)
                          (("3" (EXPAND "dbl" -3)
                            (("3" (SPLIT -3)
                              (("1" (REPLACE -1) (("1" (PROPAX) NIL)))
                               ("2" (ASSERT)
                                NIL)))))))))))))))))))))))))))))))
 (|vert_H_s| "" (SKOSIMP*)
  (("" (ASSERT)
    (("" (EXPAND "H")
      (("" (EXPAND "path_comp")
        (("" (EXPAND "subgraph")
          (("" (EXPAND "del_vert")
            (("" (EXPAND "remove")
              (("" (EXPAND "member")
                (("" (EXPAND "path_verts")
                  (("" (EXPAND "walk_from?")
                    (("" (INST + "gen_seq1(G!1,s!1)")
                      (("" (EXPAND "gen_seq1")
                        (("" (EXPAND "walk?")
                          (("" (EXPAND "verts_in?")
                            (("" (PROPAX) NIL)))))))))))))))))))))))))))))
 (|path_H_W| "" (SKOSIMP*)
  (("" (EXPAND "path?")
    (("" (FLATTEN)
      (("" (HIDE -2)
        (("" (EXPAND "walk?")
          (("" (FLATTEN)
            (("" (HIDE -2)
              (("" (EXPAND "verts_in?")
                (("" (EXPAND "H")
                  (("" (EXPAND "path_comp")
                    (("" (EXPAND "subgraph")
                      (("" (EXPAND "del_vert")
                        (("" (EXPAND "remove")
                          (("" (EXPAND "member")
                            (("" (EXPAND "verts_of")
                              (("" (EXPAND "fseq")
                                (("" (SPLIT 1)
                                  (("1" (SKOSIMP*)
                                    (("1" (INST?) (("1" (ASSERT) NIL)))))
                                   ("2" (ASSERT)
                                    (("2" (SKOSIMP*)
                                      (("2"
                                        (INST?)
                                        (("2"
                                          (ASSERT)
                                          NIL)))))))))))))))))))))))))))))))))))))))))
 (|walk?_subgraph| "" (SKOSIMP*)
  (("" (EXPAND "walk?")
    (("" (SPLIT 1)
      (("1" (FLATTEN)
        (("1" (EXPAND "verts_in?")
          (("1" (SKOSIMP*)
            (("1" (INST?)
              (("1" (EXPAND "subgraph?")
                (("1" (HIDE -3)
                  (("1" (EXPAND "subset?")
                    (("1" (FLATTEN)
                      (("1" (HIDE -2)
                        (("1" (EXPAND "member")
                          (("1" (INST?)
                            (("1" (ASSERT) NIL)))))))))))))))))))))))
       ("2" (FLATTEN)
        (("2" (SKOSIMP*)
          (("2" (HIDE -3)
            (("2" (INST?)
              (("2" (ASSERT)
                (("2" (EXPAND "subgraph?")
                  (("2" (EXPAND "subset?")
                    (("2" (FLATTEN)
                      (("2" (HIDE -2)
                        (("2" (EXPAND "member")
                          (("2" (EXPAND "edge?")
                            (("2" (EXPAND "fseq")
                              (("2" (FLATTEN)
                                (("2" (ASSERT)
                                  (("2" (INST?)
                                    (("1" (ASSERT) NIL)
                                     ("2" (INST?)
                                      (("2"
                                        (ASSERT)
                                        NIL)))))))))))))))))))))))))))))))))))))))
 (|path?_subgraph| "" (SKOSIMP*)
  (("" (EXPAND "path?")
    (("" (FLATTEN)
      (("" (SPLIT 1)
        (("1" (LEMMA "walk?_subgraph")
          (("1" (INST?) (("1" (INST?) (("1" (ASSERT) NIL)))))))
         ("2" (PROPAX) NIL)))))))))
 (|path_comp_in| "" (SKOSIMP*)
  (("" (EXPAND "path?")
    (("" (SPLIT 1)
      (("1" (FLATTEN)
        (("1" (TYPEPRED "H(G!1, s!1, w1!1, w2!1)")
          (("1" (HIDE -2 -4)
            (("1" (LEMMA "walk?_subgraph")
              (("1" (INST?) (("1" (INST?) (("1" (ASSERT) NIL)))))))))))))
       ("2" (FLATTEN) (("2" (PROPAX) NIL)))))))))
 (|walk?_H_TCC1| "" (SUBTYPE-TCC) NIL)
 (|walk?_H| "" (SKOSIMP*)
  (("" (EXPAND "H")
    (("" (EXPAND "path_comp")
      (("" (EXPAND "walk?")
        (("" (FLATTEN)
          (("" (SPLIT +)
            (("1" (HIDE -2)
              (("1" (EXPAND "verts_in?")
                (("1" (SKOSIMP*)
                  (("1" (INST?)
                    (("1" (EXPAND "subgraph")
                      (("1" (EXPAND "del_vert")
                        (("1" (EXPAND "remove")
                          (("1" (EXPAND "member")
                            (("1" (ASSERT)
                              (("1" (EXPAND "verts_of")
                                (("1" (INST?)
                                  (("1" (EXPAND "fseq")
                                    (("1" (INST?)
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (EXPAND "path_verts")
                                          (("1"
                                            (EXPAND "walk_from?")
                                            (("1"
                                              (INST 1 "p!1^(0,i!1)")
                                              (("1"
                                                (EXPAND "^")
                                                (("1"
                                                  (EXPAND "walk?")
                                                  (("1"
                                                    (SPLIT +)
                                                    (("1"
                                                      (EXPAND "verts_in?")
                                                      (("1"
                                                        (SKOSIMP*)
                                                        (("1"
                                                          (REVEAL -1)
                                                          (("1"
                                                            (INST?)
                                                            (("1"
                                                              (ASSERT)
                                                              (("1"
                                                                (REVEAL 2 3)
                                                                (("1"
                                                                  (EXPAND
                                                                   "fseq")
                                                                  (("1"
                                                                    (HIDE
                                                                     4
                                                                     5
                                                                     -2)
                                                                    (("1"
                                                                      (INST?)
                                                                      (("1"
                                                                        (INST?)
                                                                        (("1"
                                                                          (ASSERT)
                                                                          NIL)))))))))))))))))))))
                                                     ("2"
                                                      (EXPAND "fseq")
                                                      (("2"
                                                        (SKOSIMP*)
                                                        (("2"
                                                          (EXPAND "edge?")
                                                          (("2"
                                                            (HIDE -2 2 3)
                                                            (("2"
                                                              (REVEAL -3)
                                                              (("2"
                                                                (INST - "n!1")
                                                                (("2"
                                                                  (ASSERT)
                                                                  (("2"
                                                                    (EXPAND
                                                                     "fseq")
                                                                    (("2"
                                                                      (EXPAND
                                                                       "edge?")
                                                                      (("2"
                                                                        (FLATTEN)
                                                                        (("2"
                                                                          (ASSERT)
                                                                          (("2"
                                                                            (HIDE
                                                                             -1
                                                                             -3)
                                                                            (("2"
                                                                              (REVEAL
                                                                               4
                                                                               5)
                                                                              (("2"
                                                                                (EXPAND
                                                                                 "fseq")
                                                                                (("2"
                                                                                  (INST-CP
                                                                                   +
                                                                                   "n!1")
                                                                                  (("2"
                                                                                    (INST
                                                                                     +
                                                                                     "n!1+1")
                                                                                    (("2"
                                                                                      (INST-CP
                                                                                       +
                                                                                       "n!1")
                                                                                      (("2"
                                                                                        (INST
                                                                                         +
                                                                                         "n!1+1")
                                                                                        (("2"
                                                                                          (EXPAND
                                                                                           "dbl")
                                                                                          (("2"
                                                                                            (GROUND)
                                                                                            NIL)))))))))))))))))))))))))))))))))))))))))))))
                                               ("2"
                                                (EXPAND "^")
                                                (("2"
                                                  (ASSERT)
                                                  NIL)))))))))))))))))))))))))))))))))))))
             ("2" (SKOSIMP*)
              (("2" (EXPAND "fseq")
                (("2" (EXPAND "edge?")
                  (("2" (INST?)
                    (("2" (ASSERT)
                      (("2" (FLATTEN)
                        (("2" (ASSERT)
                          (("2" (EXPAND "subgraph")
                            (("2" (EXPAND "del_vert")
                              (("2" (SPLIT +)
                                (("1" (EXPAND "verts_of" 2)
                                  (("1" (INST-CP + "n!1")
                                    (("1" (INST + "n!1+1")
                                      (("1"
                                        (EXPAND "fseq")
                                        (("1"
                                          (EXPAND "dbl")
                                          (("1" (GROUND) NIL)))))))))))
                                 ("2" (EXPAND "verts_of" 3)
                                  (("2" (INST-CP + "n!1")
                                    (("2" (INST + "n!1+1")
                                      (("2"
                                        (EXPAND "fseq")
                                        (("2"
                                          (EXPAND "dbl")
                                          (("2" (GROUND) NIL)))))))))))
                                 ("3" (SKOSIMP*)
                                  (("3" (EXPAND "path_verts")
                                    (("3" (EXPAND "walk_from?")
                                      (("3"
                                        (EXPAND "dbl")
                                        (("3"
                                          (SPLIT -1)
                                          (("1"
                                            (INST 1 "p!1^(0,n!1)")
                                            (("1"
                                              (EXPAND "^")
                                              (("1"
                                                (ASSERT)
                                                (("1"
                                                  (EXPAND "walk?")
                                                  (("1"
                                                    (SPLIT +)
                                                    (("1"
                                                      (EXPAND "verts_in?")
                                                      (("1"
                                                        (SKOSIMP*)
                                                        (("1"
                                                          (EXPAND "remove")
                                                          (("1"
                                                            (EXPAND "member")
                                                            (("1"
                                                              (INST?)
                                                              (("1"
                                                                (ASSERT)
                                                                (("1"
                                                                  (EXPAND
                                                                   "verts_of")
                                                                  (("1"
                                                                    (INST
                                                                     +
                                                                     "i!1")
                                                                    (("1"
                                                                      (INST
                                                                       +
                                                                       "i!1")
                                                                      (("1"
                                                                        (EXPAND
                                                                         "fseq")
                                                                        (("1"
                                                                          (GROUND)
                                                                          NIL)))))))))))))))))))))
                                                     ("2"
                                                      (SKOSIMP*)
                                                      (("2"
                                                        (EXPAND "fseq")
                                                        (("2"
                                                          (EXPAND "edge?")
                                                          (("2"
                                                            (ASSERT)
                                                            (("2"
                                                              (REVEAL -1)
                                                              (("2"
                                                                (INST?)
                                                                (("2"
                                                                  (ASSERT)
                                                                  (("2"
                                                                    (FLATTEN)
                                                                    (("2"
                                                                      (ASSERT)
                                                                      (("2"
                                                                        (EXPAND
                                                                         "dbl")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "verts_of")
                                                                          (("2"
                                                                            (INST-CP
                                                                             +
                                                                             "n!2")
                                                                            (("2"
                                                                              (INST
                                                                               +
                                                                               "n!2+1")
                                                                              (("2"
                                                                                (INST-CP
                                                                                 +
                                                                                 "n!2")
                                                                                (("2"
                                                                                  (INST
                                                                                   +
                                                                                   "n!2+1")
                                                                                  (("2"
                                                                                    (EXPAND
                                                                                     "fseq")
                                                                                    (("2"
                                                                                      (GROUND)
                                                                                      NIL)))))))))))))))))))))))))))))))))))))))))
                                             ("2"
                                              (EXPAND "^")
                                              (("2" (ASSERT) NIL)))))
                                           ("2"
                                            (INST 1 "p!1^(0,n!1+1)")
                                            (("1"
                                              (EXPAND "^")
                                              (("1"
                                                (ASSERT)
                                                (("1"
                                                  (EXPAND "walk?")
                                                  (("1"
                                                    (SPLIT +)
                                                    (("1"
                                                      (EXPAND "verts_in?")
                                                      (("1"
                                                        (SKOSIMP*)
                                                        (("1"
                                                          (EXPAND "remove")
                                                          (("1"
                                                            (EXPAND "member")
                                                            (("1"
                                                              (INST?)
                                                              (("1"
                                                                (ASSERT)
                                                                (("1"
                                                                  (EXPAND
                                                                   "verts_of")
                                                                  (("1"
                                                                    (INST-CP
                                                                     +
                                                                     "i!1")
                                                                    (("1"
                                                                      (INST
                                                                       +
                                                                       "i!1+1")
                                                                      (("1"
                                                                        (INST-CP
                                                                         +
                                                                         "i!1")
                                                                        (("1"
                                                                          (INST
                                                                           +
                                                                           "i!1+1")
                                                                          (("1"
                                                                            (EXPAND
                                                                             "fseq")
                                                                            (("1"
                                                                              (ASSERT)
                                                                              NIL)))
                                                                           ("2"
                                                                            (ASSERT)
                                                                            (("2"
                                                                              (TYPEPRED
                                                                               "i!1")
                                                                              (("2"
                                                                                (EXPAND
                                                                                 "fseq")
                                                                                (("2"
                                                                                  (ASSERT)
                                                                                  NIL)))))))))))
                                                                       ("2"
                                                                        (EXPAND
                                                                         "fseq")
                                                                        (("2"
                                                                          (ASSERT)
                                                                          (("2"
                                                                            (TYPEPRED
                                                                             "i!1")
                                                                            (("2"
                                                                              (INST?)
                                                                              (("2"
                                                                                (ASSERT)
                                                                                NIL)))))))))))))))))))))))))))
                                                     ("2"
                                                      (SKOSIMP*)
                                                      (("2"
                                                        (EXPAND "edge?")
                                                        (("2"
                                                          (EXPAND "fseq")
                                                          (("2"
                                                            (REVEAL -1)
                                                            (("2"
                                                              (INST?)
                                                              (("2"
                                                                (ASSERT)
                                                                (("2"
                                                                  (FLATTEN)
                                                                  (("2"
                                                                    (ASSERT)
                                                                    (("2"
                                                                      (EXPAND
                                                                       "verts_of")
                                                                      (("2"
                                                                        (EXPAND
                                                                         "fseq")
                                                                        (("2"
                                                                          (INST-CP
                                                                           +
                                                                           "n!2")
                                                                          (("2"
                                                                            (INST
                                                                             +
                                                                             "n!2+1")
                                                                            (("2"
                                                                              (INST-CP
                                                                               +
                                                                               "n!2")
                                                                              (("2"
                                                                                (INST
                                                                                 +
                                                                                 "n!2+1")
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "dbl")
                                                                                  (("2"
                                                                                    (GROUND)
                                                                                    NIL)))))))))))))))))))))))))))))))))))))))
                                             ("2"
                                              (EXPAND "^")
                                              (("2"
                                                (ASSERT)
                                                NIL)))))))))))))))))))))))))))))))))))))))))))))))
 (|vert_meng_sub_TCC1| "" (SUBTYPE-TCC) NIL)
 (|vert_meng_sub_TCC2| "" (SUBTYPE-TCC) NIL)
 (|vert_meng_sub_TCC3| "" (SUBTYPE-TCC) NIL)
 (|vert_meng_sub_TCC4| "" (SUBTYPE-TCC) NIL)
 (|vert_meng_sub| "" (SKOSIMP*)
  (("" (EXPAND "subset?")
    (("" (EXPAND "member")
      (("" (SKOSIMP*)
        (("" (EXPAND "meng")
          (("" (EXPAND "add")
            (("" (EXPAND "member")
              (("" (ASSERT)
                (("" (EXPAND "H")
                  (("" (EXPAND "path_comp")
                    (("" (EXPAND "subgraph")
                      (("" (EXPAND "del_vert")
                        (("" (EXPAND "remove")
                          (("" (EXPAND "member")
                            (("" (EXPAND "in?")
                              (("" (FLATTEN)
                                (("" (EXPAND "disjoint?")
                                  (("" (FLATTEN)
                                    (("" (ASSERT)
                                      NIL)))))))))))))))))))))))))))))))))))))
 (|del_vert_comm| "" (SKOSIMP*)
  (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
    (("1" (APPLY-EXTENSIONALITY 1 :HIDE? T)
      (("1" (EXPAND "del_vert") (("1" (IFF 1) (("1" (GROUND) NIL)))))))
     ("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
      (("2" (EXPAND "del_vert")
        (("2" (EXPAND "remove")
          (("2" (EXPAND "member")
            (("2" (IFF 1) (("2" (GROUND) NIL)))))))))))))))
 (|H_comm| "" (SKOSIMP*)
  (("" (EXPAND "H")
    (("" (EXPAND "path_comp") (("" (REWRITE "del_vert_comm") NIL)))))))
 (|incident_comm| "" (SKOSIMP*)
  (("" (EXPAND "incident") (("" (REWRITE "H_comm") NIL)))))
 (|meng_comm_TCC1| "" (SUBTYPE-TCC) NIL)
 (|meng_comm_TCC2| "" (SUBTYPE-TCC) NIL)
 (|meng_comm_TCC3| "" (SUBTYPE-TCC) NIL)
 (|meng_comm_TCC4| "" (SUBTYPE-TCC) NIL)
 (|meng_comm| "" (SKOSIMP*)
  (("" (HIDE -1)
    (("" (EXPAND "meng")
      (("" (CASE-REPLACE "H(G!1, t!1, w2!1, w1!1) = H(G!1, t!1, w1!1, w2!1)")
        (("1" (SPLIT 3)
          (("1" (HIDE -1)
            (("1" (APPLY-EXTENSIONALITY 1 :HIDE? T)
              (("1" (EXPAND "add")
                (("1" (EXPAND "member")
                  (("1" (IFF) (("1" (GROUND) NIL)))))))))))
           ("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
            (("1" (EXPAND "union")
              (("1" (EXPAND "add")
                (("1" (EXPAND "member")
                  (("1" (IFF)
                    (("1" (LEMMA "incident_comm")
                      (("1" (INST?)
                        (("1" (LEMMA "incident_comm")
                          (("1" (INST -1 "G!1" "t!1" "w2!1" "w1!1" "w2!1")
                            (("1" (REPLACE -1)
                              (("1" (HIDE -1)
                                (("1" (REPLACE -1)
                                  (("1" (HIDE -1)
                                    (("1" (GROUND)
                                      NIL)))))))))))))))))))))))))
             ("2" (INST?) (("2" (ASSERT) NIL)))
             ("3" (INST?) (("3" (ASSERT) NIL)))))))
         ("2" (HIDE 4) (("2" (LEMMA "H_comm") (("2" (INST?) NIL))))))))))))))
$$$meng_scaff.pvs
meng_scaff[T: TYPE]: THEORY
BEGIN
   IMPORTING meng_scaff_defs[T], sep_set_lems[T], min_lem
   G,MM: VAR graph[T]
   v,s,t,w1,w2: VAR T
   W: VAR finite_set[T]
   p: VAR prewalk
   i: VAR nat
  P: VAR pred[T]
  ps_ptype(P): TYPE = {ps: prewalk | EXISTS (i: below(l(ps))): P(seq(ps)(i))}
  first(P: pred[T],ps: ps_ptype(P)): below(l(ps)) =
                  min({i: nat | i < l(ps) AND P(seq(ps)(i))})
  first_lem: LEMMA FORALL (ps: ps_ptype(P)): P(seq(ps)(first(P,ps)))
  first_not: LEMMA FORALL (ps: ps_ptype(P)): i < first(P,ps) IMPLIES
					   NOT  P(seq(ps)(i))
  z: VAR T
  meng_to_G_sep: LEMMA walk_from?(G, p, s, t) AND
                        in?(G, s, t, w1, w2) AND disjoint?(s, t, w1, w2) AND
                        separates(meng(G, s, t, w1, w2), singleton(z), s, t) AND
                        separable?(G, s, t) AND
                        separates(G, dbl(w1, w2), s, t) AND
                        NOT verts_of(p)(z)
                     IMPLIES sep_num(G, s, t) <= 1
  prep_14: LEMMA  vert(G)(s) AND vert(G)(t) AND
   	      	   vert(G)(w1) AND vert(G)(w2) AND
                   disjoint?(s, t, w1, w2) AND
                   sep_num(meng(G, s, t, w1, w2),s,t) <= 1 AND
                   separates(meng(G, s, t, w1, w2), dbl(w1, w2), s, t) AND
   	      	   separable?(G, s, t) AND
   	      	   separates(G, dbl(w1, w2), s, t) AND
                   sep_num(G, s, t) = 2
                  IMPLIES sep_num(G,s,t) <= 1
   line14: LEMMA separable?(G, s, t) AND
                   in?(G, s, t, w1, w2) AND
                   sep_num(G, s, t) = 2 AND
                   separates(G, dbl(w1, w2), s, t) AND
                   disjoint?(s, t, w1, w2)
                   IMPLIES
                        sep_num(meng(G, s, t, w1, w2), s, t) = 2
   line15ab: LEMMA  separable?(G,s,t) AND in?(G,s,t,w1,w2)
                    AND sep_num(G,s,t) = 2
                    AND separates(G, dbl(w1, w2), s, t)
              IMPLIES
                 ((EXISTS (Psw1: prewalk): path_from?(G,Psw1,s,w1)) AND
                  (EXISTS (Psw2: prewalk): path_from?(G,Psw2,s,w2)))
   prep_16: LEMMA separates(G, dbl(w1, w2), s, t) AND
                     disjoint?(s, t, w1, w2) AND
                     (FORALL p: path_from?(G,p,t,w1) IMPLIES verts_of(p)(w2))
                     AND vert(G)(s) AND vert(G)(t)
                     IMPLIES  sep_num(G,s,t) <= 1
   line16: LEMMA NOT edge?(G)(w1, t) AND
                        disjoint?(s,t,w1,w2) AND
                        separates(G, dbl(w1, w2), s, t) AND
                        sep_num(G,s,t) = 2 AND vert(G)(s) AND vert(G)(t)
                   IMPLIES EXISTS (yt: T): vert(H(G,t,w1,w2))(yt) AND yt /= t
   line19: LEMMA      separable?(G,s,t) AND in?(G,s,t,w1,w2)
                      AND disjoint?(s,t,w1,w2)
                      AND MM = meng(G, s, t, w1, w2)
                      AND separates(G, dbl(w1, w2), s, t)
                      AND path_from?(MM, p, s, t)
                          IMPLIES l(p) > 2 AND (  seq(p)(l(p)-2) = w1
                                               OR seq(p)(l(p)-2) = w2)
   yt: VAR T
   line17_prep: LEMMA vert(G)(s) AND vert(G)(t) AND disjoint?(s,t,w1,w2) AND
                      vert(H(G, t, w1, w2))(yt) AND
                      separates(G, dbl(w1, w2), s, t) IMPLIES
                          NOT vert(H(G, s, w1, w2))(yt)
   line17: LEMMA  vert(H(G,t,w1,w2))(yt) AND
                  in?(G, s, t, w1, w2) AND
                  disjoint?(s, t, w1, w2) AND
                  yt /= t AND
                  separates(G, dbl(w1, w2), s, t)
                       IMPLIES size(meng(G, s, t, w1, w2)) < size(G)
   pre20: LEMMA separable?(G, s, t) AND
                in?(G, s, t, w1, w2) AND
                sep_num(G, s, t) = 2 AND
                separates(G, dbl(w1, w2), s, t) AND
                disjoint?(s, t, w1, w2)
                IMPLIES
           	   ( separable?(meng(G, s, t, w1, w2),s,t) AND
                     sep_num(meng(G, s, t, w1, w2), s, t) = 2 AND
                     vert(meng(G, s, t, w1, w2))(s) AND
                     vert(meng(G, s, t, w1, w2))(t)                 )
END meng_scaff
$$$meng_scaff.prf
(|meng_scaff|
 (|first_TCC1| "" (SKOSIMP*)
  (("" (TYPEPRED "ps!1")
    (("" (EXPAND "nonempty?")
      (("" (SKOSIMP*)
        (("" (EXPAND "empty?")
          (("" (INST?) (("" (EXPAND "member") (("" (PROPAX) NIL)))))))))))))))
 (|first_TCC2| "" (SKOSIMP*)
  (("" (LEMMA "min_lem")
    (("" (INST?)
      (("1" (EXPAND "minimum?") (("1" (FLATTEN) (("1" (PROPAX) NIL)))))
       ("2" (HIDE 2)
        (("2" (EXPAND "nonempty?")
          (("2" (EXPAND "empty?")
            (("2" (EXPAND "member")
              (("2" (TYPEPRED "ps!1")
                (("2" (SKOSIMP*)
                  (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))))
 (|first_lem| "" (SKOSIMP*)
  (("" (EXPAND "first")
    (("" (LEMMA "min_lem")
      (("" (INST?)
        (("1" (EXPAND "minimum?") (("1" (FLATTEN) (("1" (PROPAX) NIL)))))
         ("2" (HIDE 2)
          (("2" (EXPAND "nonempty?")
            (("2" (TYPEPRED "ps!1")
              (("2" (SKOSIMP*)
                (("2" (EXPAND "empty?")
                  (("2" (INST?)
                    (("2" (EXPAND "member")
                      (("2" (PROPAX) NIL)))))))))))))))))))))))
 (|first_not_TCC1| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|first_not| "" (SKOSIMP*)
  (("" (EXPAND "first")
    (("" (LEMMA "min_lem")
      (("" (INST?)
        (("1" (EXPAND "minimum?")
          (("1" (FLATTEN)
            (("1" (ASSERT) (("1" (INST -3 "i!1") (("1" (ASSERT) NIL)))))))))
         ("2" (TYPEPRED "ps!1")
          (("2" (SKOSIMP*)
            (("2" (EXPAND "nonempty?")
              (("2" (EXPAND "empty?")
                (("2" (INST?)
                  (("2" (ASSERT)
                    (("2" (EXPAND "member")
                      (("2" (PROPAX) NIL)))))))))))))))))))))))
 (|meng_to_G_sep_TCC1| "" (SUBTYPE-TCC) NIL)
 (|meng_to_G_sep_TCC2| "" (SUBTYPE-TCC) NIL)
 (|meng_to_G_sep_TCC3| "" (SUBTYPE-TCC) NIL)
 (|meng_to_G_sep_TCC4| "" (SUBTYPE-TCC) NIL)
 (|meng_to_G_sep_TCC5| "" (SKOSIMP*) (("" (REWRITE "finite_singleton") NIL)))
 (|meng_to_G_sep_TCC6| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|meng_to_G_sep| "" (SKOSIMP*)
  (("" (EXPAND "separates")
    (("" (FLATTEN)
      (("" (EXPAND "dbl")
        (("" (EXPAND "singleton")
          (("" (FLATTEN)
            (("" (ASSERT)
              (("" (EXPAND "in?")
                (("" (EXPAND "disjoint?")
                  (("" (FLATTEN)
                    (("" (EXPAND "verts_of")
                      (("" (EXPAND "fseq")
                        ((""
                          (CASE "(EXISTS (i: below(l(p!1))): seq(p!1)(i) = w1!1 OR seq(p!1)(i) = w2!1)")
                          (("1" (SKOSIMP*)
                            (("1"
                              (NAME "ipf"
                                    "first((LAMBDA (x:T): x = w1!1 OR x = w2!1),p!1)")
                              (("1" (LEMMA "first_lem")
                                (("1" (INST?)
                                  (("1" (BETA -1)
                                    (("1" (LEMMA "first_not")
                                      (("1"
                                        (INST?)
                                        (("1"
                                          (REPLACE -3)
                                          (("1"
                                            (HIDE -3)
                                            (("1"
                                              (EXPAND "walk_from?")
                                              (("1"
                                                (FLATTEN)
                                                (("1"
                                                  (CASE
                                                   "walk?(G!1,p!1^(0,ipf))")
                                                  (("1"
                                                    (CASE
                                                     "NOT verts_of(p!1^(0,ipf))(t!1)")
                                                    (("1"
                                                      (HIDE 11 13)
                                                      (("1"
                                                        (CASE
                                                         "walk?(H(G!1,s!1,w1!1,w2!1),trunc1(p!1^(0,ipf)))")
                                                        (("1"
                                                          (CASE
                                                           "walk?(meng(G!1,s!1,t!1,w1!1,w2!1),p!1^(0,ipf))")
                                                          (("1"
                                                            (NAME-REPLACE
                                                             "Ms"
                                                             "meng(G!1, s!1, t!1, w1!1, w2!1)")
                                                            (("1"
                                                              (HIDE -2 -3 -9)
                                                              (("1"
                                                                (CASE
                                                                 "walk?(Ms,add1(p!1^(0,ipf),t!1))")
                                                                (("1"
                                                                  (CASE-REPLACE
                                                                   "del_verts(Ms, {y: T | y = z!1}) = del_vert(Ms,z!1)")
                                                                  (("1"
                                                                    (INST
                                                                     +
                                                                     "add1(p!1^(0,ipf),t!1)")
                                                                    (("1"
                                                                      (REWRITE
                                                                       "walk?_del_vert_not")
                                                                      (("1"
                                                                        (HIDE
                                                                         -1
                                                                         -2
                                                                         -3
                                                                         -4
                                                                         -5
                                                                         -6
                                                                         11)
                                                                        (("1"
                                                                          (EXPAND
                                                                           "add1")
                                                                          (("1"
                                                                            (EXPAND
                                                                             "^")
                                                                            (("1"
                                                                              (ASSERT)
                                                                              NIL)))))))
                                                                       ("2"
                                                                        (HIDE
                                                                         -2
                                                                         -3
                                                                         -4
                                                                         -5
                                                                         -6
                                                                         -7
                                                                         6
                                                                         11)
                                                                        (("2"
                                                                          (EXPAND
                                                                           "verts_of")
                                                                          (("2"
                                                                            (EXPAND
                                                                             "add1")
                                                                            (("2"
                                                                              (EXPAND
                                                                               "fseq")
                                                                              (("2"
                                                                                (SKOSIMP*)
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "^")
                                                                                  (("2"
                                                                                    (ASSERT)
                                                                                    (("2"
                                                                                      (INST?)
                                                                                      (("2"
                                                                                        (LIFT-IF)
                                                                                        (("2"
                                                                                          (GROUND)
                                                                                          (("2"
                                                                                            (EXPAND
                                                                                             "^")
                                                                                            (("2"
                                                                                              (REVEAL
                                                                                               3)
                                                                                              (("2"
                                                                                                (INST?)
                                                                                                NIL)))))))))))))))))))))))))))
                                                                     ("2"
                                                                      (EXPAND
                                                                       "^"
                                                                       1)
                                                                      (("2"
                                                                        (ASSERT)
                                                                        NIL)))))
                                                                   ("2"
                                                                    (HIDE
                                                                     -1
                                                                     -2
                                                                     -3
                                                                     -4
                                                                     -5
                                                                     -6
                                                                     -7
                                                                     -8
                                                                     2
                                                                     5)
                                                                    (("2"
                                                                      (APPLY-EXTENSIONALITY
                                                                       1
                                                                       :HIDE?
                                                                       T)
                                                                      (("1"
                                                                        (APPLY-EXTENSIONALITY
                                                                         1
                                                                         :HIDE?
                                                                         T)
                                                                        (("1"
                                                                          (IFF
                                                                           1)
                                                                          (("1"
                                                                            (EXPAND
                                                                             "del_verts")
                                                                            (("1"
                                                                              (EXPAND
                                                                               "del_vert")
                                                                              (("1"
                                                                                (GROUND)
                                                                                (("1"
                                                                                  (INST?)
                                                                                  (("1"
                                                                                    (ASSERT)
                                                                                    NIL)))
                                                                                 ("2"
                                                                                  (SKOSIMP*)
                                                                                  (("2"
                                                                                    (ASSERT)
                                                                                    NIL)))))))))))
                                                                         ("2"
                                                                          (LEMMA
                                                                           "finite_singleton[T]")
                                                                          (("2"
                                                                            (INST?)
                                                                            (("2"
                                                                              (EXPAND
                                                                               "singleton")
                                                                              (("2"
                                                                                (PROPAX)
                                                                                NIL)))))))))
                                                                       ("2"
                                                                        (EXPAND
                                                                         "del_vert")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "del_verts")
                                                                          (("2"
                                                                            (APPLY-EXTENSIONALITY
                                                                             1
                                                                             :HIDE?
                                                                             T)
                                                                            (("2"
                                                                              (IFF
                                                                               1)
                                                                              (("2"
                                                                                (EXPAND
                                                                                 "difference")
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "member")
                                                                                  (("2"
                                                                                    (EXPAND
                                                                                     "remove")
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "member")
                                                                                      (("2"
                                                                                        (GROUND)
                                                                                        NIL)))))))))))))))))
                                                                       ("3"
                                                                        (LEMMA
                                                                         "finite_singleton[T]")
                                                                        (("3"
                                                                          (EXPAND
                                                                           "singleton")
                                                                          (("3"
                                                                            (INST?)
                                                                            NIL)))))))))
                                                                   ("3"
                                                                    (LEMMA
                                                                     "finite_singleton[T]")
                                                                    (("3"
                                                                      (EXPAND
                                                                       "singleton")
                                                                      (("3"
                                                                        (INST?)
                                                                        NIL)))))))
                                                                 ("2"
                                                                  (HIDE
                                                                   -2
                                                                   -3
                                                                   -4
                                                                   -5
                                                                   -6
                                                                   5
                                                                   6
                                                                   7
                                                                   12)
                                                                  (("2"
                                                                    (LEMMA
                                                                     "walk?_add1")
                                                                    (("2"
                                                                      (INST?)
                                                                      (("1"
                                                                        (ASSERT)
                                                                        (("1"
                                                                          (HIDE
                                                                           -1
                                                                           2)
                                                                          (("1"
                                                                            (REVEAL
                                                                             -11)
                                                                            (("1"
                                                                              (REPLACE
                                                                               -1
                                                                               *
                                                                               RL)
                                                                              (("1"
                                                                                (HIDE
                                                                                 -1)
                                                                                (("1"
                                                                                  (SPLIT
                                                                                   +)
                                                                                  (("1"
                                                                                    (EXPAND
                                                                                     "meng")
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "add")
                                                                                      (("1"
                                                                                        (PROPAX)
                                                                                        NIL)))))
                                                                                   ("2"
                                                                                    (EXPAND
                                                                                     "edge?")
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "^")
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "verts_of")
                                                                                        (("2"
                                                                                          (EXPAND
                                                                                           "fseq")
                                                                                          (("2"
                                                                                            (INST?)
                                                                                            (("2"
                                                                                              (ASSERT)
                                                                                              (("2"
                                                                                                (REVEAL
                                                                                                 -4)
                                                                                                (("2"
                                                                                                  (EXPAND
                                                                                                   "meng")
                                                                                                  (("2"
                                                                                                    (EXPAND
                                                                                                     "union")
                                                                                                    (("2"
                                                                                                      (EXPAND
                                                                                                       "add")
                                                                                                      (("2"
                                                                                                        (EXPAND
                                                                                                         "member")
                                                                                                        (("2"
                                                                                                          (FLATTEN)
                                                                                                          (("2"
                                                                                                            (GROUND)
                                                                                                            NIL)))))))))))))))))))))))))))))))))))))
                                                                       ("2"
                                                                        (EXPAND
                                                                         "^"
                                                                         1)
                                                                        (("2"
                                                                          (ASSERT)
                                                                          NIL)))))))))))))))
                                                           ("2"
                                                            (HIDE -3 -5 7 12)
                                                            (("2"
                                                              (EXPAND "walk?")
                                                              (("2"
                                                                (FLATTEN)
                                                                (("2"
                                                                  (SPLIT +)
                                                                  (("1"
                                                                    (EXPAND
                                                                     "verts_in?")
                                                                    (("1"
                                                                      (SKOSIMP*)
                                                                      (("1"
                                                                        (TYPEPRED
                                                                         "i!2")
                                                                        (("1"
                                                                          (EXPAND
                                                                           "^"
                                                                           -1)
                                                                          (("1"
                                                                            (ASSERT)
                                                                            (("1"
                                                                              (CASE
                                                                               "i!2 = ipf")
                                                                              (("1"
                                                                                (HIDE
                                                                                 -2
                                                                                 -3
                                                                                 -4
                                                                                 -6
                                                                                 -11)
                                                                                (("1"
                                                                                  (REPLACE
                                                                                   -1)
                                                                                  (("1"
                                                                                    (HIDE
                                                                                     -1)
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "meng")
                                                                                      (("1"
                                                                                        (EXPAND
                                                                                         "^")
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "verts_of")
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "fseq")
                                                                                            (("1"
                                                                                              (EXPAND
                                                                                               "add")
                                                                                              (("1"
                                                                                                (EXPAND
                                                                                                 "member")
                                                                                                (("1"
                                                                                                  (HIDE
                                                                                                   -1)
                                                                                                  (("1"
                                                                                                    (INST?
                                                                                                     -)
                                                                                                    (("1"
                                                                                                      (GROUND)
                                                                                                      NIL)))))))))))))))))))))))
                                                                               ("2"
                                                                                (HIDE
                                                                                 -3
                                                                                 -4
                                                                                 -5
                                                                                 -9
                                                                                 -10)
                                                                                (("2"
                                                                                  (INST?)
                                                                                  (("1"
                                                                                    (EXPAND
                                                                                     "meng")
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "trunc1")
                                                                                      (("1"
                                                                                        (EXPAND
                                                                                         "^")
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "add")
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "member")
                                                                                            (("1"
                                                                                              (FLATTEN)
                                                                                              (("1"
                                                                                                (ASSERT)
                                                                                                NIL)))))))))))))
                                                                                   ("2"
                                                                                    (EXPAND
                                                                                     "trunc1"
                                                                                     1)
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "^"
                                                                                       1)
                                                                                      (("2"
                                                                                        (ASSERT)
                                                                                        NIL)))))))))))))))))))))
                                                                   ("2"
                                                                    (SKOSIMP*)
                                                                    (("2"
                                                                      (EXPAND
                                                                       "fseq")
                                                                      (("2"
                                                                        (EXPAND
                                                                         "^"
                                                                         -1)
                                                                        (("2"
                                                                          (ASSERT)
                                                                          (("2"
                                                                            (CASE
                                                                             "n!1 = ipf - 1")
                                                                            (("1"
                                                                              (HIDE
                                                                               -3
                                                                               -4)
                                                                              (("1"
                                                                                (INST?)
                                                                                (("1"
                                                                                  (EXPAND
                                                                                   "verts_in?")
                                                                                  (("1"
                                                                                    (HIDE
                                                                                     2)
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "edge?")
                                                                                      (("1"
                                                                                        (EXPAND
                                                                                         "^")
                                                                                        (("1"
                                                                                          (INST?)
                                                                                          (("1"
                                                                                            (FLATTEN)
                                                                                            (("1"
                                                                                              (ASSERT)
                                                                                              (("1"
                                                                                                (EXPAND
                                                                                                 "meng")
                                                                                                (("1"
                                                                                                  (EXPAND
                                                                                                   "union")
                                                                                                  (("1"
                                                                                                    (EXPAND
                                                                                                     "add")
                                                                                                    (("1"
                                                                                                      (EXPAND
                                                                                                       "member")
                                                                                                      (("1"
                                                                                                        (FLATTEN)
                                                                                                        (("1"
                                                                                                          (REPLACE
                                                                                                           -1)
                                                                                                          (("1"
                                                                                                            (HIDE
                                                                                                             -1)
                                                                                                            (("1"
                                                                                                              (ASSERT)
                                                                                                              (("1"
                                                                                                                (EXPAND
                                                                                                                 "incident")
                                                                                                                (("1"
                                                                                                                  (INST
                                                                                                                   +
                                                                                                                   "seq(p!1)(ipf-1)")
                                                                                                                  (("1"
                                                                                                                    (INST
                                                                                                                     +
                                                                                                                     "seq(p!1)(ipf-1)")
                                                                                                                    (("1"
                                                                                                                      (HIDE
                                                                                                                       1
                                                                                                                       2
                                                                                                                       3)
                                                                                                                      (("1"
                                                                                                                        (REVEAL
                                                                                                                         -4)
                                                                                                                        (("1"
                                                                                                                          (EXPAND
                                                                                                                           "verts_in?")
                                                                                                                          (("1"
                                                                                                                            (INST
                                                                                                                             -1
                                                                                                                             "ipf-1")
                                                                                                                            (("1"
                                                                                                                              (EXPAND
                                                                                                                               "trunc1"
                                                                                                                               -1)
                                                                                                                              (("1"
                                                                                                                                (EXPAND
                                                                                                                                 "^"
                                                                                                                                 -1)
                                                                                                                                (("1"
                                                                                                                                  (REWRITE
                                                                                                                                   "dbl_comm"
                                                                                                                                   1)
                                                                                                                                  (("1"
                                                                                                                                    (SPLIT
                                                                                                                                     -5)
                                                                                                                                    (("1"
                                                                                                                                      (REPLACE
                                                                                                                                       -1)
                                                                                                                                      (("1"
                                                                                                                                        (HIDE
                                                                                                                                         -1)
                                                                                                                                        (("1"
                                                                                                                                          (ASSERT)
                                                                                                                                          NIL)))))
                                                                                                                                     ("2"
                                                                                                                                      (REPLACE
                                                                                                                                       -1)
                                                                                                                                      (("2"
                                                                                                                                        (HIDE
                                                                                                                                         -1)
                                                                                                                                        (("2"
                                                                                                                                          (ASSERT)
                                                                                                                                          NIL)))))))))))))
                                                                                                                             ("2"
                                                                                                                              (EXPAND
                                                                                                                               "trunc1"
                                                                                                                               1)
                                                                                                                              (("2"
                                                                                                                                (EXPAND
                                                                                                                                 "^"
                                                                                                                                 1)
                                                                                                                                (("2"
                                                                                                                                  (PROPAX)
                                                                                                                                  NIL)))))))))))))))))))))))))))))))))))))))
                                                                                           ("2"
                                                                                            (EXPAND
                                                                                             "^"
                                                                                             1)
                                                                                            (("2"
                                                                                              (ASSERT)
                                                                                              NIL)))))))))))))))))
                                                                             ("2"
                                                                              (HIDE
                                                                               -4
                                                                               -5
                                                                               -9
                                                                               -10)
                                                                              (("2"
                                                                                (EXPAND
                                                                                 "edge?")
                                                                                (("2"
                                                                                  (INST
                                                                                   -
                                                                                   "n!1")
                                                                                  (("2"
                                                                                    (HIDE
                                                                                     -2
                                                                                     3)
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "trunc1")
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "^")
                                                                                        (("2"
                                                                                          (ASSERT)
                                                                                          (("2"
                                                                                            (FLATTEN)
                                                                                            (("2"
                                                                                              (ASSERT)
                                                                                              (("2"
                                                                                                (EXPAND
                                                                                                 "meng")
                                                                                                (("2"
                                                                                                  (EXPAND
                                                                                                   "union")
                                                                                                  (("2"
                                                                                                    (EXPAND
                                                                                                     "add")
                                                                                                    (("2"
                                                                                                      (EXPAND
                                                                                                       "member")
                                                                                                      (("2"
                                                                                                        (PROPAX)
                                                                                                        NIL)))))))))))))))))))))))))))))))))))))))))))))
                                                           ("3" (PROPAX) NIL)
                                                           ("4" (PROPAX) NIL)
                                                           ("5" (PROPAX) NIL)
                                                           ("6"
                                                            (PROPAX)
                                                            NIL)))
                                                         ("2"
                                                          (LEMMA "walk?_H")
                                                          (("2"
                                                            (INST?)
                                                            (("1"
                                                              (ASSERT)
                                                              (("1"
                                                                (HIDE 2)
                                                                (("1"
                                                                  (CASE
                                                                   "walk?(G!1, trunc1(p!1 ^ (0, ipf)))")
                                                                  (("1"
                                                                    (ASSERT)
                                                                    (("1"
                                                                      (HIDE
                                                                       -1
                                                                       -2
                                                                       7
                                                                       12)
                                                                      (("1"
                                                                        (EXPAND
                                                                         "trunc1")
                                                                        (("1"
                                                                          (EXPAND
                                                                           "^")
                                                                          (("1"
                                                                            (EXPAND
                                                                             "verts_of")
                                                                            (("1"
                                                                              (EXPAND
                                                                               "fseq")
                                                                              (("1"
                                                                                (SPLIT
                                                                                 +)
                                                                                (("1"
                                                                                  (ASSERT)
                                                                                  (("1"
                                                                                    (LIFT-IF)
                                                                                    (("1"
                                                                                      (ASSERT)
                                                                                      (("1"
                                                                                        (GROUND)
                                                                                        NIL)))))))
                                                                                 ("2"
                                                                                  (FLATTEN)
                                                                                  (("2"
                                                                                    (ASSERT)
                                                                                    (("2"
                                                                                      (CASE-REPLACE
                                                                                       "ipf = 0")
                                                                                      (("1"
                                                                                        (SPLIT
                                                                                         -4)
                                                                                        (("1"
                                                                                          (ASSERT)
                                                                                          NIL)
                                                                                         ("2"
                                                                                          (ASSERT)
                                                                                          NIL)))
                                                                                       ("2"
                                                                                        (ASSERT)
                                                                                        NIL)))))))
                                                                                 ("3"
                                                                                  (FLATTEN)
                                                                                  (("3"
                                                                                    (SKOSIMP*)
                                                                                    (("3"
                                                                                      (INST
                                                                                       -
                                                                                       "i!2")
                                                                                      (("3"
                                                                                        (ASSERT)
                                                                                        NIL)))))))
                                                                                 ("4"
                                                                                  (FLATTEN)
                                                                                  (("4"
                                                                                    (SKOSIMP*)
                                                                                    (("4"
                                                                                      (INST
                                                                                       -
                                                                                       "i!2")
                                                                                      (("4"
                                                                                        (ASSERT)
                                                                                        NIL)))))))
                                                                                 ("5"
                                                                                  (FLATTEN)
                                                                                  (("5"
                                                                                    (SKOSIMP*)
                                                                                    (("5"
                                                                                      (INST
                                                                                       -
                                                                                       "i!2")
                                                                                      (("5"
                                                                                        (ASSERT)
                                                                                        NIL)))))))))))))))))))))
                                                                   ("2"
                                                                    (HIDE 2)
                                                                    (("2"
                                                                      (HIDE
                                                                       -2
                                                                       2
                                                                       7
                                                                       12)
                                                                      (("2"
                                                                        (EXPAND
                                                                         "trunc1")
                                                                        (("2"
                                                                          (REWRITE
                                                                           "walk?_caret")
                                                                          (("1"
                                                                            (EXPAND
                                                                             "^"
                                                                             1)
                                                                            (("1"
                                                                              (ASSERT)
                                                                              NIL)))
                                                                           ("2"
                                                                            (EXPAND
                                                                             "^"
                                                                             1)
                                                                            (("2"
                                                                              (ASSERT)
                                                                              NIL)))))))))))))))))
                                                             ("2"
                                                              (EXPAND "^" 1)
                                                              (("2"
                                                                (ASSERT)
                                                                NIL)))))))
                                                         ("3"
                                                          (EXPAND "^" 1)
                                                          (("3"
                                                            (ASSERT)
                                                            NIL)))))))
                                                     ("2"
                                                      (HIDE 3 4 5 11)
                                                      (("2"
                                                        (ASSERT)
                                                        (("2"
                                                          (EXPAND "verts_of")
                                                          (("2"
                                                            (SKOSIMP*)
                                                            (("2"
                                                              (EXPAND "fseq")
                                                              (("2"
                                                                (EXPAND
                                                                 "^"
                                                                 -1)
                                                                (("2"
                                                                  (INST
                                                                   +
                                                                   "p!1^(0,i!2)")
                                                                  (("1"
                                                                    (EXPAND
                                                                     "^"
                                                                     7)
                                                                    (("1"
                                                                      (ASSERT)
                                                                      (("1"
                                                                        (EXPAND
                                                                         "walk?")
                                                                        (("1"
                                                                          (FLATTEN)
                                                                          (("1"
                                                                            (SPLIT
                                                                             +)
                                                                            (("1"
                                                                              (EXPAND
                                                                               "verts_in?")
                                                                              (("1"
                                                                                (SKOSIMP*)
                                                                                (("1"
                                                                                  (EXPAND
                                                                                   "del_verts")
                                                                                  (("1"
                                                                                    (EXPAND
                                                                                     "difference")
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "member")
                                                                                      (("1"
                                                                                        (TYPEPRED
                                                                                         "i!3")
                                                                                        (("1"
                                                                                          (TYPEPRED
                                                                                           "i!2")
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "^"
                                                                                             -1)
                                                                                            (("1"
                                                                                              (ASSERT)
                                                                                              (("1"
                                                                                                (INST
                                                                                                 -11
                                                                                                 "i!3")
                                                                                                (("1"
                                                                                                  (ASSERT)
                                                                                                  (("1"
                                                                                                    (CASE
                                                                                                     "i!3 = ipf")
                                                                                                    (("1"
                                                                                                      (ASSERT)
                                                                                                      NIL)
                                                                                                     ("2"
                                                                                                      (INST
                                                                                                       -7
                                                                                                       "i!3")
                                                                                                      (("2"
                                                                                                        (ASSERT)
                                                                                                        NIL)))))))))))))))))))))))))))
                                                                             ("2"
                                                                              (SKOSIMP*)
                                                                              (("2"
                                                                                (EXPAND
                                                                                 "fseq")
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "edge?")
                                                                                  (("2"
                                                                                    (INST
                                                                                     -
                                                                                     "n!1")
                                                                                    (("2"
                                                                                      (HIDE
                                                                                       -3)
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "^")
                                                                                        (("2"
                                                                                          (CASE
                                                                                           "n!1 = ipf")
                                                                                          (("1"
                                                                                            (REPLACE
                                                                                             -1)
                                                                                            (("1"
                                                                                              (HIDE
                                                                                               -1)
                                                                                              (("1"
                                                                                                (HIDE
                                                                                                 -3)
                                                                                                (("1"
                                                                                                  (INST
                                                                                                   -9
                                                                                                   "ipf")
                                                                                                  (("1"
                                                                                                    (TYPEPRED
                                                                                                     "i!2")
                                                                                                    (("1"
                                                                                                      (EXPAND
                                                                                                       "^")
                                                                                                      (("1"
                                                                                                        (ASSERT)
                                                                                                        NIL)))))))))))))
                                                                                           ("2"
                                                                                            (ASSERT)
                                                                                            (("2"
                                                                                              (TYPEPRED
                                                                                               "i!2")
                                                                                              (("2"
                                                                                                (EXPAND
                                                                                                 "^"
                                                                                                 -1)
                                                                                                (("2"
                                                                                                  (ASSERT)
                                                                                                  (("2"
                                                                                                    (FLATTEN)
                                                                                                    (("2"
                                                                                                      (ASSERT)
                                                                                                      (("2"
                                                                                                        (EXPAND
                                                                                                         "del_verts")
                                                                                                        (("2"
                                                                                                          (SKOSIMP*)
                                                                                                          (("2"
                                                                                                            (HIDE
                                                                                                             -12
                                                                                                             -13
                                                                                                             -18
                                                                                                             9)
                                                                                                            (("2"
                                                                                                              (INST-CP
                                                                                                               -7
                                                                                                               "n!1")
                                                                                                              (("2"
                                                                                                                (INST
                                                                                                                 -7
                                                                                                                 "n!1+1")
                                                                                                                (("2"
                                                                                                                  (ASSERT)
                                                                                                                  (("2"
                                                                                                                    (CASE
                                                                                                                     "n!1 = ipf -1")
                                                                                                                    (("1"
                                                                                                                      (ASSERT)
                                                                                                                      NIL)
                                                                                                                     ("2"
                                                                                                                      (ASSERT)
                                                                                                                      (("2"
                                                                                                                        (EXPAND
                                                                                                                         "dbl")
                                                                                                                        (("2"
                                                                                                                          (GROUND)
                                                                                                                          NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))
                                                                   ("2"
                                                                    (EXPAND
                                                                     "^"
                                                                     1)
                                                                    (("2"
                                                                      (ASSERT)
                                                                      NIL)))
                                                                   ("3"
                                                                    (TYPEPRED
                                                                     "i!2")
                                                                    (("3"
                                                                      (EXPAND
                                                                       "^"
                                                                       -1)
                                                                      (("3"
                                                                        (ASSERT)
                                                                        NIL)))))))))))))))))))))
                                                   ("2"
                                                    (REWRITE "walk?_caret")
                                                    NIL)
                                                   ("3"
                                                    (EXPAND "^" 1)
                                                    (("3"
                                                      (ASSERT)
                                                      (("3"
                                                        (LIFT-IF)
                                                        (("3"
                                                          (GROUND)
                                                          NIL)))))))))))))))))
                                         ("2"
                                          (HIDE -1 -2)
                                          (("2" (INST?) NIL)))))))))
                                   ("2" (HIDE -1) (("2" (INST?) NIL)))))))
                               ("2" (INST?) NIL)))))
                           ("2" (INST 11 "p!1")
                            (("2" (HIDE 6 12)
                              (("2" (EXPAND "walk_from?")
                                (("2" (FLATTEN)
                                  (("2" (ASSERT)
                                    (("2" (EXPAND "walk?")
                                      (("2"
                                        (SPLIT +)
                                        (("1"
                                          (FLATTEN)
                                          (("1"
                                            (EXPAND "verts_in?")
                                            (("1"
                                              (EXPAND "del_verts")
                                              (("1"
                                                (EXPAND "difference")
                                                (("1"
                                                  (EXPAND "member")
                                                  (("1"
                                                    (SKOSIMP*)
                                                    (("1"
                                                      (INST? -)
                                                      (("1"
                                                        (ASSERT)
                                                        (("1"
                                                          (INST?)
                                                          NIL)))))))))))))))))
                                         ("2"
                                          (SKOSIMP*)
                                          (("2"
                                            (EXPAND "edge?")
                                            (("2"
                                              (EXPAND "fseq")
                                              (("2"
                                                (INST?)
                                                (("1"
                                                  (INST? -)
                                                  (("1"
                                                    (ASSERT)
                                                    (("1"
                                                      (FLATTEN)
                                                      (("1"
                                                        (ASSERT)
                                                        (("1"
                                                          (EXPAND "del_verts")
                                                          (("1"
                                                            (SKOSIMP*)
                                                            (("1"
                                                              (EXPAND "dbl")
                                                              (("1"
                                                                (GROUND)
                                                                (("1"
                                                                  (REVEAL 1)
                                                                  (("1"
                                                                    (INST
                                                                     1
                                                                     "n!1+1")
                                                                    (("1"
                                                                      (ASSERT)
                                                                      NIL)))))
                                                                 ("2"
                                                                  (REVEAL 1)
                                                                  (("2"
                                                                    (INST
                                                                     1
                                                                     "n!1+1")
                                                                    (("2"
                                                                      (ASSERT)
                                                                      NIL)))))))))))))))))))))
                                                 ("2"
                                                  (ASSERT)
                                                  NIL)))))))))))))))))))))))))))))))))))))))))))))))))
 (|prep_14_TCC1| "" (SUBTYPE-TCC) NIL) (|prep_14_TCC2| "" (SUBTYPE-TCC) NIL)
 (|prep_14_TCC3| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|prep_14| "" (SKOSIMP*)
  (("" (LEMMA "sep_num_le1")
    (("" (INST -1 "meng(G!1, s!1, t!1, w1!1, w2!1)" "w1!1" "s!1" "t!1")
      (("1" (ASSERT)
        (("1" (SPLIT -1)
          (("1" (SKOSIMP*)
            (("1" (HIDE 1 2)
              (("1" (HIDE -7 -8)
                (("1" (LEMMA "sep_num_is_1")
                  (("1" (INST?)
                    (("1" (INST -1 "z!1")
                      (("1" (ASSERT)
                        (("1" (SPLIT 1)
                          (("1" (EXPAND "separates")
                            (("1" (FLATTEN)
                              (("1" (EXPAND "singleton")
                                (("1" (ASSERT) NIL)))))))
                           ("2" (EXPAND "separates")
                            (("2" (FLATTEN)
                              (("2" (ASSERT)
                                (("2" (EXPAND "singleton")
                                  (("2" (ASSERT) NIL)))))))))
                           ("3" (SKOSIMP*)
                            (("3" (LEMMA "meng_to_G_sep")
                              (("3" (INST?)
                                (("3" (INST?)
                                  (("3" (ASSERT)
                                    (("3" (EXPAND "in?")
                                      (("3"
                                        (EXPAND "verts_of")
                                        (("3"
                                          (SKOSIMP*)
                                          (("3"
                                            (EXPAND "fseq")
                                            (("3"
                                              (INST?)
                                              NIL)))))))))))))))))))))))))))))))))))
           ("2" (HIDE -6 -7 -8 -9 -10)
            (("2" (EXPAND "meng")
              (("2" (EXPAND "add")
                (("2" (EXPAND "member")
                  (("2" (EXPAND "disjoint?")
                    (("2" (FLATTEN)
                      (("2" (LEMMA "vert_H_s")
                        (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))
           ("3" (HIDE -6 -7 -8 -9 -10)
            (("3" (EXPAND "meng")
              (("3" (EXPAND "add") (("3" (PROPAX) NIL)))))))
           ("4" (HIDE -6 -7 -8 -9 -10)
            (("4" (EXPAND "meng")
              (("4" (EXPAND "add")
                (("4" (FLATTEN)
                  (("4" (EXPAND "member") (("4" (PROPAX) NIL)))))))))))
           ("5" (EXPAND "disjoint?") (("5" (FLATTEN) (("5" (PROPAX) NIL)))))
           ("6" (EXPAND "disjoint?") (("6" (FLATTEN) (("6" (PROPAX) NIL)))))
           ("7" (ASSERT)
            (("7" (HIDE -6 -7 -10 2)
              (("7" (EXPAND "separable?")
                (("7" (FLATTEN)
                  (("7" (ASSERT)
                    (("7" (EXPAND "meng")
                      (("7" (EXPAND "edge?")
                        (("7" (EXPAND "add")
                          (("7" (EXPAND "union")
                            (("7" (EXPAND "member")
                              (("7" (EXPAND "disjoint?")
                                (("7" (FLATTEN)
                                  (("7" (SPLIT -1)
                                    (("1" (LEMMA "dbl_eq")
                                      (("1" (INST?) (("1" (ASSERT) NIL)))))
                                     ("2" (LEMMA "dbl_eq")
                                      (("2" (INST?) (("2" (ASSERT) NIL)))))
                                     ("3" (EXPAND "H")
                                      (("3"
                                        (EXPAND "path_comp")
                                        (("3"
                                          (EXPAND "subgraph")
                                          (("3"
                                            (FLATTEN)
                                            (("3"
                                              (INST -2 "t!1")
                                              (("3"
                                                (EXPAND "dbl")
                                                (("3"
                                                  (HIDE -2)
                                                  (("3"
                                                    (EXPAND "del_vert")
                                                    (("3"
                                                      (FLATTEN)
                                                      (("3"
                                                        (PROPAX)
                                                        NIL)))))))))))))))))))
                                     ("4" (EXPAND "incident")
                                      (("4" (SKOSIMP*) NIL)))
                                     ("5" (EXPAND "incident")
                                      (("5"
                                        (SKOSIMP*)
                                        NIL)))))))))))))))))))))))))))))))))
       ("2" (ASSERT) (("2" (EXPAND "disjoint?") (("2" (PROPAX) NIL)))))
       ("3" (EXPAND "disjoint?") (("3" (FLATTEN) (("3" (ASSERT) NIL)))))))))))
 (|line14_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|line14_TCC2| "" (SUBTYPE-TCC) NIL) (|line14_TCC3| "" (SUBTYPE-TCC) NIL)
 (|line14_TCC4| "" (SUBTYPE-TCC) NIL) (|line14_TCC5| "" (SUBTYPE-TCC))
 (|line14| "" (SKOSIMP*)
  (("" (EXPAND "sep_num")
    (("" (EXPAND "in?")
      (("" (EXPAND "disjoint?")
        (("" (FLATTEN)
          ((""
            (CASE "separates(meng(G!1, s!1, t!1, w1!1, w2!1), dbl(w1!1, w2!1), s!1, t!1)")
            (("1" (ASSERT)
              (("1" (LEMMA "min_sep_set_card")
                (("1" (INST?)
                  (("1" (ASSERT)
                    (("1" (REWRITE "card_dbl")
                      (("1" (LEMMA "prep_14")
                        (("1" (INST?)
                          (("1" (ASSERT)
                            (("1" (EXPAND "sep_num")
                              (("1" (EXPAND "disjoint?")
                                (("1" (PROPAX) NIL)))))))))))))))
                   ("2" (HIDE -1 8)
                    (("2" (EXPAND "meng")
                      (("2" (EXPAND "add") (("2" (PROPAX) NIL)))))))
                   ("3" (HIDE -1 8)
                    (("3" (EXPAND "meng")
                      (("3" (EXPAND "add")
                        (("3" (EXPAND "member")
                          (("3" (LEMMA "vert_H_s")
                            (("3" (INST?)
                              (("3" (ASSERT) NIL)))))))))))))))))))
             ("2" (HIDE 8)
              (("2" (EXPAND "separates")
                (("2" (FLATTEN)
                  (("2" (EXPAND "dbl" 1 (1 2))
                    (("2" (ASSERT)
                      (("2" (SKOSIMP*)
                        (("2" (INST + "w!1")
                          (("2" (EXPAND "walk_from?")
                            (("2" (FLATTEN)
                              (("2" (ASSERT)
                                (("2" (EXPAND "walk?")
                                  (("2" (SPLIT +)
                                    (("1" (FLATTEN)
                                      (("1"
                                        (HIDE -4)
                                        (("1"
                                          (EXPAND "verts_in?")
                                          (("1"
                                            (SKOSIMP*)
                                            (("1"
                                              (EXPAND "del_verts")
                                              (("1"
                                                (EXPAND "difference")
                                                (("1"
                                                  (EXPAND "member")
                                                  (("1"
                                                    (EXPAND "meng")
                                                    (("1"
                                                      (INST?)
                                                      (("1"
                                                        (FLATTEN)
                                                        (("1"
                                                          (EXPAND "add")
                                                          (("1"
                                                            (EXPAND "member")
                                                            (("1"
                                                              (GROUND)
                                                              (("1"
                                                                (EXPAND "H")
                                                                (("1"
                                                                  (EXPAND
                                                                   "path_comp")
                                                                  (("1"
                                                                    (EXPAND
                                                                     "subgraph")
                                                                    (("1"
                                                                      (FLATTEN)
                                                                      (("1"
                                                                        (EXPAND
                                                                         "del_vert")
                                                                        (("1"
                                                                          (EXPAND
                                                                           "remove")
                                                                          (("1"
                                                                            (EXPAND
                                                                             "member")
                                                                            (("1"
                                                                              (PROPAX)
                                                                              NIL)))))))))))))))))))))))))))))))))))))))))
                                     ("2" (FLATTEN)
                                      (("2"
                                        (SKOSIMP*)
                                        (("2"
                                          (EXPAND "fseq")
                                          (("2"
                                            (EXPAND "edge?")
                                            (("2"
                                              (INST?)
                                              (("2"
                                                (ASSERT)
                                                (("2"
                                                  (FLATTEN)
                                                  (("2"
                                                    (ASSERT)
                                                    (("2"
                                                      (EXPAND "del_verts")
                                                      (("2"
                                                        (FLATTEN)
                                                        (("2"
                                                          (EXPAND "meng")
                                                          (("2"
                                                            (EXPAND "union")
                                                            (("2"
                                                              (EXPAND "add")
                                                              (("2"
                                                                (EXPAND
                                                                 "member")
                                                                (("2"
                                                                  (SPLIT +)
                                                                  (("1"
                                                                    (EXPAND
                                                                     "verts_in?")
                                                                    (("1"
                                                                      (EXPAND
                                                                       "difference")
                                                                      (("1"
                                                                        (EXPAND
                                                                         "member")
                                                                        (("1"
                                                                          (SPLIT
                                                                           -5)
                                                                          (("1"
                                                                            (LEMMA
                                                                             "dbl_eq")
                                                                            (("1"
                                                                              (INST?)
                                                                              (("1"
                                                                                (ASSERT)
                                                                                (("1"
                                                                                  (HIDE
                                                                                   -2)
                                                                                  (("1"
                                                                                    (SPLIT
                                                                                     -1)
                                                                                    (("1"
                                                                                      (FLATTEN)
                                                                                      (("1"
                                                                                        (INST
                                                                                         -6
                                                                                         "n!1")
                                                                                        (("1"
                                                                                          (ASSERT)
                                                                                          (("1"
                                                                                            (INST?)
                                                                                            (("1"
                                                                                              (EXPAND
                                                                                               "dbl")
                                                                                              (("1"
                                                                                                (PROPAX)
                                                                                                NIL)))))))))))
                                                                                     ("2"
                                                                                      (FLATTEN)
                                                                                      (("2"
                                                                                        (INST
                                                                                         -6
                                                                                         "n!1+1")
                                                                                        (("2"
                                                                                          (ASSERT)
                                                                                          (("2"
                                                                                            (INST?)
                                                                                            (("2"
                                                                                              (EXPAND
                                                                                               "dbl")
                                                                                              (("2"
                                                                                                (PROPAX)
                                                                                                NIL)))))))))))))))))))))
                                                                           ("2"
                                                                            (LEMMA
                                                                             "dbl_eq")
                                                                            (("2"
                                                                              (INST?)
                                                                              (("2"
                                                                                (ASSERT)
                                                                                (("2"
                                                                                  (SPLIT
                                                                                   -1)
                                                                                  (("1"
                                                                                    (FLATTEN)
                                                                                    (("1"
                                                                                      (INST
                                                                                       -7
                                                                                       "n!1")
                                                                                      (("1"
                                                                                        (ASSERT)
                                                                                        (("1"
                                                                                          (INST?)
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "dbl")
                                                                                            (("1"
                                                                                              (PROPAX)
                                                                                              NIL)))))))))))
                                                                                   ("2"
                                                                                    (FLATTEN)
                                                                                    (("2"
                                                                                      (INST
                                                                                       -7
                                                                                       "n!1+1")
                                                                                      (("2"
                                                                                        (ASSERT)
                                                                                        (("2"
                                                                                          (INST?)
                                                                                          (("2"
                                                                                            (EXPAND
                                                                                             "dbl")
                                                                                            (("2"
                                                                                              (PROPAX)
                                                                                              NIL)))))))))))))))))))
                                                                           ("3"
                                                                            (EXPAND
                                                                             "H")
                                                                            (("3"
                                                                              (EXPAND
                                                                               "path_comp")
                                                                              (("3"
                                                                                (EXPAND
                                                                                 "subgraph")
                                                                                (("3"
                                                                                  (FLATTEN)
                                                                                  (("3"
                                                                                    (EXPAND
                                                                                     "del_vert")
                                                                                    (("3"
                                                                                      (FLATTEN)
                                                                                      (("3"
                                                                                        (PROPAX)
                                                                                        NIL)))))))))))))
                                                                           ("4"
                                                                            (EXPAND
                                                                             "incident")
                                                                            (("4"
                                                                              (SKOSIMP*)
                                                                              NIL)))
                                                                           ("5"
                                                                            (EXPAND
                                                                             "incident")
                                                                            (("5"
                                                                              (SKOSIMP*)
                                                                              NIL)))))))))))
                                                                   ("2"
                                                                    (PROPAX)
                                                                    NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))
             ("3" (REWRITE "finite_dbl") NIL) ("4" (ASSERT) NIL)
             ("5" (ASSERT) NIL) ("6" (PROPAX) NIL)
             ("7" (PROPAX) NIL)))))))))))))
 (|line15ab| "" (SKOSIMP*)
  (("" (LEMMA "sep_num_gt_0")
    (("" (INST -1 "G!1" "s!1" "t!1")
      (("" (EXPAND "in?")
        (("" (FLATTEN)
          (("" (ASSERT)
            (("" (SKOSIMP*)
              (("" (LEMMA "walk_to_path_from")
                (("" (INST?)
                  (("" (ASSERT)
                    (("" (SKOSIMP*)
                      (("" (HIDE -2)
                        ((""
                          (CASE "(EXISTS (i: below(l(p!1))): seq(p!1)(i) = w1!1 OR
                                         seq(p!1)(i) = w2!1)")
                          (("1" (SKOSIMP*)
                            (("1" (CASE "seq(p!1)(i!1) = w1!1")
                              (("1" (HIDE -2)
                                (("1" (LEMMA "one_to_each")
                                  (("1"
                                    (INST -1 "G!1" "s!1" "t!1" "w1!1" "w2!1")
                                    (("1" (ASSERT) NIL)))))))
                               ("2" (ASSERT)
                                (("2" (LEMMA "one_to_each")
                                  (("2"
                                    (INST -1 "G!1" "s!1" "t!1" "w2!1" "w1!1")
                                    (("2" (ASSERT)
                                      (("2"
                                        (SPLIT -1)
                                        (("1"
                                          (FLATTEN)
                                          (("1"
                                            (SKOSIMP*)
                                            (("1"
                                              (SPLIT +)
                                              (("1" (INST?) NIL)
                                               ("2" (INST?) NIL)))))))
                                         ("2"
                                          (HIDE -1 -2 -3 -4 -5 -6 -7 2 3)
                                          (("2"
                                            (REWRITE "dbl_comm")
                                            NIL)))))))))))))))))
                           ("2" (EXPAND "separates")
                            (("2" (FLATTEN)
                              (("2" (INST 4 "p!1")
                                (("2" (HIDE -7 5)
                                  (("2" (EXPAND "walk_from?")
                                    (("2" (EXPAND "path_from?")
                                      (("2"
                                        (FLATTEN)
                                        (("2"
                                          (EXPAND "from?")
                                          (("2"
                                            (FLATTEN)
                                            (("2"
                                              (ASSERT)
                                              (("2"
                                                (EXPAND "path?")
                                                (("2"
                                                  (FLATTEN)
                                                  (("2"
                                                    (HIDE -2)
                                                    (("2"
                                                      (EXPAND "walk?")
                                                      (("2"
                                                        (SPLIT 4)
                                                        (("1"
                                                          (FLATTEN)
                                                          (("1"
                                                            (HIDE -2)
                                                            (("1"
                                                              (EXPAND
                                                               "verts_in?")
                                                              (("1"
                                                                (SKOSIMP*)
                                                                (("1"
                                                                  (EXPAND
                                                                   "del_verts")
                                                                  (("1"
                                                                    (EXPAND
                                                                     "difference")
                                                                    (("1"
                                                                      (EXPAND
                                                                       "member")
                                                                      (("1"
                                                                        (EXPAND
                                                                         "dbl")
                                                                        (("1"
                                                                          (INST?)
                                                                          (("1"
                                                                            (INST?)
                                                                            (("1"
                                                                              (GROUND)
                                                                              NIL)))))))))))))))))))))
                                                         ("2"
                                                          (SKOSIMP*)
                                                          (("2"
                                                            (INST? -)
                                                            (("2"
                                                              (ASSERT)
                                                              (("2"
                                                                (EXPAND
                                                                 "edge?")
                                                                (("2"
                                                                  (FLATTEN)
                                                                  (("2"
                                                                    (ASSERT)
                                                                    (("2"
                                                                      (EXPAND
                                                                       "del_verts")
                                                                      (("2"
                                                                        (SKOSIMP*)
                                                                        (("2"
                                                                          (EXPAND
                                                                           "dbl")
                                                                          (("2"
                                                                            (INST-CP
                                                                             1
                                                                             "n!1")
                                                                            (("2"
                                                                              (INST
                                                                               1
                                                                               "n!1+1")
                                                                              (("2"
                                                                                (EXPAND
                                                                                 "fseq")
                                                                                (("2"
                                                                                  (GROUND)
                                                                                  NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 (|prep_16_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|prep_16| "" (SKOSIMP*)
  (("" (CASE "separates(G!1, singleton(w2!1), s!1, t!1)")
    (("1" (HIDE -2 -3 -4)
      (("1" (EXPAND "sep_num")
        (("1" (LEMMA "min_sep_set_card")
          (("1" (INST?)
            (("1" (ASSERT)
              (("1" (HIDE -2) (("1" (REWRITE "card_singleton") NIL)))))
             ("2" (EXPAND "separates")
              (("2" (REWRITE "finite_singleton") NIL)))))))))))
     ("2" (EXPAND "separates")
      (("2" (FLATTEN)
        (("2" (SPLIT +)
          (("1" (EXPAND "singleton")
            (("1" (EXPAND "dbl") (("1" (ASSERT) NIL)))))
           ("2" (EXPAND "singleton")
            (("2" (EXPAND "dbl") (("2" (ASSERT) NIL)))))
           ("3" (SKOSIMP*)
            (("3" (LEMMA "walk_to_path_from")
              (("3" (INST?)
                (("1" (ASSERT)
                  (("1" (SKOSIMP*)
                    (("1" (HIDE -2)
                      (("1" (INST + "p!1")
                        (("1" (EXPAND "path_from?")
                          (("1" (FLATTEN)
                            (("1" (LEMMA "path?_del_verts")
                              (("1" (INST?)
                                (("1" (ASSERT)
                                  (("1" (LEMMA "path?_rev")
                                    (("1" (INST?)
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (EXPAND "path?" -3)
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (EXPAND "walk_from?")
                                              (("1"
                                                (ASSERT)
                                                (("1"
                                                  (EXPAND "from?")
                                                  (("1"
                                                    (FLATTEN)
                                                    (("1"
                                                      (ASSERT)
                                                      (("1"
                                                        (EXPAND "walk?")
                                                        (("1"
                                                          (FLATTEN)
                                                          (("1"
                                                            (SPLIT +)
                                                            (("1"
                                                              (EXPAND
                                                               "verts_in?")
                                                              (("1"
                                                                (SKOSIMP*)
                                                                (("1"
                                                                  (EXPAND
                                                                   "del_verts")
                                                                  (("1"
                                                                    (EXPAND
                                                                     "difference")
                                                                    (("1"
                                                                      (EXPAND
                                                                       "member")
                                                                      (("1"
                                                                        (INST?)
                                                                        (("1"
                                                                          (ASSERT)
                                                                          (("1"
                                                                            (FLATTEN)
                                                                            (("1"
                                                                              (ASSERT)
                                                                              (("1"
                                                                                (EXPAND
                                                                                 "dbl")
                                                                                (("1"
                                                                                  (EXPAND
                                                                                   "singleton")
                                                                                  (("1"
                                                                                    (ASSERT)
                                                                                    (("1"
                                                                                      (INST
                                                                                       -10
                                                                                       "rev(p!1)^(0,(l(p!1) - i!1 - 1))")
                                                                                      (("1"
                                                                                        (REWRITE
                                                                                         "path?_caret")
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "^")
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "rev")
                                                                                            (("1"
                                                                                              (EXPAND
                                                                                               "verts_of")
                                                                                              (("1"
                                                                                                (EXPAND
                                                                                                 "fseq")
                                                                                                (("1"
                                                                                                  (SKOSIMP*)
                                                                                                  (("1"
                                                                                                    (REVEAL
                                                                                                     -2)
                                                                                                    (("1"
                                                                                                      (INST
                                                                                                       -1
                                                                                                       "l(p!1) - 1 - i!2")
                                                                                                      (("1"
                                                                                                        (FLATTEN)
                                                                                                        (("1"
                                                                                                          (EXPAND
                                                                                                           "singleton")
                                                                                                          (("1"
                                                                                                            (PROPAX)
                                                                                                            NIL)))))))))))))))))))
                                                                                         ("2"
                                                                                          (EXPAND
                                                                                           "rev")
                                                                                          (("2"
                                                                                            (ASSERT)
                                                                                            NIL)))
                                                                                         ("3"
                                                                                          (EXPAND
                                                                                           "rev")
                                                                                          (("3"
                                                                                            (ASSERT)
                                                                                            NIL)))))
                                                                                       ("2"
                                                                                        (EXPAND
                                                                                         "^")
                                                                                        (("2"
                                                                                          (ASSERT)
                                                                                          NIL)))
                                                                                       ("3"
                                                                                        (EXPAND
                                                                                         "rev")
                                                                                        (("3"
                                                                                          (ASSERT)
                                                                                          NIL)))))))))))))))))))))))))))))
                                                             ("2"
                                                              (SKOSIMP*)
                                                              (("2"
                                                                (EXPAND
                                                                 "fseq")
                                                                (("2"
                                                                  (EXPAND
                                                                   "edge?")
                                                                  (("2"
                                                                    (INST?)
                                                                    (("2"
                                                                      (ASSERT)
                                                                      (("2"
                                                                        (FLATTEN)
                                                                        (("2"
                                                                          (ASSERT)
                                                                          (("2"
                                                                            (EXPAND
                                                                             "del_verts")
                                                                            (("2"
                                                                              (ASSERT)
                                                                              (("2"
                                                                                (FLATTEN)
                                                                                (("2"
                                                                                  (ASSERT)
                                                                                  (("2"
                                                                                    (EXPAND
                                                                                     "verts_in?")
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "difference")
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "member")
                                                                                        (("2"
                                                                                          (EXPAND
                                                                                           "singleton")
                                                                                          (("2"
                                                                                            (SKOSIMP*)
                                                                                            (("2"
                                                                                              (INST
                                                                                               -8
                                                                                               "v!1")
                                                                                              (("2"
                                                                                                (EXPAND
                                                                                                 "dbl")
                                                                                                (("2"
                                                                                                  (GROUND)
                                                                                                  (("1"
                                                                                                    (REPLACE
                                                                                                     -1)
                                                                                                    (("1"
                                                                                                      (HIDE
                                                                                                       -1)
                                                                                                      (("1"
                                                                                                        (INST
                                                                                                         -11
                                                                                                         "rev(p!1)^(0,l(p!1) - n!1 - 1)")
                                                                                                        (("1"
                                                                                                          (REWRITE
                                                                                                           "path?_caret")
                                                                                                          (("1"
                                                                                                            (EXPAND
                                                                                                             "^")
                                                                                                            (("1"
                                                                                                              (EXPAND
                                                                                                               "rev")
                                                                                                              (("1"
                                                                                                                (EXPAND
                                                                                                                 "verts_of")
                                                                                                                (("1"
                                                                                                                  (EXPAND
                                                                                                                   "fseq")
                                                                                                                  (("1"
                                                                                                                    (SKOSIMP*)
                                                                                                                    (("1"
                                                                                                                      (INST
                                                                                                                       -5
                                                                                                                       "l(p!1) - 1 - i!1")
                                                                                                                      (("1"
                                                                                                                        (FLATTEN)
                                                                                                                        (("1"
                                                                                                                          (PROPAX)
                                                                                                                          NIL)))))))))))))))
                                                                                                           ("2"
                                                                                                            (EXPAND
                                                                                                             "rev")
                                                                                                            (("2"
                                                                                                              (ASSERT)
                                                                                                              NIL)))
                                                                                                           ("3"
                                                                                                            (EXPAND
                                                                                                             "rev")
                                                                                                            (("3"
                                                                                                              (ASSERT)
                                                                                                              NIL)))))
                                                                                                         ("2"
                                                                                                          (EXPAND
                                                                                                           "^")
                                                                                                          (("2"
                                                                                                            (ASSERT)
                                                                                                            NIL)))
                                                                                                         ("3"
                                                                                                          (EXPAND
                                                                                                           "rev")
                                                                                                          (("3"
                                                                                                            (ASSERT)
                                                                                                            NIL)))))))))
                                                                                                   ("2"
                                                                                                    (REPLACE
                                                                                                     -1)
                                                                                                    (("2"
                                                                                                      (HIDE
                                                                                                       -1)
                                                                                                      (("2"
                                                                                                        (INST
                                                                                                         -11
                                                                                                         "rev(p!1)^(0,l(p!1) - n!1 - 2)")
                                                                                                        (("1"
                                                                                                          (REWRITE
                                                                                                           "path?_caret")
                                                                                                          (("1"
                                                                                                            (EXPAND
                                                                                                             "^")
                                                                                                            (("1"
                                                                                                              (EXPAND
                                                                                                               "verts_of")
                                                                                                              (("1"
                                                                                                                (EXPAND
                                                                                                                 "rev")
                                                                                                                (("1"
                                                                                                                  (EXPAND
                                                                                                                   "fseq")
                                                                                                                  (("1"
                                                                                                                    (SKOSIMP*)
                                                                                                                    (("1"
                                                                                                                      (INST
                                                                                                                       -5
                                                                                                                       "l(p!1) - 1 - i!1")
                                                                                                                      (("1"
                                                                                                                        (FLATTEN)
                                                                                                                        (("1"
                                                                                                                          (PROPAX)
                                                                                                                          NIL)))))))))))))))
                                                                                                           ("2"
                                                                                                            (EXPAND
                                                                                                             "rev")
                                                                                                            (("2"
                                                                                                              (ASSERT)
                                                                                                              NIL)))
                                                                                                           ("3"
                                                                                                            (EXPAND
                                                                                                             "rev")
                                                                                                            (("3"
                                                                                                              (ASSERT)
                                                                                                              NIL)))))
                                                                                                         ("2"
                                                                                                          (EXPAND
                                                                                                           "^")
                                                                                                          (("2"
                                                                                                            (ASSERT)
                                                                                                            NIL)))
                                                                                                         ("3"
                                                                                                          (EXPAND
                                                                                                           "rev")
                                                                                                          (("3"
                                                                                                            (ASSERT)
                                                                                                            NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
                                 ("2" (REWRITE "finite_singleton")
                                  NIL)))))))))))))))))
                 ("2" (REWRITE "finite_singleton") NIL)))))))))))))
     ("3" (REWRITE "finite_singleton") NIL)))))
 (|line16| "" (SKOSIMP*)
  (("" (LEMMA "prep_16")
    (("" (INST?)
      (("" (ASSERT)
        (("" (SKOSIMP*)
          (("" (HIDE -3 -4 -5 -6)
            (("" (LEMMA "path_from_l")
              (("" (INST?)
                (("" (ASSERT)
                  (("" (EXPAND "disjoint?")
                    (("" (FLATTEN)
                      (("" (ASSERT)
                        (("" (CASE "l(p!1) = 2")
                          (("1" (EXPAND "path_from?")
                            (("1" (FLATTEN)
                              (("1" (EXPAND "from?")
                                (("1" (FLATTEN)
                                  (("1" (REPLACE -1)
                                    (("1" (HIDE -1)
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (EXPAND "path?")
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (EXPAND "walk?")
                                              (("1"
                                                (FLATTEN)
                                                (("1"
                                                  (INST -3 "0")
                                                  (("1"
                                                    (ASSERT)
                                                    (("1"
                                                      (EXPAND "fseq")
                                                      (("1"
                                                        (EXPAND "edge?")
                                                        (("1"
                                                          (REWRITE "dbl_comm")
                                                          (("1"
                                                            (ASSERT)
                                                            NIL)))))))))))))))))))))))))))))))))
                           ("2" (EXPAND "path_from?")
                            (("2" (FLATTEN)
                              (("2" (EXPAND "from?")
                                (("2" (FLATTEN)
                                  (("2" (INST + "seq(p!1)(1)")
                                    (("2" (EXPAND "path?")
                                      (("2"
                                        (FLATTEN)
                                        (("2"
                                          (EXPAND "fseq")
                                          (("2"
                                            (INST-CP - "0" "1")
                                            (("2"
                                              (ASSERT)
                                              (("2"
                                                (EXPAND "H")
                                                (("2"
                                                  (EXPAND "path_comp")
                                                  (("2"
                                                    (EXPAND "subgraph")
                                                    (("2"
                                                      (CASE
                                                       "vert(del_vert(del_vert(G!1, w1!1), w2!1))(seq(p!1)(1))")
                                                      (("1"
                                                        (ASSERT)
                                                        (("1"
                                                          (EXPAND
                                                           "path_verts")
                                                          (("1"
                                                            (SKOSIMP*)
                                                            (("1"
                                                              (INST
                                                               +
                                                               "p!1^(0,1)")
                                                              (("1"
                                                                (EXPAND
                                                                 "walk_from?")
                                                                (("1"
                                                                  (EXPAND "^")
                                                                  (("1"
                                                                    (EXPAND
                                                                     "walk?")
                                                                    (("1"
                                                                      (SPLIT
                                                                       +)
                                                                      (("1"
                                                                        (EXPAND
                                                                         "verts_in?")
                                                                        (("1"
                                                                          (SKOSIMP*)
                                                                          (("1"
                                                                            (HIDE
                                                                             -1)
                                                                            (("1"
                                                                              (EXPAND
                                                                               "del_vert")
                                                                              (("1"
                                                                                (EXPAND
                                                                                 "remove")
                                                                                (("1"
                                                                                  (EXPAND
                                                                                   "member")
                                                                                  (("1"
                                                                                    (SPLIT
                                                                                     +)
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "verts_of")
                                                                                      (("1"
                                                                                        (INST?
                                                                                         +)
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "fseq")
                                                                                          (("1"
                                                                                            (ASSERT)
                                                                                            NIL)))))))
                                                                                     ("2"
                                                                                      (HIDE
                                                                                       -2
                                                                                       -3)
                                                                                      (("2"
                                                                                        (INST
                                                                                         -
                                                                                         "l(p!1)-1"
                                                                                         "i!1")
                                                                                        (("2"
                                                                                          (ASSERT)
                                                                                          NIL)))))
                                                                                     ("3"
                                                                                      (INST?)
                                                                                      NIL)))))))))))))))
                                                                       ("2"
                                                                        (SKOSIMP*)
                                                                        (("2"
                                                                          (EXPAND
                                                                           "fseq")
                                                                          (("2"
                                                                            (EXPAND
                                                                             "edge?")
                                                                            (("2"
                                                                              (INST?)
                                                                              (("2"
                                                                                (ASSERT)
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "del_vert")
                                                                                  (("2"
                                                                                    (SPLIT
                                                                                     +)
                                                                                    (("1"
                                                                                      (GROUND)
                                                                                      (("1"
                                                                                        (EXPAND
                                                                                         "dbl")
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "remove")
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "member")
                                                                                            (("1"
                                                                                              (FLATTEN)
                                                                                              (("1"
                                                                                                (INST
                                                                                                 -
                                                                                                 "1+n!1"
                                                                                                 "l(p!1)-1")
                                                                                                (("1"
                                                                                                  (ASSERT)
                                                                                                  NIL)))))))))))))
                                                                                     ("2"
                                                                                      (EXPAND
                                                                                       "dbl")
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "verts_of")
                                                                                        (("2"
                                                                                          (EXPAND
                                                                                           "fseq")
                                                                                          (("2"
                                                                                            (INST
                                                                                             +
                                                                                             "1+n!1")
                                                                                            (("2"
                                                                                              (ASSERT)
                                                                                              NIL)))))))))))))))))))))))))))))))
                                                               ("2"
                                                                (EXPAND "^")
                                                                (("2"
                                                                  (ASSERT)
                                                                  NIL)))))))))))
                                                       ("2"
                                                        (HIDE 11)
                                                        (("2"
                                                          (EXPAND "del_vert")
                                                          (("2"
                                                            (EXPAND "remove")
                                                            (("2"
                                                              (EXPAND
                                                               "member")
                                                              (("2"
                                                                (SPLIT +)
                                                                (("1"
                                                                  (EXPAND
                                                                   "verts_of")
                                                                  (("1"
                                                                    (INST? +)
                                                                    (("1"
                                                                      (EXPAND
                                                                       "fseq")
                                                                      (("1"
                                                                        (ASSERT)
                                                                        NIL)))))))
                                                                 ("2"
                                                                  (INST
                                                                   -
                                                                   "l(p!1)-1"
                                                                   "1")
                                                                  (("2"
                                                                    (ASSERT)
                                                                    NIL)))
                                                                 ("3"
                                                                  (EXPAND
                                                                   "walk?")
                                                                  (("3"
                                                                    (FLATTEN)
                                                                    (("3"
                                                                      (HIDE
                                                                       -3
                                                                       -4)
                                                                      (("3"
                                                                        (EXPAND
                                                                         "verts_in?")
                                                                        (("3"
                                                                          (INST?)
                                                                          NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 (|line19_TCC1| "" (SKOSIMP*)
  (("" (EXPAND "in?") (("" (FLATTEN) (("" (PROPAX) NIL)))))))
 (|line19_TCC2| "" (SUBTYPE-TCC) NIL) (|line19_TCC3| "" (SUBTYPE-TCC) NIL)
 (|line19_TCC4| "" (SUBTYPE-TCC) NIL)
 (|line19_TCC5| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|line19| "" (SKOSIMP*)
  (("" (LEMMA "path_from_l")
    (("" (INST?)
      (("" (EXPAND "disjoint?")
        (("" (FLATTEN)
          (("" (ASSERT)
            (("" (EXPAND "path_from?")
              (("" (FLATTEN)
                (("" (EXPAND "from?")
                  (("" (FLATTEN)
                    (("" (HIDE -3)
                      (("" (EXPAND "path?")
                        (("" (FLATTEN)
                          (("" (HIDE -6)
                            (("" (EXPAND "walk?")
                              (("" (FLATTEN)
                                (("" (HIDE -5)
                                  (("" (INST - "l(p!1) -2")
                                    (("" (ASSERT)
                                      ((""
                                        (EXPAND "edge?")
                                        ((""
                                          (EXPAND "fseq")
                                          ((""
                                            (REPLACE -7)
                                            ((""
                                              (FLATTEN)
                                              ((""
                                                (CASE-REPLACE "l(p!1) = 2")
                                                (("1"
                                                  (ASSERT)
                                                  (("1"
                                                    (REPLACE -4)
                                                    (("1"
                                                      (HIDE -2 -4)
                                                      (("1"
                                                        (EXPAND "meng")
                                                        (("1"
                                                          (EXPAND "union")
                                                          (("1"
                                                            (EXPAND
                                                             "incident")
                                                            (("1"
                                                              (EXPAND "add")
                                                              (("1"
                                                                (EXPAND
                                                                 "member")
                                                                (("1"
                                                                  (REPLACE -5)
                                                                  (("1"
                                                                    (SPLIT -4)
                                                                    (("1"
                                                                      (CASE
                                                                       "dbl[T](w1!1, t!1)(s!1) = dbl[T](s!1, t!1)(s!1)")
                                                                      (("1"
                                                                        (HIDE
                                                                         -2)
                                                                        (("1"
                                                                          (EXPAND
                                                                           "dbl")
                                                                          (("1"
                                                                            (PROPAX)
                                                                            NIL)))))
                                                                       ("2"
                                                                        (ASSERT)
                                                                        NIL)))
                                                                     ("2"
                                                                      (CASE
                                                                       "dbl[T](w2!1, t!1)(s!1) = dbl[T](s!1, t!1)(s!1)")
                                                                      (("1"
                                                                        (HIDE
                                                                         -2)
                                                                        (("1"
                                                                          (EXPAND
                                                                           "dbl")
                                                                          (("1"
                                                                            (PROPAX)
                                                                            NIL)))))
                                                                       ("2"
                                                                        (ASSERT)
                                                                        NIL)))
                                                                     ("3"
                                                                      (TYPEPRED
                                                                       "H(G!1, s!1, w1!1, w2!1)")
                                                                      (("3"
                                                                        (HIDE
                                                                         -2)
                                                                        (("3"
                                                                          (EXPAND
                                                                           "subgraph?")
                                                                          (("3"
                                                                            (FLATTEN)
                                                                            (("3"
                                                                              (HIDE
                                                                               -1)
                                                                              (("3"
                                                                                (EXPAND
                                                                                 "subset?")
                                                                                (("3"
                                                                                  (EXPAND
                                                                                   "member")
                                                                                  (("3"
                                                                                    (INST?)
                                                                                    (("1"
                                                                                      (ASSERT)
                                                                                      (("1"
                                                                                        (HIDE
                                                                                         -2)
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "separable?")
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "edge?")
                                                                                            (("1"
                                                                                              (PROPAX)
                                                                                              NIL)))))))))
                                                                                     ("2"
                                                                                      (INST?)
                                                                                      (("2"
                                                                                        (ASSERT)
                                                                                        NIL)))))))))))))))))))
                                                                     ("4"
                                                                      (SKOSIMP*)
                                                                      (("4"
                                                                        (EXPAND
                                                                         "separable?")
                                                                        (("4"
                                                                          (EXPAND
                                                                           "edge?")
                                                                          (("4"
                                                                            (PROPAX)
                                                                            NIL)))))))
                                                                     ("5"
                                                                      (SKOSIMP*)
                                                                      (("5"
                                                                        (EXPAND
                                                                         "separable?")
                                                                        (("5"
                                                                          (EXPAND
                                                                           "edge?")
                                                                          (("5"
                                                                            (PROPAX)
                                                                            NIL)))))))))))))))))))))))))))
                                                 ("2"
                                                  (ASSERT)
                                                  (("2"
                                                    (REPLACE -3)
                                                    (("2"
                                                      (HIDE -3)
                                                      (("2"
                                                        (HIDE -2)
                                                        (("2"
                                                          (EXPAND "separates")
                                                          (("2"
                                                            (FLATTEN)
                                                            (("2"
                                                              (EXPAND "meng")
                                                              (("2"
                                                                (EXPAND
                                                                 "union")
                                                                (("2"
                                                                  (EXPAND
                                                                   "add")
                                                                  (("2"
                                                                    (EXPAND
                                                                     "member")
                                                                    (("2"
                                                                      (EXPAND
                                                                       "incident")
                                                                      (("2"
                                                                        (SPLIT
                                                                         -2)
                                                                        (("1"
                                                                          (CASE
                                                                           "dbl[T](w1!1, t!1)(w1!1) = dbl[T](seq(p!1)(l(p!1) - 2), t!1)(w1!1)")
                                                                          (("1"
                                                                            (HIDE
                                                                             -2)
                                                                            (("1"
                                                                              (EXPAND
                                                                               "dbl")
                                                                              (("1"
                                                                                (ASSERT)
                                                                                NIL)))))
                                                                           ("2"
                                                                            (ASSERT)
                                                                            NIL)))
                                                                         ("2"
                                                                          (CASE
                                                                           "dbl[T](w2!1, t!1)(w2!1) = dbl[T](seq(p!1)(l(p!1) - 2), t!1)(w2!1)")
                                                                          (("1"
                                                                            (HIDE
                                                                             -2)
                                                                            (("1"
                                                                              (EXPAND
                                                                               "dbl")
                                                                              (("1"
                                                                                (ASSERT)
                                                                                NIL)))))
                                                                           ("2"
                                                                            (ASSERT)
                                                                            NIL)))
                                                                         ("3"
                                                                          (EXPAND
                                                                           "H")
                                                                          (("3"
                                                                            (EXPAND
                                                                             "path_comp")
                                                                            (("3"
                                                                              (EXPAND
                                                                               "subgraph")
                                                                              (("3"
                                                                                (FLATTEN)
                                                                                (("3"
                                                                                  (EXPAND
                                                                                   "del_vert")
                                                                                  (("3"
                                                                                    (FLATTEN)
                                                                                    (("3"
                                                                                      (INST
                                                                                       -
                                                                                       "seq(p!1)(l(p!1) - 2)")
                                                                                      (("3"
                                                                                        (EXPAND
                                                                                         "dbl")
                                                                                        (("3"
                                                                                          (EXPAND
                                                                                           "path_verts")
                                                                                          (("3"
                                                                                            (SKOSIMP*)
                                                                                            (("3"
                                                                                              (EXPAND
                                                                                               "walk_from?")
                                                                                              (("3"
                                                                                                (FLATTEN)
                                                                                                (("3"
                                                                                                  (INST
                                                                                                   +
                                                                                                   "add1(w!1,t!1)")
                                                                                                  (("3"
                                                                                                    (EXPAND
                                                                                                     "add1")
                                                                                                    (("3"
                                                                                                      (ASSERT)
                                                                                                      (("3"
                                                                                                        (EXPAND
                                                                                                         "del_verts")
                                                                                                        (("3"
                                                                                                          (EXPAND
                                                                                                           "walk?")
                                                                                                          (("3"
                                                                                                            (EXPAND
                                                                                                             "fseq")
                                                                                                            (("3"
                                                                                                              (SPLIT
                                                                                                               +)
                                                                                                              (("1"
                                                                                                                (EXPAND
                                                                                                                 "verts_in?")
                                                                                                                (("1"
                                                                                                                  (SKOSIMP*)
                                                                                                                  (("1"
                                                                                                                    (EXPAND
                                                                                                                     "difference")
                                                                                                                    (("1"
                                                                                                                      (EXPAND
                                                                                                                       "member")
                                                                                                                      (("1"
                                                                                                                        (EXPAND
                                                                                                                         "remove")
                                                                                                                        (("1"
                                                                                                                          (EXPAND
                                                                                                                           "member")
                                                                                                                          (("1"
                                                                                                                            (INST?)
                                                                                                                            (("1"
                                                                                                                              (FLATTEN)
                                                                                                                              (("1"
                                                                                                                                (SPLIT
                                                                                                                                 1)
                                                                                                                                (("1"
                                                                                                                                  (FLATTEN)
                                                                                                                                  (("1"
                                                                                                                                    (ASSERT)
                                                                                                                                    NIL)))
                                                                                                                                 ("2"
                                                                                                                                  (FLATTEN)
                                                                                                                                  (("2"
                                                                                                                                    (REVEAL
                                                                                                                                     -8)
                                                                                                                                    (("2"
                                                                                                                                      (EXPAND
                                                                                                                                       "in?")
                                                                                                                                      (("2"
                                                                                                                                        (FLATTEN)
                                                                                                                                        (("2"
                                                                                                                                          (PROPAX)
                                                                                                                                          NIL)))))))))))))
                                                                                                                             ("2"
                                                                                                                              (ASSERT)
                                                                                                                              (("2"
                                                                                                                                (REVEAL
                                                                                                                                 -8)
                                                                                                                                (("2"
                                                                                                                                  (EXPAND
                                                                                                                                   "in?")
                                                                                                                                  (("2"
                                                                                                                                    (PROPAX)
                                                                                                                                    NIL)))))))))))))))))))))
                                                                                                               ("2"
                                                                                                                (SKOSIMP*)
                                                                                                                (("2"
                                                                                                                  (EXPAND
                                                                                                                   "edge?")
                                                                                                                  (("2"
                                                                                                                    (ASSERT)
                                                                                                                    (("2"
                                                                                                                      (LIFT-IF)
                                                                                                                      (("2"
                                                                                                                        (SPLIT
                                                                                                                         1)
                                                                                                                        (("1"
                                                                                                                          (FLATTEN)
                                                                                                                          (("1"
                                                                                                                            (INST?)
                                                                                                                            (("1"
                                                                                                                              (ASSERT)
                                                                                                                              (("1"
                                                                                                                                (FLATTEN)
                                                                                                                                (("1"
                                                                                                                                  (ASSERT)
                                                                                                                                  (("1"
                                                                                                                                    (SKOSIMP*)
                                                                                                                                    (("1"
                                                                                                                                      (EXPAND
                                                                                                                                       "dbl")
                                                                                                                                      (("1"
                                                                                                                                        (FLATTEN)
                                                                                                                                        (("1"
                                                                                                                                          (GROUND)
                                                                                                                                          NIL)))))))))))))))))
                                                                                                                         ("2"
                                                                                                                          (FLATTEN)
                                                                                                                          (("2"
                                                                                                                            (CASE-REPLACE
                                                                                                                             "n!1 = l(w!1) - 1")
                                                                                                                            (("1"
                                                                                                                              (HIDE
                                                                                                                               -6
                                                                                                                               -7)
                                                                                                                              (("1"
                                                                                                                                (ASSERT)
                                                                                                                                (("1"
                                                                                                                                  (REPLACE
                                                                                                                                   -5)
                                                                                                                                  (("1"
                                                                                                                                    (REPLACE
                                                                                                                                     -8
                                                                                                                                     *
                                                                                                                                     RL)
                                                                                                                                    (("1"
                                                                                                                                      (EXPAND
                                                                                                                                       "dbl")
                                                                                                                                      (("1"
                                                                                                                                        (ASSERT)
                                                                                                                                        (("1"
                                                                                                                                          (SKOSIMP*)
                                                                                                                                          (("1"
                                                                                                                                            (GROUND)
                                                                                                                                            NIL)))))))))))))))
                                                                                                                             ("2"
                                                                                                                              (ASSERT)
                                                                                                                              NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))
                                                                         ("4"
                                                                          (SKOSIMP*)
                                                                          (("4"
                                                                            (REPLACE
                                                                             -2)
                                                                            (("4"
                                                                              (CASE
                                                                               "dbl[T](seq(p!1)(l(p!1) - 2), t!1)(z!1) = dbl[T](w1!1, z!1)(z!1) AND dbl[T](seq(p!1)(l(p!1) - 2), t!1)(w1!1) = dbl[T](w1!1, z!1)(w1!1)")
                                                                              (("1"
                                                                                (HIDE
                                                                                 -2)
                                                                                (("1"
                                                                                  (FLATTEN)
                                                                                  (("1"
                                                                                    (EXPAND
                                                                                     "dbl")
                                                                                    (("1"
                                                                                      (GROUND)
                                                                                      NIL)))))))
                                                                               ("2"
                                                                                (ASSERT)
                                                                                NIL)))))))
                                                                         ("5"
                                                                          (SKOSIMP*)
                                                                          (("5"
                                                                            (HIDE
                                                                             -1)
                                                                            (("5"
                                                                              (CASE
                                                                               "dbl[T](seq(p!1)(l(p!1) - 2), t!1)(w2!1) = dbl[T](w2!1, z!1)(w2!1) AND dbl[T](seq(p!1)(l(p!1) - 2), t!1)(z!1) = dbl[T](w2!1, z!1)(z!1)")
                                                                              (("1"
                                                                                (FLATTEN)
                                                                                (("1"
                                                                                  (HIDE
                                                                                   -3)
                                                                                  (("1"
                                                                                    (EXPAND
                                                                                     "dbl")
                                                                                    (("1"
                                                                                      (GROUND)
                                                                                      NIL)))))))
                                                                               ("2"
                                                                                (ASSERT)
                                                                                NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 (|line17_prep| "" (SKOSIMP*)
  (("" (EXPAND "disjoint?")
    (("" (FLATTEN)
      (("" (EXPAND "H")
        (("" (EXPAND "path_comp")
          (("" (EXPAND "subgraph")
            (("" (FLATTEN)
              (("" (EXPAND "path_verts")
                (("" (SKOSIMP*)
                  (("" (EXPAND "separates")
                    (("" (FLATTEN)
                      (("" (LEMMA "walk_merge")
                        (("" (INST?)
                          (("" (INST -1 "w!2" "s!1")
                            (("" (ASSERT)
                              (("" (SKOSIMP*)
                                (("" (INST + "p!1")
                                  (("" (ASSERT)
                                    (("" (REWRITE "del_verts_eq")
                                      NIL)))))))))))))))))))))))))))))))))))))
 (|line17_TCC1| "" (SUBTYPE-TCC) NIL) (|line17_TCC2| "" (SUBTYPE-TCC) NIL)
 (|line17_TCC3| "" (SUBTYPE-TCC) NIL) (|line17_TCC4| "" (SUBTYPE-TCC) NIL)
 (|line17| "" (SKOSIMP*)
  (("" (EXPAND "in?")
    (("" (EXPAND "disjoint?")
      (("" (FLATTEN)
        (("" (CASE "subset?(vert(meng(G!1, s!1, t!1, w1!1, w2!1)),vert(G!1))")
          (("1" (LEMMA "card_subset[T]")
            (("1" (INST?)
              (("1" (ASSERT)
                (("1" (EXPAND "size")
                  (("1" (HIDE -2)
                    (("1" (LEMMA "line17_prep")
                      (("1" (INST?)
                        (("1" (ASSERT)
                          (("1" (INST?)
                            (("1" (EXPAND "disjoint?")
                              (("1"
                                (CASE "NOT vert(meng(G!1, s!1, t!1, w1!1, w2!1))(yt!1)")
                                (("1"
                                  (NAME-REPLACE "Mt"
                                   "vert(meng(G!1, s!1, t!1, w1!1, w2!1))")
                                  (("1" (CASE "vert(G!1)(yt!1)")
                                    (("1" (HIDE -3 2)
                                      (("1"
                                        (LEMMA "same_card_subset[T]")
                                        (("1"
                                          (INST -1 "Mt" "vert(G!1)")
                                          (("1"
                                            (ASSERT)
                                            (("1"
                                              (REVEAL -6 -3)
                                              (("1" (ASSERT) NIL)))))))))))
                                     ("2" (HIDE -1 2 3 11)
                                      (("2"
                                        (EXPAND "H")
                                        (("2"
                                          (EXPAND "path_comp")
                                          (("2"
                                            (EXPAND "subgraph")
                                            (("2"
                                              (FLATTEN)
                                              (("2"
                                                (EXPAND "del_vert")
                                                (("2"
                                                  (HIDE -2)
                                                  (("2"
                                                    (EXPAND "remove")
                                                    (("2"
                                                      (EXPAND "member")
                                                      (("2"
                                                        (FLATTEN)
                                                        (("2"
                                                          (PROPAX)
                                                          NIL)))))))))))))))))))))))))
                                 ("2" (LEMMA "separates_comm")
                                  (("2" (INST?)
                                    (("2" (ASSERT)
                                      (("2"
                                        (HIDE -1 -3 9)
                                        (("2"
                                          (EXPAND "meng")
                                          (("2"
                                            (EXPAND "add")
                                            (("2"
                                              (EXPAND "member")
                                              (("2"
                                                (HIDE 1)
                                                (("2"
                                                  (EXPAND "H")
                                                  (("2"
                                                    (EXPAND "path_comp")
                                                    (("2"
                                                      (EXPAND "subgraph")
                                                      (("2"
                                                        (FLATTEN)
                                                        (("2"
                                                          (HIDE -3)
                                                          (("2"
                                                            (EXPAND
                                                             "del_vert")
                                                            (("2"
                                                              (EXPAND
                                                               "remove")
                                                              (("2"
                                                                (EXPAND
                                                                 "member")
                                                                (("2"
                                                                  (FLATTEN)
                                                                  (("2"
                                                                    (ASSERT)
                                                                    NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))
               ("2" (ASSERT) NIL) ("3" (ASSERT) NIL)))))
           ("2" (LEMMA "vert_meng_sub")
            (("2" (INST?)
              (("2" (EXPAND "in?")
                (("2" (EXPAND "disjoint?") (("2" (ASSERT) NIL)))))))))
           ("3" (ASSERT) NIL) ("4" (ASSERT) NIL) ("5" (PROPAX) NIL)
           ("6" (PROPAX) NIL)))))))))))
 (|pre20| "" (SKOSIMP*)
  (("" (SPLIT +)
    (("1" (EXPAND "separable?")
      (("1" (FLATTEN)
        (("1" (ASSERT)
          (("1" (EXPAND "meng")
            (("1" (EXPAND "edge?")
              (("1" (EXPAND "add")
                (("1" (EXPAND "member")
                  (("1" (EXPAND "union")
                    (("1" (EXPAND "member")
                      (("1" (SPLIT -1)
                        (("1" (LEMMA "dbl_eq")
                          (("1" (INST?)
                            (("1" (ASSERT)
                              (("1" (EXPAND "disjoint?")
                                (("1" (PROPAX) NIL)))))))))
                         ("2" (LEMMA "dbl_eq")
                          (("2" (INST?)
                            (("2" (ASSERT)
                              (("2" (EXPAND "disjoint?")
                                (("2" (PROPAX) NIL)))))))))
                         ("3" (EXPAND "disjoint?")
                          (("3" (FLATTEN)
                            (("3" (EXPAND "H")
                              (("3" (EXPAND "path_comp")
                                (("3" (EXPAND "subgraph")
                                  (("3" (EXPAND "del_vert")
                                    (("3" (FLATTEN)
                                      (("3" (PROPAX) NIL)))))))))))))))
                         ("4" (EXPAND "incident") (("4" (SKOSIMP*) NIL)))
                         ("5" (EXPAND "incident")
                          (("5" (SKOSIMP*) NIL)))))))))))))))))))))))
     ("2" (LEMMA "line14") (("2" (INST?) (("2" (ASSERT) NIL)))))
     ("3" (EXPAND "meng")
      (("3" (EXPAND "add")
        (("3" (EXPAND "member")
          (("3" (ASSERT)
            (("3" (EXPAND "in?")
              (("3" (EXPAND "disjoint?")
                (("3" (FLATTEN)
                  (("3" (ASSERT)
                    (("3" (EXPAND "H")
                      (("3" (EXPAND "path_comp")
                        (("3" (EXPAND "subgraph")
                          (("3" (EXPAND "del_vert")
                            (("3" (EXPAND "remove")
                              (("3" (EXPAND "member")
                                (("3" (EXPAND "path_verts")
                                  (("3" (INST + "gen_seq1(G!1,s!1)")
                                    (("3" (EXPAND "walk_from?")
                                      (("3"
                                        (EXPAND "gen_seq1")
                                        (("3"
                                          (EXPAND "walk?")
                                          (("3"
                                            (EXPAND "verts_in?")
                                            (("3"
                                              (PROPAX)
                                              NIL)))))))))))))))))))))))))))))))))))))))))
     ("4" (EXPAND "meng") (("4" (EXPAND "add") (("4" (PROPAX) NIL)))))))))
 (|line20_TCC1| "" (SKOSIMP*)
  (("" (EXPAND "in?") (("" (FLATTEN) (("" (PROPAX) NIL)))))))
 (|line20_TCC2| "" (SKOSIMP*)
  (("" (EXPAND "in?") (("" (FLATTEN) (("" (PROPAX) NIL)))))))
 (|line20_TCC3| "" (SUBTYPE-TCC) NIL) (|line20_TCC4| "" (SUBTYPE-TCC) NIL)
 (|line20_TCC5| "" (SUBTYPE-TCC) NIL) (|line20_TCC6| "" (SUBTYPE-TCC) NIL)
 (|line20| "" (SKOSIMP*)
  ((""
    (CASE "EXISTS (yt: T): vert(path_comp(del_vert(
                      del_vert(G!1,w1!1),w2!1),t!1))(yt) AND yt /= t!1")
    (("1" (HIDE 1)
      (("1" (SKOSIMP*)
        (("1" (CASE "size(MM!1) < size(G!1)")
          (("1" (EXPAND "induction_step")
            (("1" (INST - "MM!1")
              (("1" (ASSERT)
                (("1" (INST - "s!1" "t!1")
                  (("1" (ASSERT)
                    (("1"
                      (CASE "separable?(MM!1, s!1, t!1)
             AND sep_num(MM!1, s!1, t!1) = 2
             AND vert(MM!1)(s!1) AND vert(MM!1)(t!1)")
                      (("1" (FLATTEN)
                        (("1" (ASSERT)
                          (("1" (SKOSIMP*)
                            (("1" (HIDE -1 -2 -3 -4 -5 -9 -10)
                              (("1" (LEMMA "line19")
                                (("1" (INST?)
                                  (("1" (INST-CP -1 "p1!1")
                                    (("1" (INST -1 "p2!1")
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (FLATTEN)
                                          (("1"
                                            (SPLIT -2)
                                            (("1"
                                              (ASSERT)
                                              (("1"
                                                (CASE
                                                 "seq(p1!1)(l(p1!1) - 2) = w2!1")
                                                (("1"
                                                  (ASSERT)
                                                  (("1"
                                                    (HIDE -5 1)
                                                    (("1"
                                                      (INST 1 "p2!1" "p1!1")
                                                      (("1"
                                                        (ASSERT)
                                                        (("1"
                                                          (LEMMA
                                                           "independent?_comm")
                                                          (("1"
                                                            (INST
                                                             -
                                                             "p1!1"
                                                             "p2!1")
                                                            (("1"
                                                              (ASSERT)
                                                              (("1"
                                                                (HIDE
                                                                 -1
                                                                 -4
                                                                 -5
                                                                 -6
                                                                 -7)
                                                                (("1"
                                                                  (EXPAND
                                                                   "independent?")
                                                                  (("1"
                                                                    (EXPAND
                                                                     "verts_of")
                                                                    (("1"
                                                                      (SPLIT
                                                                       1)
                                                                      (("1"
                                                                        (SKOSIMP*)
                                                                        (("1"
                                                                          (EXPAND
                                                                           "fseq")
                                                                          (("1"
                                                                            (INST
                                                                             -
                                                                             "l(p1!1)-2"
                                                                             "i!1")
                                                                            (("1"
                                                                              (ASSERT)
                                                                              (("1"
                                                                                (TYPEPRED
                                                                                 "i!1")
                                                                                (("1"
                                                                                  (EXPAND
                                                                                   "path_from?")
                                                                                  (("1"
                                                                                    (FLATTEN)
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "disjoint?")
                                                                                      (("1"
                                                                                        (FLATTEN)
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "from?")
                                                                                          (("1"
                                                                                            (FLATTEN)
                                                                                            (("1"
                                                                                              (ASSERT)
                                                                                              NIL)))))))))))))))))))))))
                                                                       ("2"
                                                                        (SKOSIMP*)
                                                                        (("2"
                                                                          (EXPAND
                                                                           "fseq")
                                                                          (("2"
                                                                            (INST
                                                                             -
                                                                             "i!1"
                                                                             "l(p2!1)-2")
                                                                            (("2"
                                                                              (ASSERT)
                                                                              (("2"
                                                                                (EXPAND
                                                                                 "path_from?")
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "disjoint?")
                                                                                  (("2"
                                                                                    (FLATTEN)
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "from?")
                                                                                      (("2"
                                                                                        (FLATTEN)
                                                                                        (("2"
                                                                                          (ASSERT)
                                                                                          NIL)))))))))))))))))))))))))))))))))))))))))
                                                 ("2"
                                                  (HIDE -5 -6 2 3)
                                                  (("2"
                                                    (EXPAND "independent?")
                                                    (("2"
                                                      (INST
                                                       -
                                                       "l(p1!1)-2"
                                                       "l(p2!1)-2")
                                                      (("2"
                                                        (ASSERT)
                                                        NIL)))))))))))
                                             ("2"
                                              (ASSERT)
                                              (("2"
                                                (HIDE -5 -6 1)
                                                (("2"
                                                  (INST 1 "p1!1" "p2!1")
                                                  (("2"
                                                    (ASSERT)
                                                    (("2"
                                                      (SPLIT -4)
                                                      (("1"
                                                        (ASSERT)
                                                        (("1"
                                                          (EXPAND "verts_of")
                                                          (("1"
                                                            (SPLIT 1)
                                                            (("1"
                                                              (SKOSIMP*)
                                                              (("1"
                                                                (EXPAND
                                                                 "fseq")
                                                                (("1"
                                                                  (EXPAND
                                                                   "independent?")
                                                                  (("1"
                                                                    (INST
                                                                     -
                                                                     "i!1"
                                                                     "l(p2!1)-2")
                                                                    (("1"
                                                                      (EXPAND
                                                                       "disjoint?")
                                                                      (("1"
                                                                        (EXPAND
                                                                         "path_from?")
                                                                        (("1"
                                                                          (FLATTEN)
                                                                          (("1"
                                                                            (EXPAND
                                                                             "from?")
                                                                            (("1"
                                                                              (FLATTEN)
                                                                              (("1"
                                                                                (ASSERT)
                                                                                NIL)))))))))))))))))))
                                                             ("2"
                                                              (SKOSIMP*)
                                                              (("2"
                                                                (EXPAND
                                                                 "fseq")
                                                                (("2"
                                                                  (EXPAND
                                                                   "independent?")
                                                                  (("2"
                                                                    (INST
                                                                     -
                                                                     "l(p1!1)-2"
                                                                     "i!1")
                                                                    (("2"
                                                                      (ASSERT)
                                                                      (("2"
                                                                        (EXPAND
                                                                         "disjoint?")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "path_from?")
                                                                          (("2"
                                                                            (EXPAND
                                                                             "from?")
                                                                            (("2"
                                                                              (FLATTEN)
                                                                              (("2"
                                                                                (ASSERT)
                                                                                NIL)))))))))))))))))))))))))
                                                       ("2"
                                                        (EXPAND
                                                         "independent?")
                                                        (("2"
                                                          (INST
                                                           -
                                                           "l(p1!1)-2"
                                                           "l(p2!1)-2")
                                                          (("2"
                                                            (ASSERT)
                                                            NIL)))))))))))))))))))))))))))))))))))))
                       ("2" (LEMMA "pre20")
                        (("2" (INST?)
                          (("2" (ASSERT)
                            (("2" (FLATTEN)
                              (("2" (ASSERT) NIL)))))))))))))))))))))
           ("2" (HIDE 3)
            (("2" (HIDE -2 -4 -8)
              (("2" (LEMMA "line17")
                (("2" (INST?)
                  (("2" (EXPAND "H")
                    (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))
     ("2" (HIDE 3)
      (("2" (LEMMA "line15ab")
        (("2" (INST -1 "G!1" "t!1" "s!1" "w1!1" "w2!1")
          (("2" (REWRITE "separable?_comm")
            (("2" (REWRITE "dbl_comm")
              (("2" (REWRITE "sep_num_comm")
                (("1" (ASSERT)
                  (("1" (SPLIT -1)
                    (("1" (FLATTEN)
                      (("1" (SKOSIMP*)
                        (("1" (CASE-REPLACE "edge?(G!1)(w1!1, t!1)")
                          (("1" (ASSERT)
                            (("1" (LEMMA "line16")
                              (("1" (ASSERT)
                                (("1" (INST - "G!1" "s!1" "t!1" "w2!1" "w1!1")
                                  (("1" (ASSERT)
                                    (("1" (EXPAND "disjoint?")
                                      (("1"
                                        (FLATTEN)
                                        (("1"
                                          (EXPAND "in?")
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (ASSERT)
                                              (("1"
                                                (SKOSIMP*)
                                                (("1"
                                                  (INST 2 "yt!1")
                                                  (("1"
                                                    (EXPAND "H")
                                                    (("1"
                                                      (REWRITE
                                                       "del_vert_comm")
                                                      (("1"
                                                        (ASSERT)
                                                        NIL)))))))))))))))))))))))))))))
                           ("2" (ASSERT)
                            (("2" (LEMMA "line16")
                              (("2" (INST - "G!1" "s!1" "t!1" "w1!1" "w2!1")
                                (("2" (ASSERT)
                                  (("2" (REWRITE "dbl_comm")
                                    (("2" (ASSERT)
                                      (("2"
                                        (EXPAND "in?")
                                        (("2"
                                          (FLATTEN)
                                          (("2"
                                            (ASSERT)
                                            (("2"
                                              (SKOSIMP*)
                                              (("2"
                                                (INST 3 "yt!1")
                                                (("2"
                                                  (EXPAND "H")
                                                  (("2"
                                                    (ASSERT)
                                                    NIL)))))))))))))))))))))))))))))))
                     ("2" (EXPAND "in?")
                      (("2" (FLATTEN) (("2" (ASSERT) NIL)))))
                     ("3" (ASSERT)
                      (("3" (REWRITE "dbl_comm")
                        (("3" (HIDE 2 3)
                          (("3" (LEMMA "separates_comm")
                            (("3" (INST?) (("3" (ASSERT) NIL)))))))))))))))
                 ("2" (EXPAND "in?") (("2" (PROPAX) NIL)))
                 ("3" (EXPAND "in?") (("3" (PROPAX) NIL))))))))))))))))))))
$$$meng_scaff_prelude.pvs
meng_scaff_prelude[T: TYPE]: THEORY
BEGIN
   IMPORTING meng_scaff[T], sep_set_lems[T], meng_scaff_defs[T]
   G,MM: VAR graph[T]
   v,s,t,w1,w2: VAR T
   W: VAR finite_set[T]
   p,p1,p2: VAR prewalk
   i,j: VAR nat
   induction_step(G,s,t): bool = FORALL (GG: graph[T]): size(GG) < size(G)
                               IMPLIES FORALL (s: T, t: T):
                                          separable?(GG,s,t) AND
                                          sep_num(GG, s, t) = 2 AND
                                          vert(GG)(s) AND vert(GG)(t)
                                   IMPLIES (EXISTS (p1,p2: prewalk):
                                                  path_from?(GG,p1,s,t) AND
                                                  path_from?(GG,p2,s,t) AND
                                                  independent?(p1,p2))
   line20: LEMMA separable?(G,s,t) AND in?(G,s,t,w1,w2)
                   AND sep_num(G,s,t) = 2
                   AND separates(G, dbl(w1, w2), s, t)
                   AND disjoint?(s,t,w1,w2)
                   AND MM = meng(G,s,t,w1,w2)
                   AND induction_step(G,s,t)
                   AND NOT (edge?(G)(w1,t) AND edge?(G)(w2,t))
              IMPLIES
                  (EXISTS (P1,P2: prewalk):
                              path_from?(MM,P1,s,t) AND l(P1) > 2 AND
                              path_from?(MM,P2,s,t) AND l(P2) > 2 AND
                              seq(P1)(l(P1)-2) = w1 AND NOT verts_of(P1)(w2) AND
                              seq(P2)(l(P2)-2) = w2 AND NOT verts_of(P2)(w1) AND
                              independent?(P1,P2))
   Long_walk_from(G,s,v): TYPE = {w: Walk_from(G,s,v) | l(w) > 1}
   join2(G,s,t,v,(p1: Long_walk_from(G,s,v)),(p2: Walk_from(G,t,v))):
                                 Walk_from(G,s,t) = p1^(0,l(p1)-2) o rev(p2)
   path_meng_t  : LEMMA path_from?(G, p, s, t) AND l(p) > 0
                           IMPLIES (i < l(p) AND seq(p)(i) = t
                                      IMPLIES i = l(p) - 1)
   path_H_def   : LEMMA path?(H(G,s,w1,w2),p) AND j < l(p) IMPLIES
                           walk?(del_verts[T](G, dbl[T](w1, w2)), p^(0,j))
   path_H_ind   : LEMMA l(p1) > 1 AND l(p2) > 1 AND
                        path?(H(G,s,w1,w2),trunc1(p1)) AND
                        path?(H(G,t,w1,w2),trunc1(p2)) AND
                        separates(G, dbl(w1, w2), s, t) AND
                        seq(p1)(0) = s AND seq(p2)(0) = t
                      IMPLIES independent?(p1,p2)
   path_comps_ind3: LEMMA l(p1) > 2 AND l(p2) > 2 AND
                             path?(H(G,s,w1,w2),trunc1(trunc1(p1))) AND
                             path?(H(G,t,w1,w2),trunc1(trunc1(p2))) AND
                             separates(G, dbl(w1, w2), s, t) AND
                             seq(p1)(0) = s AND seq(p2)(0) = t
                           IMPLIES independent?(trunc1(p1),trunc1(p2))
   path_H_trunc: LEMMA l(p) >= 2 AND
                    path?(H(G, s, w1, w2), trunc1(p)) AND
                    from?(p, s, w1) AND
                    edge?(G)(p(l(p)-2),p(l(p)-1)) AND
                    vert(G)(s)  AND w1 /= s AND
                    vert(G)(t)  AND w2 /= s AND
                    vert(G)(w1) AND vert(G)(w2)
                 IMPLIES
                    path_from?[T](G, p, s, w1)
   meng_last: LEMMA l(p) > 2 AND
                    vert(G)(s)  AND w1 /= s AND w1 /= t AND
                    vert(G)(t)  AND w2 /= s AND w2 /= t AND
                    vert(G)(w1) AND vert(G)(w2) AND
                    path_from?(meng(G, s, t, w1, w2), p, s, t)
                  IMPLIES edge?(G)(seq(p)(l(p) - 3), seq(p)(l(p) - 2))
   ind_verts_W: LEMMA path_from?(G,p1,s,t) AND
                      path_from?(G,p2,t,s) AND
               	      l(p1) > 2 AND seq(p1)(l(p1) - 2) = w1 AND
               	      l(p2) > 2 AND seq(p2)(l(p2) - 2) = w2 AND
               	      independent?(p1,p2) AND
                      w1 /= s AND w1 /= t AND
                      w2 /= s AND w2 /= t
               IMPLIES NOT verts_of(p1)(w2) AND NOT verts_of(p2)(w1)
  ind_verts_w: LEMMA path_from?(G,p1,s,t) AND
                         path_from?(G,p2,s,t) AND
                  	      l(p1) > 2 AND seq(p1)(l(p1) - 2) = w1 AND
                  	      l(p2) > 2 AND seq(p2)(l(p2) - 2) = w2 AND
                  	      independent?(p1,p2) AND
                         w1 /= s AND w1 /= t AND
                         w2 /= s AND w2 /= t
                  IMPLIES NOT verts_of(p1)(w2) AND NOT verts_of(p2)(w1)
   path_meng_in: LEMMA l(p) > 2 AND
                       vert(G)(s) AND w1 /= s AND w1 /= t AND
                       vert(G)(t) AND w2 /= s AND w2 /= t AND
                       vert(G)(w1) AND vert(G)(w2) AND
                       path?(meng(G, s, t, w1, w2), p) AND
                       from?(p,s,t) AND
                       ((seq(p)(l(p) - 2) = w1 AND NOT verts_of(p)(w2)) OR
                        (seq(p)(l(p) - 2) = w2 AND NOT verts_of(p)(w1))    )
                   IMPLIES
                      path?(H(G, s, w1, w2), trunc1(trunc1(p)))
   disjoint?(w1,w2: prewalk): bool = (FORALL (i,j: nat):
                                     i < l(w1)  AND j < l(w2) IMPLIES
                                          seq(w1)(i) /= seq(w2)(j))
   join2_lem: LEMMA path_from?(G,p1,s,v) AND path_from?(G,p2,t,v) AND
                    s /= v AND t /= v AND s /= t AND
                    disjoint?(trunc1(p1),trunc1(p2))
                       IMPLIES path_from?(G,join2(G,s,t,v,p1,p2),s,t)
   path_from_to_walk_from: LEMMA path_from?(G,p,s,t) IMPLIES
                                     walk_from?(G,p,s,t)
   paths_H_disj: LEMMA path?(H(G, t, w1, w2), p2) AND
                            path?(H(G, s, w1, w2), p1) AND
                            separates(G, dbl(w1, w2), s, t) AND
                            seq(p1)(0) = s AND seq(p2)(0) = t AND s /= t
                       IMPLIES disjoint?(p1,p2)
   prelude: LEMMA separates(G, dbl(w1, w2), s, t) AND
                     separable?(G,s,t) AND
                     sep_num(G,s,t) = 2 AND
                     induction_step(G,s,t) AND
                     in?(G,s,t,w1,w2) AND
                     disjoint?(s,t,w1,w2) AND
                     NOT (edge?(G)(w1,s) AND edge?(G)(w2,s)) AND
                     NOT (edge?(G)(w1,t) AND edge?(G)(w2,t))
                   IMPLIES
                         (EXISTS (p1,p2: prewalk): path_from?(G,p1,s,t) AND
                                                  path_from?(G,p2,s,t) AND
                                                  independent?(p1,p2))
END meng_scaff_prelude
$$$meng_scaff_prelude.prf
(|meng_scaff_prelude|
 (|line20_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|line20_TCC2| "" (SKOSIMP*)
  (("" (EXPAND "in?") (("" (FLATTEN) (("" (PROPAX) NIL)))))))
 (|line20_TCC3| "" (SKOSIMP*)
  (("" (EXPAND "in?") (("" (FLATTEN) (("" (PROPAX) NIL)))))))
 (|line20_TCC4| "" (SKOSIMP*)
  (("" (EXPAND "in?")
    (("" (EXPAND "disjoint?") (("" (FLATTEN) (("" (ASSERT) NIL)))))))))
 (|line20_TCC5| "" (SKOSIMP*)
  (("" (EXPAND "in?")
    (("" (EXPAND "disjoint?") (("" (FLATTEN) (("" (ASSERT) NIL)))))))))
 (|line20_TCC6| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|line20_TCC7| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|line20| "" (SKOSIMP*)
  ((""
    (CASE "EXISTS (yt: T): vert(path_comp(del_vert(
                      del_vert(G!1,w1!1),w2!1),t!1))(yt) AND yt /= t!1")
    (("1" (HIDE 1)
      (("1" (SKOSIMP*)
        (("1" (CASE "size(MM!1) < size(G!1)")
          (("1" (EXPAND "induction_step")
            (("1" (INST - "MM!1")
              (("1" (ASSERT)
                (("1" (INST - "s!1" "t!1")
                  (("1" (ASSERT)
                    (("1"
                      (CASE "separable?(MM!1, s!1, t!1)
             AND sep_num(MM!1, s!1, t!1) = 2
             AND vert(MM!1)(s!1) AND vert(MM!1)(t!1)")
                      (("1" (FLATTEN)
                        (("1" (ASSERT)
                          (("1" (SKOSIMP*)
                            (("1" (HIDE -1 -2 -3 -4 -5 -9 -10)
                              (("1"
                                (LEMMA "line19")
                                (("1"
                                  (INST?)
                                  (("1"
                                    (INST-CP -1 "p1!1")
                                    (("1"
                                      (INST -1 "p2!1")
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (FLATTEN)
                                          (("1"
                                            (SPLIT -2)
                                            (("1"
                                              (ASSERT)
                                              (("1"
                                                (CASE
                                                 "seq(p1!1)(l(p1!1) - 2) = w2!1")
                                                (("1"
                                                  (ASSERT)
                                                  (("1"
                                                    (HIDE -5 1)
                                                    (("1"
                                                      (INST
                                                       1
                                                       "p2!1"
                                                       "p1!1")
                                                      (("1"
                                                        (ASSERT)
                                                        (("1"
                                                          (LEMMA
                                                           "independent?_comm")
                                                          (("1"
                                                            (INST
                                                             -
                                                             "p1!1"
                                                             "p2!1")
                                                            (("1"
                                                              (ASSERT)
                                                              (("1"
                                                                (HIDE
                                                                 -1
                                                                 -4
                                                                 -5
                                                                 -6
                                                                 -7)
                                                                (("1"
                                                                  (EXPAND
                                                                   "independent?")
                                                                  (("1"
                                                                    (EXPAND
                                                                     "verts_of")
                                                                    (("1"
                                                                      (SPLIT
                                                                       1)
                                                                      (("1"
                                                                        (SKOSIMP*)
                                                                        (("1"
                                                                          (EXPAND
                                                                           "fseq")
                                                                          (("1"
                                                                            (INST
                                                                             -
                                                                             "l(p1!1)-2"
                                                                             "i!1")
                                                                            (("1"
                                                                              (ASSERT)
                                                                              (("1"
                                                                                (TYPEPRED
                                                                                 "i!1")
                                                                                (("1"
                                                                                  (EXPAND
                                                                                   "path_from?")
                                                                                  (("1"
                                                                                    (FLATTEN)
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "disjoint?")
                                                                                      (("1"
                                                                                        (FLATTEN)
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "from?")
                                                                                          (("1"
                                                                                            (FLATTEN)
                                                                                            (("1"
                                                                                              (ASSERT)
                                                                                              NIL)))))))))))))))))))))))
                                                                       ("2"
                                                                        (SKOSIMP*)
                                                                        (("2"
                                                                          (EXPAND
                                                                           "fseq")
                                                                          (("2"
                                                                            (INST
                                                                             -
                                                                             "i!1"
                                                                             "l(p2!1)-2")
                                                                            (("2"
                                                                              (ASSERT)
                                                                              (("2"
                                                                                (EXPAND
                                                                                 "path_from?")
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "disjoint?")
                                                                                  (("2"
                                                                                    (FLATTEN)
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "from?")
                                                                                      (("2"
                                                                                        (FLATTEN)
                                                                                        (("2"
                                                                                          (ASSERT)
                                                                                          NIL)))))))))))))))))))))))))))))))))))))))))
                                                 ("2"
                                                  (HIDE -5 -6 2 3)
                                                  (("2"
                                                    (EXPAND
                                                     "independent?")
                                                    (("2"
                                                      (INST
                                                       -
                                                       "l(p1!1)-2"
                                                       "l(p2!1)-2")
                                                      (("2"
                                                        (ASSERT)
                                                        NIL)))))))))))
                                             ("2"
                                              (ASSERT)
                                              (("2"
                                                (HIDE -5 -6 1)
                                                (("2"
                                                  (INST
                                                   1
                                                   "p1!1"
                                                   "p2!1")
                                                  (("2"
                                                    (ASSERT)
                                                    (("2"
                                                      (SPLIT -4)
                                                      (("1"
                                                        (ASSERT)
                                                        (("1"
                                                          (EXPAND
                                                           "verts_of")
                                                          (("1"
                                                            (SPLIT 1)
                                                            (("1"
                                                              (SKOSIMP*)
                                                              (("1"
                                                                (EXPAND
                                                                 "fseq")
                                                                (("1"
                                                                  (EXPAND
                                                                   "independent?")
                                                                  (("1"
                                                                    (INST
                                                                     -
                                                                     "i!1"
                                                                     "l(p2!1)-2")
                                                                    (("1"
                                                                      (EXPAND
                                                                       "disjoint?")
                                                                      (("1"
                                                                        (EXPAND
                                                                         "path_from?")
                                                                        (("1"
                                                                          (FLATTEN)
                                                                          (("1"
                                                                            (EXPAND
                                                                             "from?")
                                                                            (("1"
                                                                              (FLATTEN)
                                                                              (("1"
                                                                                (ASSERT)
                                                                                NIL)))))))))))))))))))
                                                             ("2"
                                                              (SKOSIMP*)
                                                              (("2"
                                                                (EXPAND
                                                                 "fseq")
                                                                (("2"
                                                                  (EXPAND
                                                                   "independent?")
                                                                  (("2"
                                                                    (INST
                                                                     -
                                                                     "l(p1!1)-2"
                                                                     "i!1")
                                                                    (("2"
                                                                      (ASSERT)
                                                                      (("2"
                                                                        (EXPAND
                                                                         "disjoint?")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "path_from?")
                                                                          (("2"
                                                                            (EXPAND
                                                                             "from?")
                                                                            (("2"
                                                                              (FLATTEN)
                                                                              (("2"
                                                                                (ASSERT)
                                                                                NIL)))))))))))))))))))))))))
                                                       ("2"
                                                        (EXPAND
                                                         "independent?")
                                                        (("2"
                                                          (INST
                                                           -
                                                           "l(p1!1)-2"
                                                           "l(p2!1)-2")
                                                          (("2"
                                                            (ASSERT)
                                                            NIL)))))))))))))))))))))))))))))))))))))
                       ("2" (LEMMA "pre20")
                        (("2" (INST?)
                          (("2" (ASSERT)
                            (("2" (FLATTEN)
                              (("2" (ASSERT) NIL)))))))))))))))))))))
           ("2" (HIDE 3)
            (("2" (HIDE -2 -4 -8)
              (("2" (LEMMA "line17")
                (("2" (INST?)
                  (("2" (EXPAND "H")
                    (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))
     ("2" (HIDE 3)
      (("2" (LEMMA "line15ab")
        (("2" (INST -1 "G!1" "t!1" "s!1" "w1!1" "w2!1")
          (("2" (REWRITE "separable?_comm")
            (("2" (REWRITE "dbl_comm")
              (("2" (REWRITE "sep_num_comm")
                (("1" (ASSERT)
                  (("1" (SPLIT -1)
                    (("1" (FLATTEN)
                      (("1" (SKOSIMP*)
                        (("1" (CASE-REPLACE "edge?(G!1)(w1!1, t!1)")
                          (("1" (ASSERT)
                            (("1" (LEMMA "line16")
                              (("1"
                                (ASSERT)
                                (("1"
                                  (INST
                                   -
                                   "G!1"
                                   "s!1"
                                   "t!1"
                                   "w2!1"
                                   "w1!1")
                                  (("1"
                                    (ASSERT)
                                    (("1"
                                      (EXPAND "disjoint?")
                                      (("1"
                                        (FLATTEN)
                                        (("1"
                                          (EXPAND "in?")
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (ASSERT)
                                              (("1"
                                                (SKOSIMP*)
                                                (("1"
                                                  (INST 2 "yt!1")
                                                  (("1"
                                                    (EXPAND "H")
                                                    (("1"
                                                      (REWRITE
                                                       "del_vert_comm")
                                                      (("1"
                                                        (ASSERT)
                                                        NIL)))))))))))))))))))))))))))))
                           ("2" (ASSERT)
                            (("2" (LEMMA "line16")
                              (("2"
                                (INST
                                 -
                                 "G!1"
                                 "s!1"
                                 "t!1"
                                 "w1!1"
                                 "w2!1")
                                (("2"
                                  (ASSERT)
                                  (("2"
                                    (REWRITE "dbl_comm")
                                    (("2"
                                      (ASSERT)
                                      (("2"
                                        (EXPAND "in?")
                                        (("2"
                                          (FLATTEN)
                                          (("2"
                                            (ASSERT)
                                            (("2"
                                              (SKOSIMP*)
                                              (("2"
                                                (INST 3 "yt!1")
                                                (("2"
                                                  (EXPAND "H")
                                                  (("2"
                                                    (ASSERT)
                                                    NIL)))))))))))))))))))))))))))))))
                     ("2" (EXPAND "in?")
                      (("2" (FLATTEN) (("2" (ASSERT) NIL)))))
                     ("3" (ASSERT)
                      (("3" (REWRITE "dbl_comm")
                        (("3" (HIDE 2 3)
                          (("3" (LEMMA "separates_comm")
                            (("3" (INST?)
                              (("3" (ASSERT) NIL)))))))))))))))
                 ("2" (EXPAND "in?") (("2" (PROPAX) NIL)))
                 ("3" (EXPAND "in?")
                  (("3" (PROPAX) NIL)))))))))))))))))))
 (|join2_TCC1| "" (SUBTYPE-TCC) NIL)
 (|join2_TCC2| "" (SKOSIMP*)
  (("" (EXPAND "^")
    (("" (EXPAND "o ")
      (("" (EXPAND "rev")
        (("" (TYPEPRED "p2!1")
          (("" (TYPEPRED "p1!1")
            (("" (LEMMA "walk_concat")
              (("" (INST?)
                (("" (INST -1 "t!1" "p2!1")
                  (("" (ASSERT)
                    (("" (HIDE -3 -5)
                      (("" (EXPAND "o ")
                        (("" (EXPAND "rev")
                          (("" (EXPAND "^")
                            (("" (EXPAND "walk_from?")
                              ((""
                                (FLATTEN)
                                ((""
                                  (ASSERT)
                                  ((""
                                    (EXPAND "walk?")
                                    ((""
                                      (EXPAND "fseq")
                                      ((""
                                        (FLATTEN)
                                        ((""
                                          (SPLIT +)
                                          (("1"
                                            (HIDE -4)
                                            (("1"
                                              (EXPAND "verts_in?")
                                              (("1" (PROPAX) NIL)))))
                                           ("2"
                                            (PROPAX)
                                            NIL)))))))))))))))))))))))))))))))))))))))))))
 (|path_meng_t| "" (SKOSIMP*)
  (("" (EXPAND "path_from?")
    (("" (FLATTEN)
      (("" (EXPAND "from?")
        (("" (FLATTEN)
          (("" (EXPAND "path?")
            (("" (FLATTEN)
              (("" (EXPAND "fseq")
                (("" (INST - "i!1" "l(p!1) - 1")
                  (("" (ASSERT) NIL)))))))))))))))))))
 (|path_H_def_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|path_H_def_TCC2| "" (SUBTYPE-TCC) NIL)
 (|path_H_def_TCC3| "" (SUBTYPE-TCC) NIL)
 (|path_H_def| "" (SKOSIMP*)
  (("" (LEMMA "path_H_W")
    (("" (INST?)
      (("" (ASSERT)
        (("" (FLATTEN)
          (("" (EXPAND "path?")
            (("" (FLATTEN)
              (("" (HIDE -2)
                (("" (EXPAND "H")
                  (("" (EXPAND "walk?")
                    (("" (FLATTEN)
                      (("" (SPLIT +)
                        (("1" (HIDE -2)
                          (("1" (EXPAND "verts_in?")
                            (("1" (SKOSIMP*)
                              (("1"
                                (EXPAND "del_verts")
                                (("1"
                                  (EXPAND "difference")
                                  (("1"
                                    (EXPAND "member")
                                    (("1"
                                      (EXPAND "dbl")
                                      (("1"
                                        (EXPAND "^")
                                        (("1"
                                          (INST?)
                                          (("1"
                                            (EXPAND "path_comp")
                                            (("1"
                                              (EXPAND "subgraph")
                                              (("1"
                                                (FLATTEN)
                                                (("1"
                                                  (HIDE -2)
                                                  (("1"
                                                    (EXPAND "del_vert")
                                                    (("1"
                                                      (EXPAND "remove")
                                                      (("1"
                                                        (EXPAND
                                                         "member")
                                                        (("1"
                                                          (ASSERT)
                                                          (("1"
                                                            (FLATTEN)
                                                            (("1"
                                                              (ASSERT)
                                                              NIL)))))))))))))))))))
                                           ("2"
                                            (TYPEPRED "i!1")
                                            (("2"
                                              (EXPAND "^")
                                              (("2"
                                                (ASSERT)
                                                NIL)))))))))))))))))))))))
                         ("2" (SKOSIMP*)
                          (("2" (HIDE -2)
                            (("2" (EXPAND "fseq")
                              (("2"
                                (EXPAND "^")
                                (("2"
                                  (EXPAND "edge?")
                                  (("2"
                                    (INST?)
                                    (("2"
                                      (ASSERT)
                                      (("2"
                                        (FLATTEN)
                                        (("2"
                                          (ASSERT)
                                          (("2"
                                            (EXPAND "del_verts")
                                            (("2"
                                              (SPLIT 1)
                                              (("1"
                                                (EXPAND "path_comp")
                                                (("1"
                                                  (EXPAND "subgraph")
                                                  (("1"
                                                    (FLATTEN)
                                                    (("1"
                                                      (EXPAND
                                                       "del_vert")
                                                      (("1"
                                                        (FLATTEN)
                                                        (("1"
                                                          (PROPAX)
                                                          NIL)))))))))))
                                               ("2"
                                                (SKOSIMP*)
                                                (("2"
                                                  (EXPAND "dbl")
                                                  (("2"
                                                    (SPLIT -1)
                                                    (("1"
                                                      (EXPAND
                                                       "verts_of")
                                                      (("1"
                                                        (EXPAND "fseq")
                                                        (("1"
                                                          (REPLACE -1)
                                                          (("1"
                                                            (HIDE -1)
                                                            (("1"
                                                              (SPLIT
                                                               -1)
                                                              (("1"
                                                                (HIDE
                                                                 -3)
                                                                (("1"
                                                                  (INST?)
                                                                  (("1"
                                                                    (ASSERT)
                                                                    NIL)))))
                                                               ("2"
                                                                (INST?)
                                                                (("2"
                                                                  (ASSERT)
                                                                  NIL)))))))))))))
                                                     ("2"
                                                      (REPLACE -1)
                                                      (("2"
                                                        (HIDE -1)
                                                        (("2"
                                                          (EXPAND
                                                           "verts_of")
                                                          (("2"
                                                            (EXPAND
                                                             "fseq")
                                                            (("2"
                                                              (HIDE 1)
                                                              (("2"
                                                                (SPLIT
                                                                 -1)
                                                                (("1"
                                                                  (INST?)
                                                                  (("1"
                                                                    (ASSERT)
                                                                    NIL)))
                                                                 ("2"
                                                                  (INST?)
                                                                  (("2"
                                                                    (ASSERT)
                                                                    NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 (|path_H_ind_TCC1| "" (SUBTYPE-TCC) NIL)
 (|path_H_ind_TCC2| "" (SUBTYPE-TCC) NIL)
 (|path_H_ind_TCC3| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|path_H_ind_TCC4| "" (SUBTYPE-TCC) NIL)
 (|path_H_ind_TCC5| "" (SUBTYPE-TCC) NIL)
 (|path_H_ind| "" (SKOSIMP*)
  (("" (EXPAND "independent?")
    (("" (SKOSIMP*)
      (("" (EXPAND "separates")
        (("" (FLATTEN)
          ((""
            (CASE "walk_from?[T](del_verts[T](G!1, dbl[T](w1!1, w2!1)),
                    p1!1^(0,i!1), s!1, seq(p1!1)(i!1))")
            (("1"
              (CASE "walk_from?[T](del_verts[T](G!1, dbl[T](w1!1, w2!1)),
                    p2!1^(0,j!1), t!1, seq(p2!1)(j!1))")
              (("1"
                (NAME-REPLACE "DV" "del_verts(G!1, dbl(w1!1, w2!1))")
                (("1"
                  (INST +
                   "join2(DV,s!1,t!1,seq(p2!1)(j!1),p1!1^(0,i!1),p2!1^(0,j!1))")
                  (("1" (ASSERT) NIL)
                   ("2" (ASSERT)
                    (("2" (EXPAND "^") (("2" (ASSERT) NIL)))))
                   ("3" (ASSERT)
                    (("3" (EXPAND "^" 1) (("3" (PROPAX) NIL)))))
                   ("4" (ASSERT) NIL) ("5" (ASSERT) NIL)))))
               ("2" (HIDE -1 4)
                (("2" (EXPAND "walk_from?")
                  (("2" (SPLIT 1)
                    (("1" (EXPAND "^") (("1" (PROPAX) NIL)))
                     ("2" (EXPAND "^") (("2" (PROPAX) NIL)))
                     ("3" (LEMMA "path_H_def")
                      (("3"
                        (INST -1 "G!1" "j!1" "trunc1(p2!1)" "t!1"
                         "w1!1" "w2!1")
                        (("1" (ASSERT)
                          (("1" (EXPAND "trunc1" -1)
                            (("1" (EXPAND "^")
                              (("1" (PROPAX) NIL)))))))
                         ("2" (ASSERT) NIL)))))))))))
               ("3" (EXPAND "^" 1) (("3" (ASSERT) NIL)))
               ("4" (ASSERT) NIL)))
             ("2" (EXPAND "walk_from?")
              (("2" (SPLIT 1)
                (("1" (EXPAND "^" 1) (("1" (PROPAX) NIL)))
                 ("2" (EXPAND "^") (("2" (PROPAX) NIL)))
                 ("3" (LEMMA "path_H_def")
                  (("3"
                    (INST -1 "G!1" "i!1" "trunc1(p1!1)" "s!1" "w1!1"
                     "w2!1")
                    (("1" (ASSERT)
                      (("1" (EXPAND "trunc1")
                        (("1" (EXPAND "^") (("1" (PROPAX) NIL)))))))
                     ("2" (ASSERT) NIL)))))))))
             ("3" (EXPAND "^") (("3" (ASSERT) NIL))) ("4" (ASSERT) NIL)
             ("5" (REWRITE "finite_dbl") NIL)))))))))))))
 (|path_comps_ind3_TCC1| "" (SUBTYPE-TCC) NIL)
 (|path_comps_ind3_TCC2| "" (SUBTYPE-TCC) NIL)
 (|path_comps_ind3_TCC3| "" (SUBTYPE-TCC) NIL)
 (|path_comps_ind3_TCC4| "" (SUBTYPE-TCC) NIL)
 (|path_comps_ind3_TCC5| "" (SKOSIMP*)
  (("" (REWRITE "finite_dbl") NIL)))
 (|path_comps_ind3_TCC6| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|path_comps_ind3_TCC7| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|path_comps_ind3| "" (SKOSIMP*)
  (("" (LEMMA "path_H_ind")
    (("" (INST?)
      (("1" (ASSERT)
        (("1" (INST -1 "trunc1(p2!1)" "t!1")
          (("1" (ASSERT)
            (("1" (HIDE -3 -4 -5 2)
              (("1" (EXPAND "trunc1")
                (("1" (EXPAND "^") (("1" (PROPAX) NIL)))))))))))))
       ("2" (ASSERT) NIL)))))))
 (|path_H_trunc_TCC1| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|path_H_trunc_TCC2| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|path_H_trunc| "" (SKOSIMP*)
  (("" (LEMMA "path_comp_in")
    (("" (INST?)
      (("" (ASSERT)
        (("" (LEMMA "path_H_W")
          (("" (INST?)
            (("" (ASSERT)
              (("" (FLATTEN)
                (("" (EXPAND "path_from?")
                  (("" (HIDE -3)
                    (("" (EXPAND "path?")
                      (("" (FLATTEN)
                        (("" (SPLIT +)
                          (("1" (EXPAND "walk?")
                            (("1" (SPLIT +)
                              (("1"
                                (FLATTEN)
                                (("1"
                                  (EXPAND "verts_in?")
                                  (("1"
                                    (SKOSIMP*)
                                    (("1"
                                      (HIDE -2 -3)
                                      (("1"
                                        (INST?)
                                        (("1"
                                          (EXPAND "trunc1")
                                          (("1"
                                            (EXPAND "^")
                                            (("1" (PROPAX) NIL)))))
                                         ("2"
                                          (EXPAND "trunc1")
                                          (("2"
                                            (EXPAND "^")
                                            (("2"
                                              (EXPAND "fseq")
                                              (("2"
                                                (TYPEPRED "i!1")
                                                (("2"
                                                  (CASE-REPLACE
                                                   "i!1 = l(p!1) - 1")
                                                  (("1"
                                                    (HIDE -1 -2 -3 1)
                                                    (("1"
                                                      (TYPEPRED "G!1")
                                                      (("1"
                                                        (EXPAND
                                                         "edge?")
                                                        (("1"
                                                          (FLATTEN)
                                                          (("1"
                                                            (INST?)
                                                            (("1"
                                                              (ASSERT)
                                                              (("1"
                                                                (INST?)
                                                                (("1"
                                                                  (EXPAND
                                                                   "dbl")
                                                                  (("1"
                                                                    (PROPAX)
                                                                    NIL)))))))
                                                             ("2"
                                                              (INST?)
                                                              (("2"
                                                                (ASSERT)
                                                                NIL)))))))))))))
                                                   ("2"
                                                    (ASSERT)
                                                    NIL)))))))))))))))))))))
                               ("2"
                                (FLATTEN)
                                (("2"
                                  (SKOSIMP*)
                                  (("2"
                                    (EXPAND "fseq")
                                    (("2"
                                      (HIDE -4)
                                      (("2"
                                        (INST -3 "n!1")
                                        (("2"
                                          (ASSERT)
                                          (("2"
                                            (EXPAND "trunc1")
                                            (("2"
                                              (EXPAND "^")
                                              (("2"
                                                (PROPAX)
                                                NIL)))))))))))))))))))))
                           ("2" (SKOSIMP*)
                            (("2" (EXPAND "fseq")
                              (("2"
                                (INST - "i!1" "j!1")
                                (("1"
                                  (ASSERT)
                                  (("1"
                                    (HIDE -2)
                                    (("1"
                                      (EXPAND "trunc1")
                                      (("1"
                                        (EXPAND "^")
                                        (("1" (ASSERT) NIL)))))))))
                                 ("2"
                                  (EXPAND "trunc1")
                                  (("2"
                                    (EXPAND "^")
                                    (("2"
                                      (ASSERT)
                                      (("2"
                                        (HIDE -2)
                                        (("2"
                                          (TYPEPRED "j!1")
                                          (("2"
                                            (CASE-REPLACE
                                             "j!1 = l(p!1) - 1")
                                            (("1"
                                              (EXPAND "from?")
                                              (("1"
                                                (FLATTEN)
                                                (("1"
                                                  (REPLACE -6)
                                                  (("1"
                                                    (EXPAND "verts_of")
                                                    (("1"
                                                      (EXPAND "fseq")
                                                      (("1"
                                                        (INST?)
                                                        NIL)))))))))))
                                             ("2"
                                              (EXPAND "from?")
                                              (("2"
                                                (FLATTEN)
                                                (("2"
                                                  (HIDE 4)
                                                  (("2"
                                                    (EXPAND "verts_of")
                                                    (("2"
                                                      (EXPAND "fseq")
                                                      (("2"
                                                        (INST?)
                                                        (("2"
                                                          (ASSERT)
                                                          NIL)))))))))))))))))))))))))
                                 ("3"
                                  (EXPAND "trunc1")
                                  (("3"
                                    (EXPAND "^")
                                    (("3"
                                      (ASSERT)
                                      (("3"
                                        (CASE "i!1 = l(p!1) - 1")
                                        (("1"
                                          (REPLACE -1)
                                          (("1"
                                            (EXPAND "from?")
                                            (("1"
                                              (FLATTEN)
                                              (("1"
                                                (REPLACE -6)
                                                (("1"
                                                  (EXPAND "verts_of")
                                                  (("1"
                                                    (EXPAND "fseq")
                                                    (("1"
                                                      (INST 3 "j!1")
                                                      (("1"
                                                        (ASSERT)
                                                        NIL)))))))))))))))
                                         ("2"
                                          (ASSERT)
                                          NIL)))))))))))))))))))))))))))))))))))))))))
 (|meng_last_TCC1| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|meng_last_TCC2| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|meng_last_TCC3| "" (SUBTYPE-TCC) NIL)
 (|meng_last_TCC4| "" (SUBTYPE-TCC) NIL)
 (|meng_last| "" (SKOSIMP*)
  (("" (LEMMA "path_meng_t")
    (("" (INST?)
      (("1" (ASSERT)
        (("1" (ASSERT)
          (("1" (HIDE -1)
            (("1" (EXPAND "path_from?")
              (("1" (FLATTEN)
                (("1" (HIDE -7 -8)
                  (("1" (EXPAND "path?")
                    (("1" (FLATTEN)
                      (("1" (HIDE -7)
                        (("1" (EXPAND "walk?")
                          (("1" (FLATTEN)
                            (("1" (EXPAND "fseq")
                              (("1"
                                (INST?)
                                (("1"
                                  (ASSERT)
                                  (("1"
                                    (HIDE -6)
                                    (("1"
                                      (EXPAND "edge?")
                                      (("1"
                                        (FLATTEN)
                                        (("1"
                                          (ASSERT)
                                          (("1"
                                            (EXPAND "meng")
                                            (("1"
                                              (EXPAND "union")
                                              (("1"
                                                (EXPAND "add")
                                                (("1"
                                                  (EXPAND "member")
                                                  (("1"
                                                    (SPLIT -)
                                                    (("1"
                                                      (ASSERT)
                                                      (("1"
                                                        (LEMMA
                                                         "dbl_eq")
                                                        (("1"
                                                          (INST?)
                                                          (("1"
                                                            (ASSERT)
                                                            (("1"
                                                              (HIDE -2)
                                                              (("1"
                                                                (REVEAL
                                                                 -7)
                                                                (("1"
                                                                  (SPLIT
                                                                   -)
                                                                  (("1"
                                                                    (FLATTEN)
                                                                    (("1"
                                                                      (HIDE
                                                                       -1)
                                                                      (("1"
                                                                        (INST?)
                                                                        (("1"
                                                                          (ASSERT)
                                                                          NIL)))))))
                                                                   ("2"
                                                                    (FLATTEN)
                                                                    (("2"
                                                                      (HIDE
                                                                       -1)
                                                                      (("2"
                                                                        (INST?)
                                                                        (("2"
                                                                          (ASSERT)
                                                                          NIL)))))))))))))))))))))
                                                     ("2"
                                                      (LEMMA "dbl_eq")
                                                      (("2"
                                                        (INST?)
                                                        (("2"
                                                          (ASSERT)
                                                          (("2"
                                                            (HIDE -2)
                                                            (("2"
                                                              (REVEAL
                                                               -7)
                                                              (("2"
                                                                (SPLIT
                                                                 -)
                                                                (("1"
                                                                  (FLATTEN)
                                                                  (("1"
                                                                    (HIDE
                                                                     -1)
                                                                    (("1"
                                                                      (INST?)
                                                                      (("1"
                                                                        (ASSERT)
                                                                        NIL)))))))
                                                                 ("2"
                                                                  (FLATTEN)
                                                                  (("2"
                                                                    (HIDE
                                                                     -1)
                                                                    (("2"
                                                                      (INST?)
                                                                      (("2"
                                                                        (ASSERT)
                                                                        NIL)))))))))))))))))))
                                                     ("3"
                                                      (EXPAND "H")
                                                      (("3"
                                                        (EXPAND
                                                         "path_comp")
                                                        (("3"
                                                          (EXPAND
                                                           "subgraph")
                                                          (("3"
                                                            (FLATTEN)
                                                            (("3"
                                                              (HIDE -2)
                                                              (("3"
                                                                (EXPAND
                                                                 "del_vert")
                                                                (("3"
                                                                  (PROPAX)
                                                                  NIL)))))))))))))
                                                     ("4"
                                                      (EXPAND
                                                       "incident")
                                                      (("4"
                                                        (PROPAX)
                                                        NIL)))
                                                     ("5"
                                                      (EXPAND
                                                       "incident")
                                                      (("5"
                                                        (PROPAX)
                                                        NIL)))))))))))))))))))))))))))))))))))))))))))))))))
       ("2" (ASSERT) NIL) ("3" (ASSERT) NIL)))))))
 (|ind_verts_W_TCC1| "" (SUBTYPE-TCC) NIL)
 (|ind_verts_W_TCC2| "" (SUBTYPE-TCC) NIL)
 (|ind_verts_W| "" (SKOSIMP*)
  (("" (EXPAND "path_from?")
    (("" (FLATTEN)
      (("" (EXPAND "from?")
        (("" (FLATTEN)
          (("" (EXPAND "independent?")
            (("" (SPLIT +)
              (("1" (EXPAND "verts_of")
                (("1" (EXPAND "fseq")
                  (("1" (SKOSIMP*)
                    (("1" (INST - "i!1" "l(p2!1) - 2")
                      (("1" (ASSERT) NIL) ("2" (ASSERT) NIL)))))))))
               ("2" (EXPAND "verts_of")
                (("2" (SKOSIMP*)
                  (("2" (EXPAND "fseq")
                    (("2" (INST - "l(p1!1) - 2" "i!1")
                      (("1" (ASSERT) NIL)
                       ("2" (ASSERT) NIL)))))))))))))))))))))))
 (|ind_verts_w_TCC1| "" (SUBTYPE-TCC) NIL)
 (|ind_verts_w_TCC2| "" (SUBTYPE-TCC) NIL)
 (|ind_verts_w| "" (SKOSIMP*)
  (("" (EXPAND "path_from?")
    (("" (FLATTEN)
      (("" (EXPAND "from?")
        (("" (FLATTEN)
          (("" (EXPAND "independent?")
            (("" (SPLIT +)
              (("1" (EXPAND "verts_of")
                (("1" (EXPAND "fseq")
                  (("1" (SKOSIMP*)
                    (("1" (INST - "i!1" "l(p2!1) - 2")
                      (("1" (ASSERT) NIL) ("2" (ASSERT) NIL)))))))))
               ("2" (EXPAND "verts_of")
                (("2" (SKOSIMP*)
                  (("2" (EXPAND "fseq")
                    (("2" (INST - "l(p1!1) - 2" "i!1")
                      (("1" (ASSERT) NIL)
                       ("2" (ASSERT) NIL)))))))))))))))))))))))
 (|path_meng_in_TCC1| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|path_meng_in_TCC2| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|path_meng_in_TCC3| "" (SUBTYPE-TCC) NIL)
 (|path_meng_in| "" (SKOSIMP*)
  (("" (EXPAND "path?")
    (("" (FLATTEN)
      (("" (SPLIT +)
        (("1" (EXPAND "walk?")
          (("1" (FLATTEN)
            (("1" (SPLIT +)
              (("1" (EXPAND "verts_in?")
                (("1" (SKOSIMP*)
                  (("1" (TYPEPRED "i!1")
                    (("1" (EXPAND "trunc1")
                      (("1" (EXPAND "^")
                        (("1" (ASSERT)
                          (("1" (HIDE -8)
                            (("1" (EXPAND "fseq")
                              (("1"
                                (INST?)
                                (("1"
                                  (EXPAND "meng")
                                  (("1"
                                    (EXPAND "add")
                                    (("1"
                                      (EXPAND "member")
                                      (("1"
                                        (SPLIT -7)
                                        (("1"
                                          (EXPAND "from?")
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (INST
                                               -
                                               "i!1"
                                               "l(p!1) - 1")
                                              (("1" (ASSERT) NIL)))))))
                                         ("2"
                                          (SPLIT -10)
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (INST
                                               -
                                               "i!1"
                                               "l(p!1) - 2")
                                              (("1" (ASSERT) NIL)))))
                                           ("2"
                                            (FLATTEN)
                                            (("2"
                                              (EXPAND "verts_of")
                                              (("2"
                                                (EXPAND "fseq")
                                                (("2"
                                                  (INST + "i!1")
                                                  (("2"
                                                    (ASSERT)
                                                    NIL)))))))))))
                                         ("3"
                                          (SPLIT -10)
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (EXPAND "verts_of")
                                              (("1"
                                                (INST + "i!1")
                                                (("1"
                                                  (EXPAND "fseq")
                                                  (("1"
                                                    (ASSERT)
                                                    NIL)))))))))
                                           ("2"
                                            (FLATTEN)
                                            (("2"
                                              (INST
                                               -
                                               "i!1"
                                               "l(p!1) - 2")
                                              (("2"
                                                (ASSERT)
                                                NIL)))))))))))))))))))))))))))
                     ("2" (SKOSIMP*)
                      (("2" (EXPAND "trunc1" 1)
                        (("2" (EXPAND "^") (("2" (ASSERT) NIL)))))))
                     ("3" (SKOSIMP*) (("3" (ASSERT) NIL)))))))))
               ("2" (EXPAND "fseq")
                (("2" (EXPAND "trunc1")
                  (("2" (SKOSIMP*)
                    (("2" (EXPAND "^")
                      (("2" (ASSERT)
                        (("2" (INST?)
                          (("2" (ASSERT)
                            (("2" (HIDE -7)
                              (("2"
                                (EXPAND "meng")
                                (("2"
                                  (EXPAND "edge?")
                                  (("2"
                                    (FLATTEN)
                                    (("2"
                                      (ASSERT)
                                      (("2"
                                        (EXPAND "union")
                                        (("2"
                                          (EXPAND "add")
                                          (("2"
                                            (EXPAND "member")
                                            (("2"
                                              (SPLIT -7)
                                              (("1"
                                                (LEMMA "dbl_eq")
                                                (("1"
                                                  (INST?)
                                                  (("1"
                                                    (ASSERT)
                                                    (("1"
                                                      (HIDE -2)
                                                      (("1"
                                                        (SPLIT -1)
                                                        (("1"
                                                          (FLATTEN)
                                                          (("1"
                                                            (EXPAND
                                                             "from?")
                                                            (("1"
                                                              (FLATTEN)
                                                              (("1"
                                                                (INST
                                                                 -
                                                                 "1 + n!1"
                                                                 "l(p!1) - 1")
                                                                (("1"
                                                                  (ASSERT)
                                                                  NIL)))))))))
                                                         ("2"
                                                          (FLATTEN)
                                                          (("2"
                                                            (INST
                                                             -
                                                             "n!1"
                                                             "l(p!1) - 1")
                                                            (("2"
                                                              (ASSERT)
                                                              (("2"
                                                                (EXPAND
                                                                 "from?")
                                                                (("2"
                                                                  (PROPAX)
                                                                  NIL)))))))))))))))))))
                                               ("2"
                                                (EXPAND "from?")
                                                (("2"
                                                  (FLATTEN)
                                                  (("2"
                                                    (LEMMA "dbl_eq")
                                                    (("2"
                                                      (INST?)
                                                      (("2"
                                                        (ASSERT)
                                                        (("2"
                                                          (HIDE -2)
                                                          (("2"
                                                            (SPLIT -1)
                                                            (("1"
                                                              (FLATTEN)
                                                              (("1"
                                                                (INST
                                                                 -
                                                                 "1 + n!1"
                                                                 "l(p!1) - 1")
                                                                (("1"
                                                                  (ASSERT)
                                                                  NIL)))))
                                                             ("2"
                                                              (FLATTEN)
                                                              (("2"
                                                                (INST
                                                                 -
                                                                 "n!1"
                                                                 "l(p!1) - 1")
                                                                (("2"
                                                                  (ASSERT)
                                                                  NIL)))))))))))))))))))
                                               ("3"
                                                (EXPAND "incident")
                                                (("3"
                                                  (SKOSIMP*)
                                                  (("3"
                                                    (HIDE -1)
                                                    (("3"
                                                      (LEMMA "dbl_eq")
                                                      (("3"
                                                        (INST?)
                                                        (("3"
                                                          (ASSERT)
                                                          (("3"
                                                            (HIDE -2)
                                                            (("3"
                                                              (SPLIT
                                                               -1)
                                                              (("1"
                                                                (FLATTEN)
                                                                (("1"
                                                                  (SPLIT
                                                                   -12)
                                                                  (("1"
                                                                    (FLATTEN)
                                                                    (("1"
                                                                      (INST
                                                                       -
                                                                       "n!1"
                                                                       "l(p!1) - 2")
                                                                      (("1"
                                                                        (ASSERT)
                                                                        NIL)))))
                                                                   ("2"
                                                                    (FLATTEN)
                                                                    (("2"
                                                                      (EXPAND
                                                                       "verts_of")
                                                                      (("2"
                                                                        (INST
                                                                         +
                                                                         "n!1")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "fseq")
                                                                          (("2"
                                                                            (PROPAX)
                                                                            NIL)))))))))))))
                                                               ("2"
                                                                (FLATTEN)
                                                                (("2"
                                                                  (SPLIT
                                                                   -12)
                                                                  (("1"
                                                                    (FLATTEN)
                                                                    (("1"
                                                                      (INST
                                                                       -
                                                                       "1 + n!1"
                                                                       "l(p!1) - 2")
                                                                      (("1"
                                                                        (ASSERT)
                                                                        NIL)))))
                                                                   ("2"
                                                                    (FLATTEN)
                                                                    (("2"
                                                                      (EXPAND
                                                                       "verts_of")
                                                                      (("2"
                                                                        (INST
                                                                         +
                                                                         "1 + n!1")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "fseq")
                                                                          (("2"
                                                                            (PROPAX)
                                                                            NIL)))))))))))))))))))))))))))))
                                               ("4"
                                                (EXPAND "incident")
                                                (("4"
                                                  (SKOSIMP*)
                                                  (("4"
                                                    (HIDE -1)
                                                    (("4"
                                                      (LEMMA "dbl_eq")
                                                      (("4"
                                                        (INST?)
                                                        (("4"
                                                          (ASSERT)
                                                          (("4"
                                                            (HIDE -2)
                                                            (("4"
                                                              (EXPAND
                                                               "from?")
                                                              (("4"
                                                                (FLATTEN)
                                                                (("4"
                                                                  (GROUND)
                                                                  (("1"
                                                                    (EXPAND
                                                                     "verts_of")
                                                                    (("1"
                                                                      (EXPAND
                                                                       "fseq")
                                                                      (("1"
                                                                        (INST
                                                                         +
                                                                         "n!1")
                                                                        NIL)))))
                                                                   ("2"
                                                                    (INST
                                                                     -
                                                                     "n!1"
                                                                     "l(p!1) - 2")
                                                                    (("2"
                                                                      (ASSERT)
                                                                      NIL)))
                                                                   ("3"
                                                                    (EXPAND
                                                                     "verts_of")
                                                                    (("3"
                                                                      (EXPAND
                                                                       "fseq")
                                                                      (("3"
                                                                        (INST
                                                                         +
                                                                         "1 + n!1")
                                                                        NIL)))))
                                                                   ("4"
                                                                    (INST
                                                                     -
                                                                     "1 + n!1"
                                                                     "l(p!1) - 2")
                                                                    (("4"
                                                                      (ASSERT)
                                                                      NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
         ("2" (SKOSIMP*)
          (("2" (EXPAND "fseq")
            (("2" (TYPEPRED "i!1")
              (("1" (TYPEPRED "j!1")
                (("1" (HIDE -9 -11 -12)
                  (("1" (EXPAND "trunc1")
                    (("1" (EXPAND "^")
                      (("1" (ASSERT)
                        (("1" (INST - "i!1" "j!1")
                          (("1" (ASSERT) NIL)))))))))))
                 ("2" (SKOSIMP*)
                  (("2" (EXPAND "trunc1" 1)
                    (("2" (EXPAND "^") (("2" (ASSERT) NIL)))))))
                 ("3" (SKOSIMP*) (("3" (ASSERT) NIL)))))
               ("2" (SKOSIMP*)
                (("2" (EXPAND "trunc1" 1)
                  (("2" (EXPAND "^") (("2" (ASSERT) NIL)))))))
               ("3" (SKOSIMP*) (("3" (ASSERT) NIL)))))))))))))))))
 (|disjoint?_TCC1| "" (SKOSIMP*) NIL)
 (|disjoint?_TCC2| "" (SKOSIMP*) NIL)
 (|join2_lem_TCC1| "" (SKOSIMP*)
  (("" (LEMMA "path_from_l") (("" (INST?) (("" (ASSERT) NIL)))))))
 (|join2_lem_TCC2| "" (ASSERT)
  (("" (SKOSIMP*)
    (("" (ASSERT)
      (("" (LEMMA "path_from_l")
        (("" (HIDE -2) (("" (INST?) (("" (ASSERT) NIL)))))))))))))
 (|join2_lem_TCC3| "" (SKOSIMP*)
  (("" (LEMMA "path_from_l")
    (("" (INST?)
      (("" (ASSERT)
        (("" (HIDE -3 -4)
          (("" (EXPAND "path_from?")
            (("" (EXPAND "walk_from?")
              (("" (EXPAND "from?")
                (("" (EXPAND "path?")
                  (("" (FLATTEN) (("" (ASSERT) NIL)))))))))))))))))))))
 (|join2_lem_TCC4| "" (SKOSIMP*)
  (("" (HIDE -1 -3)
    (("" (EXPAND "path_from?")
      (("" (EXPAND "path?")
        (("" (EXPAND "from?")
          (("" (EXPAND "walk_from?")
            (("" (FLATTEN) (("" (ASSERT) NIL)))))))))))))))
 (|join2_lem| "" (SKOSIMP*)
  (("" (LEMMA "path_from_l")
    (("" (INST?)
      (("" (ASSERT)
        (("" (LEMMA "path_from_l")
          (("" (INST -1 "G!1" "p2!1" "t!1" "v!1")
            (("" (ASSERT)
              (("" (EXPAND "path_from?")
                (("" (FLATTEN)
                  (("" (SPLIT +)
                    (("1" (EXPAND "join2")
                      (("1" (EXPAND "path?")
                        (("1" (FLATTEN)
                          (("1" (SPLIT +)
                            (("1" (HIDE -4 -7)
                              (("1"
                                (EXPAND "walk?")
                                (("1"
                                  (FLATTEN)
                                  (("1"
                                    (SPLIT +)
                                    (("1"
                                      (HIDE -4 -7)
                                      (("1"
                                        (EXPAND "verts_in?")
                                        (("1"
                                          (SKOSIMP*)
                                          (("1"
                                            (TYPEPRED "i!1")
                                            (("1"
                                              (EXPAND "o ")
                                              (("1"
                                                (EXPAND "rev")
                                                (("1"
                                                  (EXPAND "^")
                                                  (("1"
                                                    (GROUND)
                                                    (("1" (INST?) NIL)
                                                     ("2"
                                                      (INST? -6)
                                                      NIL)))))))))))))))))
                                     ("2"
                                      (SKOSIMP*)
                                      (("2"
                                        (EXPAND "fseq")
                                        (("2"
                                          (HIDE -4 -7 -10)
                                          (("2"
                                            (EXPAND "from?")
                                            (("2"
                                              (FLATTEN)
                                              (("2"
                                                (EXPAND "o ")
                                                (("2"
                                                  (EXPAND "rev")
                                                  (("2"
                                                    (EXPAND "^")
                                                    (("2"
                                                      (EXPAND "edge?")
                                                      (("2"
                                                        (CASE
                                                         "n!1 < l(p1!1) - 1")
                                                        (("1"
                                                          (INST?)
                                                          (("1"
                                                            (ASSERT)
                                                            (("1"
                                                              (FLATTEN)
                                                              (("1"
                                                                (ASSERT)
                                                                (("1"
                                                                  (CASE-REPLACE
                                                                   "n!1 = l(p1!1) - 1")
                                                                  (("1"
                                                                    (ASSERT)
                                                                    NIL)
                                                                   ("2"
                                                                    (LIFT-IF)
                                                                    (("2"
                                                                      (ASSERT)
                                                                      NIL)))))))))))))
                                                         ("2"
                                                          (ASSERT)
                                                          (("2"
                                                            (INST
                                                             -7
                                                             "l(p1!1) + l(p2!1) - 3 - n!1")
                                                            (("2"
                                                              (ASSERT)
                                                              (("2"
                                                                (FLATTEN)
                                                                (("2"
                                                                  (ASSERT)
                                                                  (("2"
                                                                    (REWRITE
                                                                     "dbl_comm")
                                                                    NIL)))))))))))))))))))))))))))))))))))))))
                             ("2" (SKOSIMP*)
                              (("2"
                                (HIDE -4 -7)
                                (("2"
                                  (EXPAND "fseq")
                                  (("2"
                                    (EXPAND "o ")
                                    (("2"
                                      (EXPAND "^")
                                      (("2"
                                        (EXPAND "rev")
                                        (("2"
                                          (LIFT-IF)
                                          (("2"
                                            (LIFT-IF)
                                            (("2"
                                              (GROUND)
                                              (("1"
                                                (INST -6 "i!1" "j!1")
                                                (("1" (ASSERT) NIL)))
                                               ("2"
                                                (TYPEPRED "i!1")
                                                (("2"
                                                  (EXPAND "o ")
                                                  (("2"
                                                    (EXPAND "rev")
                                                    (("2"
                                                      (EXPAND "^")
                                                      (("2"
                                                        (HIDE -6 -8)
                                                        (("2"
                                                          (EXPAND
                                                           "disjoint?")
                                                          (("2"
                                                            (EXPAND
                                                             "trunc1")
                                                            (("2"
                                                              (EXPAND
                                                               "^")
                                                              (("2"
                                                                (CASE
                                                                 "i!1 = l(p1!1) - 1")
                                                                (("1"
                                                                  (REPLACE
                                                                   -1)
                                                                  (("1"
                                                                    (HIDE
                                                                     -1)
                                                                    (("1"
                                                                      (ASSERT)
                                                                      (("1"
                                                                        (EXPAND
                                                                         "from?")
                                                                        (("1"
                                                                          (FLATTEN)
                                                                          (("1"
                                                                            (REPLACE
                                                                             -9)
                                                                            (("1"
                                                                              (REPLACE
                                                                               -7
                                                                               *
                                                                               RL)
                                                                              (("1"
                                                                                (REVEAL
                                                                                 -2)
                                                                                (("1"
                                                                                  (INST?)
                                                                                  (("1"
                                                                                    (INST
                                                                                     -1
                                                                                     "j!1")
                                                                                    (("1"
                                                                                      (ASSERT)
                                                                                      NIL)))))))))))))))))))))
                                                                 ("2"
                                                                  (INST?)
                                                                  (("2"
                                                                    (INST?)
                                                                    (("1"
                                                                      (ASSERT)
                                                                      NIL)
                                                                     ("2"
                                                                      (ASSERT)
                                                                      NIL)))))))))))))))))))))))
                                               ("3"
                                                (TYPEPRED "j!1")
                                                (("3"
                                                  (EXPAND "o ")
                                                  (("3"
                                                    (EXPAND "^")
                                                    (("3"
                                                      (EXPAND "rev")
                                                      (("3"
                                                        (CASE
                                                         "j!1 = l(p1!1) - 1")
                                                        (("1"
                                                          (REPLACE -1)
                                                          (("1"
                                                            (HIDE -1)
                                                            (("1"
                                                              (ASSERT)
                                                              (("1"
                                                                (EXPAND
                                                                 "from?")
                                                                (("1"
                                                                  (FLATTEN)
                                                                  (("1"
                                                                    (REPLACE
                                                                     -11)
                                                                    (("1"
                                                                      (REPLACE
                                                                       -8
                                                                       *
                                                                       RL)
                                                                      (("1"
                                                                        (INST?)
                                                                        (("1"
                                                                          (INST
                                                                           -6
                                                                           "l(p1!1) -1")
                                                                          (("1"
                                                                            (ASSERT)
                                                                            NIL)))))))))))))))))))
                                                         ("2"
                                                          (EXPAND
                                                           "disjoint?")
                                                          (("2"
                                                            (HIDE
                                                             -6
                                                             -8)
                                                            (("2"
                                                              (EXPAND
                                                               "trunc1")
                                                              (("2"
                                                                (EXPAND
                                                                 "^")
                                                                (("2"
                                                                  (INST?)
                                                                  (("1"
                                                                    (ASSERT)
                                                                    NIL)
                                                                   ("2"
                                                                    (ASSERT)
                                                                    NIL)))))))))))))))))))))
                                               ("4"
                                                (EXPAND "disjoint?")
                                                (("4"
                                                  (HIDE -4 -8)
                                                  (("4"
                                                    (INST?)
                                                    (("1"
                                                      (INST
                                                       -5
                                                       "l(p1!1) + l(p2!1) - 2 - j!1")
                                                      (("1"
                                                        (ASSERT)
                                                        NIL)
                                                       ("2"
                                                        (ASSERT)
                                                        (("2"
                                                          (TYPEPRED
                                                           "j!1")
                                                          (("2"
                                                            (EXPAND
                                                             "^")
                                                            (("2"
                                                              (EXPAND
                                                               "o ")
                                                              (("2"
                                                                (EXPAND
                                                                 "rev")
                                                                (("2"
                                                                  (ASSERT)
                                                                  NIL)))))))))))))
                                                     ("2"
                                                      (ASSERT)
                                                      (("2"
                                                        (TYPEPRED
                                                         "i!1")
                                                        (("2"
                                                          (EXPAND "o ")
                                                          (("2"
                                                            (EXPAND
                                                             "^")
                                                            (("2"
                                                              (EXPAND
                                                               "rev")
                                                              (("2"
                                                                (ASSERT)
                                                                NIL)))))))))))))))))))))))))))))))))))))))))))
                     ("2" (EXPAND "from?")
                      (("2" (EXPAND "join2")
                        (("2" (EXPAND "o ")
                          (("2" (FLATTEN)
                            (("2" (EXPAND "^")
                              (("2"
                                (EXPAND "rev")
                                (("2"
                                  (ASSERT)
                                  NIL)))))))))))))))))))))))))))))))))
 (|path_from_to_walk_from| "" (SKOSIMP*)
  (("" (EXPAND "path_from?")
    (("" (EXPAND "walk_from?")
      (("" (EXPAND "from?")
        (("" (EXPAND "path?")
          (("" (FLATTEN) (("" (ASSERT) NIL)))))))))))))
 (|paths_H_disj_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|paths_H_disj_TCC2| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|paths_H_disj_TCC3| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|paths_H_disj| "" (SKOSIMP*)
  (("" (EXPAND "disjoint?")
    (("" (SKOSIMP*)
      (("" (EXPAND "separates")
        (("" (FLATTEN)
          ((""
            (CASE "walk_from?[T](del_verts[T](G!1, dbl[T](w1!1, w2!1)),
                    p1!1^(0,i!1), s!1, seq(p1!1)(i!1))")
            (("1"
              (CASE "walk_from?[T](del_verts[T](G!1, dbl[T](w1!1, w2!1)),
                    p2!1^(0,j!1), t!1, seq(p2!1)(j!1))")
              (("1" (HIDE -3 -4)
                (("1"
                  (NAME-REPLACE "DV" "del_verts(G!1, dbl(w1!1, w2!1))")
                  (("1" (CASE-REPLACE "i!1 = 0")
                    (("1" (REPLACE -4)
                      (("1" (REPLACE -8 * RL)
                        (("1" (INST + "rev(p2!1 ^ (0, j!1))")
                          (("1" (HIDE -3)
                            (("1" (EXPAND "walk_from?")
                              (("1"
                                (FLATTEN)
                                (("1"
                                  (LEMMA "walk?_rev")
                                  (("1"
                                    (INST -1 "DV" "p2!1 ^ (0, j!1)")
                                    (("1"
                                      (ASSERT)
                                      (("1"
                                        (EXPAND "^" +)
                                        (("1"
                                          (EXPAND "rev")
                                          (("1" (PROPAX) NIL)))))))
                                     ("2"
                                      (EXPAND "^" 1)
                                      (("2" (ASSERT) NIL)))))))))))))
                           ("2" (EXPAND "rev")
                            (("2" (EXPAND "^" 1)
                              (("2" (ASSERT) NIL)))))))))))
                     ("2"
                      (INST +
                       "join2(DV,s!1,t!1,seq(p2!1)(j!1),p1!1^(0,i!1),p2!1^(0,j!1))")
                      (("1"
                        (TYPEPRED "join2(DV, s!1, t!1, seq(p2!1)(j!1),
                       p1!1 ^ (0, i!1), p2!1 ^ (0, j!1))")
                        (("1" (PROPAX) NIL) ("2" (ASSERT) NIL)
                         ("3" (ASSERT) NIL)))
                       ("2" (ASSERT)
                        (("2" (EXPAND "^" 1) (("2" (ASSERT) NIL)))))
                       ("3" (ASSERT)
                        (("3" (EXPAND "^" 1)
                          (("3" (PROPAX) NIL)))))))))))))
               ("2" (HIDE -1 4)
                (("2" (EXPAND "walk_from?")
                  (("2" (SPLIT 1)
                    (("1" (EXPAND "^") (("1" (PROPAX) NIL)))
                     ("2" (EXPAND "^") (("2" (PROPAX) NIL)))
                     ("3" (LEMMA "path_H_def")
                      (("3"
                        (INST -1 "G!1" "j!1" "p2!1" "t!1" "w1!1"
                         "w2!1")
                        (("3" (ASSERT) NIL)))))))))))
               ("3" (EXPAND "^" 1) (("3" (ASSERT) NIL)))
               ("4" (PROPAX) NIL)))
             ("2" (HIDE -1 4)
              (("2" (LEMMA "path_H_def")
                (("2" (INST -1 "G!1" "i!1" "p1!1" "s!1" "w1!1" "w2!1")
                  (("2" (ASSERT)
                    (("2" (EXPAND "walk_from?")
                      (("2" (EXPAND "^" 1)
                        (("2" (PROPAX) NIL)))))))))))))
             ("3" (EXPAND "^" 1) (("3" (ASSERT) NIL)))
             ("4" (PROPAX) NIL)
             ("5" (REWRITE "finite_dbl") NIL)))))))))))))
 (|prelude_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|prelude| "" (SKOSIMP*)
  (("" (EXPAND "in?")
    (("" (EXPAND "disjoint?")
      (("" (FLATTEN)
        (("" (LEMMA "line20")
          ((""
            (INST -1 "G!1" "meng(G!1, s!1, t!1, w1!1, w2!1)" "s!1"
             "t!1" "w1!1" "w2!1")
            (("1" (ASSERT)
              (("1" (EXPAND "in?")
                (("1" (EXPAND "disjoint?")
                  (("1" (SPLIT -1)
                    (("1" (SKOSIMP*)
                      (("1" (HIDE 1 2)
                        (("1" (LEMMA "line20")
                          (("1"
                            (INST -1 "G!1"
                             "meng(G!1, t!1, s!1, w1!1, w2!1)" "t!1"
                             "s!1" "w1!1" "w2!1")
                            (("1" (ASSERT)
                              (("1"
                                (REWRITE "separable?_comm")
                                (("1"
                                  (EXPAND "in?")
                                  (("1"
                                    (EXPAND "disjoint?")
                                    (("1"
                                      (REWRITE "sep_num_comm")
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (REWRITE "separates_comm")
                                          (("1"
                                            (ASSERT)
                                            (("1"
                                              (SPLIT -1)
                                              (("1"
                                                (SKOSIMP*)
                                                (("1"
                                                  (HIDE 1 2)
                                                  (("1"
                                                    (HIDE
                                                     -15
                                                     -16
                                                     -17
                                                     -18
                                                     7
                                                     8)
                                                    (("1"
                                                      (NAME
                                                       "HS"
                                                       "H(G!1, s!1, w1!1, w2!1)")
                                                      (("1"
                                                        (NAME
                                                         "HT"
                                                         "H(G!1, t!1, w1!1, w2!1)")
                                                        (("1"
                                                          (CASE
                                                           "path?(HS,trunc1(trunc1(P1!1))) AND from?(trunc1(P1!1),s!1,w1!1)")
                                                          (("1"
                                                            (CASE
                                                             "path?(HS,trunc1(trunc1(P2!1))) AND from?(trunc1(P2!1),s!1,w2!1)")
                                                            (("1"
                                                              (CASE
                                                               "path?(HT,trunc1(trunc1(P1!2))) AND from?(trunc1(P1!2),t!1,w1!1)")
                                                              (("1"
                                                                (CASE
                                                                 "path?(HT,trunc1(trunc1(P2!2))) AND from?(trunc1(P2!2),t!1,w2!1)")
                                                                (("1"
                                                                  (FLATTEN)
                                                                  (("1"
                                                                    (CASE
                                                                     "path_from?[T](G!1, trunc1(P1!1), s!1, w1!1) AND
             path_from?[T](G!1, trunc1(P1!2), t!1, w1!1)")
                                                                    (("1"
                                                                      (FLATTEN)
                                                                      (("1"
                                                                        (NAME
                                                                         "Rw1"
                                                                         "join2(G!1,s!1,t!1,w1!1,trunc1(P1!1),trunc1(P1!2))")
                                                                        (("1"
                                                                          (CASE
                                                                           "disjoint?(trunc1(trunc1(P1!1)),trunc1(trunc1(P1!2)))")
                                                                          (("1"
                                                                            (LEMMA
                                                                             "join2_lem")
                                                                            (("1"
                                                                              (INST?)
                                                                              (("1"
                                                                                (ASSERT)
                                                                                (("1"
                                                                                  (REPLACE
                                                                                   -3)
                                                                                  (("1"
                                                                                    (CASE
                                                                                     "path_from?[T](G!1, trunc1(P2!1), s!1, w2!1) AND
             path_from?[T](G!1, trunc1(P2!2), t!1, w2!1)")
                                                                                    (("1"
                                                                                      (FLATTEN)
                                                                                      (("1"
                                                                                        (CASE
                                                                                         "disjoint?(trunc1(trunc1(P2!1)),trunc1(trunc1(P2!2)))")
                                                                                        (("1"
                                                                                          (LEMMA
                                                                                           "join2_lem")
                                                                                          (("1"
                                                                                            (INST
                                                                                             -1
                                                                                             "G!1"
                                                                                             "trunc1(P2!1)"
                                                                                             "trunc1(P2!2)"
                                                                                             "s!1"
                                                                                             "t!1"
                                                                                             "w2!1")
                                                                                            (("1"
                                                                                              (ASSERT)
                                                                                              (("1"
                                                                                                (NAME
                                                                                                 "Rw2"
                                                                                                 "join2(G!1,s!1,t!1,w2!1,trunc1(P2!1),trunc1(P2!2))")
                                                                                                (("1"
                                                                                                  (REPLACE
                                                                                                   -1)
                                                                                                  (("1"
                                                                                                    (HIDE
                                                                                                     -11
                                                                                                     -12
                                                                                                     -13
                                                                                                     -14
                                                                                                     -15
                                                                                                     -16
                                                                                                     -17
                                                                                                     -18
                                                                                                     -19
                                                                                                     -20
                                                                                                     -21
                                                                                                     -22
                                                                                                     -23
                                                                                                     -24
                                                                                                     -25
                                                                                                     -26
                                                                                                     -28
                                                                                                     -30)
                                                                                                    (("1"
                                                                                                      (CASE
                                                                                                       "independent?(Rw1,Rw2)")
                                                                                                      (("1"
                                                                                                        (CASE
                                                                                                         "Rw1 /= Rw2")
                                                                                                        (("1"
                                                                                                          (ASSERT)
                                                                                                          (("1"
                                                                                                            (FLATTEN)
                                                                                                            (("1"
                                                                                                              (EXPAND
                                                                                                               "path_from?")
                                                                                                              (("1"
                                                                                                                (FLATTEN)
                                                                                                                (("1"
                                                                                                                  (ASSERT)
                                                                                                                  (("1"
                                                                                                                    (HIDE
                                                                                                                     -2
                                                                                                                     -3
                                                                                                                     -4
                                                                                                                     -5
                                                                                                                     -6
                                                                                                                     -7
                                                                                                                     -8
                                                                                                                     -9
                                                                                                                     -10)
                                                                                                                    (("1"
                                                                                                                      (HIDE
                                                                                                                       -2
                                                                                                                       -3
                                                                                                                       -4
                                                                                                                       -5
                                                                                                                       -8
                                                                                                                       -9
                                                                                                                       -10)
                                                                                                                      (("1"
                                                                                                                        (LEMMA
                                                                                                                         "independent?_comm")
                                                                                                                        (("1"
                                                                                                                          (INST
                                                                                                                           -1
                                                                                                                           "Rw1"
                                                                                                                           "Rw2")
                                                                                                                          (("1"
                                                                                                                            (ASSERT)
                                                                                                                            (("1"
                                                                                                                              (REVEAL
                                                                                                                               -10
                                                                                                                               -11
                                                                                                                               -15
                                                                                                                               -16)
                                                                                                                              (("1"
                                                                                                                                (INST
                                                                                                                                 8
                                                                                                                                 "Rw1"
                                                                                                                                 "Rw2")
                                                                                                                                (("1"
                                                                                                                                  (ASSERT)
                                                                                                                                  NIL)))))))))))))))))))))))))
                                                                                                         ("2"
                                                                                                          (LEMMA
                                                                                                           "independent_ne")
                                                                                                          (("2"
                                                                                                            (INST?)
                                                                                                            (("2"
                                                                                                              (CASE
                                                                                                               "independent?(Rw1, Rw2)")
                                                                                                              (("1"
                                                                                                                (ASSERT)
                                                                                                                (("1"
                                                                                                                  (REPLACE
                                                                                                                   -10
                                                                                                                   *
                                                                                                                   RL)
                                                                                                                  (("1"
                                                                                                                    (EXPAND
                                                                                                                     "join2"
                                                                                                                     1)
                                                                                                                    (("1"
                                                                                                                      (EXPAND
                                                                                                                       "o ")
                                                                                                                      (("1"
                                                                                                                        (EXPAND
                                                                                                                         "trunc1"
                                                                                                                         1)
                                                                                                                        (("1"
                                                                                                                          (EXPAND
                                                                                                                           "^")
                                                                                                                          (("1"
                                                                                                                            (EXPAND
                                                                                                                             "rev")
                                                                                                                            (("1"
                                                                                                                              (ASSERT)
                                                                                                                              NIL)))))))))))))))
                                                                                                               ("2"
                                                                                                                (PROPAX)
                                                                                                                NIL)))))))))
                                                                                                       ("2"
                                                                                                        (HIDE
                                                                                                         -4
                                                                                                         -5
                                                                                                         -9
                                                                                                         -10
                                                                                                         8)
                                                                                                        (("2"
                                                                                                          (REPLACE
                                                                                                           -1
                                                                                                           *
                                                                                                           RL)
                                                                                                          (("2"
                                                                                                            (HIDE
                                                                                                             -1)
                                                                                                            (("2"
                                                                                                              (REPLACE
                                                                                                               -5
                                                                                                               *
                                                                                                               RL)
                                                                                                              (("2"
                                                                                                                (HIDE
                                                                                                                 -5)
                                                                                                                (("2"
                                                                                                                  (HIDE
                                                                                                                   -1
                                                                                                                   -2
                                                                                                                   -3
                                                                                                                   -4)
                                                                                                                  (("2"
                                                                                                                    (REVEAL
                                                                                                                     -11
                                                                                                                     -12
                                                                                                                     -13
                                                                                                                     -14
                                                                                                                     -15
                                                                                                                     -16
                                                                                                                     -17
                                                                                                                     -18)
                                                                                                                    (("2"
                                                                                                                      (LEMMA
                                                                                                                       "path_comps_ind3")
                                                                                                                      (("2"
                                                                                                                        (INST
                                                                                                                         -1
                                                                                                                         "G!1"
                                                                                                                         "P1!1"
                                                                                                                         "P2!2"
                                                                                                                         "s!1"
                                                                                                                         "t!1"
                                                                                                                         "w1!1"
                                                                                                                         "w2!1")
                                                                                                                        (("2"
                                                                                                                          (ASSERT)
                                                                                                                          (("2"
                                                                                                                            (SPLIT
                                                                                                                             -1)
                                                                                                                            (("1"
                                                                                                                              (LEMMA
                                                                                                                               "path_comps_ind3")
                                                                                                                              (("1"
                                                                                                                                (INST
                                                                                                                                 -1
                                                                                                                                 "G!1"
                                                                                                                                 "P2!1"
                                                                                                                                 "P1!2"
                                                                                                                                 "s!1"
                                                                                                                                 "t!1"
                                                                                                                                 "w1!1"
                                                                                                                                 "w2!1")
                                                                                                                                (("1"
                                                                                                                                  (ASSERT)
                                                                                                                                  (("1"
                                                                                                                                    (SPLIT
                                                                                                                                     -1)
                                                                                                                                    (("1"
                                                                                                                                      (HIDE
                                                                                                                                       -3
                                                                                                                                       -4
                                                                                                                                       -5
                                                                                                                                       -6
                                                                                                                                       -7
                                                                                                                                       -8
                                                                                                                                       -9
                                                                                                                                       -10)
                                                                                                                                      (("1"
                                                                                                                                        (EXPAND
                                                                                                                                         "independent?"
                                                                                                                                         1)
                                                                                                                                        (("1"
                                                                                                                                          (SKOSIMP*)
                                                                                                                                          (("1"
                                                                                                                                            (EXPAND
                                                                                                                                             "join2")
                                                                                                                                            (("1"
                                                                                                                                              (REWRITE
                                                                                                                                               "l_trunc1")
                                                                                                                                              (("1"
                                                                                                                                                (REWRITE
                                                                                                                                                 "l_trunc1")
                                                                                                                                                (("1"
                                                                                                                                                  (EXPAND
                                                                                                                                                   "^")
                                                                                                                                                  (("1"
                                                                                                                                                    (ASSERT)
                                                                                                                                                    (("1"
                                                                                                                                                      (EXPAND
                                                                                                                                                       "o ")
                                                                                                                                                      (("1"
                                                                                                                                                        (EXPAND
                                                                                                                                                         "rev")
                                                                                                                                                        (("1"
                                                                                                                                                          (REWRITE
                                                                                                                                                           "l_trunc1")
                                                                                                                                                          (("1"
                                                                                                                                                            (REWRITE
                                                                                                                                                             "l_trunc1")
                                                                                                                                                            (("1"
                                                                                                                                                              (LIFT-IF)
                                                                                                                                                              (("1"
                                                                                                                                                                (LIFT-IF)
                                                                                                                                                                (("1"
                                                                                                                                                                  (GROUND)
                                                                                                                                                                  (("1"
                                                                                                                                                                    (EXPAND
                                                                                                                                                                     "independent?"
                                                                                                                                                                     -15)
                                                                                                                                                                    (("1"
                                                                                                                                                                      (INST
                                                                                                                                                                       -
                                                                                                                                                                       "i!1"
                                                                                                                                                                       "j!1")
                                                                                                                                                                      (("1"
                                                                                                                                                                        (ASSERT)
                                                                                                                                                                        (("1"
                                                                                                                                                                          (HIDE
                                                                                                                                                                           -4
                                                                                                                                                                           -5)
                                                                                                                                                                          (("1"
                                                                                                                                                                            (EXPAND
                                                                                                                                                                             "trunc1")
                                                                                                                                                                            (("1"
                                                                                                                                                                              (EXPAND
                                                                                                                                                                               "^")
                                                                                                                                                                              (("1"
                                                                                                                                                                                (ASSERT)
                                                                                                                                                                                NIL)))))))))))))
                                                                                                                                                                   ("2"
                                                                                                                                                                    (EXPAND
                                                                                                                                                                     "independent?"
                                                                                                                                                                     -3)
                                                                                                                                                                    (("2"
                                                                                                                                                                      (INST
                                                                                                                                                                       -
                                                                                                                                                                       "j!1"
                                                                                                                                                                       "l(P1!1) + l(P1!2) - 4 - i!1")
                                                                                                                                                                      (("2"
                                                                                                                                                                        (REWRITE
                                                                                                                                                                         "l_trunc1")
                                                                                                                                                                        (("2"
                                                                                                                                                                          (REWRITE
                                                                                                                                                                           "l_trunc1")
                                                                                                                                                                          (("2"
                                                                                                                                                                            (ASSERT)
                                                                                                                                                                            (("2"
                                                                                                                                                                              (CASE
                                                                                                                                                                               "i!1 = l(P1!1) - 2")
                                                                                                                                                                              (("1"
                                                                                                                                                                                (REPLACE
                                                                                                                                                                                 -1)
                                                                                                                                                                                (("1"
                                                                                                                                                                                  (HIDE
                                                                                                                                                                                   -1)
                                                                                                                                                                                  (("1"
                                                                                                                                                                                    (ASSERT)
                                                                                                                                                                                    (("1"
                                                                                                                                                                                      (HIDE
                                                                                                                                                                                       -3)
                                                                                                                                                                                      (("1"
                                                                                                                                                                                        (EXPAND
                                                                                                                                                                                         "trunc1")
                                                                                                                                                                                        (("1"
                                                                                                                                                                                          (EXPAND
                                                                                                                                                                                           "^")
                                                                                                                                                                                          (("1"
                                                                                                                                                                                            (REVEAL
                                                                                                                                                                                             -29
                                                                                                                                                                                             7)
                                                                                                                                                                                            (("1"
                                                                                                                                                                                              (REPLACE
                                                                                                                                                                                               -1)
                                                                                                                                                                                              (("1"
                                                                                                                                                                                                (HIDE
                                                                                                                                                                                                 -1)
                                                                                                                                                                                                (("1"
                                                                                                                                                                                                  (EXPAND
                                                                                                                                                                                                   "verts_of")
                                                                                                                                                                                                  (("1"
                                                                                                                                                                                                    (EXPAND
                                                                                                                                                                                                     "fseq")
                                                                                                                                                                                                    (("1"
                                                                                                                                                                                                      (INST?)
                                                                                                                                                                                                      (("1"
                                                                                                                                                                                                        (ASSERT)
                                                                                                                                                                                                        NIL)))))))))))))))))))))))))
                                                                                                                                                                               ("2"
                                                                                                                                                                                (ASSERT)
                                                                                                                                                                                NIL)))))))))))))
                                                                                                                                                                   ("3"
                                                                                                                                                                    (EXPAND
                                                                                                                                                                     "independent?"
                                                                                                                                                                     -4)
                                                                                                                                                                    (("3"
                                                                                                                                                                      (INST
                                                                                                                                                                       -
                                                                                                                                                                       "i!1"
                                                                                                                                                                       "l(P2!1) + l(P2!2) - 4 - j!1")
                                                                                                                                                                      (("3"
                                                                                                                                                                        (REWRITE
                                                                                                                                                                         "l_trunc1")
                                                                                                                                                                        (("3"
                                                                                                                                                                          (REWRITE
                                                                                                                                                                           "l_trunc1")
                                                                                                                                                                          (("3"
                                                                                                                                                                            (ASSERT)
                                                                                                                                                                            (("3"
                                                                                                                                                                              (CASE
                                                                                                                                                                               "j!1 = l(P2!1) - 2")
                                                                                                                                                                              (("1"
                                                                                                                                                                                (REPLACE
                                                                                                                                                                                 -1)
                                                                                                                                                                                (("1"
                                                                                                                                                                                  (HIDE
                                                                                                                                                                                   -1)
                                                                                                                                                                                  (("1"
                                                                                                                                                                                    (ASSERT)
                                                                                                                                                                                    (("1"
                                                                                                                                                                                      (EXPAND
                                                                                                                                                                                       "trunc1")
                                                                                                                                                                                      (("1"
                                                                                                                                                                                        (EXPAND
                                                                                                                                                                                         "^")
                                                                                                                                                                                        (("1"
                                                                                                                                                                                          (REVEAL
                                                                                                                                                                                           -29
                                                                                                                                                                                           6)
                                                                                                                                                                                          (("1"
                                                                                                                                                                                            (REPLACE
                                                                                                                                                                                             -1)
                                                                                                                                                                                            (("1"
                                                                                                                                                                                              (HIDE
                                                                                                                                                                                               -1)
                                                                                                                                                                                              (("1"
                                                                                                                                                                                                (EXPAND
                                                                                                                                                                                                 "verts_of")
                                                                                                                                                                                                (("1"
                                                                                                                                                                                                  (EXPAND
                                                                                                                                                                                                   "fseq")
                                                                                                                                                                                                  (("1"
                                                                                                                                                                                                    (INST?)
                                                                                                                                                                                                    NIL)))))))))))))))))))))
                                                                                                                                                                               ("2"
                                                                                                                                                                                (ASSERT)
                                                                                                                                                                                NIL)))))))))))))
                                                                                                                                                                   ("4"
                                                                                                                                                                    (HIDE
                                                                                                                                                                     -2
                                                                                                                                                                     -3
                                                                                                                                                                     -13)
                                                                                                                                                                    (("4"
                                                                                                                                                                      (EXPAND
                                                                                                                                                                       "independent?")
                                                                                                                                                                      (("4"
                                                                                                                                                                        (EXPAND
                                                                                                                                                                         "trunc1")
                                                                                                                                                                        (("4"
                                                                                                                                                                          (EXPAND
                                                                                                                                                                           "^")
                                                                                                                                                                          (("4"
                                                                                                                                                                            (INST
                                                                                                                                                                             -
                                                                                                                                                                             "l(P1!1) + l(P1!2) - 4 - i!1"
                                                                                                                                                                             "l(P2!1) + l(P2!2) - 4 - j!1")
                                                                                                                                                                            (("4"
                                                                                                                                                                              (ASSERT)
                                                                                                                                                                              NIL)))))))))))))))))))))))))))))))))))))))))
                                                                                                                                     ("2"
                                                                                                                                      (EXPAND
                                                                                                                                       "from?"
                                                                                                                                       -7)
                                                                                                                                      (("2"
                                                                                                                                        (FLATTEN)
                                                                                                                                        (("2"
                                                                                                                                          (EXPAND
                                                                                                                                           "trunc1"
                                                                                                                                           -7)
                                                                                                                                          (("2"
                                                                                                                                            (EXPAND
                                                                                                                                             "^")
                                                                                                                                            (("2"
                                                                                                                                              (PROPAX)
                                                                                                                                              NIL)))))))))
                                                                                                                                     ("3"
                                                                                                                                      (EXPAND
                                                                                                                                       "from?"
                                                                                                                                       -5)
                                                                                                                                      (("3"
                                                                                                                                        (FLATTEN)
                                                                                                                                        (("3"
                                                                                                                                          (EXPAND
                                                                                                                                           "trunc1"
                                                                                                                                           -5)
                                                                                                                                          (("3"
                                                                                                                                            (ASSERT)
                                                                                                                                            (("3"
                                                                                                                                              (EXPAND
                                                                                                                                               "^")
                                                                                                                                              (("3"
                                                                                                                                                (PROPAX)
                                                                                                                                                NIL)))))))))))))))))))
                                                                                                                             ("2"
                                                                                                                              (EXPAND
                                                                                                                               "from?"
                                                                                                                               -8)
                                                                                                                              (("2"
                                                                                                                                (FLATTEN)
                                                                                                                                (("2"
                                                                                                                                  (EXPAND
                                                                                                                                   "trunc1"
                                                                                                                                   -8)
                                                                                                                                  (("2"
                                                                                                                                    (EXPAND
                                                                                                                                     "^")
                                                                                                                                    (("2"
                                                                                                                                      (PROPAX)
                                                                                                                                      NIL)))))))))
                                                                                                                             ("3"
                                                                                                                              (EXPAND
                                                                                                                               "from?"
                                                                                                                               -2)
                                                                                                                              (("3"
                                                                                                                                (FLATTEN)
                                                                                                                                (("3"
                                                                                                                                  (EXPAND
                                                                                                                                   "trunc1"
                                                                                                                                   -2)
                                                                                                                                  (("3"
                                                                                                                                    (ASSERT)
                                                                                                                                    (("3"
                                                                                                                                      (EXPAND
                                                                                                                                       "^")
                                                                                                                                      (("3"
                                                                                                                                        (PROPAX)
                                                                                                                                        NIL)))))))))))))))))))))))))))))))))))))))
                                                                                                 ("2"
                                                                                                  (HIDE
                                                                                                   -10
                                                                                                   -11
                                                                                                   -12
                                                                                                   -13
                                                                                                   -14
                                                                                                   -15
                                                                                                   -16
                                                                                                   -17
                                                                                                   -18
                                                                                                   -19
                                                                                                   -20
                                                                                                   -21
                                                                                                   -22
                                                                                                   -23
                                                                                                   -24)
                                                                                                  (("2"
                                                                                                    (HIDE
                                                                                                     -1
                                                                                                     -2
                                                                                                     -3
                                                                                                     -5
                                                                                                     -6
                                                                                                     -7
                                                                                                     -8
                                                                                                     -9
                                                                                                     -10
                                                                                                     -11
                                                                                                     -12
                                                                                                     -13
                                                                                                     -14
                                                                                                     -16
                                                                                                     -17
                                                                                                     -18)
                                                                                                    (("2"
                                                                                                      (REWRITE
                                                                                                       "path_from_to_walk_from")
                                                                                                      NIL)))))
                                                                                                 ("3"
                                                                                                  (REWRITE
                                                                                                   "path_from_to_walk_from")
                                                                                                  (("3"
                                                                                                    (EXPAND
                                                                                                     "trunc1"
                                                                                                     1)
                                                                                                    (("3"
                                                                                                      (EXPAND
                                                                                                       "^"
                                                                                                       1)
                                                                                                      (("3"
                                                                                                        (ASSERT)
                                                                                                        NIL)))))))))))))))
                                                                                         ("2"
                                                                                          (LEMMA
                                                                                           "paths_H_disj")
                                                                                          (("2"
                                                                                            (INST?)
                                                                                            (("2"
                                                                                              (INST?)
                                                                                              (("1"
                                                                                                (ASSERT)
                                                                                                (("1"
                                                                                                  (INST
                                                                                                   -1
                                                                                                   "s!1")
                                                                                                  (("1"
                                                                                                    (ASSERT)
                                                                                                    (("1"
                                                                                                      (HIDE
                                                                                                       -1
                                                                                                       -2
                                                                                                       -3
                                                                                                       -4
                                                                                                       -5
                                                                                                       -6
                                                                                                       -7
                                                                                                       -8
                                                                                                       2
                                                                                                       9)
                                                                                                      (("1"
                                                                                                        (HIDE
                                                                                                         -2
                                                                                                         -3
                                                                                                         -4
                                                                                                         -6
                                                                                                         -7
                                                                                                         -8
                                                                                                         -9
                                                                                                         -10
                                                                                                         -12
                                                                                                         -17
                                                                                                         -19
                                                                                                         -23)
                                                                                                        (("1"
                                                                                                          (EXPAND
                                                                                                           "from?")
                                                                                                          (("1"
                                                                                                            (EXPAND
                                                                                                             "trunc1")
                                                                                                            (("1"
                                                                                                              (EXPAND
                                                                                                               "^")
                                                                                                              (("1"
                                                                                                                (ASSERT)
                                                                                                                NIL)))))))))))))))))
                                                                                               ("2"
                                                                                                (EXPAND
                                                                                                 "trunc1"
                                                                                                 1)
                                                                                                (("2"
                                                                                                  (EXPAND
                                                                                                   "^")
                                                                                                  (("2"
                                                                                                    (ASSERT)
                                                                                                    NIL)))))
                                                                                               ("3"
                                                                                                (EXPAND
                                                                                                 "trunc1"
                                                                                                 1)
                                                                                                (("3"
                                                                                                  (EXPAND
                                                                                                   "^")
                                                                                                  (("3"
                                                                                                    (ASSERT)
                                                                                                    NIL)))))))))))))))
                                                                                     ("2"
                                                                                      (HIDE
                                                                                       -1
                                                                                       -2
                                                                                       -3
                                                                                       -4
                                                                                       -5
                                                                                       -16
                                                                                       -18
                                                                                       -23
                                                                                       -25)
                                                                                      (("2"
                                                                                        (HIDE
                                                                                         -3
                                                                                         -4
                                                                                         -7
                                                                                         -8)
                                                                                        (("2"
                                                                                          (REPLACE
                                                                                           -5
                                                                                           *
                                                                                           RL)
                                                                                          (("2"
                                                                                            (HIDE
                                                                                             -5)
                                                                                            (("2"
                                                                                              (REPLACE
                                                                                               -5
                                                                                               *
                                                                                               RL)
                                                                                              (("2"
                                                                                                (HIDE
                                                                                                 -5)
                                                                                                (("2"
                                                                                                  (LEMMA
                                                                                                   "path_comp_in")
                                                                                                  (("2"
                                                                                                    (EXPAND
                                                                                                     "path_from?")
                                                                                                    (("2"
                                                                                                      (INST?)
                                                                                                      (("1"
                                                                                                        (ASSERT)
                                                                                                        (("1"
                                                                                                          (LEMMA
                                                                                                           "path_H_trunc")
                                                                                                          (("1"
                                                                                                            (SPLIT
                                                                                                             +)
                                                                                                            (("1"
                                                                                                              (INST
                                                                                                               -1
                                                                                                               "G!1"
                                                                                                               "trunc1(P2!1)"
                                                                                                               "s!1"
                                                                                                               "t!1"
                                                                                                               "w2!1"
                                                                                                               "w1!1")
                                                                                                              (("1"
                                                                                                                (REWRITE
                                                                                                                 "H_comm"
                                                                                                                 -1)
                                                                                                                (("1"
                                                                                                                  (ASSERT)
                                                                                                                  (("1"
                                                                                                                    (EXPAND
                                                                                                                     "path_from?")
                                                                                                                    (("1"
                                                                                                                      (HIDE
                                                                                                                       1)
                                                                                                                      (("1"
                                                                                                                        (REVEAL
                                                                                                                         -16
                                                                                                                         -28)
                                                                                                                        (("1"
                                                                                                                          (EXPAND
                                                                                                                           "trunc1"
                                                                                                                           1)
                                                                                                                          (("1"
                                                                                                                            (EXPAND
                                                                                                                             "^")
                                                                                                                            (("1"
                                                                                                                              (EXPAND
                                                                                                                               "fseq")
                                                                                                                              (("1"
                                                                                                                                (LEMMA
                                                                                                                                 "meng_last")
                                                                                                                                (("1"
                                                                                                                                  (HIDE
                                                                                                                                   -2)
                                                                                                                                  (("1"
                                                                                                                                    (REVEAL
                                                                                                                                     -17)
                                                                                                                                    (("1"
                                                                                                                                      (INST?)
                                                                                                                                      (("1"
                                                                                                                                        (ASSERT)
                                                                                                                                        NIL)))))))))))))))))))))))))))
                                                                                                             ("2"
                                                                                                              (INST
                                                                                                               -1
                                                                                                               "G!1"
                                                                                                               "trunc1(P2!2)"
                                                                                                               "t!1"
                                                                                                               "s!1"
                                                                                                               "w2!1"
                                                                                                               "w1!1")
                                                                                                              (("2"
                                                                                                                (ASSERT)
                                                                                                                (("2"
                                                                                                                  (REWRITE
                                                                                                                   "H_comm")
                                                                                                                  (("2"
                                                                                                                    (ASSERT)
                                                                                                                    (("2"
                                                                                                                      (EXPAND
                                                                                                                       "path_from?")
                                                                                                                      (("2"
                                                                                                                        (HIDE
                                                                                                                         1)
                                                                                                                        (("2"
                                                                                                                          (EXPAND
                                                                                                                           "trunc1"
                                                                                                                           1)
                                                                                                                          (("2"
                                                                                                                            (EXPAND
                                                                                                                             "^")
                                                                                                                            (("2"
                                                                                                                              (EXPAND
                                                                                                                               "fseq")
                                                                                                                              (("2"
                                                                                                                                (LEMMA
                                                                                                                                 "meng_last")
                                                                                                                                (("2"
                                                                                                                                  (REVEAL
                                                                                                                                   -15)
                                                                                                                                  (("2"
                                                                                                                                    (INST?)
                                                                                                                                    (("2"
                                                                                                                                      (ASSERT)
                                                                                                                                      NIL)))))))))))))))))))))))))))))))
                                                                                                       ("2"
                                                                                                        (EXPAND
                                                                                                         "trunc1"
                                                                                                         1)
                                                                                                        (("2"
                                                                                                          (EXPAND
                                                                                                           "^")
                                                                                                          (("2"
                                                                                                            (ASSERT)
                                                                                                            NIL)))))))))))))))))))))))))))))
                                                                               ("2"
                                                                                (ASSERT)
                                                                                NIL)))))
                                                                           ("2"
                                                                            (LEMMA
                                                                             "paths_H_disj")
                                                                            (("2"
                                                                              (INST?)
                                                                              (("2"
                                                                                (INST?)
                                                                                (("1"
                                                                                  (INST
                                                                                   -1
                                                                                   "s!1")
                                                                                  (("1"
                                                                                    (ASSERT)
                                                                                    (("1"
                                                                                      (HIDE
                                                                                       -1
                                                                                       -2
                                                                                       -3
                                                                                       -4
                                                                                       -5
                                                                                       -6
                                                                                       -8
                                                                                       -9
                                                                                       -10
                                                                                       -12
                                                                                       -13
                                                                                       2
                                                                                       9)
                                                                                      (("1"
                                                                                        (HIDE
                                                                                         -3
                                                                                         -5
                                                                                         -7
                                                                                         -8
                                                                                         -9
                                                                                         -10
                                                                                         -12
                                                                                         -14
                                                                                         -15
                                                                                         -16)
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "from?")
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "trunc1")
                                                                                            (("1"
                                                                                              (FLATTEN)
                                                                                              (("1"
                                                                                                (EXPAND
                                                                                                 "^")
                                                                                                (("1"
                                                                                                  (ASSERT)
                                                                                                  NIL)))))))))))))))))
                                                                                 ("2"
                                                                                  (EXPAND
                                                                                   "trunc1"
                                                                                   1)
                                                                                  (("2"
                                                                                    (EXPAND
                                                                                     "^")
                                                                                    (("2"
                                                                                      (ASSERT)
                                                                                      NIL)))))
                                                                                 ("3"
                                                                                  (ASSERT)
                                                                                  NIL)
                                                                                 ("4"
                                                                                  (EXPAND
                                                                                   "trunc1"
                                                                                   1)
                                                                                  (("4"
                                                                                    (EXPAND
                                                                                     "^")
                                                                                    (("4"
                                                                                      (ASSERT)
                                                                                      NIL)))))))))))))
                                                                         ("2"
                                                                          (REWRITE
                                                                           "path_from_to_walk_from")
                                                                          NIL)
                                                                         ("3"
                                                                          (REWRITE
                                                                           "path_from_to_walk_from")
                                                                          (("3"
                                                                            (ASSERT)
                                                                            (("3"
                                                                              (EXPAND
                                                                               "trunc1"
                                                                               1)
                                                                              (("3"
                                                                                (EXPAND
                                                                                 "^")
                                                                                (("3"
                                                                                  (ASSERT)
                                                                                  NIL)))))))))))))
                                                                     ("2"
                                                                      (HIDE
                                                                       -24
                                                                       -23
                                                                       -21
                                                                       -20
                                                                       -17
                                                                       -16)
                                                                      (("2"
                                                                        (HIDE
                                                                         -14
                                                                         -13
                                                                         -1
                                                                         -2
                                                                         -5
                                                                         -6
                                                                         8)
                                                                        (("2"
                                                                          (REPLACE
                                                                           -5
                                                                           *
                                                                           RL)
                                                                          (("2"
                                                                            (HIDE
                                                                             -5)
                                                                            (("2"
                                                                              (REPLACE
                                                                               -5
                                                                               *
                                                                               RL)
                                                                              (("2"
                                                                                (HIDE
                                                                                 -5)
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "path_from?")
                                                                                  (("2"
                                                                                    (FLATTEN)
                                                                                    (("2"
                                                                                      (LEMMA
                                                                                       "path_comp_in")
                                                                                      (("2"
                                                                                        (SPLIT
                                                                                         1)
                                                                                        (("1"
                                                                                          (HIDE
                                                                                           -2
                                                                                           -3)
                                                                                          (("1"
                                                                                            (INST?)
                                                                                            (("1"
                                                                                              (ASSERT)
                                                                                              (("1"
                                                                                                (LEMMA
                                                                                                 "path_H_trunc")
                                                                                                (("1"
                                                                                                  (INST?)
                                                                                                  (("1"
                                                                                                    (INST?)
                                                                                                    (("1"
                                                                                                      (ASSERT)
                                                                                                      (("1"
                                                                                                        (EXPAND
                                                                                                         "path_from?")
                                                                                                        (("1"
                                                                                                          (EXPAND
                                                                                                           "trunc1"
                                                                                                           1)
                                                                                                          (("1"
                                                                                                            (EXPAND
                                                                                                             "^")
                                                                                                            (("1"
                                                                                                              (EXPAND
                                                                                                               "fseq")
                                                                                                              (("1"
                                                                                                                (LEMMA
                                                                                                                 "meng_last")
                                                                                                                (("1"
                                                                                                                  (HIDE
                                                                                                                   -2
                                                                                                                   -3
                                                                                                                   -4
                                                                                                                   -5
                                                                                                                   -6)
                                                                                                                  (("1"
                                                                                                                    (INST?)
                                                                                                                    (("1"
                                                                                                                      (INST?)
                                                                                                                      (("1"
                                                                                                                        (EXPAND
                                                                                                                         "path_from?")
                                                                                                                        (("1"
                                                                                                                          (PROPAX)
                                                                                                                          NIL)))))))))))))))))))))))))))))
                                                                                             ("2"
                                                                                              (EXPAND
                                                                                               "trunc1"
                                                                                               1)
                                                                                              (("2"
                                                                                                (EXPAND
                                                                                                 "^")
                                                                                                (("2"
                                                                                                  (ASSERT)
                                                                                                  NIL)))))))))
                                                                                         ("2"
                                                                                          (PROPAX)
                                                                                          NIL)
                                                                                         ("3"
                                                                                          (INST?)
                                                                                          (("1"
                                                                                            (ASSERT)
                                                                                            (("1"
                                                                                              (LEMMA
                                                                                               "path_H_trunc")
                                                                                              (("1"
                                                                                                (INST?)
                                                                                                (("1"
                                                                                                  (INST?)
                                                                                                  (("1"
                                                                                                    (EXPAND
                                                                                                     "path_from?")
                                                                                                    (("1"
                                                                                                      (EXPAND
                                                                                                       "trunc1"
                                                                                                       1)
                                                                                                      (("1"
                                                                                                        (EXPAND
                                                                                                         "^")
                                                                                                        (("1"
                                                                                                          (EXPAND
                                                                                                           "fseq")
                                                                                                          (("1"
                                                                                                            (LEMMA
                                                                                                             "meng_last")
                                                                                                            (("1"
                                                                                                              (HIDE
                                                                                                               -2
                                                                                                               -3
                                                                                                               -4
                                                                                                               -5
                                                                                                               -6)
                                                                                                              (("1"
                                                                                                                (INST?)
                                                                                                                (("1"
                                                                                                                  (INST?)
                                                                                                                  (("1"
                                                                                                                    (EXPAND
                                                                                                                     "path_from?")
                                                                                                                    (("1"
                                                                                                                      (PROPAX)
                                                                                                                      NIL)))))))))))))))))))))))))))
                                                                                           ("2"
                                                                                            (EXPAND
                                                                                             "trunc1"
                                                                                             1)
                                                                                            (("2"
                                                                                              (EXPAND
                                                                                               "^")
                                                                                              (("2"
                                                                                                (ASSERT)
                                                                                                NIL)))))
                                                                                           ("3"
                                                                                            (ASSERT)
                                                                                            NIL)))
                                                                                         ("4"
                                                                                          (PROPAX)
                                                                                          NIL)))))))))))))))))))))
                                                                     ("3"
                                                                      (ASSERT)
                                                                      NIL)))))
                                                                 ("2"
                                                                  (FLATTEN)
                                                                  (("2"
                                                                    (ASSERT)
                                                                    (("2"
                                                                      (REPLACE
                                                                       -7
                                                                       *
                                                                       RL)
                                                                      (("2"
                                                                        (HIDE
                                                                         -1
                                                                         -2
                                                                         -3
                                                                         -4
                                                                         -5
                                                                         -6
                                                                         -7
                                                                         -8
                                                                         -9
                                                                         -10
                                                                         -13
                                                                         -14
                                                                         -15
                                                                         -16
                                                                         -17
                                                                         -18)
                                                                        (("2"
                                                                          (REVEAL
                                                                           -9
                                                                           -11
                                                                           -12
                                                                           -13)
                                                                          (("2"
                                                                            (LEMMA
                                                                             "ind_verts_w")
                                                                            (("2"
                                                                              (INST
                                                                               -1
                                                                               "meng(G!1, t!1, s!1, w1!1, w2!1)"
                                                                               "P1!2"
                                                                               "P2!2"
                                                                               "t!1"
                                                                               "s!1"
                                                                               "w1!1"
                                                                               "w2!1")
                                                                              (("2"
                                                                                (ASSERT)
                                                                                (("2"
                                                                                  (FLATTEN)
                                                                                  (("2"
                                                                                    (HIDE
                                                                                     -1
                                                                                     -4)
                                                                                    (("2"
                                                                                      (LEMMA
                                                                                       "path_meng_in")
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "path_from?")
                                                                                        (("2"
                                                                                          (INST?)
                                                                                          (("2"
                                                                                            (FLATTEN)
                                                                                            (("2"
                                                                                              (ASSERT)
                                                                                              (("2"
                                                                                                (EXPAND
                                                                                                 "from?")
                                                                                                (("2"
                                                                                                  (FLATTEN)
                                                                                                  (("2"
                                                                                                    (EXPAND
                                                                                                     "trunc1"
                                                                                                     +)
                                                                                                    (("2"
                                                                                                      (EXPAND
                                                                                                       "^")
                                                                                                      (("2"
                                                                                                        (PROPAX)
                                                                                                        NIL)))))))))))))))))))))))))))))))))))))))
                                                                 ("3"
                                                                  (ASSERT)
                                                                  NIL)
                                                                 ("4"
                                                                  (EXPAND
                                                                   "trunc1"
                                                                   1)
                                                                  (("4"
                                                                    (EXPAND
                                                                     "^")
                                                                    (("4"
                                                                      (ASSERT)
                                                                      NIL)))))
                                                                 ("5"
                                                                  (ASSERT)
                                                                  NIL)))
                                                               ("2"
                                                                (REPLACE
                                                                 -3
                                                                 *
                                                                 RL)
                                                                (("2"
                                                                  (HIDE
                                                                   -1
                                                                   -2
                                                                   -3
                                                                   -4
                                                                   -7
                                                                   -12
                                                                   -14
                                                                   8)
                                                                  (("2"
                                                                    (REVEAL
                                                                     -5)
                                                                    (("2"
                                                                      (LEMMA
                                                                       "ind_verts_w")
                                                                      (("2"
                                                                        (INST
                                                                         -1
                                                                         "meng(G!1, t!1, s!1, w1!1, w2!1)"
                                                                         "P1!2"
                                                                         "P2!2"
                                                                         "t!1"
                                                                         "s!1"
                                                                         "w1!1"
                                                                         "w2!1")
                                                                        (("2"
                                                                          (ASSERT)
                                                                          (("2"
                                                                            (FLATTEN)
                                                                            (("2"
                                                                              (HIDE
                                                                               -1)
                                                                              (("2"
                                                                                (LEMMA
                                                                                 "path_meng_in")
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "path_from?")
                                                                                  (("2"
                                                                                    (FLATTEN)
                                                                                    (("2"
                                                                                      (INST?)
                                                                                      (("2"
                                                                                        (ASSERT)
                                                                                        (("2"
                                                                                          (HIDE
                                                                                           -1
                                                                                           -2)
                                                                                          (("2"
                                                                                            (EXPAND
                                                                                             "from?")
                                                                                            (("2"
                                                                                              (EXPAND
                                                                                               "trunc1")
                                                                                              (("2"
                                                                                                (EXPAND
                                                                                                 "^")
                                                                                                (("2"
                                                                                                  (FLATTEN)
                                                                                                  (("2"
                                                                                                    (PROPAX)
                                                                                                    NIL)))))))))))))))))))))))))))))))))))))
                                                               ("3"
                                                                (ASSERT)
                                                                NIL)
                                                               ("4"
                                                                (EXPAND
                                                                 "trunc1"
                                                                 1)
                                                                (("4"
                                                                  (EXPAND
                                                                   "^")
                                                                  (("4"
                                                                    (ASSERT)
                                                                    NIL)))))
                                                               ("5"
                                                                (ASSERT)
                                                                NIL)))
                                                             ("2"
                                                              (REPLACE
                                                               -3
                                                               *
                                                               RL)
                                                              (("2"
                                                                (HIDE
                                                                 -1
                                                                 -2
                                                                 -3
                                                                 -4
                                                                 -5
                                                                 -6
                                                                 -7
                                                                 -8
                                                                 -9
                                                                 -10
                                                                 -11
                                                                 -12
                                                                 8)
                                                                (("2"
                                                                  (REVEAL
                                                                   -11)
                                                                  (("2"
                                                                    (LEMMA
                                                                     "ind_verts_w")
                                                                    (("2"
                                                                      (INST
                                                                       -1
                                                                       "meng(G!1, s!1, t!1, w1!1, w2!1)"
                                                                       "P1!1"
                                                                       "P2!1"
                                                                       "s!1"
                                                                       "t!1"
                                                                       "w1!1"
                                                                       "w2!1")
                                                                      (("2"
                                                                        (ASSERT)
                                                                        (("2"
                                                                          (FLATTEN)
                                                                          (("2"
                                                                            (HIDE
                                                                             -1)
                                                                            (("2"
                                                                              (LEMMA
                                                                               "path_meng_in")
                                                                              (("2"
                                                                                (EXPAND
                                                                                 "path_from?")
                                                                                (("2"
                                                                                  (FLATTEN)
                                                                                  (("2"
                                                                                    (INST?)
                                                                                    (("2"
                                                                                      (ASSERT)
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "from?")
                                                                                        (("2"
                                                                                          (EXPAND
                                                                                           "trunc1"
                                                                                           +)
                                                                                          (("2"
                                                                                            (EXPAND
                                                                                             "^")
                                                                                            (("2"
                                                                                              (FLATTEN)
                                                                                              (("2"
                                                                                                (PROPAX)
                                                                                                NIL)))))))))))))))))))))))))))))))))))
                                                             ("3"
                                                              (EXPAND
                                                               "trunc1"
                                                               1)
                                                              (("3"
                                                                (EXPAND
                                                                 "^")
                                                                (("3"
                                                                  (ASSERT)
                                                                  NIL)))))))
                                                           ("2"
                                                            (REPLACE
                                                             -2
                                                             *
                                                             RL)
                                                            (("2"
                                                              (HIDE
                                                               -1
                                                               -2
                                                               -3
                                                               -4
                                                               -5
                                                               -6
                                                               -7
                                                               -8
                                                               -9
                                                               -13
                                                               8)
                                                              (("2"
                                                                (LEMMA
                                                                 "ind_verts_w")
                                                                (("2"
                                                                  (INST
                                                                   -1
                                                                   "meng(G!1, s!1, t!1, w1!1, w2!1)"
                                                                   "P1!1"
                                                                   "P2!1"
                                                                   "s!1"
                                                                   "t!1"
                                                                   "w1!1"
                                                                   "w2!1")
                                                                  (("2"
                                                                    (ASSERT)
                                                                    (("2"
                                                                      (FLATTEN)
                                                                      (("2"
                                                                        (LEMMA
                                                                         "path_meng_in")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "path_from?")
                                                                          (("2"
                                                                            (FLATTEN)
                                                                            (("2"
                                                                              (INST?)
                                                                              (("2"
                                                                                (ASSERT)
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "from?")
                                                                                  (("2"
                                                                                    (EXPAND
                                                                                     "trunc1"
                                                                                     +)
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "^")
                                                                                      (("2"
                                                                                        (FLATTEN)
                                                                                        (("2"
                                                                                          (PROPAX)
                                                                                          NIL)))))))))))))))))))))))))))))))
                                                           ("3"
                                                            (EXPAND
                                                             "trunc1"
                                                             1)
                                                            (("3"
                                                              (EXPAND
                                                               "^")
                                                              (("3"
                                                                (ASSERT)
                                                                NIL)))))))))))))))))
                                               ("2"
                                                (EXPAND
                                                 "induction_step")
                                                (("2" (PROPAX) NIL)))
                                               ("3"
                                                (PROPAX)
                                                NIL)))))))))))))))))))))))))))
                     ("2" (PROPAX) NIL)))))))))
             ("2" (ASSERT) NIL) ("3" (ASSERT) NIL))))))))))))))
$$$h_menger.pvs
h_menger[T: TYPE]: THEORY
BEGIN
   IMPORTING meng_scaff_prelude[T], graph_inductions[T], graph_ops[T], path_ops[T]
   G,MM: VAR graph[T]
   v,s,t,w1,w2,av,ajm,z,x: VAR T
   W: VAR finite_set[T]
   p,p1,p2: VAR prewalk
   e: VAR doubleton[T]
   path_not_thru: LEMMA separable?(G,s,t) AND
                        sep_num(G,s,t) = 2 AND
                        vert(G)(s) AND vert(G)(t)
                    IMPLIES
                      (FORALL (z: T): z /= s AND z /= t IMPLIES
                        (EXISTS (pn: prewalk): path_from?(del_vert(G,z),pn,s,t)))
  adjacent_fact: LEMMA separates(G, dbl(w1, w2), s, t) AND
                    separable?(G,s,t) AND
                    sep_num(G,s,t) = 2 AND
                    in?(G,s,t,w1,w2) AND
                    disjoint?(s,t,w1,w2) AND
                    edge?(G)(w1,s) AND
                    edge?(G)(w2,s) AND
                    (edge?(G)(w1,s) AND edge?(G)(w1,t))
                  IMPLIES
                          (EXISTS (p1,p2: prewalk): path_from?(G,p1,s,t) AND
                                                   path_from?(G,p2,s,t) AND
                                                   independent?(p1,p2))
  sep_num_del: LEMMA separable?(G,s,t) AND vert(G)(s) AND vert(G)(t)
                     AND v /= t AND v /= s IMPLIES
                     sep_num(del_vert(G, v), s, t) <= sep_num(G, s, t)
  separates_del: LEMMA separates(del_vert(G,ajm), singleton(z), s,t) AND
                         vert(G)(ajm) AND vert(G)(s) AND vert(G)(t) AND
                         ajm /= s AND ajm /= t
                       IMPLIES
                           separates(G, dbl(ajm,z), s,t)
  induction_step_comm: LEMMA induction_step(G,s,t) IMPLIES induction_step(G,t,s)
  separable?_del: LEMMA separable?(G,s,t) AND vert(G)(s) AND vert(G)(t)
                        AND v /= s AND v /= t
                        IMPLIES separable?(del_vert(G, v), s, t) AND
                                vert(del_vert(G, v))(s) AND
                                vert(del_vert(G, v))(t)
  seq_j: LEMMA (l(p) > 3 AND edge?(G)(seq(p)(l(p)-2),t) AND
               NOT edge?(G)(seq(p)(0),t)) IMPLIES
                 (EXISTS (j: nat): j > 0 AND j < l(p) AND
                                   NOT edge?(G)(seq(p)(j - 1), t)
                                   AND edge?(G)(seq(p)(j), t))
  short_path_case: LEMMA vert(G)(x) AND vert(G)(s) AND vert(G)(t) AND
                         edge?(G)(s, x) AND edge?(G)(x, t) AND
                         separable?(G, s, t) AND
                         sep_num(G, s, t) = 2
                     IMPLIES
                  (EXISTS (p1, p2: prewalk):
                    path_from?(G, p1, s, t)
                        AND path_from?(G, p2, s, t) AND independent?(p1, p2))
  finale: LEMMA  separable?(G,s,t) AND sep_num(G,s,t) = 2 AND
                 vert(G)(s) AND vert(G)(t) AND
                 induction_step(G,s,t)
                IMPLIES
                      (EXISTS (p1,p2: prewalk): path_from?(G,p1,s,t) AND
                                               path_from?(G,p2,s,t) AND
                                               independent?(p1,p2))
  h_menger: LEMMA  separable?(G,s,t) AND sep_num(G,s,t) = 2 AND
                      vert(G)(s) AND vert(G)(t)
                IMPLIES
                      (EXISTS (p1,p2: prewalk): path_from?(G,p1,s,t) AND
                                               path_from?(G,p2,s,t) AND
                                               independent?(p1,p2))
  hard_menger: LEMMA  separable?(G,s,t) AND sep_num(G,s,t) = 2 AND
                      vert(G)(s) AND vert(G)(t)
                IMPLIES
                        (EXISTS (ips: set_of_paths(G,s,t)):
                                 card(ips) = 2 AND ind_path_set?(G,s,t,ips))
%
END h_menger
$$$h_menger.prf
(|h_menger|
 (|path_not_thru| "" (SKOSIMP*)
  (("" (CASE "(FORALL (zz: T): NOT separates(G!1,singleton(zz),s!1,t!1))")
    (("1" (INST -1 "z!1")
      (("1" (EXPAND "separates" 1)
        (("1" (EXPAND "singleton")
          (("1" (ASSERT)
            (("1" (SKOSIMP*)
              (("1" (LEMMA "walk_to_path_from")
                (("1" (INST?)
                  (("1" (ASSERT)
                    (("1" (HIDE -2)
                      (("1" (SKOSIMP*)
                        (("1"
                          (CASE-REPLACE
                           "del_verts(G!1, {y: T | y = z!1}) = del_vert(G!1, z!1)")
                          (("1" (HIDE -1) (("1" (INST + "p!1") NIL)))
                           ("2" (HIDE -1 -2 -3 4)
                            (("2" (APPLY-EXTENSIONALITY :HIDE? T)
                              (("1" (APPLY-EXTENSIONALITY :HIDE? T)
                                (("1" (IFF 1)
                                  (("1" (EXPAND "del_verts")
                                    (("1" (EXPAND "del_vert")
                                      (("1"
                                        (GROUND)
                                        (("1" (INST?) (("1" (ASSERT) NIL)))
                                         ("2"
                                          (SKOSIMP*)
                                          (("2" (ASSERT) NIL)))))))))))
                                 ("2" (LEMMA "finite_singleton[T]")
                                  (("2" (INST?)
                                    (("2" (EXPAND "singleton")
                                      (("2" (PROPAX) NIL)))))))))
                               ("2" (APPLY-EXTENSIONALITY :HIDE? T)
                                (("1" (EXPAND "del_verts")
                                  (("1" (EXPAND "del_vert")
                                    (("1" (EXPAND "difference")
                                      (("1"
                                        (EXPAND "remove")
                                        (("1"
                                          (EXPAND "member")
                                          (("1"
                                            (IFF)
                                            (("1" (GROUND) NIL)))))))))))))
                                 ("2" (LEMMA "finite_singleton[T]")
                                  (("2" (INST?)
                                    (("2" (EXPAND "singleton")
                                      (("2" (PROPAX) NIL)))))))))
                               ("3" (LEMMA "finite_singleton[T]")
                                (("3" (INST?)
                                  (("3" (EXPAND "singleton")
                                    (("3" (PROPAX) NIL)))))))))))
                           ("3" (LEMMA "finite_singleton[T]")
                            (("3" (INST?)
                              (("3" (EXPAND "singleton")
                                (("3" (PROPAX) NIL)))))))))))))))
                   ("2" (LEMMA "finite_singleton[T]")
                    (("2" (INST?)
                      (("2" (EXPAND "singleton")
                        (("2" (PROPAX) NIL)))))))))))))))))))))
     ("2" (SKOSIMP*)
      (("2" (HIDE -2)
        (("2" (EXPAND "sep_num")
          (("2" (LEMMA "min_sep_set_card")
            (("2" (INST?)
              (("1" (ASSERT)
                (("1" (REWRITE "card_singleton") (("1" (ASSERT) NIL)))))
               ("2" (REWRITE "finite_singleton") NIL)))))))))))
     ("3" (SKOSIMP*) (("3" (REWRITE "finite_singleton") NIL)))))))
 (|adjacent_fact_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|adjacent_fact| "" (SKOSIMP*)
  (("" (EXPAND "in?")
    (("" (FLATTEN)
      (("" (LEMMA "path_not_thru")
        (("" (INST?)
          (("" (ASSERT)
            (("" (INST -1 "w1!1")
              (("" (EXPAND "disjoint?")
                (("" (FLATTEN)
                  (("" (ASSERT)
                    (("" (SKOSIMP*)
                      (("" (NAME "path2" "add1(gen_seq2(G!1,s!1,w1!1),t!1)")
                        (("" (CASE "independent?(pn!1,path2)")
                          (("1" (LEMMA "path_from_l")
                            (("1" (INST?)
                              (("1" (ASSERT)
                                (("1" (EXPAND "path_from?")
                                  (("1" (FLATTEN)
                                    (("1" (LEMMA "path?_del_vert")
                                      (("1"
                                        (INST?)
                                        (("1"
                                          (ASSERT)
                                          (("1"
                                            (CASE
                                             "path?[T](G!1, path2) AND from?[T](path2, s!1, t!1)")
                                            (("1"
                                              (FLATTEN)
                                              (("1"
                                                (INST + "pn!1" "path2")
                                                (("1" (ASSERT) NIL)))))
                                             ("2"
                                              (HIDE -1 -2 -3 -5 -6 -7 -8 -9 8)
                                              (("2"
                                                (REPLACE -1 * RL)
                                                (("2"
                                                  (HIDE -1)
                                                  (("2"
                                                    (SPLIT +)
                                                    (("1"
                                                      (EXPAND "path?")
                                                      (("1"
                                                        (SPLIT +)
                                                        (("1"
                                                          (LEMMA "walk?_add1")
                                                          (("1"
                                                            (INST?)
                                                            (("1"
                                                              (ASSERT)
                                                              (("1"
                                                                (EXPAND
                                                                 "gen_seq2")
                                                                (("1"
                                                                  (HIDE 2)
                                                                  (("1"
                                                                    (EXPAND
                                                                     "walk?")
                                                                    (("1"
                                                                      (EXPAND
                                                                       "fseq")
                                                                      (("1"
                                                                        (EXPAND
                                                                         "verts_in?")
                                                                        (("1"
                                                                          (SKOSIMP*)
                                                                          (("1"
                                                                            (EXPAND
                                                                             "edge?")
                                                                            (("1"
                                                                              (ASSERT)
                                                                              (("1"
                                                                                (REWRITE
                                                                                 "dbl_comm")
                                                                                NIL)))))))))))))))))))))))
                                                         ("2"
                                                          (SKOSIMP*)
                                                          (("2"
                                                            (EXPAND "fseq")
                                                            (("2"
                                                              (EXPAND "add1")
                                                              (("2"
                                                                (EXPAND
                                                                 "gen_seq2")
                                                                (("2"
                                                                  (LIFT-IF)
                                                                  (("2"
                                                                    (LIFT-IF)
                                                                    (("2"
                                                                      (TYPEPRED
                                                                       "i!1")
                                                                      (("2"
                                                                        (TYPEPRED
                                                                         "j!1")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "add1")
                                                                          (("2"
                                                                            (EXPAND
                                                                             "gen_seq2")
                                                                            (("2"
                                                                              (GROUND)
                                                                              NIL)))))))))))))))))))))))))
                                                     ("2"
                                                      (EXPAND "add1")
                                                      (("2"
                                                        (EXPAND "from?")
                                                        (("2"
                                                          (EXPAND "gen_seq2")
                                                          (("2"
                                                            (PROPAX)
                                                            NIL)))))))))))))))))))))))))))))))))
                           ("2" (HIDE -3 -4 -5 8)
                            (("2" (EXPAND "independent?")
                              (("2" (SKOSIMP*)
                                (("2" (REPLACE -6 * RL)
                                  (("2" (HIDE -6)
                                    (("2" (EXPAND "add1")
                                      (("2"
                                        (EXPAND "gen_seq2")
                                        (("2"
                                          (LIFT-IF)
                                          (("2"
                                            (GROUND)
                                            (("2"
                                              (EXPAND "path_from?")
                                              (("2"
                                                (EXPAND "path?")
                                                (("2"
                                                  (EXPAND "walk?")
                                                  (("2"
                                                    (FLATTEN)
                                                    (("2"
                                                      (HIDE -8 -9)
                                                      (("2"
                                                        (EXPAND "verts_in?")
                                                        (("2"
                                                          (INST?)
                                                          (("2"
                                                            (EXPAND
                                                             "del_vert")
                                                            (("2"
                                                              (EXPAND
                                                               "remove")
                                                              (("2"
                                                                (PROPAX)
                                                                NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 (|sep_num_del| "" (SKOSIMP*)
  (("" (LEMMA "min_sep_set_seps")
    (("" (INST?)
      (("" (ASSERT)
        (("" (EXPAND "sep_num")
          (("" (LEMMA "min_sep_set_card")
            (("" (INST?)
              (("1" (ASSERT)
                (("1" (HIDE -2 2)
                  (("1" (EXPAND "separates")
                    (("1" (SKOSIMP*)
                      (("1" (SPLIT 1)
                        (("1" (PROPAX) NIL) ("2" (PROPAX) NIL)
                         ("3" (SKOSIMP*)
                          (("3" (INST?)
                            (("3" (EXPAND "walk_from?")
                              (("3" (FLATTEN)
                                (("3" (ASSERT)
                                  (("3" (EXPAND "walk?")
                                    (("3" (SPLIT +)
                                      (("1"
                                        (FLATTEN)
                                        (("1"
                                          (EXPAND "verts_in?")
                                          (("1"
                                            (SKOSIMP*)
                                            (("1"
                                              (HIDE -4)
                                              (("1"
                                                (INST?)
                                                (("1"
                                                  (GROUND)
                                                  (("1"
                                                    (EXPAND "del_verts")
                                                    (("1"
                                                      (EXPAND "difference")
                                                      (("1"
                                                        (EXPAND "member")
                                                        (("1"
                                                          (FLATTEN)
                                                          (("1"
                                                            (EXPAND
                                                             "del_vert")
                                                            (("1"
                                                              (EXPAND
                                                               "remove")
                                                              (("1"
                                                                (EXPAND
                                                                 "member")
                                                                (("1"
                                                                  (FLATTEN)
                                                                  (("1"
                                                                    (ASSERT)
                                                                    NIL)))))))))))))))))))))))))))))
                                       ("2"
                                        (SKOSIMP*)
                                        (("2"
                                          (EXPAND "fseq")
                                          (("2"
                                            (EXPAND "edge?")
                                            (("2"
                                              (INST?)
                                              (("2"
                                                (ASSERT)
                                                (("2"
                                                  (FLATTEN)
                                                  (("2"
                                                    (ASSERT)
                                                    (("2"
                                                      (HIDE -4)
                                                      (("2"
                                                        (EXPAND "del_verts")
                                                        (("2"
                                                          (FLATTEN)
                                                          (("2"
                                                            (SPLIT +)
                                                            (("1"
                                                              (LEMMA
                                                               "edges_del_vert")
                                                              (("1"
                                                                (INST?)
                                                                (("1"
                                                                  (ASSERT)
                                                                  NIL)
                                                                 ("2"
                                                                  (INST?)
                                                                  (("2"
                                                                    (ASSERT)
                                                                    NIL)))))))
                                                             ("2"
                                                              (PROPAX)
                                                              NIL)))))))))))))))))))))))))))))))))))))))))))))))
               ("2" (HIDE -1 2)
                (("2" (EXPAND "del_vert")
                  (("2" (EXPAND "remove")
                    (("2" (EXPAND "member") (("2" (PROPAX) NIL)))))))))
               ("3" (HIDE -1 4)
                (("3" (EXPAND "del_vert")
                  (("3" (EXPAND "remove")
                    (("3" (EXPAND "member")
                      (("3" (PROPAX) NIL)))))))))))))))))))))))
 (|separates_del_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_singleton") NIL)))
 (|separates_del_TCC2| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|separates_del| "" (SKOSIMP*)
  (("" (EXPAND "del_vert")
    (("" (EXPAND "separates")
      (("" (EXPAND "singleton")
        (("" (EXPAND "dbl")
          (("" (FLATTEN)
            (("" (ASSERT)
              (("" (SKOSIMP*)
                (("" (INST?)
                  (("" (EXPAND "walk_from?")
                    (("" (FLATTEN)
                      (("" (ASSERT)
                        (("" (EXPAND "walk?")
                          (("" (FLATTEN)
                            (("" (SPLIT +)
                              (("1" (EXPAND "verts_in?")
                                (("1" (HIDE -7)
                                  (("1" (SKOSIMP*)
                                    (("1" (EXPAND "del_verts")
                                      (("1"
                                        (EXPAND "difference")
                                        (("1"
                                          (EXPAND "remove")
                                          (("1"
                                            (EXPAND "member")
                                            (("1"
                                              (INST?)
                                              (("1"
                                                (FLATTEN)
                                                (("1"
                                                  (ASSERT)
                                                  NIL)))))))))))))))))))
                               ("2" (SKOSIMP*)
                                (("2" (EXPAND "edge?")
                                  (("2" (EXPAND "fseq")
                                    (("2" (INST?)
                                      (("2"
                                        (ASSERT)
                                        (("2"
                                          (FLATTEN)
                                          (("2"
                                            (ASSERT)
                                            (("2"
                                              (EXPAND "del_verts")
                                              (("2"
                                                (HIDE -7)
                                                (("2"
                                                  (FLATTEN)
                                                  (("2"
                                                    (ASSERT)
                                                    (("2"
                                                      (SPLIT +)
                                                      (("1"
                                                        (EXPAND "dbl")
                                                        (("1"
                                                          (INST-CP - "ajm!1")
                                                          (("1"
                                                            (INST - "z!1")
                                                            (("1"
                                                              (ASSERT)
                                                              NIL)))))))
                                                       ("2"
                                                        (SKOSIMP*)
                                                        (("2"
                                                          (REPLACE -1)
                                                          (("2"
                                                            (HIDE -1)
                                                            (("2"
                                                              (EXPAND "dbl")
                                                              (("2"
                                                                (INST - "z!1")
                                                                (("2"
                                                                  (GROUND)
                                                                  NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 (|induction_step_comm| "" (SKOSIMP*)
  (("" (EXPAND "induction_step") (("" (PROPAX) NIL)))))
 (|separable?_del| "" (SKOSIMP*)
  (("" (EXPAND "separable?")
    (("" (FLATTEN)
      (("" (ASSERT)
        (("" (EXPAND "edge?")
          (("" (EXPAND "del_vert")
            (("" (ASSERT)
              (("" (EXPAND "remove")
                (("" (EXPAND "member") (("" (PROPAX) NIL)))))))))))))))))))
 (|seq_j_TCC1| "" (SUBTYPE-TCC) NIL) (|seq_j_TCC2| "" (SUBTYPE-TCC) NIL)
 (|seq_j_TCC3| "" (SUBTYPE-TCC) NIL)
 (|seq_j| "" (INDUCT "p" 1 "graph_induction_walk")
  (("1" (SKOSIMP*)
    (("1" (INST -1 "trunc1(w!1)")
      (("1" (REWRITE "l_trunc1")
        (("1" (ASSERT)
          (("1"
            (CASE "NOT edge?(G!1)(seq(w!1)(l(w!1) - 3), t!1)
                 AND edge?(G!1)(seq(w!1)(l(w!1)-2), t!1)")
            (("1" (INST + "l(w!1)-2") (("1" (FLATTEN) (("1" (ASSERT) NIL)))))
             ("2" (INST -1 "G!1" "t!1")
              (("2" (CASE "l(w!1) = 4")
                (("1" (HIDE -2)
                  (("1" (REPLACE -1)
                    (("1" (HIDE -1)
                      (("1" (ASSERT)
                        (("1" (INST + "1") (("1" (ASSERT) NIL)))))))))))
                 ("2" (ASSERT)
                  (("2" (EXPAND "trunc1")
                    (("2" (EXPAND "^")
                      (("2" (SKOSIMP*)
                        (("2" (INST + "j!1")
                          (("2" (ASSERT) NIL)))))))))))))))))))))
       ("2" (ASSERT) NIL)))))
   ("2" (SKOSIMP*) (("2" (ASSERT) NIL)))
   ("3" (SKOSIMP*) (("3" (ASSERT) NIL)))))
 (|short_path_case| "" (SKOSIMP*)
  (("" (LEMMA "path_not_thru")
    (("" (INST?)
      (("" (ASSERT)
        (("" (INST?)
          (("" (EXPAND "edge?")
            (("" (FLATTEN)
              (("" (ASSERT)
                (("" (SKOSIMP*)
                  (("" (NAME "path2" "add1(gen_seq2(G!1,s!1,x!1),t!1)")
                    (("" (INST + "path2" "pn!1")
                      (("" (EXPAND "path_from?")
                        (("" (FLATTEN)
                          (("" (EXPAND "from?")
                            (("" (FLATTEN)
                              (("" (ASSERT)
                                (("" (LEMMA "path?_del_vert")
                                  (("" (INST?)
                                    (("" (ASSERT)
                                      ((""
                                        (REPLACE -2 * RL)
                                        ((""
                                          (HIDE -2)
                                          ((""
                                            (SPLIT +)
                                            (("1"
                                              (REWRITE "path?_add1")
                                              (("1"
                                                (HIDE 2)
                                                (("1"
                                                  (REWRITE "path?_gen_seq2")
                                                  NIL)))
                                               ("2"
                                                (EXPAND "gen_seq2")
                                                (("2"
                                                  (EXPAND "edge?")
                                                  (("2" (PROPAX) NIL)))))
                                               ("3"
                                                (EXPAND "verts_of" -1)
                                                (("3"
                                                  (EXPAND "fseq")
                                                  (("3"
                                                    (EXPAND "gen_seq2" -1)
                                                    (("3"
                                                      (SKOSIMP*)
                                                      (("3"
                                                        (LIFT-IF)
                                                        (("3"
                                                          (GROUND)
                                                          (("3"
                                                            (EXPAND
                                                             "separable?")
                                                            (("3"
                                                              (PROPAX)
                                                              NIL)))))))))))))))))
                                             ("2"
                                              (EXPAND "add1")
                                              (("2"
                                                (EXPAND "gen_seq2")
                                                (("2" (PROPAX) NIL)))))
                                             ("3"
                                              (EXPAND "add1")
                                              (("3" (PROPAX) NIL)))
                                             ("4"
                                              (EXPAND "independent?")
                                              (("4"
                                                (SKOSIMP*)
                                                (("4"
                                                  (EXPAND "add1")
                                                  (("4"
                                                    (EXPAND "gen_seq2")
                                                    (("4"
                                                      (LIFT-IF)
                                                      (("4"
                                                        (EXPAND "path?")
                                                        (("4"
                                                          (EXPAND "walk?")
                                                          (("4"
                                                            (FLATTEN)
                                                            (("4"
                                                              (HIDE
                                                               -6
                                                               -7
                                                               -10
                                                               -11)
                                                              (("4"
                                                                (EXPAND
                                                                 "verts_in?")
                                                                (("4"
                                                                  (EXPAND
                                                                   "fseq")
                                                                  (("4"
                                                                    (INST-CP
                                                                     -
                                                                     "i!1"
                                                                     "j!1")
                                                                    (("1"
                                                                      (GROUND)
                                                                      (("1"
                                                                        (EXPAND
                                                                         "del_vert")
                                                                        (("1"
                                                                          (EXPAND
                                                                           "remove")
                                                                          (("1"
                                                                            (EXPAND
                                                                             "member")
                                                                            (("1"
                                                                              (HIDE
                                                                               -7)
                                                                              (("1"
                                                                                (INST
                                                                                 -7
                                                                                 "j!1")
                                                                                (("1"
                                                                                  (FLATTEN)
                                                                                  (("1"
                                                                                    (PROPAX)
                                                                                    NIL)))))))))))))
                                                                       ("2"
                                                                        (INST
                                                                         -9
                                                                         "j!1")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "del_vert")
                                                                          (("2"
                                                                            (EXPAND
                                                                             "remove")
                                                                            (("2"
                                                                              (PROPAX)
                                                                              NIL)))))))))
                                                                     ("2"
                                                                      (ASSERT)
                                                                      NIL)
                                                                     ("3"
                                                                      (TYPEPRED
                                                                       "i!1")
                                                                      (("3"
                                                                        (GROUND)
                                                                        NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 (|finale| "" (SKOSIMP*)
  (("" (LEMMA "sep_num_gt_0")
    (("" (INST?)
      (("" (ASSERT)
        (("" (SKOSIMP*)
          (("" (LEMMA "walk_to_path_from")
            (("" (INST?)
              (("" (ASSERT)
                (("" (SKOSIMP*)
                  (("" (HIDE -2)
                    (("" (CASE "l(p!1) <= 3")
                      (("1" (LEMMA "path_from_l")
                        (("1" (INST?)
                          (("1" (ASSERT)
                            (("1" (EXPAND "separable?")
                              (("1" (FLATTEN)
                                (("1" (ASSERT)
                                  (("1" (EXPAND "path_from?" -)
                                    (("1" (EXPAND "path?")
                                      (("1"
                                        (EXPAND "walk?")
                                        (("1"
                                          (EXPAND "verts_in?")
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (INST - "1")
                                              (("1"
                                                (INST-CP - "0")
                                                (("1"
                                                  (INST - "1")
                                                  (("1"
                                                    (ASSERT)
                                                    (("1"
                                                      (EXPAND "from?")
                                                      (("1"
                                                        (FLATTEN)
                                                        (("1"
                                                          (EXPAND "fseq")
                                                          (("1"
                                                            (CASE-REPLACE
                                                             "l(p!1) = 3")
                                                            (("1"
                                                              (ASSERT)
                                                              (("1"
                                                                (LEMMA
                                                                 "short_path_case")
                                                                (("1"
                                                                  (INST?)
                                                                  (("1"
                                                                    (INST?)
                                                                    (("1"
                                                                      (ASSERT)
                                                                      NIL)))))))))
                                                             ("2"
                                                              (ASSERT)
                                                              NIL)))))))))))))))))))))))))))))))))))))))
                       ("2"
                        (CASE "  (EXISTS (j: nat): j > 1 AND j < l(p!1)-1  AND
           NOT edge?(G!1)(seq(p!1)(j - 1), t!1)
               AND edge?(G!1)(seq(p!1)(j), t!1))")
                        (("1" (SKOSIMP*)
                          (("1"
                            (CASE "vert(G!1)(seq(p!1)(j!1 - 1)) AND vert(G!1)(seq(p!1)(j!1)) AND
              disjoint?(s!1,t!1,seq(p!1)(j!1-1),seq(p!1)(j!1))")
                            (("1" (FLATTEN)
                              (("1"
                                (CASE "separates(G!1,dbl(seq(p!1)(j!1-1),seq(p!1)(j!1)),s!1,t!1)")
                                (("1" (LEMMA "prelude")
                                  (("1" (INST - "G!1" "s!1" "t!1" "_" "_")
                                    (("1" (INST?)
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (EXPAND "in?")
                                          (("1"
                                            (SPLIT -1)
                                            (("1" (PROPAX) NIL)
                                             ("2"
                                              (FLATTEN)
                                              (("2"
                                                (LEMMA "adjacent_fact")
                                                (("2"
                                                  (INST
                                                   -
                                                   "G!1"
                                                   "s!1"
                                                   "t!1"
                                                   "seq(p!1)(j!1)"
                                                   "seq(p!1)(j!1-1)")
                                                  (("2"
                                                    (ASSERT)
                                                    (("2"
                                                      (EXPAND "in?")
                                                      (("2"
                                                        (EXPAND "disjoint?")
                                                        (("2"
                                                          (FLATTEN)
                                                          (("2"
                                                            (ASSERT)
                                                            (("2"
                                                              (REWRITE
                                                               "dbl_comm")
                                                              (("2"
                                                                (ASSERT)
                                                                NIL)))))))))))))))))))))))))
                                       ("2" (ASSERT) NIL)
                                       ("3" (ASSERT) NIL)))))))
                                 ("2" (EXPAND "separates")
                                  (("2" (EXPAND "disjoint?")
                                    (("2" (FLATTEN)
                                      (("2"
                                        (EXPAND "dbl" 1 (1 2))
                                        (("2"
                                          (ASSERT)
                                          (("2"
                                            (SKOSIMP*)
                                            (("2"
                                              (LEMMA "walk_to_path_from")
                                              (("2"
                                                (INST?)
                                                (("2"
                                                  (ASSERT)
                                                  (("2"
                                                    (SKOSIMP*)
                                                    (("2"
                                                      (HIDE -2)
                                                      (("2"
                                                        (CASE
                                                         "edge?(G!1)(s!1,seq(p!1)(j!1-1))")
                                                        (("1"
                                                          (NAME
                                                           "Pscat"
                                                           "add1(add1(gen_seq2(G!1,s!1,seq(p!1)(j!1-1)),seq(p!1)(j!1)),t!1)")
                                                          (("1"
                                                            (CASE
                                                             "independent?(p!2,Pscat)")
                                                            (("1"
                                                              (INST
                                                               +
                                                               "p!2"
                                                               "Pscat")
                                                              (("1"
                                                                (ASSERT)
                                                                (("1"
                                                                  (EXPAND
                                                                   "path_from?")
                                                                  (("1"
                                                                    (FLATTEN)
                                                                    (("1"
                                                                      (ASSERT)
                                                                      (("1"
                                                                        (LEMMA
                                                                         "path?_del_verts")
                                                                        (("1"
                                                                          (INST?)
                                                                          (("1"
                                                                            (ASSERT)
                                                                            (("1"
                                                                              (HIDE
                                                                               -1
                                                                               -2
                                                                               -5
                                                                               -6)
                                                                              (("1"
                                                                                (REPLACE
                                                                                 -1
                                                                                 *
                                                                                 RL)
                                                                                (("1"
                                                                                  (HIDE
                                                                                   -1)
                                                                                  (("1"
                                                                                    (SPLIT)
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "path?"
                                                                                       -)
                                                                                      (("1"
                                                                                        (FLATTEN)
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "walk?")
                                                                                          (("1"
                                                                                            (FLATTEN)
                                                                                            (("1"
                                                                                              (INST
                                                                                               -8
                                                                                               "j!1-1")
                                                                                              (("1"
                                                                                                (ASSERT)
                                                                                                (("1"
                                                                                                  (EXPAND
                                                                                                   "fseq")
                                                                                                  (("1"
                                                                                                    (REWRITE
                                                                                                     "path?_add1")
                                                                                                    (("1"
                                                                                                      (HIDE
                                                                                                       2)
                                                                                                      (("1"
                                                                                                        (REWRITE
                                                                                                         "path?_add1")
                                                                                                        (("1"
                                                                                                          (HIDE
                                                                                                           2)
                                                                                                          (("1"
                                                                                                            (REWRITE
                                                                                                             "path?_gen_seq2")
                                                                                                            NIL)))
                                                                                                         ("2"
                                                                                                          (EXPAND
                                                                                                           "gen_seq2")
                                                                                                          (("2"
                                                                                                            (PROPAX)
                                                                                                            NIL)))
                                                                                                         ("3"
                                                                                                          (EXPAND
                                                                                                           "verts_of"
                                                                                                           -1)
                                                                                                          (("3"
                                                                                                            (EXPAND
                                                                                                             "fseq")
                                                                                                            (("3"
                                                                                                              (EXPAND
                                                                                                               "gen_seq2"
                                                                                                               -1)
                                                                                                              (("3"
                                                                                                                (SKOSIMP*)
                                                                                                                (("3"
                                                                                                                  (LIFT-IF)
                                                                                                                  (("3"
                                                                                                                    (GROUND)
                                                                                                                    NIL)))))))))))))))
                                                                                                     ("2"
                                                                                                      (EXPAND
                                                                                                       "add1")
                                                                                                      (("2"
                                                                                                        (PROPAX)
                                                                                                        NIL)))
                                                                                                     ("3"
                                                                                                      (HIDE
                                                                                                       1)
                                                                                                      (("3"
                                                                                                        (EXPAND
                                                                                                         "verts_of"
                                                                                                         -1)
                                                                                                        (("3"
                                                                                                          (EXPAND
                                                                                                           "add1"
                                                                                                           -1)
                                                                                                          (("3"
                                                                                                            (EXPAND
                                                                                                             "gen_seq2"
                                                                                                             -1)
                                                                                                            (("3"
                                                                                                              (EXPAND
                                                                                                               "fseq")
                                                                                                              (("3"
                                                                                                                (SKOSIMP*)
                                                                                                                (("3"
                                                                                                                  (LIFT-IF)
                                                                                                                  (("3"
                                                                                                                    (GROUND)
                                                                                                                    NIL)))))))))))))))))))))))))))))))
                                                                                     ("2"
                                                                                      (EXPAND
                                                                                       "from?")
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "add1")
                                                                                        (("2"
                                                                                          (EXPAND
                                                                                           "gen_seq2")
                                                                                          (("2"
                                                                                            (PROPAX)
                                                                                            NIL)))))))))))))))))))))))))))))))
                                                             ("2"
                                                              (REPLACE
                                                               -1
                                                               *
                                                               RL)
                                                              (("2"
                                                                (HIDE -1)
                                                                (("2"
                                                                  (HIDE
                                                                   -1
                                                                   -7
                                                                   -9
                                                                   -10
                                                                   -13
                                                                   8
                                                                   10)
                                                                  (("2"
                                                                    (EXPAND
                                                                     "path_from?")
                                                                    (("2"
                                                                      (EXPAND
                                                                       "path?")
                                                                      (("2"
                                                                        (EXPAND
                                                                         "walk?")
                                                                        (("2"
                                                                          (FLATTEN)
                                                                          (("2"
                                                                            (HIDE
                                                                             -2)
                                                                            (("2"
                                                                              (EXPAND
                                                                               "independent?")
                                                                              (("2"
                                                                                (SKOSIMP*)
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "add1")
                                                                                  (("2"
                                                                                    (EXPAND
                                                                                     "gen_seq2")
                                                                                    (("2"
                                                                                      (LIFT-IF)
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "verts_in?")
                                                                                        (("2"
                                                                                          (EXPAND
                                                                                           "del_verts")
                                                                                          (("2"
                                                                                            (EXPAND
                                                                                             "difference")
                                                                                            (("2"
                                                                                              (EXPAND
                                                                                               "member")
                                                                                              (("2"
                                                                                                (INST?)
                                                                                                (("1"
                                                                                                  (FLATTEN)
                                                                                                  (("1"
                                                                                                    (EXPAND
                                                                                                     "dbl")
                                                                                                    (("1"
                                                                                                      (GROUND)
                                                                                                      NIL)))))
                                                                                                 ("2"
                                                                                                  (ASSERT)
                                                                                                  NIL)))))))))))))))))))))))))))))))))))))))))
                                                         ("2"
                                                          (CASE
                                                           "(FORALL (v:T): vert(G!1)(v) AND v /= s!1 AND v /= t!1
                               IMPLIES sep_num(del_vert(G!1,v),s!1,t!1) <= 1)")
                                                          (("1"
                                                            (INST
                                                             -1
                                                             "seq(p!1)(j!1-1)")
                                                            (("1"
                                                              (ASSERT)
                                                              (("1"
                                                                (LEMMA
                                                                 "sep_num_le1")
                                                                (("1"
                                                                  (INST
                                                                   -1
                                                                   "del_vert(G!1, seq(p!1)(j!1 - 1))"
                                                                   "seq(p!1)(j!1)"
                                                                   "s!1"
                                                                   "t!1")
                                                                  (("1"
                                                                    (EXPAND
                                                                     "separable?")
                                                                    (("1"
                                                                      (ASSERT)
                                                                      (("1"
                                                                        (LEMMA
                                                                         "separable?_del")
                                                                        (("1"
                                                                          (INST
                                                                           -1
                                                                           "G!1"
                                                                           "s!1"
                                                                           "t!1"
                                                                           "seq(p!1)(j!1 - 1)")
                                                                          (("1"
                                                                            (ASSERT)
                                                                            (("1"
                                                                              (FLATTEN)
                                                                              (("1"
                                                                                (ASSERT)
                                                                                (("1"
                                                                                  (SPLIT
                                                                                   -4)
                                                                                  (("1"
                                                                                    (SKOSIMP*)
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "del_vert"
                                                                                       -1)
                                                                                      (("1"
                                                                                        (EXPAND
                                                                                         "remove")
                                                                                        (("1"
                                                                                          (FLATTEN)
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "member")
                                                                                            (("1"
                                                                                              (LEMMA
                                                                                               "separates_del")
                                                                                              (("1"
                                                                                                (INST?)
                                                                                                (("1"
                                                                                                  (ASSERT)
                                                                                                  (("1"
                                                                                                    (LEMMA
                                                                                                     "prelude")
                                                                                                    (("1"
                                                                                                      (INST?)
                                                                                                      (("1"
                                                                                                        (ASSERT)
                                                                                                        (("1"
                                                                                                          (EXPAND
                                                                                                           "in?")
                                                                                                          (("1"
                                                                                                            (EXPAND
                                                                                                             "disjoint?")
                                                                                                            (("1"
                                                                                                              (EXPAND
                                                                                                               "edge?")
                                                                                                              (("1"
                                                                                                                (REWRITE
                                                                                                                 "dbl_comm")
                                                                                                                (("1"
                                                                                                                  (ASSERT)
                                                                                                                  NIL)))))))))))))))))))))))))))))))
                                                                                   ("2"
                                                                                    (EXPAND
                                                                                     "del_vert"
                                                                                     1)
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "remove")
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "member")
                                                                                        (("2"
                                                                                          (PROPAX)
                                                                                          NIL)))))))
                                                                                   ("3"
                                                                                    (EXPAND
                                                                                     "edge?")
                                                                                    (("3"
                                                                                      (EXPAND
                                                                                       "del_vert"
                                                                                       -1)
                                                                                      (("3"
                                                                                        (FLATTEN)
                                                                                        (("3"
                                                                                          (PROPAX)
                                                                                          NIL)))))))))))))))))))))))))))))))
                                                           ("2"
                                                            (SKOSIMP*)
                                                            (("2"
                                                              (HIDE -2)
                                                              (("2"
                                                                (EXPAND
                                                                 "induction_step")
                                                                (("2"
                                                                  (INST
                                                                   -
                                                                   "del_vert(G!1,v!1)")
                                                                  (("2"
                                                                    (REWRITE
                                                                     "size_del_vert")
                                                                    (("2"
                                                                      (ASSERT)
                                                                      (("2"
                                                                        (INST
                                                                         -
                                                                         "s!1"
                                                                         "t!1")
                                                                        (("2"
                                                                          (LEMMA
                                                                           "sep_num_del")
                                                                          (("2"
                                                                            (INST?)
                                                                            (("2"
                                                                              (ASSERT)
                                                                              (("2"
                                                                                (LEMMA
                                                                                 "separable?_del")
                                                                                (("2"
                                                                                  (INST?)
                                                                                  (("2"
                                                                                    (ASSERT)
                                                                                    (("2"
                                                                                      (FLATTEN)
                                                                                      (("2"
                                                                                        (ASSERT)
                                                                                        (("2"
                                                                                          (SKOSIMP*)
                                                                                          (("2"
                                                                                            (INST
                                                                                             +
                                                                                             "p1!1"
                                                                                             "p2!1")
                                                                                            (("2"
                                                                                              (ASSERT)
                                                                                              (("2"
                                                                                                (EXPAND
                                                                                                 "path_from?")
                                                                                                (("2"
                                                                                                  (FLATTEN)
                                                                                                  (("2"
                                                                                                    (ASSERT)
                                                                                                    (("2"
                                                                                                      (LEMMA
                                                                                                       "path?_del_vert")
                                                                                                      (("2"
                                                                                                        (INST?)
                                                                                                        (("2"
                                                                                                          (ASSERT)
                                                                                                          (("2"
                                                                                                            (LEMMA
                                                                                                             "path?_del_vert")
                                                                                                            (("2"
                                                                                                              (INST
                                                                                                               -1
                                                                                                               "G!1"
                                                                                                               "v!1"
                                                                                                               "p2!1")
                                                                                                              (("2"
                                                                                                                (ASSERT)
                                                                                                                NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
                                 ("3" (REWRITE "finite_dbl") NIL)
                                 ("4" (ASSERT) NIL)))))
                             ("2" (HIDE 4)
                              (("2" (EXPAND "path_from?")
                                (("2" (FLATTEN)
                                  (("2" (EXPAND "from?")
                                    (("2" (HIDE 2 3)
                                      (("2"
                                        (EXPAND "path?")
                                        (("2"
                                          (EXPAND "walk?")
                                          (("2"
                                            (EXPAND "verts_in?")
                                            (("2"
                                              (FLATTEN)
                                              (("2"
                                                (INST-CP -4 "j!1")
                                                (("1"
                                                  (INST -4 "j!1-1")
                                                  (("1"
                                                    (INST-CP -6 "j!1-1")
                                                    (("1"
                                                      (INST -6 "j!1")
                                                      (("1"
                                                        (ASSERT)
                                                        (("1"
                                                          (EXPAND "disjoint?")
                                                          (("1"
                                                            (EXPAND "fseq")
                                                            (("1"
                                                              (INST-CP
                                                               -
                                                               "j!1-1"
                                                               "j!1")
                                                              (("1"
                                                                (INST-CP
                                                                 -
                                                                 "j!1-1"
                                                                 "0")
                                                                (("1"
                                                                  (INST-CP
                                                                   -
                                                                   "j!1-1"
                                                                   "l(p!1)-1")
                                                                  (("1"
                                                                    (INST-CP
                                                                     -
                                                                     "j!1"
                                                                     "0")
                                                                    (("1"
                                                                      (INST
                                                                       -
                                                                       "j!1"
                                                                       "l(p!1)-1")
                                                                      (("1"
                                                                        (ASSERT)
                                                                        (("1"
                                                                          (EXPAND
                                                                           "separable?")
                                                                          (("1"
                                                                            (ASSERT)
                                                                            NIL)))))))))))))))))))))))
                                                     ("2" (ASSERT) NIL)))
                                                   ("2" (ASSERT) NIL)))
                                                 ("2"
                                                  (ASSERT)
                                                  NIL)))))))))))))))))))))
                             ("3" (ASSERT) NIL) ("4" (ASSERT) NIL)
                             ("5" (ASSERT) NIL) ("6" (ASSERT) NIL)))))
                         ("2" (LEMMA "seq_j")
                          (("2" (GROUND)
                            (("2" (INST?)
                              (("2" (ASSERT)
                                (("2" (EXPAND "path_from?")
                                  (("2" (EXPAND "from?")
                                    (("2" (FLATTEN)
                                      (("2"
                                        (ASSERT)
                                        (("2"
                                          (INST -1 "p!1" "t!1")
                                          (("2"
                                            (ASSERT)
                                            (("2"
                                              (EXPAND "separable?")
                                              (("2"
                                                (FLATTEN)
                                                (("2"
                                                  (ASSERT)
                                                  (("2"
                                                    (SPLIT -1)
                                                    (("1"
                                                      (SKOSIMP*)
                                                      (("1"
                                                        (INST 2 "j!1")
                                                        (("1"
                                                          (ASSERT)
                                                          (("1"
                                                            (CASE "j!1 = 1")
                                                            (("1"
                                                              (REPLACE -1)
                                                              (("1"
                                                                (HIDE -1)
                                                                (("1"
                                                                  (ASSERT)
                                                                  (("1"
                                                                    (LEMMA
                                                                     "short_path_case")
                                                                    (("1"
                                                                      (INST
                                                                       -1
                                                                       "G!1"
                                                                       "s!1"
                                                                       "t!1"
                                                                       "seq(p!1)(1)")
                                                                      (("1"
                                                                        (ASSERT)
                                                                        (("1"
                                                                          (EXPAND
                                                                           "path?"
                                                                           -5)
                                                                          (("1"
                                                                            (FLATTEN)
                                                                            (("1"
                                                                              (EXPAND
                                                                               "walk?")
                                                                              (("1"
                                                                                (FLATTEN)
                                                                                (("1"
                                                                                  (EXPAND
                                                                                   "verts_in?")
                                                                                  (("1"
                                                                                    (INST
                                                                                     -
                                                                                     "1")
                                                                                    (("1"
                                                                                      (ASSERT)
                                                                                      (("1"
                                                                                        (INST
                                                                                         -
                                                                                         "0")
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "fseq")
                                                                                          (("1"
                                                                                            (ASSERT)
                                                                                            NIL)))))))))))))))))))))))))))))))
                                                             ("2"
                                                              (ASSERT)
                                                              (("2"
                                                                (CASE
                                                                 "j!1 = l(p!1) - 1")
                                                                (("1"
                                                                  (REPLACE -1)
                                                                  (("1"
                                                                    (HIDE -1)
                                                                    (("1"
                                                                      (ASSERT)
                                                                      (("1"
                                                                        (EXPAND
                                                                         "path?"
                                                                         -4)
                                                                        (("1"
                                                                          (FLATTEN)
                                                                          (("1"
                                                                            (EXPAND
                                                                             "walk?")
                                                                            (("1"
                                                                              (FLATTEN)
                                                                              (("1"
                                                                                (INST
                                                                                 -
                                                                                 "l(p!1)-2")
                                                                                (("1"
                                                                                  (EXPAND
                                                                                   "fseq")
                                                                                  (("1"
                                                                                    (PROPAX)
                                                                                    NIL)))))))))))))))))))
                                                                 ("2"
                                                                  (ASSERT)
                                                                  NIL)))))))))))))
                                                     ("2"
                                                      (EXPAND "path?" -1)
                                                      (("2"
                                                        (FLATTEN)
                                                        (("2"
                                                          (EXPAND "walk?")
                                                          (("2"
                                                            (FLATTEN)
                                                            (("2"
                                                              (INST
                                                               -
                                                               "l(p!1)-2")
                                                              (("2"
                                                                (ASSERT)
                                                                (("2"
                                                                  (EXPAND
                                                                   "fseq")
                                                                  (("2"
                                                                    (ASSERT)
                                                                    NIL)))))))))))))))))))))))))))))))))))))))))))
                         ("3" (SKOSIMP*) (("3" (ASSERT) NIL)))
                         ("4" (SKOSIMP*)
                          (("4" (ASSERT) NIL)))))))))))))))))))))))))))
 (|h_menger| "" (INDUCT "G" 1 "graph_induction_vert")
  (("" (SKOSIMP*)
    (("" (LEMMA "finale")
      (("" (INST?)
        (("" (ASSERT)
          (("" (SPLIT -1)
            (("1" (PROPAX) NIL)
             ("2" (HIDE 2)
              (("2" (EXPAND "induction_step")
                (("2" (PROPAX) NIL)))))))))))))))))
 (|hard_menger| "" (SKOSIMP*)
  (("" (LEMMA "h_menger")
    (("" (INST?)
      (("" (ASSERT)
        (("" (SKOSIMP*)
          (("" (INST + "add(p1!1,singleton[Path_from(G!1,s!1,t!1)](p2!1))")
            (("1" (REWRITE "card_add[Path_from(G!1, s!1, t!1)]")
              (("1" (REWRITE "card_singleton[Path_from(G!1, s!1, t!1)]")
                (("1" (ASSERT)
                  (("1" (SPLIT +)
                    (("1" (LIFT-IF)
                      (("1" (GROUND)
                        (("1" (EXPAND "singleton")
                          (("1" (REPLACE -1)
                            (("1" (HIDE -1)
                              (("1" (CASE "l(p2!1) = 2")
                                (("1" (EXPAND "path_from?")
                                  (("1" (FLATTEN)
                                    (("1" (HIDE -4 -5)
                                      (("1"
                                        (EXPAND "path?")
                                        (("1"
                                          (EXPAND "walk?")
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (HIDE -2 -4)
                                              (("1"
                                                (INST - "0")
                                                (("1"
                                                  (ASSERT)
                                                  (("1"
                                                    (EXPAND "fseq")
                                                    (("1"
                                                      (EXPAND "separable?")
                                                      (("1"
                                                        (FLATTEN)
                                                        (("1"
                                                          (EXPAND "from?")
                                                          (("1"
                                                            (FLATTEN)
                                                            (("1"
                                                              (ASSERT)
                                                              NIL)))))))))))))))))))))))))))))
                                 ("2" (EXPAND "independent?")
                                  (("2" (EXPAND "path_from?")
                                    (("2" (FLATTEN)
                                      (("2"
                                        (INST -5 "1" "1")
                                        (("2"
                                          (ASSERT)
                                          (("2"
                                            (CASE "l(p2!1) = 1")
                                            (("1"
                                              (EXPAND "from?")
                                              (("1"
                                                (FLATTEN)
                                                (("1"
                                                  (ASSERT)
                                                  (("1"
                                                    (EXPAND "separable?")
                                                    (("1"
                                                      (PROPAX)
                                                      NIL)))))))))
                                             ("2"
                                              (ASSERT)
                                              NIL)))))))))))))))))))))))))
                     ("2" (EXPAND "ind_path_set?")
                      (("2" (SKOSIMP*)
                        (("2" (EXPAND "add")
                          (("2" (EXPAND "member")
                            (("2" (EXPAND "singleton")
                              (("2" (LEMMA "independent?_comm")
                                (("2" (INST -1 "p1!1" "p2!1")
                                  (("2" (ASSERT)
                                    (("2" (GROUND) NIL)))))))))))))))))))))))
               ("2" (HIDE 2)
                (("2" (REWRITE "finite_singleton[Path_from(G!1, s!1, t!1)]")
                  NIL)))))
             ("2" (REWRITE "finite_add[Path_from(G!1, s!1, t!1)]")
              (("2" (REWRITE "finite_singleton[Path_from(G!1, s!1, t!1)]")
                NIL))))))))))))))))
$$$ind_paths.pvs
ind_paths[T: TYPE]: THEORY
BEGIN
   IMPORTING paths[T]
   G: VAR graph[T]
   u,v,s,t: VAR T
   e: VAR doubleton[T]
   V: VAR finite_set[T]
   n: VAR nat
   independent?(w1,w2: prewalk): bool =
                       (FORALL (i,j: nat): i > 0 AND i < l(w1) - 1 AND
                                           j > 0 AND j < l(w2) - 1 IMPLIES
                                    seq(w1)(i) /= seq(w2)(j))
   p1,p2: VAR prewalk
   independent?_comm: LEMMA independent?(p1,p2) IMPLIES
                                    independent?(p2,p1)
   independent_ne: LEMMA l(p1) > 2 AND independent?(p1,p2) IMPLIES p1 /= p2
   ps: VAR prewalk
   IMPORTING finite_sets
   set_of_paths(G,s,t): TYPE = finite_set[Path_from(G,s,t)]
   ind_path_set?(G,s,t,(pset: set_of_paths(G,s,t))): bool =
                   (FORALL (p1,p2: Path_from(G,s,t)):
                             pset(p1) AND pset(p2) AND  p1 /= p2
                                         IMPLIES independent?(p1,p2))
   ind_path_set_2: LEMMA FORALL (ips: set_of_paths(G,s,t)):
                                    card(ips) = 2 AND
                                    ind_path_set?(G, s, t, ips)
                              IMPLIES
                         (EXISTS (P_1,P_2: prewalk): path_from?(G, P_1, s, t) AND
                                                    path_from?(G, P_2, s, t) AND
                                                      independent?(P_1,P_2) )
   internal_verts(w: prewalk): finite_set[T] =
               {t: T | (EXISTS (i: nat): i > 0 AND i < l(w) - 1 AND w(i) = t)}
   indep?(w1,w2: prewalk): bool = empty?(intersection(internal_verts(w1),
                                                      internal_verts(w2)))
   w1,w2: VAR prewalk
   indep?_lem: LEMMA indep?(w1,w2) IFF independent?(w1,w2)
END ind_paths
$$$ind_paths.prf
(|ind_paths| (|independent?_TCC1| "" (SUBTYPE-TCC) NIL)
 (|independent?_TCC2| "" (SUBTYPE-TCC) NIL)
 (|independent?_comm| "" (SKOSIMP*)
  (("" (EXPAND "independent?")
    (("" (SKOSIMP*) (("" (INST -1 "j!1" "i!1") (("" (ASSERT) NIL)))))))))
 (|independent_ne| "" (SKOSIMP*)
  (("" (EXPAND "independent?")
    (("" (REPLACE -3)
      (("" (HIDE -3) (("" (INST - "1" "1") (("" (ASSERT) NIL)))))))))))
 (|ind_path_set_2| "" (SKOSIMP*)
  (("" (LEMMA "card_2_has_2[Path_from(G!1,s!1,t!1)]")
    (("" (INST?)
      (("" (ASSERT)
        (("" (SKOSIMP*)
          (("" (INST 2 "x!1" "y!1")
            (("" (EXPAND "ind_path_set?")
              (("" (INST?)
                (("" (ASSERT)
                  (("" (EXPAND "path_from?")
                    (("" (PROPAX) NIL)))))))))))))))))))))
 (|internal_verts_TCC1| "" (SUBTYPE-TCC) NIL)
 (|internal_verts_TCC2| "" (SKOSIMP*)
  (("" (LEMMA "finite_subset[T]")
    (("" (INST?)
      (("1" (ASSERT)
        (("1" (INST - "verts_of(w!1)")
          (("1" (ASSERT) (("1" (HIDE 2) (("1" (GRIND) NIL)))))))))
       ("2" (HIDE 2) (("2" (SKOSIMP*) (("2" (ASSERT) NIL)))))))))))
 (|indep?_lem| "" (SKOSIMP*)
  (("" (EXPAND "indep?")
    (("" (EXPAND "independent?")
      (("" (PROP)
        (("1" (SKOSIMP*)
          (("1" (EXPAND "empty?")
            (("1" (EXPAND "member")
              (("1" (EXPAND "intersection")
                (("1" (EXPAND "internal_verts")
                  (("1" (EXPAND "member")
                    (("1" (EXPAND "fseq")
                      (("1" (INST - "seq(w1!1)(i!1)")
                        (("1" (PROP)
                          (("1" (INST?) (("1" (ASSERT) NIL)))
                           ("2" (INST + "j!1") (("2" (ASSERT) NIL)))))
                         ("2" (ASSERT) NIL)))))))))))))))))
         ("2" (EXPAND "empty?")
          (("2" (EXPAND "intersection")
            (("2" (EXPAND "internal_verts")
              (("2" (EXPAND "member")
                (("2" (EXPAND "fseq")
                  (("2" (SKOSIMP*)
                    (("2" (INST - "i!1" "i!2")
                      (("2" (ASSERT) NIL))))))))))))))))))))))))
$$$menger.pvs
menger[T: TYPE]: THEORY
BEGIN
   IMPORTING sep_sets[T], ind_paths[T]
   G: VAR graph[T]
   v,s,t: VAR T
   e: VAR doubleton[T]
   V: VAR finite_set[T]
   m: VAR nat
   easy_menger: LEMMA FORALL (ips:  set_of_paths(G,s,t)):
                         separable?(G,s,t) AND
                         ind_path_set?(G,s,t,ips) IMPLIES
                         card(ips) <= sep_num(G,s,t)
   IMPORTING h_menger[T] % FOR PROOF ONLY
   hard_menger: LEMMA  separable?(G,s,t) AND sep_num(G,s,t) = 2 AND
                       vert(G)(s) AND vert(G)(t)
                   IMPLIES
                        (EXISTS (ips: set_of_paths(G,s,t)):
                                 card(ips) = 2 AND ind_path_set?(G,s,t,ips))
% --------------------------- PLAY STUFF ------------------------------ %
   easy_meng_1: LEMMA FORALL (ips:  set_of_paths(G,s,t)):
                         separable?(G,s,t) AND
                         ind_path_set?(G,s,t,ips) IMPLIES
                         card(ips) <= sep_num(G,s,t)
END menger
$$$menger.prf
(|menger|
 (|easy_menger| "" (SKOSIMP*)
  (("" (EXPAND "sep_num")
    (("" (LEMMA "injection_and_cardinal[Path_from(G!1,s!1,t!1),T]")
      (("" (INST?)
        (("" (ASSERT)
          (("" (HIDE 2)
            ((""
              (CASE "FORALL (p: (ips!1)):
         nonempty?(intersection(min_sep_set(G!1, s!1, t!1),internal_verts(p)))")
              (("1" (EXPAND "intersection")
                (("1" (EXPAND "member")
                  (("1"
                    (INST 1
                     "(LAMBDA (p: (ips!1)): choose({x: T | min_sep_set[T](G!1, s!1, t!1)(x) AND internal_verts(p)(x)}))")
                    (("1" (EXPAND "injective?")
                      (("1" (SKOSIMP*)
                        (("1" (TYPEPRED "x1!1")
                          (("1" (TYPEPRED "x2!1")
                            (("1" (EXPAND "path_from?")
                              (("1" (FLATTEN)
                                (("1" (EXPAND "ind_path_set?")
                                  (("1" (INST -12 "x1!1" "x2!1")
                                    (("1" (ASSERT)
                                      (("1" (EXPAND "independent?")
                                        (("1"
                                          (HIDE -1 -2 -3 -4 -5 -6 -7 -8)
                                          (("1"
                                            (TYPEPRED
                                             "choose({x: T |
             min_sep_set[T](G!1, s!1, t!1)(x) AND internal_verts(x1!1)(x)})")
                                            (("1"
                                              (EXPAND "internal_verts")
                                              (("1"
                                                (SKOSIMP*)
                                                (("1"
                                                  (HIDE -1)
                                                  (("1"
                                                    (REPLACE -3 * RL)
                                                    (("1"
                                                      (HIDE -3)
                                                      (("1"
                                                        (TYPEPRED
                                                         "choose({x: T |
             min_sep_set[T](G!1, s!1, t!1)(x) AND internal_verts(x2!1)(x)})")
                                                        (("1"
                                                          (HIDE -1)
                                                          (("1"
                                                            (EXPAND
                                                             "internal_verts")
                                                            (("1"
                                                              (SKOSIMP*)
                                                              (("1"
                                                                (REPLACE
                                                                 -3
                                                                 *
                                                                 RL)
                                                                (("1"
                                                                  (HIDE -3)
                                                                  (("1"
                                                                    (EXPAND
                                                                     "fseq")
                                                                    (("1"
                                                                      (INST
                                                                       -8
                                                                       "i!1"
                                                                       "i!2")
                                                                      (("1"
                                                                        (ASSERT)
                                                                        NIL)))))))))))))))
                                                         ("2"
                                                          (EXPAND "nonempty?")
                                                          (("2"
                                                            (EXPAND "empty?")
                                                            (("2"
                                                              (EXPAND "member")
                                                              (("2"
                                                                (INST -4 "x2!1")
                                                                (("2"
                                                                  (SKOSIMP*)
                                                                  (("2"
                                                                    (INST?)
                                                                    (("2"
                                                                      (ASSERT)
                                                                      (("2"
                                                                        (EXPAND
                                                                         "internal_verts")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "fseq")
                                                                          (("2"
                                                                            (INST
                                                                             +
                                                                             "i!2")
                                                                            (("2"
                                                                              (ASSERT)
                                                                              NIL)))))))))))))))))))))))))))))))))
                                             ("2"
                                              (INST -1 "x1!1")
                                              NIL)))))))))))))))))))))))))
                     ("2" (SKOSIMP*) (("2" (ASSERT) NIL)))))))))
               ("2" (SKOSIMP*)
                (("2" (EXPAND "nonempty?")
                  (("2" (LEMMA "min_sep_set_seps")
                    (("2" (INST?)
                      (("2" (ASSERT)
                        (("2" (HIDE -4 1)
                          (("2" (EXPAND "separates")
                            (("2" (FLATTEN)
                              (("2" (INST 3 "p!1")
                                (("2" (HIDE -2 1 2)
                                  (("2" (TYPEPRED "p!1")
                                    (("2" (EXPAND "path_from?")
                                      (("2" (FLATTEN)
                                        (("2"
                                          (EXPAND "walk_from?")
                                          (("2"
                                            (EXPAND "from?")
                                            (("2"
                                              (FLATTEN)
                                              (("2"
                                                (ASSERT)
                                                (("2"
                                                  (LEMMA "walk?_del_verts_not")
                                                  (("2"
                                                    (INST?)
                                                    (("2"
                                                      (EXPAND "path?")
                                                      (("2"
                                                        (FLATTEN)
                                                        (("2"
                                                          (ASSERT)
                                                          (("2"
                                                            (HIDE
                                                             -1
                                                             -2
                                                             -3
                                                             -4
                                                             -5
                                                             -6
                                                             2)
                                                            (("2"
                                                              (REVEAL 2 3)
                                                              (("2"
                                                                (NAME-REPLACE
                                                                 "MSS"
                                                                 "min_sep_set(G!1, s!1, t!1)")
                                                                (("2"
                                                                  (EXPAND
                                                                   "intersection")
                                                                  (("2"
                                                                    (EXPAND
                                                                     "empty?")
                                                                    (("2"
                                                                      (EXPAND
                                                                       "member")
                                                                      (("2"
                                                                        (EXPAND
                                                                         "verts_of")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "internal_verts")
                                                                          (("2"
                                                                            (EXPAND
                                                                             "fseq")
                                                                            (("2"
                                                                              (SKOSIMP*)
                                                                              (("2"
                                                                                (INST
                                                                                 -3
                                                                                 "x!1")
                                                                                (("2"
                                                                                  (ASSERT)
                                                                                  (("2"
                                                                                    (INST?)
                                                                                    (("2"
                                                                                      (ASSERT)
                                                                                      NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 (|hard_menger| "" (SKOSIMP*)
  (("" (LEMMA "h_menger")
    (("" (INST?)
      (("" (ASSERT)
        (("" (SKOSIMP*)
          (("" (INST + "add(p1!1,singleton[Path_from(G!1,s!1,t!1)](p2!1))")
            (("1" (REWRITE "card_add[Path_from(G!1, s!1, t!1)]")
              (("1" (REWRITE "card_singleton[Path_from(G!1, s!1, t!1)]")
                (("1" (ASSERT)
                  (("1" (SPLIT +)
                    (("1" (LIFT-IF)
                      (("1" (GROUND)
                        (("1" (EXPAND "singleton")
                          (("1" (REPLACE -1)
                            (("1" (HIDE -1)
                              (("1" (CASE "l(p2!1) = 2")
                                (("1" (EXPAND "path_from?")
                                  (("1" (FLATTEN)
                                    (("1" (HIDE -4 -5)
                                      (("1" (EXPAND "path?")
                                        (("1"
                                          (EXPAND "walk?")
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (HIDE -2 -4)
                                              (("1"
                                                (INST - "0")
                                                (("1"
                                                  (ASSERT)
                                                  (("1"
                                                    (EXPAND "fseq")
                                                    (("1"
                                                      (EXPAND "separable?")
                                                      (("1"
                                                        (FLATTEN)
                                                        (("1"
                                                          (EXPAND "from?")
                                                          (("1"
                                                            (FLATTEN)
                                                            (("1"
                                                              (ASSERT)
                                                              NIL)))))))))))))))))))))))))))))
                                 ("2" (EXPAND "independent?")
                                  (("2" (EXPAND "path_from?")
                                    (("2" (FLATTEN)
                                      (("2" (INST -5 "1" "1")
                                        (("2"
                                          (ASSERT)
                                          (("2"
                                            (CASE "l(p2!1) = 1")
                                            (("1"
                                              (EXPAND "from?")
                                              (("1"
                                                (FLATTEN)
                                                (("1"
                                                  (ASSERT)
                                                  (("1"
                                                    (EXPAND "separable?")
                                                    (("1" (PROPAX) NIL)))))))))
                                             ("2"
                                              (ASSERT)
                                              NIL)))))))))))))))))))))))))
                     ("2" (EXPAND "ind_path_set?")
                      (("2" (SKOSIMP*)
                        (("2" (EXPAND "add")
                          (("2" (EXPAND "member")
                            (("2" (EXPAND "singleton")
                              (("2" (LEMMA "independent?_comm")
                                (("2" (INST -1 "p1!1" "p2!1")
                                  (("2" (ASSERT)
                                    (("2" (GROUND) NIL)))))))))))))))))))))))
               ("2" (HIDE 2)
                (("2" (REWRITE "finite_singleton[Path_from(G!1, s!1, t!1)]")
                  NIL)))))
             ("2" (REWRITE "finite_add[Path_from(G!1, s!1, t!1)]")
              (("2" (REWRITE "finite_singleton[Path_from(G!1, s!1, t!1)]")
                NIL)))))))))))))))
 (|walk?_del_verts_not| "" (SKOSIMP*)
  (("" (EXPAND "walk?")
    (("" (SPLIT +)
      (("1" (FLATTEN)
        (("1" (HIDE -2)
          (("1" (EXPAND "verts_in?")
            (("1" (SKOSIMP*)
              (("1" (EXPAND "del_verts")
                (("1" (EXPAND "intersection")
                  (("1" (EXPAND "empty?")
                    (("1" (EXPAND "difference")
                      (("1" (EXPAND "member")
                        (("1" (INST?)
                          (("1" (ASSERT)
                            (("1" (INST?)
                              (("1" (ASSERT)
                                (("1" (EXPAND "verts_of")
                                  (("1" (INST?)
                                    (("1" (EXPAND "fseq")
                                      (("1" (PROPAX)
                                        NIL)))))))))))))))))))))))))))))))))
       ("2" (SKOSIMP*)
        (("2" (EXPAND "edge?")
          (("2" (INST?)
            (("2" (ASSERT)
              (("2" (FLATTEN)
                (("2" (ASSERT)
                  (("2" (EXPAND "del_verts")
                    (("2" (EXPAND "empty?")
                      (("2" (EXPAND "intersection")
                        (("2" (EXPAND "member")
                          (("2" (SKOSIMP*)
                            (("2" (INST?)
                              (("2" (EXPAND "verts_of")
                                (("2" (ASSERT)
                                  (("2" (EXPAND "dbl")
                                    (("2" (SPLIT -3)
                                      (("1" (INST?) (("1" (ASSERT) NIL)))
                                       ("2" (INST?)
                                        (("2"
                                          (ASSERT)
                                          NIL)))))))))))))))))))))))))))))))))))))))))
 (|easy_meng_1| "" (SKOSIMP*)
  (("" (EXPAND "sep_num")
    (("" (LEMMA "injection_and_cardinal[Path_from(G!1,s!1,t!1),T]")
      (("" (INST?)
        (("" (ASSERT)
          (("" (HIDE 2)
            ((""
              (CASE "FORALL (p: (ips!1)):
         nonempty?(intersection(min_sep_set(G!1, s!1, t!1),internal_verts(p)))")
              (("1" (EXPAND "intersection")
                (("1" (EXPAND "member")
                  (("1"
                    (INST 1
                     "(LAMBDA (p: (ips!1)): choose({x: T | min_sep_set[T](G!1, s!1, t!1)(x) AND internal_verts(p)(x)}))")
                    (("1" (EXPAND "injective?")
                      (("1" (SKOSIMP*)
                        (("1" (TYPEPRED "x1!1")
                          (("1" (TYPEPRED "x2!1")
                            (("1" (EXPAND "path_from?")
                              (("1" (FLATTEN)
                                (("1" (EXPAND "ind_path_set?")
                                  (("1" (INST -12 "x1!1" "x2!1")
                                    (("1" (ASSERT)
                                      (("1" (EXPAND "independent?")
                                        (("1"
                                          (HIDE -1 -2 -3 -4 -5 -6 -7 -8)
                                          (("1"
                                            (TYPEPRED
                                             "choose({x: T |
             min_sep_set[T](G!1, s!1, t!1)(x) AND internal_verts(x1!1)(x)})")
                                            (("1"
                                              (EXPAND "internal_verts")
                                              (("1"
                                                (SKOSIMP*)
                                                (("1"
                                                  (HIDE -1)
                                                  (("1"
                                                    (REPLACE -3 * RL)
                                                    (("1"
                                                      (HIDE -3)
                                                      (("1"
                                                        (TYPEPRED
                                                         "choose({x: T |
             min_sep_set[T](G!1, s!1, t!1)(x) AND internal_verts(x2!1)(x)})")
                                                        (("1"
                                                          (HIDE -1)
                                                          (("1"
                                                            (EXPAND
                                                             "internal_verts")
                                                            (("1"
                                                              (SKOSIMP*)
                                                              (("1"
                                                                (REPLACE
                                                                 -3
                                                                 *
                                                                 RL)
                                                                (("1"
                                                                  (HIDE -3)
                                                                  (("1"
                                                                    (EXPAND
                                                                     "fseq")
                                                                    (("1"
                                                                      (INST
                                                                       -8
                                                                       "i!1"
                                                                       "i!2")
                                                                      (("1"
                                                                        (ASSERT)
                                                                        NIL)))))))))))))))
                                                         ("2"
                                                          (EXPAND "nonempty?")
                                                          (("2"
                                                            (EXPAND "empty?")
                                                            (("2"
                                                              (EXPAND "member")
                                                              (("2"
                                                                (INST -4 "x2!1")
                                                                (("2"
                                                                  (SKOSIMP*)
                                                                  (("2"
                                                                    (INST?)
                                                                    (("2"
                                                                      (ASSERT)
                                                                      (("2"
                                                                        (EXPAND
                                                                         "internal_verts")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "fseq")
                                                                          (("2"
                                                                            (INST
                                                                             +
                                                                             "i!2")
                                                                            (("2"
                                                                              (ASSERT)
                                                                              NIL)))))))))))))))))))))))))))))))))
                                             ("2"
                                              (INST -1 "x1!1")
                                              NIL)))))))))))))))))))))))))
                     ("2" (SKOSIMP*) (("2" (ASSERT) NIL)))))))))
               ("2" (SKOSIMP*)
                (("2" (EXPAND "nonempty?")
                  (("2" (LEMMA "min_sep_set_seps")
                    (("2" (INST?)
                      (("2" (ASSERT)
                        (("2" (HIDE -4 1)
                          (("2" (EXPAND "separates")
                            (("2" (FLATTEN)
                              (("2" (INST 3 "p!1")
                                (("2" (HIDE -2 1 2)
                                  (("2" (TYPEPRED "p!1")
                                    (("2" (EXPAND "path_from?")
                                      (("2" (FLATTEN)
                                        (("2"
                                          (EXPAND "walk_from?")
                                          (("2"
                                            (EXPAND "from?")
                                            (("2"
                                              (FLATTEN)
                                              (("2"
                                                (ASSERT)
                                                (("2"
                                                  (LEMMA "walk?_del_verts_not")
                                                  (("2"
                                                    (INST?)
                                                    (("2"
                                                      (EXPAND "path?")
                                                      (("2"
                                                        (FLATTEN)
                                                        (("2"
                                                          (ASSERT)
                                                          (("2"
                                                            (HIDE
                                                             -1
                                                             -2
                                                             -3
                                                             -4
                                                             -5
                                                             -6
                                                             2)
                                                            (("2"
                                                              (REVEAL 2 3)
                                                              (("2"
                                                                (NAME-REPLACE
                                                                 "MSS"
                                                                 "min_sep_set(G!1, s!1, t!1)")
                                                                (("2"
                                                                  (EXPAND
                                                                   "intersection")
                                                                  (("2"
                                                                    (EXPAND
                                                                     "empty?")
                                                                    (("2"
                                                                      (EXPAND
                                                                       "member")
                                                                      (("2"
                                                                        (EXPAND
                                                                         "verts_of")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "internal_verts")
                                                                          (("2"
                                                                            (EXPAND
                                                                             "fseq")
                                                                            (("2"
                                                                              (SKOSIMP*)
                                                                              (("2"
                                                                                (INST
                                                                                 -3
                                                                                 "x!1")
                                                                                (("2"
                                                                                  (ASSERT)
                                                                                  (("2"
                                                                                    (INST?)
                                                                                    (("2"
                                                                                      (ASSERT)
                                                                                      NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 (|easy_meng_old_proof| "" (SKOSIMP*)
  (("" (LEMMA "h_menger")
    (("" (INST?)
      (("" (ASSERT)
        (("" (SKOSIMP*)
          (("" (INST + "add(p1!1,singleton[Path_from(G!1,s!1,t!1)](p2!1))")
            (("1" (REWRITE "card_add[Path_from(G!1, s!1, t!1)]")
              (("1" (REWRITE "card_singleton[Path_from(G!1, s!1, t!1)]")
                (("1" (ASSERT)
                  (("1" (SPLIT +)
                    (("1" (LIFT-IF)
                      (("1" (GROUND)
                        (("1" (EXPAND "singleton")
                          (("1" (REPLACE -1)
                            (("1" (HIDE -1)
                              (("1" (CASE "l(p2!1) = 2")
                                (("1" (EXPAND "path_from?")
                                  (("1" (FLATTEN)
                                    (("1" (HIDE -4 -5)
                                      (("1" (EXPAND "path?")
                                        (("1"
                                          (EXPAND "walk?")
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (HIDE -2 -4)
                                              (("1"
                                                (INST - "0")
                                                (("1"
                                                  (ASSERT)
                                                  (("1"
                                                    (EXPAND "fseq")
                                                    (("1"
                                                      (EXPAND "separable?")
                                                      (("1"
                                                        (FLATTEN)
                                                        (("1"
                                                          (EXPAND "from?")
                                                          (("1"
                                                            (FLATTEN)
                                                            (("1"
                                                              (ASSERT)
                                                              NIL)))))))))))))))))))))))))))))
                                 ("2" (EXPAND "independent?")
                                  (("2" (EXPAND "path_from?")
                                    (("2" (FLATTEN)
                                      (("2" (INST -5 "1" "1")
                                        (("2"
                                          (ASSERT)
                                          (("2"
                                            (CASE "l(p2!1) = 1")
                                            (("1"
                                              (EXPAND "from?")
                                              (("1"
                                                (FLATTEN)
                                                (("1"
                                                  (ASSERT)
                                                  (("1"
                                                    (EXPAND "separable?")
                                                    (("1" (PROPAX) NIL)))))))))
                                             ("2"
                                              (ASSERT)
                                              NIL)))))))))))))))))))))))))
                     ("2" (EXPAND "ind_path_set?")
                      (("2" (SKOSIMP*)
                        (("2" (EXPAND "add")
                          (("2" (EXPAND "member")
                            (("2" (EXPAND "singleton")
                              (("2" (LEMMA "independent?_comm")
                                (("2" (INST -1 "p1!1" "p2!1")
                                  (("2" (ASSERT)
                                    (("2" (GROUND) NIL)))))))))))))))))))))))
               ("2" (HIDE 2)
                (("2" (REWRITE "finite_singleton[Path_from(G!1, s!1, t!1)]")
                  NIL)))))
             ("2" (REWRITE "finite_add[Path_from(G!1, s!1, t!1)]")
              (("2" (REWRITE "finite_singleton[Path_from(G!1, s!1, t!1)]")
                NIL))))))))))))))))
$$$reduce_walks.pvs
reduce_walks[T: TYPE]: THEORY
BEGIN
   IMPORTING paths[T]
   G: VAR graph[T]
   Long_walk(G): TYPE = {w: Walk(G) | l(w) > 3}
   reduce(G: graph[T], w: Long_walk(G),
          k: {n: nat | n > 0 AND n < l(w)-1}): Walk(G) =
                      IF w(k-1) = w(k+1) THEN
                          (# l := l(w) - 2,
                          seq := (LAMBDA (i: below(l(w)-2)):
                                     IF i < k THEN w(i)
                                     ELSE w(i+2)
                                     ENDIF) #)
                      ELSE
                          w
                      ENDIF
   reduce_lem: LEMMA FORALL (w: Walk(G),
                            k: {n: nat | n > 0 AND n < l(w)-1}):
       w(k-1) = w(k+1) AND l(w) > 3 IMPLIES
          reduce(G,w,k) = w^(0,k-1) o w^(k+2,l(w)-1)
END reduce_walks
$$$reduce_walks.prf
(|reduce_walks| (|reduce_TCC1| "" (SUBTYPE-TCC) NIL)
 (|reduce_TCC2| "" (SUBTYPE-TCC) NIL)
 (|reduce_TCC3| "" (SUBTYPE-TCC) NIL)
 (|reduce_TCC4| "" (SUBTYPE-TCC) NIL)
 (|reduce_TCC5| "" (SUBTYPE-TCC) NIL)
 (|reduce_TCC6| "" (SKOSIMP*)
  (("" (EXPAND "fseq") (("" (GRIND) NIL)))))
 (|reduce_TCC7| "" (SKOSIMP*)
  (("" (EXPAND "fseq")
    (("" (TYPEPRED "w!1")
      (("" (EXPAND "walk?")
        (("" (EXPAND "fseq")
          (("" (FLATTEN)
            (("" (SPLIT +)
              (("1" (HIDE -3)
                (("1" (EXPAND "verts_in?")
                  (("1" (SKOSIMP*)
                    (("1" (GROUND)
                      (("1" (INST?) NIL) ("2" (INST?) NIL)))))))))
               ("2" (SKOSIMP*)
                (("2" (LIFT-IF)
                  (("2" (TYPEPRED "k!1")
                    (("2" (LIFT-IF)
                      (("2" (GROUND)
                        (("1" (INST?) (("1" (ASSERT) NIL)))
                         ("2" (CASE-REPLACE "k!1=n!1+1")
                          (("1" (ASSERT)
                            (("1" (REPLACE -10)
                              (("1"
                                (HIDE -10)
                                (("1"
                                  (INST?)
                                  (("1" (ASSERT) NIL)))))))))
                           ("2" (ASSERT) NIL)))
                         ("3" (INST?)
                          (("3" (ASSERT) NIL)))))))))))))))))))))))))))
 (|reduce_lem_TCC1| "" (SUBTYPE-TCC) NIL)
 (|reduce_lem_TCC2| "" (SUBTYPE-TCC) NIL)
 (|reduce_lem_TCC3| "" (SUBTYPE-TCC) NIL)
 (|reduce_lem_TCC4| "" (SUBTYPE-TCC) NIL)
 (|reduce_lem| "" (SKOSIMP*)
  (("" (EXPAND "o ")
    (("" (EXPAND "^")
      (("" (AUTO-REWRITE "fseq")
        (("" (TYPEPRED "k!1")
          (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
            (("1" (EXPAND "reduce")
              (("1" (LIFT-IF) (("1" (LIFT-IF) (("1" (GROUND) NIL)))))))
             ("2" (EXPAND "emptyseq")
              (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
                (("1" (TYPEPRED "x!1")
                  (("1" (LIFT-IF) (("1" (GRIND) NIL)))))
                 ("2" (SKOSIMP*)
                  (("2" (EXPAND "^")
                    (("2" (EXPAND "emptyseq")
                      (("2" (EXPAND "reduce")
                        (("2" (LIFT-IF)
                          (("2" (EXPAND "fseq")
                            (("2" (GROUND) NIL)))))))))))))
                 ("3" (SKOSIMP*)
                  (("3" (TYPEPRED "n!1")
                    (("3" (EXPAND "^")
                      (("3" (LIFT-IF) (("3" (GROUND) NIL)))))))))
                 ("4" (SKOSIMP*)
                  (("4" (ASSERT)
                    (("4" (TYPEPRED "n!1")
                      (("4" (EXPAND "^")
                        (("4" (EXPAND "emptyseq")
                          (("4" (PROPAX) NIL)))))))))))
                 ("5" (SKOSIMP*)
                  (("5" (TYPEPRED "n!1")
                    (("5" (EXPAND "^")
                      (("5" (EXPAND "emptyseq")
                        (("5" (LIFT-IF) (("5" (GROUND) NIL)))))))))))
                 ("6" (SKOSIMP*)
                  (("6" (TYPEPRED "n!1")
                    (("6" (EXPAND "reduce")
                      (("6" (EXPAND "fseq")
                        (("6" (EXPAND "^")
                          (("6" (LIFT-IF)
                            (("6" (GROUND) NIL)))))))))))))))))
             ("3" (SKOSIMP*) (("3" (EXPAND "^") (("3" (PROPAX) NIL)))))
             ("4" (SKOSIMP*)
              (("4" (TYPEPRED "n!1")
                (("4" (EXPAND "^")
                  (("4" (EXPAND "emptyseq")
                    (("4" (LIFT-IF) (("4" (GROUND) NIL)))))))))))
             ("5" (SKOSIMP*)
              (("5" (TYPEPRED "n!1")
                (("5" (EXPAND "^")
                  (("5" (EXPAND "emptyseq")
                    (("5" (LIFT-IF) (("5" (GROUND) NIL)))))))))))
             ("6" (SKOSIMP*)
              (("6" (TYPEPRED "n!1")
                (("6" (EXPAND "^")
                  (("6" (LIFT-IF)
                    (("6" (EXPAND "emptyseq")
                      (("6" (GROUND) NIL)))))))))))
             ("7" (SKOSIMP*)
              (("7" (TYPEPRED "n!1")
                (("7" (EXPAND "^") (("7" (PROPAX) NIL)))))))
             ("8" (LIFT-IF) (("8" (GROUND) NIL))))))))))))))))
$$$min_walks.pvs
min_walks[T: TYPE]: THEORY
BEGIN
   IMPORTING graphs[T]
   IMPORTING walks[T], abstract_min
   v1,v2,x,y: VAR T
   G: VAR graph[T]
   gr_walk(v1,v2): TYPE = {G: graph[T] | vert(G)(v1) AND vert(G)(v2) AND
                                         (EXISTS (w: Seq(G)):
                                           walk_from?(G,w,v1,v2))}
   min_walk_from(x,y,(Gw:gr_walk(x,y))): Walk(Gw) =
                        min[Seq(Gw),(LAMBDA (w: Seq(Gw)): l(w)),
                                (LAMBDA (w: Seq(Gw)): walk_from?(Gw,w,x,y))]
   is_min(G,(w: Seq(G)),x,y): bool = walk?(G,w) AND
                       (FORALL (ww: Seq(G)): walk_from?(G,ww,x,y) IMPLIES
                                                        l(w) <= l(ww))
   min_walk_def: LEMMA FORALL (Gw: gr_walk(x,y)):
                          walk_from?(Gw,min_walk_from(x,y,Gw),x,y) AND
                          is_min(Gw, min_walk_from(x,y,Gw),x,y)
   min_walk_in : LEMMA FORALL (Gw: gr_walk(x,y)):
                          walk_from?(Gw,min_walk_from(x,y,Gw),x,y)
   min_walk_is_min: LEMMA FORALL (Gw: gr_walk(x,y), ww: Seq(Gw)):
                              walk_from?(Gw,ww,x,y) IMPLIES
                                        l(min_walk_from(x,y,Gw)) <= l(ww)
END min_walks
$$$min_walks.prf
(|min_walks|
 (|min_walk_from_TCC1| "" (SKOSIMP*)
  (("" (TYPEPRED "Gw!1") (("" (PROPAX) NIL)))))
 (|min_walk_from_TCC2| "" (SKOSIMP*)
  (("" (TYPEPRED "Gw!1")
    (("" (HIDE -1 -2 -3 -4)
      ((""
        (LEMMA "min_in[Seq(Gw!1), (LAMBDA (w: Seq(Gw!1)): l(w)),
                   (LAMBDA (w: Seq(Gw!1)): walk_from?(Gw!1, w, x!1, y!1))]")
        (("1" (BETA)
          (("1" (EXPAND "walk_from?")
            (("1" (FLATTEN) (("1" (PROPAX) NIL)))))))
         ("2" (HIDE 2) (("2" (TYPEPRED "Gw!1") (("2" (PROPAX) NIL)))))))))))))
 (|min_walk_def_TCC1| "" (SUBTYPE-TCC) NIL)
 (|min_walk_def| "" (SKOSIMP*)
  (("" (TYPEPRED "min_walk_from(x!1, y!1,Gw!1)")
    (("" (PROP)
      (("1"
        (LEMMA "min_in[Seq(Gw!1), (LAMBDA (w: Seq(Gw!1)): l(w)),
                (LAMBDA (w: Seq(Gw!1)):
                   walk_from?(Gw!1, w, x!1, y!1))]")
        (("1" (HIDE -2 -3 -4)
          (("1" (BETA)
            (("1" (EXPAND "min_walk_from") (("1" (PROPAX) NIL)))))))
         ("2" (HIDE -1 -2 -3 2)
          (("2" (TYPEPRED "Gw!1") (("2" (PROPAX) NIL)))))))
       ("2"
        (LEMMA "min_is_min[Seq(Gw!1), (LAMBDA (w: Seq(Gw!1)): l(w)),
                (LAMBDA (w: Seq(Gw!1)):
                   walk_from?(Gw!1, w, x!1, y!1))]")
        (("1" (HIDE -3 -4)
          (("1" (EXPAND "is_min")
            (("1" (ASSERT)
              (("1" (SKOSIMP*)
                (("1" (INST?)
                  (("1" (ASSERT)
                    (("1" (EXPAND "min_walk_from")
                      (("1" (PROPAX) NIL)))))))))))))))
         ("2" (HIDE -1 -2 -3 2)
          (("2" (TYPEPRED "Gw!1") (("2" (PROPAX) NIL)))))))))))))
 (|min_walk_in| "" (SKOSIMP*)
  (("" (LEMMA "min_walk_def")
    (("" (INST?) (("" (FLATTEN) (("" (PROPAX) NIL)))))))))
 (|min_walk_is_min| "" (SKOSIMP*)
  (("" (LEMMA "min_walk_def")
    (("" (INST?)
      (("" (FLATTEN)
        (("" (HIDE -1)
          (("" (EXPAND "is_min")
            (("" (FLATTEN) (("" (INST?) (("" (ASSERT) NIL))))))))))))))))))
$$$min_walk_reduced.pvs
min_walk_reduced[T: TYPE]: THEORY
BEGIN
   IMPORTING min_walks[T], path_ops[T]
   reduced?(G: graph[T], w: Seq(G)): bool =
          (FORALL (k: nat): k > 0 AND k < l(w) - 1 IMPLIES w(k-1) /= w(k+1))
   x,y: VAR T
   i: VAR nat
   min_walk_vert: LEMMA FORALL (Gw: gr_walk(x,y)): i < l(min_walk_from(x,y,Gw))
                               IMPLIES vert(Gw)(min_walk_from(x,y,Gw)(i))
   min_walk_is_reduced: LEMMA FORALL (Gw: gr_walk(x,y)):
                                     reduced?(Gw,min_walk_from(x,y,Gw))
END min_walk_reduced
$$$min_walk_reduced.prf
(|min_walk_reduced| (|reduced?_TCC1| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|reduced?_TCC2| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|min_walk_vert| "" (SKOSIMP*)
  (("" (EXPAND "fseq")
    (("" (LEMMA "min_walk_in")
      (("" (INST?)
        (("" (EXPAND "walk_from?")
          (("" (FLATTEN)
            (("" (EXPAND "walk?")
              (("" (FLATTEN)
                (("" (HIDE -4)
                  (("" (EXPAND "verts_in?")
                    (("" (INST -3 "i!1") NIL)))))))))))))))))))))
 (|min_walk_is_reduced_TCC1| "" (SKOSIMP*)
  (("" (EXPAND "verts_in?")
    (("" (SKOSIMP*)
      (("" (LEMMA "min_walk_vert")
        (("" (INST?) (("" (INST?) (("" (EXPAND "fseq") (("" (PROPAX) NIL)))))))))))))))
 (|min_walk_is_reduced| "" (SKOSIMP*)
  (("" (EXPAND "reduced?")
    (("" (EXPAND "fseq")
      (("" (SKOSIMP*)
        (("" (NAME MIN_W "min_walk_from(x!1,y!1,Gw!1)")
          (("" (REPLACE -1)
            (("" (LEMMA "min_walk_is_min")
              (("" (INST?)
                (("" (LEMMA "min_walk_in")
                  (("" (INST?)
                    (("" (REPLACE -3)
                      (("" (EXPAND "walk_from?")
                        (("" (FLATTEN)
                          (("" (CASE "k!1 = l(MIN_W) - 2")
                            (("1" (REPLACE -1)
                              (("1" (HIDE -1)
                                (("1" (ASSERT)
                                  (("1" (NAME RED_W "MIN_W ^ (0, l(MIN_W) - 3)")
                                    (("1" (INST -5 "RED_W")
                                      (("1" (REPLACE -1 * RL)
                                        (("1" (HIDE -1)
                                          (("1" (EXPAND "^")
                                            (("1" (EXPAND "walk?")
                                              (("1" (FLATTEN)
                                                (("1"
                                                  (EXPAND "verts_in?")
                                                  (("1"
                                                    (SPLIT +)
                                                    (("1"
                                                      (SKOSIMP*)
                                                      (("1" (INST?) NIL)))
                                                     ("2"
                                                      (SKOSIMP*)
                                                      (("2"
                                                        (EXPAND "fseq")
                                                        (("2"
                                                          (HIDE -4)
                                                          (("2"
                                                            (INST -4 "n!1")
                                                            (("2"
                                                              (ASSERT)
                                                              NIL)))))))))))))))))))))))
                                       ("2" (PROP)
                                        (("1" (REPLACE -1 * RL)
                                          (("1" (HIDE -1)
                                            (("1" (EXPAND "^") (("1" (PROPAX) NIL)))))))
                                         ("2" (EXPAND "verts_in?")
                                          (("2" (SKOSIMP*)
                                            (("2" (REPLACE -1 * RL)
                                              (("2" (TYPEPRED "i!1")
                                                (("2"
                                                  (REPLACE -2 * RL)
                                                  (("2"
                                                    (HIDE -2)
                                                    (("2"
                                                      (EXPAND "^")
                                                      (("2"
                                                        (EXPAND "walk?")
                                                        (("2"
                                                          (FLATTEN)
                                                          (("2"
                                                            (HIDE -5)
                                                            (("2"
                                                              (EXPAND "verts_in?")
                                                              (("2"
                                                                (INST - "i!1")
                                                                (("2"
                                                                  (ASSERT)
                                                                  NIL)))))))))))))))))))))))))))))))))))))
                             ("2"
                              (INST -4
                               "MIN_W ^ (0, k!1 - 1) o MIN_W ^ (2 + k!1, l(MIN_W) - 1)")
                              (("1" (SPLIT -4)
                                (("1" (EXPAND "o ")
                                  (("1" (EXPAND "^")
                                    (("1" (EXPAND "emptyseq")
                                      (("1" (LIFT-IF)
                                        (("1" (LIFT-IF) (("1" (GROUND) NIL)))))))))))
                                 ("2" (EXPAND "o ")
                                  (("2" (EXPAND "^")
                                    (("2" (LIFT-IF)
                                      (("2" (EXPAND "emptyseq")
                                        (("2" (LIFT-IF) (("2" (GROUND) NIL)))))))))))
                                 ("3" (EXPAND "o ")
                                  (("3" (EXPAND "^")
                                    (("3" (EXPAND "emptyseq")
                                      (("3" (LIFT-IF)
                                        (("3" (LIFT-IF) (("3" (GROUND) NIL)))))))))))
                                 ("4" (LEMMA "walk?_cut")
                                  (("4" (INST?)
                                    (("1" (INST -1 "Gw!1" "x!1" "y!1")
                                      (("1" (ASSERT)
                                        (("1" (EXPAND "walk_from?")
                                          (("1" (PROPAX) NIL)))))))
                                     ("2" (ASSERT) NIL) ("3" (ASSERT) NIL)))))))
                               ("2" (SPLIT +)
                                (("1" (EXPAND "o ")
                                  (("1" (EXPAND "^")
                                    (("1" (LIFT-IF) (("1" (GROUND) NIL)))))))
                                 ("2" (EXPAND "verts_in?")
                                  (("2" (SKOSIMP*)
                                    (("2" (TYPEPRED "i!1")
                                      (("1" (EXPAND "o ")
                                        (("1" (EXPAND "^")
                                          (("1" (LIFT-IF)
                                            (("1" (EXPAND "walk?")
                                              (("1" (FLATTEN)
                                                (("1"
                                                  (HIDE -5)
                                                  (("1"
                                                    (EXPAND "verts_in?")
                                                    (("1"
                                                      (GROUND)
                                                      (("1" (INST?) NIL)
                                                       ("2" (INST?) NIL)))))))))))))))))
                                       ("2" (SKOSIMP*) (("2" (ASSERT) NIL)))
                                       ("3" (SKOSIMP*) (("3" (ASSERT) NIL)))))))))))
                               ("3" (ASSERT) NIL)
                               ("4" (ASSERT) NIL))))))))))))))))))))))))))))))))
$$$ramsey_new.pvs
ramsey_new[T: TYPE]: THEORY
BEGIN
  IMPORTING graphs[T], subgraphs[T]
  i, j: VAR T
  n, p, q, ii: VAR nat
%  g: VAR graph[T]
  g: VAR graph[T]
  V: VAR finite_set[T]
  contains_clique(g, n): bool =
      (EXISTS (C: finite_set[T]):
        subset?(C,vert(g)) AND card(C) >= n AND
          (FORALL i,j: i/=j AND C(i) AND C(j) IMPLIES edge?(g)(i,j)))
  contains_indep(g, n): bool =
      (EXISTS (D: finite_set[T]):
        subset?(D, vert(g)) AND card(D) >= n AND
         (FORALL i, j: i/=j AND D(i) AND D(j) IMPLIES NOT edge?(g)(i, j)))
  subgraph_clique: LEMMA (FORALL (V: set[T]):
                             contains_clique(subgraph(g, V), p)
                             IMPLIES contains_clique(g, p))
  subgraph_indep : LEMMA (FORALL (V: set[T]):
                             contains_indep(subgraph(g, V), p)
                             IMPLIES contains_indep(g, p))
  G: VAR Graph[T]   % finite and nonempty
  r1(G): finite_set[T] = (LET v0 = choose(vert(G)) IN
           { n: (vert(G)) | n /= v0 AND edge?(G)(v0,n)})
  r2(G): finite_set[T] = (LET v0 = choose(vert(G)) IN
           { n: (vert(G)) | n /= v0 AND NOT edge?(G)(v0,n)})
  SG1(G): graph[T] = subgraph(G, r1(G))
  SG2(G): graph[T] = subgraph(G, r2(G))
  v0: VAR nat
  card_r1_r2: LEMMA card(r1(G)) + card(r2(G)) >= size(G) - 1
%  ramsey(p, q): RECURSIVE posnat =
%         (IF p=0
%          THEN 1
%          ELSIF q=0
%             THEN 1
%             ELSE (ramsey(p-1,q)+ramsey(p, q-1))
%             ENDIF)
%  MEASURE p+q
  ramsey(p, q): posnat
  l1,l2: VAR nat
  ramsey_lem: LEMMA (FORALL l1,l2: l1+l2=ii IMPLIES
      (EXISTS (n: posnat):
          (FORALL (G: Graph[T]): size(G) >= n
              IMPLIES (contains_clique(G, l1) OR
                       contains_indep(G, l2)))))
  ramseys_theorem: THEOREM (EXISTS (n: posnat):
                               (FORALL (G: Graph[T]): size(G) >= n
                                   IMPLIES (contains_clique(G, l1) OR
                                            contains_indep(G, l2))))
END ramsey_new
$$$ramsey_new.prf
(|ramsey_new|
 (|subgraph_clique| "" (INSTALL-REWRITES :DEFS !)
  (("" (GROUND)
    (("" (SKOSIMP*)
      (("" (INST? +)
        (("" (PROP)
          (("1" (SKOSIMP*) (("1" (INST?) (("1" (ASSERT) NIL)))))
           ("2" (SKOSIMP*)
            (("2" (INST?)
              (("2" (ASSERT) (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))
 (|subgraph_indep| "" (INSTALL-REWRITES :DEFS !)
  (("" (SKOSIMP*)
    (("" (GROUND)
      (("" (SKOSIMP*)
        (("" (INST?)
          (("" (PROP)
            (("1" (SKOSIMP*) (("1" (INST?) (("1" (ASSERT) NIL)))))
             ("2" (SKOSIMP*)
              (("2" (INST?)
                (("2" (ASSERT)
                  (("2" (INST?)
                    (("2" (ASSERT)
                      (("2" (FLATTEN)
                        (("2" (SKOSIMP*)
                          (("2" (GROUND)
                            (("2" (REPLACE -1)
                              (("2" (HIDE -1)
                                (("2" (REVEAL -3)
                                  (("2" (INST -1 "j!1")
                                    (("2" (ASSERT)
                                      NIL)))))))))))))))))))))))))))))))))))))
 (|r1_TCC1| "" (SKOSIMP*) (("" (TYPEPRED "G!1") (("" (PROPAX) NIL)))))
 (|r1_TCC2| "" (SKOSIMP*)
  (("" (EXPAND "extend")
    ((""
      (CASE "subset?((LAMBDA (t:T):
                     IF vert(G!1)(t) THEN t /= choose[T](vert(G!1))
                           AND edge?[T](G!1)(choose[T](vert(G!1)), t)
                     ELSE FALSE
                     ENDIF) , vert(G!1))")
      (("1" (LEMMA "finite_subset[T]") (("1" (INST?) (("1" (ASSERT) NIL)))))
       ("2" (HIDE 2)
        (("2" (EXPAND "subset?")
          (("2" (SKOSIMP*)
            (("2" (EXPAND "member") (("2" (ASSERT) NIL)))))))))))))))
 (|r2_TCC1| "" (SKOSIMP*)
  (("" (EXPAND "extend")
    ((""
      (CASE "subset?((LAMBDA (t:T):
                     IF vert(G!1)(t) THEN t /= choose[T](vert(G!1))
                           AND NOT edge?[T](G!1)(choose[T](vert(G!1)), t)
                     ELSE FALSE
                     ENDIF) , vert(G!1))")
      (("1" (LEMMA "finite_subset[T]") (("1" (INST?) (("1" (ASSERT) NIL)))))
       ("2" (HIDE 2)
        (("2" (EXPAND "subset?")
          (("2" (SKOSIMP*)
            (("2" (EXPAND "member") (("2" (ASSERT) NIL)))))))))))))))
 (|card_r1_r2| "" (SKOSIMP*)
  (("" (CASE "add(choose(vert(G!1)),union(r1(G!1),r2(G!1))) = vert(G!1)")
    (("1" (EXPAND "size")
      (("1" (REPLACE -1 * RL)
        (("1" (HIDE -1)
          (("1" (REWRITE "card_add")
            (("1" (REWRITE "card_union")
              (("1" (LIFT-IF) (("1" (GROUND) NIL)))))))))))))
     ("2" (HIDE 2)
      (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
        (("2" (GRIND :EXCLUDE "choose") NIL)))))))))
 (|ramsey_lem| "" (INDUCT "ii")
  (("1" (SKOSIMP*)
    (("1" (INST 1 "ramsey(l1!1,l2!1)")
      (("1" (SKOSIMP*)
        (("1" (EXPAND "contains_clique")
          (("1" (INST 1 "emptyset[T]")
            (("1" (HIDE 2) (("1" (GRIND) NIL)))))))))))))
   ("2" (SKOSIMP*)
    (("2" (CASE-REPLACE "l1!1 = 0")
      (("1" (INST 1 "ramsey(l1!1,l2!1)")
        (("1" (SKOSIMP*)
          (("1" (EXPAND "contains_clique")
            (("1" (INST 1 "emptyset[T]")
              (("1" (HIDE -2 2) (("1" (GRIND) NIL)))))))))))
       ("2" (CASE-REPLACE "l2!1 = 0")
        (("1" (INST 2 "ramsey(l1!1,l2!1)")
          (("1" (SKOSIMP*)
            (("1" (HIDE -2 2)
              (("1" (EXPAND "contains_indep")
                (("1" (INST 2 "emptyset[T]") (("1" (GRIND) NIL)))))))))))
         ("2" (INST-CP -1 "l1!1" "l2!1-1")
          (("1" (INST -1 "l1!1-1" "l2!1")
            (("1" (ASSERT)
              (("1" (SKOSIMP*)
                (("1" (INST 3 "n!1+n!2")
                  (("1" (SKOSIMP*)
                    (("1" (LEMMA "card_r1_r2")
                      (("1" (INST?)
                        (("1" (ASSERT)
                          (("1" (CASE "card(r1(G!1)) >= n!1")
                            (("1" (INST -3 "SG1(G!1)")
                              (("1" (EXPAND "size")
                                (("1" (SPLIT -3)
                                  (("1" (HIDE -2 -3 -4 -5 -6 4)
                                    (("1" (NAME "Vo" "choose(vert(G!1))")
                                      (("1"
                                        (CASE "contains_clique(subgraph(G!1,add(Vo,
                                          vert(SG1(G!1)))), l1!1)")
                                        (("1"
                                          (LEMMA "subgraph_clique")
                                          (("1"
                                            (INST
                                             -1
                                             "G!1"
                                             "l1!1"
                                             "add(Vo, vert(SG1(G!1)))")
                                            (("1" (ASSERT) NIL)))))
                                         ("2"
                                          (HIDE 4)
                                          (("2"
                                            (EXPAND "contains_clique")
                                            (("2"
                                              (SKOSIMP*)
                                              (("2"
                                                (INST 1 "add(Vo,C!1)")
                                                (("2"
                                                  (PROP)
                                                  (("1"
                                                    (HIDE -1)
                                                    (("1"
                                                      (HIDE -2 -3 2 3)
                                                      (("1"
                                                        (EXPAND "subset?")
                                                        (("1"
                                                          (SKOSIMP*)
                                                          (("1"
                                                            (EXPAND "member")
                                                            (("1"
                                                              (INST -2 "x!1")
                                                              (("1"
                                                                (GRIND
                                                                 :EXCLUDE
                                                                 ("choose" "r1"))
                                                                NIL)))))))))))))
                                                   ("2"
                                                    (HIDE -4 2 3)
                                                    (("2"
                                                      (REWRITE "card_add")
                                                      (("2"
                                                        (EXPAND "SG1")
                                                        (("2"
                                                          (EXPAND "subgraph")
                                                          (("2"
                                                            (EXPAND "subset?")
                                                            (("2"
                                                              (INST -2 "Vo")
                                                              (("2"
                                                                (EXPAND "member")
                                                                (("2"
                                                                  (GRIND
                                                                   :EXCLUDE
                                                                   "choose")
                                                                  NIL)))))))))))))))
                                                   ("3"
                                                    (SKOSIMP*)
                                                    (("3"
                                                      (HIDE -5 3 4)
                                                      (("3"
                                                        (INST -5 "i!1" "j!2")
                                                        (("3"
                                                          (EXPAND "subset?")
                                                          (("3"
                                                            (INST-CP -4 "i!1")
                                                            (("3"
                                                              (INST -4 "j!2")
                                                              (("3"
                                                                (EXPAND "add")
                                                                (("3"
                                                                  (EXPAND
                                                                   "member")
                                                                  (("3"
                                                                    (GRIND
                                                                     :EXCLUDE
                                                                     "choose")
                                                                    (("3"
                                                                      (REWRITE
                                                                       "dbl_comm")
                                                                      NIL)))))))))))))))))))))))))))))))))))
                                   ("2" (HIDE -2 -3 -4 -5 -6 3)
                                    (("2" (EXPAND "SG1")
                                      (("2" (EXPAND "subgraph")
                                        (("2"
                                          (EXPAND "contains_indep")
                                          (("2"
                                            (SKOSIMP*)
                                            (("2"
                                              (INST 3 "D!1")
                                              (("2"
                                                (EXPAND "subset?")
                                                (("2"
                                                  (EXPAND "member")
                                                  (("2"
                                                    (PROP)
                                                    (("1"
                                                      (SKOSIMP*)
                                                      (("1"
                                                        (INST -2 "x!1")
                                                        (("1" (ASSERT) NIL)))))
                                                     ("2"
                                                      (SKOSIMP*)
                                                      (("2"
                                                        (ASSERT)
                                                        (("2"
                                                          (INST -6 "i!1" "j!2")
                                                          (("2"
                                                            (ASSERT)
                                                            (("2"
                                                              (EXPAND "edge?")
                                                              (("2"
                                                                (PROP)
                                                                (("2"
                                                                  (SKOSIMP*)
                                                                  (("2"
                                                                    (EXPAND "r1")
                                                                    (("2"
                                                                      (EXPAND
                                                                       "extend")
                                                                      (("2"
                                                                        (ASSERT)
                                                                        (("2"
                                                                          (INST?)
                                                                          (("2"
                                                                            (EXPAND
                                                                             "dbl")
                                                                            (("2"
                                                                              (SPLIT)
                                                                              (("1"
                                                                                (REPLACE
                                                                                 -1)
                                                                                (("1"
                                                                                  (HIDE
                                                                                   -1)
                                                                                  (("1"
                                                                                    (ASSERT)
                                                                                    (("1"
                                                                                      (FLATTEN)
                                                                                      (("1"
                                                                                        (PROPAX)
                                                                                        NIL)))))))))
                                                                               ("2"
                                                                                (REPLACE
                                                                                 -1)
                                                                                (("2"
                                                                                  (HIDE
                                                                                   -1)
                                                                                  (("2"
                                                                                    (ASSERT)
                                                                                    (("2"
                                                                                      (FLATTEN)
                                                                                      (("2"
                                                                                        (PROPAX)
                                                                                        NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))
                                   ("3" (HIDE -2 -3 -4 -5 2 3 4 5)
                                    (("3"
                                      (CASE-REPLACE "vert(SG1(G!1)) = r1(G!1)")
                                      (("3" (HIDE -1 2)
                                        (("3"
                                          (APPLY-EXTENSIONALITY 1 :HIDE? T)
                                          (("3"
                                            (GRIND :EXCLUDE ("choose" "edge?"))
                                            NIL)))))))))))))
                               ("2" (ASSERT)
                                (("2" (HIDE -4 -6 2 3 4 5)
                                  (("2" (EXPAND "nonempty?")
                                    (("2" (EXPAND "SG1")
                                      (("2" (CASE "card(r1(G!1)) = 0")
                                        (("1" (ASSERT) NIL)
                                         ("2"
                                          (HIDE -3 -4 -5)
                                          (("2"
                                            (LEMMA "card_empty?[T]")
                                            (("2"
                                              (INST
                                               -1
                                               "vert(subgraph(G!1, r1(G!1)))")
                                              (("2"
                                                (LEMMA "card_subset[T]")
                                                (("2"
                                                  (INST
                                                   -1
                                                   "r1(G!1)"
                                                   "vert(subgraph(G!1, r1(G!1)))")
                                                  (("2"
                                                    (GROUND)
                                                    (("2"
                                                      (HIDE -1 -2 -3 2)
                                                      (("2"
                                                        (GRIND
                                                         :EXCLUDE
                                                         ("choose" "edge?"))
                                                        NIL)))))))))))))))))))))))))))
                             ("2" (ASSERT)
                              (("2" (CASE "card(r2(G!1)) >= n!2")
                                (("1" (INST -4 "SG2(G!1)")
                                  (("1" (EXPAND "size")
                                    (("1" (HIDE -3)
                                      (("1" (SPLIT -3)
                                        (("1"
                                          (HIDE -2 -3 -4 -5 1 5)
                                          (("1"
                                            (EXPAND "contains_clique")
                                            (("1"
                                              (SKOSIMP*)
                                              (("1"
                                                (INST?)
                                                (("1"
                                                  (PROP)
                                                  (("1"
                                                    (HIDE -2 -3 2 3)
                                                    (("1"
                                                      (EXPAND "subset?")
                                                      (("1"
                                                        (SKOSIMP*)
                                                        (("1"
                                                          (GRIND
                                                           :EXCLUDE
                                                           ("choose" "r2"))
                                                          NIL)))))))
                                                   ("2"
                                                    (SKOSIMP*)
                                                    (("2"
                                                      (INST?)
                                                      (("2"
                                                        (INST -5 "j!2")
                                                        (("2"
                                                          (GRIND
                                                           :EXCLUDE
                                                           ("choose" "r2"))
                                                          NIL)))))))))))))))))
                                         ("2"
                                          (HIDE -2 -3 -4 -5 1 4)
                                          (("2"
                                            (EXPAND "SG2")
                                            (("2"
                                              (EXPAND "contains_indep")
                                              (("2"
                                                (SKOSIMP*)
                                                (("2"
                                                  (NAME "Vo" "choose(vert(G!1))")
                                                  (("2"
                                                    (INST 3 "add(Vo,D!1)")
                                                    (("2"
                                                      (PROP)
                                                      (("1"
                                                        (HIDE -3 -4 2 3)
                                                        (("1"
                                                          (CASE-REPLACE
                                                           "vert(subgraph(G!1, r2(G!1))) = r2(G!1)")
                                                          (("1"
                                                            (HIDE -1)
                                                            (("1"
                                                              (EXPAND "subset?")
                                                              (("1"
                                                                (SKOSIMP*)
                                                                (("1"
                                                                  (INST?)
                                                                  (("1"
                                                                    (GRIND
                                                                     :EXCLUDE
                                                                     "choose")
                                                                    NIL)))))))))
                                                           ("2"
                                                            (HIDE -1 2)
                                                            (("2"
                                                              (APPLY-EXTENSIONALITY
                                                               1
                                                               :HIDE?
                                                               T)
                                                              (("2"
                                                                (GRIND
                                                                 :EXCLUDE
                                                                 "choose")
                                                                NIL)))))))))
                                                       ("2"
                                                        (HIDE -4)
                                                        (("2"
                                                          (TYPEPRED "G!1")
                                                          (("2"
                                                            (TYPEPRED
                                                             "vert(G!1)")
                                                            (("2"
                                                              (REWRITE
                                                               "card_add")
                                                              (("2"
                                                                (LIFT-IF)
                                                                (("2"
                                                                  (EXPAND
                                                                   "subset?")
                                                                  (("2"
                                                                    (EXPAND
                                                                     "member")
                                                                    (("2"
                                                                      (HIDE
                                                                       -1
                                                                       -2
                                                                       2
                                                                       3)
                                                                      (("2"
                                                                        (GRIND
                                                                         :EXCLUDE
                                                                         "choose")
                                                                        NIL)))))))))))))))))
                                                       ("3"
                                                        (SKOSIMP*)
                                                        (("3"
                                                          (EXPAND "add")
                                                          (("3"
                                                            (EXPAND "member")
                                                            (("3"
                                                              (INST
                                                               -7
                                                               "i!1"
                                                               "j!2")
                                                              (("3"
                                                                (EXPAND
                                                                 "subset?")
                                                                (("3"
                                                                  (INST-CP
                                                                   -5
                                                                   "i!1")
                                                                  (("3"
                                                                    (INST
                                                                     -5
                                                                     "j!2")
                                                                    (("3"
                                                                      (EXPAND
                                                                       "member")
                                                                      (("3"
                                                                        (GRIND
                                                                         :EXCLUDE
                                                                         "choose")
                                                                        (("3"
                                                                          (REWRITE
                                                                           "dbl_comm")
                                                                          NIL)))))))))))))))))))))))))))))))))
                                         ("3"
                                          (HIDE -2 -3 -4 2 3 4 5 6)
                                          (("3"
                                            (CASE-REPLACE
                                             "vert(SG2(G!1)) = r2(G!1)")
                                            (("3"
                                              (HIDE 2)
                                              (("3"
                                                (APPLY-EXTENSIONALITY 1 :HIDE? T)
                                                (("3"
                                                  (HIDE -1)
                                                  (("3"
                                                    (GRIND
                                                     :EXCLUDE
                                                     ("choose" "edge?"))
                                                    NIL)))))))))))))))))
                                   ("2" (ASSERT)
                                    (("2" (EXPAND "nonempty?")
                                      (("2" (CASE "card(r2(G!1)) = 0")
                                        (("1" (ASSERT) NIL)
                                         ("2"
                                          (HIDE -3 -4 -5 -6 -7 2 3 4 5 6)
                                          (("2"
                                            (EXPAND "SG2")
                                            (("2"
                                              (LEMMA "card_empty?[T]")
                                              (("2"
                                                (INST
                                                 -1
                                                 "vert(subgraph(G!1, r2(G!1)))")
                                                (("2"
                                                  (LEMMA "card_subset[T]")
                                                  (("2"
                                                    (INST
                                                     -1
                                                     "r2(G!1)"
                                                     "vert(subgraph(G!1, r2(G!1)))")
                                                    (("2"
                                                      (GROUND)
                                                      (("2"
                                                        (HIDE -1 -2 2 -3)
                                                        (("2"
                                                          (GRIND
                                                           :EXCLUDE
                                                           ("choose" "edge?"))
                                                          NIL)))))))))))))))))))))))))
                                 ("2" (ASSERT) NIL)))))))))))))))))))))
             ("2" (ASSERT) NIL)))
           ("2" (ASSERT) NIL)))))))))))
 (|ramseys_theorem| "" (SKOSIMP*)
  (("" (LEMMA "ramsey_lem")
    (("" (INST?) (("" (INST -1 "l1!1 + l2!1") (("" (ASSERT) NIL))))))))))
$$$graph_complected.pvs
graph_complected[T: TYPE]: THEORY
BEGIN
   IMPORTING graph_conn_defs[T], graph_ops[T], graph_deg[T],
             graph_inductions[T]
   G,G1,G2: VAR graph[T]
   v,v1,v2: VAR T
   e: VAR doubleton[T]
   two_vertices: LEMMA FORALL (v1,v2: T): edges(G)(e) AND e(v2) AND
                            vert(G) = dbl(v1, v2) IMPLIES e(v1)
   sub_T: LEMMA FORALL (v: (vert(G))):
                          NOT empty?(vert(del_vert(G,v))) AND deg(v,G) = 0
                             IMPLIES NOT connected?(G)
   rev_lem2  : LEMMA FORALL (v: (vert(G))):
                     connected?(G) AND
                     deg(v, G) = 1 IMPLIES
                             connected?(del_vert(G, v))
   conn_lem2 : LEMMA FORALL (v: (vert(G))):
                     connected?(G) AND NOT isolated?(G) AND
                     deg(v, G) = 1 IMPLIES
                         (EXISTS (x: (vert(G))): deg(x, G) = 1
                                     AND connected?(del_vert(G, x)))
   del_rem_lem: LEMMA edges(G)(e) AND e(v)
                      IMPLIES del_vert(del_edge(G, e), v) = del_vert(G, v)
   conn_lem3 : LEMMA connected?(G) AND NOT isolated?(G) AND
                     NOT (EXISTS (v: (vert(G))): deg(v, G) = 1)
                     IMPLIES
                        (EXISTS (e: (edges(G))): connected?(del_edge(G, e)))
   BIG       : LEMMA connected?(del_edge(G, e)) IMPLIES connected?(G)
   conn_lem6 : LEMMA  edges(G)(e) AND connected?(del_edge(G, e))
                      AND NOT isolated?(G) AND
                      NOT (EXISTS (v: (vert(G))): deg(v, G) = 1)
                      IMPLIES
                         connected?(G )
   conn_eq_compl: LEMMA connected?(G) IFF
                        (IF isolated?(G) THEN singleton?(G)
                        ELSIF (EXISTS (v: (vert(G))): deg(v,G) = 1) THEN
                           (EXISTS (x: (vert(G))): deg(x,G) = 1 AND
                              connected?(del_vert(G,x)))
                        ELSE
                           (EXISTS (e: (edges(G))):
                              connected?(del_edge(G,e)))
                        ENDIF)
    conn_del_vert: LEMMA  (EXISTS (v: (vert(G))): deg(v,G) = 1 AND                                             connected?(del_vert(G,v)))
                          IMPLIES connected?(G)
    connected_not_empty: LEMMA connected?(G) IMPLIES NOT empty?(G)
END graph_complected
$$$graph_complected.prf
(|graph_complected|
 (|two_vertices| "" (SKOSIMP*)
  (("" (TYPEPRED "e!1")
    (("" (SKOSIMP*)
      (("" (TYPEPRED "G!1")
        (("" (INST?)
          (("" (ASSERT)
            (("" (INST-CP -1 "x!1")
              (("" (INST -1 "y!1")
                (("" (REPLACE -3 -1)
                  (("" (REPLACE -3 -2)
                    (("" (EXPAND "dbl" -1)
                      (("" (EXPAND "dbl" -2)
                        (("" (REPLACE -6)
                          (("" (EXPAND "dbl" -1)
                            (("" (EXPAND "dbl" -2)
                              (("" (GROUND)
                                (("1" (REPLACE -1)
                                  (("1" (HIDE -1)
                                    (("1" (REPLACE -1)
                                      (("1"
                                        (HIDE -1)
                                        (("1"
                                          (REPLACE -1)
                                          (("1"
                                            (EXPAND "dbl")
                                            (("1" (PROPAX) NIL)))))))))))))
                                 ("2" (REPLACE -1)
                                  (("2" (HIDE -1)
                                    (("2" (REPLACE -1)
                                      (("2"
                                        (HIDE -1)
                                        (("2"
                                          (REPLACE -1)
                                          (("2"
                                            (HIDE -1)
                                            (("2"
                                              (EXPAND "dbl")
                                              (("2"
                                                (PROPAX)
                                                NIL)))))))))))))))))))))))))))))))))))))))))))))))
 (|sub_T| "" (INDUCT "G" 1 "graph_induction_vert")
  (("" (SKOSIMP*)
    (("" (EXPAND "connected?" -3)
      (("" (PROP)
        (("1" (HIDE -2)
          (("1" (TYPEPRED "v!1")
            (("1" (EXPAND "singleton?")
              (("1" (EXPAND "size")
                (("1" (ASSERT)
                  (("1" (EXPAND "del_vert")
                    (("1" (REWRITE "empty_card[T]")
                      (("1" (REWRITE "card_remove")
                        (("1" (ASSERT) NIL)))))))))))))))))
         ("2" (SKOSIMP*)
          (("2" (INST -3 "del_vert(G!1, v!2)")
            (("2" (REWRITE "size_del_vert")
              (("2" (ASSERT)
                (("2" (INST -3 "v!1")
                  (("1" (PROP)
                    (("1" (CASE "vert(G!1) = dbl[T](v!1,v!2)")
                      (("1" (HIDE -2 -4 1)
                        (("1" (EXPAND "deg")
                          (("1" (REWRITE "card_is_0[doubleton[T]]")
                            (("1" (LEMMA "nonempty_card[doubleton[T]]")
                              (("1" (INST?)
                                (("1" (ASSERT)
                                  (("1" (EXPAND "nonempty?")
                                    (("1" (EXPAND "empty?")
                                      (("1"
                                        (EXPAND "member")
                                        (("1"
                                          (SKOSIMP*)
                                          (("1"
                                            (HIDE -3)
                                            (("1"
                                              (CASE
                                               "incident_edges(v!1, G!1)(x!1) = emptyset(x!1)")
                                              (("1"
                                                (HIDE -4)
                                                (("1"
                                                  (EXPAND "incident_edges")
                                                  (("1"
                                                    (EXPAND "emptyset")
                                                    (("1"
                                                      (FLATTEN)
                                                      (("1"
                                                        (ASSERT)
                                                        (("1"
                                                          (LEMMA
                                                           "two_vertices")
                                                          (("1"
                                                            (INST?)
                                                            (("1"
                                                              (INST -1 "x!1")
                                                              (("1"
                                                                (ASSERT)
                                                                NIL)))))))))))))))))
                                               ("2"
                                                (ASSERT)
                                                NIL)))))))))))))))))))))))))
                       ("2" (HIDE -2 -3 -4 2)
                        (("2" (EXPAND "del_vert")
                          (("2" (EXPAND "remove")
                            (("2" (EXPAND "empty?")
                              (("2" (EXPAND "member")
                                (("2" (EXPAND "dbl")
                                  (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
                                    (("2" (INST -1 "x!1")
                                      (("2" (GROUND) NIL)))))))))))))))))))
                     ("2" (HIDE -2 2)
                      (("2" (CASE "v!1 = v!2")
                        (("1" (ASSERT) NIL)
                         ("2" (LEMMA "del_vert_not_incident")
                          (("2" (INST?)
                            (("2" (ASSERT)
                              (("2" (HIDE -2 2)
                                (("2" (EXPAND "deg")
                                  (("2" (REWRITE "card_empty?[doubleton[T]]")
                                    (("2" (EXPAND "empty?")
                                      (("2"
                                        (EXPAND "member")
                                        (("2"
                                          (EXPAND "incident_edges")
                                          (("2"
                                            (INST?)
                                            (("1"
                                              (ASSERT)
                                              (("1"
                                                (EXPAND "dbl")
                                                (("1" (PROPAX) NIL)))))
                                             ("2"
                                              (INST?)
                                              (("2"
                                                (ASSERT)
                                                NIL)))))))))))))))))))))))))))))
                   ("2" (TYPEPRED "v!1")
                    (("2" (HIDE -2 -3 -4 2)
                      (("2" (REWRITE "del_vert_still_in")
                        NIL)))))))))))))))))))))))
 (|rev_lem2| "" (INDUCT "G" 1 "graph_induction_vert")
  (("" (SKOSIMP*)
    (("" (LEMMA "singleton_deg")
      (("" (INST?)
        (("" (ASSERT)
          ((""
            (CASE "(EXISTS (x: (vert(G!1))): deg(x,G!1) > 0 AND
              connected?(del_vert(G!1, x)))")
            (("1" (SKOSIMP*)
              (("1" (CASE-REPLACE "x!1 = v!1")
                (("1" (CASE "edges(G!1)(dbl[T](x!1,v!1))")
                  (("1"
                    (CASE "vert(del_vert(del_vert(G!1, x!1), v!1)) = emptyset[T]")
                    (("1" (HIDE -5)
                      (("1" (EXPAND "connected?" 3)
                        (("1" (FLATTEN)
                          (("1" (HIDE -2 -3 -4 -5 -6 2 4)
                            (("1" (EXPAND "singleton?")
                              (("1" (EXPAND "size")
                                (("1" (LEMMA "card_is_0[T]")
                                  (("1"
                                    (INST -1
                                     "vert(del_vert(del_vert(G!1, x!1), v!1))")
                                    (("1" (IFF -1)
                                      (("1"
                                        (FLATTEN)
                                        (("1"
                                          (ASSERT)
                                          (("1"
                                            (LEMMA "size_del_vert ")
                                            (("1"
                                              (INST
                                               -1
                                               "del_vert(G!1, v!1)"
                                               "x!1")
                                              (("1"
                                                (REWRITE "del_vert_comm")
                                                (("1"
                                                  (EXPAND "size")
                                                  (("1" (ASSERT) NIL)))))
                                               ("2"
                                                (REWRITE "del_vert_still_in")
                                                NIL)))))))))))))))))))))))))))
                     ("2" (HIDE -4)
                      (("2" (LEMMA "sub_T")
                        (("2" (INST -1 "del_vert(G!1,x!1)" "v!1")
                          (("1" (ASSERT)
                            (("1" (PROP)
                              (("1" (HIDE -2 -3 -4 -5 -6 3 4)
                                (("1" (LEMMA "emptyset_is_empty?[T]")
                                  (("1" (INST?) (("1" (ASSERT) NIL)))))))
                               ("2" (HIDE -2 -3 -4 2 4 5 6)
                                (("2" (ASSERT)
                                  (("2" (LEMMA "deg_del_vert")
                                    (("2" (INST?)
                                      (("2" (ASSERT) NIL)))))))))))))
                           ("2" (REWRITE "del_vert_still_in") NIL)))))))))
                   ("2" (INST -3 "del_vert(G!1,x!1)")
                    (("2" (PROP)
                      (("1" (INST -1 "v!1")
                        (("1" (EXPAND "connected?" 4)
                          (("1" (PROP)
                            (("1" (INST?)
                              (("1" (REWRITE "del_vert_comm")
                                (("1" (ASSERT)
                                  (("1" (REWRITE "del_vert_not_incident")
                                    NIL)))))
                               ("2" (REWRITE "del_vert_still_in") NIL)))
                             ("2" (LEMMA "del_vert_not_incident")
                              (("2" (INST?)
                                (("2" (REWRITE "dbl_comm")
                                  (("2" (ASSERT) NIL)))))))))))
                         ("2" (REWRITE "del_vert_still_in") NIL)))
                       ("2" (REWRITE "size_del_vert")
                        (("2" (ASSERT) NIL)))))))
                   ("3" (INST 1 "x!1" "v!1") (("3" (ASSERT) NIL)))))))))
             ("2" (HIDE -1)
              (("2" (EXPAND "connected?" -1)
                (("2" (PROPAX) NIL)))))))))))))))))
 (|conn_lem2| "" (SKOSIMP*)
  (("" (LEMMA "rev_lem2")
    (("" (INST?)
      (("" (ASSERT) (("" (INST 2 "v!1") (("" (ASSERT) NIL)))))))))))
 (|del_rem_lem| "" (SKOSIMP*)
  (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
    (("1" (EXPAND "del_vert")
      (("1" (EXPAND "del_edge")
        (("1" (APPLY-EXTENSIONALITY 1 :HIDE? T) (("1" (GRIND) NIL)))))))
     ("2" (GRIND) NIL)))))
 (|conn_lem3| "" (SKOSIMP*)
  (("" (EXPAND "connected?" -1)
    (("" (PROP)
      (("1" (HIDE 2 3)
        (("1" (EXPAND "isolated?") (("1" (REWRITE "singleton_edges") NIL)))))
       ("2" (SKOSIMP*)
        (("2"
          (CASE "(EXISTS (e: doubleton[T], y:T): e = dbl(y,v!1) AND edges(G!1)(e))")
          (("1" (SKOSIMP*)
            (("1" (INST 3 "e!1")
              (("1" (NAME "HH" "del_edge(G!1,e!1)")
                (("1" (NAME "KK" "del_vert(G!1,v!1)")
                  (("1" (REPLACE -1)
                    (("1" (REPLACE -2)
                      (("1" (EXPAND "connected?" +)
                        (("1" (FLATTEN)
                          (("1" (INST 2 "v!1")
                            (("1" (INST 4 "v!1")
                              (("1" (PROP)
                                (("1" (REPLACE -2 * RL)
                                  (("1" (HIDE -2)
                                    (("1" (LEMMA "deg_del_edge")
                                      (("1"
                                        (INST?)
                                        (("1"
                                          (INST?)
                                          (("1" (ASSERT) NIL)))))))))))
                                 ("2" (ASSERT)
                                  (("2" (CASE "del_vert(HH,v!1) = KK")
                                    (("1" (ASSERT) NIL)
                                     ("2" (REPLACE -2 * RL)
                                      (("2"
                                        (HIDE -2)
                                        (("2"
                                          (REPLACE -1 * RL)
                                          (("2"
                                            (HIDE -1)
                                            (("2"
                                              (HIDE -3 -4 2 3 4 5)
                                              (("2"
                                                (LEMMA "del_rem_lem")
                                                (("2"
                                                  (INST?)
                                                  (("2"
                                                    (ASSERT)
                                                    (("2"
                                                      (HIDE 2)
                                                      (("2"
                                                        (REPLACE -1)
                                                        (("2"
                                                          (HIDE -1)
                                                          (("2"
                                                            (EXPAND "dbl")
                                                            (("2"
                                                              (PROPAX)
                                                              NIL)))))))))))))))))))))))))))))))
                               ("2" (TYPEPRED "v!1")
                                (("2" (REPLACE -3 * RL)
                                  (("2" (REWRITE "vert_del_edge")
                                    NIL)))))))))))))))))))))))))
           ("2" (HIDE -2 2 3 4)
            (("2" (EXPAND "deg")
              (("2" (LEMMA "empty_card[doubleton[T]]")
                (("2" (INST?)
                  (("2" (FLATTEN)
                    (("2" (HIDE -2)
                      (("2" (ASSERT)
                        (("2" (HIDE -1)
                          (("2" (EXPAND "empty?")
                            (("2" (EXPAND "incident_edges")
                              (("2" (SKOSIMP*)
                                (("2" (EXPAND "member")
                                  (("2" (FLATTEN)
                                    (("2" (INST?)
                                      (("2"
                                        (LEMMA "other_vert")
                                        (("2"
                                          (INST?)
                                          (("2"
                                            (INST?)
                                            (("2"
                                              (ASSERT)
                                              (("2"
                                                (SKOSIMP*)
                                                (("2"
                                                  (INST?)
                                                  NIL)))))))))))))))))))))))))))))))))))))))))))))))))
 (BIG "" (INDUCT "G" 1 "graph_induction_vert")
  (("" (SKOSIMP*)
    (("" (CASE "edges(G!1)(e!1)")
      (("1" (HIDE -2)
        (("1" (CASE "(EXISTS (v: T): vert(G!1)(v) AND deg(v,G!1) = 1)")
          (("1" (NAME "H" "del_edge(G!1,e!1)")
            (("1" (SKOSIMP*)
              (("1"
                (CASE "(EXISTS (u: T): vert(G!1)(u) AND e!1 = dbl[T](u,v!1))")
                (("1" (SKOSIMP*)
                  (("1" (LEMMA "deg_del_edge")
                    (("1" (INST?)
                      (("1" (INST?)
                        (("1" (ASSERT)
                          (("1" (LEMMA "sub_T")
                            (("1" (INST?)
                              (("1" (ASSERT)
                                (("1" (LEMMA "   del_vert_empty?")
                                  (("1" (INST -1 "H" "v!1")
                                    (("1" (ASSERT)
                                      (("1"
                                        (REPLACE -6)
                                        (("1"
                                          (EXPAND "connected?" 1)
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (LEMMA "del_edge_singleton")
                                              (("1"
                                                (INST?)
                                                (("1"
                                                  (ASSERT)
                                                  NIL)))))))))))))
                                     ("2" (REPLACE -5 + RL)
                                      (("2"
                                        (EXPAND "del_edge")
                                        (("2" (PROPAX) NIL)))))))))))
                               ("2" (EXPAND "del_edge")
                                (("2" (PROPAX) NIL)))))))))))))))))
                 ("2" (NAME "GP" "del_vert(G!1,v!1)")
                  (("2" (NAME "K" "del_vert(H,v!1)")
                    (("2" (CASE "K = del_edge(GP,e!1)")
                      (("1" (CASE "connected?(K)")
                        (("1" (REVEAL -1)
                          (("1" (INST -1 "GP")
                            (("1" (SPLIT -1)
                              (("1" (INST?)
                                (("1" (ASSERT)
                                  (("1" (EXPAND "connected?" 2)
                                    (("1" (FLATTEN)
                                      (("1"
                                        (INST 3 "v!1")
                                        (("1" (ASSERT) NIL)))))))))))
                               ("2" (EXPAND "size")
                                (("2" (REPLACE -4 + RL)
                                  (("2" (HIDE -1 -2 -3 -4 -5 -7 -8 -9 2 3)
                                    (("2" (EXPAND "del_vert")
                                      (("2"
                                        (REWRITE "card_remove[T]")
                                        (("2" (ASSERT) NIL)))))))))))))))))
                         ("2" (LEMMA "rev_lem2")
                          (("2" (INST?)
                            (("1" (ASSERT)
                              (("1" (REPLACE -4 + RL)
                                (("1" (LEMMA "deg_del_edge3")
                                  (("1" (INST?)
                                    (("1" (ASSERT)
                                      (("1"
                                        (HIDE -2 -3 -4 -5 -7 -9 1 2 4)
                                        (("1"
                                          (LEMMA "other_vert")
                                          (("1"
                                            (INST?)
                                            (("1"
                                              (INST?)
                                              (("1"
                                                (ASSERT)
                                                (("1"
                                                  (SKOSIMP*)
                                                  (("1"
                                                    (INST?)
                                                    (("1"
                                                      (ASSERT)
                                                      NIL)))))))))))))))))))))))))
                             ("2" (REPLACE -4 + RL)
                              (("2" (EXPAND "del_edge" 1)
                                (("2" (PROPAX) NIL)))))))))))
                       ("2" (HIDE -7 2 3)
                        (("2" (REPLACE -2 + RL)
                          (("2" (REPLACE -1 + RL)
                            (("2" (REPLACE -3 + RL)
                              (("2" (HIDE -1 -2 -3)
                                (("2" (REWRITE "del_vert_edge_comm")
                                  NIL)))))))))))))))))))))))
           ("2" (CASE "(FORALL (v: T): vert(G!1)(v) IMPLIES deg(v, G!1) > 1)")
            (("1" (NAME "H" "del_edge(G!1,e!1)")
              (("1" (CASE "(EXISTS (u: T): vert(G!1)(u) AND deg(u,H) = 1)")
                (("1" (SKOSIMP*)
                  (("1"
                    (CASE "(EXISTS (z: T): vert(H)(z) AND e!1 = dbl[T](u!1,z))")
                    (("1" (SKOSIMP*)
                      (("1" (NAME "K" "del_vert(G!1,u!1)")
                        (("1" (CASE "K = del_vert(H,u!1)")
                          (("1" (CASE "connected?(K)")
                            (("1" (EXPAND "connected?" 2)
                              (("1" (FLATTEN)
                                (("1" (INST 3 "u!1")
                                  (("1" (ASSERT)
                                    (("1" (HIDE -1 -2 -3 -4 -5 -9 -11 1 2)
                                      (("1"
                                        (REPLACE -3 * RL)
                                        (("1"
                                          (HIDE -3)
                                          (("1"
                                            (LEMMA "deg_del_edge_ge")
                                            (("1"
                                              (INST?)
                                              (("1"
                                                (ASSERT)
                                                NIL)))))))))))))))))))
                             ("2" (REPLACE -7)
                              (("2" (LEMMA "rev_lem2")
                                (("2" (INST?)
                                  (("1" (ASSERT) NIL)
                                   ("2" (HIDE -1 -2 -3 -4 -6 -8 -9 -10 2 3 4)
                                    (("2" (REPLACE -2 * RL)
                                      (("2"
                                        (EXPAND "del_edge")
                                        (("2" (PROPAX) NIL)))))))))))))))
                           ("2" (LEMMA "del_vert_edge")
                            (("2" (INST?)
                              (("2" (INST -1 "u!1")
                                (("2" (ASSERT)
                                  (("2" (REPLACE -3)
                                    (("2" (EXPAND "dbl")
                                      (("2" (PROPAX) NIL)))))))))))))))))))
                     ("2" (INST -4 "u!1")
                      (("2" (ASSERT)
                        (("2" (REPLACE -3 * RL)
                          (("2" (HIDE -3)
                            (("2" (CASE "e!1(u!1)")
                              (("1" (LEMMA "edges_vert")
                                (("1" (INST?)
                                  (("1" (INST?)
                                    (("1" (ASSERT)
                                      (("1"
                                        (SKOSIMP*)
                                        (("1"
                                          (INST 2 "y!1")
                                          (("1"
                                            (LEMMA "edge_has_2_verts")
                                            (("1"
                                              (INST?)
                                              (("1"
                                                (ASSERT)
                                                (("1"
                                                  (EXPAND "del_edge")
                                                  (("1"
                                                    (PROPAX)
                                                    NIL)))))))))))))))))))))
                               ("2" (HIDE -5 2 3 4)
                                (("2" (LEMMA "deg_del_edge3")
                                  (("2" (INST?)
                                    (("2" (ASSERT) NIL)))))))))))))))))))))
                 ("2"
                  (CASE "(FORALL (v: T): vert(H)(v) IMPLIES deg(v,H) > 1)")
                  (("1"
                    (CASE "(EXISTS (z: T): vert(H)(z) AND deg(z,H) > 0 AND
             connected?(del_vert(H,z)))")
                    (("1" (SKOSIMP*)
                      (("1"
                        (CASE "(EXISTS (p: T): p /= z!1 AND vert(H)(p) AND e!1 = dbl[T](z!1,p))")
                        (("1" (SKOSIMP*)
                          (("1" (CASE "del_vert(H,z!1) = del_vert(G!1,z!1)")
                            (("1" (EXPAND "connected?" 4)
                              (("1" (FLATTEN)
                                (("1" (REPLACE -1)
                                  (("1" (INST 5 "z!1")
                                    (("1" (ASSERT)
                                      (("1"
                                        (HIDE -2 -3 -4 -5 -6 -8 -10 2 3 4)
                                        (("1"
                                          (LEMMA "deg_del_edge_ge")
                                          (("1"
                                            (INST?)
                                            (("1"
                                              (ASSERT)
                                              (("1"
                                                (INST -4 "z!1")
                                                (("1"
                                                  (ASSERT)
                                                  (("1"
                                                    (REVEAL -5 -8)
                                                    (("1"
                                                      (HIDE -3 -5)
                                                      (("1"
                                                        (REPLACE -2 * RL)
                                                        (("1"
                                                          (EXPAND
                                                           "del_edge"
                                                           -1)
                                                          (("1"
                                                            (PROPAX)
                                                            NIL)))))))))))))))))))))))
                                     ("2" (HIDE -1 -2 -4 -5 -6 -7 -9 3 4 5)
                                      (("2"
                                        (REPLACE -1)
                                        (("2"
                                          (HIDE -1)
                                          (("2"
                                            (TYPEPRED "G!1")
                                            (("2"
                                              (INST?)
                                              (("1"
                                                (ASSERT)
                                                (("1"
                                                  (INST -1 "z!1")
                                                  (("1"
                                                    (EXPAND "dbl")
                                                    (("1" (PROPAX) NIL)))))))
                                               ("2"
                                                (INST?)
                                                (("2"
                                                  (ASSERT)
                                                  NIL)))))))))))))))))))))
                             ("2" (LEMMA "del_vert_edge")
                              (("2" (INST?)
                                (("2" (INST -1 "z!1")
                                  (("2" (ASSERT)
                                    (("2" (HIDE -1 -4 -5 -6 -8 -10 2 4 5 6)
                                      (("2"
                                        (REPLACE -1)
                                        (("2"
                                          (HIDE -1)
                                          (("2"
                                            (EXPAND "dbl")
                                            (("2"
                                              (PROPAX)
                                              NIL)))))))))))))))))))))
                         ("2" (NAME "K" "del_vert(H,z!1)")
                          (("2" (REPLACE -1)
                            (("2" (REPLACE -6)
                              (("2" (NAME "GP" "del_vert(G!1,z!1)")
                                (("2" (CASE "K = del_edge(GP,e!1)")
                                  (("1" (CASE "size(GP) < size(G!1)")
                                    (("1" (REVEAL -1)
                                      (("1"
                                        (INST -1 "GP")
                                        (("1"
                                          (ASSERT)
                                          (("1"
                                            (INST -1 "e!1")
                                            (("1"
                                              (ASSERT)
                                              (("1"
                                                (EXPAND "connected?" 4)
                                                (("1"
                                                  (FLATTEN)
                                                  (("1"
                                                    (INST 5 "z!1")
                                                    (("1"
                                                      (ASSERT)
                                                      (("1"
                                                        (HIDE
                                                         -1
                                                         -2
                                                         -3
                                                         -4
                                                         -5
                                                         -8
                                                         -9
                                                         -11
                                                         -12
                                                         -13
                                                         1
                                                         2
                                                         3
                                                         4)
                                                        (("1"
                                                          (REPLACE -3 * RL)
                                                          (("1"
                                                            (HIDE -3)
                                                            (("1"
                                                              (EXPAND
                                                               "del_edge"
                                                               -1)
                                                              (("1"
                                                                (LEMMA
                                                                 "deg_del_edge_ge")
                                                                (("1"
                                                                  (INST?)
                                                                  (("1"
                                                                    (ASSERT)
                                                                    NIL)))))))))))))))
                                                     ("2"
                                                      (HIDE
                                                       -1
                                                       -2
                                                       -3
                                                       -4
                                                       -5
                                                       -7
                                                       -8
                                                       -9
                                                       -11
                                                       -12
                                                       -13
                                                       2
                                                       3
                                                       4
                                                       5)
                                                      (("2"
                                                        (REPLACE -2 * RL)
                                                        (("2"
                                                          (HIDE -2)
                                                          (("2"
                                                            (EXPAND
                                                             "del_edge")
                                                            (("2"
                                                              (PROPAX)
                                                              NIL)))))))))))))))))))))))))
                                     ("2"
                                      (HIDE -1 -3 -5 -6 -7 -9 -10 -11 2 3 4 5)
                                      (("2"
                                        (REPLACE -1 * RL)
                                        (("2"
                                          (HIDE -1)
                                          (("2"
                                            (REPLACE -2 * RL)
                                            (("2"
                                              (HIDE -2)
                                              (("2"
                                                (EXPAND "del_edge")
                                                (("2"
                                                  (EXPAND "size")
                                                  (("2"
                                                    (EXPAND "del_vert")
                                                    (("2"
                                                      (REWRITE "card_remove")
                                                      (("2"
                                                        (GROUND)
                                                        NIL)))))))))))))))))))))
                                   ("2" (LEMMA "del_vert_edge_comm")
                                    (("2" (REPLACE -3 * RL)
                                      (("2"
                                        (REPLACE -8 * RL)
                                        (("2"
                                          (REPLACE -2 * RL)
                                          (("2"
                                            (HIDE
                                             -2
                                             -3
                                             -5
                                             -6
                                             -7
                                             -8
                                             -9
                                             -11
                                             2
                                             3
                                             4
                                             5)
                                            (("2"
                                              (INST?)
                                              NIL)))))))))))))))))))))))))
                     ("2" (REPLACE -2)
                      (("2" (EXPAND "connected?" -5)
                        (("2" (SPLIT -5)
                          (("1" (HIDE -2 -4 1 2 3 4)
                            (("1" (REPLACE -2 * RL)
                              (("1" (LEMMA "del_edge_singleton")
                                (("1" (INST?)
                                  (("1" (ASSERT)
                                    (("1" (HIDE -2 -3)
                                      (("1"
                                        (LEMMA "edge_in_card_gt_1")
                                        (("1"
                                          (INST?)
                                          (("1"
                                            (ASSERT)
                                            (("1"
                                              (EXPAND "singleton?")
                                              (("1"
                                                (EXPAND "size")
                                                (("1"
                                                  (ASSERT)
                                                  NIL)))))))))))))))))))))))
                           ("2" (SKOSIMP*)
                            (("2" (INST 1 "v!1")
                              (("2" (ASSERT) NIL)))))))))))))
                   ("2" (SKOSIMP*)
                    (("2" (INST 2 "v!1")
                      (("2" (INST -3 "v!1")
                        (("2" (REPLACE -2 * RL)
                          (("2" (EXPAND "del_edge" -1)
                            (("2" (ASSERT)
                              (("2" (LEMMA "deg_del_edge_le")
                                (("2" (INST?)
                                  (("2" (ASSERT) NIL)))))))))))))))))))))))
             ("2" (SKOSIMP*)
              (("2" (INST?)
                (("2" (ASSERT)
                  (("2" (CASE "deg(v!1, G!1) = 0")
                    (("1" (CASE "vert(del_edge(G!1, e!1))(v!1)")
                      (("1" (CASE "card(vert(del_edge(G!1,e!1))) > 1")
                        (("1"
                          (CASE "NOT empty?(vert(del_vert(del_edge(G!1, e!1), v!1)))")
                          (("1" (LEMMA "sub_T")
                            (("1" (INST -1 "del_edge(G!1, e!1)" "v!1")
                              (("1" (ASSERT)
                                (("1" (HIDE -1 -6 2 3 4 5)
                                  (("1" (LEMMA "deg_del_edge3")
                                    (("1" (INST?)
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (EXPAND "deg")
                                          (("1"
                                            (LEMMA "empty_card[doubleton[T]]")
                                            (("1"
                                              (INST
                                               -1
                                               "incident_edges(v!1, G!1)")
                                              (("1"
                                                (ASSERT)
                                                (("1"
                                                  (HIDE -3 -4 -5 1)
                                                  (("1"
                                                    (EXPAND "incident_edges")
                                                    (("1"
                                                      (EXPAND "empty?")
                                                      (("1"
                                                        (INST?)
                                                        (("1"
                                                          (EXPAND "member")
                                                          (("1"
                                                            (PROPAX)
                                                            NIL)))))))))))))))))))))))))))))))))
                           ("2" (HIDE -4 -7 1 2 3)
                            (("2" (LEMMA "empty_card[T]")
                              (("2" (INST?)
                                (("2" (ASSERT)
                                  (("2" (HIDE -2 -5 -6)
                                    (("2" (GRIND)
                                      (("2"
                                        (REWRITE "card_remove[T]")
                                        (("2" (ASSERT) NIL)))))))))))))))))
                         ("2" (LEMMA "edge_in_card_gt_1")
                          (("2" (INST -1 "G!1" "e!1")
                            (("2" (ASSERT)
                              (("2" (HIDE -2 -3 -4 -5 -6 2 3 4)
                                (("2" (EXPAND "del_edge")
                                  (("2" (PROPAX) NIL)))))))))))))
                       ("2" (EXPAND "del_edge") (("2" (PROPAX) NIL)))))
                     ("2" (ASSERT) NIL)))))))))))))))
       ("2" (HIDE -1)
        (("2" (LEMMA "del_edge_lem5")
          (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))
 (|conn_lem6| "" (SKOSIMP*)
  (("" (LEMMA "BIG") (("" (INST?) (("" (ASSERT) NIL)))))))
 (|conn_eq_compl| "" (SKOSIMP*)
  (("" (PROP)
    (("1" (EXPAND "connected?")
      (("1" (ASSERT)
        (("1" (EXPAND "singleton?")
          (("1" (SKOSIMP*)
            (("1" (EXPAND "isolated?")
              (("1" (LEMMA "deg_edge_exists")
                (("1" (INST?)
                  (("1" (ASSERT)
                    (("1" (SKOSIMP*)
                      (("1" (EXPAND "empty?")
                        (("1" (INST?)
                          (("1" (EXPAND "member")
                            (("1" (PROPAX) NIL)))))))))))))))))))))))))
     ("2" (SKOSIMP*)
      (("2" (LEMMA "conn_lem2") (("2" (INST?) (("2" (ASSERT) NIL)))))))
     ("3" (REWRITE "conn_lem3") NIL)
     ("4" (EXPAND "connected?") (("4" (ASSERT) NIL)))
     ("5" (SKOSIMP*)
      (("5" (EXPAND "connected?" 2)
        (("5" (FLATTEN) (("5" (INST 3 "x!1") (("5" (ASSERT) NIL)))))))))
     ("6" (SKOSIMP*)
      (("6" (LEMMA "conn_lem6") (("6" (INST?) (("6" (ASSERT) NIL)))))))))))
 (|conn_del_vert| "" (SKOSIMP*)
  (("" (LEMMA "conn_eq_compl")
    (("" (INST?)
      (("" (FLATTEN)
        (("" (HIDE -2)
          (("" (ASSERT)
            (("" (SPLIT -1)
              (("1" (FLATTEN)
                (("1" (EXPAND "connected?")
                  (("1" (FLATTEN)
                    (("1" (INST 2 "v!1") (("1" (ASSERT) NIL)))))))))
               ("2" (FLATTEN)
                (("2" (SPLIT -1)
                  (("1" (FLATTEN)
                    (("1" (SKOSIMP*)
                      (("1" (EXPAND "connected?")
                        (("1" (ASSERT)
                          (("1" (FLATTEN)
                            (("1" (INST?) (("1" (ASSERT) NIL)))))))))))))
                   ("2" (FLATTEN)
                    (("2" (EXPAND "connected?" 3)
                      (("2" (FLATTEN)
                        (("2" (INST 4 "v!1")
                          (("2" (ASSERT) NIL)))))))))))))))))))))))))))
 (|connected_not_empty| "" (SKOSIMP*)
  (("" (EXPAND "empty?")
    (("" (EXPAND "connected?")
      (("" (LEMMA " card_empty?[T]")
        (("" (INST?)
          (("" (IFF)
            (("" (ASSERT)
              (("" (PROP)
                (("1" (EXPAND "singleton?")
                  (("1" (EXPAND "size") (("1" (ASSERT) NIL)))))
                 ("2" (SKOSIMP*)
                  (("2" (EXPAND "empty?")
                    (("2" (INST -4 "v!1")
                      (("2" (EXPAND "member")
                        (("2" (PROPAX) NIL))))))))))))))))))))))))))
$$$graph_path_conn.pvs
graph_path_conn[T: TYPE]: THEORY
BEGIN
   IMPORTING graph_conn_defs[T], walks[T], subgraphs[T]
   G,G1,G2: VAR graph[T]
   isolated_not_path: LEMMA isolated?(G) AND NOT singleton?(G)
                                IMPLIES NOT path_connected?(G)
   u,v,y: VAR T
   pic_A: LEMMA (EXISTS v: vert(G)(v) AND deg(v,G) = 0)
                    IMPLIES path_connected?(G) IMPLIES connected?(G)
   IMPORTING graph_inductions[T], subtrees[T], path_ops[T]
   thw_A: LEMMA  (FORALL (GG: graph[T]): size(GG) < size(G)
                                              IMPLIES
                     (FORALL (x: T, y: T): tree?(GG) AND vert(GG)(x)
                                           AND vert(GG)(y) AND x /= y
                     IMPLIES (EXISTS (w: Walk(GG)): walk_from?(GG, w, x, y))))
               AND deg(v, G) = 1 AND tree?(del_vert[T](G, v)) AND
	       vert(G)(v) AND vert(G)(y) AND v /= y
	 IMPLIES
 	    (EXISTS (w: Walk(G)): walk_from?(G, w, v, y))
   TR: VAR graph[T]
   x: VAR T
   tree_has_walk: LEMMA tree?(TR) AND vert(TR)(x) AND vert(TR)(y)
                           AND x /= y IMPLIES
                              (EXISTS (w: Walk(TR)):
                                   walk_from?(TR,w,x,y))
   path_implies_conn: THEOREM path_connected?(G) IMPLIES connected?(G)
END graph_path_conn
$$$graph_path_conn.prf
(|graph_path_conn|
 (|isolated_not_path| "" (SKOSIMP*)
  (("" (EXPAND "path_connected?")
    (("" (FLATTEN)
      (("" (EXPAND "isolated?")
        (("" (EXPAND "empty?" -1)
          (("" (EXPAND "member")
            (("" (LEMMA "not_singleton_2_vert")
              (("" (INST?)
                (("" (ASSERT)
                  (("" (SKOSIMP*)
                    (("" (INST -4 "x!1" "y!1")
                      (("" (ASSERT)
                        (("" (SKOSIMP*)
                          (("" (TYPEPRED "w!1")
                            (("" (EXPAND "walk?")
                              (("" (FLATTEN)
                                (("" (EXPAND "verts_in?")
                                  (("" (INST -1 "0")
                                    (("" (ASSERT)
                                      ((""
                                        (EXPAND "fseq")
                                        ((""
                                          (INST -2 "0")
                                          ((""
                                            (ASSERT)
                                            ((""
                                              (EXPAND "edge?")
                                              ((""
                                                (FLATTEN)
                                                ((""
                                                  (INST
                                                   -6
                                                   "dbl[T](seq(w!1)(0), seq(w!1)(1))")
                                                  ((""
                                                    (INST?)
                                                    ((""
                                                      (ASSERT)
                                                      NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))
 (|pic_A| "" (SKOSIMP*)
  (("" (CASE "NOT singleton?(G!1)")
    (("1" (EXPAND "singleton?")
      (("1" (EXPAND "size")
        (("1" (CASE "NOT empty?(G!1)")
          (("1" (EXPAND "empty?")
            (("1" (LEMMA "card_empty?[T]")
              (("1" (INST?)
                (("1" (IFF)
                  (("1" (ASSERT)
                    (("1" (HIDE 2)
                      (("1"
                        (CASE "(EXISTS (y: T): vert(G!1)(y) AND y /= v!1)")
                        (("1" (SKOSIMP*)
                          (("1" (HIDE 2 3 4)
                            (("1" (EXPAND "path_connected?")
                              (("1" (FLATTEN)
                                (("1" (INST -4 "v!1" "y!1")
                                  (("1" (ASSERT)
                                    (("1" (SKOSIMP*)
                                      (("1"
                                        (TYPEPRED "w!1")
                                        (("1"
                                          (EXPAND "walk?")
                                          (("1"
                                            (FLATTEN)
                                            (("1"
                                              (HIDE -1)
                                              (("1"
                                                (INST -1 "0")
                                                (("1"
                                                  (ASSERT)
                                                  (("1"
                                                    (EXPAND "fseq")
                                                    (("1"
                                                      (REPLACE -6)
                                                      (("1"
                                                        (EXPAND "deg")
                                                        (("1"
                                                          (EXPAND "edge?")
                                                          (("1"
                                                            (FLATTEN)
                                                            (("1"
                                                              (LEMMA
                                                               "card_empty?[Dbl]")
                                                              (("1"
                                                                (INST?)
                                                                (("1"
                                                                  (ASSERT)
                                                                  (("1"
                                                                    (IFF)
                                                                    (("1"
                                                                      (ASSERT)
                                                                      (("1"
                                                                        (EXPAND
                                                                         "empty?")
                                                                        (("1"
                                                                          (EXPAND
                                                                           "member")
                                                                          (("1"
                                                                            (INST?)
                                                                            (("1"
                                                                              (EXPAND
                                                                               "incident_edges")
                                                                              (("1"
                                                                                (EXPAND
                                                                                 "dbl"
                                                                                 1)
                                                                                (("1"
                                                                                  (PROPAX)
                                                                                  NIL)))))
                                                                             ("2"
                                                                              (INST?)
                                                                              (("2"
                                                                                (ASSERT)
                                                                                NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))
                         ("2" (HIDE -2 -3 4)
                          (("2" (LEMMA "card_2_has_2[T]")
                            (("2" (INST?)
                              (("2" (ASSERT)
                                (("2" (SKOSIMP*)
                                  (("2" (CASE-REPLACE "x!1=v!1")
                                    (("1" (INST 2 "y!1") (("1" (ASSERT) NIL)))
                                     ("2" (INST 3 "x!1")
                                      (("2"
                                        (ASSERT)
                                        NIL)))))))))))))))))))))))))))))
           ("2" (HIDE -3 -4 1 2)
            (("2" (EXPAND "empty?")
              (("2" (EXPAND "empty?")
                (("2" (INST?)
                  (("2" (EXPAND "member") (("2" (PROPAX) NIL)))))))))))))))))
     ("2" (EXPAND "connected?") (("2" (ASSERT) NIL)))))))
 (|thw_A| "" (SKOSIMP*)
  (("" (HIDE -1)
    (("" (LEMMA "deg_1_sing")
      (("" (INST?)
        (("" (ASSERT)
          (("" (SKOSIMP*)
            (("" (HIDE -1)
              (("" (LEMMA "other_vert")
                (("" (INST?)
                  (("" (INST?)
                    (("" (ASSERT)
                      (("" (SKOSIMP*)
                        (("" (CASE-REPLACE "u!1 = y!1")
                          (("1"
                            (CASE "walk?[T](G!1, gen_seq2[T](G!1, v!1, y!1))")
                            (("1" (INST 3 "gen_seq2(G!1,v!1,y!1)")
                              (("1" (EXPAND "walk_from?")
                                (("1" (ASSERT)
                                  (("1" (HIDE -1)
                                    (("1" (EXPAND "gen_seq2")
                                      (("1" (PROPAX) NIL)))))))))))
                             ("2" (EXPAND "walk?")
                              (("2" (GROUND)
                                (("2" (SKOSIMP*)
                                  (("2" (EXPAND "fseq")
                                    (("2" (EXPAND "gen_seq2")
                                      (("2"
                                        (LIFT-IF)
                                        (("2"
                                          (ASSERT)
                                          (("2"
                                            (REWRITE "dbl_comm")
                                            (("2"
                                              (EXPAND "edge?")
                                              (("2"
                                                (ASSERT)
                                                NIL)))))))))))))))))))))
                           ("2"
                            (CASE "vert(del_vert(G!1,v!1))(u!1) AND vert(del_vert(G!1,v!1))(y!1)")
                            (("1" (FLATTEN)
                              (("1" (REVEAL -5)
                                (("1" (INST -1 "del_vert(G!1,v!1)")
                                  (("1" (SPLIT -1)
                                    (("1" (INST -1 "u!1" "y!1")
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (SKOSIMP*)
                                          (("1"
                                            (INST 4 "gen_seq1(G!1,v!1) o w!1")
                                            (("1"
                                              (EXPAND "gen_seq1")
                                              (("1"
                                                (EXPAND "o ")
                                                (("1"
                                                  (EXPAND "walk_from?")
                                                  (("1"
                                                    (FLATTEN)
                                                    (("1"
                                                      (ASSERT)
                                                      (("1"
                                                        (EXPAND "walk?")
                                                        (("1"
                                                          (EXPAND "verts_in?")
                                                          (("1"
                                                            (EXPAND "fseq")
                                                            (("1"
                                                              (SPLIT)
                                                              (("1"
                                                                (SKOSIMP*)
                                                                (("1"
                                                                  (GROUND)
                                                                  (("1"
                                                                    (LEMMA
                                                                     "vert_seq_lem")
                                                                    (("1"
                                                                      (INST?)
                                                                      (("1"
                                                                        (INST
                                                                         -1
                                                                         "i!1-1"
                                                                         "w!1")
                                                                        (("1"
                                                                          (ASSERT)
                                                                          (("1"
                                                                            (EXPAND
                                                                             "fseq")
                                                                            (("1"
                                                                              (PROPAX)
                                                                              NIL)))))
                                                                         ("2"
                                                                          (ASSERT)
                                                                          (("2"
                                                                            (TYPEPRED
                                                                             "w!1")
                                                                            (("2"
                                                                              (EXPAND
                                                                               "walk?")
                                                                              (("2"
                                                                                (FLATTEN)
                                                                                (("2"
                                                                                  (HIDE
                                                                                   -2)
                                                                                  (("2"
                                                                                    (EXPAND
                                                                                     "verts_in?")
                                                                                    (("2"
                                                                                      (HIDE
                                                                                       -12)
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "del_vert")
                                                                                        (("2"
                                                                                          (EXPAND
                                                                                           "remove")
                                                                                          (("2"
                                                                                            (EXPAND
                                                                                             "member")
                                                                                            (("2"
                                                                                              (SKOSIMP*)
                                                                                              (("2"
                                                                                                (INST?)
                                                                                                (("2"
                                                                                                  (FLATTEN)
                                                                                                  (("2"
                                                                                                    (PROPAX)
                                                                                                    NIL)))))))))))))))))))))))))))))))))))))
                                                               ("2"
                                                                (TYPEPRED
                                                                 "w!1")
                                                                (("2"
                                                                  (EXPAND
                                                                   "walk?")
                                                                  (("2"
                                                                    (EXPAND
                                                                     "verts_in?")
                                                                    (("2"
                                                                      (FLATTEN)
                                                                      (("2"
                                                                        (SKOSIMP*)
                                                                        (("2"
                                                                          (CASE-REPLACE
                                                                           "n!1 = 0")
                                                                          (("1"
                                                                            (ASSERT)
                                                                            (("1"
                                                                              (EXPAND
                                                                               "edge?")
                                                                              (("1"
                                                                                (REPLACE
                                                                                 -6)
                                                                                (("1"
                                                                                  (REWRITE
                                                                                   "dbl_comm")
                                                                                  (("1"
                                                                                    (ASSERT)
                                                                                    NIL)))))))))
                                                                           ("2"
                                                                            (LIFT-IF)
                                                                            (("2"
                                                                              (ASSERT)
                                                                              (("2"
                                                                                (INST
                                                                                 -2
                                                                                 "n!1-1")
                                                                                (("2"
                                                                                  (ASSERT)
                                                                                  (("2"
                                                                                    (EXPAND
                                                                                     "edge?")
                                                                                    (("2"
                                                                                      (FLATTEN)
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "fseq")
                                                                                        (("2"
                                                                                          (ASSERT)
                                                                                          (("2"
                                                                                            (EXPAND
                                                                                             "del_vert"
                                                                                             -2)
                                                                                            (("2"
                                                                                              (PROPAX)
                                                                                              NIL)))))))))))))))))))))))))))))))))))))))))))))))))
                                             ("2"
                                              (PROP)
                                              (("1"
                                                (EXPAND "o ")
                                                (("1"
                                                  (EXPAND "gen_seq1")
                                                  (("1" (ASSERT) NIL)))))
                                               ("2"
                                                (HIDE -8 -9)
                                                (("2"
                                                  (EXPAND "gen_seq1")
                                                  (("2"
                                                    (EXPAND "walk?")
                                                    (("2"
                                                      (EXPAND "verts_in?")
                                                      (("2"
                                                        (PROP)
                                                        (("1"
                                                          (SKOSIMP*)
                                                          (("1"
                                                            (ASSERT)
                                                            (("1"
                                                              (EXPAND "o ")
                                                              (("1"
                                                                (GROUND)
                                                                (("1"
                                                                  (TYPEPRED
                                                                   "w!1")
                                                                  (("1"
                                                                    (EXPAND
                                                                     "walk?")
                                                                    (("1"
                                                                      (FLATTEN)
                                                                      (("1"
                                                                        (HIDE
                                                                         -2
                                                                         -4
                                                                         -5
                                                                         -6)
                                                                        (("1"
                                                                          (EXPAND
                                                                           "verts_in?")
                                                                          (("1"
                                                                            (INST?)
                                                                            (("1"
                                                                              (EXPAND
                                                                               "del_vert")
                                                                              (("1"
                                                                                (EXPAND
                                                                                 "remove")
                                                                                (("1"
                                                                                  (EXPAND
                                                                                   "member")
                                                                                  (("1"
                                                                                    (PROPAX)
                                                                                    NIL)))))))
                                                                             ("2"
                                                                              (ASSERT)
                                                                              (("2"
                                                                                (TYPEPRED
                                                                                 "i!1")
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "o ")
                                                                                  (("2"
                                                                                    (ASSERT)
                                                                                    NIL)))))))))))))))))))))))))))
                                                         ("2"
                                                          (SKOSIMP*)
                                                          (("2"
                                                            (EXPAND "fseq")
                                                            (("2"
                                                              (EXPAND "o ")
                                                              (("2"
                                                                (CASE-REPLACE
                                                                 "n!1 = 0")
                                                                (("1"
                                                                  (EXPAND
                                                                   "walk_from?")
                                                                  (("1"
                                                                    (FLATTEN)
                                                                    (("1"
                                                                      (LIFT-IF)
                                                                      (("1"
                                                                        (ASSERT)
                                                                        (("1"
                                                                          (REPLACE
                                                                           -3)
                                                                          (("1"
                                                                            (EXPAND
                                                                             "edge?")
                                                                            (("1"
                                                                              (REWRITE
                                                                               "dbl_comm")
                                                                              (("1"
                                                                                (ASSERT)
                                                                                NIL)))))))))))))))
                                                                 ("2"
                                                                  (TYPEPRED
                                                                   "w!1")
                                                                  (("2"
                                                                    (EXPAND
                                                                     "walk?")
                                                                    (("2"
                                                                      (EXPAND
                                                                       "verts_in?")
                                                                      (("2"
                                                                        (FLATTEN)
                                                                        (("2"
                                                                          (INST
                                                                           -2
                                                                           "n!1-1")
                                                                          (("1"
                                                                            (ASSERT)
                                                                            (("1"
                                                                              (EXPAND
                                                                               "fseq")
                                                                              (("1"
                                                                                (EXPAND
                                                                                 "edge?")
                                                                                (("1"
                                                                                  (FLATTEN)
                                                                                  (("1"
                                                                                    (ASSERT)
                                                                                    (("1"
                                                                                      (LEMMA
                                                                                       "edges_del_vert")
                                                                                      (("1"
                                                                                        (INST?)
                                                                                        (("1"
                                                                                          (ASSERT)
                                                                                          NIL)
                                                                                         ("2"
                                                                                          (INST?)
                                                                                          (("2"
                                                                                            (ASSERT)
                                                                                            NIL)))))))))))))))))
                                                                           ("2"
                                                                            (ASSERT)
                                                                            NIL)))))))))))))))))))))))))))))))))))))))
                                     ("2" (REWRITE "size_del_vert")
                                      (("2" (ASSERT) NIL)))))))))))
                             ("2" (HIDE -6 -7 5)
                              (("2" (EXPAND "del_vert")
                                (("2" (EXPAND "remove")
                                  (("2" (EXPAND "member")
                                    (("2" (ASSERT)
                                      NIL)))))))))))))))))))))))))))))))))))))
 (|tree_has_walk| "" (INDUCT "TR" 1 "graph_induction_vert")
  (("" (SKOSIMP*)
    (("" (HIDE -1)
      (("" (EXPAND "tree?")
        (("" (SPLIT)
          (("1" (REWRITE "card_one[T]")
            (("1" (SKOSIMP*)
              (("1" (REPLACE -1)
                (("1" (HIDE -1) (("1" (HIDE 2) (("1" (GRIND) NIL)))))))))))
           ("2" (SKOSIMP*)
            (("2" (CASE-REPLACE "x!1 =v!1")
              (("1" (REVEAL -1)
                (("1" (LEMMA "thw_A")
                  (("1" (INST -1 "G!1" "v!1" "y!1")
                    (("1" (REPLACE -2)
                      (("1" (HIDE -2) (("1" (ASSERT) NIL)))))))))))
               ("2" (CASE-REPLACE "y!1 = v!1")
                (("1" (LEMMA "thw_A")
                  (("1" (INST -1 "G!1" "v!1" "x!1")
                    (("1" (REVEAL -2)
                      (("1" (REPLACE -1)
                        (("1" (HIDE -1)
                          (("1" (ASSERT)
                            (("1" (SKOSIMP*)
                              (("1" (LEMMA "walk?_reverse")
                                (("1" (INST?)
                                  (("1" (ASSERT) NIL)))))))))))))))))))
                 ("2" (REVEAL -1)
                  (("2" (INST?)
                    (("2" (SPLIT -1)
                      (("1" (INST -1 "x!1" "y!1")
                        (("1" (ASSERT)
                          (("1" (SPLIT -1)
                            (("1" (SKOSIMP*)
                              (("1" (INST 4 "w!1")
                                (("1" (EXPAND "walk_from?")
                                  (("1" (FLATTEN)
                                    (("1" (ASSERT)
                                      (("1"
                                        (TYPEPRED "w!1")
                                        (("1"
                                          (LEMMA "walk?_del_vert")
                                          (("1"
                                            (INST?)
                                            (("1" (ASSERT) NIL)))))))))))))
                                 ("2" (LEMMA "walk?_del_vert")
                                  (("2" (INST?)
                                    (("2" (INST?)
                                      (("2" (ASSERT) NIL)))))))))))
                             ("2" (HIDE -1 -2 5)
                              (("2" (EXPAND "del_vert")
                                (("2" (EXPAND "remove")
                                  (("2" (EXPAND "member")
                                    (("2" (PROPAX) NIL)))))))))
                             ("3" (HIDE -1 -2 5)
                              (("3" (EXPAND "del_vert")
                                (("3" (EXPAND "remove")
                                  (("3" (EXPAND "member")
                                    (("3" (PROPAX) NIL)))))))))))))))
                       ("2" (REWRITE "size_del_vert")
                        (("2" (ASSERT) NIL)))))))))))))))))))))))))
 (|path_implies_conn| "" (INDUCT "G" 1 "graph_induction_vert")
  (("" (SKOSIMP*)
    (("" (CASE "(FORALL v: vert(G!1)(v) IMPLIES deg(v,G!1) > 0)")
      (("1" (HIDE -2)
        (("1" (EXPAND "connected?")
          (("1" (FLATTEN)
            (("1" (CASE "nonempty?(vert(G!1))")
              (("1" (NAME "MTR" "max_subtree(G!1)")
                (("1" (LEMMA "max_tree_all_verts")
                  (("1" (ASSERT)
                    (("1" (INST?)
                      (("1" (ASSERT)
                        (("1" (CASE "tree?(MTR)")
                          (("1" (EXPAND "tree?" -1)
                            (("1" (SPLIT)
                              (("1" (EXPAND "singleton?")
                                (("1" (EXPAND "size") (("1" (ASSERT) NIL)))))
                               ("2" (SKOSIMP*)
                                (("2" (NAME "TC" "del_vert(MTR,v!1)")
                                  (("2" (REPLACE -1)
                                    (("2" (INST 2 "v!1")
                                      (("2"
                                        (SPLIT 2)
                                        (("1"
                                          (HIDE -4 -7 -8 -9 2)
                                          (("1"
                                            (HIDE -4)
                                            (("1"
                                              (EXPAND "deg")
                                              (("1"
                                                (CASE
                                                 "subset?(incident_edges(v!1, MTR),incident_edges(v!1, G!1))")
                                                (("1"
                                                  (LEMMA "card_subset[Dbl]")
                                                  (("1"
                                                    (INST?)
                                                    (("1" (ASSERT) NIL)))))
                                                 ("2"
                                                  (HIDE -2 2)
                                                  (("2"
                                                    (EXPAND "subset?")
                                                    (("2"
                                                      (SKOSIMP*)
                                                      (("2"
                                                        (EXPAND "member")
                                                        (("2"
                                                          (EXPAND
                                                           "incident_edges")
                                                          (("2"
                                                            (ASSERT)
                                                            (("2"
                                                              (REVEAL -2)
                                                              (("2"
                                                                (LEMMA
                                                                 "max_subtree_subgraph")
                                                                (("2"
                                                                  (INST?)
                                                                  (("2"
                                                                    (REPLACE
                                                                     -2)
                                                                    (("2"
                                                                      (HIDE
                                                                       -2)
                                                                      (("2"
                                                                        (EXPAND
                                                                         "subgraph?")
                                                                        (("2"
                                                                          (FLATTEN)
                                                                          (("2"
                                                                            (HIDE
                                                                             -1)
                                                                            (("2"
                                                                              (EXPAND
                                                                               "subset?")
                                                                              (("2"
                                                                                (INST?)
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "member")
                                                                                  (("2"
                                                                                    (ASSERT)
                                                                                    NIL)))))))))))))))))))))))))))))))))))))))))))
                                         ("2"
                                          (REVEAL -2)
                                          (("2"
                                            (INST -1 "del_vert(G!1, v!1)")
                                            (("2"
                                              (SPLIT -1)
                                              (("1" (PROPAX) NIL)
                                               ("2"
                                                (LEMMA "max_tree_all_verts")
                                                (("2"
                                                  (INST?)
                                                  (("2"
                                                    (ASSERT)
                                                    (("2"
                                                      (HIDE -8)
                                                      (("2"
                                                        (EXPAND
                                                         "path_connected?")
                                                        (("2"
                                                          (PROP)
                                                          (("1"
                                                            (HIDE 1)
                                                            (("1"
                                                              (HIDE
                                                               -2
                                                               -3
                                                               -4
                                                               -5
                                                               -6
                                                               -7
                                                               -9)
                                                              (("1"
                                                                (EXPAND
                                                                 "empty?")
                                                                (("1"
                                                                  (LEMMA
                                                                   "card_empty?[T]")
                                                                  (("1"
                                                                    (INST?)
                                                                    (("1"
                                                                      (ASSERT)
                                                                      (("1"
                                                                        (IFF)
                                                                        (("1"
                                                                          (ASSERT)
                                                                          (("1"
                                                                            (HIDE
                                                                             -2)
                                                                            (("1"
                                                                              (EXPAND
                                                                               "del_vert")
                                                                              (("1"
                                                                                (REWRITE
                                                                                 "card_remove")
                                                                                (("1"
                                                                                  (EXPAND
                                                                                   "singleton?")
                                                                                  (("1"
                                                                                    (EXPAND
                                                                                     "size")
                                                                                    (("1"
                                                                                      (ASSERT)
                                                                                      NIL)))))))))))))))))))))))))))
                                                           ("2"
                                                            (SKOSIMP*)
                                                            (("2"
                                                              (LEMMA
                                                               "tree_has_walk")
                                                              (("2"
                                                                (INST
                                                                 -1
                                                                 "TC"
                                                                 "x!1"
                                                                 "y!1")
                                                                (("2"
                                                                  (EXPAND
                                                                   "walk_from?")
                                                                  (("2"
                                                                    (SPLIT -1)
                                                                    (("1"
                                                                      (SKOSIMP*)
                                                                      (("1"
                                                                        (INST
                                                                         1
                                                                         "w!1")
                                                                        (("1"
                                                                          (ASSERT)
                                                                          NIL)
                                                                         ("2"
                                                                          (HIDE
                                                                           -5
                                                                           -9
                                                                           2
                                                                           3)
                                                                          (("2"
                                                                            (TYPEPRED
                                                                             "w!1")
                                                                            (("2"
                                                                              (REPLACE
                                                                               -5
                                                                               *
                                                                               RL)
                                                                              (("2"
                                                                                (HIDE
                                                                                 -5)
                                                                                (("2"
                                                                                  (REPLACE
                                                                                   -7
                                                                                   *
                                                                                   RL)
                                                                                  (("2"
                                                                                    (HIDE
                                                                                     -7)
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "walk?")
                                                                                      (("2"
                                                                                        (FLATTEN)
                                                                                        (("2"
                                                                                          (SPLIT
                                                                                           1)
                                                                                          (("1"
                                                                                            (HIDE
                                                                                             -2)
                                                                                            (("1"
                                                                                              (EXPAND
                                                                                               "verts_in?")
                                                                                              (("1"
                                                                                                (EXPAND
                                                                                                 "del_vert")
                                                                                                (("1"
                                                                                                  (SKOSIMP*)
                                                                                                  (("1"
                                                                                                    (INST?)
                                                                                                    (("1"
                                                                                                      (EXPAND
                                                                                                       "remove")
                                                                                                      (("1"
                                                                                                        (EXPAND
                                                                                                         "member")
                                                                                                        (("1"
                                                                                                          (FLATTEN)
                                                                                                          (("1"
                                                                                                            (ASSERT)
                                                                                                            NIL)))))))))))))))))
                                                                                           ("2"
                                                                                            (SKOSIMP*)
                                                                                            (("2"
                                                                                              (INST?)
                                                                                              (("2"
                                                                                                (ASSERT)
                                                                                                (("2"
                                                                                                  (EXPAND
                                                                                                   "edge?")
                                                                                                  (("2"
                                                                                                    (FLATTEN)
                                                                                                    (("2"
                                                                                                      (TYPEPRED
                                                                                                       "max_subtree(G!1)")
                                                                                                      (("2"
                                                                                                        (HIDE
                                                                                                         -2
                                                                                                         -3)
                                                                                                        (("2"
                                                                                                          (EXPAND
                                                                                                           "subgraph?")
                                                                                                          (("2"
                                                                                                            (FLATTEN)
                                                                                                            (("2"
                                                                                                              (HIDE
                                                                                                               -1)
                                                                                                              (("2"
                                                                                                                (EXPAND
                                                                                                                 "subset?")
                                                                                                                (("2"
                                                                                                                  (EXPAND
                                                                                                                   "member")
                                                                                                                  (("2"
                                                                                                                    (INST?)
                                                                                                                    (("1"
                                                                                                                      (HIDE
                                                                                                                       -3)
                                                                                                                      (("1"
                                                                                                                        (EXPAND
                                                                                                                         "del_vert")
                                                                                                                        (("1"
                                                                                                                          (FLATTEN)
                                                                                                                          (("1"
                                                                                                                            (ASSERT)
                                                                                                                            NIL)))))))
                                                                                                                     ("2"
                                                                                                                      (INST?)
                                                                                                                      (("2"
                                                                                                                        (ASSERT)
                                                                                                                        NIL)))))))))))))))))))))))))))))))))))))))))))))))))))
                                                                     ("2"
                                                                      (TYPEPRED
                                                                       "x!1")
                                                                      (("2"
                                                                        (HIDE
                                                                         -3)
                                                                        (("2"
                                                                          (HIDE
                                                                           2
                                                                           3
                                                                           4)
                                                                          (("2"
                                                                            (REPLACE
                                                                             -2
                                                                             *
                                                                             RL)
                                                                            (("2"
                                                                              (EXPAND
                                                                               "del_vert"
                                                                               1)
                                                                              (("2"
                                                                                (EXPAND
                                                                                 "remove")
                                                                                (("2"
                                                                                  (EXPAND
                                                                                   "member")
                                                                                  (("2"
                                                                                    (ASSERT)
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "del_vert"
                                                                                       -1)
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "remove")
                                                                                        (("2"
                                                                                          (EXPAND
                                                                                           "member")
                                                                                          (("2"
                                                                                            (FLATTEN)
                                                                                            (("2"
                                                                                              (ASSERT)
                                                                                              NIL)))))))))))))))))))))))))
                                                                     ("3"
                                                                      (TYPEPRED
                                                                       "y!1")
                                                                      (("3"
                                                                        (HIDE
                                                                         -4
                                                                         -7
                                                                         -8
                                                                         2
                                                                         3
                                                                         4)
                                                                        (("3"
                                                                          (REPLACE
                                                                           -2
                                                                           *
                                                                           RL)
                                                                          (("3"
                                                                            (HIDE
                                                                             -2)
                                                                            (("3"
                                                                              (EXPAND
                                                                               "del_vert")
                                                                              (("3"
                                                                                (EXPAND
                                                                                 "remove")
                                                                                (("3"
                                                                                  (EXPAND
                                                                                   "member")
                                                                                  (("3"
                                                                                    (FLATTEN)
                                                                                    (("3"
                                                                                      (ASSERT)
                                                                                      NIL)))))))))))))))))
                                                                     ("4"
                                                                      (ASSERT)
                                                                      (("4"
                                                                        (INST
                                                                         2
                                                                         "gen_seq1(del_vert(G!1,v!1),y!1)")
                                                                        (("1"
                                                                          (EXPAND
                                                                           "gen_seq1")
                                                                          (("1"
                                                                            (PROPAX)
                                                                            NIL)))
                                                                         ("2"
                                                                          (LEMMA
                                                                           "gen_seq1_is_walk")
                                                                          (("2"
                                                                            (INST?)
                                                                            (("2"
                                                                              (FLATTEN)
                                                                              (("2"
                                                                                (ASSERT)
                                                                                NIL)))))))))))))))))))))))))))))))))
                                               ("3"
                                                (REWRITE "size_del_vert")
                                                (("3"
                                                  (ASSERT)
                                                  NIL)))))))))))))))))))))))
                           ("2" (ASSERT) NIL)))))))))))
                 ("2" (PROPAX) NIL)))
               ("2" (EXPAND "nonempty?")
                (("2" (EXPAND "path_connected?" -3)
                  (("2" (FLATTEN)
                    (("2" (EXPAND "empty?" 1)
                      (("2" (PROPAX) NIL)))))))))))))))))
       ("2" (SKOSIMP*)
        (("2" (LEMMA "pic_A")
          (("2" (INST?)
            (("2" (ASSERT)
              (("2" (INST 1 "v!1") (("2" (ASSERT) NIL))))))))))))))))))
$$$graph_piece_path.pvs
graph_piece_path[T: TYPE]: THEORY
BEGIN
   IMPORTING graph_conn_defs[T], walks[T], subgraphs[T]
   G,H1,H2: VAR graph[T]
   VV: VAR set[T]
   union_edge_disj: LEMMA NOT (EXISTS (u, w: T): vert(H1)(u) AND vert(H2)(w)
                                           AND u /= w
                                           AND edges(G)(edg[T](u, w)))
                              AND H1 = subgraph(G,VV)
                              AND H2 = subgraph(G,difference(vert(G),VV))
                           IMPLIES
                              G = union(H1,H2)
   piece_implies_path: THEOREM piece_connected?(G) IMPLIES path_connected?(G)
END graph_piece_path
$$$graph_piece_path.prf
(|graph_piece_path| (|union_edge_disj_TCC1| "" (SUBTYPE-TCC) NIL)
 (|union_edge_disj| "" (SKOSIMP*)
  (("" (APPLY-EXTENSIONALITY 2 :HIDE? T)
    (("1" (APPLY-EXTENSIONALITY 1 :HIDE? T)
      (("1" (IFF 1)
        (("1" (PROP)
          (("1" (REPLACE -2)
            (("1" (HIDE -2)
              (("1" (REPLACE -2)
                (("1" (HIDE -2)
                  (("1" (EXPAND "union")
                    (("1" (EXPAND "union")
                      (("1" (EXPAND "member")
                        (("1" (EXPAND "subgraph")
                          (("1" (ASSERT)
                            (("1" (EXPAND "difference")
                              (("1" (EXPAND "member")
                                (("1" (SKOSIMP*)
                                  (("1" (TYPEPRED "G!1")
                                    (("1" (INST?)
                                      (("1" (ASSERT)
                                        (("1" (INST-CP -1 "x!2")
                                          (("1" (INST -1 "x!3")
                                            (("1" (ASSERT)
                                              (("1" (CASE-REPLACE "x!2 = x!3")
                                                (("1"
                                                  (LEMMA "edge_has_2_verts")
                                                  (("1"
                                                    (INST -1 "x!1" "x!2" "x!3")
                                                    (("1"
                                                      (ASSERT)
                                                      (("1"
                                                        (INST 3 "x!3" "x!2")
                                                        (("1"
                                                          (GROUND)
                                                          (("1"
                                                            (EXPAND "edg")
                                                            (("1"
                                                              (ASSERT)
                                                              NIL)))))))))))))))))))))))))))))))))))))))))))))))))))
           ("2" (EXPAND "union")
            (("2" (EXPAND "union")
              (("2" (EXPAND "member")
                (("2" (PROP)
                  (("1" (REPLACE -2) (("1" (EXPAND "subgraph") (("1" (ASSERT) NIL)))))
                   ("2" (REPLACE -3)
                    (("2" (EXPAND "subgraph") (("2" (ASSERT) NIL)))))))))))))))))))
     ("2" (HIDE 2)
      (("2" (REPLACE -1)
        (("2" (HIDE -1)
          (("2" (REPLACE -1)
            (("2" (HIDE -1)
              (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T) (("2" (GRIND) NIL)))))))))))))))))
 (|piece_implies_path| "" (SKOSIMP*)
  (("" (CASE "empty?(G!1)")
    (("1" (EXPAND "piece_connected?") (("1" (FLATTEN) (("1" (PROPAX) NIL)))))
     ("2" (EXPAND "empty?")
      (("2" (EXPAND "empty?")
        (("2" (EXPAND "member")
          (("2" (SKOSIMP*)
            (("2"
              (NAME "V"
                    "{u: T | (EXISTS (w: Walk(G!1)): w(0) = u AND w(l(w)-1) = x!1) OR u = x!1}")
              (("2" (NAME "H" "subgraph(G!1,V)")
                (("2" (NAME "W" "difference(vert(G!1),V)")
                  (("2" (NAME "K" "subgraph(G!1,W)")
                    (("2"
                      (CASE "(EXISTS (u,w:T): vert(H)(u) AND vert(K)(w) AND u /= w AND edges(G!1)(edg[T](u,w)))")
                      (("1" (SKOSIMP*)
                        (("1" (HIDE 1)
                          (("1" (EXPAND "piece_connected?")
                            (("1" (FLATTEN)
                              (("1" (INST -9 "K" "H")
                                (("1" (ASSERT)
                                  (("1" (SPLIT -9)
                                    (("1" (EXPAND "intersection")
                                      (("1" (EXPAND "empty?")
                                        (("1" (SKOSIMP*)
                                          (("1" (EXPAND "member")
                                            (("1" (FLATTEN)
                                              (("1" (HIDE -3 -4 -5 -9 -10 1)
                                                (("1"
                                                  (REPLACE -3 * RL)
                                                  (("1"
                                                    (HIDE -3)
                                                    (("1"
                                                      (REPLACE -3 * RL)
                                                      (("1"
                                                        (HIDE -3)
                                                        (("1"
                                                          (REPLACE -3 * RL)
                                                          (("1"
                                                            (HIDE -3)
                                                            (("1"
                                                              (GRIND)
                                                              NIL)))))))))))))))))))))))))
                                     ("2" (HIDE -8 1 2)
                                      (("2" (CASE "V(u!1)")
                                        (("1" (CASE "V(w!1)")
                                          (("1" (HIDE -5 -8 -9)
                                            (("1" (EXPAND "difference")
                                              (("1" (REPLACE -6 * RL)
                                                (("1"
                                                  (EXPAND "subgraph")
                                                  (("1"
                                                    (REPLACE -5 * RL)
                                                    (("1"
                                                      (ASSERT)
                                                      (("1"
                                                        (HIDE -5 -6)
                                                        (("1"
                                                          (EXPAND "member")
                                                          (("1"
                                                            (PROPAX)
                                                            NIL)))))))))))))))))
                                           ("2" (HIDE -2 -6 -7)
                                            (("2" (REPLACE -4 * RL)
                                              (("2" (HIDE -4)
                                                (("2"
                                                  (EXPAND "subgraph")
                                                  (("2"
                                                    (FLATTEN)
                                                    (("2"
                                                      (REPLACE -5 * RL)
                                                      (("2"
                                                        (HIDE -5)
                                                        (("2"
                                                          (BETA)
                                                          (("2"
                                                            (FLATTEN)
                                                            (("2"
                                                              (SPLIT -1)
                                                              (("1"
                                                                (SKOSIMP*)
                                                                (("1"
                                                                  (EXPAND "fseq")
                                                                  (("1"
                                                                    (CASE-REPLACE
                                                                     "u!1 = w!1")
                                                                    (("1"
                                                                      (INST 1 "w!2")
                                                                      (("1"
                                                                        (ASSERT)
                                                                        NIL)))
                                                                     ("2"
                                                                      (INST
                                                                       +
                                                                       "gen_seq1(G!1,w!1) o w!2")
                                                                      (("1"
                                                                        (EXPAND "o ")
                                                                        (("1"
                                                                          (EXPAND
                                                                           "gen_seq1")
                                                                          (("1"
                                                                            (PROPAX)
                                                                            NIL)))))
                                                                       ("2"
                                                                        (LEMMA
                                                                         "walk_concat_edge")
                                                                        (("2"
                                                                          (INST
                                                                           -
                                                                           "G!1"
                                                                           "w!1"
                                                                           "u!1"
                                                                           "w!1"
                                                                           "x!1"
                                                                           "gen_seq1[T](G!1, w!1)"
                                                                           "w!2")
                                                                          (("2"
                                                                            (EXPAND
                                                                             "walk_from?")
                                                                            (("2"
                                                                              (ASSERT)
                                                                              (("2"
                                                                                (SPLIT
                                                                                 +)
                                                                                (("1"
                                                                                  (ASSERT)
                                                                                  (("1"
                                                                                    (HIDE
                                                                                     -1)
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "o ")
                                                                                      (("1"
                                                                                        (EXPAND
                                                                                         "gen_seq1")
                                                                                        (("1"
                                                                                          (ASSERT)
                                                                                          NIL)))))))))
                                                                                 ("2"
                                                                                  (ASSERT)
                                                                                  (("2"
                                                                                    (HIDE
                                                                                     1)
                                                                                    (("2"
                                                                                      (EXPAND
                                                                                       "edg")
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "edge?")
                                                                                        (("2"
                                                                                          (REWRITE
                                                                                           "dbl_comm")
                                                                                          (("2"
                                                                                            (ASSERT)
                                                                                            (("2"
                                                                                              (REWRITE
                                                                                               "gen_seq1_is_walk")
                                                                                              (("2"
                                                                                                (EXPAND
                                                                                                 "gen_seq1")
                                                                                                (("2"
                                                                                                  (PROPAX)
                                                                                                  NIL)))))))))))))))))))))))))))))))))))
                                                               ("2"
                                                                (REPLACE -1)
                                                                (("2"
                                                                  (HIDE -1)
                                                                  (("2"
                                                                    (EXPAND "fseq")
                                                                    (("2"
                                                                      (INST
                                                                       +
                                                                       "gen_seq2(G!1,w!1,x!1)")
                                                                      (("1"
                                                                        (EXPAND
                                                                         "gen_seq2")
                                                                        (("1"
                                                                          (PROPAX)
                                                                          NIL)))
                                                                       ("2"
                                                                        (LEMMA
                                                                         "edge_to_walk")
                                                                        (("2"
                                                                          (INST?)
                                                                          (("2"
                                                                            (ASSERT)
                                                                            (("2"
                                                                              (EXPAND
                                                                               "edg")
                                                                              (("2"
                                                                                (REWRITE
                                                                                 "dbl_comm")
                                                                                NIL)))))))))))))))))))))))))))))))))))))))
                                         ("2" (HIDE -2 -3 -4 -5 -7)
                                          (("2" (EXPAND "subgraph")
                                            (("2" (REPLACE -2 * RL)
                                              (("2" (HIDE -2)
                                                (("2" (ASSERT) NIL)))))))))))))
                                     ("3" (EXPAND "empty?")
                                      (("3" (EXPAND "empty?")
                                        (("3" (INST -1 "w!1")
                                          (("3" (EXPAND "member")
                                            (("3" (PROPAX) NIL)))))))))
                                     ("4" (EXPAND "empty?")
                                      (("4" (EXPAND "empty?")
                                        (("4" (INST -1 "u!1")
                                          (("4" (EXPAND "member")
                                            (("4" (PROPAX) NIL)))))))))))))))))))))))
                       ("2" (HIDE 2)
                        (("2" (LEMMA "union_edge_disj")
                          (("2"
                            (INST -1 "G!1" "subgraph(G!1, V)" "subgraph(G!1, W)" "V")
                            (("2" (ASSERT)
                              (("2" (REPLACE -2)
                                (("2" (REPLACE -4)
                                  (("2" (ASSERT)
                                    (("2" (HIDE 1)
                                      (("2" (EXPAND "piece_connected?")
                                        (("2" (PROP)
                                          (("2" (INST -7 "H" "K")
                                            (("2" (ASSERT)
                                              (("2" (SPLIT -7)
                                                (("1"
                                                  (HIDE -1 -6 2)
                                                  (("1"
                                                    (REPLACE -1 * RL)
                                                    (("1"
                                                      (HIDE -1)
                                                      (("1"
                                                        (REPLACE -1 * RL)
                                                        (("1"
                                                          (HIDE -1)
                                                          (("1"
                                                            (REPLACE -1 * RL)
                                                            (("1"
                                                              (HIDE -1)
                                                              (("1"
                                                                (REPLACE -1 * RL)
                                                                (("1"
                                                                  (HIDE -1)
                                                                  (("1"
                                                                    (GRIND)
                                                                    NIL)))))))))))))))))))
                                                 ("2"
                                                  (REPLACE -5 * RL)
                                                  (("2"
                                                    (EXPAND "empty?")
                                                    (("2"
                                                      (HIDE -2 -3 -4 -5)
                                                      (("2"
                                                        (REPLACE -2 * RL)
                                                        (("2"
                                                          (HIDE -2)
                                                          (("2"
                                                            (EXPAND "subgraph")
                                                            (("2"
                                                              (EXPAND "empty?")
                                                              (("2"
                                                                (INST -1 "x!1")
                                                                (("2"
                                                                  (EXPAND "member")
                                                                  (("2"
                                                                    (PROPAX)
                                                                    NIL)))))))))))))))))))
                                                 ("3"
                                                  (HIDE -7)
                                                  (("3"
                                                    (REVEAL 2)
                                                    (("3"
                                                      (EXPAND "path_connected?")
                                                      (("3"
                                                        (SKOSIMP*)
                                                        (("3"
                                                          (CASE
                                                           "vert(K)(x!2) OR vert(K)(y!1)")
                                                          (("1"
                                                            (HIDE -3 -4 -5 -6 -7 1 2 3)
                                                            (("1" (GRIND) NIL)))
                                                           ("2"
                                                            (CASE
                                                             "vert(H)(x!2) AND vert(H)(y!1)")
                                                            (("1"
                                                              (FLATTEN)
                                                              (("1"
                                                                (HIDE -3 -4 -5 -6 1 2)
                                                                (("1"
                                                                  (REPLACE -4 * RL)
                                                                  (("1"
                                                                    (HIDE -4)
                                                                    (("1"
                                                                      (REPLACE -3 * RL)
                                                                      (("1"
                                                                        (HIDE -3)
                                                                        (("1"
                                                                          (EXPAND
                                                                           "subgraph")
                                                                          (("1"
                                                                            (CASE-REPLACE
                                                                             "x!2 = x!1")
                                                                            (("1"
                                                                              (CASE-REPLACE
                                                                               "y!1 = x!1")
                                                                              (("1"
                                                                                (ASSERT)
                                                                                (("1"
                                                                                  (INST
                                                                                   1
                                                                                   "gen_seq1(G!1,x!1)")
                                                                                  (("1"
                                                                                    (EXPAND
                                                                                     "gen_seq1")
                                                                                    (("1"
                                                                                      (PROPAX)
                                                                                      NIL)))
                                                                                   ("2"
                                                                                    (LEMMA
                                                                                     "gen_seq1_is_walk")
                                                                                    (("2"
                                                                                      (INST?)
                                                                                      (("2"
                                                                                        (ASSERT)
                                                                                        NIL)))))))))
                                                                               ("2"
                                                                                (ASSERT)
                                                                                (("2"
                                                                                  (SKOSIMP*)
                                                                                  (("2"
                                                                                    (ASSERT)
                                                                                    (("2"
                                                                                      (HIDE
                                                                                       -1
                                                                                       -2)
                                                                                      (("2"
                                                                                        (EXPAND
                                                                                         "fseq")
                                                                                        (("2"
                                                                                          (INST
                                                                                           +
                                                                                           "rev(w!1)")
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "rev")
                                                                                            (("1"
                                                                                              (ASSERT)
                                                                                              NIL)))
                                                                                           ("2"
                                                                                            (REWRITE
                                                                                             "walk?_rev")
                                                                                            (("2"
                                                                                              (EXPAND
                                                                                               "rev")
                                                                                              (("2"
                                                                                                (PROPAX)
                                                                                                NIL)))))))))))))))))))
                                                                             ("2"
                                                                              (GROUND)
                                                                              (("1"
                                                                                (SKOSIMP*)
                                                                                (("1"
                                                                                  (EXPAND
                                                                                   "fseq")
                                                                                  (("1"
                                                                                    (CASE
                                                                                     "y!1 = x!2")
                                                                                    (("1"
                                                                                      (REPLACE
                                                                                       -1)
                                                                                      (("1"
                                                                                        (HIDE
                                                                                         -1)
                                                                                        (("1"
                                                                                          (INST
                                                                                           +
                                                                                           "gen_seq1(G!1,x!2)")
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "gen_seq1")
                                                                                            (("1"
                                                                                              (PROPAX)
                                                                                              NIL)))
                                                                                           ("2"
                                                                                            (REWRITE
                                                                                             "gen_seq1_is_walk")
                                                                                            NIL)))))))
                                                                                     ("2"
                                                                                      (LEMMA
                                                                                       "walk_concat_exists")
                                                                                      (("2"
                                                                                        (INST
                                                                                         -1
                                                                                         "G!1"
                                                                                         "x!1"
                                                                                         "y!1"
                                                                                         "x!2"
                                                                                         "w!1"
                                                                                         "w!2")
                                                                                        (("2"
                                                                                          (EXPAND
                                                                                           "walk_from?")
                                                                                          (("2"
                                                                                            (ASSERT)
                                                                                            (("2"
                                                                                              (SKOSIMP*)
                                                                                              (("2"
                                                                                                (INST
                                                                                                 +
                                                                                                 "rev(w!3)")
                                                                                                (("1"
                                                                                                  (EXPAND
                                                                                                   "rev")
                                                                                                  (("1"
                                                                                                    (ASSERT)
                                                                                                    NIL)))
                                                                                                 ("2"
                                                                                                  (REWRITE
                                                                                                   "walk?_rev")
                                                                                                  (("2"
                                                                                                    (EXPAND
                                                                                                     "rev")
                                                                                                    (("2"
                                                                                                      (PROPAX)
                                                                                                      NIL)))))))))))))))))))))))
                                                                               ("2"
                                                                                (REPLACE
                                                                                 -1)
                                                                                (("2"
                                                                                  (HIDE
                                                                                   -1)
                                                                                  (("2"
                                                                                    (EXPAND
                                                                                     "fseq")
                                                                                    (("2"
                                                                                      (PROPAX)
                                                                                      NIL)))))))))))))))))))))))))
                                                             ("2"
                                                              (HIDE 3 4)
                                                              (("2"
                                                                (CASE
                                                                 "disjoint?(vert(H),vert(K))")
                                                                (("1"
                                                                  (HIDE -2 -3 -4 -5 -6)
                                                                  (("1"
                                                                    (EXPAND "disjoint?")
                                                                    (("1"
                                                                      (EXPAND
                                                                       "intersection")
                                                                      (("1"
                                                                        (EXPAND
                                                                         "empty?")
                                                                        (("1"
                                                                          (EXPAND
                                                                           "member")
                                                                          (("1"
                                                                            (INST-CP
                                                                             -1
                                                                             "x!2")
                                                                            (("1"
                                                                              (INST
                                                                               -1
                                                                               "y!1")
                                                                              (("1"
                                                                                (CASE
                                                                                 "vert(G!1) = union(vert(H),vert(K))")
                                                                                (("1"
                                                                                  (TYPEPRED
                                                                                   "y!1")
                                                                                  (("1"
                                                                                    (TYPEPRED
                                                                                     "x!2")
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "union")
                                                                                      (("1"
                                                                                        (EXPAND
                                                                                         "member")
                                                                                        (("1"
                                                                                          (REPLACE
                                                                                           -3)
                                                                                          (("1"
                                                                                            (HIDE
                                                                                             -3)
                                                                                            (("1"
                                                                                              (BETA)
                                                                                              (("1"
                                                                                                (FLATTEN)
                                                                                                (("1"
                                                                                                  (GROUND)
                                                                                                  NIL)))))))))))))))))
                                                                                 ("2"
                                                                                  (HIDE
                                                                                   -1
                                                                                   2
                                                                                   3
                                                                                   4
                                                                                   5
                                                                                   6)
                                                                                  (("2"
                                                                                    (REVEAL
                                                                                     -4)
                                                                                    (("2"
                                                                                      (REPLACE
                                                                                       -1)
                                                                                      (("2"
                                                                                        (HIDE
                                                                                         -1)
                                                                                        (("2"
                                                                                          (GRIND)
                                                                                          NIL)))))))))))))))))))))))))
                                                                 ("2"
                                                                  (HIDE -1 -2 -6 2 3 4)
                                                                  (("2"
                                                                    (REPLACE -1 * RL)
                                                                    (("2"
                                                                      (HIDE -1)
                                                                      (("2"
                                                                        (REPLACE
                                                                         -1
                                                                         *
                                                                         RL)
                                                                        (("2"
                                                                          (HIDE -1)
                                                                          (("2"
                                                                            (REPLACE
                                                                             -1
                                                                             *
                                                                             RL)
                                                                            (("2"
                                                                              (HIDE -1)
                                                                              (("2"
                                                                                (GRIND)
                                                                                NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))
                       ("3" (SKOSIMP*) (("3" (GROUND) NIL))))))))))))))))))))))))))
$$$graph_inductions.pvs
graph_inductions[T: TYPE]: THEORY
BEGIN
  IMPORTING graphs[T]
  G,GG,GGG: VAR graph[T]
  P: VAR pred[graph[T]]
  n: VAR nat
  size_prep              : LEMMA (FORALL G : P(G)) IFF
                                      (FORALL n, G : size(G) = n IMPLIES P(G))
  graph_induction_vert    : THEOREM (FORALL G:
                                (FORALL GG: size(GG) < size(G) IMPLIES P(GG))
                                                IMPLIES P(G))
                                  IMPLIES (FORALL G: P(G))
  graph_induction_vert_not: THEOREM (FORALL G: P(G)
                               IMPLIES
                             (EXISTS GG: size(GG) < size(G) AND
                                            P(GG)))
                           IMPLIES (FORALL G: NOT P(G))
  IMPORTING graph_ops[T]
  num_edges_prep         : LEMMA (FORALL G : P(G)) IFF
                                   (FORALL n, G : num_edges(G) = n IMPLIES P(G))
  graph_induction_edge   : THEOREM (FORALL G:
                          (FORALL GG: num_edges(GG) < num_edges(G) IMPLIES P(GG))
                                                IMPLIES P(G))
                                  IMPLIES (FORALL G: P(G))
END graph_inductions
$$$graph_inductions.prf
(|graph_inductions| (|size_prep| "" (GRIND) NIL)
 (|graph_induction_vert| "" (SKOSIMP)
  (("" (REWRITE "size_prep" +)
    (("" (INDUCT "n" 1 "NAT_induction")
      (("" (SKOSIMP*)
        (("" (INST -3 "G!1")
          (("" (SPLIT -3)
            (("1" (PROPAX) NIL)
             ("2" (SKOSIMP*)
              (("2" (INST -2 "size(GG!1)")
                (("2" (ASSERT)
                  (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))))
 (|graph_induction_vert_not| "" (SKOSIMP*)
  (("" (LEMMA "graph_induction_vert")
    (("" (INST -1 "(LAMBDA (GG: graph[T]): NOT P!1(GG))")
      (("" (BETA)
        (("" (PROP)
          (("1" (INST?) NIL)
           ("2" (SKOSIMP*)
            (("2" (INST -3 "G!2")
              (("2" (ASSERT)
                (("2" (SKOSIMP*)
                  (("2" (INST -1 "GG!1")
                    (("2" (ASSERT) NIL)))))))))))))))))))))
 (|num_edges_prep| "" (SKOSIMP*)
  (("" (PROP)
    (("1" (SKOSIMP*) (("1" (INST?) NIL)))
     ("2" (SKOSIMP*)
      (("2" (INST?)
        (("2" (ASSERT) (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))
 (|graph_induction_edge| "" (SKOSIMP)
  (("" (REWRITE "num_edges_prep" +)
    (("" (INDUCT "n" 1 "NAT_induction")
      (("" (SKOSIMP*)
        (("" (INST -3 "G!1")
          (("" (SPLIT -3)
            (("1" (PROPAX) NIL)
             ("2" (SKOSIMP*)
              (("2" (INST -2 "num_edges(GG!1)")
                (("2" (ASSERT)
                  (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))))
 (|graph_induction_both| "" (SKOSIMP*)
  (("" (INST?)
    (("" (PROP)
      (("1" (LEMMA "graph_induction_edge")
        (("1" (INST -1 "P!1")
          (("1" (SPLIT -1)
            (("1" (INST?) NIL) ("2" (SKOSIMP*) (("2" (POSTPONE) NIL)))))))))
       ("2" (POSTPONE) NIL))))))))
$$$graph_conn_piece.pvs
graph_conn_piece[T: TYPE]: THEORY
BEGIN
   IMPORTING graph_conn_defs[T]
   G,H1,H2: VAR graph[T]
   x,y,v: VAR T
%   piece_connected?(G): bool = NOT empty?(G) AND
%                               (FORALL H1,H2: G = union(H1,H2) AND
%                                         NOT empty?(H1) AND NOT empty?(H2)
%                                  IMPLIES NOT empty?(intersection(vert(H1),
%                                                                   vert(H2))))
   singleton_piece: LEMMA singleton?(G) IMPLIES
                              piece_connected?(G)
   not_piece_has_2: LEMMA NOT piece_connected?(G) IMPLIES empty?(G) OR
                            size(G) > 1
   e: VAR doubleton[T]
   vo: VAR T
   edge_not_across: LEMMA e(vo) AND vert(H1)(vo) AND
                          edges(union(H1, H2))(e) AND
                          empty?(intersection(vert(H1), vert(H2)))
                          IMPLIES  edges(H1)(e)
   lem1: LEMMA vert(H1)(vo) AND  empty?(intersection(vert(H1), vert(H2))) AND
           NOT empty?(H1) AND NOT empty?(H2)
          IMPLIES del_vert(union(H1, H2), vo) = union(del_vert(H1, vo), H2)
   H1P_not_empty: LEMMA vert(H1)(vo) AND
                         deg(vo, union(H1, H2)) > 0 AND
                         del_vert(G, vo) = union(del_vert(H1, vo), H2) AND
                         empty?(intersection(vert(H1), vert(H2))) AND
                         NOT empty?(H1) AND NOT empty?(H2) AND
                         NOT empty?(del_vert(G, vo))
                 IMPLIES NOT empty?(del_vert(H1, vo))
   cip0: LEMMA (FORALL (GG: graph[T]): size(GG) < size(G)
                       IMPLIES connected?(GG) IMPLIES piece_connected?(GG)) AND
               vert(H1)(vo) AND
               deg(vo, G) > 0 AND
               connected?(del_vert(G, vo)) AND
               G = union(H1, H2) AND
               empty?(intersection(vert(H1), vert(H2))) AND
      	       NOT empty?(H1) AND NOT empty?(H2)
             IMPLIES NOT empty?(intersection(vert(H1), vert(H2)))
   cip3: LEMMA (FORALL (GG: graph[T]): size(GG) < size(G)
                       IMPLIES connected?(GG) IMPLIES piece_connected?(GG)) AND
               deg(vo, G) > 0 AND
      	       connected?(del_vert(G, vo)) AND
      	       G = union(H1, H2) AND
      	       NOT empty?(H1) AND NOT empty?(H2) AND vert(G)(vo)
             IMPLIES NOT empty?(intersection(vert(H1), vert(H2)))
   connected_not_empty: LEMMA connected?(G) IMPLIES NOT empty?(G)
   IMPORTING graph_inductions[T]
   conn_implies_piece: LEMMA connected?(G) IMPLIES piece_connected?(G)
END graph_conn_piece
$$$graph_conn_piece.prf
(|graph_conn_piece|
 (|singleton_piece| "" (SKOSIMP*)
  (("" (EXPAND "piece_connected?")
    (("" (PROP)
      (("1" (REWRITE "empty?_rew")
        (("1" (EXPAND "singleton?")
          (("1" (EXPAND "size") (("1" (ASSERT) NIL)))))))
       ("2" (SKOSIMP*)
        (("2" (EXPAND "singleton?")
          (("2" (REPLACE -1)
            (("2" (HIDE -1)
              (("2" (EXPAND "empty?")
                (("2" (EXPAND "empty?")
                  (("2" (EXPAND "member")
                    (("2" (SKOSIMP*)
                      (("2" (EXPAND "intersection")
                        (("2" (EXPAND "member")
                          (("2" (INST-CP -3 "x!1")
                            (("2" (INST -3 "x!2")
                              (("2" (GROUND)
                                (("2" (EXPAND "size")
                                  (("2" (REWRITE "card_one[T]")
                                    (("2" (SKOSIMP*)
                                      (("2"
                                        (CASE
                                         "vert(union(H1!1, H2!1))(x!1) = singleton(x!3)(x!1)")
                                        (("1"
                                          (CASE
                                           "vert(union(H1!1, H2!1))(x!2) = singleton(x!3)(x!2)")
                                          (("1" (HIDE -5) (("1" (GRIND) NIL)))
                                           ("2" (ASSERT) NIL)))
                                         ("2"
                                          (ASSERT)
                                          NIL)))))))))))))))))))))))))))))))))))))))))
 (|not_piece_has_2| "" (SKOSIMP*)
  (("" (EXPAND "piece_connected?")
    (("" (PROP)
      (("" (SKOSIMP*)
        (("" (REWRITE "empty?_rew")
          (("" (REWRITE "empty?_rew")
            (("" (REWRITE "empty?_rew")
              (("" (EXPAND "empty?")
                (("" (EXPAND "size")
                  ((""
                    (CASE "card(vert(G!1)) >= card(vert(H1!1)) + card(vert(H2!1))")
                    (("1" (ASSERT) NIL)
                     ("2" (HIDE 2 3 4)
                      (("2" (REPLACE -1)
                        (("2" (HIDE -1)
                          (("2" (EXPAND "union")
                            (("2" (REWRITE "card_union[T]")
                              (("2"
                                (CASE "card(intersection(vert(H1!1), vert(H2!1))) = 0")
                                (("1" (ASSERT) NIL)
                                 ("2" (HIDE 2)
                                  (("2" (REWRITE "card_empty?[T]")
                                    (("2" (EXPAND "empty?")
                                      (("2"
                                        (PROPAX)
                                        NIL)))))))))))))))))))))))))))))))))))))))
 (|edge_not_across| "" (SKOSIMP*)
  (("" (EXPAND "union")
    (("" (EXPAND "union")
      (("" (EXPAND "member")
        (("" (ASSERT)
          (("" (TYPEPRED "H2!1")
            (("" (INST?)
              (("" (ASSERT)
                (("" (INST -1 "vo!1")
                  (("" (ASSERT)
                    (("" (HIDE -2 -4 1)
                      (("" (GRIND) NIL)))))))))))))))))))))))
 (|lem1| "" (SKOSIMP*)
  (("" (CASE "NOT vert(H2!1)(vo!1)")
    (("1" (HIDE -2)
      (("1" (APPLY-EXTENSIONALITY 4 :HIDE? T)
        (("1" (HIDE 3 4)
          (("1" (APPLY-EXTENSIONALITY 1 :HIDE? T)
            (("1" (GRIND)
              (("1" (HIDE -3)
                (("1" (TYPEPRED "H2!1")
                  (("1" (INST?)
                    (("1" (ASSERT)
                      (("1" (INST?) (("1" (ASSERT) NIL)))))))))))))))))
         ("2" (HIDE 3 4)
          (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T) (("2" (GRIND) NIL)))))))))
     ("2" (HIDE 1 2 3) (("2" (GRIND) NIL)))))))
 (|H1P_not_empty| "" (SKOSIMP*)
  (("" (HIDE -3 3)
    (("" (LEMMA "deg_edge_exists")
      (("" (INST?)
        (("" (ASSERT)
          (("" (SKOSIMP*)
            (("" (CASE "edges(H1!1)(e!1)")
              (("1" (HIDE -3)
                (("1" (TYPEPRED "H1!1")
                  (("1" (INST?)
                    (("1" (ASSERT)
                      (("1" (TYPEPRED "e!1")
                        (("1" (SKOSIMP*)
                          (("1" (HIDE -3 -4 -6)
                            (("1" (REPLACE -1)
                              (("1" (HIDE -1)
                                (("1" (INST-CP -1 "x!1")
                                  (("1" (INST -1 "y!1")
                                    (("1" (EXPAND "dbl")
                                      (("1"
                                        (CASE "vo!1 = x!1")
                                        (("1"
                                          (REPLACE -1 * RL)
                                          (("1"
                                            (HIDE -1)
                                            (("1"
                                              (HIDE -4 2 3)
                                              (("1"
                                                (EXPAND "empty?")
                                                (("1"
                                                  (EXPAND "empty?")
                                                  (("1"
                                                    (EXPAND "member")
                                                    (("1"
                                                      (INST -4 "y!1")
                                                      (("1"
                                                        (GRIND)
                                                        NIL)))))))))))))))
                                         ("2"
                                          (HIDE -4 3 4)
                                          (("2"
                                            (EXPAND "empty?")
                                            (("2"
                                              (EXPAND "empty?")
                                              (("2"
                                                (INST -4 "x!1")
                                                (("2"
                                                  (EXPAND "member")
                                                  (("2"
                                                    (GRIND)
                                                    NIL)))))))))))))))))))))))))))))))))))))
               ("2" (HIDE -4 -6 2 3)
                (("2" (LEMMA "edge_not_across")
                  (("2" (INST?)
                    (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))))))
 (|cip0| "" (SKOSIMP*)
  (("" (NAME "GP" "del_vert(G!1,vo!1)")
    (("" (NAME "H1P" "del_vert(H1!1, vo!1)")
      (("" (CASE "GP = union(H1P,H2!1)")
        (("1" (CASE "NOT piece_connected?(GP)")
          (("1" (INST?)
            (("1" (ASSERT)
              (("1" (HIDE -1 -2 -5 -6 -8 -9 1 3 4)
                (("1" (REPLACE -1 * RL)
                  (("1" (HIDE -1)
                    (("1" (EXPAND "size")
                      (("1" (EXPAND "del_vert")
                        (("1" (REWRITE "card_remove")
                          (("1" (LIFT-IF)
                            (("1" (GROUND)
                              (("1" (HIDE 2)
                                (("1" (REPLACE -2)
                                  (("1" (HIDE -2)
                                    (("1" (GRIND)
                                      NIL)))))))))))))))))))))))))))
           ("2" (HIDE -5 -6 -7 -8)
            (("2" (EXPAND "piece_connected?")
              (("2" (FLATTEN)
                (("2" (INST -1 "H1P" "H2!1")
                  (("2" (ASSERT)
                    (("2" (SPLIT -1)
                      (("1" (HIDE -3 -4 2)
                        (("1" (HIDE -1)
                          (("1" (REPLACE -1 * RL)
                            (("1" (HIDE -1)
                              (("1" (HIDE -1 2 3)
                                (("1" (EXPAND "empty?")
                                  (("1" (SKOSIMP*)
                                    (("1" (INST?)
                                      (("1" (GRIND) NIL)))))))))))))))))
                       ("2" (REVEAL -3 -4)
                        (("2" (LEMMA "H1P_not_empty")
                          (("2" (INST?)
                            (("2" (INST -1 "G!1" "H2!1")
                              (("2" (ASSERT) NIL)))))))))))))))))))))))
         ("2" (HIDE -5 -6 -8)
          (("2" (LEMMA "lem1")
            (("2" (INST -1 "H1!1" "H2!1" "vo!1")
              (("2" (ASSERT) NIL)))))))))))))))
 (|cip3| "" (SKOSIMP*)
  (("" (CASE "vert(H1!1)(vo!1)")
    (("1" (LEMMA "cip0")
      (("1" (INST -1 "G!1" "H1!1" "H2!1" "vo!1") (("1" (ASSERT) NIL)))))
     ("2" (LEMMA "cip0")
      (("2" (INST -1 "G!1" "H2!1" "H1!1" "vo!1")
        (("2" (REWRITE "intersection_commutative")
          (("2" (CASE-REPLACE "union(H2!1, H1!1) = union(H1!1, H2!1)")
            (("1" (ASSERT)
              (("1" (PROP)
                (("1" (HIDE -1 -2 -3 -4 -7)
                  (("1" (REPLACE -1)
                    (("1" (HIDE -1) (("1" (GRIND) NIL)))))))))))
             ("2" (HIDE -1 -2 -3 -4 -5 -6 -7 -8 -9 2 3 4)
              (("2" (EXPAND "union")
                (("2" (PROP)
                  (("1" (REWRITE "union_commutative") NIL)
                   ("2" (REWRITE "union_commutative") NIL)))))))))))))))))))
 (|connected_not_empty| "" (SKOSIMP*)
  (("" (EXPAND "empty?")
    (("" (EXPAND "connected?")
      (("" (LEMMA " card_empty?[T]")
        (("" (INST?)
          (("" (IFF)
            (("" (ASSERT)
              (("" (PROP)
                (("1" (EXPAND "singleton?")
                  (("1" (EXPAND "size") (("1" (ASSERT) NIL)))))
                 ("2" (SKOSIMP*)
                  (("2" (EXPAND "empty?")
                    (("2" (INST -4 "v!1")
                      (("2" (EXPAND "member")
                        (("2" (PROPAX) NIL)))))))))))))))))))))))))
 (|conn_implies_piece| "" (INDUCT "G" 1 "graph_induction_vert")
  (("" (SKOSIMP*)
    (("" (HIDE -1)
      (("" (LEMMA "not_piece_has_2")
        (("" (INST?)
          (("" (ASSERT)
            (("" (EXPAND "piece_connected?")
              (("" (REWRITE "connected_not_empty")
                (("" (ASSERT)
                  (("" (SKOSIMP*)
                    ((""
                      (CASE "(FORALL (vo: (vert(G!1))): deg(vo,G!1) > 0 IMPLIES NOT connected?(del_vert(G!1,vo)))")
                      (("1" (EXPAND "connected?" -3)
                        (("1" (PROP)
                          (("1" (USE "singleton_piece") (("1" (ASSERT) NIL)))
                           ("2" (SKOSIMP*)
                            (("2" (INST -3 "v!1") (("2" (ASSERT) NIL)))))))))
                       ("2" (SKOSIMP*)
                        (("2" (ASSERT)
                          (("2" (REVEAL -2)
                            (("2" (CASE "vert(H1!1)(vo!1)")
                              (("1" (LEMMA "cip3")
                                (("1" (INST?)
                                  (("1" (INST -1 "vo!1")
                                    (("1" (ASSERT) NIL)))))))
                               ("2" (LEMMA "cip3")
                                (("2" (INST -1 "G!1" "H2!1" "H1!1" "vo!1")
                                  (("2"
                                    (CASE-REPLACE
                                     "union(H2!1, H1!1) = union(H1!1, H2!1)")
                                    (("1"
                                      (CASE-REPLACE
                                       "intersection(vert(H2!1), vert(H1!1)) = intersection(vert(H1!1), vert(H2!1))")
                                      (("1" (HIDE -1 -2) (("1" (ASSERT) NIL)))
                                       ("2"
                                        (PROP)
                                        (("1"
                                          (HIDE -1 -2 -3 -4 -5 -7 3 4)
                                          (("1"
                                            (TYPEPRED "vo!1")
                                            (("1"
                                              (HIDE -2)
                                              (("1"
                                                (GRIND)
                                                (("1"
                                                  (HIDE
                                                   -1
                                                   -2
                                                   -3
                                                   -4
                                                   -5
                                                   -6
                                                   -7
                                                   -8
                                                   -9
                                                   2
                                                   3
                                                   4)
                                                  (("1"
                                                    (APPLY-EXTENSIONALITY
                                                     1
                                                     :HIDE?
                                                     T)
                                                    (("1" (GRIND) NIL)))))
                                                 ("2"
                                                  (HIDE
                                                   -1
                                                   -2
                                                   -3
                                                   -4
                                                   -5
                                                   -6
                                                   -7
                                                   -8
                                                   2
                                                   3
                                                   4)
                                                  (("2"
                                                    (APPLY-EXTENSIONALITY
                                                     1
                                                     :HIDE?
                                                     T)
                                                    (("2"
                                                      (GRIND)
                                                      NIL)))))))))))))
                                         ("2"
                                          (HIDE
                                           -1
                                           -2
                                           -3
                                           -4
                                           -5
                                           -6
                                           -7
                                           -8
                                           1
                                           3
                                           4
                                           5)
                                          (("2"
                                            (APPLY-EXTENSIONALITY 1 :HIDE? T)
                                            (("2" (GRIND) NIL)))))))))
                                     ("2" (HIDE -1 -2 -3 -4 -5 -6 -7 -8 2 3 4)
                                      (("2"
                                        (APPLY-EXTENSIONALITY 1 :HIDE? T)
                                        (("1"
                                          (APPLY-EXTENSIONALITY 1 :HIDE? T)
                                          (("1" (GRIND) NIL)))
                                         ("2"
                                          (APPLY-EXTENSIONALITY 1 :HIDE? T)
                                          (("2"
                                            (GRIND)
                                            NIL))))))))))))))))))))))))))))))))))))))))))))
$$$graph_connected.pvs
graph_connected[T: TYPE]: THEORY
BEGIN
   IMPORTING graph_ops[T], graph_deg[T], walks[T],
             graph_conn_defs[T],
             graph_conn_piece, graph_piece_path,  % FOR PROOF ONLY
             graph_path_conn, graph_complected    % FOR PROOF ONLY
   G,G1,G2,H1,H2: VAR graph[T]
   conn_eq_path       : THEOREM connected?(G) = path_connected?(G)
   path_eq_piece      : THEOREM path_connected?(G) = piece_connected?(G)
   piece_eq_conn      : THEOREM piece_connected?(G) = connected?(G)
   conn_eq_complected : THEOREM connected?(G) = complected?(G)
%WHERE (defined in graph_conn_defs[T])
%
%   connected?(G): RECURSIVE bool = singleton?(G) OR
%                                   (EXISTS (v: (vert(G))): deg(v,G) > 0
%                                       AND connected?(del_vert(G,v)))
%                  MEASURE size(G)
%
%   path_connected?(G): bool = (FORALL (x,y: (vert(G))): x /= y IMPLIES
%                                   (EXISTS (w: Walk(G)): seq(w)(0) = x AND
%                                                         seq(w)(l(w)-1) = y))
%
%   piece_connected?(G): bool = NOT empty?(G) AND
%                               (FORALL H1,H2: G = union(H1,H2) AND
%                                         NOT empty?(H1) AND NOT empty?(H2)
%                                  IMPLIES NOT empty?(intersection(vert(H1),
%                                                                   vert(H2))))
%
%   complected?(G): bool = IF isolated?(G) THEN singleton?(G)
%                          ELSIF (EXISTS (v: (vert(G))): deg(v,G) = 1) THEN
%                           (EXISTS (x: (vert(G))): deg(x,G) = 1 AND
%                              connected?(del_vert(G,x)))
%                          ELSE
%                             (EXISTS (e: (edges(G))):
%                              connected?(del_edge(G,e)))
%                          ENDIF
%
% are defined in graph_conn_defs.pvs
END graph_connected
$$$graph_connected.prf
(|graph_connected|
 (|conn_eq_path| "" (SKOSIMP*)
  (("" (IFF 1)
    (("" (PROP)
      (("1" (LEMMA "conn_implies_piece[T]")
        (("1" (INST?)
          (("1" (LEMMA "piece_implies_path[T]")
            (("1" (INST?) (("1" (ASSERT) NIL)))))))))
       ("2" (LEMMA "path_implies_conn[T]")
        (("2" (INST?) (("2" (ASSERT) NIL)))))))))))
 (|path_eq_piece| "" (SKOSIMP*)
  (("" (IFF)
    (("" (PROP)
      (("1" (LEMMA "path_implies_conn[T]")
        (("1" (LEMMA "conn_implies_piece[T]")
          (("1" (INST?) (("1" (INST?) (("1" (ASSERT) NIL)))))))))
       ("2" (LEMMA "piece_implies_path[T]")
        (("2" (INST?) (("2" (ASSERT) NIL)))))))))))
 (|piece_eq_conn| "" (SKOSIMP*)
  (("" (IFF)
    (("" (PROP)
      (("1" (LEMMA "piece_implies_path[T]")
        (("1" (INST?)
          (("1" (LEMMA "path_implies_conn[T]")
            (("1" (INST?) (("1" (ASSERT) NIL)))))))))
       ("2" (LEMMA "conn_implies_piece[T]")
        (("2" (INST?) (("2" (ASSERT) NIL)))))))))))
 (|conn_eq_complected| "" (SKOSIMP*)
  (("" (LEMMA "conn_eq_compl[T]")
    (("" (INST?)
      (("" (EXPAND "complected?") (("" (IFF) (("" (PROPAX) NIL))))))))))))
$$$graph_conn_defs.pvs
graph_conn_defs[T: TYPE]: THEORY
BEGIN
   IMPORTING graph_deg[T]
   G,G1,G2: VAR graph[T]
   connected?(G): RECURSIVE bool = singleton?(G) OR
                                   (EXISTS (v: (vert(G))): deg(v,G) > 0
                                       AND connected?(del_vert(G,v)))
                  MEASURE size(G)
   IMPORTING walks[T]
   path_connected?(G): bool = NOT empty?(G) AND
                              (FORALL (x,y: (vert(G))): % x /= y IMPLIES
                                   (EXISTS (w: Walk(G)): seq(w)(0) = x AND
                                                         seq(w)(l(w)-1) = y))
   H1,H2: VAR graph[T]
   piece_connected?(G): bool = NOT empty?(G) AND
                               (FORALL H1,H2: G = union(H1,H2) AND
                                         NOT empty?(H1) AND NOT empty?(H2)
                                  IMPLIES NOT empty?(intersection(vert(H1),
                                                                   vert(H2))))
   complected?(G): bool = IF isolated?(G) THEN singleton?(G)
                          ELSIF (EXISTS (v: (vert(G))): deg(v,G) = 1) THEN
                           (EXISTS (x: (vert(G))): deg(x,G) = 1 AND
                              connected?(del_vert(G,x)))
                          ELSE
                             (EXISTS (e: (edges(G))):
                              connected?(del_edge(G,e)))
                          ENDIF
END graph_conn_defs
$$$graph_conn_defs.prf
(|graph_conn_defs|
 (|connected?_TCC1| "" (SKOSIMP*)
  (("" (REWRITE "size_del_vert") (("" (ASSERT) NIL)))))
 (|path_connected?_TCC1| "" (SUBTYPE-TCC) NIL)
 (|path_connected?_TCC2| "" (SUBTYPE-TCC) NIL))
$$$subtrees.pvs
subtrees[T: TYPE]: THEORY
BEGIN
   IMPORTING max_subtrees[T], graph_conn_defs[T]
   G: VAR Graph[T]    % not empty?(G)
   S: VAR graph[T]
   n: VAR nat
   walk_acr: LEMMA FORALL (w: Walk(G)): n < l(w) AND
                                vert(S)(seq(w)(0)) AND NOT vert(S)(seq(w)(n))
                               IMPLIES
                    (EXISTS (j: posnat): (j <= n
                        AND (vert(S)(seq(w)(j - 1)) AND NOT vert(S)(seq(w)(j)))))
   walk_acr2: LEMMA FORALL (w: Walk(G)): n < l(w) AND
                                vert(S)(seq(w)(0)) AND NOT vert(S)(seq(w)(n))
                               IMPLIES
                    (EXISTS (j: posnat): (j <= n
                        AND (vert(S)(seq(w)(j - 1)) AND NOT vert(S)(seq(w)(j)))))
    e: VAR doubleton[T]
    v,w: VAR T
    add_dbl: LEMMA  vert(G)(v) AND v /= w AND
                 add(dbl[T](v, w), edges(G))(e)
              IMPLIES (FORALL (x: T): e(x) IMPLIES add(w, vert(G))(x))
   max_tree_all_verts: LEMMA path_connected?(G)   IMPLIES
                               vert(max_subtree(G)) = vert(G)
END subtrees
$$$subtrees.prf
(|subtrees| (|walk_acr_TCC1| "" (SUBTYPE-TCC) NIL) (|walk_acr_TCC2| "" (SUBTYPE-TCC) NIL)
 (|walk_acr_TCC3| "" (SUBTYPE-TCC) NIL)
 (|walk_acr| "" (INDUCT "n" 1 "NAT_induction")
  (("1" (SKOSIMP*)
    (("1" (INST -1 "j!1-1")
      (("1" (ASSERT)
        (("1" (INST?)
          (("1" (ASSERT)
            (("1" (SPLIT -1)
              (("1" (SKOSIMP*) (("1" (INST 3 "j!2") (("1" (ASSERT) NIL)))))
               ("2" (ASSERT) (("2" (INST 2 "j!1") (("2" (ASSERT) NIL)))))))))))))
       ("2" (ASSERT) NIL)))))
   ("2" (SKOSIMP*) (("2" (ASSERT) NIL))) ("3" (SKOSIMP*) (("3" (ASSERT) NIL)))))
 (|walk_acr2| "" (INDUCT "n" 1 "NAT_induction")
  (("1" (SKOSIMP*)
    (("1" (INST -1 "j!1-1")
      (("1" (ASSERT)
        (("1" (INST?)
          (("1" (ASSERT)
            (("1" (SPLIT -1)
              (("1" (SKOSIMP*) (("1" (INST 3 "j!2") (("1" (ASSERT) NIL)))))
               ("2" (INST 2 "j!1") (("2" (ASSERT) NIL)))))))))))
       ("2" (ASSERT) NIL)))))
   ("2" (SKOSIMP*) (("2" (ASSERT) NIL))) ("3" (SKOSIMP*) (("3" (ASSERT) NIL)))))
 (|add_dbl_TCC1| "" (SUBTYPE-TCC))
 (|add_dbl| "" (SKOSIMP*)
  (("" (EXPAND "add")
    (("" (EXPAND "member")
      (("" (SPLIT)
        (("1" (REPLACE -1 * RL) (("1" (HIDE -1) (("1" (EXPAND "dbl") (("1" (FLATTEN) (("1" (GROUND) NIL)))))))))
         ("2" (TYPEPRED "G!1")
          (("2" (INST?) (("2" (ASSERT) (("2" (INST -2 "x!1") (("2" (ASSERT) NIL)))))))))))))))))
 (|max_tree_all_verts| "" (SKOSIMP*)
  (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
    (("" (IFF 1)
      (("" (PROP)
        (("1" (HIDE -2)
          (("1" (LEMMA "max_subtree_subgraph")
            (("1" (INST?)
              (("1" (EXPAND "subgraph?")
                (("1" (FLATTEN)
                  (("1" (HIDE -2)
                    (("1" (EXPAND "subset?")
                      (("1" (INST?) (("1" (EXPAND "member") (("1" (ASSERT) NIL)))))))))))))))))))
         ("2" (LEMMA "max_subtree_tree")
          (("2" (INST?)
            (("2" (NAME "TR" "max_subtree(G!1)")
              (("2" (CASE "(EXISTS (v: T): vert(TR)(v))")
                (("1" (SKOSIMP*)
                  (("1" (EXPAND "path_connected?")
                    (("1" (FLATTEN)
                      (("1" (INST -5 "v!1" "x!1")
                        (("1" (ASSERT)
                          (("1" (SKOSIMP*)
                            (("1"
                              (CASE "(EXISTS (j: posnat): j < l(w!1) AND vert(TR)(w!1(j-1)) AND
	                               NOT vert(TR)(w!1(j)))")
                              (("1" (EXPAND "fseq")
                                (("1" (SKOSIMP*)
                                  (("1" (TYPEPRED "w!1")
                                    (("1" (EXPAND "walk?")
                                      (("1" (EXPAND "verts_in?")
                                        (("1" (FLATTEN)
                                          (("1" (INST -1 "j!1-1")
                                            (("1" (ASSERT)
                                              (("1" (EXPAND "edge?")
                                                (("1" (EXPAND "fseq")
                                                  (("1" (NAME "ss" "seq(w!1)(j!1 - 1)")
                                                    (("1" (NAME "tt" "seq(w!1)(j!1)")
                                                      (("1"
                                                        (NAME "TP" "(# vert := add(tt,vert(TR)),
                     edges := add(dbl[T](ss,tt),edges(TR)) #)")
                                                        (("1" (CASE "tree?(TP)")
                                                          (("1" (LEMMA "max_subtree_max")
                                                            (("1" (INST -1 "G!1" "TP")
                                                              (("1" (REPLACE -4)
                                                                (("1"
                                                                  (HIDE -2 --4 -5 -6 -7 -8 -9 -10 -11 -13 -14 -15
                                                                   -16 1 3 4)
                                                                  (("1" (REPLACE -2 * RL)
                                                                    (("1" (HIDE -2)
                                                                      (("1" (EXPAND "size")
                                                                        (("1" (REWRITE "card_add[T]")
                                                                          (("1" (ASSERT) NIL)))))))))))))
                                                               ("2" (PROP)
                                                                (("1" (SKOSIMP*)
                                                                  (("1" (LEMMA "add_dbl")
                                                                    (("1" (INST?)
                                                                      (("1" (INST?)
                                                                        (("1" (ASSERT)
                                                                          (("1" (INST?) (("1" (ASSERT) NIL)))))))
                                                                       ("2" (EXPAND "nonempty?")
                                                                        (("2" (EXPAND "empty?")
                                                                          (("2"
                                                                            (EXPAND "member")
                                                                            (("2" (INST -1 "v!1") NIL)))))))))))))
                                                                 ("2" (REPLACE -4)
                                                                  (("2" (INST -6 "j!1")
                                                                    (("2" (REPLACE -3)
                                                                      (("2" (HIDE -1 -12 3 4)
                                                                        (("2" (REPLACE -1 * RL)
                                                                          (("2"
                                                                            (HIDE -1)
                                                                            (("2"
                                                                              (EXPAND "subgraph?")
                                                                              (("2"
                                                                                (LEMMA "max_subtree_subgraph")
                                                                                (("2"
                                                                                  (INST?)
                                                                                  (("2"
                                                                                    (REPLACE -10)
                                                                                    (("2"
                                                                                      (HIDE -10)
                                                                                      (("2"
                                                                                        (EXPAND "subgraph?")
                                                                                        (("2"
                                                                                          (FLATTEN)
                                                                                          (("2"
                                                                                            (SPLIT 1)
                                                                                            (("1"
                                                                                              (EXPAND "subset?")
                                                                                              (("1"
                                                                                                (SKOSIMP*)
                                                                                                (("1"
                                                                                                  (EXPAND "member")
                                                                                                  (("1"
                                                                                                    (EXPAND "add")
                                                                                                    (("1"
                                                                                                      (EXPAND
                                                                                                       "member")
                                                                                                      (("1"
                                                                                                        (SPLIT -1)
                                                                                                        (("1"
                                                                                                          (INST?)
                                                                                                          (("1"
                                                                                                            (ASSERT)
                                                                                                            (("1"
                                                                                                              (REPLACE
                                                                                                               -1)
                                                                                                              (("1"
                                                                                                                (HIDE
                                                                                                                 -1)
                                                                                                                (("1"
                                                                                                                  (REVEAL
                                                                                                                   -10)
                                                                                                                  (("1"
                                                                                                                    (INST?)
                                                                                                                    (("1"
                                                                                                                      (ASSERT)
                                                                                                                      NIL)))))))))))))
                                                                                                         ("2"
                                                                                                          (INST?)
                                                                                                          (("2"
                                                                                                            (ASSERT)
                                                                                                            NIL)))))))))))))))
                                                                                             ("2"
                                                                                              (EXPAND "subset?")
                                                                                              (("2"
                                                                                                (EXPAND "member")
                                                                                                (("2"
                                                                                                  (SKOSIMP*)
                                                                                                  (("2"
                                                                                                    (EXPAND "add")
                                                                                                    (("2"
                                                                                                      (EXPAND
                                                                                                       "member")
                                                                                                      (("2"
                                                                                                        (SPLIT -1)
                                                                                                        (("1"
                                                                                                          (REVEAL
                                                                                                           -6)
                                                                                                          (("1"
                                                                                                            (INST
                                                                                                             -1
                                                                                                             "j!1-1")
                                                                                                            (("1"
                                                                                                              (ASSERT)
                                                                                                              NIL)))))
                                                                                                         ("2"
                                                                                                          (HIDE -2)
                                                                                                          (("2"
                                                                                                            (INST?)
                                                                                                            (("2"
                                                                                                              (ASSERT)
                                                                                                              NIL)))))))))))))))))))))))))))))))))))))))))))))))))))
                                                           ("2" (REPLACE -2)
                                                            (("2" (REPLACE -3)
                                                              (("2" (EXPAND "tree?")
                                                                (("2" (FLATTEN)
                                                                  (("2" (HIDE 1)
                                                                    (("2" (INST 1 "tt")
                                                                      (("1" (SPLIT 1)
                                                                        (("1" (HIDE -11)
                                                                          (("1"
                                                                            (EXPAND "deg")
                                                                            (("1"
                                                                              (CASE-REPLACE
                                                                               "incident_edges(tt, TP) = singleton[Dbl](dbl[T](ss,tt))")
                                                                              (("1" (REWRITE "card_singleton") NIL)
                                                                               ("2"
                                                                                (HIDE 2)
                                                                                (("2"
                                                                                  (EXPAND "incident_edges")
                                                                                  (("2"
                                                                                    (EXPAND "singleton")
                                                                                    (("2"
                                                                                      (REPLACE -1 * RL)
                                                                                      (("2"
                                                                                        (HIDE -1)
                                                                                        (("2"
                                                                                          (APPLY-EXTENSIONALITY
                                                                                           :HIDE?
                                                                                           T)
                                                                                          (("1"
                                                                                            (EXPAND "add")
                                                                                            (("1"
                                                                                              (EXPAND "member")
                                                                                              (("1"
                                                                                                (IFF)
                                                                                                (("1"
                                                                                                  (GROUND)
                                                                                                  (("1"
                                                                                                    (TYPEPRED "TR")
                                                                                                    (("1"
                                                                                                      (HIDE -1 -2)
                                                                                                      (("1"
                                                                                                        (INST?)
                                                                                                        (("1"
                                                                                                          (ASSERT)
                                                                                                          (("1"
                                                                                                            (INST
                                                                                                             -1
                                                                                                             "tt")
                                                                                                            (("1"
                                                                                                              (ASSERT)
                                                                                                              NIL)))))))))))
                                                                                                   ("2"
                                                                                                    (REPLACE -1)
                                                                                                    (("2"
                                                                                                      (HIDE -1)
                                                                                                      (("2"
                                                                                                        (EXPAND
                                                                                                         "dbl")
                                                                                                        (("2"
                                                                                                          (PROPAX)
                                                                                                          NIL)))))))))))))))
                                                                                           ("2"
                                                                                            (SKOSIMP*)
                                                                                            (("2"
                                                                                              (INST?)
                                                                                              (("2"
                                                                                                (ASSERT)
                                                                                                NIL)))))))))))))))))))))))
                                                                         ("2" (REPLACE -1 * RL)
                                                                          (("2"
                                                                            (CASE-REPLACE
                                                                             "del_vert[T]((# vert := add(tt, vert(TR)),
                           edges :=
                             add(dbl[T](ss, tt),
                                 edges(TR))
                           #),
                        tt) = TR")
                                                                            (("1" (ASSERT) NIL)
                                                                             ("2"
                                                                              (HIDE -11 -12 -13 -14 2 5 6)
                                                                              (("2"
                                                                                (APPLY-EXTENSIONALITY 1 :HIDE? T)
                                                                                (("1"
                                                                                  (EXPAND "del_vert")
                                                                                  (("1"
                                                                                    (APPLY-EXTENSIONALITY
                                                                                     1
                                                                                     :HIDE?
                                                                                     T)
                                                                                    (("1"
                                                                                      (EXPAND "add")
                                                                                      (("1"
                                                                                        (EXPAND "member")
                                                                                        (("1"
                                                                                          (IFF 1)
                                                                                          (("1"
                                                                                            (GROUND)
                                                                                            (("1"
                                                                                              (REPLACE -1 * RL)
                                                                                              (("1"
                                                                                                (EXPAND "dbl")
                                                                                                (("1"
                                                                                                  (PROPAX)
                                                                                                  NIL)))))
                                                                                             ("2"
                                                                                              (TYPEPRED "TR")
                                                                                              (("2"
                                                                                                (INST -3 "x!2")
                                                                                                (("2"
                                                                                                  (ASSERT)
                                                                                                  (("2"
                                                                                                    (INST -3 "tt")
                                                                                                    (("2"
                                                                                                      (ASSERT)
                                                                                                      NIL)))))))))))))))))
                                                                                     ("2"
                                                                                      (SKOSIMP*)
                                                                                      (("2"
                                                                                        (INST 1 "ss" "tt")
                                                                                        (("2" (ASSERT) NIL)))))))))
                                                                                 ("2"
                                                                                  (EXPAND "del_vert")
                                                                                  (("2"
                                                                                    (APPLY-EXTENSIONALITY
                                                                                     1
                                                                                     :HIDE?
                                                                                     T)
                                                                                    (("2"
                                                                                      (EXPAND "remove")
                                                                                      (("2"
                                                                                        (EXPAND "add")
                                                                                        (("2"
                                                                                          (EXPAND "member")
                                                                                          (("2"
                                                                                            (IFF)
                                                                                            (("2"
                                                                                              (GROUND)
                                                                                              NIL)))))))))))))
                                                                                 ("3"
                                                                                  (SKOSIMP*)
                                                                                  (("3"
                                                                                    (LEMMA "add_dbl")
                                                                                    (("3"
                                                                                      (INST?)
                                                                                      (("1"
                                                                                        (ASSERT)
                                                                                        (("1"
                                                                                          (INST?)
                                                                                          (("1" (ASSERT) NIL)))))
                                                                                       ("2"
                                                                                        (EXPAND "nonempty?")
                                                                                        (("2"
                                                                                          (EXPAND "empty?")
                                                                                          (("2"
                                                                                            (INST -1 "ss")
                                                                                            (("2"
                                                                                              (EXPAND "member")
                                                                                              (("2"
                                                                                                (PROPAX)
                                                                                                NIL)))))))))))))))
                                                                                 ("4"
                                                                                  (INST?)
                                                                                  (("4" (ASSERT) NIL)))))))
                                                                             ("3"
                                                                              (SKOSIMP*)
                                                                              (("3"
                                                                                (LEMMA "add_dbl")
                                                                                (("3"
                                                                                  (INST?)
                                                                                  (("1"
                                                                                    (ASSERT)
                                                                                    (("1"
                                                                                      (INST -1 "x!2")
                                                                                      (("1"
                                                                                        (EXPAND "add")
                                                                                        (("1" (PROPAX) NIL)))))))
                                                                                   ("2"
                                                                                    (EXPAND "nonempty?")
                                                                                    (("2"
                                                                                      (EXPAND "empty?")
                                                                                      (("2"
                                                                                        (EXPAND "member")
                                                                                        (("2"
                                                                                          (INST -1 "ss")
                                                                                          NIL)))))))))))))))))))
                                                                       ("2" (REPLACE -1 * RL)
                                                                        (("2" (ASSERT)
                                                                          (("2"
                                                                            (EXPAND "add")
                                                                            (("2" (PROPAX) NIL)))))))))))))))))))
                                                           ("3" (SKOSIMP*)
                                                            (("3" (REPLACE -3 * RL)
                                                              (("3" (HIDE -3)
                                                                (("3" (ASSERT)
                                                                  (("3" (EXPAND "add")
                                                                    (("3" (EXPAND "member")
                                                                      (("3" (FLATTEN)
                                                                        (("3" (SPLIT -1)
                                                                          (("1"
                                                                            (REPLACE -1 * RL)
                                                                            (("1"
                                                                              (HIDE -1)
                                                                              (("1"
                                                                                (EXPAND "dbl")
                                                                                (("1" (ASSERT) NIL)))))))
                                                                           ("2"
                                                                            (TYPEPRED "TR")
                                                                            (("2"
                                                                              (INST?)
                                                                              (("2"
                                                                                (ASSERT)
                                                                                (("2"
                                                                                  (INST -3 "x!2")
                                                                                  (("2"
                                                                                    (ASSERT)
                                                                                    NIL)))))))))))))))))))))))))))
                                                         ("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))
                                             ("2" (ASSERT) NIL)))))))))))))))
                               ("2" (EXPAND "fseq")
                                (("2" (LEMMA "walk_acr")
                                  (("2" (INST -1 "G!1" "TR" "l(w!1)-1" "w!1")
                                    (("2" (ASSERT) (("2" (SKOSIMP*) (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))
                               ("3" (SKOSIMP*) (("3" (ASSERT) NIL)))))))))
                         ("2" (REPLACE -2 * RL)
                          (("2" (HIDE -2)
                            (("2" (LEMMA "max_subtree_subgraph")
                              (("2" (INST?)
                                (("2" (EXPAND "subgraph?")
                                  (("2" (FLATTEN)
                                    (("2" (HIDE -2)
                                      (("2" (EXPAND "subset?")
                                        (("2" (EXPAND "member")
                                          (("2" (INST -1 "v!1") (("2" (ASSERT) NIL)))))))))))))))))))))))))))))
                 ("2" (HIDE -4 2)
                  (("2" (REPLACE -1)
                    (("2" (HIDE -1)
                      (("2" (EXPAND "tree?")
                        (("2" (PROP)
                          (("1" (LEMMA "card_1_has_1[T]") (("1" (INST?) (("1" (ASSERT) NIL)))))
                           ("2" (SKOSIMP*)
                            (("2" (HIDE -2 -3)
                              (("2" (INST?)
                                (("2" (EXPAND "deg")
                                  (("2" (LEMMA "card_1_has_1[Dbl]")
                                    (("2" (INST?) (("2" (ASSERT) NIL))))))))))))))))))))))))))))))))))))))))
$$$circuit_deg.pvs
circuit_deg[T: TYPE]: THEORY
BEGIN
   IMPORTING graph_deg[T], circuits[T], subgraphs_from_walk[T]
   G: VAR graph[T]
   e_duo(e1,e2: doubleton[T]): finite_set[doubleton[T]] =
                   add[doubleton[T]](e1,singleton[doubleton[T]](e2))
   z: VAR T
   cir_deg_G: LEMMA (EXISTS (a,b: (vert(G))): vert(G)(z) AND
                          a /= b AND edge?(G)(a,z) AND edge?(G)(b,z) ) IMPLIES
                              deg(z,G) >= 2
   circuit_deg: LEMMA FORALL (w: Walk(G),i: below(l(w))): circuit?(G,w)
                            IMPLIES deg(w(i),G_from(G,w)) >= 2
   circuit_subgraph_len_1: LEMMA FORALL (w: Walk(G)): circuit?(G,w)
                                IMPLIES card(vert(G_from(G,w))) > 1
END circuit_deg
$$$circuit_deg.prf
(|circuit_deg| (|e_duo_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_add[doubleton[T]]") NIL)))
 (|cir_deg_G| "" (SKOSIMP*)
  (("" (EXPAND "edge?")
    (("" (FLATTEN)
      (("" (EXPAND "deg")
        ((""
          (CASE "subset?(e_duo(dbl(a!1,z!1),dbl(b!1,z!1)),
                     incident_edges(z!1, G!1))")
          (("1" (LEMMA "card_subset[doubleton[T]]")
            (("1" (INST?)
              (("1" (CASE "card(e_duo(dbl(a!1, z!1), dbl(b!1, z!1))) = 2")
                (("1" (ASSERT) NIL)
                 ("2" (HIDE -1 -2 3)
                  (("2" (EXPAND "e_duo")
                    (("2" (REWRITE "card_add[doubleton[T]]")
                      (("2" (REWRITE "card_singleton[doubleton[T]]")
                        (("2" (LIFT-IF)
                          (("2" (GROUND)
                            (("2" (HIDE 1)
                              (("2" (EXPAND "singleton")
                                (("2" (CASE "dbl(a!1, z!1)(a!1) = dbl(b!1, z!1)(a!1)")
                                  (("1" (CASE "dbl(a!1, z!1)(b!1) = dbl(b!1, z!1)(b!1)")
                                    (("1" (HIDE -3) (("1" (EXPAND "dbl") (("1" (PROPAX) NIL)))))
                                     ("2" (ASSERT) NIL)))
                                   ("2" (ASSERT) NIL)))))))))))))))))))))
               ("2" (HIDE -1 3) (("2" (ASSERT) (("2" (INST 1 "b!1" "z!1") (("2" (ASSERT) NIL)))))))
               ("3" (INST?) (("3" (ASSERT) NIL)))))))
           ("2" (HIDE 3)
            (("2" (EXPAND "subset?")
              (("2" (SKOSIMP*)
                (("2" (EXPAND "member")
                  (("2" (EXPAND "incident_edges")
                    (("2" (CASE "x!1 = dbl(a!1, z!1) OR x!1 = dbl(b!1, z!1)")
                      (("1" (HIDE -2)
                        (("1" (SPLIT -1)
                          (("1" (REPLACE -1)
                            (("1" (HIDE -1) (("1" (ASSERT) (("1" (EXPAND "dbl") (("1" (PROPAX) NIL)))))))))
                           ("2" (REPLACE -1)
                            (("2" (HIDE -1) (("2" (ASSERT) (("2" (EXPAND "dbl") (("2" (PROPAX) NIL)))))))))))))
                       ("2" (HIDE -2 -3 -4 2 3)
                        (("2" (EXPAND "e_duo")
                          (("2" (EXPAND "add")
                            (("2" (EXPAND "member")
                              (("2" (EXPAND "singleton") (("2" (GROUND) NIL)))))))))))))))))))))))
           ("3" (INST 1 "b!1" "z!1") (("3" (ASSERT) NIL))) ("4" (INST?) (("4" (ASSERT) NIL)))))))))))))
 (|circuit_deg_TCC1| "" (SUBTYPE-TCC) NIL)
 (|circuit_deg| "" (SKOSIMP*)
  (("" (REWRITE "cir_deg_G")
    (("" (EXPAND "circuit?")
      (("" (EXPAND "cyclically_reduced?")
        (("" (FLATTEN)
          (("" (CASE "i!1 = 0")
            (("1" (HIDE 2)
              (("1" (INST 1 "w!1(l(w!1)-2)" "w!1(i!1+1)")
                (("1" (PROP)
                  (("1" (REWRITE "vert_G_from") NIL)
                   ("2" (REPLACE -2) (("2" (HIDE -2) (("2" (ASSERT) (("2" (REVEAL 2) (("2" (ASSERT) NIL)))))))))
                   ("3" (EXPAND "pre_circuit?")
                    (("3" (LEMMA "edge?_G_from") (("3" (INST?) (("1" (ASSERT) NIL) ("2" (ASSERT) NIL)))))))
                   ("4" (REWRITE "edge?_G_from_rev") NIL)))
                 ("2" (REWRITE "vert_G_from") NIL) ("3" (ASSERT) NIL) ("4" (REWRITE "vert_G_from") NIL)
                 ("5" (ASSERT) NIL)))))
             ("2" (CASE "i!1 = l(w!1)-1")
              (("1" (INST 2 "w!1(l(w!1)-2)" "w!1(1)")
                (("1" (PROP)
                  (("1" (REWRITE "vert_G_from") NIL) ("2" (ASSERT) NIL)
                   ("3" (REPLACE -1) (("3" (HIDE -1) (("3" (REWRITE "edge?_G_from") NIL)))))
                   ("4" (EXPAND "pre_circuit?")
                    (("4" (REPLACE -1)
                      (("4" (HIDE -1)
                        (("4" (LEMMA "edge?_G_from_rev")
                          (("4" (INST -1 "G!1" "w!1" 0) (("1" (ASSERT) NIL) ("2" (ASSERT) NIL)))))))))))))
                 ("2" (REWRITE "vert_G_from") NIL) ("3" (ASSERT) NIL)
                 ("4" (HIDE 3 4)
                  (("4" (EXPAND "fseq")
                    (("4" (EXPAND "G_from")
                      (("4" (EXPAND "verts_of")
                        (("4" (INST 1 "l(w!1)-2")
                          (("1" (EXPAND "fseq") (("1" (PROPAX) NIL))) ("2" (ASSERT) NIL)))))))))))
                 ("5" (ASSERT) NIL)))
               ("2" (INST 3 "w!1(i!1-1)" "w!1(i!1+1)")
                (("1" (PROP)
                  (("1" (EXPAND "G_from") (("1" (EXPAND "verts_of") (("1" (INST 1 "i!1") NIL)))))
                   ("2" (EXPAND "reduced?")
                    (("2" (EXPAND "reducible?")
                      (("2" (INST?) (("1" (EXPAND "fseq") (("1" (ASSERT) NIL))) ("2" (ASSERT) NIL)))))))
                   ("3" (REWRITE "edge?_G_from") NIL) ("4" (REWRITE "edge?_G_from_rev") NIL)))
                 ("2" (REWRITE "vert_G_from") NIL) ("3" (ASSERT) NIL) ("4" (REWRITE "vert_G_from") NIL)
                 ("5" (ASSERT) NIL)))))))))))))))))
 (|circuit_subgraph_len_1_TCC1| "" (SUBTYPE-TCC) NIL)
 (|circuit_subgraph_len_1| "" (SKOSIMP*)
  (("" (EXPAND "circuit?")
    (("" (EXPAND "cyclically_reduced?")
      (("" (EXPAND "pre_circuit?")
        (("" (FLATTEN)
          (("" (EXPAND "fseq")
            (("" (TYPEPRED "w!1")
              (("" (EXPAND "walk?")
                (("" (FLATTEN)
                  (("" (CASE "subset?(add[T](fseq(w!1)(0), singleton[T](fseq(w!1)(1))),vert(G_from(G!1, w!1)))")
                    (("1" (LEMMA "card_subset[T]")
                      (("1" (INST?)
                        (("1" (ASSERT)
                          (("1" (CASE-REPLACE "card(add[T](fseq(w!1)(0), singleton[T](fseq(w!1)(1)))) = 2")
                            (("1" (ASSERT) NIL)
                             ("2" (HIDE -1 -2 -3 -4 -5 -6 -7 -8 2 3)
                              (("2" (REWRITE "card_add")
                                (("2" (REWRITE "card_singleton")
                                  (("2" (LIFT-IF)
                                    (("2" (GROUND)
                                      (("2" (HIDE 1)
                                        (("2" (EXPAND "singleton")
                                          (("2" (TYPEPRED "w!1")
                                            (("2" (EXPAND "walk?")
                                              (("2" (INST?)
                                                (("2" (ASSERT)
                                                  (("2" (EXPAND "edge?")
                                                    (("2" (PROPAX) NIL)))))))))))))))))))))))))
                             ("3" (REWRITE "finite_add") NIL)))))
                         ("2" (REWRITE "finite_add") NIL) ("3" (ASSERT) NIL)))))
                     ("2" (HIDE -1 -2 -3 -5 -6 3) (("2" (GRIND) NIL))) ("3" (ASSERT) NIL))))))))))))))))))))))
$$$tree_circ.pvs
tree_circ[T: TYPE]: THEORY
BEGIN
   IMPORTING trees[T], graphs[T], graph_deg[T], graph_ops[T],
             circuit_deg[T], subgraphs_from_walk[T]
   G,GP,C,GG: VAR graph[T]
   GT: VAR Tree
   IMPORTING abstract_min
   exists_c_tree: LEMMA FORALL (w: Walk(GT)):
                              EXISTS (t: Tree[T]): subgraph?(G_from(GT, w), t)
   c_tree(TR: Tree, C: Subgraph(TR)): Tree =
            min[Tree[T],(LAMBDA GT: size(GT)),
                         (LAMBDA GT: subgraph?(C,GT))]
   tree_containing_lem: LEMMA FORALL (w: Walk(GT)):
         tree?(c_tree(GT,G_from(GT,w))) AND
         subgraph?(G_from(GT,w),c_tree(GT,G_from(GT,w))) AND
         (FORALL (GG: Tree): subgraph?(G_from(GT,w),GG) IMPLIES
                                 size(c_tree(GT,G_from(GT,w))) <= size(GG))
   tree_deg: LEMMA FORALL (w: Walk(GT), v: T):
                 vert(c_tree(GT,G_from(GT,w)))(v) AND
                 deg(v, G_from(GT,w)) >= 2
                     IMPLIES  deg(v, c_tree(GT,G_from(GT,w))) >= 2
   small_tree_lem: LEMMA FORALL (w: Walk(G)): tree?(G) =>
                                 size(G) <= 1 IMPLIES NOT circuit?(G,w)
   tree_no_circuits: THEOREM (FORALL (w: Walk(G)): tree?(G) =>
                                   NOT circuit?(G,w))
END tree_circ
$$$tree_circ.prf
(|tree_circ|
 (|exists_c_tree| "" (SKOSIMP*) (("" (INST 1 "GT!1") (("" (ASSERT) NIL)))))
 (|c_tree_TCC1| "" (SKOSIMP*)
  (("" (INST 1 "TR!1") (("" (TYPEPRED "C!1") (("" (PROPAX) NIL)))))))
 (|tree_containing_lem| "" (SKOSIMP*)
  (("" (PROP)
    (("1" (ASSERT) NIL)
     ("2"
      (LEMMA "min_in[Tree[T],(LAMBDA GT: size(GT)),
                         (LAMBDA GT: subgraph?(G_from(GT!1,w!1),GT))]")
      (("1" (BETA) (("1" (EXPAND "c_tree") (("1" (PROPAX) NIL)))))
       ("2" (LEMMA "exists_c_tree") (("2" (INST?) NIL)))))
     ("3" (SKOSIMP*)
      (("3"
        (LEMMA "min_is_min[Tree[T],(LAMBDA GT: size(GT)),
                         (LAMBDA GT: subgraph?(G_from(GT!1,w!1),GT))]")
        (("1" (EXPAND "c_tree")
          (("1" (INST -1 "GG!1") (("1" (BETA) (("1" (ASSERT) NIL)))))))
         ("2" (LEMMA "exists_c_tree") (("2" (INST?) NIL)))))))))))
 (|tree_deg| "" (SKOSIMP*)
  (("" (EXPAND "deg")
    (("" (LEMMA "card_subset[doubleton[T]]")
      ((""
        (INST -1 "incident_edges(v!1, G_from(GT!1, w!1))"
         "incident_edges(v!1, c_tree(GT!1, G_from(GT!1, w!1)))")
        (("" (ASSERT)
          (("" (HIDE -1 -2 2)
            (("" (EXPAND "subset?")
              (("" (SKOSIMP*)
                (("" (EXPAND "member")
                  (("" (EXPAND "incident_edges")
                    (("" (LEMMA "tree_containing_lem")
                      (("" (INST?)
                        (("" (FLATTEN)
                          (("" (HIDE -1 -3)
                            (("" (EXPAND "subgraph?")
                              (("" (FLATTEN)
                                (("" (HIDE -1)
                                  (("" (EXPAND "subset?")
                                    (("" (EXPAND "member")
                                      ((""
                                        (INST?)
                                        ((""
                                          (ASSERT)
                                          NIL)))))))))))))))))))))))))))))))))))))))))
 (|small_tree_lem_TCC1| "" (SUBTYPE-TCC) NIL)
 (|small_tree_lem| "" (SKOSIMP*)
  (("" (EXPAND "size")
    (("" (LEMMA "circuit_subgraph_len_1")
      (("" (INST?)
        (("" (ASSERT)
          (("" (LEMMA "G_from_vert")
            (("" (INST?)
              (("" (REPLACE -1)
                (("" (HIDE -1)
                  (("" (LEMMA "verts_of_subset")
                    (("" (INST?)
                      (("" (INST?)
                        (("1" (LEMMA "card_subset[T]")
                          (("1" (INST?) (("1" (ASSERT) NIL)))))
                         ("2" (ASSERT)
                          (("2" (TYPEPRED "w!1")
                            (("2" (EXPAND "walk?")
                              (("2" (PROPAX)
                                NIL)))))))))))))))))))))))))))))))
 (|tree_no_circuits_TCC1| "" (SUBTYPE-TCC) NIL)
 (|tree_no_circuits| "" (SKOSIMP*)
  (("" (CASE "card(vert(G!1)) <= 1")
    (("1" (REWRITE "small_tree_lem")
      (("1" (EXPAND "size") (("1" (PROPAX) NIL)))))
     ("2" (NAME "Gp" "c_tree(G!1,G_from(G!1,w!1))")
      (("1" (CASE "size(G_from(G!1,w!1)) <= size(Gp)")
        (("1" (EXPAND "size")
          (("1" (LEMMA "tree_containing_lem")
            (("1" (INST?)
              (("1" (ASSERT)
                (("1" (FLATTEN)
                  (("1" (TYPEPRED "c_tree(G!1, G_from(G!1, w!1))")
                    (("1" (EXPAND "tree?" -1)
                      (("1" (SPLIT -1)
                        (("1" (LEMMA "circuit_subgraph_len_1")
                          (("1" (INST?) (("1" (ASSERT) NIL)))))
                         ("2" (SKOSIMP*)
                          (("2" (HIDE -3)
                            (("2" (EXPAND "subgraph?" -3)
                              (("2" (FLATTEN)
                                (("2" (LEMMA "card_subset[T]")
                                  (("2" (INST?)
                                    (("2" (ASSERT)
                                      (("2"
                                        (LEMMA "circuit_deg")
                                        (("2"
                                          (INST?)
                                          (("2"
                                            (ASSERT)
                                            (("2"
                                              (HIDE -3 -8 -9)
                                              (("2"
                                                (TYPEPRED "v!1")
                                                (("2"
                                                  (HIDE -3)
                                                  (("2"
                                                    (CASE
                                                     "NOT verts_of(w!1)(v!1)")
                                                    (("1"
                                                      (CASE
                                                       "subgraph?(G_from(G!1,w!1),del_vert(Gp,v!1))")
                                                      (("1"
                                                        (CASE
                                                         "size(del_vert(Gp, v!1)) = size(Gp) - 1")
                                                        (("1"
                                                          (INST
                                                           -8
                                                           "del_vert(Gp, v!1)")
                                                          (("1"
                                                            (ASSERT)
                                                            NIL)))
                                                         ("2"
                                                          (EXPAND "size")
                                                          (("2"
                                                            (HIDE -5)
                                                            (("2"
                                                              (EXPAND
                                                               "del_vert")
                                                              (("2"
                                                                (REWRITE
                                                                 "card_remove")
                                                                NIL)))))))))
                                                       ("2"
                                                        (EXPAND "verts_of")
                                                        (("2"
                                                          (REWRITE
                                                           "del_vert_subgraph"
                                                           +)
                                                          (("1"
                                                            (HIDE 2)
                                                            (("1"
                                                              (EXPAND
                                                               "subgraph?")
                                                              (("1"
                                                                (PROPAX)
                                                                NIL)))))
                                                           ("2"
                                                            (EXPAND
                                                             "verts_of")
                                                            (("2"
                                                              (PROPAX)
                                                              NIL)))))))))
                                                     ("2"
                                                      (EXPAND "verts_of")
                                                      (("2"
                                                        (SKOSIMP*)
                                                        (("2"
                                                          (INST?)
                                                          (("2"
                                                            (HIDE
                                                             -5
                                                             -6
                                                             -7
                                                             -8
                                                             -9)
                                                            (("2"
                                                              (REPLACE -1)
                                                              (("2"
                                                                (HIDE -1)
                                                                (("2"
                                                                  (LEMMA
                                                                   "tree_deg")
                                                                  (("2"
                                                                    (INST?)
                                                                    (("2"
                                                                      (ASSERT)
                                                                      NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
         ("2" (TYPEPRED "w!1")
          (("2" (EXPAND "walk?")
            (("2" (FLATTEN)
              (("2" (HIDE -2 -3 2)
                (("2" (HIDE -1)
                  (("2" (LEMMA "tree_containing_lem")
                    (("2" (INST -1 "G!1" "w!1")
                      (("2" (FLATTEN)
                        (("2" (HIDE -3)
                          (("2" (EXPAND "subgraph?")
                            (("2" (FLATTEN)
                              (("2" (HIDE -1 -3)
                                (("2" (EXPAND "size")
                                  (("2" (LEMMA "card_subset[T]")
                                    (("2" (INST?)
                                      (("2"
                                        (ASSERT)
                                        NIL)))))))))))))))))))))))))))))))))
       ("2" (PROPAX) NIL))))))))
$$$trees.pvs
trees[T: TYPE]: THEORY
BEGIN
   IMPORTING graph_deg[T], graph_ops[T], subgraphs[T]
   G,GP,C,GG: VAR graph[T]
   tree?(G): RECURSIVE bool = card[T](vert(G)) = 1 OR
                         (EXISTS (v: (vert(G))): deg(v,G) = 1 AND
                                  tree?(del_vert[T](G,v)))
             MEASURE size(G)
   tree_nonempty: LEMMA tree?(G) IMPLIES NOT empty?(G)
   Tree: TYPE = {G: graph[T] | tree?(G)}
END trees
$$$trees.prf
(|trees|
 (|tree?_TCC1| "" (SKOSIMP*)
  (("" (EXPAND "size")
    (("" (EXPAND "del_vert")
      (("" (REWRITE "card_remove") (("" (ASSERT) NIL)))))))))
 (|tree_nonempty| "" (SKOSIMP*)
  (("" (EXPAND "empty?")
    (("" (USE "card_empty?[T]")
      (("" (ASSERT)
        (("" (IFF)
          (("" (ASSERT)
            (("" (EXPAND "tree?")
              (("" (SKOSIMP*)
                (("" (USE "deg_to_card")
                  (("" (ASSERT)
                    (("" (EXPAND "size") (("" (ASSERT) NIL))))))))))))))))))))))))
$$$max_subtrees.pvs
max_subtrees[T: TYPE]: THEORY
BEGIN
   IMPORTING trees[T]
   G: VAR Graph[T]    % not empty?(G)
   IMPORTING  max_subgraphs[T]
   v: VAR T
   sing_is_tree: LEMMA tree?[T](singleton_graph(v))
   tree_in: LEMMA (EXISTS (Tr: Tree[T]): subgraph?(Tr,G) AND
                          nonempty?[T](vert(Tr)))
   Tr,S: VAR Tree[T]
   Subtree(G: graph[T]): TYPE = {Tr: Tree | subgraph?(Tr,G)}
   max_subtree(G: Graph[T]): Subtree(G) = max_subgraph(G,(LAMBDA G: tree?(G)))
   max_subtree_tree    : LEMMA tree?(max_subtree(G))
   max_subtree_subgraph: LEMMA subgraph?(max_subtree(G),G)
   max_subtree_max     : LEMMA FORALL (SS: Subtree(G)):
                                         size(SS) <= size(max_subtree(G))
END max_subtrees
$$$max_subtrees.prf
(|max_subtrees|
 (|sing_is_tree| "" (SKOSIMP*)
  (("" (EXPAND "tree?")
    (("" (PROP)
      (("" (HIDE 2)
        (("" (EXPAND "singleton_graph")
          (("" (REWRITE "card_singleton") NIL)))))))))))
 (|tree_in| "" (SKOSIMP*)
  (("" (TYPEPRED "G!1")
    (("" (HIDE -2)
      (("" (EXPAND "nonempty?")
        (("" (EXPAND "empty?")
          (("" (SKOSIMP*)
            (("" (EXPAND "member")
              (("" (CASE "isolated?(G!1)")
                (("1" (INST 1 "singleton_graph(x!1)")
                  (("1" (GRIND) NIL) ("2" (REWRITE "sing_is_tree") NIL)))
                 ("2" (EXPAND "isolated?")
                  (("2" (EXPAND "empty?")
                    (("2" (SKOSIMP*)
                      (("2" (EXPAND "member")
                        (("2" (TYPEPRED "x!2")
                          (("2" (SKOSIMP*)
                            (("2" (REPLACE -1)
                              (("2" (HIDE -1)
                                (("2" (TYPEPRED "G!1")
                                  (("2" (INST?)
                                    (("1" (ASSERT)
                                      (("1"
                                        (INST?)
                                        (("1"
                                          (ASSERT)
                                          (("1"
                                            (INST
                                             2
                                             "(# vert := edg[T](x!3,y!1), edges := singleton[doubleton](dbl[T](x!3,y!1)) #)")
                                            (("1"
                                              (EXPAND "edg")
                                              (("1"
                                                (EXPAND "subgraph?")
                                                (("1"
                                                  (PROP)
                                                  (("1"
                                                    (TYPEPRED "G!1")
                                                    (("1"
                                                      (INST?)
                                                      (("1"
                                                        (HIDE -1)
                                                        (("1"
                                                          (SPLIT -1)
                                                          (("1"
                                                            (INST-CP -1 "y!1")
                                                            (("1"
                                                              (INST -1 "x!3")
                                                              (("1"
                                                                (HIDE -3)
                                                                (("1"
                                                                  (EXPAND
                                                                   "dbl")
                                                                  (("1"
                                                                    (GRIND)
                                                                    NIL)))))))))
                                                           ("2"
                                                            (PROPAX)
                                                            NIL)))))
                                                       ("2"
                                                        (INST?)
                                                        (("2"
                                                          (ASSERT)
                                                          NIL)))))))
                                                   ("2"
                                                    (EXPAND "subset?")
                                                    (("2"
                                                      (SKOSIMP*)
                                                      (("2"
                                                        (EXPAND "member")
                                                        (("2"
                                                          (EXPAND "singleton")
                                                          (("2"
                                                            (ASSERT)
                                                            NIL)))))))))
                                                   ("3"
                                                    (INST -1 "x!3")
                                                    (("3"
                                                      (EXPAND "dbl")
                                                      (("3" (PROPAX) NIL)))))
                                                   ("4"
                                                    (EXPAND "subset?")
                                                    (("4"
                                                      (SKOSIMP*)
                                                      (("4"
                                                        (EXPAND "member")
                                                        (("4"
                                                          (TYPEPRED "G!1")
                                                          (("4"
                                                            (INST?)
                                                            (("1"
                                                              (ASSERT)
                                                              (("1"
                                                                (INST?)
                                                                (("1"
                                                                  (ASSERT)
                                                                  NIL)))))
                                                             ("2"
                                                              (INST?)
                                                              (("2"
                                                                (ASSERT)
                                                                NIL)))))))))))))
                                                   ("5"
                                                    (EXPAND "subset?")
                                                    (("5"
                                                      (SKOSIMP*)
                                                      (("5"
                                                        (EXPAND "member")
                                                        (("5"
                                                          (EXPAND "singleton")
                                                          (("5"
                                                            (ASSERT)
                                                            NIL)))))))))
                                                   ("6"
                                                    (INST -1 "x!3")
                                                    (("6"
                                                      (EXPAND "dbl")
                                                      (("6"
                                                        (PROPAX)
                                                        NIL)))))))))))
                                             ("2"
                                              (SPLIT +)
                                              (("1"
                                                (SKOSIMP*)
                                                (("1"
                                                  (EXPAND "singleton")
                                                  (("1"
                                                    (ASSERT)
                                                    (("1"
                                                      (REPLACE -1)
                                                      (("1"
                                                        (HIDE -1)
                                                        (("1"
                                                          (EXPAND "edg")
                                                          (("1"
                                                            (PROPAX)
                                                            NIL)))))))))))))
                                               ("2"
                                                (HIDE -2)
                                                (("2"
                                                  (EXPAND "tree?")
                                                  (("2"
                                                    (FLATTEN)
                                                    (("2"
                                                      (INST 2 "x!3")
                                                      (("1"
                                                        (PROP)
                                                        (("1"
                                                          (HIDE -1 -3 2)
                                                          (("1"
                                                            (EXPAND "deg")
                                                            (("1"
                                                              (EXPAND
                                                               "incident_edges")
                                                              (("1"
                                                                (CASE-REPLACE
                                                                 "{e: doubleton[T] |
            singleton[doubleton](dbl[T](x!3, y!1))(e) AND e(x!3)} =
            singleton[doubleton](dbl[T](x!3, y!1))")
                                                                (("1"
                                                                  (REWRITE
                                                                   "card_singleton")
                                                                  (("1"
                                                                    (INST?)
                                                                    (("1"
                                                                      (ASSERT)
                                                                      NIL)))))
                                                                 ("2"
                                                                  (HIDE 2)
                                                                  (("2"
                                                                    (APPLY-EXTENSIONALITY
                                                                     1
                                                                     :HIDE?
                                                                     T)
                                                                    (("1"
                                                                      (GRIND)
                                                                      NIL)
                                                                     ("2"
                                                                      (INST?)
                                                                      (("2"
                                                                        (ASSERT)
                                                                        NIL)))
                                                                     ("3"
                                                                      (SKOSIMP*)
                                                                      (("3"
                                                                        (INST?)
                                                                        (("3"
                                                                          (ASSERT)
                                                                          NIL)))))))))
                                                                 ("3"
                                                                  (INST?)
                                                                  (("3"
                                                                    (ASSERT)
                                                                    NIL)))
                                                                 ("4"
                                                                  (SKOSIMP*)
                                                                  (("4"
                                                                    (INST?)
                                                                    (("4"
                                                                      (ASSERT)
                                                                      NIL)))))))))))))
                                                         ("2"
                                                          (CASE-REPLACE
                                                           "del_vert[T]((# vert := edg[T](x!3, y!1),
                              edges :=
                                singleton[doubleton]
                                  (dbl[T](x!3,
                                          y!1))
                              #),
                           x!3) = singleton_graph(y!1)")
                                                          (("1"
                                                            (HIDE -1)
                                                            (("1"
                                                              (REWRITE
                                                               "sing_is_tree")
                                                              NIL)))
                                                           ("2"
                                                            (HIDE 2 3)
                                                            (("2"
                                                              (HIDE -1 -2)
                                                              (("2"
                                                                (APPLY-EXTENSIONALITY
                                                                 :HIDE?
                                                                 T)
                                                                (("1"
                                                                  (GRIND)
                                                                  (("1"
                                                                    (APPLY-EXTENSIONALITY
                                                                     :HIDE?
                                                                     T)
                                                                    (("1"
                                                                      (GRIND)
                                                                      NIL)
                                                                     ("2"
                                                                      (SKOSIMP*)
                                                                      (("2"
                                                                        (INST?)
                                                                        (("2"
                                                                          (ASSERT)
                                                                          NIL)))))))))
                                                                 ("2"
                                                                  (EXPAND
                                                                   "del_vert")
                                                                  (("2"
                                                                    (EXPAND
                                                                     "remove")
                                                                    (("2"
                                                                      (EXPAND
                                                                       "singleton_graph")
                                                                      (("2"
                                                                        (EXPAND
                                                                         "member")
                                                                        (("2"
                                                                          (EXPAND
                                                                           "singleton")
                                                                          (("2"
                                                                            (EXPAND
                                                                             "edg")
                                                                            (("2"
                                                                              (EXPAND
                                                                               "dbl")
                                                                              (("2"
                                                                                (APPLY-EXTENSIONALITY
                                                                                 1
                                                                                 :HIDE?
                                                                                 T)
                                                                                (("2"
                                                                                  (IFF
                                                                                   1)
                                                                                  (("2"
                                                                                    (GROUND)
                                                                                    NIL)))))))))))))))))))
                                                                 ("3"
                                                                  (SKOSIMP*)
                                                                  (("3"
                                                                    (EXPAND
                                                                     "edg")
                                                                    (("3"
                                                                      (EXPAND
                                                                       "singleton")
                                                                      (("3"
                                                                        (ASSERT)
                                                                        NIL)))))))
                                                                 ("4"
                                                                  (EXPAND
                                                                   "edg")
                                                                  (("4"
                                                                    (REWRITE
                                                                     "finite_dbl")
                                                                    NIL)))
                                                                 ("5"
                                                                  (INST?)
                                                                  (("5"
                                                                    (ASSERT)
                                                                    NIL)))))))))
                                                           ("3"
                                                            (SKOSIMP*)
                                                            (("3"
                                                              (EXPAND
                                                               "singleton")
                                                              (("3"
                                                                (EXPAND "edg")
                                                                (("3"
                                                                  (ASSERT)
                                                                  NIL)))))))
                                                           ("4"
                                                            (EXPAND "edg")
                                                            (("4"
                                                              (REWRITE
                                                               "finite_dbl")
                                                              NIL)))
                                                           ("5"
                                                            (REWRITE
                                                             "finite_singleton")
                                                            (("5"
                                                              (INST?)
                                                              (("5"
                                                                (ASSERT)
                                                                NIL)))))
                                                           ("6"
                                                            (INST?)
                                                            (("6"
                                                              (ASSERT)
                                                              NIL)))))))
                                                       ("2"
                                                        (EXPAND "edg")
                                                        (("2"
                                                          (EXPAND "dbl")
                                                          (("2"
                                                            (PROPAX)
                                                            NIL)))))))))))))))
                                             ("3"
                                              (EXPAND "edg")
                                              (("3"
                                                (REWRITE "finite_dbl")
                                                NIL)))
                                             ("4"
                                              (REWRITE "finite_singleton")
                                              (("4"
                                                (INST?)
                                                (("4" (ASSERT) NIL)))))
                                             ("5"
                                              (INST?)
                                              (("5" (ASSERT) NIL)))))))))))
                                     ("2" (INST?)
                                      (("2"
                                        (ASSERT)
                                        NIL)))))))))))))))))))))))))))))))))))))))
 (|max_subtree_TCC1| "" (SKOSIMP*)
  (("" (LEMMA "tree_in")
    (("" (INST?)
      (("" (SKOSIMP*)
        (("" (INST?)
          (("" (PROP) (("" (EXPAND "extend") (("" (ASSERT) NIL)))))))))))))))
 (|max_subtree_TCC2| "" (SKOSIMP*)
  (("" (PROP)
    (("1" (LEMMA "max_subgraph_in")
      (("1" (INST?)
        (("1" (EXPAND "extend") (("1" (ASSERT) NIL)))
         ("2" (HIDE 2)
          (("2" (LEMMA "tree_in")
            (("2" (INST?)
              (("2" (SKOSIMP*)
                (("2" (INST?)
                  (("2" (ASSERT)
                    (("2" (EXPAND "extend")
                      (("2" (PROPAX) NIL)))))))))))))))))))
     ("2" (EXPAND "extend") (("2" (ASSERT) NIL)))))))
 (|max_subtree_tree| "" (SKOSIMP*)
  (("" (EXPAND "max_subtree")
    (("" (LEMMA "max_subgraph_in")
      (("" (INST?)
        (("1" (EXPAND "extend") (("1" (ASSERT) NIL)))
         ("2" (HIDE 2)
          (("2" (LEMMA "tree_in")
            (("2" (INST?)
              (("2" (SKOSIMP*)
                (("2" (INST?)
                  (("2" (EXPAND "extend")
                    (("2" (ASSERT) NIL)))))))))))))))))))))
 (|max_subtree_subgraph| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|max_subtree_max| "" (SKOSIMP*)
  (("" (EXPAND "max_subtree")
    (("" (LEMMA "max_subgraph_is_max")
      (("" (INST?)
        (("1" (EXPAND "extend")
          (("1" (GROUND)
            (("1" (HIDE 2)
              (("1" (TYPEPRED "SS!1")
                (("1" (HIDE -1 -3)
                  (("1" (LEMMA "tree_nonempty")
                    (("1" (INST?)
                      (("1" (EXPAND "empty?")
                        (("1" (EXPAND "nonempty?")
                          (("1" (PROPAX) NIL)))))))))))))))))))
         ("2" (HIDE 2)
          (("2" (LEMMA "tree_in")
            (("2" (INST?)
              (("2" (SKOSIMP*)
                (("2" (INST?)
                  (("2" (ASSERT)
                    (("2" (EXPAND "extend")
                      (("2" (PROPAX) NIL))))))))))))))))))))))))
$$$min_lem.pvs
min_lem: THEORY
BEGIN
  IMPORTING min_nat
  S: VAR (nonempty?[nat])
  min_lem        : LEMMA minimum?(min(S), S)
END min_lem
$$$min_lem.prf
(|min_lem|
 (|min_lem| "" (SKOSIMP*)
  (("" (LEMMA "min_def") (("" (INST?) (("" (ASSERT) NIL))))))))
$$$max_upto.pvs
max_upto[N: nat]: THEORY
  EXPORTING ALL
BEGIN
  IMPORTING min_lem
  S: VAR (nonempty?[upto[N]])
  n,a,x: VAR upto[N]
  max(S): {a: upto[N] | S(a) AND (FORALL x: S(x) IMPLIES a >= x)}
  maximum?(a, S) : bool = S(a) AND (FORALL x: S(x) IMPLIES a >= x)
  max_def         : LEMMA max(S) = a IFF maximum?(a, S)
  max_lem         : LEMMA maximum?(max(S), S)
END max_upto
$$$max_upto.prf
(|max_upto|
 (|max_TCC1| "" (INST 1 "(LAMBDA S: N - min({y: upto[N] | S(N-y)}))")
  (("1" (SKOSIMP*)
    (("1" (LEMMA "min_lem")
      (("1" (EXPAND "extend")
        (("1" (INST?)
          (("1" (EXPAND "minimum?")
            (("1" (FLATTEN)
              (("1" (ASSERT)
                (("1" (GROUND)
                  (("1" (SKOSIMP*)
                    (("1" (INST -4 "N-x!1") (("1" (ASSERT) NIL)))))))))))))
           ("2" (HIDE 2)
            (("2" (EXPAND "nonempty?")
              (("2" (TYPEPRED "S!1")
                (("2" (EXPAND "nonempty?")
                  (("2" (EXPAND "empty?")
                    (("2" (SKOSIMP*)
                      (("2" (EXPAND "member")
                        (("2" (INST -2 "N-x!1")
                          (("2" (ASSERT) NIL)))))))))))))))))
           ("3" (HIDE 2) (("3" (SKOSIMP*) (("3" (ASSERT) NIL)))))))))))))
   ("2" (SKOSIMP*)
    (("2" (TYPEPRED "S!1")
      (("2" (EXPAND "nonempty?")
        (("2" (EXPAND "empty?")
          (("2" (SKOSIMP*)
            (("2" (EXPAND "member")
              (("2" (INST -2 "N-x!1")
                (("2" (EXPAND "extend") (("2" (PROPAX) NIL)))))))))))))))))))
 (|max_def| "" (SKOLEM-TYPEPRED)
  (("" (TYPEPRED "max(S!1)")
    (("" (PROP)
      (("1" (EXPAND "maximum?")
        (("1" (ASSERT) (("1" (SKOSIMP*) (("1" (INST?) (("1" (ASSERT) NIL)))))))))
       ("2" (EXPAND "maximum?")
        (("2" (FLATTEN)
          (("2" (INST -5 "a!1")
            (("2" (ASSERT)
              (("2" (INST -2 "max(S!1)") (("2" (ASSERT) NIL)))))))))))))))))
 (|max_lem| "" (SKOSIMP*)
  (("" (EXPAND "maximum?")
    (("" (ASSERT)
      (("" (LEMMA "max_def")
        (("" (INST?) (("" (INST?) (("" (ASSERT) NIL))))))))))))))
$$$max_subgraphs.pvs
max_subgraphs[T: TYPE]: THEORY
BEGIN
   IMPORTING  subgraphs[T], max_upto
   G: VAR graph[T]
   Gpred(G): TYPE = {P: pred[graph[T]] | (EXISTS (S: graph[T]):
                                             subgraph?(S,G) AND P(S))}
   n: VAR nat
   is_one_of_size(G: graph[T], P: Gpred(G),n: nat): bool =
            (EXISTS (S: Subgraph(G)): P(S) AND size(S) = n)
   prep0: LEMMA FORALL (G: graph[T], P: Gpred(G)):
       nonempty?[upto[size(G)]]({n: upto[size(G)] | is_one_of_size(G,P,n)})
   max_size(G: graph[T], P: Gpred(G)): upto[size(G)] =
             max({n: upto[size(G)] | is_one_of_size(G,P,n)})
   prep    : LEMMA FORALL (G: graph[T], P: Gpred(G)):
                            nonempty?[Subgraph(G)]({S: Subgraph(G)
                                | size[T](S) = max_size(G,P) AND P(S)})
   maximal?(G: graph[T], S: Subgraph(G),P: Gpred(G)): bool = P(S) AND
                       (FORALL (SS: Subgraph(G)): P(SS) IMPLIES
                                                        size(SS) <= size(S))
%  Existence TCC satisfied by
%    choose({S: Subgraph(G) | size(S) = max_size AND P(S)})
   max_subgraph(G: graph[T], P: Gpred(G)): {S: Subgraph(G) | maximal?(G,S,P)}
   max_subgraph_def    : LEMMA FORALL (P: Gpred(G)):
                                     maximal?(G,max_subgraph(G,P),P)
   max_subgraph_in     : LEMMA FORALL (P: Gpred(G)): P(max_subgraph(G,P))
   max_subgraph_is_max : LEMMA FORALL (P: Gpred(G)):
                          (FORALL (SS: Subgraph(G)): P(SS) IMPLIES
                                          size(SS) <= size(max_subgraph(G,P)))
END max_subgraphs
$$$max_subgraphs.prf
(|max_subgraphs|
 (|prep0| "" (SKOSIMP*)
  (("" (EXPAND "nonempty?")
    (("" (EXPAND "empty?")
      (("" (TYPEPRED "P!1")
        (("" (SKOSIMP*)
          (("" (INST -3 "size(S!1)")
            (("1" (EXPAND "member")
              (("1" (EXPAND "is_one_of_size")
                (("1" (INST?) (("1" (ASSERT) NIL)))))))
             ("2" (REWRITE "subgraph_smaller") NIL)))))))))))))
 (|max_size_TCC1| "" (EXPAND "nonempty?")
  (("" (EXPAND "empty?")
    (("" (EXPAND "member")
      (("" (SKOSIMP*)
        (("" (LEMMA "prep0")
          (("" (INST?)
            (("" (INST?)
              (("" (EXPAND "nonempty?")
                (("" (EXPAND "empty?")
                  (("" (SKOSIMP*)
                    (("" (EXPAND "member")
                      (("" (INST?) NIL)))))))))))))))))))))))
 (|prep| "" (SKOSIMP*)
  (("" (EXPAND "nonempty?")
    (("" (EXPAND "empty?")
      (("" (EXPAND "member")
        (("" (EXPAND "max_size")
          (("" (TYPEPRED "max({n: upto[size(G!1)] | is_one_of_size(G!1,P!1,n)})")
            (("1" (HIDE -1 -3)
              (("1" (EXPAND "is_one_of_size")
                (("1" (SKOSIMP*)
                  (("1" (INST -3 "S!1") (("1" (ASSERT) NIL)))))))))
             ("2" (REWRITE "prep0") NIL)))))))))))))
 (|max_subgraph_TCC1| ""
  (INST 1
   "(LAMBDA (G: graph[T], P: Gpred(G)): choose({S: Subgraph(G) | size(S) = max_size(G,P) AND P(S)}))")
  (("1" (SKOSIMP*)
    (("1" (EXPAND "maximal?")
      (("1" (PROP)
        (("1" (ASSERT) NIL)
         ("2" (SKOSIMP*)
          (("2" (TYPEPRED "max_size(G!1,P!1)")
            (("2" (HIDE -1)
              (("2" (EXPAND "max_size")
                (("2"
                  (TYPEPRED
                   "max({n: upto[size(G!1)] | is_one_of_size(G!1,P!1,n)})")
                  (("1" (HIDE -1 -2)
                    (("1" (INST -1 "size(SS!1)")
                      (("1" (ASSERT)
                        (("1" (HIDE -1 2)
                          (("1" (EXPAND "is_one_of_size")
                            (("1" (INST?) (("1" (ASSERT) NIL)))))))))
                       ("2" (HIDE -1 2)
                        (("2" (TYPEPRED "SS!1")
                          (("2" (HIDE -2 -2)
                            (("2" (REWRITE "subgraph_smaller") NIL)))))))))))
                   ("2" (HIDE -1 2)
                    (("2" (LEMMA "prep")
                      (("2" (REWRITE "prep0") NIL)))))))))))))))))))))
   ("2" (ASSERT) (("2" (SKOSIMP*) (("2" (LEMMA "prep") (("2" (INST?) NIL)))))))))
 (|max_subgraph_def| "" (SKOSIMP*)
  (("" (TYPEPRED "max_subgraph(G!1, P!1)") (("" (PROPAX) NIL)))))
 (|max_subgraph_in| "" (SKOSIMP*)
  (("" (TYPEPRED "max_subgraph(G!1, P!1)")
    (("" (HIDE -2 -3)
      (("" (EXPAND "maximal?") (("" (FLATTEN) (("" (PROPAX) NIL)))))))))))
 (|max_subgraph_is_max| "" (SKOSIMP*)
  (("" (TYPEPRED "max_subgraph(G!1, P!1)")
    (("" (HIDE -2 -3)
      (("" (EXPAND "maximal?")
        (("" (FLATTEN)
          (("" (HIDE -1) (("" (INST?) (("" (ASSERT) NIL))))))))))))))))
$$$subgraphs_from_walk.pvs
subgraphs_from_walk[T: TYPE]: THEORY
BEGIN
   IMPORTING graphs[T], walks[T], subgraphs[T]
   G,GG: VAR graph[T]
   t,t1,t2,v: VAR T
   i: VAR nat
   e: VAR doubleton[T]
   G_from(G, (w: Walk(G))): Subgraph(G) = (# vert  := verts_of(w),
                                             edges := edges_of(w) #)
   G_from_vert     : LEMMA FORALL (w: Walk(G)): vert(G_from(G,w)) = verts_of(w)
   vert_G_from     : LEMMA FORALL (w: Walk(G), i: below(l(w))):
                                      vert(G_from(G, w))(w(i))
   edge?_G_from    : LEMMA FORALL (w: Walk(G), i: below(l(w)-1)):
                                      edge?(G_from(G, w))(w(i), w(i+1))
   edge?_G_from_rev: LEMMA FORALL (w: Walk(G), i: below(l(w)-1)):
                                     edge?(G_from(G, w))(w(i+1), w(i))
   vert_G_from_not : LEMMA FORALL (w: Walk(G)):
                       subset?(vert(G_from(G, w)), vert(GG)) AND
                       NOT  verts_of(w)(v)
                     IMPLIES
                        subset?(vert(G_from(G, w)), remove[T](v, vert(GG)))
   IMPORTING graph_ops[T]
   del_vert_subgraph: LEMMA FORALL (w: Walk(G), v: (vert(GG))):
                              subgraph?(G_from(G, w), GG) AND
                              NOT verts_of(w)(v) IMPLIES
                                    subgraph?(G_from(G, w), del_vert(GG, v))
END subgraphs_from_walk
$$$subgraphs_from_walk.prf
(|subgraphs_from_walk|
 (|walk_edge_vert| "" (SKOSIMP*)
  (("" (EXPAND "verts_of")
    (("" (EXPAND "edges_of")
      (("" (SKOSIMP*)
        (("" (REPLACE -2)
          (("" (HIDE -2)
            (("" (EXPAND "dbl")
              (("" (SPLIT)
                (("1" (INST 1 "i!1") (("1" (ASSERT) NIL)))
                 ("2" (INST 1 "1 + i!1") (("2" (ASSERT) NIL)))))))))))))))))))
 (|G_from_TCC1| "" (SKOSIMP*)
  (("" (TYPEPRED "w!1")
    (("" (SPLIT +)
      (("1" (SKOSIMP*)
        (("1" (EXPAND "walk?")
          (("1" (FLATTEN)
            (("1" (EXPAND "verts_of")
              (("1" (EXPAND "verts_in?")
                (("1" (EXPAND "fseq")
                  (("1" (HIDE -4)
                    (("1" (EXPAND "edges_of")
                      (("1" (SKOSIMP*)
                        (("1" (REPLACE -1)
                          (("1" (HIDE -1)
                            (("1" (EXPAND "fseq")
                              (("1" (EXPAND "dbl")
                                (("1" (SPLIT -1)
                                  (("1" (REPLACE -1)
                                    (("1" (HIDE -1) (("1" (INST?) NIL)))))
                                   ("2" (INST?)
                                    (("2" (INST?)
                                      (("2"
                                        (ASSERT)
                                        NIL)))))))))))))))))))))))))))))))))
       ("2" (EXPAND "subgraph?")
        (("2" (EXPAND "walk?")
          (("2" (FLATTEN)
            (("2" (EXPAND "subset?")
              (("2" (EXPAND "member")
                (("2" (EXPAND "verts_of")
                  (("2" (EXPAND "edges_of")
                    (("2" (EXPAND "fseq")
                      (("2" (SPLIT +)
                        (("1" (SKOSIMP*)
                          (("1" (EXPAND "verts_in?")
                            (("1" (INST?) (("1" (ASSERT) NIL)))))))
                         ("2" (SKOSIMP*)
                          (("2" (EXPAND "edge?")
                            (("2" (INST?)
                              (("2" (ASSERT)
                                NIL)))))))))))))))))))))))))))))))
 (|G_from_vert| "" (SKOSIMP*) (("" (EXPAND "G_from") (("" (PROPAX) NIL)))))
 (|vert_G_from| "" (SKOSIMP*)
  (("" (EXPAND "G_from") (("" (EXPAND "verts_of") (("" (INST?) NIL)))))))
 (|edge?_G_from_TCC1| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|edge?_G_from_TCC2| "" (SUBTYPE-TCC) NIL)
 (|edge?_G_from_TCC3| "" (SUBTYPE-TCC) NIL)
 (|edge?_G_from| "" (SKOSIMP*)
  (("" (EXPAND "G_from")
    (("" (EXPAND "edge?")
      (("" (TYPEPRED "w!1")
        (("" (EXPAND "walk?")
          (("" (FLATTEN)
            (("" (INST?)
              (("" (ASSERT)
                (("" (EXPAND "edge?")
                  (("" (FLATTEN)
                    (("" (ASSERT)
                      (("" (EXPAND "edges_of")
                        (("" (INST?) NIL)))))))))))))))))))))))))
 (|edge?_G_from_rev| "" (SKOSIMP*)
  (("" (EXPAND "G_from")
    (("" (TYPEPRED "w!1")
      (("" (EXPAND "walk?")
        (("" (FLATTEN)
          (("" (EXPAND "edge?")
            (("" (INST -2 "i!1")
              (("" (ASSERT)
                (("" (FLATTEN)
                  (("" (REWRITE "dbl_comm")
                    (("" (ASSERT)
                      (("" (EXPAND "edges_of")
                        (("" (INST?)
                          (("" (HIDE -1 -2 -3 1)
                            (("" (REWRITE "dbl_comm")
                              NIL)))))))))))))))))))))))))))))
 (|vert_G_from_not| "" (SKOSIMP*)
  (("" (EXPAND "subset?")
    (("" (SKOSIMP*)
      (("" (REWRITE "G_from_vert")
        (("" (INST?)
          (("" (ASSERT)
            (("" (EXPAND "remove")
              (("" (EXPAND "member") (("" (ASSERT) NIL)))))))))))))))))
 (|del_vert_subgraph| "" (SKOSIMP*)
  (("" (EXPAND "subgraph?")
    (("" (PROP)
      (("1" (HIDE -2)
        (("1" (EXPAND "del_vert") (("1" (REWRITE "vert_G_from_not") NIL)))))
       ("2" (LEMMA "vert_G_from_not")
        (("2" (INST?)
          (("2" (INST?)
            (("2" (ASSERT)
              (("2" (EXPAND "subset?" +)
                (("2" (SKOSIMP*)
                  (("2" (EXPAND "member")
                    (("2" (REWRITE "edge_in_del_vert")
                      (("1" (HIDE -1 -3 2 3)
                        (("1" (EXPAND "subset?")
                          (("1" (INST?)
                            (("1" (EXPAND "member")
                              (("1" (PROPAX) NIL)))))))))
                       ("2" (HIDE -4 -5 1)
                        (("2" (EXPAND "subset?")
                          (("2" (INST?)
                            (("2" (EXPAND "member")
                              (("2" (NAME-REPLACE SG "G_from(G!1, w!1)")
                                (("2" (TYPEPRED "SG")
                                  (("2" (INST?)
                                    (("2" (ASSERT)
                                      (("2"
                                        (INST?)
                                        (("2"
                                          (ASSERT)
                                          (("2"
                                            (EXPAND "remove")
                                            (("2"
                                              (PROPAX)
                                              NIL))))))))))))))))))))))))))))))))))))))))))))))
$$$circuits.pvs
circuits[T: TYPE]: THEORY
BEGIN
   IMPORTING walks[T]
   G: VAR graph[T]
   reducible?(G: graph[T], w: Seq(G)): bool  =
          (EXISTS (k: posnat): k < l(w) - 1 AND w(k-1) = w(k+1))
   reduced?(G: graph[T], w: Seq(G)): bool = NOT reducible?(G,w)
%
%   cyclically_reduced?(G: graph[T], w: Long_walk(G)): bool =
%         reduced?(G,w) AND
%         (FORALL (j: below(l(w)-1)): reduced?(G,w^(j+1, l(w)-1) o w^(1,j)))
   cyclically_reduced?(G: graph[T], w: Seq(G)): bool = l(w) > 2 AND
         reduced?(G,w) AND w(1) /= w(l(w)-2)
   circuit?(G:  graph[T], w: Seq(G)): bool = walk?(G,w) AND
                                             cyclically_reduced?(G,w) AND
                                             pre_circuit?(G,w)
END circuits
$$$circuits.prf
(|circuits| (|reducible?_TCC1| "" (SUBTYPE-TCC) NIL)
 (|reducible?_TCC2| "" (SUBTYPE-TCC) NIL)
 (|cyclically_reduced?_TCC1| "" (SUBTYPE-TCC) NIL)
 (|cyclically_reduced?_TCC2| "" (SUBTYPE-TCC) NIL))
$$$fslib.pvs
fslib : THEORY
BEGIN
     IMPORTING finite_sets@finite_sets,
               finite_sets@finite_sets_below,
               finite_sets@finite_sets_card_eq
END fslib
$$$seq_pidgeon.pvs
seq_pidgeon[T: TYPE, (IMPORTING fslib)
            S: finite_set[T]]: THEORY
BEGIN
   IMPORTING seq_def
   w: VAR finite_seq[(S)]
   seq_pigeon_lem: LEMMA
          (FORALL (i,j: below(l(w))): i /= j IMPLIES w(i) /= w(j)) IMPLIES
              l(w) <= card(S)
   seq_pigeon_hole: THEOREM l(w) > card(S) IMPLIES
                      (EXISTS (i,j: below(l(w))): i /= j AND w(i) = w(j))
END seq_pidgeon
$$$seq_pidgeon.prf
(|seq_pidgeon| (T_TCC1 "" (SKOSIMP*) (("" (REWRITE "finite_below") NIL)))
 (T_1 "" (SKOSIMP*)
  (("" (EXPAND "T")
    (("" (EXPAND "fseq")
      (("" (CASE "{j: below(l(w!1)) | (seq(w!1)(j) = seq(w!1)(i!1))}(i!1)")
        (("1" (LEMMA "card_empty?[below(l(w!1))]")
          (("1" (INST -1 "{j: below(l(w!1)) | (seq(w!1)(j) = seq(w!1)(i!1))}")
            (("1"
              (CASE "card({j: below(l(w!1)) | (seq(w!1)(j) = seq(w!1)(i!1))}) = 0")
              (("1" (ASSERT)
                (("1" (HIDE -1 1)
                  (("1" (EXPAND "empty?")
                    (("1" (INST?)
                      (("1" (EXPAND "member") (("1" (PROPAX) NIL)))))))))))
               ("2" (HIDE -1 -2) (("2" (ASSERT) NIL)))
               ("3" (HIDE -1 -2 2) (("3" (REWRITE "finite_below") NIL)))))
             ("2" (REWRITE "finite_below") NIL)))))
         ("2" (HIDE 2) (("2" (GRIND) NIL)))))))))))
 (X_TCC1 "" (SKOSIMP*) (("" (REWRITE "finite_below") NIL)))
 (Y_TCC1 "" (SKOSIMP*) (("" (REWRITE "finite_below") NIL)))
 (W_TCC1 "" (SUBTYPE-TCC)) (|X_lem| "" (SKOSIMP*) (("" (POSTPONE) NIL)))
 (|XY_lem| "" (SKOSIMP*)
  (("" (CASE "fullset[below(l(w!1))] = union(X(w!1),Y(w!1))")
    (("1"
      (CASE-REPLACE
       "card(fullset[below(l(w!1))]) = card(union(X(w!1), Y(w!1)))")
      (("1" (HIDE -2)
        (("1" (REWRITE "card_union[below(l(w!1))]")
          (("1" (CASE-REPLACE "card(intersection(X(w!1), Y(w!1))) = 0")
            (("1" (HIDE -1)
              (("1" (REWRITE "card_below_fullset") (("1" (ASSERT) NIL)))))
             ("2" (HIDE -1 2)
              (("2"
                (CASE-REPLACE
                 "intersection(X(w!1), Y(w!1)) = emptyset[below(l(w!1))]")
                (("1" (HIDE -1)
                  (("1" (REWRITE "card_emptyset[below(l(w!1))]") NIL)))
                 ("2" (HIDE 2)
                  (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
                    (("2" (GRIND) NIL)))))))))
             ("3" (REWRITE "finite_below") NIL)))))))
       ("2" (ASSERT) NIL) ("3" (REWRITE "finite_below") NIL)
       ("4" (REWRITE "finite_below") NIL)))
     ("2" (HIDE 2)
      (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T) (("2" (GRIND) NIL)))))))))
 (|Y_lem| "" (SKOSIMP*)
  (("" (LEMMA "X_lem")
    (("" (INST?)
      (("" (LEMMA "XY_lem") (("" (INST?) (("" (ASSERT) NIL)))))))))))
 (|CY_lem| "" (SKOSIMP*)
  (("" (LEMMA "card_empty?[below(l(w!1))]")
    (("" (INST?)
      (("" (ASSERT)
        (("" (EXPAND "empty?")
          (("" (SKOSIMP*)
            (("" (EXPAND "member")
              (("" (HIDE -2)
                (("" (EXPAND "Y")
                  (("" (CASE-REPLACE "card(T(w!1, x!1)) > 1")
                    (("1" (HIDE -2)
                      (("1"
                        (INST 1 "choose(T(w!1,x!1))"
                         "choose(remove(choose(T(w!1,x!1)),
                                                  T(w!1,x!1)))")
                        (("1" (POSTPONE) NIL) ("2" (POSTPONE) NIL)
                         ("3" (POSTPONE) NIL)))))
                     ("2" (HIDE 2)
                      (("2" (LEMMA "T_1")
                        (("2" (INST?)
                          (("2" (ASSERT) NIL)))))))))))))))))))))))))))
 (|seq_pigeon_lem| "" (SKOSIMP*)
  (("" (CASE "l(w!1) = card(fullset[below(l(w!1))])")
    (("1" (REPLACE -1)
      (("1" (HIDE -1)
        (("1" (LEMMA "injection_and_cardinal[below(l(w!1)),T]")
          (("1" (INST?)
            (("1" (ASSERT)
              (("1" (HIDE 2)
                (("1" (INST 1 "(LAMBDA (i: below(l(w!1))): w!1(i))")
                  (("1" (EXPAND "restrict")
                    (("1" (EXPAND "injective?")
                      (("1" (SKOSIMP*)
                        (("1" (INST?)
                          (("1" (INST -2 "x2!1") (("1" (ASSERT) NIL)))))))))))
                   ("2" (HIDE -1) (("2" (GRIND) NIL)))))))))
             ("2" (REWRITE "finite_below") NIL)))))))))
     ("2" (HIDE -1 2) (("2" (REWRITE "card_below_fullset") NIL)))
     ("3" (REWRITE "finite_below") NIL)))))
 (|seq_pigeon_hole| "" (SKOSIMP*)
  (("" (LEMMA "seq_pigeon_lem")
    (("" (INST?)
      (("" (ASSERT)
        (("" (SKOSIMP*) (("" (INST?) (("" (ASSERT) NIL)))))))))))))
 (|seq_pigeon_hole2| "" (SKOSIMP*)
  (("" (LEMMA "seq_pigeon_lem")
    (("" (INST?)
      (("" (ASSERT)
        (("" (SKOSIMP*) (("" (INST?) (("" (ASSERT) NIL))))))))))))))
$$$path_lems.pvs
path_lems[T: TYPE]: THEORY
BEGIN
   IMPORTING paths[T]
   G: VAR graph[T]
   cycle?(G: graph[T], (w: Seq(G))): bool = pre_circuit?(G,w) AND l(w) > 1 AND
                          w(1) /= w(l(w)-2) AND
                          (FORALL (i,j: below(l(w))):
                             w(i) = w(j) IMPLIES (i = j OR
                                          (endpoint?(i,w) AND endpoint?(j,w))))
   cycle_l_gt_3: LEMMA (FORALL (w: Seq(G)): cycle?(G,w) IMPLIES l(w) > 3)
   cycle_has_path: LEMMA FORALL (w: Seq(G)): cycle?(G,w) IMPLIES
                            (EXISTS (j: below(l(w))): path?(G,w^(0,j)))
%   fslib: LIBRARY = "../lib/fs/"
%
%   IMPORTING graphs, fslib@finite_sets_card_eq, seq_pidgeon
   IMPORTING graphs, finite_sets_card_eq, seq_pidgeon
   GF: VAR Graph[T]
   Pigeon_hole: THEOREM FORALL (w: Walk(GF)): l(w) > card(vert(GF)) IMPLIES
                  (EXISTS (i,j: below(l(w))): i /= j AND w(i) = w(j))
END path_lems
$$$path_lems.prf
(|path_lems| (|cycle?_TCC1| "" (SUBTYPE-TCC) NIL)
 (|cycle?_TCC2| "" (SUBTYPE-TCC) NIL)
 (|cycle_l_gt_3| "" (SKOSIMP*)
  (("" (EXPAND "cycle?")
    (("" (FLATTEN)
      (("" (AUTO-REWRITE "fseq")
        (("" (EXPAND "pre_circuit?")
          (("" (FLATTEN) (("" (ASSERT) NIL)))))))))))))
 (|cycle_has_path_TCC1| "" (SKOSIMP*)
  (("" (EXPAND "^") (("" (TYPEPRED "j!1") (("" (ASSERT) NIL)))))))
 (|cycle_has_path| "" (SKOSIMP*)
  (("" (AUTO-REWRITE "fseq")
    (("" (LEMMA "cycle_l_gt_3")
      (("" (INST?)
        (("" (ASSERT)
          (("" (CASE "walk?(G!1, w!1)")
            (("1" (INST 1 "l(w!1)-2")
              (("1" (EXPAND "path?")
                (("1" (PROP)
                  (("1" (REWRITE "walk?_caret") NIL)
                   ("2" (SKOSIMP*)
                    (("2" (EXPAND "^")
                      (("2" (TYPEPRED "j!1")
                        (("2" (TYPEPRED "i!1")
                          (("2" (EXPAND "^")
                            (("2" (EXPAND "cycle?")
                              (("2" (FLATTEN)
                                (("2" (INST -7 "i!1" "j!1")
                                  (("1" (ASSERT)
                                    (("1" (EXPAND "fseq")
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (FLATTEN)
                                          (("1"
                                            (EXPAND "endpoint?")
                                            (("1" (ASSERT) NIL)))))))))))
                                   ("2" (ASSERT) NIL)
                                   ("3" (ASSERT) NIL)))))))))))))))))))))))
             ("2" (HIDE 2)
              (("2" (EXPAND "cycle?")
                (("2" (EXPAND "pre_circuit?")
                  (("2" (FLATTEN) (("2" (PROPAX) NIL)))))))))))))))))))))
 (|Pigeon_hole| "" (SKOSIMP*)
  (("" (LEMMA "seq_pigeon_hole[T,(vert(GF!1))]")
    (("" (INST?)
      (("1" (ASSERT)
        (("1" (SKOSIMP*)
          (("1" (INST?)
            (("1" (INST 2 "j!1")
              (("1" (EXPAND "fseq") (("1" (ASSERT) NIL)))))))))))
       ("2" (SKOSIMP*)
        (("2" (HIDE 2)
          (("2" (TYPEPRED "x1!1")
            (("2" (TYPEPRED "w!1")
              (("2" (EXPAND "walk?")
                (("2" (FLATTEN)
                  (("2" (EXPAND "verts_in?")
                    (("2" (INST?) NIL))))))))))))))))))))))
$$$walk_inductions.pvs
walk_inductions[T: TYPE]: THEORY
BEGIN
   IMPORTING walks[T]
   P: VAR pred[prewalk]
   n: VAR nat
   w,ww: VAR prewalk
   walk_prep              : LEMMA (FORALL w: P(w)) IFF
                                       (FORALL n, w : l(w) = n IMPLIES P(w))
   graph_induction_walk    : THEOREM (FORALL w:
                                 (FORALL ww: l(ww) < l(w) IMPLIES P(ww))
                                                 IMPLIES P(w))
                                   IMPLIES (FORALL w: P(w))
END walk_inductions
$$$walk_inductions.prf
(|walk_inductions|
 (|walk_prep| "" (SKOSIMP*)
  (("" (SPLIT)
    (("1" (FLATTEN) (("1" (SKOSIMP*) (("1" (INST?) NIL)))))
     ("2" (FLATTEN) (("2" (SKOSIMP*) (("2" (INST?) (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))
 (|graph_induction_walk| "" (SKOSIMP)
  (("" (REWRITE "walk_prep" +)
    (("" (INDUCT "n" 1 "NAT_induction")
      (("" (SKOSIMP*)
        (("" (INST -3 "w!1")
          (("" (SPLIT -3)
            (("1" (PROPAX) NIL)
             ("2" (SKOSIMP*)
              (("2" (INST -2 "l(ww!1)") (("2" (ASSERT) (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))))
 (|walk_to_path| "" (SKOLEM!)
  ((""
    (CASE "FORALL (w: prewalk): NOT walk_from?(G!1, w, s!1, t!1)
           OR (EXISTS (p: prewalk): path?(G!1, p) AND walk_from?(G!1, p, s!1, t!1))")
    (("1" (FLATTEN) (("1" (SKOSIMP*) (("1" (INST -1 "w!1") (("1" (ASSERT) NIL)))))))
     ("2" (HIDE 2)
      (("2" (INDUCT "w" 1 "graph_induction_walk")
        (("2" (SKOSIMP*)
          (("2" (CASE "(EXISTS (i,j: below(l(w!1))): i /= j AND seq(w!1)(i) = seq(w!1)(j))")
            (("1" (SKOSIMP*)
              (("1" (CASE "i!1 < j!1")
                (("1" (INST -3 "w!1^(0,i!1) o w!1^(j!1-1,l(w!1)-1)")
                  (("1" (SPLIT -3)
                    (("1" (POSTPONE) NIL) ("2" (PROPAX) NIL)
                     ("3" (EXPAND "^")
                      (("3" (EXPAND "o ")
                        (("3" (ASSERT)
                          (("3" (TYPEPRED "j!1") (("3" (TYPEPRED "i!1") (("3" (POSTPONE) NIL)))))))))))))
                   ("2" (POSTPONE) NIL) ("3" (ASSERT) NIL)))
                 ("2" (POSTPONE) NIL)))))
             ("2" (INST 2 "w!1")
              (("2" (ASSERT)
                (("2" (EXPAND "path?")
                  (("2" (EXPAND "walk_from?")
                    (("2" (ASSERT)
                      (("2" (FLATTEN)
                        (("2" (ASSERT)
                          (("2" (SKOSIMP*)
                            (("2" (INST 1 "i!1" "j!1")
                              (("2" (ASSERT)
                                (("2" (EXPAND "fseq") (("2" (PROPAX) NIL))))))))))))))))))))))))))))))))))))
$$$abstract_min.pvs
abstract_min[T: TYPE, size: [T -> nat], P: pred[T]]: THEORY
%------------------------------------------------------------------------------
%
%  The need for a function that returns the smallest object that
%  satisfies a particular predicate arises in many contexts.  Thus it is
%  useful to develop an "abstract" min theory that can be instantiated in
%  multiple ways to provide different min functions.  Such a theory must
%  be parameterized by
%
%    -------------------------------------------------------------------------
%    | T: TYPE          | the base type over which min is defined            |
%    | size:[T -> nat]  | the size function by which objects are compared    |
%    | P: pred[T]       | the property that the min function must satisfy    |
%    -------------------------------------------------------------------------
%
%  Author:
%
%      Ricky W. Butler   NASA Langley
%
%  Version 2.0           Last modified 10/21/97
%
%  Maintained by:
%
%     Rick Butler        NASA Langley Research Center
%                        R.W.Butler@larc.nasa.gov
%
%------------------------------------------------------------------------------
BEGIN
   ASSUMING
   T_ne: ASSUMPTION EXISTS (t: T): P(t)
   ENDASSUMING
   IMPORTING min_nat
   n: VAR nat
   S,SS: VAR T
   is_one(n): bool = (EXISTS (S: T): P(S) AND size(S) = n)
   prep0: LEMMA nonempty?({n: nat | is_one(n)})
   min_f: nat = min({n: nat | is_one(n)})
   prep1: LEMMA nonempty?({S: T | size(S) = min_f AND P(S)})
   minimal?(S): bool = P(S) AND
                       (FORALL (SS: T): P(SS) IMPLIES size(S) <= size(SS))
   min: {S: T | minimal?(S)}
   min_def: LEMMA minimal?(min)
   min_in : LEMMA P(min)
   min_is_min: LEMMA P(SS) IMPLIES size(min) <= size(SS)
END abstract_min
$$$abstract_min.prf
(|abstract_min|
 (|prep0| "" (LEMMA "T_ne")
  (("" (EXPAND "nonempty?")
    (("" (EXPAND "empty?")
      (("" (SKOSIMP*)
        (("" (EXPAND "member")
          (("" (EXPAND "is_one")
            (("" (INST -2 "size(t!1)")
              (("" (INST 1 "t!1") (("" (ASSERT) NIL)))))))))))))))))
 (|min_f_TCC1| "" (LEMMA "prep0") (("" (PROPAX) NIL)))
 (|prep1| "" (EXPAND "nonempty?")
  (("" (EXPAND "empty?")
    (("" (EXPAND "member")
      (("" (EXPAND "min_f")
        (("" (TYPEPRED "min({n: nat | is_one(n)})")
          (("1" (EXPAND "is_one")
            (("1" (SKOSIMP*) (("1" (INST -4 "S!1") (("1" (ASSERT) NIL)))))))
           ("2" (REWRITE "prep0") NIL)))))))))))
 (|min_TCC1| "" (LEMMA "prep1")
  (("" (EXPAND "nonempty?")
    (("" (EXPAND "empty?")
      (("" (SKOSIMP*)
        (("" (EXPAND "member")
          (("" (INST?)
            (("" (EXPAND "minimal?")
              (("" (ASSERT)
                (("" (EXPAND "min_f")
                  (("" (FLATTEN)
                    (("" (ASSERT)
                      (("" (SKOSIMP*)
                        (("" (TYPEPRED "min({n: nat | is_one(n)})")
                          (("1" (INST -2 "size(SS!1)")
                            (("1" (HIDE -1)
                              (("1" (ASSERT)
                                (("1" (EXPAND "is_one")
                                  (("1" (INST?) (("1" (ASSERT) NIL)))))))))))
                           ("2" (LEMMA "prep0")
                            (("2" (PROPAX) NIL)))))))))))))))))))))))))))))
 (|min_def| "" (TYPEPRED "min") (("" (PROPAX) NIL)))
 (|min_in| "" (TYPEPRED "min")
  (("" (EXPAND "minimal?") (("" (FLATTEN) (("" (PROPAX) NIL)))))))
 (|min_is_min| "" (SKOSIMP*)
  (("" (TYPEPRED "min")
    (("" (EXPAND "minimal?")
      (("" (FLATTEN) (("" (INST?) (("" (ASSERT) NIL))))))))))))
$$$sep_sets.pvs
sep_sets[T: TYPE]: THEORY
BEGIN
   IMPORTING graphs[T], walks[T]
   G: VAR graph[T]
   v,s,t: VAR T
   e: VAR doubleton[T]
   V: VAR finite_set[T]
   del_verts(G,V): graph[T] =
           (# vert := difference[T](vert(G),V),
              edges := {e | edges(G)(e) AND
                           (FORALL v: V(v) IMPLIES NOT e(v))} #)
   separates(G,V,s,t): bool = NOT V(s) AND NOT V(t) AND
                   NOT (EXISTS (w: prewalk): walk_from?(del_verts(G,V),w,s,t))
   seps(G,s,t): TYPE = {V: finite_set[T] | IF s = t OR edge?(G)(s,t) THEN
                                              V = vert(G)
                                           ELSE separates(G,V,s,t)
                                           ENDIF}
   IMPORTING abstract_min
   sep_set_exists: LEMMA (EXISTS (t: seps(G, s, t)): TRUE)
   min_sep_set(G,s,t): finite_set[T] = min[seps(G,s,t),
                                  (LAMBDA (v: seps(G,s,t)): card(v)),
                                  (LAMBDA (v: seps(G,s,t)): true)]
   separable?(G,s,t): bool = (s /= t AND NOT edge?(G)(s,t))
   min_sep_set_edge: LEMMA NOT separable?(G,s,t) IMPLIES
                                  min_sep_set(G,s,t) = vert(G)
   min_sep_set_card: LEMMA FORALL (s,t: (vert(G))): separates(G,V,s,t)
                                  IMPLIES card(min_sep_set(G,s,t)) <= card(V)
   min_sep_set_seps: LEMMA separable?(G,s,t) IMPLIES
                               separates(G,min_sep_set(G,s,t),s,t)
   min_sep_set_vert: LEMMA separable?(G,s,t) AND min_sep_set(G,s,t)(v)
                                    IMPLIES vert(G)(v)
   ends_not_in_min_sep_set: LEMMA separable?(G,s,t)  AND min_sep_set(G, s, t)(v)
                                  IMPLIES v /= s AND v /= t
   w: VAR prewalk
   walk?_del_verts_not : LEMMA walk?(G, w) AND
                                  empty?(intersection(verts_of(w),V))
                                      IMPLIES walk?(del_verts(G, V), w)
   sep_num(G,s,t): nat = card(min_sep_set(G,s,t))
   IMPORTING graph_deg[T], finite_sets@finite_sets_card_eq
   adj_verts(G,s): finite_set[T] = {v: T | (EXISTS (e: Dbl[T]):
                                         incident_edges[T](s, G)(e)
                                           AND e(v) AND NOT v = s)}
   adj_verts_lem: LEMMA card(adj_verts(G,s)) = deg(s,G)
   sep_num_min: LEMMA FORALL (s,t: (vert(G))):
                      separable?(G,s,t) IMPLIES
                       sep_num(G,s,t) <= min(deg(s,G),deg(t,G))
END sep_sets
$$$sep_sets.prf
(|sep_sets|
 (|del_verts_TCC1| "" (SKOSIMP*)
  (("" (LEMMA "finite_subset[Dbl]")
    (("" (INST?)
      (("" (INST -1 "edges(G!1)")
        (("" (ASSERT) (("" (HIDE 2) (("" (GRIND) NIL)))))))))))))
 (|del_verts_TCC2| "" (SKOSIMP*)
  (("" (INST -2 "x!1")
    (("" (ASSERT)
      (("" (EXPAND "difference")
        (("" (EXPAND "member")
          (("" (TYPEPRED "G!1")
            (("" (INST?)
              (("" (ASSERT)
                (("" (INST?) (("" (ASSERT) NIL)))))))))))))))))))
 (|sep_set_exists| "" (SKOSIMP*)
  (("" (CASE "s!1 = t!1 OR edge?(G!1)(s!1,t!1)")
    (("1" (INST 1 "vert(G!1)") (("1" (GROUND) NIL)))
     ("2" (INST 2 "{t: T | vert(G!1)(t)  AND t /= s!1 AND t /= t!1}")
      (("2" (PROP)
        (("1" (LEMMA "finite_subset[T]")
          (("1" (INST?)
            (("1" (INST?)
              (("1" (ASSERT)
                (("1" (HIDE 2 3 4) (("1" (GRIND) NIL)))))))))))
         ("2" (HIDE 4 5)
          (("2" (EXPAND "separates")
            (("2" (SKOSIMP*)
              (("2" (EXPAND "walk_from?")
                (("2" (FLATTEN)
                  (("2" (CASE "l(w!1) = 1")
                    (("1" (REPLACE -1)
                      (("1" (HIDE -1) (("1" (ASSERT) NIL)))))
                     ("2" (CASE-REPLACE "l(w!1) = 2")
                      (("1" (ASSERT)
                        (("1" (EXPAND "walk?")
                          (("1" (FLATTEN)
                            (("1" (INST -5 "0")
                              (("1"
                                (ASSERT)
                                (("1"
                                  (EXPAND "del_verts")
                                  (("1"
                                    (EXPAND "edge?")
                                    (("1"
                                      (EXPAND "fseq")
                                      (("1"
                                        (ASSERT)
                                        NIL)))))))))))))))))
                       ("2"
                        (CASE "FORALL (i: below(l(w!1))): seq(w!1)(i) = s!1 OR seq(w!1)(i) = t!1")
                        (("1" (EXPAND "walk?")
                          (("1" (FLATTEN)
                            (("1" (INST -5 "0")
                              (("1"
                                (ASSERT)
                                (("1"
                                  (EXPAND "fseq")
                                  (("1"
                                    (EXPAND "edge?")
                                    (("1"
                                      (EXPAND "del_verts")
                                      (("1"
                                        (FLATTEN)
                                        (("1"
                                          (INST -1 "1")
                                          (("1"
                                            (ASSERT)
                                            NIL)))))))))))))))))))
                         ("2" (LEMMA "walk_verts_in")
                          (("2" (INST?)
                            (("1" (SPLIT -1)
                              (("1"
                                (HIDE -4)
                                (("1"
                                  (EXPAND "verts_in?")
                                  (("1"
                                    (EXPAND "del_verts")
                                    (("1"
                                      (EXPAND "difference")
                                      (("1"
                                        (EXPAND "member")
                                        (("1"
                                          (SKOSIMP*)
                                          (("1"
                                            (INST?)
                                            (("1"
                                              (FLATTEN)
                                              (("1"
                                                (ASSERT)
                                                NIL)))))))))))))))))
                               ("2" (PROPAX) NIL)))
                             ("2" (HIDE -1 -2 -3 2 3 4 5 6)
                              (("2"
                                (LEMMA "finite_subset[T]")
                                (("2"
                                  (INST?)
                                  (("2"
                                    (INST -1 "vert(G!1)")
                                    (("2"
                                      (ASSERT)
                                      (("2"
                                        (HIDE 2)
                                        (("2"
                                          (GRIND)
                                          NIL)))))))))))))))))))))))))))))))))))))))))
 (|min_sep_set_TCC1| "" (SKOSIMP*)
  (("" (LEMMA "sep_set_exists") (("" (INST?) NIL)))))
 (|min_sep_set_edge| "" (SKOSIMP*)
  (("" (EXPAND "separable?")
    (("" (EXPAND "min_sep_set")
      ((""
        (LEMMA "min_in[seps(G!1, s!1, t!1),
                (LAMBDA (v: seps(G!1, s!1, t!1)): card(v)),
                (LAMBDA (v: seps(G!1, s!1, t!1)): TRUE)]")
        (("1"
          (TYPEPRED
           "min[seps(G!1, s!1, t!1), (LAMBDA (v: seps(G!1, s!1, t!1)): card(v)),
           (LAMBDA (v: seps(G!1, s!1, t!1)): TRUE)]")
          (("1" (EXPAND "minimal?")
            (("1" (ASSERT) (("1" (FLATTEN) (("1" (ASSERT) NIL)))))))
           ("2" (SKOSIMP*)
            (("2" (LEMMA "sep_set_exists") (("2" (INST?) NIL)))))))
         ("2" (LEMMA "sep_set_exists") (("2" (INST?) NIL)))))))))))
 (|min_sep_set_card| "" (SKOSIMP*)
  (("" (EXPAND "min_sep_set")
    ((""
      (LEMMA "min_is_min[seps(G!1, s!1, t!1),
                (LAMBDA (v: seps(G!1, s!1, t!1)): card(v)),
                (LAMBDA (v: seps(G!1, s!1, t!1)): TRUE)]")
      (("1" (INST -1 "V!1")
        (("1" (BETA) (("1" (ASSERT) NIL)))
         ("2" (HIDE 2)
          (("2" (GROUND)
            (("1" (EXPAND "separates")
              (("1" (FLATTEN)
                (("1" (INST 4 "gen_seq1(G!1,s!1)")
                  (("1" (EXPAND "walk_from?")
                    (("1" (EXPAND "gen_seq1")
                      (("1" (EXPAND "walk?")
                        (("1" (EXPAND "verts_in?")
                          (("1" (SKOSIMP*)
                            (("1" (EXPAND "del_verts")
                              (("1"
                                (EXPAND "difference")
                                (("1"
                                  (EXPAND "member")
                                  (("1"
                                    (PROPAX)
                                    NIL)))))))))))))))))))))))
             ("2" (EXPAND "separates")
              (("2" (FLATTEN)
                (("2" (INST 4 "gen_seq2(G!1,s!1,t!1)")
                  (("2" (EXPAND "walk_from?")
                    (("2" (EXPAND "gen_seq2")
                      (("2" (EXPAND "del_verts")
                        (("2" (EXPAND "walk?")
                          (("2" (SPLIT 4)
                            (("1" (EXPAND "verts_in?")
                              (("1"
                                (SKOSIMP*)
                                (("1"
                                  (EXPAND "difference")
                                  (("1"
                                    (EXPAND "member")
                                    (("1" (GROUND) NIL)))))))))
                             ("2" (SKOSIMP*)
                              (("2"
                                (EXPAND "fseq")
                                (("2"
                                  (EXPAND "edge?")
                                  (("2"
                                    (FLATTEN)
                                    (("2"
                                      (ASSERT)
                                      (("2"
                                        (SKOSIMP*)
                                        (("2"
                                          (EXPAND "dbl")
                                          (("2"
                                            (GROUND)
                                            NIL)))))))))))))))))))))))))))))))))))))
       ("2" (LEMMA "sep_set_exists") (("2" (INST?) NIL)))))))))
 (|min_sep_set_seps| "" (SKOSIMP*)
  (("" (EXPAND "separable?")
    (("" (FLATTEN)
      ((""
        (LEMMA "min_in[seps(G!1, s!1, t!1),
                (LAMBDA (v: seps(G!1, s!1, t!1)): card(v)),
                (LAMBDA (v: seps(G!1, s!1, t!1)): TRUE)]")
        (("1"
          (TYPEPRED
           "min[seps(G!1, s!1, t!1), (LAMBDA (v: seps(G!1, s!1, t!1)): card(v)),
           (LAMBDA (v: seps(G!1, s!1, t!1)): TRUE)]")
          (("1" (ASSERT)
            (("1" (EXPAND "min_sep_set") (("1" (PROPAX) NIL)))))
           ("2" (SKOSIMP*)
            (("2" (LEMMA "sep_set_exists") (("2" (INST?) NIL)))))))
         ("2" (LEMMA "sep_set_exists") (("2" (INST?) NIL)))))))))))
 (|min_sep_set_vert| "" (SKOSIMP*)
  ((""
    (TYPEPRED
     "min[seps(G!1, s!1, t!1), (LAMBDA (v: seps(G!1, s!1, t!1)): card(v)),
          (LAMBDA (v: seps(G!1, s!1, t!1)): TRUE)]")
    (("1" (HIDE -2 -3 -4)
      (("1" (EXPAND "minimal?")
        (("1" (INST -1 "remove(v!1,(min_sep_set(G!1, s!1, t!1)))")
          (("1" (REWRITE "card_remove[T]")
            (("1" (ASSERT)
              (("1" (EXPAND "min_sep_set" -1) (("1" (ASSERT) NIL)))))))
           ("2" (SPLIT 1)
            (("1" (FLATTEN)
              (("1" (LEMMA "min_sep_set_edge")
                (("1" (INST?)
                  (("1" (SPLIT -1)
                    (("1" (REPLACE -1) (("1" (PROPAX) NIL)))
                     ("2" (HIDE -1)
                      (("2" (EXPAND "separable?")
                        (("2" (FLATTEN)
                          (("2" (ASSERT) NIL)))))))))))))))
             ("2" (FLATTEN)
              (("2" (GROUND)
                (("2" (LEMMA "min_sep_set_seps")
                  (("2" (INST?)
                    (("2" (ASSERT)
                      (("2" (EXPAND "separates")
                        (("2" (FLATTEN)
                          (("2" (EXPAND "remove")
                            (("2" (EXPAND "member")
                              (("2"
                                (ASSERT)
                                (("2"
                                  (SKOSIMP*)
                                  (("2"
                                    (INST 3 "w!1")
                                    (("2"
                                      (EXPAND "walk_from?")
                                      (("2"
                                        (FLATTEN)
                                        (("2"
                                          (EXPAND "walk?")
                                          (("2"
                                            (FLATTEN)
                                            (("2"
                                              (ASSERT)
                                              (("2"
                                                (SPLIT 3)
                                                (("1"
                                                  (HIDE -4)
                                                  (("1"
                                                    (EXPAND
                                                     "verts_in?")
                                                    (("1"
                                                      (SKOSIMP*)
                                                      (("1"
                                                        (EXPAND
                                                         "del_verts")
                                                        (("1"
                                                          (EXPAND
                                                           "difference")
                                                          (("1"
                                                            (EXPAND
                                                             "member")
                                                            (("1"
                                                              (INST
                                                               -3
                                                               "i!1")
                                                              (("1"
                                                                (FLATTEN)
                                                                (("1"
                                                                  (ASSERT)
                                                                  NIL)))))))))))))))))
                                                 ("2"
                                                  (HIDE -3)
                                                  (("2"
                                                    (SKOSIMP*)
                                                    (("2"
                                                      (INST?)
                                                      (("2"
                                                        (ASSERT)
                                                        (("2"
                                                          (EXPAND
                                                           "edge?")
                                                          (("2"
                                                            (FLATTEN)
                                                            (("2"
                                                              (EXPAND
                                                               "fseq")
                                                              (("2"
                                                                (EXPAND
                                                                 "del_verts")
                                                                (("2"
                                                                  (FLATTEN)
                                                                  (("2"
                                                                    (ASSERT)
                                                                    (("2"
                                                                      (SKOSIMP*)
                                                                      (("2"
                                                                        (EXPAND
                                                                         "dbl")
                                                                        (("2"
                                                                          (INST
                                                                           -7
                                                                           "v!2")
                                                                          (("2"
                                                                            (ASSERT)
                                                                            (("2"
                                                                              (SPLIT
                                                                               -7)
                                                                              (("1"
                                                                                (PROPAX)
                                                                                NIL)
                                                                               ("2"
                                                                                (CASE-REPLACE
                                                                                 "v!1 = v!2")
                                                                                (("1"
                                                                                  (HIDE
                                                                                   -1
                                                                                   -3
                                                                                   -5
                                                                                   -6
                                                                                   -7
                                                                                   -8
                                                                                   -9
                                                                                   1
                                                                                   2
                                                                                   3
                                                                                   4
                                                                                   5)
                                                                                  (("1"
                                                                                    (REVEAL
                                                                                     -9)
                                                                                    (("1"
                                                                                      (EXPAND
                                                                                       "verts_in?")
                                                                                      (("1"
                                                                                        (EXPAND
                                                                                         "del_verts")
                                                                                        (("1"
                                                                                          (EXPAND
                                                                                           "difference")
                                                                                          (("1"
                                                                                            (EXPAND
                                                                                             "member")
                                                                                            (("1"
                                                                                              (SPLIT
                                                                                               -3)
                                                                                              (("1"
                                                                                                (INST?)
                                                                                                (("1"
                                                                                                  (FLATTEN)
                                                                                                  (("1"
                                                                                                    (ASSERT)
                                                                                                    NIL)))))
                                                                                               ("2"
                                                                                                (INST?)
                                                                                                (("2"
                                                                                                  (FLATTEN)
                                                                                                  (("2"
                                                                                                    (ASSERT)
                                                                                                    NIL)))))))))))))))))))
                                                                                 ("2"
                                                                                  (ASSERT)
                                                                                  NIL)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
     ("2" (LEMMA "sep_set_exists")
      (("2" (INST?)
        (("2" (SKOSIMP*)
          (("2" (LEMMA "sep_set_exists") (("2" (INST?) NIL)))))))))
     ("3" (LEMMA "sep_set_exists") (("3" (INST?) NIL)))))))
 (|ends_not_in_min_sep_set| "" (SKOSIMP*)
  (("" (LEMMA "min_sep_set_seps")
    (("" (INST?)
      (("" (ASSERT)
        (("" (EXPAND "separates")
          (("" (FLATTEN) (("" (HIDE 3) (("" (GROUND) NIL)))))))))))))))
 (|walk?_del_verts_not| "" (SKOSIMP*)
  (("" (EXPAND "walk?")
    (("" (SPLIT +)
      (("1" (FLATTEN)
        (("1" (HIDE -2)
          (("1" (EXPAND "verts_in?")
            (("1" (SKOSIMP*)
              (("1" (EXPAND "del_verts")
                (("1" (EXPAND "intersection")
                  (("1" (EXPAND "empty?")
                    (("1" (EXPAND "difference")
                      (("1" (EXPAND "member")
                        (("1" (INST?)
                          (("1" (ASSERT)
                            (("1" (INST?)
                              (("1"
                                (ASSERT)
                                (("1"
                                  (EXPAND "verts_of")
                                  (("1"
                                    (INST?)
                                    (("1"
                                      (EXPAND "fseq")
                                      (("1"
                                        (PROPAX)
                                        NIL)))))))))))))))))))))))))))))))))
       ("2" (SKOSIMP*)
        (("2" (EXPAND "edge?")
          (("2" (INST?)
            (("2" (ASSERT)
              (("2" (FLATTEN)
                (("2" (ASSERT)
                  (("2" (EXPAND "del_verts")
                    (("2" (EXPAND "empty?")
                      (("2" (EXPAND "intersection")
                        (("2" (EXPAND "member")
                          (("2" (SKOSIMP*)
                            (("2" (INST?)
                              (("2"
                                (EXPAND "verts_of")
                                (("2"
                                  (ASSERT)
                                  (("2"
                                    (EXPAND "dbl")
                                    (("2"
                                      (SPLIT -3)
                                      (("1"
                                        (INST?)
                                        (("1" (ASSERT) NIL)))
                                       ("2"
                                        (INST?)
                                        (("2"
                                          (ASSERT)
                                          NIL)))))))))))))))))))))))))))))))))))))))))
 (|adj_verts_TCC1| "" (SKOSIMP*)
  (("" (LEMMA "finite_subset[T]")
    (("" (INST?)
      (("" (INST -1 "vert(G!1)")
        (("" (ASSERT)
          (("" (HIDE 2)
            (("" (GRIND)
              (("1" (TYPEPRED "G!1")
                (("1" (INST?)
                  (("1" (ASSERT) (("1" (INST?) (("1" (ASSERT) NIL)))))
                   ("2" (INST 1 "x!2" "y!1") (("2" (ASSERT) NIL)))))))
               ("2" (TYPEPRED "G!1")
                (("2" (INST?)
                  (("1" (ASSERT) (("1" (INST?) (("1" (ASSERT) NIL)))))
                   ("2" (INST 1 "x!2" "y!1")
                    (("2" (ASSERT) NIL)))))))))))))))))))))
 (|adj_verts_lem| "" (SKOSIMP*)
  (("" (LEMMA "card_eq_bij[T,Dbl]")
    (("" (EXPAND "deg")
      (("" (INST?)
        (("" (ASSERT)
          (("" (HIDE 2)
            ((""
              (INST 1
               "(LAMBDA (vv: (adj_verts(G!1, s!1))): dbl[T](s!1,vv))")
              (("1" (EXPAND "bijective?")
                (("1" (PROP)
                  (("1" (EXPAND "injective?")
                    (("1" (SKOSIMP*)
                      (("1"
                        (CASE "dbl[T](s!1, x1!1)(x1!1) = dbl[T](s!1, x2!1)(x1!1)")
                        (("1"
                          (CASE "dbl[T](s!1, x1!1)(x2!1) = dbl[T](s!1, x2!1)(x2!1)")
                          (("1" (HIDE -3)
                            (("1" (EXPAND "dbl")
                              (("1" (GROUND) NIL)))))
                           ("2" (ASSERT) NIL)))
                         ("2" (ASSERT) NIL)))))))
                   ("2" (EXPAND "surjective?")
                    (("2" (SKOSIMP*)
                      (("2" (TYPEPRED "y!1")
                        (("2" (SKOSIMP*)
                          (("2" (REPLACE -2)
                            (("2" (CASE "s!1 = x!1 OR s!1 = y!2")
                              (("1"
                                (SPLIT -1)
                                (("1"
                                  (REPLACE -1)
                                  (("1"
                                    (INST 2 "y!2")
                                    (("1"
                                      (EXPAND "adj_verts")
                                      (("1"
                                        (INST?)
                                        (("1"
                                          (ASSERT)
                                          (("1"
                                            (EXPAND "dbl")
                                            (("1" (PROPAX) NIL)))))
                                         ("2"
                                          (INST?)
                                          (("2"
                                            (EXPAND "dbl")
                                            (("2"
                                              (ASSERT)
                                              NIL)))))))))))))
                                 ("2"
                                  (INST 2 "x!1")
                                  (("1"
                                    (APPLY-EXTENSIONALITY 2 :HIDE? T)
                                    (("1"
                                      (EXPAND "dbl")
                                      (("1"
                                        (IFF 1)
                                        (("1" (GROUND) NIL)))))))
                                   ("2"
                                    (EXPAND "adj_verts")
                                    (("2"
                                      (INST?)
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (EXPAND "dbl")
                                          (("1" (PROPAX) NIL)))))
                                       ("2"
                                        (INST?)
                                        (("2" (ASSERT) NIL)))))))))))
                               ("2"
                                (HIDE 3)
                                (("2"
                                  (EXPAND "incident_edges")
                                  (("2"
                                    (FLATTEN)
                                    (("2"
                                      (HIDE -1)
                                      (("2"
                                        (EXPAND "dbl")
                                        (("2"
                                          (ASSERT)
                                          NIL)))))))))))))))))))))))))))
               ("2" (SKOSIMP*)
                (("2" (PROP)
                  (("1" (INST?)
                    (("1" (EXPAND "dbl")
                      (("1" (ASSERT)
                        (("1" (TYPEPRED "vv!1")
                          (("1" (EXPAND "adj_verts")
                            (("1" (PROPAX) NIL)))))))))))
                   ("2" (TYPEPRED "vv!1")
                    (("2" (EXPAND "adj_verts")
                      (("2" (SKOSIMP*)
                        (("2" (EXPAND "incident_edges")
                          (("2" (FLATTEN)
                            (("2" (LEMMA "edge_has_2_verts")
                              (("2"
                                (INST?)
                                (("2"
                                  (INST?)
                                  (("2"
                                    (ASSERT)
                                    NIL)))))))))))))))))))))))))))))))))))
 (|sep_num_min| "" (SKOSIMP*)
  (("" (EXPAND "separable?")
    (("" (FLATTEN)
      (("" (LEMMA "min_sep_set_card")
        (("" (INST -1 "G!1" "_" "s!1" "t!1")
          (("" (COPY -1)
            (("" (INST -1 "adj_verts(G!1,s!1)")
              (("" (INST -2 "adj_verts(G!1,t!1)")
                (("" (SPLIT -1)
                  (("1" (SPLIT -2)
                    (("1" (EXPAND "sep_num")
                      (("1" (LEMMA "adj_verts_lem")
                        (("1" (INST?)
                          (("1" (REPLACE -1)
                            (("1" (HIDE -1)
                              (("1"
                                (LEMMA "adj_verts_lem")
                                (("1"
                                  (INST?)
                                  (("1"
                                    (REPLACE -1)
                                    (("1"
                                      (HIDE -1)
                                      (("1"
                                        (EXPAND "min")
                                        (("1"
                                          (LIFT-IF)
                                          (("1"
                                            (GROUND)
                                            NIL)))))))))))))))))))))))
                     ("2" (HIDE -1 4)
                      (("2" (EXPAND "separates")
                        (("2" (EXPAND "adj_verts")
                          (("2" (PROP)
                            (("1" (SKOSIMP*)
                              (("1"
                                (EXPAND "incident_edges")
                                (("1"
                                  (FLATTEN)
                                  (("1"
                                    (EXPAND "edge?")
                                    (("1"
                                      (LEMMA "edge_has_2_verts")
                                      (("1"
                                        (INST?)
                                        (("1"
                                          (INST?)
                                          (("1"
                                            (ASSERT)
                                            NIL)))))))))))))))
                             ("2" (SKOSIMP*)
                              (("2"
                                (EXPAND "walk_from?")
                                (("2"
                                  (FLATTEN)
                                  (("2"
                                    (EXPAND "walk?")
                                    (("2"
                                      (EXPAND "del_verts")
                                      (("2"
                                        (EXPAND "edge?")
                                        (("2"
                                          (FLATTEN)
                                          (("2"
                                            (EXPAND "verts_in?")
                                            (("2"
                                              (EXPAND "fseq")
                                              (("2"
                                                (ASSERT)
                                                (("2"
                                                  (INST -4 "l(w!1)-2")
                                                  (("2"
                                                    (ASSERT)
                                                    (("2"
                                                      (FLATTEN)
                                                      (("2"
                                                        (ASSERT)
                                                        (("2"
                                                          (INST
                                                           -5
                                                           "seq(w!1)(l(w!1)-2)")
                                                          (("2"
                                                            (SPLIT -5)
                                                            (("1"
                                                              (EXPAND
                                                               "dbl")
                                                              (("1"
                                                                (PROPAX)
                                                                NIL)))
                                                             ("2"
                                                              (INST
                                                               1
                                                               "dbl[T](seq(w!1)(l(w!1) - 2),seq(w!1)(l(w!1) - 1))")
                                                              (("1"
                                                                (SPLIT
                                                                 1)
                                                                (("1"
                                                                  (EXPAND
                                                                   "incident_edges")
                                                                  (("1"
                                                                    (EXPAND
                                                                     "dbl")
                                                                    (("1"
                                                                      (PROPAX)
                                                                      NIL)))))
                                                                 ("2"
                                                                  (EXPAND
                                                                   "dbl")
                                                                  (("2"
                                                                    (PROPAX)
                                                                    NIL)))
                                                                 ("3"
                                                                  (ASSERT)
                                                                  NIL)))
                                                               ("2"
                                                                (INST?)
                                                                (("2"
                                                                  (ASSERT)
                                                                  NIL)))))))))))))))))))))))))))))))))))))))))))))))
                   ("2" (HIDE -1 4)
                    (("2" (EXPAND "separates")
                      (("2" (EXPAND "adj_verts")
                        (("2" (PROP)
                          (("1" (EXPAND "incident_edges")
                            (("1" (SKOSIMP*)
                              (("1"
                                (EXPAND "edge?")
                                (("1"
                                  (ASSERT)
                                  (("1"
                                    (LEMMA "edge_has_2_verts")
                                    (("1"
                                      (INST?)
                                      (("1"
                                        (INST -1 "e!1")
                                        (("1"
                                          (ASSERT)
                                          NIL)))))))))))))))
                           ("2" (SKOSIMP*)
                            (("2" (EXPAND "walk_from?")
                              (("2"
                                (FLATTEN)
                                (("2"
                                  (EXPAND "walk?")
                                  (("2"
                                    (FLATTEN)
                                    (("2"
                                      (INST -4 "0")
                                      (("2"
                                        (ASSERT)
                                        (("2"
                                          (EXPAND "del_verts")
                                          (("2"
                                            (EXPAND "edge?")
                                            (("2"
                                              (EXPAND "fseq")
                                              (("2"
                                                (FLATTEN)
                                                (("2"
                                                  (INST
                                                   -5
                                                   "seq(w!1)(1)")
                                                  (("2"
                                                    (SPLIT -5)
                                                    (("1"
                                                      (EXPAND "dbl")
                                                      (("1"
                                                        (PROPAX)
                                                        NIL)))
                                                     ("2"
                                                      (INST
                                                       1
                                                       "dbl[T](seq(w!1)(0),seq(w!1)(1))")
                                                      (("1"
                                                        (EXPAND
                                                         "incident_edges")
                                                        (("1"
                                                          (EXPAND
                                                           "dbl")
                                                          (("1"
                                                            (ASSERT)
                                                            NIL)))))
                                                       ("2"
                                                        (INST?)
                                                        (("2"
                                                          (ASSERT)
                                                          NIL))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
$$$path_ops.pvs
path_ops[T: TYPE]: THEORY
BEGIN
   IMPORTING paths[T], subgraphs[T], sep_sets[T], graph_ops[T]
   G: VAR graph[T]
   v,s,t: VAR T
   e: VAR doubleton[T]
   W,V: VAR finite_set[T]
   w: VAR prewalk
   walk?_del_vert     : LEMMA walk?(del_vert(G, v), w) IMPLIES walk?[T](G, w)
   walk?_del_vert_not : LEMMA walk?(G, w) AND NOT verts_of(w)(v)
                                          IMPLIES walk?(del_vert(G, v), w)
   path?_del_vert     : LEMMA FORALL (w: prewalk): path?(del_vert(G, v), w)
                                                       IMPLIES path?[T](G, w)
   path?_del_verts    : LEMMA FORALL (w: prewalk): path?(del_verts(G, W), w)
                                                       IMPLIES path?[T](G, w)
   IMPORTING walk_inductions[T]
   walk_to_path      : LEMMA (EXISTS (w: prewalk): walk_from?(G,w,s,t)) IMPLIES
                                 (EXISTS (p: prewalk): path?(G,p) and
                                                   walk_from?(G,p,s,t))
   walk_to_path_from : LEMMA walk_from?(G,w,s,t) IMPLIES
                                 (EXISTS (p: prewalk): path_from?(G,p,s,t))
END path_ops
$$$path_ops.prf
(|path_ops|
 (|walk?_del_vert| "" (SKOSIMP*)
  (("" (EXPAND "walk?")
    (("" (FLATTEN)
      (("" (PROP)
        (("1" (HIDE -2)
          (("1" (EXPAND "verts_in?")
            (("1" (SKOSIMP*) (("1" (INST?) (("1" (GRIND) NIL)))))))))
         ("2" (HIDE -1)
          (("2" (SKOSIMP*)
            (("2" (INST?)
              (("2" (ASSERT)
                (("2" (LEMMA "edges_del_vert")
                  (("2" (EXPAND "edge?")
                    (("2" (FLATTEN)
                      (("2" (INST?)
                        (("1" (ASSERT) NIL)
                         ("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))))))))))
 (|walk?_del_vert_not| "" (SKOSIMP*)
  (("" (EXPAND "walk?")
    (("" (FLATTEN)
      (("" (PROP)
        (("1" (HIDE -2)
          (("1" (EXPAND "verts_in?")
            (("1" (SKOSIMP*)
              (("1" (EXPAND "verts_of")
                (("1" (INST 2 "i!1")
                  (("1" (EXPAND "fseq")
                    (("1" (INST?)
                      (("1" (EXPAND "del_vert")
                        (("1" (EXPAND "remove")
                          (("1" (EXPAND "member")
                            (("1" (ASSERT) NIL)))))))))))))))))))))
         ("2" (SKOSIMP*)
          (("2" (INST?)
            (("2" (HIDE -2)
              (("2" (EXPAND "del_vert")
                (("2" (EXPAND "edge?")
                  (("2" (ASSERT)
                    (("2" (FLATTEN)
                      (("2" (ASSERT)
                        (("2" (EXPAND "verts_of")
                          (("2" (EXPAND "dbl")
                            (("2" (HIDE -3 1)
                              (("2" (SPLIT)
                                (("1" (INST?) (("1" (ASSERT) NIL)))
                                 ("2" (INST?)
                                  (("2" (ASSERT) NIL)))))))))))))))))))))))))))))))))))
 (|path?_del_vert| "" (SKOSIMP*)
  (("" (EXPAND "path?")
    (("" (FLATTEN)
      (("" (LEMMA "walk?_del_vert") (("" (INST?) (("" (ASSERT) NIL)))))))))))
 (|path?_del_verts| "" (SKOSIMP*)
  (("" (EXPAND "path?")
    (("" (FLATTEN)
      (("" (SPLIT +)
        (("1" (HIDE -2)
          (("1" (EXPAND "walk?")
            (("1" (FLATTEN)
              (("1" (SPLIT +)
                (("1" (HIDE -2)
                  (("1" (EXPAND "verts_in?")
                    (("1" (EXPAND "del_verts")
                      (("1" (EXPAND "difference")
                        (("1" (EXPAND "member")
                          (("1" (SKOSIMP*)
                            (("1" (INST?) (("1" (ASSERT) NIL)))))))))))))))
                 ("2" (SKOSIMP*)
                  (("2" (EXPAND "fseq")
                    (("2" (INST?)
                      (("2" (ASSERT)
                        (("2" (EXPAND "edge?")
                          (("2" (FLATTEN)
                            (("2" (ASSERT)
                              (("2" (EXPAND "del_verts")
                                (("2" (PROPAX) NIL)))))))))))))))))))))))))
         ("2" (PROPAX) NIL)))))))))
 (|walk_to_path| "" (SKOLEM!)
  ((""
    (CASE "FORALL (w: prewalk): NOT walk_from?(G!1, w, s!1, t!1)
           OR (EXISTS (p: prewalk): path?(G!1, p) AND walk_from?(G!1, p, s!1, t!1))")
    (("1" (FLATTEN) (("1" (SKOSIMP*) (("1" (INST -1 "w!1") (("1" (ASSERT) NIL)))))))
     ("2" (HIDE 2)
      (("2" (INDUCT "w" 1 "graph_induction_walk")
        (("2" (SKOSIMP*)
          (("2"
            (CASE "(EXISTS (i,j: below(l(w!1))): i /= j AND seq(w!1)(i) = seq(w!1)(j))")
            (("1" (SKOSIMP*)
              (("1" (CASE "i!1 < j!1")
                (("1" (INST -3 "w!1^(0,i!1) o w!1^(j!1+1,l(w!1)-1)")
                  (("1" (SPLIT -3)
                    (("1" (REWRITE "walk?_cut") NIL) ("2" (PROPAX) NIL)
                     ("3" (HIDE -2 -3 3)
                      (("3" (EXPAND "o ")
                        (("3" (EXPAND "^")
                          (("3" (EXPAND "emptyseq")
                            (("3" (LIFT-IF) (("3" (GROUND) NIL)))))))))))))
                   ("2" (EXPAND "o ")
                    (("2" (EXPAND "^")
                      (("2" (LIFT-IF)
                        (("2" (EXPAND "emptyseq") (("2" (PROPAX) NIL)))))))))))
                 ("2" (ASSERT)
                  (("2" (INST -2 "w!1^(0,j!1) o w!1^(i!1+1,l(w!1)-1)")
                    (("1" (ASSERT)
                      (("1" (SPLIT -2)
                        (("1" (HIDE 4) (("1" (REWRITE "walk?_cut") NIL)))
                         ("2" (PROPAX) NIL)
                         ("3" (EXPAND "o ")
                          (("3" (EXPAND "^")
                            (("3" (LIFT-IF)
                              (("3" (EXPAND "emptyseq") (("3" (PROPAX) NIL)))))))))))))
                     ("2" (EXPAND "o ")
                      (("2" (EXPAND "^")
                        (("2" (EXPAND "emptyseq")
                          (("2" (LIFT-IF) (("2" (GROUND) NIL)))))))))))))))))
             ("2" (HIDE -1)
              (("2" (INST 2 "w!1")
                (("2" (ASSERT)
                  (("2" (EXPAND "path?")
                    (("2" (EXPAND "walk_from?")
                      (("2" (FLATTEN)
                        (("2" (ASSERT)
                          (("2" (SKOSIMP*)
                            (("2" (EXPAND "fseq")
                              (("2" (INST?)
                                (("2" (ASSERT) NIL)))))))))))))))))))))))))))))))))
 (|walk_to_path_from| "" (SKOSIMP*)
  (("" (LEMMA "walk_to_path")
    (("" (INST?)
      (("" (INST -1 "s!1" "t!1")
        (("" (SPLIT -1)
          (("1" (SKOSIMP*)
            (("1" (INST?)
              (("1" (EXPAND "path_from?")
                (("1" (ASSERT)
                  (("1" (EXPAND "walk_from?")
                    (("1" (FLATTEN)
                      (("1" (EXPAND "from?") (("1" (ASSERT) NIL)))))))))))))))
           ("2" (INST?) NIL))))))))))))
$$$paths.pvs
paths[T: TYPE]: THEORY
BEGIN
   IMPORTING graphs[T], walks[T], seq_def
   G: VAR graph[T]
   x,y,s,t: VAR T
   i,j: VAR nat
   p,ps: VAR prewalk
   path?(G,ps): bool = walk?(G,ps) AND (FORALL (i,j: below(l(ps))):
                                          i /= j IMPLIES ps(i) /= ps(j))
   Path(G): TYPE = {p: prewalk | path?(G,p)}
   path_from?(G,ps,s,t): bool = path?(G,ps) AND from?(ps,s,t)
   Path_from(G,s,t): TYPE = {p: prewalk | path_from?(G,p,s,t)}
   endpoint?(i: nat, w: prewalk): bool = (i = 0) OR (i = l(w)-1)
   path?_verts     : LEMMA path?(G,ps) IMPLIES verts_in?(G,ps)
   path_from_l     : LEMMA path_from?(G,ps,s,t) AND s /= t IMPLIES l(ps) >= 2
   path_from_in    : LEMMA path_from?(G, ps, s, t) IMPLIES
                          vert(G)(s) AND vert(G)(t)
   path?_caret     : LEMMA i <= j AND j < l(ps) AND path?(G,ps)
                            IMPLIES path?(G,ps^(i,j))
   path_from?_caret: LEMMA  i <= j AND j < l(ps) AND path_from?(G, ps, s, t)
                         IMPLIES path_from?(G, ps^(i, j),seq(ps)(i),seq(ps)(j))
   path?_rev       : LEMMA path?(G,ps) IMPLIES path?(G,rev(ps))
   path?_gen_seq2  : LEMMA vert(G)(x) AND vert(G)(y) AND
                            edge?(G)(x,y) IMPLIES path?(G,gen_seq2(G,x,y))
   path?_add1      : LEMMA path?(G,p) AND vert(G)(x)
                            AND edge?(G)(seq(p)(l(p)-1),x)
                            AND NOT verts_of(p)(x)
                            IMPLIES path?(G,add1(p,x))
   path?_trunc1      : LEMMA path?(G,p) AND l(p) > 1 IMPLIES
                            path_from?(G,trunc1(p),seq(p)(0),seq(p)(l(p)-2))
END paths
$$$paths.prf
(|paths|
 (|path?_verts| "" (SKOSIMP*)
  (("" (EXPAND "path?")
    (("" (EXPAND "walk?") (("" (FLATTEN) (("" (PROPAX) NIL)))))))))
 (|path_from_l| "" (SKOSIMP*)
  (("" (EXPAND "path_from?")
    (("" (FLATTEN)
      (("" (EXPAND "path?")
        (("" (FLATTEN)
          (("" (EXPAND "from?")
            (("" (FLATTEN)
              (("" (EXPAND "fseq")
                (("" (INST -2 "0" "(l(ps!1)-1)")
                  (("" (SPLIT -2)
                    (("1" (ASSERT) NIL) ("2" (ASSERT) NIL)))))))))))))))))))))
 (|path_from_in| "" (SKOSIMP*)
  (("" (EXPAND "path_from?")
    (("" (FLATTEN)
      (("" (EXPAND "path?")
        (("" (FLATTEN)
          (("" (HIDE -2)
            (("" (EXPAND "walk?")
              (("" (FLATTEN)
                (("" (HIDE -2)
                  (("" (EXPAND "from?")
                    (("" (EXPAND "verts_in?")
                      (("" (FLATTEN)
                        (("" (INST-CP -1 "0")
                          (("" (INST -1 "l(ps!1) - 1")
                            (("" (ASSERT) NIL)))))))))))))))))))))))))))))
 (|path?_caret_TCC1| "" (SUBTYPE-TCC) NIL)
 (|path?_caret_TCC2| "" (SUBTYPE-TCC) NIL)
 (|path?_caret| "" (SKOSIMP*)
  (("" (EXPAND "path?")
    (("" (EXPAND "fseq")
      (("" (FLATTEN)
        (("" (SPLIT 1)
          (("1" (EXPAND "walk?")
            (("1" (SPLIT 1)
              (("1" (FLATTEN)
                (("1" (HIDE -4 -5)
                  (("1" (EXPAND "verts_in?")
                    (("1" (SKOSIMP*)
                      (("1" (TYPEPRED "i!2")
                        (("1" (EXPAND "^")
                          (("1" (LIFT-IF)
                            (("1" (ASSERT) (("1" (INST?) NIL)))))))
                         ("2" (SKOSIMP*) NIL)))))))))))
               ("2" (SKOSIMP*)
                (("2" (HIDE -6)
                  (("2" (EXPAND "fseq")
                    (("2" (EXPAND "edge?")
                      (("2" (INST - "n!1+i!1")
                        (("2" (EXPAND "^") (("2" (ASSERT) NIL)))))))))))))))))
           ("2" (SKOSIMP*)
            (("2" (EXPAND "^")
              (("2" (ASSERT)
                (("2" (INST - "i!1+i!2" "i!1+j!2")
                  (("1" (ASSERT) NIL)
                   ("2" (TYPEPRED "i!2")
                    (("2" (TYPEPRED "j!2")
                      (("2" (EXPAND "^") (("2" (ASSERT) NIL)))))))
                   ("3" (TYPEPRED "i!2")
                    (("3" (TYPEPRED "i!1")
                      (("3" (EXPAND "^")
                        (("3" (ASSERT) NIL)))))))))))))))))))))))))
 (|path_from?_caret_TCC1| "" (SUBTYPE-TCC) NIL)
 (|path_from?_caret_TCC2| "" (SUBTYPE-TCC) NIL)
 (|path_from?_caret_TCC3| "" (SUBTYPE-TCC) NIL)
 (|path_from?_caret| "" (SKOSIMP*)
  (("" (EXPAND "path_from?")
    (("" (FLATTEN)
      (("" (REWRITE "path?_caret")
        (("" (EXPAND "from?") (("" (EXPAND "^") (("" (ASSERT) NIL)))))))))))))
 (|path?_rev_TCC1| "" (SUBTYPE-TCC) NIL)
 (|path?_rev| "" (SKOSIMP*)
  (("" (EXPAND "path?")
    (("" (FLATTEN)
      (("" (REWRITE "walk?_rev")
        (("" (ASSERT)
          (("" (SKOSIMP*)
            (("" (EXPAND "fseq")
              (("" (TYPEPRED "i!1")
                (("" (TYPEPRED "j!1")
                  (("" (EXPAND "rev")
                    (("" (INST?)
                      (("1" (INST - "l(ps!1) - 1 - j!1")
                        (("1" (ASSERT) NIL) ("2" (ASSERT) NIL)))
                       ("2" (ASSERT) NIL)))))))))))))))))))))))
 (|path?_gen_seq2_TCC1| "" (SUBTYPE-TCC) NIL)
 (|path?_gen_seq2_TCC2| "" (SUBTYPE-TCC) NIL)
 (|path?_gen_seq2| "" (SKOSIMP*)
  (("" (EXPAND "gen_seq2")
    (("" (EXPAND "path?")
      (("" (EXPAND "fseq")
        (("" (SPLIT +)
          (("1" (EXPAND "walk?")
            (("1" (SPLIT +)
              (("1" (EXPAND "verts_in?") (("1" (PROPAX) NIL)))
               ("2" (SKOSIMP*)
                (("2" (EXPAND "fseq")
                  (("2" (LIFT-IF) (("2" (GROUND) NIL)))))))))))
           ("2" (SKOSIMP*)
            (("2" (EXPAND "edge?")
              (("2" (FLATTEN)
                (("2" (LIFT-IF) (("2" (GROUND) NIL)))))))))))))))))))
 (|path?_add1_TCC1| "" (SUBTYPE-TCC) NIL)
 (|path?_add1| "" (SKOSIMP*)
  (("" (EXPAND "path?")
    (("" (FLATTEN)
      (("" (SPLIT +)
        (("1" (REWRITE "walk?_add1") NIL)
         ("2" (SKOSIMP*)
          (("2" (EXPAND "fseq")
            (("2" (EXPAND "add1")
              (("2" (LIFT-IF)
                (("2" (LIFT-IF)
                  (("2" (EXPAND "verts_of")
                    (("2" (TYPEPRED "i!1")
                      (("2" (TYPEPRED "j!1")
                        (("2" (EXPAND "add1")
                          (("2" (GROUND)
                            (("1" (INST - "i!1" "j!1") (("1" (ASSERT) NIL)))
                             ("2" (EXPAND "fseq")
                              (("2" (INST + "j!1") (("2" (ASSERT) NIL)))))
                             ("3" (INST + "i!1")
                              (("3" (EXPAND "fseq")
                                (("3" (PROPAX)
                                  NIL)))))))))))))))))))))))))))))))))
 (|path?_trunc1_TCC1| "" (SUBTYPE-TCC) NIL)
 (|path?_trunc1_TCC2| "" (SUBTYPE-TCC) NIL)
 (|path?_trunc1_TCC3| "" (SUBTYPE-TCC) NIL)
 (|path?_trunc1| "" (SKOSIMP*)
  (("" (EXPAND "path_from?")
    (("" (SPLIT 1)
      (("1" (EXPAND "trunc1")
        (("1" (LEMMA "path?_caret")
          (("1" (INST?) (("1" (ASSERT) NIL) ("2" (ASSERT) NIL)))))))
       ("2" (EXPAND "from?")
        (("2" (EXPAND "trunc1")
          (("2" (EXPAND "^") (("2" (ASSERT) NIL))))))))))))))
$$$seq_def.pvs
seq_def[T: TYPE]: THEORY
BEGIN
  finite_seq: TYPE = [# l: nat, seq: [below[l] -> T] #]
  fs, fs1, fs2, fs3: VAR finite_seq
  m, n: VAR nat
  fin_seq(n): TYPE = {fs | l(fs) = n}
  fseq(fs): [below[l(fs)] -> T] = seq(fs)
  CONVERSION fseq
  o(fs1, fs2): finite_seq =
     LET l1 = l(fs1),
         lsum = l1 + l(fs2)
      IN (# l := lsum,
            seq := (LAMBDA (n:below[lsum]):
                      IF n < l1
                         THEN seq(fs1)(n)
                         ELSE seq(fs2)(n-l1)
                      ENDIF) #);
  emptyarr(x: below[0]): T
  emptyseq: fin_seq(0) = (# l := 0, seq := emptyarr #) ;
  p: VAR [nat, nat] ;
  ^(fs: finite_seq, (p: [nat, below(l(fs))])):
       fin_seq(IF proj_1(p) > proj_2(p) THEN 0
               ELSE proj_2(p)-proj_1(p)+1 ENDIF) =
    LET (m, n) = p
     IN IF m > n
        THEN emptyseq
        ELSE (# l := n-m+1,
                seq := (LAMBDA (x: below[n-m+1]): seq(fs)(x + m)) #)
        ENDIF ;
  rev(fs): finite_seq = (# l := l(fs),
                           seq := (LAMBDA (i: below(l(fs))): seq(fs)(l(fs)-1-i))
                         #)
%%  ^(fs: finite_seq, (p: [m: nat, {n: nat | n >= m AND n < l(fs)}])):
%%       fin_seq(proj_2(p)-proj_1(p)+1) =
%%    LET (m, n) = p IN
%%             (# l   := n-m+1,
%%                seq := (LAMBDA (x: below[n-m+1]): seq(fs)(x + m)) #) ;
%
%
%  ^^(fs, p): finite_seq =
%    LET (m, n) = p
%     IN IF m > n OR m >= l(fs)
%        THEN emptyseq
%        ELSE LET len = IF n < l(fs)  THEN n - m + 1
%                       ELSE l(fs) - m ENDIF
%              IN (# l := len,
%                    seq := (LAMBDA (x: below[len]): seq(fs)(x + m)) #)
%        ENDIF ;
%
%  i,j: VAR nat
%  extractors_eq: LEMMA j < l(fs) IMPLIES fs^(i,j) = fs^^(i,j)
END seq_def
$$$seq_def.prf
(|seq_def| (|oh_TCC1| "" (SUBTYPE-TCC) NIL) (|oh_TCC2| "" (SUBTYPE-TCC) NIL)
 (|emptyarr_TCC1| "" (INST 1 "(LAMBDA (x: below[0]): epsilon! (t:T): true)") (("" (SKOSIMP*) NIL)))
 (|emptyseq_TCC1| "" (PROPAX) NIL) (|caret_TCC1| "" (SUBTYPE-TCC) NIL) (|caret_TCC2| "" (SUBTYPE-TCC) NIL)
 (|caret_TCC3| "" (SUBTYPE-TCC) NIL) (|caret_TCC4| "" (SUBTYPE-TCC) NIL) (|caret_TCC5| "" (SUBTYPE-TCC) NIL)
 (|rev_TCC1| "" (SUBTYPE-TCC) NIL))
$$$walks.pvs
walks[T: TYPE]: THEORY
BEGIN
   IMPORTING graphs[T], seq_def, finite_sets@finite_sets_eq
   G,GG: VAR graph[T]
   n: VAR nat
   x,u,v,u1,u2,v1,v2,v3: VAR T
   e: VAR doubleton[T]
   i,j: VAR nat
   prewalk: TYPE = {w: finite_seq[T] | l(w) > 0}
   s,ps,ww: VAR prewalk
   verts_in?(G,s): bool = (FORALL (i: below(l(s))): vert(G)(seq(s)(i)))
   Seq(G): TYPE = {w: prewalk | verts_in?(G,w)}
   walk?(G,ps): bool = verts_in?(G,ps) AND
                             (FORALL n: n < l(ps) - 1 IMPLIES
                                         edge?(G)(ps(n),ps(n+1)))
   Walk(G): TYPE = {w: prewalk | walk?(G,w)}
   from?(ps,u,v): bool = seq(ps)(0) = u AND seq(ps)(l(ps) - 1) = v
   walk_from?(G,ps,u,v): bool =
	          seq(ps)(0) = u AND seq(ps)(l(ps) - 1) = v AND walk?(G,ps)
   Walk_from(G,u,v): TYPE = {w: prewalk | walk_from?(G,w,u,v)}
   verts_of(ww: prewalk): finite_set[T] =
               {t: T | (EXISTS (i: below(l(ww))): ww(i) = t)}
   edges_of(ww): finite_set[doubleton[T]] = {e: doubleton[T] |
                           EXISTS (i: below(l(ww)-1)): e = dbl(ww(i),ww(i+1))}
   pre_circuit?(G: graph[T], w: prewalk): bool = walk?(G,w) AND
                                                 w(0) = w(l(w)-1)
%  ----------------------- Properties -----------------------
   verts_in?_concat: LEMMA FORALL (s1,s2: Seq(G)): verts_in?(G,s1 o s2)
   verts_in?_caret : LEMMA FORALL (j: below(l(ps))): i <= j IMPLIES
                                   verts_in?(G,ps) IMPLIES verts_in?(G,ps^(i,j))
   vert_seq_lem    : LEMMA FORALL (w: Seq(G)): n < l(w) IMPLIES vert(G)(w(n))
   verts_of_subset : LEMMA FORALL (w: Seq(G)):
                                   subset?(verts_of(w),vert(G))
   edges_of_subset : LEMMA walk?(G,ww) IMPLIES subset?(edges_of(ww),edges(G))
   walk_verts_in   : LEMMA walk?(G,ps) IMPLIES verts_in?(G,ps)
   walk_from_vert  : LEMMA FORALL (w: prewalk,v1,v2:T):
                             walk_from?(G,w,v1,v2) IMPLIES
                                vert(G)(v1) AND vert(G)(v2)
   walk_edge_in    : LEMMA walk?(G,ww) AND
                           subset?(edges_of(ww),edges(GG)) AND
                           subset?(verts_of(ww),vert(GG))
                         IMPLIES walk?(GG,ww)
%  ----------- operations and constructors for walks --------------------
   gen_seq1(G, (u: (vert(G)))): Seq(G) =
                        (# l := 1, seq := (LAMBDA (i: below(1)): u) #)
   gen_seq2(G, (u,v: (vert(G)))): Seq(G) =
                  (# l := 2,
                     seq := (LAMBDA (i: below(2)):
                                      IF i = 0 THEN u ELSE v ENDIF) #)
   Longprewalk: TYPE = {ps: prewalk | l(ps) >= 2}
   trunc1(p: Longprewalk ): prewalk = p^(0,l(p)-2)
   add1(ww,x): prewalk = (# l := l(ww) + 1,
                           seq := (LAMBDA (ii: below(l(ww) + 1)):
                                    IF ii < l(ww) THEN seq(ww)(ii) ELSE x ENDIF)
                         #)
   gen_seq1_is_walk: LEMMA vert(G)(x) IMPLIES walk?(G,gen_seq1(G,x))
   edge_to_walk    : LEMMA u /= v AND edges(G)(edg[T](u, v)) IMPLIES
                             walk?(G,gen_seq2(G,u,v))
   walk?_rev       : LEMMA walk?(G,ps) IMPLIES walk?(G,rev(ps))
   w1,w2: VAR prewalk
   walk?_reverse   : LEMMA walk_from?(G,w1,v1,v2) IMPLIES
                             (EXISTS (w: Walk(G)): walk_from?(G,w,v2,v1))
   walk?_caret     : LEMMA i <= j AND j < l(ps) AND walk?(G,ps)
                               IMPLIES walk?(G,ps^(i,j))
   l_trunc1        : LEMMA l(ww) > 1 IMPLIES l(trunc1(ww)) = l(ww)-1
   walk?_add1      : LEMMA walk?(G,ww) AND vert(G)(x)
                           AND edge?(G)(seq(ww)(l(ww)-1),x)
                           IMPLIES walk?(G,add1(ww,x))
   walk_concat_edge: LEMMA walk_from?(G, w1, u1, v1) AND
         		           walk_from?(G, w2, u2, v2) AND
                              edge?(G)(v1,u2)
         		        IMPLIES
         		            walk_from?(G, w1 o w2,u1,v2)
   walk_concat: LEMMA l(w1) > 1 AND
      		      walk_from?(G, w1, u1, v) AND
      		      walk_from?(G, w2, u2, v)
      		 IMPLIES
      		     walk_from?(G, w1 ^ (0, l(w1) - 2) o rev(w2),u1,u2)
   walk?_cut  : LEMMA FORALL (i,j: below(l(ps))): i < j AND
                                  seq(ps)(i) = seq(ps)(j) AND
                                  walk_from?(G, ps, u, v)
                               IMPLIES
                                  walk_from?(G, ps^(0,i) o ps^(j+1,l(ps)-1),u,v)
   walk_concat_exists  : LEMMA v2 /= v3 AND
                               walk_from?(G,w1,v2,v1) AND
                               walk_from?(G,w2,v3,v1) IMPLIES
                       (EXISTS (w: prewalk): walk_from?(G,w,v2,v3))
   yt: VAR T
   p1,p2: VAR prewalk
   walk_merge: LEMMA walk_from?(G, p1, v, yt) AND
      	             walk_from?(G, p2, u, yt)
                           IMPLIES
      	                (EXISTS (p: prewalk): walk_from?(G, p, u, v))
END walks
$$$walks.prf
(|walks| (|walk?_TCC1| "" (SUBTYPE-TCC) NIL)
 (|walk?_TCC2| "" (SUBTYPE-TCC) NIL)
 (|from?_TCC1| "" (SUBTYPE-TCC) NIL)
 (|from?_TCC2| "" (SUBTYPE-TCC) NIL)
 (|verts_of_TCC1| "" (SKOSIMP*)
  (("" (LEMMA "surjection_from_finite_set[below(l(ww!1)),T]")
    (("" (INST?)
      (("" (INST -1 "fullset[below(l(ww!1))]")
        (("1" (ASSERT)
          (("1" (HIDE 2)
            (("1" (INST 1 "(LAMBDA (i: below(l(ww!1))): seq(ww!1)(i))")
              (("1" (EXPAND "restrict")
                (("1" (EXPAND "surjective?")
                  (("1" (SKOSIMP*)
                    (("1" (TYPEPRED "y!1")
                      (("1" (SKOSIMP*)
                        (("1" (INST?)
                          (("1" (ASSERT)
                            (("1" (EXPAND "fseq")
                              (("1" (PROPAX) NIL)))))
                           ("2" (EXPAND "fullset")
                            (("2" (PROPAX) NIL)))))))))))))))
               ("2" (SKOSIMP*)
                (("2" (INST?)
                  (("2" (EXPAND "fseq") (("2" (PROPAX) NIL)))))))
               ("3" (SKOSIMP*)
                (("3" (EXPAND "fullset") (("3" (PROPAX) NIL)))))))))))
         ("2" (HIDE 2)
          (("2" (EXPAND "is_finite")
            (("2"
              (INST 1 "l(ww!1)" "(LAMBDA (ii: below(l(ww!1))): ii)")
              (("1" (EXPAND "injective?")
                (("1" (EXPAND "restrict") (("1" (SKOSIMP*) NIL)))))
               ("2" (SKOSIMP*)
                (("2" (EXPAND "fullset")
                  (("2" (PROPAX) NIL)))))))))))))))))))
 (|edges_of_TCC1| "" (SUBTYPE-TCC) NIL)
 (|edges_of_TCC2| "" (SUBTYPE-TCC) NIL)
 (|edges_of_TCC3| "" (SUBTYPE-TCC) NIL)
 (|edges_of_TCC4| "" (SKOSIMP*)
  (("" (EXPAND "is_finite")
    ((""
      (INST 1 "l(ww!1) - 1" "(LAMBDA (e: {e: doubleton[T] |
           EXISTS (i: below(l(ww!1) - 1)):
             e = dbl[T](fseq[T](ww!1)(i), fseq[T](ww!1)(i + 1))}):
        choose({i: below(l(ww!1) - 1) |
                   e = dbl[T](fseq[T](ww!1)(i), fseq[T](ww!1)(i + 1))}))")
      (("1" (EXPAND "injective?")
        (("1" (SKOSIMP*) (("1" (ASSERT) NIL)))))
       ("2" (SKOSIMP*)
        (("2" (EXPAND "nonempty?")
          (("2" (EXPAND "empty?")
            (("2" (EXPAND "member")
              (("2" (EXPAND "fseq")
                (("2" (TYPEPRED "ww!1")
                  (("2" (TYPEPRED "e!1")
                    (("2" (SKOSIMP*)
                      (("2" (INST -4 "i!1")
                        (("2" (EXPAND "fseq")
                          (("2" (PROPAX) NIL)))))))))))))))))))))))))))
 (|pre_circuit?_TCC1| "" (SUBTYPE-TCC) NIL)
 (|pre_circuit?_TCC2| "" (SUBTYPE-TCC) NIL)
 (|verts_in?_concat_TCC1| "" (SUBTYPE-TCC) NIL)
 (|verts_in?_concat| "" (SKOSIMP*)
  (("" (EXPAND "verts_in?")
    (("" (SKOSIMP*)
      (("" (TYPEPRED "i!1")
        (("" (EXPAND "o ")
          (("" (GROUND)
            (("1" (TYPEPRED "s1!1")
              (("1" (EXPAND "verts_in?") (("1" (INST?) NIL)))))
             ("2" (TYPEPRED "s2!1")
              (("2" (EXPAND "verts_in?")
                (("2" (INST?) NIL)))))))))))))))))
 (|verts_in?_caret_TCC1| "" (SKOSIMP*)
  (("" (EXPAND "verts_in?")
    (("" (EXPAND "^")
      (("" (EXPAND "emptyseq")
        (("" (LIFT-IF) (("" (GROUND) NIL)))))))))))
 (|verts_in?_caret| "" (SKOSIMP*)
  (("" (EXPAND "verts_in?")
    (("" (SKOSIMP*)
      (("" (INST?)
        (("1" (TYPEPRED "i!2")
          (("1" (EXPAND "^")
            (("1" (EXPAND "emptyseq")
              (("1" (LIFT-IF)
                (("1" (GROUND)
                  (("1" (TYPEPRED "i!2")
                    (("1" (EXPAND "^")
                      (("1" (TYPEPRED "j!1")
                        (("1" (REVEAL -1)
                          (("1" (INST?) NIL)))))))))))))))))))
         ("2" (TYPEPRED "i!1")
          (("2" (TYPEPRED "i!2")
            (("2" (EXPAND "^")
              (("2" (LIFT-IF)
                (("2" (EXPAND "emptyseq")
                  (("2" (GROUND) NIL)))))))))))))))))))
 (|vert_seq_lem| "" (SKOSIMP*)
  (("" (EXPAND "fseq")
    (("" (TYPEPRED "w!1")
      (("" (EXPAND "verts_in?") (("" (INST -1 "n!1") NIL)))))))))
 (|verts_of_subset| "" (SKOSIMP*)
  (("" (TYPEPRED "w!1")
    (("" (EXPAND "subset?")
      (("" (SKOSIMP*)
        (("" (EXPAND "verts_in?")
          (("" (EXPAND "member")
            (("" (EXPAND "verts_of")
              (("" (SKOSIMP*)
                (("" (EXPAND "fseq")
                  (("" (INST?) (("" (ASSERT) NIL)))))))))))))))))))))
 (|edges_of_subset| "" (SKOSIMP*)
  (("" (EXPAND "subset?")
    (("" (SKOSIMP*)
      (("" (EXPAND "member")
        (("" (EXPAND "edges_of")
          (("" (EXPAND "fseq")
            (("" (SKOSIMP*)
              (("" (REPLACE -2)
                (("" (HIDE -2)
                  (("" (EXPAND "walk?")
                    (("" (FLATTEN)
                      (("" (INST - "i!1")
                        (("" (ASSERT)
                          (("" (EXPAND "edge?")
                            (("" (EXPAND "fseq")
                              ((""
                                (PROPAX)
                                NIL)))))))))))))))))))))))))))))))
 (|walk_verts_in| "" (SKOSIMP*)
  (("" (EXPAND "walk?") (("" (FLATTEN) (("" (PROPAX) NIL)))))))
 (|walk_from_vert| "" (SKOSIMP*)
  (("" (EXPAND "walk_from?")
    (("" (FLATTEN)
      (("" (EXPAND "walk?")
        (("" (FLATTEN)
          (("" (EXPAND "verts_in?")
            (("" (INST-CP -3 "0")
              (("" (INST -3 "l(w!1)-1")
                (("" (ASSERT) NIL)))))))))))))))))
 (|walk_edge_in| "" (SKOSIMP*)
  (("" (EXPAND "walk?")
    (("" (FLATTEN)
      (("" (SPLIT 1)
        (("1" (HIDE -2)
          (("1" (EXPAND "verts_in?")
            (("1" (SKOSIMP*)
              (("1" (INST?)
                (("1" (EXPAND "verts_of")
                  (("1" (HIDE -2)
                    (("1" (EXPAND "subset?")
                      (("1" (EXPAND "member")
                        (("1" (INST?)
                          (("1" (SPLIT -2)
                            (("1" (PROPAX) NIL)
                             ("2" (INST?)
                              (("2"
                                (EXPAND "fseq")
                                (("2"
                                  (PROPAX)
                                  NIL)))))))))))))))))))))))))
         ("2" (SKOSIMP*)
          (("2" (HIDE -5)
            (("2" (EXPAND "subset?")
              (("2" (EXPAND "member")
                (("2" (INST?)
                  (("2" (ASSERT)
                    (("2" (EXPAND "edge?")
                      (("2" (FLATTEN)
                        (("2" (INST?)
                          (("1" (EXPAND "edges_of")
                            (("1" (SPLIT -4)
                              (("1" (ASSERT) NIL) ("2" (INST?) NIL)))))
                           ("2" (INST?)
                            (("2" (ASSERT)
                              NIL)))))))))))))))))))))))))))))
 (|gen_seq1_TCC1| "" (SKOSIMP*)
  (("" (EXPAND "verts_in?") (("" (PROPAX) NIL)))))
 (|gen_seq2_TCC1| "" (SKOSIMP*)
  (("" (EXPAND "verts_in?") (("" (PROPAX) NIL)))))
 (|trunc1_TCC1| "" (SUBTYPE-TCC) NIL)
 (|trunc1_TCC2| "" (SUBTYPE-TCC) NIL)
 (|add1_TCC1| "" (SUBTYPE-TCC) NIL)
 (|gen_seq1_is_walk| "" (SKOSIMP*)
  (("" (EXPAND "gen_seq1")
    (("" (EXPAND "walk?")
      (("" (EXPAND "verts_in?") (("" (SKOSIMP*) NIL)))))))))
 (|edge_to_walk_TCC1| "" (SUBTYPE-TCC) NIL)
 (|edge_to_walk_TCC2| "" (SKOSIMP*)
  (("" (EXPAND "edg")
    (("" (TYPEPRED "G!1")
      (("" (INST?)
        (("1" (ASSERT)
          (("1" (INST?)
            (("1" (HIDE -2)
              (("1" (EXPAND "dbl") (("1" (PROPAX) NIL)))))))))
         ("2" (INST?) (("2" (ASSERT) NIL)))))))))))
 (|edge_to_walk_TCC3| "" (SKOSIMP*)
  (("" (TYPEPRED "G!1")
    (("" (INST?)
      (("1" (ASSERT)
        (("1" (INST -1 "v!1")
          (("1" (EXPAND "edg")
            (("1" (EXPAND "dbl") (("1" (PROPAX) NIL)))))))))
       ("2" (ASSERT) NIL)))))))
 (|edge_to_walk| "" (SKOSIMP*)
  (("" (EXPAND "walk?")
    (("" (EXPAND "gen_seq2")
      (("" (SPLIT 2)
        (("1" (EXPAND "verts_in?") (("1" (PROPAX) NIL)))
         ("2" (SKOSIMP*)
          (("2" (EXPAND "fseq")
            (("2" (ASSERT)
              (("2" (EXPAND "edge?")
                (("2" (EXPAND "edg")
                  (("2" (PROPAX) NIL)))))))))))))))))))
 (|walk?_rev_TCC1| "" (SUBTYPE-TCC) NIL)
 (|walk?_rev| "" (SKOSIMP*)
  (("" (EXPAND "walk?")
    (("" (FLATTEN)
      (("" (SPLIT +)
        (("1" (HIDE -2)
          (("1" (EXPAND "verts_in?")
            (("1" (SKOSIMP*)
              (("1" (TYPEPRED "i!1")
                (("1" (EXPAND "rev")
                  (("1" (INST?) (("1" (ASSERT) NIL)))))))))))))
         ("2" (SKOSIMP*)
          (("2" (EXPAND "fseq")
            (("2" (EXPAND "edge?")
              (("2" (HIDE -2)
                (("2" (EXPAND "rev")
                  (("2" (INST - "l(ps!1) - 2 - n!1")
                    (("1" (ASSERT)
                      (("1" (FLATTEN)
                        (("1" (ASSERT)
                          (("1" (REWRITE "dbl_comm") NIL)))))))
                     ("2" (ASSERT) NIL)))))))))))))))))))))
 (|walk?_reverse| "" (SKOSIMP*)
  (("" (EXPAND "walk_from?")
    (("" (FLATTEN)
      ((""
        (INST 1 "(# l := l(w1!1),
                  seq := (LAMBDA (i: below(l(w1!1))): seq(w1!1)(l(w1!1)-1-i)) #)")
        (("1" (ASSERT) NIL)
         ("2" (EXPAND "walk?")
          (("2" (SPLIT)
            (("1" (ASSERT)
              (("1" (EXPAND "verts_in?")
                (("1" (SKOSIMP*)
                  (("1" (TYPEPRED "w1!1") (("1" (INST?) NIL)))))))))
             ("2" (SKOSIMP*)
              (("2" (EXPAND "fseq")
                (("2" (LEMMA "edge?_comm")
                  (("2" (INST?)
                    (("1" (ASSERT)
                      (("1" (HIDE 2)
                        (("1" (TYPEPRED "w1!1")
                          (("1" (INST?) (("1" (ASSERT) NIL)))))))))
                     ("2" (ASSERT) NIL)
                     ("3" (HIDE 2)
                      (("3" (TYPEPRED "n!1")
                        (("3" (ASSERT) NIL)))))))))))))))))))))))))
 (|walk?_caret_TCC1| "" (SUBTYPE-TCC) NIL)
 (|walk?_caret_TCC2| "" (SUBTYPE-TCC) NIL)
 (|walk?_caret| "" (SKOSIMP*)
  (("" (EXPAND "walk?")
    (("" (FLATTEN)
      (("" (SPLIT +)
        (("1" (REWRITE "verts_in?_caret") NIL)
         ("2" (SKOSIMP*)
          (("2" (EXPAND "fseq")
            (("2" (EXPAND "edge?")
              (("2" (EXPAND "^")
                (("2" (ASSERT)
                  (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))))
 (|l_trunc1_TCC1| "" (SUBTYPE-TCC) NIL)
 (|l_trunc1| "" (SKOSIMP*)
  (("" (EXPAND "trunc1") (("" (EXPAND "^") (("" (ASSERT) NIL)))))))
 (|walk?_add1| "" (SKOSIMP*)
  (("" (EXPAND "walk?")
    (("" (FLATTEN)
      (("" (SPLIT 1)
        (("1" (EXPAND "verts_in?")
          (("1" (EXPAND "add1")
            (("1" (SKOSIMP*)
              (("1" (HIDE -2)
                (("1" (INST?)
                  (("1" (GROUND) NIL) ("2" (ASSERT) NIL)))))))))))
         ("2" (SKOSIMP*)
          (("2" (EXPAND "fseq")
            (("2" (EXPAND "add1")
              (("2" (LIFT-IF)
                (("2" (SPLIT 1)
                  (("1" (FLATTEN)
                    (("1" (INST?)
                      (("1" (LIFT-IF) (("1" (GROUND) NIL)))))))
                   ("2" (FLATTEN)
                    (("2" (PROPAX) NIL)))))))))))))))))))))
 (|walk_concat_edge_TCC1| "" (SUBTYPE-TCC) NIL)
 (|walk_concat_edge| "" (SKOSIMP*)
  (("" (EXPAND "walk_from?")
    (("" (FLATTEN)
      (("" (EXPAND "o ")
        (("" (ASSERT)
          (("" (AUTO-REWRITE "fseq")
            (("" (EXPAND "walk?")
              (("" (ASSERT)
                (("" (FLATTEN)
                  (("" (ASSERT)
                    (("" (SPLIT +)
                      (("1" (EXPAND "verts_in?")
                        (("1" (SKOSIMP*)
                          (("1" (HIDE -4)
                            (("1" (GROUND)
                              (("1" (INST?) NIL)
                               ("2"
                                (HIDE -3)
                                (("2" (INST?) NIL)))))))))))
                       ("2" (SKOSIMP*)
                        (("2" (CASE "n!1 < l(w1!1)")
                          (("1" (ASSERT)
                            (("1" (LIFT-IF)
                              (("1" (INST?) (("1" (GROUND) NIL)))))))
                           ("2" (ASSERT)
                            (("2" (HIDE -5)
                              (("2"
                                (INST?)
                                (("2"
                                  (ASSERT)
                                  NIL)))))))))))))))))))))))))))))))))
 (|walk_concat_TCC1| "" (SUBTYPE-TCC) NIL)
 (|walk_concat_TCC2| "" (SKOSIMP*)
  (("" (EXPAND "o ")
    (("" (EXPAND "rev")
      (("" (EXPAND "^") (("" (LIFT-IF) (("" (GROUND) NIL)))))))))))
 (|walk_concat| "" (SKOSIMP*)
  (("" (EXPAND "walk_from?")
    (("" (FLATTEN)
      (("" (ASSERT)
        (("" (EXPAND "o ")
          (("" (EXPAND "rev")
            (("" (EXPAND "^")
              (("" (EXPAND "walk?")
                (("" (EXPAND "fseq")
                  (("" (FLATTEN)
                    (("" (SPLIT +)
                      (("1" (EXPAND "verts_in?")
                        (("1" (SKOSIMP*)
                          (("1" (GROUND)
                            (("1" (INST?) NIL)
                             ("2" (HIDE -2 -3 -4 -5 -6 -7 -9)
                              (("2"
                                (INST - "l(w1!1) + l(w2!1) - 2 - i!1")
                                NIL)))))))))
                       ("2" (SKOSIMP*)
                        (("2" (EXPAND "edge?")
                          (("2" (CASE "n!1 < l(w1!1) - 1")
                            (("1" (ASSERT)
                              (("1"
                                (INST?)
                                (("1"
                                  (ASSERT)
                                  (("1"
                                    (FLATTEN)
                                    (("1"
                                      (ASSERT)
                                      (("1"
                                        (CASE "n!1 = l(w1!1) - 1")
                                        (("1"
                                          (REPLACE -1)
                                          (("1"
                                            (HIDE -1)
                                            (("1" (ASSERT) NIL)))))
                                         ("2"
                                          (LIFT-IF)
                                          (("2"
                                            (ASSERT)
                                            NIL)))))))))))))))
                             ("2" (ASSERT)
                              (("2"
                                (HIDE -6)
                                (("2"
                                  (INST
                                   -
                                   "l(w1!1) + l(w2!1) - 3 - n!1")
                                  (("2"
                                    (ASSERT)
                                    (("2"
                                      (FLATTEN)
                                      (("2"
                                        (ASSERT)
                                        (("2"
                                          (REWRITE "dbl_comm")
                                          NIL)))))))))))))))))))))))))))))))))))))))))
 (|walk?_cut_TCC1| "" (SUBTYPE-TCC) NIL)
 (|walk?_cut_TCC2| "" (SKOSIMP*)
  (("" (EXPAND "o ")
    (("" (EXPAND "^") (("" (LIFT-IF) (("" (GROUND) NIL)))))))))
 (|walk?_cut| "" (SKOSIMP*)
  (("" (EXPAND "walk_from?")
    (("" (FLATTEN)
      (("" (EXPAND "walk?")
        (("" (EXPAND "fseq")
          (("" (EXPAND "o ")
            (("" (EXPAND "^")
              (("" (EXPAND "emptyseq")
                (("" (SPLIT 1)
                  (("1" (PROPAX) NIL)
                   ("2" (FLATTEN)
                    (("2" (LIFT-IF)
                      (("2" (SPLIT 1)
                        (("1" (FLATTEN)
                          (("1" (EXPAND "verts_in?")
                            (("1" (HIDE -7)
                              (("1" (INST?) (("1" (GROUND) NIL)))))))))
                         ("2" (FLATTEN) (("2" (ASSERT) NIL)))))))))
                   ("3" (FLATTEN)
                    (("3" (EXPAND "verts_in?")
                      (("3" (SKOSIMP*)
                        (("3" (HIDE -6)
                          (("3" (SPLIT 1)
                            (("1" (FLATTEN)
                              (("1" (INST?) (("1" (ASSERT) NIL)))))
                             ("2" (FLATTEN)
                              (("2"
                                (ASSERT)
                                (("2"
                                  (TYPEPRED "i!2")
                                  (("2"
                                    (LIFT-IF)
                                    (("2"
                                      (GROUND)
                                      (("2"
                                        (INST?)
                                        NIL)))))))))))))))))))))
                   ("4" (SKOSIMP*)
                    (("4" (LIFT-IF)
                      (("4" (SPLIT 1)
                        (("1" (FLATTEN)
                          (("1" (GROUND)
                            (("1" (INST?) (("1" (ASSERT) NIL)))
                             ("2" (LIFT-IF)
                              (("2"
                                (SPLIT 2)
                                (("1"
                                  (FLATTEN)
                                  (("1" (INST?) (("1" (ASSERT) NIL)))))
                                 ("2"
                                  (FLATTEN)
                                  (("2"
                                    (ASSERT)
                                    (("2"
                                      (INST?)
                                      (("2"
                                        (ASSERT)
                                        (("2"
                                          (CASE "n!1 = i!1")
                                          (("1"
                                            (REPLACE -1)
                                            (("1"
                                              (HIDE -1)
                                              (("1"
                                                (ASSERT)
                                                (("1"
                                                  (REPLACE -4)
                                                  (("1"
                                                    (REVEAL -2)
                                                    (("1"
                                                      (INST -1 "j!1")
                                                      (("1"
                                                        (ASSERT)
                                                        NIL)))))))))))))
                                           ("2"
                                            (ASSERT)
                                            NIL)))))))))))))))))))
                         ("2" (FLATTEN)
                          (("2" (GROUND)
                            (("2" (INST?)
                              (("2"
                                (ASSERT)
                                NIL)))))))))))))))))))))))))))))))
 (|walk_concat_exists| "" (SKOSIMP*)
  (("" (CASE "v2!1 = v1!1")
    (("1" (REPLACE -1)
      (("1" (HIDE -1)
        (("1" (INST + "rev(w2!1)")
          (("1" (EXPAND "walk_from?")
            (("1" (FLATTEN)
              (("1" (REWRITE "walk?_rev")
                (("1" (EXPAND "rev") (("1" (ASSERT) NIL)))))))))
           ("2" (EXPAND "rev") (("2" (ASSERT) NIL)))))))))
     ("2" (CASE "v3!1 = v1!1")
      (("1" (REPLACE -1) (("1" (HIDE -1) (("1" (INST + "w1!1") NIL)))))
       ("2" (INST + "w1!1 ^ (0, l(w1!1) - 2) o rev(w2!1)")
        (("1" (LEMMA "walk_concat")
          (("1" (INST?)
            (("1" (INST?)
              (("1" (ASSERT)
                (("1" (HIDE -2 5)
                  (("1" (EXPAND "walk_from?")
                    (("1" (FLATTEN)
                      (("1" (CASE "l(w1!1) = 1")
                        (("1" (REPLACE -1)
                          (("1" (HIDE -1) (("1" (ASSERT) NIL)))))
                         ("2" (ASSERT) NIL)))))))))))))))))
         ("2" (EXPAND "o ")
          (("2" (EXPAND "rev")
            (("2" (EXPAND "^")
              (("2" (LIFT-IF)
                (("2" (ASSERT) (("2" (GROUND) NIL)))))))))))
         ("3" (ASSERT)
          (("3" (HIDE -2)
            (("3" (EXPAND "walk_from?")
              (("3" (FLATTEN)
                (("3" (CASE "l(w1!1) = 1")
                  (("1" (REPLACE -1)
                    (("1" (HIDE -1) (("1" (ASSERT) NIL)))))
                   ("2" (ASSERT) NIL)))))))))))))))))))
 (|walk_merge| "" (SKOSIMP*)
  (("" (CASE "l(p2!1) = 1")
    (("1" (INST 1 "rev(p1!1)")
      (("1" (EXPAND "walk_from?")
        (("1" (FLATTEN)
          (("1" (EXPAND "rev")
            (("1" (ASSERT)
              (("1" (LEMMA "walk?_rev")
                (("1" (INST?)
                  (("1" (ASSERT)
                    (("1" (EXPAND "rev")
                      (("1" (PROPAX) NIL)))))))))))))))))
       ("2" (EXPAND "rev") (("2" (ASSERT) NIL)))))
     ("2" (INST + "trunc1(p2!1) o rev(p1!1)")
      (("1" (EXPAND "walk_from?")
        (("1" (EXPAND "o ")
          (("1" (EXPAND "trunc1")
            (("1" (EXPAND "rev")
              (("1" (EXPAND "^")
                (("1" (ASSERT)
                  (("1" (FLATTEN)
                    (("1" (ASSERT)
                      (("1" (EXPAND "walk?")
                        (("1" (SPLIT +)
                          (("1" (EXPAND "verts_in?")
                            (("1" (SKOSIMP*)
                              (("1"
                                (ASSERT)
                                (("1"
                                  (TYPEPRED "i!1")
                                  (("1"
                                    (HIDE -5 -9)
                                    (("1"
                                      (HIDE -2 -3 -5 -6)
                                      (("1"
                                        (GROUND)
                                        (("1"
                                          (HIDE -3)
                                          (("1" (INST?) NIL)))
                                         ("2"
                                          (INST?)
                                          NIL)))))))))))))))
                           ("2" (SKOSIMP*)
                            (("2" (EXPAND "fseq")
                              (("2"
                                (LIFT-IF)
                                (("2"
                                  (GROUND)
                                  (("1"
                                    (EXPAND "edge?")
                                    (("1"
                                      (INST -10 "n!1")
                                      (("1"
                                        (ASSERT)
                                        (("1"
                                          (FLATTEN)
                                          (("1"
                                            (ASSERT)
                                            (("1"
                                              (LIFT-IF)
                                              (("1"
                                                (ASSERT)
                                                NIL)))))))))))))
                                   ("2"
                                    (EXPAND "edge?")
                                    (("2"
                                      (INST
                                       -5
                                       "l(p1!1) + l(p2!1) - 3 - n!1")
                                      (("2"
                                        (ASSERT)
                                        (("2"
                                          (FLATTEN)
                                          (("2"
                                            (ASSERT)
                                            (("2"
                                              (REWRITE "dbl_comm")
                                              NIL)))))))))))))))))))))))))))))))))))))))
       ("2" (EXPAND "o ")
        (("2" (EXPAND "rev")
          (("2" (EXPAND "trunc1")
            (("2" (EXPAND "^")
              (("2" (EXPAND "emptyseq") (("2" (ASSERT) NIL)))))))))))
       ("3" (ASSERT) NIL))))))))
$$$subgraphs.pvs
subgraphs[T: TYPE]: THEORY
BEGIN
   IMPORTING graphs[T]
   V: VAR set[T]
   G,G1,G2,SS: VAR graph[T]
   i: VAR T
   e: VAR doubleton[T]
   subgraph?(G1,G2): bool = subset?(vert(G1),vert(G2)) AND
                            subset?(edges(G1),edges(G2))
   equal?(G1,G2): bool = subgraph?(G1,G2) AND subgraph?(G2,G1)
   Subgraph(G): TYPE = {S: graph[T] | subgraph?(S,G)}
   finite_vert_subset: LEMMA is_finite(LAMBDA (i:T): vert(G)(i) AND V(i))
   subgraph(G, V): Subgraph(G) =
       (G WITH [vert :=  {i | vert(G)(i) AND V(i)},
                edges := {e | edges(G)(e) AND
                              (FORALL (x: T): e(x) IMPLIES V(x))}])
   subgraph_vert_sub: LEMMA subset?(V,vert(G)) IMPLIES
                                        vert(subgraph(G,V)) = V
   subgraph_lem     : LEMMA subgraph?(subgraph(G,V),G)
   subgraph_smaller: LEMMA subgraph?(SS, G) IMPLIES
   	                     size(SS) <= size(G)
END subgraphs
$$$subgraphs.prf
(|subgraphs|
 (|finite_vert_subset| "" (SKOSIMP*)
  (("" (LEMMA "finite_subset[T]")
    (("" (INST?)
      (("" (INST -1 "vert(G!1)")
        (("" (ASSERT) (("" (HIDE 2) (("" (GRIND) NIL)))))))))))))
 (|subgraph_TCC1| "" (SKOSIMP*)
  (("" (LEMMA "finite_subset[doubleton[T]]")
    (("" (INST?)
      (("" (INST -1 "edges(G!1)")
        (("" (ASSERT) (("" (HIDE 2) (("" (GRIND) NIL)))))))))))))
 (|subgraph_TCC2| "" (SKOSIMP*)
  (("" (LEMMA "finite_subset[T]")
    (("" (INST?)
      (("" (INST -1 "vert(G!1)")
        (("" (ASSERT) (("" (HIDE 2) (("" (GRIND) NIL)))))))))))))
 (|subgraph_TCC3| "" (SKOSIMP*)
  (("" (PROP)
    (("1" (SKOSIMP*)
      (("1" (INST?)
        (("1" (ASSERT)
          (("1" (TYPEPRED "G!1")
            (("1" (INST?)
              (("1" (ASSERT) (("1" (INST?) (("1" (ASSERT) NIL)))))))))))))))
     ("2" (EXPAND "subgraph?")
      (("2" (PROP) (("1" (GRIND) NIL) ("2" (GRIND) NIL)))))))))
 (|subgraph_vert_sub| "" (SKOSIMP*)
  (("" (EXPAND "subgraph")
    (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
      (("" (EXPAND "subset?")
        (("" (INST?)
          (("" (EXPAND "member") (("" (IFF 1) (("" (GROUND) NIL)))))))))))))))
 (|subgraph_lem| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|subgraph_smaller| "" (SKOSIMP*)
  (("" (EXPAND "size")
    (("" (EXPAND "subgraph?") (("" (REWRITE "card_subset[T]") NIL))))))))
$$$graph_deg_sum.pvs
graph_deg_sum[T: TYPE]: THEORY
BEGIN
   IMPORTING graph_deg[T],    %  fslib@finite_sets_sum_real[T]
             finite_sets@finite_sets_sum_real[T]
   v: VAR T
   G,GS: VAR graph[T]
   x,y: VAR T
   V_reduced: VAR set[T]
   P : VAR pred[graph[T]]
   n : VAR nat
   e: VAR doubleton[T]
   deg_lem0: LEMMA num_edges(G) = 0 IMPLIES
                      sum(vert(G), (LAMBDA (v: T): deg(v, G))) = 0
   deg_lem2: LEMMA remove(x, remove(y, vert(G))) = V_reduced AND
                    e = dbl[T](x, y) AND nonempty?(edges(G)) AND
                    choose(edges(G)) = e IMPLIES
                      sum(V_reduced, (LAMBDA (v:T): deg(v,G)))
                      = sum(V_reduced,(LAMBDA (v:T): deg(v,del_edge(G,e))))
   edge_induction : LEMMA
     (FORALL G : P(G)) IFF (FORALL n, G: num_edges(G) = n IMPLIES P(G))
   deg_thm: THEOREM sum(vert(G), (LAMBDA (v: T): deg(v,G))) =
                           2 * num_edges(G)
   IMPORTING subgraphs[T]
   subgraph_deg: THEOREM subgraph?(GS,G) AND vert(G)(v) IMPLIES
                               deg(v,GS) <= deg(v,G)
END graph_deg_sum
$$$graph_deg_sum.prf
(|graph_deg_sum| (|deg_lem0_TCC1| "" (ASSUMING-TCC) NIL)
 (|deg_lem0_TCC2| "" (ASSUMING-TCC) NIL)
 (|deg_lem0| "" (SKOSIMP*)
  (("" (EXPAND "num_edges")
    (("" (REWRITE "card_is_0[doubleton[T]]")
      (("" (ASSERT)
        (("" (EXPAND "deg")
          (("" (LEMMA "finite_emptyset[doubleton[T]]")
            ((""
              (CASE-REPLACE " (LAMBDA (v: T): card(incident_edges(v, G!1))) =
                       (LAMBDA (v: T): card(emptyset[doubleton[T]]))")
              (("1" (HIDE -1)
                (("1" (REWRITE "card_emptyset[doubleton[T]]")
                  (("1" (REWRITE "sum_const") (("1" (ASSERT) NIL)))))))
               ("2" (HIDE 2)
                (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
                  (("1" (LEMMA "incident_edges_emptyset")
                    (("1" (INST -1 "G!1" "x!1") (("1" (ASSERT) NIL)))))
                   ("2" (SKOSIMP*)
                    (("2" (REWRITE "card_def[doubleton[T]]")
                      (("2" (LEMMA "incident_edges_emptyset")
                        (("2" (INST?)
                          (("2" (ASSERT) NIL)))))))))))))))))))))))))))
 (|deg_lem2_TCC1| "" (SKOSIMP*)
  (("" (REPLACE -1 * RL)
    (("" (REWRITE "finite_remove") (("" (REWRITE "finite_remove") NIL)))))))
 (|deg_lem2| "" (SKOSIMP*)
  (("" (REWRITE "sum_f_g[T,real,0,+]")
    (("1" (HIDE 2)
      (("1" (SKOSIMP*)
        (("1" (TYPEPRED "x!2")
          (("1" (REPLACE -2 * RL)
            (("1" (HIDE -2)
              (("1" (EXPAND "deg")
                (("1"
                  (CASE-REPLACE
                   "incident_edges(x!2, del_edge(G!1,e!1)) = incident_edges(x!2, G!1)")
                  (("1" (HIDE 2)
                    (("1" (APPLY-EXTENSIONALITY 1 :HIDE? T)
                      (("1" (EXPAND "incident_edges")
                        (("1" (IFF 1)
                          (("1" (GROUND)
                            (("1" (LEMMA "del_edge_lem2[T]")
                              (("1" (INST?) (("1" (ASSERT) NIL)))))
                             ("2" (REWRITE "del_edge_lem3")
                              (("2" (HIDE -5 -6 2)
                                (("2" (GRIND) NIL)))))))))))))))))))))))))))))
     ("2" (HIDE -2 -3 -4 2)
      (("2" (REPLACE -1 * RL)
        (("2" (REWRITE "finite_remove")
          (("2" (REWRITE "finite_remove") NIL)))))))))))
 (|edge_induction| "" (SKOSIMP*)
  (("" (PROP)
    (("1" (SKOSIMP*) (("1" (INST?) NIL)))
     ("2" (SKOSIMP*) (("2" (INST?) (("2" (INST?) (("2" (ASSERT) NIL)))))))))))
 (|deg_thm| "" (SKOSIMP*)
  (("" (LEMMA "edge_induction")
    ((""
      (INST -1
       "(LAMBDA G: sum(vert(G), (LAMBDA (v: T): deg(v, G))) = 2 * num_edges(G))")
      (("" (FLATTEN)
        (("" (HIDE -1)
          (("" (ASSERT)
            (("" (SPLIT -1)
              (("1" (INST?) NIL)
               ("2" (HIDE 2)
                (("2" (INDUCT "n")
                  (("1" (SKOSIMP*)
                    (("1" (REWRITE "deg_lem0") (("1" (ASSERT) NIL)))))
                   ("2" (SKOSIMP*)
                    (("2" (NAME "Eo" "choose(edges(G!2))")
                      (("1" (INST -2 "del_edge(G!2,Eo)")
                        (("1" (REWRITE "del_edge_num")
                          (("1" (ASSERT)
                            (("1" (TYPEPRED "Eo")
                              (("1" (SKOSIMP*)
                                (("1"
                                  (CASE "member(x!1, remove(y!1, vert(G!2))) AND member(y!1, vert(G!2))
            AND is_finite[T](remove(x!1, remove(y!1, vert(G!2))))
            AND is_finite[T](remove[T](y!1, vert(G!2)))")
                                  (("1" (FLATTEN)
                                    (("1"
                                      (NAME "V_r"
                                            "remove(x!1,remove(y!1,vert(G!2)))")
                                      (("1" (REPLACE -1)
                                        (("1"
                                          (CASE-REPLACE
                                           "sum(vert(G!2), (LAMBDA (v: T): deg(v, G!2))) =
                     sum(V_r, (LAMBDA (v: T): deg(v, G!2)))
                 + deg(x!1, G!2)
                 + deg(y!1, G!2)")
                                          (("1"
                                            (HIDE -1)
                                            (("1"
                                              (CASE-REPLACE
                                               "deg(x!1, G!2) = deg(x!1, del_edge(G!2,Eo)) + 1")
                                              (("1"
                                                (CASE-REPLACE
                                                 "deg(y!1, G!2) = deg(y!1, del_edge(G!2,Eo)) + 1")
                                                (("1"
                                                  (CASE-REPLACE
                                                   "sum(V_r, (LAMBDA (v: T): deg(v, G!2))) =
                     sum(V_r, (LAMBDA (v: T): deg(v, del_edge(G!2,Eo))))")
                                                  (("1"
                                                    (CASE-REPLACE
                                                     "sum(V_r, (LAMBDA (v: T): deg(v, del_edge(G!2,Eo))))
                     = sum(vert(G!2), (LAMBDA (v: T): deg(v, del_edge(G!2,Eo))))
          - deg(x!1, del_edge(G!2,Eo))
          - deg(y!1, del_edge(G!2,Eo)) ")
                                                    (("1"
                                                      (ASSERT)
                                                      (("1"
                                                        (REWRITE "vert_del_edge")
                                                        (("1" (ASSERT) NIL)))))
                                                     ("2"
                                                      (HIDE
                                                       -1
                                                       -2
                                                       -3
                                                       -9
                                                       -10
                                                       -11
                                                       -12
                                                       -13
                                                       2
                                                       3)
                                                      (("2"
                                                        (REPLACE -1 + RL)
                                                        (("2"
                                                          (REWRITE
                                                           "sum_remove_rew")
                                                          (("2"
                                                            (REWRITE
                                                             "sum_remove_rew")
                                                            (("2"
                                                              (ASSERT)
                                                              NIL)))))))))
                                                     ("3"
                                                      (HIDE -1 -2 -11 -12 3)
                                                      (("3"
                                                        (HIDE
                                                         -1
                                                         -2
                                                         -3
                                                         -4
                                                         -5
                                                         -6
                                                         -7
                                                         -8
                                                         -9
                                                         2)
                                                        (("3"
                                                          (LEMMA
                                                           "finite_sets_sum_real.sum_TCC2")
                                                          (("3"
                                                            (INST?)
                                                            NIL)))))))))
                                                   ("2"
                                                    (HIDE -1 -2 -11 -12 3)
                                                    (("2"
                                                      (LEMMA "deg_lem2")
                                                      (("2"
                                                        (INST?)
                                                        (("2"
                                                          (INST
                                                           -1
                                                           "dbl[T](x!1, y!1)")
                                                          (("1"
                                                            (ASSERT)
                                                            (("1"
                                                              (HIDE
                                                               -1
                                                               -2
                                                               -3
                                                               -5
                                                               -6
                                                               2
                                                               3)
                                                              (("1"
                                                                (GRIND
                                                                 :EXCLUDE
                                                                 "edges")
                                                                NIL)))))
                                                           ("2"
                                                            (INST?)
                                                            (("2"
                                                              (ASSERT)
                                                              NIL)))))))))))))
                                                 ("2"
                                                  (HIDE -1 -2 -3 -4 -10 -11 2 3)
                                                  (("2"
                                                    (LEMMA "deg_del_edge")
                                                    (("2"
                                                      (INST?)
                                                      (("2"
                                                        (INST -1 "x!1")
                                                        (("2"
                                                          (ASSERT)
                                                          NIL)))))))))))
                                               ("2"
                                                (HIDE -1 -2 -3 -8 -9 -10 2 3)
                                                (("2"
                                                  (LEMMA "deg_del_edge")
                                                  (("2"
                                                    (INST?)
                                                    (("2"
                                                      (INST -1 "y!1")
                                                      (("2"
                                                        (REWRITE "dbl_comm")
                                                        (("2"
                                                          (ASSERT)
                                                          NIL)))))))))))))))
                                           ("2"
                                            (HIDE -4 -5 -8 -9 -10 2 3)
                                            (("2"
                                              (REPLACE -1 + RL)
                                              (("2"
                                                (REWRITE "sum_remove_rew")
                                                (("1"
                                                  (REWRITE "sum_remove_rew")
                                                  (("1" (ASSERT) NIL)))
                                                 ("2"
                                                  (HIDE -3 -4 -5 3)
                                                  (("2"
                                                    (REWRITE "finite_remove")
                                                    NIL)))))))))
                                           ("3"
                                            (REWRITE "finite_remove")
                                            (("3"
                                              (HIDE
                                               -1
                                               -2
                                               -3
                                               -4
                                               -5
                                               -6
                                               -7
                                               -8
                                               -9
                                               2
                                               3)
                                              (("3"
                                                (LEMMA
                                                 "finite_sets_sum_real.sum_TCC2")
                                                (("3"
                                                  (INST?)
                                                  (("1"
                                                    (ASSERT)
                                                    (("1"
                                                      (LEMMA
                                                       "finite_sets_sum_real.sum_TCC3")
                                                      (("1"
                                                        (INST?)
                                                        (("1"
                                                          (ASSERT)
                                                          (("1"
                                                            (REVEAL -6)
                                                            (("1"
                                                              (PROPAX)
                                                              NIL)))))))))))
                                                   ("2"
                                                    (REVEAL -6)
                                                    (("2"
                                                      (REVEAL -5)
                                                      (("2"
                                                        (PROPAX)
                                                        NIL)))))))))))))))))))))
                                   ("2" (REWRITE "finite_remove")
                                    (("1" (REWRITE "finite_remove")
                                      (("1" (ASSERT)
                                        (("1"
                                          (EXPAND "member")
                                          (("1"
                                            (EXPAND "remove")
                                            (("1"
                                              (EXPAND "member")
                                              (("1"
                                                (REPLACE -2)
                                                (("1"
                                                  (HIDE -3 -4 -5 3)
                                                  (("1"
                                                    (HIDE -2)
                                                    (("1"
                                                      (TYPEPRED "G!2")
                                                      (("1"
                                                        (INST?)
                                                        (("1"
                                                          (ASSERT)
                                                          (("1"
                                                            (INST-CP -1 "x!1")
                                                            (("1"
                                                              (INST -1 "y!1")
                                                              (("1"
                                                                (EXPAND "dbl")
                                                                (("1"
                                                                  (ASSERT)
                                                                  NIL)))))))))
                                                         ("2"
                                                          (INST?)
                                                          (("2"
                                                            (ASSERT)
                                                            NIL)))))))))))))))))))))))
                                     ("2" (REWRITE "finite_remove")
                                      NIL)))))))))))))))
                       ("2" (HIDE -1 2)
                        (("2" (EXPAND "nonempty?")
                          (("2" (LEMMA "deg_lem0")
                            (("2" (INST?)
                              (("2" (SPLIT -1)
                                (("1" (EXPAND "num_edges")
                                  (("1" (LEMMA "card_empty?[doubleton[T]]")
                                    (("1" (INST?)
                                      (("1" (ASSERT)
                                        (("1"
                                          (REPLACE -3)
                                          (("1" (ASSERT) NIL)))))))))))
                                 ("2" (EXPAND "num_edges")
                                  (("2" (LEMMA "card_empty?[doubleton[T]]")
                                    (("2" (INST?)
                                      (("2" (ASSERT)
                                        (("2"
                                          (REPLACE -2)
                                          (("2"
                                            (ASSERT)
                                            NIL)))))))))))))))))))))))))))))))))))))))))))
 (|subgraph_deg| "" (SKOSIMP*)
  (("" (EXPAND "deg")
    (("" (EXPAND "incident_edges")
      (("" (EXPAND "subgraph?")
        (("" (FLATTEN)
          (("" (HIDE -1 -3)
            (("" (LEMMA "card_subset[doubletons[T].doubleton]")
              (("" (INST?)
                (("1" (ASSERT)
                  (("1" (HIDE 2)
                    (("1" (EXPAND "subset?")
                      (("1" (SKOSIMP*)
                        (("1" (EXPAND "member")
                          (("1" (FLATTEN)
                            (("1" (INST?) (("1" (ASSERT) NIL)))))))))))))))
                 ("2" (HIDE -1 2)
                  (("2" (LEMMA "finite_subset[doubletons[T].doubleton]")
                    (("2" (INST?)
                      (("2" (INST?)
                        (("2" (ASSERT)
                          (("2" (HIDE -1 2) (("2" (GRIND) NIL)))))))))))))
                 ("3" (HIDE -1 2)
                  (("3" (LEMMA "finite_subset[doubletons[T].doubleton]")
                    (("3" (INST?)
                      (("3" (INST?)
                        (("3" (ASSERT)
                          (("3" (HIDE -1 2)
                            (("3" (GRIND) NIL))))))))))))))))))))))))))))))
$$$graph_ops.pvs
%------------------------------------------------------------------------
%
%  Operations on a graph
%  ------------------------------------------------
%
%      Author: Ricky W. Butler   NASA Langley Research Center
%
%  Defines:
%
%      union(G1,G2)      -- creates graph that is a union of G1 and G2
%
%      del_vert(G,v)     -- removes a vertex and all adjacent edges from a graph
%
%      del_edge(e,G)     --  creates subgraph with edge e removed
%
%      num_edges(G): nat --  number of edges in a graph
%
%------------------------------------------------------------------------
graph_ops[T: TYPE]: THEORY
BEGIN
   IMPORTING graphs[T]
   G, G1, G2: VAR graph[T]
   t1,t2: VAR T
   x,v: VAR T
   e,e2: VAR doubleton[T]
   union(G1,G2): graph[T] = (# vert := union(vert(G1),vert(G2)),
                               edges := union(edges(G1),edges(G2)) #)
   del_vert(G: graph[T], v: T): graph[T] =
                        (# vert := remove[T](v,vert(G)),
                           edges := {e | edges(G)(e) AND NOT e(v)} #)
   del_edge(G,e): graph[T] = G WITH [edges := remove(e,edges(G))]
   num_edges(G): nat = card(edges(G))
%  --------------------- del_vert(G,v) lemmas ----------------
   del_vert_still_in   : LEMMA FORALL (x: (vert(G))):
                                     x /= v IMPLIES vert(del_vert(G, v))(x)
   size_del_vert       : LEMMA FORALL (v: (vert(G))):
                                   size(del_vert(G,v)) = size(G) - 1
   del_vert_le         : LEMMA size(del_vert(G,v)) <= size(G)
   del_vert_ge         : LEMMA size(del_vert(G,v)) >= size(G) - 1
   edge_in_del_vert    : LEMMA (edges(G)(e) AND NOT e(v)) IMPLIES
                                 edges(del_vert(G,v))(e)
   edges_del_vert      : LEMMA edges(del_vert(G,v))(e) IMPLIES
                                       edges(G)(e)
   del_vert_comm       : LEMMA del_vert(del_vert(G, x), v) =
                                    del_vert(del_vert(G, v), x)
   del_vert_empty?     : LEMMA FORALL (v: (vert(G))):
                                  empty?(vert(del_vert(G, v))) IMPLIES
                                      singleton?(G)
%  ---------- del_edge(G,e) ----------------------------------
   del_edge_lem       : LEMMA NOT member(e,edges(del_edge(G,e)))
   del_edge_lem2      : LEMMA edges(del_edge(G,e))(e2)
                    		    IMPLIES edges(G)(e2)
   del_edge_lem3      : LEMMA edges(G)(e2) AND e2 /= e IMPLIES
                    		    edges(del_edge(G,e))(e2)
   del_edge_lem5      : LEMMA NOT edges(G)(e) IMPLIES del_edge(G, e) = G
   vert_del_edge      : LEMMA vert(del_edge(G,e)) = vert(G)
   del_edge_num       : LEMMA num_edges(del_edge(G,e)) = num_edges(G)
                                       - IF edges(G)(e) THEN 1 ELSE 0 ENDIF
   del_edge_singleton : LEMMA singleton?(del_edge(G,e)) IMPLIES singleton?(G)
   del_vert_edge_comm : LEMMA del_vert(del_edge(G, e), v) =
                               del_edge(del_vert(G, v), e)
   del_vert_edge      : LEMMA e(v) IMPLIES
                               del_vert(del_edge(G,e),v) = del_vert(G,v)
END graph_ops
$$$graph_ops.prf
(|graph_ops|
 (|union_TCC1| "" (SKOSIMP*)
  (("" (EXPAND "union")
    (("" (EXPAND "member")
      (("" (FLATTEN)
        (("" (PROP)
          (("1" (TYPEPRED "G1!1")
            (("1" (INST?)
              (("1" (ASSERT) (("1" (INST?) (("1" (ASSERT) NIL)))))))))
           ("2" (TYPEPRED "G2!1")
            (("2" (INST?)
              (("2" (ASSERT)
                (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))
 (|del_vert_TCC1| "" (SKOSIMP*)
  (("" (LEMMA "finite_subset[doubleton[T]]")
    (("" (INST?)
      (("" (INST -1 "edges(G!1)")
        (("" (ASSERT) (("" (HIDE 2) (("" (GRIND) NIL)))))))))))))
 (|del_vert_TCC2| "" (SKOSIMP*)
  (("" (EXPAND "remove")
    (("" (EXPAND "member")
      (("" (ASSERT)
        (("" (TYPEPRED "G!1")
          (("" (INST?)
            (("" (ASSERT) (("" (INST?) (("" (ASSERT) NIL)))))))))))))))))
 (|del_edge_TCC1| "" (SKOSIMP*)
  (("" (EXPAND "remove")
    (("" (FLATTEN)
      (("" (EXPAND "member")
        (("" (TYPEPRED "G!1")
          (("" (INST?)
            (("" (ASSERT) (("" (INST?) (("" (ASSERT) NIL)))))))))))))))))
 (|del_vert_still_in| "" (SKOSIMP*)
  (("" (EXPAND "del_vert")
    (("" (EXPAND "remove") (("" (EXPAND "member") (("" (ASSERT) NIL)))))))))
 (|size_del_vert| "" (SKOSIMP*)
  (("" (TYPEPRED "v!1")
    (("" (EXPAND "del_vert")
      (("" (EXPAND "size") (("" (REWRITE "card_remove") NIL)))))))))
 (|del_vert_le| "" (SKOSIMP*)
  (("" (EXPAND "size")
    (("" (EXPAND "del_vert")
      (("" (REWRITE "card_remove") (("" (LIFT-IF) (("" (GROUND) NIL)))))))))))
 (|del_vert_ge| "" (SKOSIMP*)
  (("" (EXPAND "size")
    (("" (EXPAND "del_vert")
      (("" (REWRITE "card_remove") (("" (LIFT-IF) (("" (GROUND) NIL)))))))))))
 (|edge_in_del_vert| "" (SKOSIMP*)
  (("" (EXPAND "del_vert") (("" (ASSERT) NIL)))))
 (|edges_del_vert| "" (SKOSIMP*)
  (("" (EXPAND "del_vert") (("" (FLATTEN) (("" (PROPAX) NIL)))))))
 (|del_vert_comm| "" (SKOSIMP*)
  (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
    (("1" (EXPAND "del_vert")
      (("1" (APPLY-EXTENSIONALITY 1 :HIDE? T)
        (("1" (IFF 1) (("1" (GROUND) NIL)))))))
     ("2" (EXPAND "del_vert")
      (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T) (("2" (GRIND) NIL)))))))))
 (|del_vert_empty?| "" (SKOSIMP*)
  (("" (LEMMA "card_empty?[T]")
    (("" (INST?)
      (("" (REPLACE -1 * RL)
        (("" (HIDE -1)
          (("" (EXPAND "singleton?")
            (("" (EXPAND "size")
              (("" (LEMMA "size_del_vert")
                (("" (INST?)
                  (("" (EXPAND "size") (("" (ASSERT) NIL)))))))))))))))))))))
 (|del_edge_lem| "" (SKOSIMP*)
  (("" (EXPAND "member")
    (("" (EXPAND "del_edge") (("" (EXPAND "remove") (("" (PROPAX) NIL)))))))))
 (|del_edge_lem2| "" (SKOSIMP*) (("" (GRIND) NIL)))
 (|del_edge_lem3| "" (SKOSIMP*) (("" (GRIND) NIL)))
 (|del_edge_lem5| "" (SKOSIMP*)
  (("" (APPLY-EXTENSIONALITY 2 :HIDE? T)
    (("1" (APPLY-EXTENSIONALITY 1 :HIDE? T)
      (("1" (EXPAND "del_edge") (("1" (GRIND) NIL)))))
     ("2" (EXPAND "del_edge") (("2" (PROPAX) NIL)))))))
 (|vert_del_edge| "" (GRIND) NIL)
 (|del_edge_num| "" (SKOSIMP*)
  (("" (EXPAND "num_edges")
    (("" (CASE-REPLACE "edges(del_edge(G!1,e!1)) = remove(e!1,edges(G!1))")
      (("1" (REWRITE "card_remove[doubleton[T]]") NIL)
       ("2" (HIDE 2)
        (("2" (APPLY-EXTENSIONALITY :HIDE? T)
          (("2" (IFF 1)
            (("2" (PROP)
              (("1" (LEMMA "del_edge_lem2")
                (("1" (INST?)
                  (("1" (LEMMA "del_edge_lem")
                    (("1" (INST?)
                      (("1" (EXPAND "member")
                        (("1" (ASSERT)
                          (("1" (GRIND :EXCLUDE ("edges" "del_edge"))
                            NIL)))))))))))))
               ("2" (REWRITE "del_edge_lem3")
                (("1" (HIDE 2) (("1" (GRIND :EXCLUDE "edges") NIL)))
                 ("2" (HIDE 2)
                  (("2" (GRIND :EXCLUDE "edges") NIL)))))))))))))))))))
 (|del_edge_singleton| "" (SKOSIMP*)
  (("" (EXPAND "singleton?")
    (("" (EXPAND "size") (("" (EXPAND "del_edge") (("" (PROPAX) NIL)))))))))
 (|del_vert_edge_comm| "" (SKOSIMP*)
  (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
    (("1" (APPLY-EXTENSIONALITY :HIDE? T) (("1" (GRIND) NIL)))
     ("2" (EXPAND "del_edge")
      (("2" (EXPAND "del_vert") (("2" (PROPAX) NIL)))))))))
 (|del_vert_edge| "" (SKOSIMP*)
  (("" (REWRITE "del_vert_edge_comm")
    (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
      (("1" (APPLY-EXTENSIONALITY 1 :HIDE? T) (("1" (GRIND) NIL)))
       ("2" (EXPAND "del_edge") (("2" (PROPAX) NIL))))))))))
$$$graph_deg.pvs
graph_deg[T: TYPE]: THEORY
%------------------------------------------------------------------------
%
%  Defines degree of a vertex
%  ------------------------------------------------
%
%      Author: Ricky W. Butler   NASA Langley Research Center
%
%  Defines:
%
%    incident_edges(v,G) -- returns set of edges attached to vertex v
%
%    deg(v,G)          -- number of edges attached to vertex v
%
%------------------------------------------------------------------------
BEGIN
   IMPORTING graphs[T], graph_ops[T]
   v: VAR T
   G,GS: VAR graph[T]
   incident_edges(v,G)  : finite_set[doubleton[T]]
                              = {e: doubleton[T] | edges(G)(e) AND e(v)}
   incident_edges_subset: LEMMA subset?(incident_edges(v,G),edges(G))
   deg(v,G): nat = card(incident_edges(v,G))
   P : VAR pred[graph[T]]
   n : VAR nat
   e: VAR doubleton[T]
   x,y: VAR T
   incident_edges_emptyset: LEMMA edges(G) = emptyset[doubleton[T]] IMPLIES
                                    incident_edges(v,G) = emptyset[doubleton[T]]
   deg_del_edge    : LEMMA e = dbl(x,y) AND edges(G)(e) IMPLIES
                             deg(y, G) = deg(y, del_edge(G, e)) + 1
   deg_del_edge2   : LEMMA e(y) AND edges(G)(e) IMPLIES
                             deg(y, G) = deg(y, del_edge(G, e)) + 1
   deg_del_edge3   : LEMMA NOT e(y)  IMPLIES
                              deg(y, G) = deg(y, del_edge(G, e))
   deg_del_edge_ge : LEMMA deg(y, G) >= deg(y, del_edge(G, e))
   deg_del_edge_le : LEMMA deg(y, G) - 1 <= deg(y, del_edge(G, e))
   deg_edge_exists       : LEMMA deg(v,G) > 0 IMPLIES
                             (EXISTS e: e(v) AND edges(G)(e))
   deg_to_card     : LEMMA deg(v,G) > 0 IMPLIES size(G) >= 2
   del_vert_deg_0  : LEMMA deg(v,G) = 0 IMPLIES
                               edges(del_vert(G,v)) = edges(G)
   deg_del_vert: LEMMA x /= v AND edges(G)(dbl[T](x, v))
                                IMPLIES deg(v, del_vert(G, x)) =
                                           deg(v, G) - 1
   del_vert_not_incident: LEMMA x /= v AND NOT edges(G)(dbl[T](x, v)) IMPLIES
                                       deg(x, del_vert(G, v)) = deg(x, G)
   singleton_deg: LEMMA singleton?(G) IMPLIES deg(v, G) = 0
   deg_1_sing   : LEMMA deg(v, G) = 1 IMPLIES
                           (EXISTS e: incident_edges(v, G) = singleton(e) AND
                                      e(v) AND edges(G)(e))
END graph_deg
$$$graph_deg.prf
(|graph_deg|
 (|incident_edges_TCC1| "" (SKOSIMP*)
  (("" (LEMMA "finite_subset[doubleton[T]]")
    (("" (INST?)
      (("" (INST -1 "edges(G!1)")
        (("" (ASSERT) (("" (HIDE 2) (("" (GRIND) NIL)))))))))))))
 (|incident_edges_subset| "" (GRIND) NIL)
 (|incident_edges_emptyset| "" (SKOSIMP*)
  (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
    (("" (EXPAND "emptyset")
      (("" (EXPAND "incident_edges") (("" (GROUND) NIL)))))))))
 (|deg_del_edge| "" (SKOSIMP*)
  (("" (EXPAND "deg")
    ((""
      (CASE-REPLACE "incident_edges(y!1, del_edge(G!1,e!1)) =
                     remove(e!1,incident_edges(y!1, G!1))")
      (("1" (REWRITE "card_remove[doubleton[T]]")
        (("1" (LIFT-IF)
          (("1" (GROUND)
            (("1" (HIDE -1 2) (("1" (HIDE -2) (("1" (GRIND) NIL)))))))))))
       ("2" (HIDE 2)
        (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
          (("2" (IFF 1)
            (("2" (PROP)
              (("1" (EXPAND "incident_edges")
                (("1" (GROUND)
                  (("1" (EXPAND "remove")
                    (("1" (EXPAND "member")
                      (("1" (GROUND)
                        (("1" (REPLACE -1)
                          (("1" (HIDE -1)
                            (("1" (LEMMA "del_edge_lem[T]")
                              (("1" (INST?)
                                (("1" (EXPAND "member")
                                  (("1" (PROPAX) NIL)))))))))))
                         ("2" (LEMMA "del_edge_lem2[T]")
                          (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))
               ("2" (EXPAND "incident_edges")
                (("2" (EXPAND "remove")
                  (("2" (FLATTEN)
                    (("2" (EXPAND "member")
                      (("2" (GROUND)
                        (("2" (REWRITE "del_edge_lem3")
                          NIL)))))))))))))))))))))))))
 (|deg_del_edge2| "" (SKOSIMP*)
  (("" (LEMMA "deg_del_edge")
    (("" (INST?)
      (("" (TYPEPRED "e!1")
        (("" (SKOSIMP*)
          (("" (CASE "x!1=y!1")
            (("1" (REPLACE -1)
              (("1" (HIDE -1)
                (("1" (INST -2 "y!2")
                  (("1" (SPLIT -2)
                    (("1" (PROPAX) NIL)
                     ("2" (REPLACE -1)
                      (("2" (HIDE -1)
                        (("2" (HIDE -1 -2 3)
                          (("2" (EXPAND "dbl")
                            (("2" (APPLY-EXTENSIONALITY :HIDE? T)
                              (("2" (IFF 1) (("2" (GROUND) NIL)))))))))))))
                     ("3" (PROPAX) NIL)))))))))
             ("2" (CASE "y!2 = y!1")
              (("1" (REPLACE -1)
                (("1" (HIDE -1)
                  (("1" (INST -2 "x!1") (("1" (ASSERT) NIL)))))))
               ("2" (HIDE -2 -4 4)
                (("2" (REPLACE -1)
                  (("2" (HIDE -1)
                    (("2" (EXPAND "dbl")
                      (("2" (GROUND) NIL)))))))))))))))))))))))
 (|deg_del_edge_jon| "" (SKOSIMP*)
  (("" (EXPAND "deg")
    ((""
      (CASE "incident_edges(y!1, del_edge(G!1, e!1))=
             remove(e!1,incident_edges(y!1, G!1))")
      (("1" (REPLACE -1)
        (("1" (LEMMA "card_remove[doubleton[T]]")
          (("1" (INST?)
            (("1" (ASSERT)
              (("1" (REPLACE -1)
                (("1" (HIDE -1 -2)
                  (("1" (LIFT-IF)
                    (("1" (GROUND)
                      (("1" (EXPAND "incident_edges")
                        (("1" (REPLACE -1)
                          (("1" (HIDE -1 -2)
                            (("1" (EXPAND "dbl")
                              (("1" (PROPAX) NIL)))))))))))))))))))))))))
       ("2" (HIDE 2)
        (("2" (APPLY-EXTENSIONALITY :HIDE? T) (("2" (GRIND) NIL)))))))))))
 (|deg_del_edge3| "" (SKOSIMP*)
  (("" (EXPAND "deg")
    ((""
      (CASE "incident_edges(y!1, G!1) = incident_edges(y!1, del_edge(G!1, e!1))")
      (("1" (ASSERT) NIL)
       ("2" (HIDE 3)
        (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
          (("2" (EXPAND "incident_edges")
            (("2" (IFF 1)
              (("2" (GROUND)
                (("1" (LEMMA "del_edge_lem3[T]")
                  (("1" (INST?) (("1" (ASSERT) NIL)))))
                 ("2" (LEMMA "del_edge_lem2[T]")
                  (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))))
 (|deg_del_edge_ge| "" (SKOSIMP*)
  (("" (CASE "e!1(y!1)")
    (("1" (LEMMA "deg_del_edge2")
      (("1" (INST?)
        (("1" (ASSERT)
          (("1" (LEMMA "del_edge_lem5[T]")
            (("1" (INST?) (("1" (ASSERT) NIL)))))))))))
     ("2" (LEMMA "deg_del_edge3") (("2" (INST?) (("2" (ASSERT) NIL)))))))))
 (|deg_del_edge_le| "" (SKOSIMP*)
  (("" (CASE "e!1(y!1)")
    (("1" (LEMMA "deg_del_edge2")
      (("1" (INST?)
        (("1" (ASSERT)
          (("1" (LEMMA "del_edge_lem5[T]")
            (("1" (INST?) (("1" (ASSERT) NIL)))))))))))
     ("2" (LEMMA "deg_del_edge3") (("2" (INST?) (("2" (ASSERT) NIL)))))))))
 (|deg_edge_exists| "" (SKOSIMP*)
  (("" (EXPAND "deg")
    (("" (REWRITE "nonempty_card[doubleton[T]]" :DIR RL)
      (("" (EXPAND "nonempty?")
        (("" (EXPAND "empty?")
          (("" (EXPAND "incident_edges")
            (("" (SKOSIMP*)
              (("" (EXPAND "member")
                (("" (INST?)
                  (("" (FLATTEN) (("" (ASSERT) NIL)))))))))))))))))))))
 (|deg_to_card| "" (SKOSIMP*)
  (("" (LEMMA "deg_edge_exists")
    (("" (INST?)
      (("" (ASSERT)
        (("" (SKOSIMP*)
          (("" (HIDE -1 -3)
            (("" (TYPEPRED "G!1")
              (("" (INST?)
                (("" (ASSERT)
                  (("" (TYPEPRED "e!1")
                    (("" (SKOSIMP*)
                      (("" (INST-CP -2 "x!1")
                        (("" (INST -2 "y!1")
                          (("" (REPLACE -1)
                            (("" (HIDE -1)
                              (("" (HIDE -3)
                                (("" (EXPAND "dbl")
                                  (("" (EXPAND "size")
                                    ((""
                                      (CASE
                                       "subset?(add[T](x!1,singleton(y!1)),vert(G!1))")
                                      (("1"
                                        (LEMMA "card_subset[T]")
                                        (("1"
                                          (INST?)
                                          (("1"
                                            (ASSERT)
                                            (("1"
                                              (HIDE -2)
                                              (("1"
                                                (LEMMA "card_add[T]")
                                                (("1"
                                                  (INST?)
                                                  (("1"
                                                    (LEMMA
                                                     "card_singleton[T]")
                                                    (("1"
                                                      (INST?)
                                                      (("1"
                                                        (REPLACE -1)
                                                        (("1"
                                                          (HIDE -1)
                                                          (("1"
                                                            (EXPAND
                                                             "singleton")
                                                            (("1"
                                                              (REPLACE -1)
                                                              (("1"
                                                                (HIDE -1)
                                                                (("1"
                                                                  (ASSERT)
                                                                  NIL)))))))))))))))))))))))
                                           ("2"
                                            (REWRITE "finite_add[T]")
                                            NIL)))))
                                       ("2"
                                        (HIDE 3)
                                        (("2"
                                          (GRIND)
                                          NIL)))))))))))))))))))))))))))))))))))))))))
 (|del_vert_deg_0| "" (SKOSIMP*)
  (("" (EXPAND "deg")
    (("" (LEMMA "card_empty?[doubleton[T]]")
      (("" (INST?)
        (("" (IFF)
          (("" (ASSERT)
            (("" (HIDE -2)
              (("" (EXPAND "incident_edges")
                (("" (EXPAND "empty?")
                  (("" (EXPAND "member")
                    (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
                      (("" (EXPAND "del_vert")
                        (("" (INST?)
                          (("" (IFF 1)
                            (("" (GROUND) NIL)))))))))))))))))))))))))))))
 (|deg_del_vert_TCC1| "" (SUBTYPE-TCC) NIL)
 (|deg_del_vert| "" (SKOSIMP*)
  (("" (EXPAND "deg")
    ((""
      (CASE-REPLACE "incident_edges(v!1, del_vert(G!1, x!1)) =
             incident_edges(v!1, del_edge(G!1,dbl[T](x!1,v!1)))")
      (("1" (HIDE -1)
        (("1" (LEMMA "deg_del_edge")
          (("1" (INST?)
            (("1" (INST -1 "x!1" "v!1")
              (("1" (PROP) (("1" (EXPAND "deg") (("1" (ASSERT) NIL)))))))
             ("2" (INST?) (("2" (ASSERT) NIL)))))))))
       ("2" (HIDE 3)
        (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
          (("1" (EXPAND "incident_edges")
            (("1" (GRIND)
              (("1" (HIDE -3) (("1" (REPLACE -2 * RL) (("1" (GRIND) NIL)))))
               ("2" (HIDE -1 -4)
                (("2" (LEMMA "edge_has_2_verts[T]")
                  (("2" (INST?) (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))
           ("2" (INST?) (("2" (ASSERT) NIL)))))))
       ("3" (INST?) (("3" (ASSERT) NIL)))))))))
 (|del_vert_not_incident| "" (SKOSIMP*)
  (("" (EXPAND "deg")
    ((""
      (CASE-REPLACE
       "incident_edges(x!1, G!1) = incident_edges(x!1, del_vert(G!1, v!1))")
      (("" (HIDE 4)
        (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
          (("" (EXPAND "incident_edges")
            (("" (IFF 1)
              (("" (PROP)
                (("1" (LEMMA "edge_in_del_vert")
                  (("1" (INST?)
                    (("1" (ASSERT)
                      (("1" (LEMMA "edge_has_2_verts")
                        (("1" (INST?)
                          (("1" (INST?) (("1" (ASSERT) NIL)))))))))))))
                 ("2" (EXPAND "del_vert")
                  (("2" (FLATTEN) (("2" (PROPAX) NIL)))))))))))))))))))))
 (|singleton_deg| "" (SKOSIMP*)
  (("" (EXPAND "singleton?")
    (("" (EXPAND "deg")
      (("" (REWRITE "card_is_0[doubleton[T]]")
        (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
          (("" (EXPAND "incident_edges")
            (("" (EXPAND "emptyset")
              (("" (FLATTEN)
                (("" (LEMMA "edge_in_card_gt_1[T]")
                  (("" (INST?)
                    (("" (SPLIT -1)
                      (("1" (ASSERT)
                        (("1" (EXPAND "size") (("1" (ASSERT) NIL)))))
                       ("2" (PROPAX) NIL)))))))))))))))))))))))
 (|deg_1_sing| "" (SKOSIMP*)
  (("" (EXPAND "deg")
    (("" (LEMMA "card_one[Dbl]")
      (("" (INST?)
        (("" (FLATTEN)
          (("" (ASSERT)
            (("" (HIDE -2)
              (("" (SKOSIMP*)
                (("" (INST?)
                  (("" (ASSERT)
                    ((""
                      (CASE-REPLACE
                       "incident_edges(v!1, G!1)(x!1) = singleton(x!1)(x!1)")
                      (("1" (HIDE -2)
                        (("1" (EXPAND "incident_edges")
                          (("1" (EXPAND "singleton")
                            (("1" (FLATTEN) (("1" (ASSERT) NIL)))))))))
                       ("2" (ASSERT) NIL))))))))))))))))))))))))
$$$doubletons.pvs
doubletons[T: TYPE]: THEORY
BEGIN
   x,y,z: VAR T
   dbl(x,y): set[T] = {t: T | t = x OR t = y}
   S: VAR set[T]
   doubleton?(S): bool = (EXISTS x,y: x /= y AND S = dbl(x,y))
   doubleton: TYPE = {S | EXISTS x,y: x /= y AND S = dbl(x,y)}
   Dbl: TYPE = doubleton
   dbl_comm: LEMMA dbl(x,y) = dbl(y,x)
   D: VAR doubleton
   doubleton_irreflexive  : LEMMA NOT doubleton?(dbl(x,x))
   doubleton_nonempty     : LEMMA nonempty?(D)
   doubleton_rest_nonempty: LEMMA nonempty?(rest(D))
   dbl_choose             : LEMMA choose(dbl(x,y)) = x or choose(dbl(x,y)) = y
   dbl_rest_choose        : LEMMA x /= y IMPLIES
                                  (choose(dbl(x,y)) /= choose(rest(dbl(x,y)))) AND
                                  (choose(rest(dbl(x,y))) = x
                                      OR choose(rest(dbl(x,y))) = y)
   dbl_to_pair(D) : {(x,y) | D = dbl(x,y)}
   dbl_def        : LEMMA dbl(PROJ_1(dbl_to_pair(D)), PROJ_2(dbl_to_pair(D))) = D
   dbl_in         : LEMMA D = dbl(x,y) IMPLIES D(x) AND D(y)
   dbl_not_in     : LEMMA D = dbl(x,y) AND z /= x AND z /= y IMPLIES NOT D(z)
   dbl_to_pair_lem        : LEMMA x /= y IMPLIES
                                   dbl_to_pair(dbl(x,y)) = (x,y) OR
                                   dbl_to_pair(dbl(x,y)) = (y,x)
   dbl_to_pair_inverse_l  : LEMMA dbl(dbl_to_pair(D)) = D
   dbl_proj               : LEMMA D(PROJ_1(dbl_to_pair(D))) AND
                                  D(PROJ_2(dbl_to_pair(D)))
   v: VAR T
   proj_dbl: LEMMA (PROJ_1(dbl_to_pair(D)) = v OR PROJ_2(dbl_to_pair(D)) = v)
                    IMPLIES D(v)
   dbl_eq: LEMMA dbl(x,y) = dbl(v,z) IMPLIES
                        (x = v AND y = z) OR (x = z AND y = v)
END doubletons
$$$doubletons.prf
(|doubletons|
 (|dbl_comm| "" (SKOSIMP*)
  (("" (EXPAND "dbl")
    (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
      (("" (IFF) (("" (GROUND) NIL)))))))))
 (|doubleton_irreflexive| "" (SKOSIMP*)
  (("" (EXPAND "doubleton?")
    (("" (SKOSIMP*)
      ((""
        (CASE "(FORALL (z:T): member(z,dbl(x!1, x!1)) = member(z,dbl(x!2, y!1)))")
        (("1" (INST-CP -1 "x!2")
          (("1" (INST -1 "y!1")
            (("1" (EXPAND "member")
              (("1" (EXPAND "dbl")
                (("1" (HIDE -3) (("1" (GROUND) NIL)))))))))))
         ("2" (SKOSIMP*)
          (("2" (EXPAND "member")
            (("2" (REPLACE -1) (("2" (PROPAX) NIL)))))))))))))))
 (|doubleton_nonempty| "" (GRIND) NIL)
 (|doubleton_rest_nonempty| "" (SKOLEM-TYPEPRED)
  (("" (SKOSIMP*)
    (("" (EXPAND "rest")
      (("" (REWRITE "doubleton_nonempty")
        (("" (EXPAND "nonempty?")
          (("" (ASSERT)
            (("" (PROP)
              (("" (EXPAND "empty?")
                (("" (EXPAND "remove")
                  (("" (EXPAND "member")
                    (("" (INST-CP - "x!1")
                      (("" (INST - "y!1")
                        (("" (REPLACE -1)
                          (("" (EXPAND "dbl")
                            (("" (ASSERT) NIL)))))))))))))))))))))))))))))
 (|dbl_choose_TCC1| "" (SUBTYPE-TCC) NIL)
 (|dbl_choose| "" (SKOSIMP*)
  (("" (EXPAND "dbl")
    (("" (EXPAND "choose")
      (("" (ASSERT)
        (("" (LEMMA "epsilon_ax[T]")
          (("1" (INST?)
            (("1" (ASSERT) (("1" (INST + "x!1") (("1" (ASSERT) NIL)))))))
           ("2" (INST + "x!1") NIL)))))))))))
 (|dbl_rest_choose_TCC1| "" (SKOSIMP*)
  (("" (USE "doubleton_rest_nonempty") (("" (INST?) (("" (ASSERT) NIL)))))))
 (|dbl_rest_choose| "" (SKOSIMP*)
  (("" (EXPAND "rest")
    (("" (LEMMA "doubleton_nonempty")
      (("" (INST - "dbl(x!1, y!1)")
        (("1" (EXPAND "nonempty?")
          (("1" (ASSERT)
            (("1" (USE "dbl_choose")
              (("1" (GROUND)
                (("1" (REPLACE -2)
                  (("1" (EXPAND "remove")
                    (("1" (EXPAND "member") (("1" (ASSERT) NIL)))))))
                 ("2" (REPLACE -1)
                  (("2" (EXPAND "remove")
                    (("2" (EXPAND "member")
                      (("2" (ASSERT)
                        (("2" (EXPAND "dbl")
                          (("2" (HIDE -1 3)
                            (("2" (EXPAND "choose")
                              (("2" (LEMMA "epsilon_ax[T]")
                                (("1" (INST?)
                                  (("1" (ASSERT)
                                    (("1" (INST + "y!1")
                                      (("1" (ASSERT) NIL)))))))
                                 ("2" (INST + "y!1") NIL)))))))))))))))))
                 ("3" (REPLACE -2)
                  (("3" (EXPAND "remove") (("3" (ASSERT) NIL)))))
                 ("4" (REPLACE -1)
                  (("4" (EXPAND "remove")
                    (("4" (EXPAND "member")
                      (("4" (EXPAND "dbl")
                        (("4" (ASSERT)
                          (("4" (HIDE -1)
                            (("4" (HIDE 3)
                              (("4" (EXPAND "choose")
                                (("4" (LEMMA "epsilon_ax[T]")
                                  (("1" (INST?)
                                    (("1" (ASSERT)
                                      (("1"
                                        (INST + "x!1")
                                        (("1" (ASSERT) NIL)))))))
                                   ("2" (INST + "x!1")
                                    NIL)))))))))))))))))))))))))))
         ("2" (HIDE 3) (("2" (INST?) (("2" (ASSERT) NIL)))))))))))))
 (|dbl_to_pair_TCC1| "" (INST 1 " (LAMBDA D: (choose(D),choose(rest(D))))")
  (("1" (SKOSIMP*)
    (("1" (TYPEPRED "D!1")
      (("1" (SKOSIMP*)
        (("1" (REPLACE -1)
          (("1" (LEMMA "dbl_choose")
            (("1" (INST?)
              (("1" (LEMMA "dbl_rest_choose")
                (("1" (INST?)
                  (("1" (ASSERT)
                    (("1" (FLATTEN)
                      (("1" (ASSERT)
                        (("1" (PROP)
                          (("1" (REPLACE*) NIL)
                           ("2" (REPLACE*)
                            (("2" (REWRITE "dbl_comm") NIL)))
                           ("3" (REPLACE*) NIL)
                           ("4" (REPLACE*) NIL)))))))))))))))))))))))))
   ("2" (LEMMA "doubleton_rest_nonempty") (("2" (PROPAX) NIL)))
   ("3" (LEMMA "doubleton_nonempty") (("3" (PROPAX) NIL)))))
 (|dbl_def| "" (SKOSIMP*) (("" (ASSERT) NIL)))
 (|dbl_in| "" (SKOSIMP*)
  (("" (REPLACE -1) (("" (HIDE -1) (("" (GRIND) NIL)))))))
 (|dbl_not_in| "" (SKOSIMP*)
  (("" (REPLACE -1) (("" (HIDE -1) (("" (GRIND) NIL)))))))
 (|dbl_to_pair_lem_TCC1| "" (SUBTYPE-TCC) NIL)
 (|dbl_to_pair_lem| "" (SKOSIMP*)
  (("" (TYPEPRED "dbl_to_pair(dbl(x!1, y!1))")
    (("1"
      (CASE "dbl(x!1, y!1)(x!1)
          =
        dbl(PROJ_1(dbl_to_pair(dbl(x!1, y!1))),
            PROJ_2(dbl_to_pair(dbl(x!1, y!1))))(x!1)")
      (("1"
        (CASE "dbl(x!1, y!1)(y!1)
          =
        dbl(PROJ_1(dbl_to_pair(dbl(x!1, y!1))),
            PROJ_2(dbl_to_pair(dbl(x!1, y!1))))(y!1)")
        (("1" (HIDE -3)
          (("1" (EXPAND "dbl")
            (("1" (APPLY-EXTENSIONALITY 2 :HIDE? T)
              (("1" (APPLY-EXTENSIONALITY 3 :HIDE? T)
                (("1" (EXPAND "dbl") (("1" (INST?) (("1" (ASSERT) NIL)))))))
               ("2" (APPLY-EXTENSIONALITY 3 :HIDE? T)
                (("2" (EXPAND "dbl") (("2" (INST?) (("2" (ASSERT) NIL)))))))
               ("3" (EXPAND "dbl") (("3" (INST?) (("3" (ASSERT) NIL)))))))))))
         ("2" (ASSERT) NIL)))
       ("2" (ASSERT) NIL)))
     ("2" (INST?) (("2" (ASSERT) NIL)))))))
 (|dbl_to_pair_inverse_l| "" (SKOLEM-TYPEPRED)
  (("" (SKOSIMP*)
    (("" (REPLACE -1)
      (("" (USE "dbl_to_pair_lem")
        (("" (ASSERT)
          (("" (GROUND)
            (("1" (REPLACE -1) (("1" (PROPAX) NIL)))
             ("2" (REPLACE -1)
              (("2" (REWRITE "dbl_comm") NIL)))))))))))))))
 (|dbl_proj| "" (SKOSIMP*)
  (("" (LEMMA "dbl_to_pair_inverse_l")
    (("" (INST?)
      (("" (EXPAND "dbl") (("" (REPLACE -1 + RL) (("" (ASSERT) NIL)))))))))))
 (|proj_dbl| "" (SKOSIMP*)
  (("" (TYPEPRED "D!1")
    (("" (SKOSIMP*)
      (("" (REPLACE -1)
        (("" (HIDE -1)
          (("" (LEMMA "dbl_to_pair_lem")
            (("" (INST?) (("" (ASSERT) (("" (GRIND) NIL)))))))))))))))))
 (|dbl_eq| "" (SKOSIMP*)
  (("" (CASE "dbl(x!1, y!1)(x!1) = dbl(v!1, z!1)(x!1)")
    (("1" (CASE "dbl(x!1, y!1)(y!1) = dbl(v!1, z!1)(y!1)")
      (("1" (CASE "dbl(x!1, y!1)(z!1) = dbl(v!1, z!1)(z!1)")
        (("1" (CASE "dbl(x!1, y!1)(v!1) = dbl(v!1, z!1)(v!1)")
          (("1" (EXPAND "dbl") (("1" (GROUND) NIL))) ("2" (ASSERT) NIL)))
         ("2" (ASSERT) NIL)))
       ("2" (ASSERT) NIL)))
     ("2" (ASSERT) NIL))))))
$$$graphs.pvs
graphs[T: TYPE]: THEORY
%-------------------------------------------------------------------------------
%
% Defines:
%
%      Graph[T] -- graph over domain T
%      vert(G)  -- vertices of graph G
%      edges(G) -- set of edges in a graph G
%
%  Authors:
%
%      Ricky W. Butler   NASA Langley
%      Jon Sjogren       AFOSR
%
%  Version 1.0           Last modified 12/20/96
%
%  Maintained by:
%
%     Rick Butler        NASA Langley Research Center
%                        R.W.Butler@larc.nasa.gov
%
%  NOTE:
%
%-------------------------------------------------------------------------------
BEGIN
  IMPORTING finite_sets@finite_sets[T], doubletons[T],
            finite_sets@finite_sets[doubleton[T]]
  R: VAR PRED[[T, T]]
  x,y,v: VAR T
  pregraph: TYPE = [# vert : finite_set[T],
                      edges: finite_set[doubleton[T]] #]
  graph: TYPE = {g: pregraph | (FORALL (e: doubleton[T]): edges(g)(e) IMPLIES
                                     (FORALL (x: T): e(x) IMPLIES vert(g)(x)))}
  e: VAR doubleton[T]
  G: var graph
  edg(x,(y:{y:T | y /= x})): doubleton[T] = dbl[T](x,y)
  edge?(G)(x,y): bool = x /= y AND edges(G)(dbl[T](x,y))
  edge?_comm : LEMMA edge?(G)(y, x) IMPLIES edge?(G)(x, y)
  edges_vert      : LEMMA e(x) AND edges(G)(e) IMPLIES
                             (EXISTS y: x /= y AND vert(G)(y) AND e(y))
  other_vert      : LEMMA e(v) AND edges(G)(e)
                         IMPLIES (EXISTS (u: T): u /= v AND vert(G)(u)
                                                 AND e = dbl[T](u, v))
  edge_has_2_verts: LEMMA x /= v AND e(x) AND e(v)
                                   IMPLIES e = dbl(x,v)
% -------------- size of graphs --------------------
  size(G): nat = card[T](vert(G))
  empty?(G): bool = empty?(vert(G))
  singleton?(G): bool = (size(G) = 1)
  isolated?(G): bool = empty?(edges(G))
  empty?_rew          : LEMMA empty?(G) = (card(vert(G)) = 0)
  edges_of_empty      : LEMMA empty?(G)
                                 IMPLIES edges(G) = emptyset[doubleton[T]]
  singleton_edges     : LEMMA singleton?(G) IMPLIES  empty?(edges(G))
  edge_in_card_gt_1   : LEMMA edges(G)(e) IMPLIES card(vert(G)) > 1
  not_singleton_2_vert: LEMMA NOT empty?(G) AND NOT singleton?(G)
                                IMPLIES (EXISTS (x,y: T): x /= y AND
                                     vert(G)(x) AND vert(G)(y))
  infgraph: TYPE = [# vert : set[T],
                      edges: set[doubleton[T]] #]
  is_graph(g: infgraph): bool = is_finite[T](vert(g))
                                AND is_finite[doubleton[T]](edges(g))
                                AND (FORALL (e: doubleton[T]): edges(g)(e)
                                     IMPLIES (FORALL x: e(x) IMPLIES vert(g)(x)))
  singleton_graph(v): graph = (# vert := singleton[T](v),
                                       edges := emptyset[doubleton[T]] #)
  is_sing:  LEMMA singleton?(singleton_graph(x))
  Graph: TYPE = {g: graph | nonempty?(vert(g))}
  finite_dbl: LEMMA is_finite(dbl[T](x,y))
  finite_doubleton: LEMMA is_finite(e)
  card_dbl: LEMMA x /= y IMPLIES card(dbl(x,y)) = 2
  JUDGEMENT dbl HAS_TYPE [[T,T] -> finite_set[T]]
END graphs
$$$graphs.prf
(|graphs| (|edg_TCC1| "" (SKOSIMP*) (("" (INST?) (("" (ASSERT) NIL)))))
 (|edge?_TCC1| "" (SUBTYPE-TCC) NIL)
 (|edge?_comm| "" (SKOSIMP*)
  (("" (EXPAND "edge?")
    (("" (REWRITE "dbl_comm") (("" (FLATTEN) (("" (ASSERT) NIL)))))))))
 (|edges_vert| "" (SKOSIMP*)
  (("" (TYPEPRED "e!1")
    (("" (SKOSIMP*)
      (("" (REPLACE -1)
        (("" (HIDE -1)
          (("" (LEMMA "dbl_to_pair_lem")
            (("" (INST?)
              (("" (ASSERT)
                (("" (PROP)
                  (("1" (HIDE -1)
                    (("1" (EXPAND "dbl" -1)
                      (("1" (PROP)
                        (("1" (INST 2 "y!1")
                          (("1" (ASSERT)
                            (("1" (TYPEPRED "G!1")
                              (("1" (INST?)
                                (("1" (ASSERT)
                                  (("1" (INST -1 "y!1")
                                    (("1" (EXPAND "dbl")
                                      (("1" (PROPAX) NIL)))))))
                                 ("2" (INST?) (("2" (ASSERT) NIL)))))))))))
                         ("2" (REPLACE -1)
                          (("2" (HIDE -1)
                            (("2" (INST?)
                              (("2" (TYPEPRED "G!1")
                                (("2" (INST?)
                                  (("1" (ASSERT)
                                    (("1" (INST?)
                                      (("1"
                                        (EXPAND "dbl")
                                        (("1" (PROPAX) NIL)))))))
                                   ("2" (INST?)
                                    (("2" (ASSERT)
                                      (("2"
                                        (HIDE -1 3)
                                        (("2"
                                          (APPLY-EXTENSIONALITY :HIDE? T)
                                          (("2"
                                            (GRIND)
                                            NIL)))))))))))))))))))))))))
                   ("2" (HIDE -1)
                    (("2" (EXPAND "dbl" -1)
                      (("2" (SPLIT)
                        (("1" (REPLACE -1)
                          (("1" (HIDE -1)
                            (("1" (INST 2 "y!1")
                              (("1" (ASSERT)
                                (("1" (TYPEPRED "G!1")
                                  (("1" (INST?)
                                    (("1" (ASSERT)
                                      (("1"
                                        (INST?)
                                        (("1"
                                          (EXPAND "dbl")
                                          (("1" (PROPAX) NIL)))))))
                                     ("2" (INST?)
                                      (("2" (ASSERT) NIL)))))))))))))))
                         ("2" (REPLACE -1)
                          (("2" (HIDE -1)
                            (("2" (INST 2 "x!2")
                              (("2" (ASSERT)
                                (("2" (TYPEPRED "G!1")
                                  (("2" (INST?)
                                    (("1" (ASSERT)
                                      (("1"
                                        (INST?)
                                        (("1"
                                          (EXPAND "dbl")
                                          (("1" (PROPAX) NIL)))))))
                                     ("2" (INST?)
                                      (("2"
                                        (ASSERT)
                                        NIL)))))))))))))))))))))))))))))))))))))))
 (|other_vert| "" (SKOSIMP*)
  (("" (TYPEPRED "e!1")
    (("" (SKOSIMP*)
      (("" (REPLACE -1)
        (("" (HIDE -1)
          (("" (EXPAND "dbl" -1)
            (("" (PROP)
              (("1" (REPLACE -1)
                (("1" (HIDE -1)
                  (("1" (INST 2 "y!1")
                    (("1" (TYPEPRED "G!1")
                      (("1" (INST?)
                        (("1" (ASSERT)
                          (("1" (INST -1 "y!1")
                            (("1" (EXPAND "dbl" -1)
                              (("1" (ASSERT)
                                (("1" (HIDE -1 -2)
                                  (("1" (APPLY-EXTENSIONALITY 2 :HIDE? T)
                                    (("1" (GRIND) NIL)))))))))))))
                         ("2" (INST?)
                          (("2" (ASSERT)
                            (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T)
                              (("2" (GRIND) NIL)))))))))))))))))
               ("2" (REPLACE -1)
                (("2" (HIDE -1)
                  (("2" (INST 2 "x!1")
                    (("2" (TYPEPRED "G!1")
                      (("2" (INST?)
                        (("1" (ASSERT)
                          (("1" (INST -1 "x!1")
                            (("1" (ASSERT)
                              (("1" (EXPAND "dbl") (("1" (PROPAX) NIL)))))))))
                         ("2" (INST?)
                          (("2" (ASSERT) NIL)))))))))))))))))))))))))))
 (|edge_has_2_verts| "" (SKOSIMP*)
  (("" (TYPEPRED "e!1")
    (("" (SKOSIMP*)
      (("" (REPLACE -1)
        (("" (HIDE -1)
          (("" (APPLY-EXTENSIONALITY 3 :HIDE? T)
            (("" (EXPAND "dbl") (("" (IFF) (("" (GROUND) NIL)))))))))))))))))
 (|empty?_rew| "" (SKOSIMP*)
  (("" (LEMMA " card_empty?[T]")
    (("" (INST?)
      (("" (EXPAND "empty?" 1) (("" (REPLACE -1) (("" (PROPAX) NIL)))))))))))
 (|edges_of_empty| "" (SKOSIMP*)
  (("" (EXPAND "empty?")
    (("" (APPLY-EXTENSIONALITY 1 :HIDE? T)
      (("" (EXPAND "emptyset")
        (("" (EXPAND "empty?")
          (("" (TYPEPRED "x!1")
            (("" (SKOSIMP*)
              (("" (INST -3 "y!1")
                (("" (EXPAND "member")
                  (("" (TYPEPRED "G!1")
                    (("" (INST?)
                      (("" (ASSERT)
                        (("" (INST -1 "y!1")
                          (("" (REPLACE -2)
                            (("" (EXPAND "dbl")
                              (("" (PROPAX) NIL)))))))))))))))))))))))))))))))
 (|singleton_edges| "" (SKOSIMP*)
  (("" (EXPAND "singleton?")
    (("" (EXPAND "size")
      (("" (LEMMA "card_one[T]")
        (("" (INST?)
          (("" (ASSERT)
            (("" (HIDE -2)
              (("" (SKOSIMP*)
                (("" (EXPAND "empty?")
                  (("" (SKOSIMP*)
                    (("" (EXPAND "member")
                      (("" (TYPEPRED "x!2")
                        (("" (SKOSIMP*)
                          (("" (REPLACE -1)
                            (("" (HIDE -1)
                              (("" (TYPEPRED "G!1")
                                (("" (INST?)
                                  (("1" (ASSERT)
                                    (("1" (INST-CP -1 "x!3")
                                      (("1"
                                        (INST -1 "y!1")
                                        (("1"
                                          (EXPAND "dbl")
                                          (("1"
                                            (HIDE -4)
                                            (("1"
                                              (REPLACE -3)
                                              (("1"
                                                (HIDE -3)
                                                (("1"
                                                  (EXPAND "singleton")
                                                  (("1"
                                                    (ASSERT)
                                                    NIL)))))))))))))))))
                                   ("2" (INST?)
                                    (("2" (ASSERT)
                                      NIL)))))))))))))))))))))))))))))))))))))
 (|edge_in_card_gt_1| "" (SKOSIMP*)
  (("" (TYPEPRED "e!1")
    (("" (SKOSIMP*)
      (("" (REPLACE -1)
        (("" (HIDE -1)
          (("" (TYPEPRED "G!1")
            (("" (ASSERT)
              (("" (INST?)
                (("1" (ASSERT)
                  (("1" (HIDE -2)
                    (("1" (INST-CP -1 "x!1")
                      (("1" (INST -1 "y!1")
                        (("1" (EXPAND "dbl")
                          (("1"
                            (CASE "subset?(add(x!1,singleton(y!1)),vert(G!1))")
                            (("1" (LEMMA "card_subset[T]")
                              (("1" (INST?)
                                (("1" (REWRITE "card_add")
                                  (("1" (REWRITE "card_singleton")
                                    (("1" (ASSERT)
                                      (("1"
                                        (HIDE -2)
                                        (("1"
                                          (EXPAND "singleton")
                                          (("1" (ASSERT) NIL)))))))))))
                                 ("2" (REWRITE "finite_add") NIL)))))
                             ("2" (GRIND) NIL)))))))))))))
                 ("2" (INST?) (("2" (ASSERT) NIL)))))))))))))))))))
 (|not_singleton_2_vert| "" (SKOSIMP*)
  (("" (EXPAND "empty?")
    (("" (LEMMA "card_empty?[T]")
      (("" (INST?)
        (("" (IFF)
          (("" (ASSERT)
            (("" (EXPAND "singleton?")
              (("" (EXPAND "size")
                (("" (LEMMA "card_2_has_2[T]")
                  (("" (INST?) (("" (ASSERT) NIL)))))))))))))))))))))
 (|singleton_graph_TCC1| "" (SKOSIMP*)
  (("" (REWRITE "finite_singleton") NIL)))
 (|singleton_graph_TCC2| "" (SUBTYPE-TCC) NIL)
 (|is_sing| "" (SKOSIMP*)
  (("" (EXPAND "singleton_graph")
    (("" (EXPAND "singleton?")
      (("" (EXPAND "size") (("" (REWRITE "card_singleton") NIL)))))))))
 (|finite_dbl| "" (SKOSIMP*)
  (("" (CASE-REPLACE "dbl[T](x!1, y!1) = add(x!1,singleton(y!1))")
    (("1" (HIDE -1) (("1" (REWRITE "finite_add") NIL)))
     ("2" (HIDE 2)
      (("2" (APPLY-EXTENSIONALITY :HIDE? T) (("2" (GRIND) NIL)))))))))
 (|finite_doubleton| "" (SKOSIMP*)
  (("" (TYPEPRED "e!1")
    (("" (SKOSIMP*)
      (("" (REPLACE -1)
        (("" (HIDE -1) (("" (REWRITE "finite_dbl") NIL)))))))))))
 (|card_dbl_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL)))
 (|card_dbl| "" (SKOSIMP*)
  (("" (CASE-REPLACE "dbl(x!1, y!1) = add(x!1,singleton(y!1))")
    (("1" (HIDE -1)
      (("1" (REWRITE "card_add")
        (("1" (REWRITE "card_singleton")
          (("1" (EXPAND "singleton") (("1" (ASSERT) NIL)))))))))
     ("2" (HIDE 3)
      (("2" (APPLY-EXTENSIONALITY 1 :HIDE? T) (("2" (GRIND) NIL)))))))))
 (|dbl_TCC1| "" (SKOSIMP*) (("" (REWRITE "finite_dbl") NIL))))