# Declarations

decl_type: tcc
theory: doubletons
library: graphs
signature: nil
location: 125 0 127 999
body:
  % Judgement subtype TCC generated (at line 64, column 13) for  dbl(x, y)
      % expected type  finite_set[T]
  dbl_TCC1: OBLIGATION FORALL (x, y): is_finite[T](dbl(x, y));


decl_type: tcc
theory: doubletons
library: graphs
signature: nil
location: 129 0 133 999
body:
  % Subtype TCC generated (at line 89, column 81) for  length(fs) - 1 - i
      % expected type  below[fs`length]
  rev_TCC1: OBLIGATION
    FORALL (fs: finseq[T], i: below(length(fs))):
      length(fs) - 1 - i >= 0 AND length(fs) - 1 - i < fs`length;


decl_type: formula
theory: graphs
library: graphs
signature: nil
location: 50 2 51 71
body:
    edges_vert      : LEMMA e(x) AND edges(G)(e) IMPLIES
                               (EXISTS y: x /= y AND vert(G)(y) AND e(y))


decl_type: formula
theory: graphs
library: graphs
signature: nil
location: 54 2 56 70
body:
    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))


decl_type: formula
theory: graphs
library: graphs
signature: nil
location: 58 2 59 55
body:
    edge_has_2_verts: LEMMA x /= v AND e(x) AND e(v)
                                     IMPLIES e = dbl(x,v)


decl_type: formula
theory: graphs
library: graphs
signature: nil
location: 62 1 63 56
body:
   edges_vert_in: LEMMA e = dbl[T](x, y) AND edges(G)(e)
                         IMPLIES vert(G)(x) AND vert(G)(y)


decl_type: formula
theory: graphs
library: graphs
signature: nil
location: 80 2 81 74
body:
    edges_of_empty      : LEMMA empty?(G) 
                                   IMPLIES edges(G) = emptyset[doubleton[T]]


decl_type: formula
theory: graphs
library: graphs
signature: nil
location: 87 2 89 63
body:
    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))


decl_type: type
theory: graphs
library: graphs
signature: nil
location: 35 2 36 56
body:
    pregraph: TYPE = [# vert : finite_set[T],
                        edges: finite_set[doubleton[T]] #]


decl_type: type
theory: graphs
library: graphs
signature: nil
location: 38 2 39 79
body:
    graph: TYPE = {g: pregraph | (FORALL (e: doubleton[T]): edges(g)(e) IMPLIES
                                       (FORALL (x: T): e(x) IMPLIES vert(g)(x)))}


decl_type: function
theory: graphs
library: graphs
signature: [infgraph -> bool]
location: 95 2 98 81
body:
    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)))


decl_type: function
theory: graphs
library: graphs
signature: [T -> (singleton?)]
location: 101 2 102 73
body:
    singleton_graph(v): (singleton?) = (# vert := singleton[T](v), 
                                         edges := emptyset[doubleton[T]] #)


decl_type: tcc
theory: graphs
library: graphs
signature: nil
location: 113 0 118 999
body:
  % Subtype TCC generated (at line 44, column 44) for  dbl[T](x, y)
      % expected type  doubleton[T]
  edg_TCC1: OBLIGATION
    FORALL (x: T, (y: {y: T | y /= x})):
      EXISTS (x_1: T), (y_1: T):
        x_1 /= y_1 AND dbl[T](x, y) = dbl[T](x_1, y_1);


decl_type: tcc
theory: graphs
library: graphs
signature: nil
location: 120 0 126 999
body:
  % Subtype TCC generated (at line 46, column 44) for  dbl[T](x, y)
      % expected type  doubleton[T]
  edge?_TCC1: OBLIGATION
    FORALL (G: graph, x: T, y: T):
      x /= y IMPLIES
       (EXISTS (x_1: T), (y_1: T):
          x_1 /= y_1 AND dbl[T](x, y) = dbl[T](x_1, y_1));


decl_type: tcc
theory: graphs
library: graphs
signature: nil
location: 128 0 138 999
body:
  % Subtype TCC generated (at line 101, column 37) for
      % (# vert := singleton[T](v), edges := emptyset[doubleton[T]] #)
      % expected type  (singleton?)
  singleton_graph_TCC1: OBLIGATION
    FORALL (v: T):
      (FORALL (e: doubleton[T]):
         emptyset[doubleton[T]](e) IMPLIES
          (FORALL (x: T): e(x) IMPLIES singleton[T](v)(x)))
       AND
       singleton?((# vert := singleton[T](v),
                     edges := emptyset[doubleton[T]] #));


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 60 3 61 80
body:
     verts_in?_caret : LEMMA FORALL (j: below(length(ps))): i <= j IMPLIES
                                     verts_in?(G,ps) IMPLIES verts_in?(G,ps^(i,j))


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 66 3 67 63
body:
     verts_of_subset : LEMMA FORALL (w: Seq(G)):
                                     subset?(verts_of(w),vert(G))


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 75 3 77 59
body:
     walk_from_vert  : LEMMA FORALL (w: prewalk,v1,v2:T):
                               walk_from?(G,w,v1,v2) IMPLIES
                                  vert(G)(v1) AND vert(G)(v2)


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 79 3 82 45
body:
     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)


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 106 3 107 53
body:
     edge_to_walk    : LEMMA u /= v AND edges(G)(edg[T](u, v)) IMPLIES
                               walk?(G,gen_seq2(G,u,v))


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 115 3 116 73
body:
     walk?_reverse   : LEMMA walk_from?(G,w1,v1,v2) IMPLIES
                               (EXISTS (w: Walk(G)): walk_from?(G,w,v2,v1))


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 118 3 119 56
body:
     walk?_caret     : LEMMA i <= j AND j < length(ps) AND walk?(G,ps) 
                                 IMPLIES walk?(G,ps^(i,j))


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 126 3 128 54
body:
     walk?_add1      : LEMMA walk?(G,ww) AND vert(G)(x)
                             AND edge?(G)(seq(ww)(length(ww)-1),x)
                             IMPLIES walk?(G,add1(ww,x))                      


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 131 3 135 51
body:
     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)


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 137 3 141 68
body:
     walk_concat: LEMMA length(w1) > 1 AND
                        walk_from?(G, w1, u1, v) AND
                        walk_from?(G, w2, u2, v)
                   IMPLIES
                       walk_from?(G, w1 ^ (0, length(w1) - 2) o rev(w2),u1,u2)


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 143 3 147 85
body:
     walk?_cut  : LEMMA FORALL (i,j: below(length(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,length(ps)-1),u,v)


decl_type: formula
theory: walks
library: graphs
signature: nil
location: 151 3 154 68
body:
     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))


decl_type: function
theory: walks
library: graphs
signature: [[graph[T], prewalk] -> bool]
location: 28 3 30 65
body:
     walk?(G,ps): bool = verts_in?(G,ps) AND
                               (FORALL n: n < length(ps) - 1 IMPLIES
                                           edge?(G)(ps(n),ps(n+1)))


decl_type: function
theory: walks
library: graphs
signature: [non_null -> prewalk]
location: 34 3 36 64
body:
     list2prewalk(L: non_null): prewalk =
            (# length := length(L),
               seq := (LAMBDA (x: below[length(L)]): nth(L, x)) #)


decl_type: function
theory: walks
library: graphs
signature: [[graph[T], prewalk, T, T] -> bool]
location: 40 3 41 73
body:
     walk_from?(G,ps,u,v): bool =
                    seq(ps)(0) = u AND seq(ps)(length(ps) - 1) = v AND walk?(G,ps)


decl_type: function
theory: walks
library: graphs
signature: [prewalk -> finite_set[T]]
location: 46 3 47 66
body:
     verts_of(ww: prewalk): finite_set[T] = 
                 {t: T | (EXISTS (i: below(length(ww))): ww(i) = t)}


decl_type: function
theory: walks
library: graphs
signature: [prewalk -> finite_set[doubleton[T]]]
location: 49 3 50 83
body:
     edges_of(ww): finite_set[doubleton[T]] = {e: doubleton[T] |
                             EXISTS (i: below(length(ww)-1)): e = dbl(ww(i),ww(i+1))}


decl_type: function
theory: walks
library: graphs
signature: [[graph[T], prewalk] -> bool]
location: 53 3 54 70
body:
     pre_circuit?(G: graph[T], w: prewalk): bool = walk?(G,w) AND 
                                                   w(0) = w(length(w)-1)


decl_type: function
theory: walks
library: graphs
signature: [d: [G: graph[T], (vert(G))] -> Seq(d`1)]
location: 86 3 87 75
body:
     gen_seq1(G, (u: (vert(G)))): Seq(G) = 
                          (# length := 1, seq := (LAMBDA (i: below(1)): u) #)


decl_type: function
theory: walks
library: graphs
signature: [d: [G: graph[T], (vert(G)), (vert(G))] -> Seq(d`1)]
location: 89 3 92 70
body:
     gen_seq2(G, (u,v: (vert(G)))): Seq(G) = 
                    (# length := 2,
                       seq := (LAMBDA (i: below(2)):
                                        IF i = 0 THEN u ELSE v ENDIF) #)


decl_type: function
theory: walks
library: graphs
signature: [[prewalk, T] -> prewalk]
location: 98 3 101 27
body:
     add1(ww,x): prewalk = (# length := length(ww) + 1,
                             seq := (LAMBDA (ii: below(length(ww) + 1)):
                                      IF ii < length(ww) THEN seq(ww)(ii) ELSE x ENDIF)
                           #)


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 162 0 167 999
body:
  % Subtype TCC generated (at line 31, column 53) for  n
      % expected type  below[length(ps)]
  walk?_TCC1: OBLIGATION
    FORALL (G: graph[T], ps: prewalk):
      verts_in?(G, ps) IMPLIES
       (FORALL (n): n < length(ps) - 1 IMPLIES n < length(ps));


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 169 0 174 999
body:
  % Subtype TCC generated (at line 31, column 59) for  n + 1
      % expected type  below[length(ps)]
  walk?_TCC2: OBLIGATION
    FORALL (G: graph[T], ps: prewalk):
      verts_in?(G, ps) IMPLIES
       (FORALL (n): n < length(ps) - 1 IMPLIES n + 1 < length(ps));


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 176 0 180 999
body:
  % Subtype TCC generated (at line 36, column 10) for
      % (# length := length(L),
      %    seq := (LAMBDA (x: below[length(L)]): nth(L, x)) #)
      % expected type  prewalk
  list2prewalk_TCC1: OBLIGATION FORALL (L: non_null): length[T](L) > 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 182 0 184 999
body:
  % Subtype TCC generated (at line 39, column 33) for  0
      % expected type  below[ps`length]
  from?_TCC1: OBLIGATION FORALL (ps: prewalk, u: T, v: T): 0 < ps`length;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 186 0 191 999
body:
  % Subtype TCC generated (at line 39, column 52) for  length(ps) - 1
      % expected type  below[ps`length]
  from?_TCC2: OBLIGATION
    FORALL (ps: prewalk, u: T, v: T):
      seq(ps)(0) = u IMPLIES
       length(ps) - 1 >= 0 AND length(ps) - 1 < ps`length;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 193 0 200 999
body:
  % Subtype TCC generated (at line 48, column 15) for
      % {t: T | (EXISTS (i: below(length(ww))): finseq_appl[T](ww)(i) = t)}
      % expected type  finite_set[T]
  verts_of_TCC1: OBLIGATION
    FORALL (ww: prewalk):
      is_finite[T]
          ({t: T |
              (EXISTS (i: below(length(ww))): finseq_appl[T](ww)(i) = t)});


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 202 0 206 999
body:
  % Subtype TCC generated (at line 51, column 71) for  i
      % expected type  below[length(ww)]
  edges_of_TCC1: OBLIGATION
    FORALL (ww: prewalk, e: doubleton[T], i: below(length(ww) - 1)):
      i < length(ww);


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 208 0 212 999
body:
  % Subtype TCC generated (at line 51, column 77) for  i + 1
      % expected type  below[length(ww)]
  edges_of_TCC2: OBLIGATION
    FORALL (ww: prewalk, e: doubleton[T], i: below(length(ww) - 1)):
      i + 1 < length(ww);


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 214 0 225 999
body:
  % Subtype TCC generated (at line 50, column 44) for
      % {e: doubleton[T] |
      %    EXISTS (i: below(length(ww) - 1)):
      %      e = dbl(finseq_appl[T](ww)(i), finseq_appl[T](ww)(i + 1))}
      % expected type  finite_set[doubleton[T]]
  edges_of_TCC3: OBLIGATION
    FORALL (ww: prewalk):
      is_finite[doubleton[T]]
          ({e: doubleton[T] |
              EXISTS (i: below(length(ww) - 1)):
                e =
                 dbl[T](finseq_appl[T](ww)(i), finseq_appl[T](ww)(i + 1))});


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 227 0 230 999
body:
  % Subtype TCC generated (at line 55, column 51) for  0
      % expected type  below[length(w)]
  pre_circuit?_TCC1: OBLIGATION
    FORALL (G: graph[T], w: prewalk): walk?(G, w) IMPLIES 0 < length(w);


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 232 0 236 999
body:
  % Subtype TCC generated (at line 55, column 58) for  length(w) - 1
      % expected type  below[length(w)]
  pre_circuit?_TCC2: OBLIGATION
    FORALL (G: graph[T], w: prewalk):
      walk?(G, w) IMPLIES length(w) - 1 >= 0 AND length(w) - 1 < length(w);


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 238 0 241 999
body:
  % Subtype TCC generated (at line 59, column 63) for  s1 o s2
      % expected type  prewalk
  verts_in?_concat_TCC1: OBLIGATION
    FORALL (G: graph[T], s1, s2: Seq(G)): length(o[T](s1, s2)) > 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 243 0 247 999
body:
  % Subtype TCC generated (at line 62, column 71) for  ps ^ (i, j)
      % expected type  prewalk
  verts_in?_caret_TCC1: OBLIGATION
    FORALL (G: graph[T], i: nat, ps: prewalk, j: below(length(ps))):
      verts_in?(G, ps) AND i <= j IMPLIES length(^[T](ps, (i, j))) > 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 249 0 255 999
body:
  % Subtype TCC generated (at line 88, column 24) for
      % (# length := 1, seq := (LAMBDA (i: below(1)): u) #)
      % expected type  Seq(G)
  gen_seq1_TCC1: OBLIGATION
    FORALL (G: graph[T], (u: (vert(G)))):
      1 > 0 AND
       verts_in?(G, (# length := 1, seq := LAMBDA (i: below(1)): u #));


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 257 0 268 999
body:
  % Subtype TCC generated (at line 91, column 18) for
      % (# length := 2,
      %    seq := (LAMBDA (i: below(2)): IF i = 0 THEN u ELSE v ENDIF) #)
      % expected type  Seq(G)
  gen_seq2_TCC1: OBLIGATION
    FORALL (G: graph[T], (u, v: (vert(G)))):
      2 > 0 AND
       verts_in?(G,
                 (# length := 2,
                    seq
                      := LAMBDA (i: below(2)):
                           IF i = 0 THEN u ELSE v ENDIF #));


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 270 0 272 999
body:
  % Subtype TCC generated (at line 97, column 43) for  length(p) - 2
      % expected type  nat
  trunc1_TCC1: OBLIGATION FORALL (p: Longprewalk): length(p) - 2 >= 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 274 0 277 999
body:
  % Subtype TCC generated (at line 97, column 38) for  p ^ (0, length(p) - 2)
      % expected type  prewalk
  trunc1_TCC2: OBLIGATION
    FORALL (p: Longprewalk): length(^[T](p, (0, length(p) - 2))) > 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 279 0 285 999
body:
  % Subtype TCC generated (at line 99, column 25) for
      % (# length := length(ww) + 1,
      %    seq
      %      := (LAMBDA (ii: below(length(ww) + 1)):
      %            IF ii < length(ww) THEN seq(ww)(ii) ELSE x ENDIF) #)
      % expected type  prewalk
  add1_TCC1: OBLIGATION FORALL (ww: prewalk, x: T): length(ww) + 1 > 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 287 0 289 999
body:
  % Subtype TCC generated (at line 107, column 57) for  v
      % expected type  {y: T | y /= u}
  edge_to_walk_TCC1: OBLIGATION FORALL (u, v: T): u /= v IMPLIES v /= u;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 291 0 295 999
body:
  % Subtype TCC generated (at line 108, column 48) for  u
      % expected type  (vert(G))
  edge_to_walk_TCC2: OBLIGATION
    FORALL (G: graph[T], u, v: T):
      edges(G)(edg[T](u, v)) AND u /= v IMPLIES vert(G)(u);


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 297 0 301 999
body:
  % Subtype TCC generated (at line 108, column 50) for  v
      % expected type  (vert(G))
  edge_to_walk_TCC3: OBLIGATION
    FORALL (G: graph[T], u, v: T):
      edges(G)(edg[T](u, v)) AND u /= v IMPLIES vert(G)(v);


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 303 0 307 999
body:
  % Subtype TCC generated (at line 111, column 55) for  rev(ps)
      % expected type  prewalk
  walk?_rev_TCC1: OBLIGATION
    FORALL (G: graph[T], ps: prewalk):
      walk?(G, ps) IMPLIES length(rev[T](ps)) > 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 309 0 314 999
body:
  % Subtype TCC generated (at line 120, column 47) for  ps ^ (i, j)
      % expected type  prewalk
  walk?_caret_TCC1: OBLIGATION
    FORALL (G: graph[T], i, j: nat, ps: prewalk):
      walk?(G, ps) AND j < length(ps) AND i <= j IMPLIES
       length(^[T](ps, (i, j))) > 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 316 0 319 999
body:
  % Subtype TCC generated (at line 124, column 64) for  ww
      % expected type  Longprewalk
  l_trunc1_TCC1: OBLIGATION
    FORALL (ww: prewalk): length(ww) > 1 IMPLIES length(ww) >= 2;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 321 0 327 999
body:
  % Subtype TCC generated (at line 136, column 37) for  w1 o w2
      % expected type  prewalk
  walk_concat_edge_TCC1: OBLIGATION
    FORALL (G: graph[T], u1, u2, v1, v2: T, w1, w2: prewalk):
      edge?(G)(v1, u2) AND
       walk_from?(G, w2, u2, v2) AND walk_from?(G, w1, u1, v1)
       IMPLIES length(o[T](w1, w2)) > 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 329 0 335 999
body:
  % Subtype TCC generated (at line 142, column 36) for  length(w1) - 2
      % expected type  nat
  walk_concat_TCC1: OBLIGATION
    FORALL (G: graph[T], u1, u2, v: T, w1, w2: prewalk):
      walk_from?(G, w2, u2, v) AND
       walk_from?(G, w1, u1, v) AND length(w1) > 1
       IMPLIES length(w1) - 2 >= 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 337 0 344 999
body:
  % Subtype TCC generated (at line 142, column 27) for
      % w1 ^ (0, length(w1) - 2) o rev(w2)
      % expected type  prewalk
  walk_concat_TCC2: OBLIGATION
    FORALL (G: graph[T], u1, u2, v: T, w1, w2: prewalk):
      walk_from?(G, w2, u2, v) AND
       walk_from?(G, w1, u1, v) AND length(w1) > 1
       IMPLIES length(o[T](^[T](w1, (0, length(w1) - 2)), rev[T](w2))) > 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 346 0 351 999
body:
  % Subtype TCC generated (at line 148, column 67) for  length(ps) - 1
      % expected type  nat
  walk?_cut_TCC1: OBLIGATION
    FORALL (G: graph[T], ps: prewalk, u, v: T, i, j: below(length(ps))):
      i < j AND seq(ps)(i) = seq(ps)(j) AND walk_from?(G, ps, u, v) IMPLIES
       length(ps) - 1 >= 0;


decl_type: tcc
theory: walks
library: graphs
signature: nil
location: 353 0 359 999
body:
  % Subtype TCC generated (at line 148, column 48) for
      % ps ^ (0, i) o ps ^ (j + 1, length(ps) - 1)
      % expected type  prewalk
  walk?_cut_TCC2: OBLIGATION
    FORALL (G: graph[T], ps: prewalk, u, v: T, i, j: below(length(ps))):
      i < j AND seq(ps)(i) = seq(ps)(j) AND walk_from?(G, ps, u, v) IMPLIES
       length(o[T](^[T](ps, (0, i)), ^[T](ps, (j + 1, length(ps) - 1)))) > 0;


decl_type: formula
theory: paths
library: graphs
signature: nil
location: 30 3 31 51
body:
     path_from_in    : LEMMA path_from?(G, ps, s, t) IMPLIES 
                            vert(G)(s) AND vert(G)(t)


decl_type: formula
theory: paths
library: graphs
signature: nil
location: 34 3 35 53
body:
     path?_caret     : LEMMA i <= j AND j < length(ps) AND path?(G,ps) 
                              IMPLIES path?(G,ps^(i,j))


decl_type: formula
theory: paths
library: graphs
signature: nil
location: 37 3 38 79
body:
     path_from?_caret: LEMMA  i <= j AND j < length(ps) AND path_from?(G, ps, s, t)
                           IMPLIES path_from?(G, ps^(i, j),seq(ps)(i),seq(ps)(j))


decl_type: formula
theory: paths
library: graphs
signature: nil
location: 43 3 44 74
body:
     path?_gen_seq2  : LEMMA vert(G)(x) AND vert(G)(y) AND
                              edge?(G)(x,y) IMPLIES path?(G,gen_seq2(G,x,y))


decl_type: formula
theory: paths
library: graphs
signature: nil
location: 46 3 49 54
body:
     path?_add1      : LEMMA path?(G,p) AND vert(G)(x)
                              AND edge?(G)(seq(p)(length(p)-1),x)
                              AND NOT verts_of(p)(x)
                              IMPLIES path?(G,add1(p,x))                      


decl_type: formula
theory: paths
library: graphs
signature: nil
location: 51 3 52 81
body:
     path?_trunc1      : LEMMA path?(G,p) AND length(p) > 1 IMPLIES
                              path_from?(G,trunc1(p),seq(p)(0),seq(p)(length(p)-2)) 


decl_type: function
theory: paths
library: graphs
signature: [[graph[T], prewalk[T]] -> bool]
location: 12 3 13 72
body:
     path?(G,ps): bool = walk?(G,ps) AND (FORALL (i,j: below(length(ps))):
                                            i /= j IMPLIES ps(i) /= ps(j))


decl_type: tcc
theory: paths
library: graphs
signature: nil
location: 62 0 67 999
body:
  % Subtype TCC generated (at line 35, column 44) for  ps ^ (i, j)
      % expected type  prewalk[T]
  path?_caret_TCC1: OBLIGATION
    FORALL (G: graph[T], i, j: nat, ps: prewalk[T]):
      path?(G, ps) AND j < length(ps) AND i <= j IMPLIES
       length(^[T](ps, (i, j))) > 0;


decl_type: tcc
theory: paths
library: graphs
signature: nil
location: 69 0 74 999
body:
  % Subtype TCC generated (at line 38, column 47) for  ps ^ (i, j)
      % expected type  prewalk[T]
  path_from?_caret_TCC1: OBLIGATION
    FORALL (G: graph[T], i, j: nat, ps: prewalk[T], s, t: T):
      path_from?(G, ps, s, t) AND j < length(ps) AND i <= j IMPLIES
       length(^[T](ps, (i, j))) > 0;


decl_type: tcc
theory: paths
library: graphs
signature: nil
location: 76 0 81 999
body:
  % Subtype TCC generated (at line 38, column 65) for  i
      % expected type  below[ps`length]
  path_from?_caret_TCC2: OBLIGATION
    FORALL (G: graph[T], i, j: nat, ps: prewalk[T], s, t: T):
      path_from?(G, ps, s, t) AND j < length(ps) AND i <= j IMPLIES
       i < ps`length;


decl_type: tcc
theory: paths
library: graphs
signature: nil
location: 83 0 87 999
body:
  % Subtype TCC generated (at line 40, column 55) for  rev(ps)
      % expected type  prewalk[T]
  path?_rev_TCC1: OBLIGATION
    FORALL (G: graph[T], ps: prewalk[T]):
      path?(G, ps) IMPLIES length(rev[T](ps)) > 0;


decl_type: tcc
theory: paths
library: graphs
signature: nil
location: 89 0 94 999
body:
  % Subtype TCC generated (at line 47, column 48) for  length(p) - 1
      % expected type  below[p`length]
  path?_add1_TCC1: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], x: T):
      path?(G, p) AND vert(G)(x) IMPLIES
       length(p) - 1 >= 0 AND length(p) - 1 < p`length;


decl_type: tcc
theory: paths
library: graphs
signature: nil
location: 96 0 100 999
body:
  % Subtype TCC generated (at line 52, column 48) for  p
      % expected type  Longprewalk[T]
  path?_trunc1_TCC1: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T]):
      length(p) > 1 AND path?(G, p) IMPLIES length(p) >= 2;


decl_type: tcc
theory: paths
library: graphs
signature: nil
location: 102 0 106 999
body:
  % Subtype TCC generated (at line 52, column 58) for  0
      % expected type  below[p`length]
  path?_trunc1_TCC2: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T]):
      length(p) > 1 AND path?(G, p) IMPLIES 0 < p`length;


decl_type: tcc
theory: paths
library: graphs
signature: nil
location: 108 0 113 999
body:
  % Subtype TCC generated (at line 52, column 68) for  length(p) - 2
      % expected type  below[p`length]
  path?_trunc1_TCC3: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T]):
      length(p) > 1 AND path?(G, p) IMPLIES
       length(p) - 2 >= 0 AND length(p) - 2 < p`length;


decl_type: formula
theory: path_lems
library: graphs
signature: nil
location: 12 3 13 74
body:
     Pigeon_hole: THEOREM FORALL (w: Walk(GF)): length(w) > card(vert(GF)) IMPLIES 
                    (EXISTS (i,j: below(length(w))): i /= j AND w(i) = w(j))


decl_type: formula
theory: subgraphs
library: graphs
signature: nil
location: 27 3 28 63
body:
     subgraph_vert_sub: LEMMA subset?(V,vert(G)) IMPLIES
                                          vert(subgraph(G,V)) = V


decl_type: formula
theory: subgraphs
library: graphs
signature: nil
location: 32 3 33 44
body:
     subgraph_smaller: LEMMA subgraph?(SS, G) IMPLIES
                               size(SS) <= size(G)


decl_type: function
theory: subgraphs
library: graphs
signature: [[graph[T], graph[T]] -> bool]
location: 12 3 13 56
body:
     subgraph?(G1,G2): bool = subset?(vert(G1),vert(G2)) AND
                              subset?(edges(G1),edges(G2))


decl_type: function
theory: subgraphs
library: graphs
signature: [d: [graph[T], set[T]] -> Subgraph(d`1)]
location: 22 3 25 67
body:
     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))}])


decl_type: tcc
theory: subgraphs
library: graphs
signature: nil
location: 40 0 46 999
body:
  % Subtype TCC generated (at line 24, column 25) for
      % {e | edges(G)(e) AND (FORALL (x: T): e(x) IMPLIES V(x))}
      % expected type  finite_set[doubleton[T]]
  subgraph_TCC1: OBLIGATION
    FORALL (G: graph[T], V: set[T]):
      is_finite[doubleton[T]]
          ({e | edges(G)(e) AND (FORALL (x: T): e(x) IMPLIES V(x))});


decl_type: tcc
theory: subgraphs
library: graphs
signature: nil
location: 48 0 52 999
body:
  % Subtype TCC generated (at line 23, column 25) for
      % {i | vert(G)(i) AND V(i)}
      % expected type  finite_set[T]
  subgraph_TCC2: OBLIGATION
    FORALL (G: graph[T], V: set[T]): is_finite[T]({i | vert(G)(i) AND V(i)});


decl_type: tcc
theory: subgraphs
library: graphs
signature: nil
location: 54 0 73 999
body:
  % Subtype TCC generated (at line 23, column 8) for
      % (G
      %    WITH [vert := {i | vert(G)(i) AND V(i)},
      %          edges
      %            := {e |
      %                  edges(G)(e) AND (FORALL (x: T): e(x) IMPLIES V(x))}])
      % expected type  Subgraph(G)
  subgraph_TCC3: OBLIGATION
    FORALL (G: graph[T], V: set[T]):
      (FORALL (e_1: doubleton[T]):
         (edges(G)(e_1) AND (FORALL (x: T): e_1(x) IMPLIES V(x))) IMPLIES
          (FORALL (x_1: T): e_1(x_1) IMPLIES vert(G)(x_1) AND V(x_1)))
       AND
       subgraph?((G
                    WITH [vert := {i | vert(G)(i) AND V(i)},
                          edges
                            := {e |
                                  edges(G)(e) AND
                                   (FORALL (x: T): e(x) IMPLIES V(x))}]),
                 G);


decl_type: formula
theory: graph_ops
library: graphs
signature: nil
location: 45 3 46 75
body:
     del_vert_still_in   : LEMMA FORALL (x: (vert(G))):
                                       x /= v IMPLIES vert(del_vert(G, v))(x)


decl_type: formula
theory: graph_ops
library: graphs
signature: nil
location: 48 3 49 68
body:
     size_del_vert       : LEMMA FORALL (v: (vert(G))):
                                     size(del_vert(G,v)) = size(G) - 1


decl_type: formula
theory: graph_ops
library: graphs
signature: nil
location: 55 3 56 56
body:
     edge_in_del_vert    : LEMMA (edges(G)(e) AND NOT e(v)) IMPLIES
                                   edges(del_vert(G,v))(e)


decl_type: formula
theory: graph_ops
library: graphs
signature: nil
location: 58 3 59 50
body:
     edges_del_vert      : LEMMA edges(del_vert(G,v))(e) IMPLIES
                                         edges(G)(e)


decl_type: formula
theory: graph_ops
library: graphs
signature: nil
location: 61 3 62 63
body:
     del_vert_comm       : LEMMA del_vert(del_vert(G, x), v) =
                                      del_vert(del_vert(G, v), x)


decl_type: formula
theory: graph_ops
library: graphs
signature: nil
location: 64 3 66 51
body:
     del_vert_empty?     : LEMMA FORALL (v: (vert(G))): 
                                    empty?(vert(del_vert(G, v))) IMPLIES
                                        singleton?(G)


decl_type: formula
theory: graph_ops
library: graphs
signature: nil
location: 74 3 75 46
body:
     del_edge_lem2      : LEMMA edges(del_edge(G,e))(e2)
                                      IMPLIES edges(G)(e2)


decl_type: formula
theory: graph_ops
library: graphs
signature: nil
location: 77 3 78 50
body:
     del_edge_lem3      : LEMMA edges(G)(e2) AND e2 /= e IMPLIES
                                      edges(del_edge(G,e))(e2) 


decl_type: formula
theory: graph_ops
library: graphs
signature: nil
location: 84 3 85 75
body:
     del_edge_num       : LEMMA num_edges(del_edge(G,e)) = num_edges(G) 
                                         - IF edges(G)(e) THEN 1 ELSE 0 ENDIF


decl_type: formula
theory: graph_ops
library: graphs
signature: nil
location: 90 3 91 58
body:
     del_vert_edge_comm : LEMMA del_vert(del_edge(G, e), v) = 
                                 del_edge(del_vert(G, v), e)


decl_type: formula
theory: graph_ops
library: graphs
signature: nil
location: 93 3 94 72
body:
     del_vert_edge      : LEMMA e(v) IMPLIES
                                 del_vert(del_edge(G,e),v) = del_vert(G,v)


decl_type: function
theory: graph_ops
library: graphs
signature: [[graph[T], graph[T]] -> graph[T]]
location: 30 3 31 69
body:
     union(G1,G2): graph[T] = (# vert := union(vert(G1),vert(G2)),
                                 edges := union(edges(G1),edges(G2)) #)


decl_type: function
theory: graph_ops
library: graphs
signature: [[graph[T], T] -> graph[T]]
location: 33 3 35 69
body:
     del_vert(G: graph[T], v: T): graph[T] = 
                          (# vert := remove[T](v,vert(G)),
                             edges := {e | edges(G)(e) AND NOT e(v)} #)


decl_type: tcc
theory: graph_ops
library: graphs
signature: nil
location: 103 0 111 999
body:
  % Subtype TCC generated (at line 30, column 28) for
      % (# vert := union(vert(G1), vert(G2)),
      %    edges := union(edges(G1), edges(G2)) #)
      % expected type  graph[T]
  union_TCC1: OBLIGATION
    FORALL (G1: graph[T], G2: graph[T]):
      FORALL (e: doubleton[T]):
        union[doubleton[T]](edges(G1), edges(G2))(e) IMPLIES
         (FORALL (x: T): e(x) IMPLIES union[T](vert(G1), vert(G2))(x));


decl_type: tcc
theory: graph_ops
library: graphs
signature: nil
location: 113 0 118 999
body:
  % Subtype TCC generated (at line 35, column 36) for
      % {e | edges(G)(e) AND NOT e(v)}
      % expected type  finite_set[doubleton[T]]
  del_vert_TCC1: OBLIGATION
    FORALL (G: graph[T], v: T):
      is_finite[doubleton[T]]({e | edges(G)(e) AND NOT e(v)});


decl_type: tcc
theory: graph_ops
library: graphs
signature: nil
location: 120 0 128 999
body:
  % Subtype TCC generated (at line 34, column 24) for
      % (# vert := remove[T](v, vert(G)),
      %    edges := {e | edges(G)(e) AND NOT e(v)} #)
      % expected type  graph[T]
  del_vert_TCC2: OBLIGATION
    FORALL (G: graph[T], v: T):
      FORALL (e_1: doubleton[T]):
        edges(G)(e_1) AND NOT e_1(v) IMPLIES
         (FORALL (x: T): e_1(x) IMPLIES remove[T](v, vert(G))(x));


decl_type: tcc
theory: graph_ops
library: graphs
signature: nil
location: 130 0 137 999
body:
  % Subtype TCC generated (at line 37, column 29) for
      % G WITH [edges := remove(e, edges(G))]
      % expected type  graph[T]
  del_edge_TCC1: OBLIGATION
    FORALL (G: graph[T], e: doubleton[T]):
      FORALL (e_1: doubleton[T]):
        remove[doubleton[T]](e, edges(G))(e_1) IMPLIES
         (FORALL (x_1: T): e_1(x_1) IMPLIES G`vert(x_1));


decl_type: tcc
theory: graph_ops
library: graphs
signature: nil
location: 139 0 144 999
body:
  % Subtype TCC generated (at line 41, column 39) for
      % {y: T | vert(G)(y) AND edge?(G)(x, y)}
      % expected type  finite_set[T]
  adjacent_TCC1: OBLIGATION
    FORALL (G: graph[T], (x: T)):
      is_finite[T]({y: T | vert(G)(y) AND edge?[T](G)(x, y)});


decl_type: formula
theory: graph_deg
library: graphs
signature: nil
location: 36 3 37 80
body:
     incident_edges_emptyset: LEMMA edges(G) = emptyset[doubleton[T]] IMPLIES
                                      incident_edges(v,G) = emptyset[doubleton[T]]


decl_type: formula
theory: graph_deg
library: graphs
signature: nil
location: 40 3 41 67
body:
     deg_del_edge    : LEMMA e = dbl(x,y) AND edges(G)(e) IMPLIES  
                               deg(y, G) = deg(y, del_edge(G, e)) + 1


decl_type: formula
theory: graph_deg
library: graphs
signature: nil
location: 43 3 44 67
body:
     deg_del_edge2   : LEMMA e(y) AND edges(G)(e) IMPLIES  
                               deg(y, G) = deg(y, del_edge(G, e)) + 1


decl_type: formula
theory: graph_deg
library: graphs
signature: nil
location: 47 3 48 64
body:
     deg_del_edge3   : LEMMA NOT e(y)  IMPLIES  
                                deg(y, G) = deg(y, del_edge(G, e))


decl_type: formula
theory: graph_deg
library: graphs
signature: nil
location: 55 3 56 61
body:
     deg_edge_exists       : LEMMA deg(v,G) > 0 IMPLIES
                               (EXISTS e: e(v) AND edges(G)(e))


decl_type: formula
theory: graph_deg
library: graphs
signature: nil
location: 60 3 61 62
body:
     del_vert_deg_0  : LEMMA deg(v,G) = 0 IMPLIES 
                                 edges(del_vert(G,v)) = edges(G)


decl_type: formula
theory: graph_deg
library: graphs
signature: nil
location: 63 3 65 56
body:
     deg_del_vert: LEMMA x /= v AND edges(G)(dbl[T](x, v))  
                                  IMPLIES deg(v, del_vert(G, x)) = 
                                             deg(v, G) - 1


decl_type: formula
theory: graph_deg
library: graphs
signature: nil
location: 67 3 68 73
body:
     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)


decl_type: formula
theory: graph_deg
library: graphs
signature: nil
location: 72 3 74 59
body:
     deg_1_sing   : LEMMA deg(v, G) = 1 IMPLIES 
                             (EXISTS e: incident_edges(v, G) = singleton(e) AND
                                        e(v) AND edges(G)(e))


decl_type: function
theory: graph_deg
library: graphs
signature: [[T, graph[T]] -> finite_set[doubleton[T]]]
location: 24 3 25 72
body:
     incident_edges(v,G)  : finite_set[doubleton[T]] 
                                = {e: doubleton[T] | edges(G)(e) AND e(v)}


decl_type: tcc
theory: graph_deg
library: graphs
signature: nil
location: 86 0 91 999
body:
  % Subtype TCC generated (at line 25, column 32) for
      % {e: doubleton[T] | edges(G)(e) AND e(v)}
      % expected type  finite_set[doubleton[T]]
  incident_edges_TCC1: OBLIGATION
    FORALL (v: T, G: graph[T]):
      is_finite[doubleton[T]]({e: doubleton[T] | edges(G)(e) AND e(v)});


decl_type: tcc
theory: graph_deg
library: graphs
signature: nil
location: 93 0 98 999
body:
  % Subtype TCC generated (at line 63, column 43) for  dbl[T](x, v)
      % expected type  doubleton[T]
  deg_del_vert_TCC1: OBLIGATION
    FORALL (v, x: T):
      x /= v IMPLIES
       (EXISTS (x_1: T), (y: T): x_1 /= y AND dbl[T](x, v) = dbl[T](x_1, y));


decl_type: formula
theory: graph_deg_sum
library: graphs
signature: nil
location: 18 3 19 66
body:
     deg_lem0: LEMMA num_edges(G) = 0 IMPLIES 
                        sum(vert(G), (LAMBDA (v: T): deg(v, G))) = 0


decl_type: formula
theory: graph_deg_sum
library: graphs
signature: nil
location: 21 3 25 75
body:
     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))))


decl_type: formula
theory: graph_deg_sum
library: graphs
signature: nil
location: 31 3 32 43
body:
     deg_thm: THEOREM sum(vert(G), (LAMBDA (v: T): deg(v,G))) =
                             2 * num_edges(G)          


decl_type: formula
theory: graph_deg_sum
library: graphs
signature: nil
location: 37 3 38 52
body:
     subgraph_deg : THEOREM subgraph?(GS,G) AND vert(G)(v) IMPLIES 
                                 deg(v,GS) <= deg(v,G)


decl_type: formula
theory: graph_deg_sum
library: graphs
signature: nil
location: 41 3 42 58
body:
     sum_gt_bound : THEOREM (FORALL (t: (S)): f(t) >= B) 
                               IMPLIES sum(S,f) >= B*card(S)


decl_type: formula
theory: graph_deg_sum
library: graphs
signature: nil
location: 44 3 45 66
body:
     deg_gt_one   : THEOREM (FORALL (v:(vert(G))): deg(v,G) > 1) 
                                       IMPLIES num_edges(G)>=size(G)


decl_type: tcc
theory: graph_deg_sum
library: graphs
signature: nil
location: 55 0 62 999
body:
  % Subtype TCC generated (at line 24, column 26) for  V_reduced
      % expected type  finite_set[T]
  deg_lem2_TCC1: OBLIGATION
    FORALL (G: graph[T], V_reduced: set[T], e: doubleton[T], x, y: T):
      choose(edges(G)) = e AND
       nonempty?(edges(G)) AND
        e = dbl[T](x, y) AND remove(x, remove(y, vert(G))) = V_reduced
       IMPLIES is_finite[T](V_reduced);


decl_type: formula
theory: subgraph_paths
library: graphs
signature: nil
location: 13 3 14 50
body:
     walk?_subgraph  : LEMMA subgraph?(HH,G) AND walk?(HH, p)
                                 IMPLIES walk?(G, p)


decl_type: formula
theory: subgraph_paths
library: graphs
signature: nil
location: 16 3 17 53
body:
     path?_subgraph  : LEMMA subgraph?(HH,G) AND path?(HH, p)
                                    IMPLIES path?(G, p)


decl_type: function
theory: abstract_min
library: graphs
signature: [T -> bool]
location: 49 3 50 74
body:
     minimal?(S): bool = P(S) AND 
                         (FORALL (SS: T): P(SS) IMPLIES size(S) <= size(SS))


decl_type: formula
theory: cycles
library: graphs
signature: nil
location: 20 3 21 76
body:
     cycle_has_path: LEMMA FORALL (w: Seq(G)): cycle?(G,w) IMPLIES
                              (EXISTS (j: below(length(w))): path?(G,w^(0,j)))


decl_type: formula
theory: cycles
library: graphs
signature: nil
location: 29 3 33 78
body:
     cycle_def: LEMMA FORALL (w: Seq(G)): cycle?(G,w) IFF
                            pre_circuit?(G,w) AND length(w) > 3 AND 
                            (FORALL (i,j: below(length(w))):
                               w(i) = w(j) IMPLIES (i = j OR 
                                           (endpoint?(i,w) AND endpoint?(j,w))))


decl_type: function
theory: cycles
library: graphs
signature: [[G: graph[T], Seq[T](G)] -> bool]
location: 10 3 14 78
body:
     cycle?(G: graph[T], (w: Seq(G))): bool = pre_circuit?(G,w) AND length(w) > 1 AND 
                            w(1) /= w(length(w)-2) AND
                            (FORALL (i,j: below(length(w))):
                               w(i) = w(j) IMPLIES (i = j OR 
                                           (endpoint?(i,w) AND endpoint?(j,w)))) 


decl_type: tcc
theory: cycles
library: graphs
signature: nil
location: 43 0 47 999
body:
  % Subtype TCC generated (at line 11, column 28) for  1
      % expected type  below[length(w)]
  cycle?_TCC1: OBLIGATION
    FORALL (G: graph[T], (w: Seq[T](G))):
      length(w) > 1 AND pre_circuit?(G, w) IMPLIES 1 < length(w);


decl_type: tcc
theory: cycles
library: graphs
signature: nil
location: 49 0 54 999
body:
  % Subtype TCC generated (at line 11, column 36) for  length(w) - 2
      % expected type  below[length(w)]
  cycle?_TCC2: OBLIGATION
    FORALL (G: graph[T], (w: Seq[T](G))):
      length(w) > 1 AND pre_circuit?(G, w) IMPLIES
       length(w) - 2 >= 0 AND length(w) - 2 < length(w);


decl_type: tcc
theory: cycles
library: graphs
signature: nil
location: 56 0 61 999
body:
  % Subtype TCC generated (at line 21, column 67) for  w ^ (0, j)
      % expected type  prewalk[T]
  cycle_has_path_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Seq[T](G)):
      cycle?(G, w) IMPLIES
       (FORALL (j: below(length(w))): length(^[T](w, (0, j))) > 0);


decl_type: function
theory: circuits
library: graphs
signature: [[G: graph[T], Seq[T](G)] -> bool]
location: 21 3 22 69
body:
     reducible?(G: graph[T], w: Seq(G)): bool  = 
            (EXISTS (k: posnat): k < length(w) - 1 AND w(k-1) = w(k+1))


decl_type: function
theory: circuits
library: graphs
signature: [[G: graph[T], Seq[T](G)] -> bool]
location: 32 3 33 49
body:
     cyclically_reduced?(G: graph[T], w: Seq(G)): bool = length(w) > 2 AND
           reduced?(G,w) AND w(1) /= w(length(w)-2)


decl_type: function
theory: circuits
library: graphs
signature: [[G: graph[T], Seq[T](G)] -> bool]
location: 35 3 37 62
body:
     circuit?(G:  graph[T], w: Seq(G)): bool = %% walk?(G,w) AND
                                               cyclically_reduced?(G,w) AND
                                               pre_circuit?(G,w) 


decl_type: tcc
theory: circuits
library: graphs
signature: nil
location: 46 0 50 999
body:
  % Subtype TCC generated (at line 22, column 55) for  k - 1
      % expected type  below[length(w)]
  reducible?_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Seq[T](G), k: posnat):
      k < length(w) - 1 IMPLIES k - 1 >= 0 AND k - 1 < length(w);


decl_type: tcc
theory: circuits
library: graphs
signature: nil
location: 52 0 56 999
body:
  % Subtype TCC generated (at line 22, column 64) for  k + 1
      % expected type  below[length(w)]
  reducible?_TCC2: OBLIGATION
    FORALL (G: graph[T], w: Seq[T](G), k: posnat):
      k < length(w) - 1 IMPLIES k + 1 < length(w);


decl_type: tcc
theory: circuits
library: graphs
signature: nil
location: 58 0 62 999
body:
  % Subtype TCC generated (at line 33, column 29) for  1
      % expected type  below[length(w)]
  cyclically_reduced?_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Seq[T](G)):
      reduced?(G, w) AND length(w) > 2 IMPLIES 1 < length(w);


decl_type: tcc
theory: circuits
library: graphs
signature: nil
location: 64 0 69 999
body:
  % Subtype TCC generated (at line 33, column 37) for  length(w) - 2
      % expected type  below[length(w)]
  cyclically_reduced?_TCC2: OBLIGATION
    FORALL (G: graph[T], w: Seq[T](G)):
      reduced?(G, w) AND length(w) > 2 IMPLIES
       length(w) - 2 >= 0 AND length(w) - 2 < length(w);


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 19 2 22 83
body:
    walks_concat_red : LEMMA walk?(G,u) AND walk?(G,w) AND
                             length(u) >=2 AND length(w) >=2 AND reduced?(G,u) AND 
                             reduced?(G,w) AND u(length(u)-1) = w(0) AND
                             u(length(u)-2) /= w(1) IMPLIES reduced?(G,trunc1(u) o w)


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 24 2 26 69
body:
    index_rev        : LEMMA length(q)>=2 IMPLIES length(rev(q)) = length(q) AND 
                                             rev(q)(0) = q(length(q)-1) AND
                                             rev(q)(1) = q(length(q)-2)


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 30 2 31 70
body:
    ind_rev_rev      : LEMMA length(q)>=2  IMPLIES rev(q)(length(q)-1) = q(0) AND 
                                              rev(q)(length(q)-2) = q(1)


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 33 2 34 61
body:
    second_in_cat    : LEMMA s /= t AND from?(p,s,t) AND from?(q,s,t) IMPLIES 
                                 p(1) = (trunc1(p) o rev(q))(1)


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 36 2 37 84
body:
    sec_from_last    : LEMMA s /= t AND from?(p,s,t) AND from?(q,s,t) IMPLIES 
                             q(1) = (trunc1(p) o rev(q))(length(trunc1(p) o rev(q))-2)


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 39 2 40 51
body:
    prewalk_same     : LEMMA s=t AND length(p)=1 AND length(q)=1 AND from?(p,s,t) AND 
                             from?(q,s,t) IMPLIES p=q 


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 43 2 44 98
body:
    compose_long     : LEMMA s /= t AND from?(p,s,t) AND from?(q,s,t) AND 
                             p(length(p)-2) /= q(length(q)-2) IMPLIES length(trunc1(p) o rev(q)) > 2 


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 46 2 48 68
body:
    red_compos       : LEMMA s /= t AND path_from?(G,p,s,t) AND 
                             path_from?(G,q,s,t) AND p(length(p)-2) /= q(length(q)-2) 
                                IMPLIES reduced?(G,trunc1(p) o rev(q))


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 50 2 53 79
body:
    cycl_red_compos  : LEMMA s /= t AND path_from?(G,p,s,t) AND 
                             path_from?(G,q,s,t) AND p(length(p)-2) /= q(length(q)-2) AND 
                             p(1) /= q(1) 
                                IMPLIES cyclically_reduced?(G,trunc1(p) o rev(q))


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 55 2 59 81
body:
    walkers          : LEMMA finseq_appl(p)(0)=finseq_appl(q)(0) AND 
                             finseq_appl(p)(length(p)-1)=finseq_appl(q)(length(q)-1)
                           IMPLIES 
                             from?(p,finseq_appl(p)(0),finseq_appl(p)(length(p)-1)) AND 
                             from?(q,finseq_appl(p)(0),finseq_appl(p)(length(p)-1))


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 65 2 66 80
body:
    front_back       : LEMMA from?(p,s,t) AND from?(q,s,t) 
                              IMPLIES p(0)=q(0) AND  p(length(p)-1)=q(length(q)-1)


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 70 2 71 52
body:
    plus_up          : LEMMA s /= t AND from?(p,s,t) AND from?(q,s,t)  IMPLIES 
                              (trunc1(p) = trunc1(q) IMPLIES  p=q)


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 74 2 76 71
body:
    two_walks        : LEMMA s /=t AND walk?(G,p) AND walk?(G,q) AND 
                             from?(p,s,t) AND from?(q,s,t) IMPLIES 
                                       pre_circuit?(G,trunc1(p) o rev(q))


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 78 2 86 28
body:
    back_short       : LEMMA s /= t AND path_from?(G,p,s,t) AND 
                             path_from?(G,q,s,t) 
                          IMPLIES 
                             ( p(length(p)-2)=q(length(q)-2) AND p /= q IMPLIES  
                               (EXISTS (pp,qq: prewalk) : pp /= qq AND 
                                   path_from?(G,pp,s,p(length(p)-2)) AND 
                                   path_from?(G,qq,s,p(length(p)-2)) AND 
                                   length(pp)= length(p)-1 AND length(qq)=length(q)-1)
                             )


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 90 2 97 25
body:
    front_short: LEMMA s /= t AND path_from?(G,p,s,t) AND path_from?(G,q,s,t)
                        IMPLIES 
                          ( p(1)=q(1) AND p /= q  IMPLIES  
                            (EXISTS (pp,qq: prewalk) :
                              pp /= qq AND path_from?(G,pp,t,p(1)) 
                              AND path_from?(G,qq,t,p(1))
                              AND length(pp)= length(p)-1 AND length(qq)=length(q)-1)
                          )


decl_type: formula
theory: path_circ
library: graphs
signature: nil
location: 99 2 101 87
body:
    add1_rev: LEMMA FORALL (w:Seq(G),x:(vert(G))): 
                     length(w)>1 AND x /= seq(w)(length(w)-1) 
                     IMPLIES add1(w,x)=trunc1(w) o rev(gen_seq2(G,x,seq(w)(length(w)-1)))


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 111 0 114 999
body:
  % Subtype TCC generated (at line 13, column 60) for  p
      % expected type  Seq[T](G)
  path_reduc_TCC1: OBLIGATION
    FORALL (G: graph[T], p: Path[T](G)): verts_in?[T](G, p);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 116 0 121 999
body:
  % Subtype TCC generated (at line 20, column 74) for  u
      % expected type  Seq[T](G)
  walks_concat_red_TCC1: OBLIGATION
    FORALL (G: graph[T], u, w: prewalk[T]):
      walk?(G, u) AND walk?(G, w) AND length(u) >= 2 AND length(w) >= 2
       IMPLIES verts_in?[T](G, u);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 123 0 129 999
body:
  % Subtype TCC generated (at line 21, column 38) for  w
      % expected type  Seq[T](G)
  walks_concat_red_TCC2: OBLIGATION
    FORALL (G: graph[T], u, w: prewalk[T]):
           walk?(G, u) AND walk?(G, w) AND length(u) >= 2 AND length(w) >= 2
       AND reduced?(G, u)
       IMPLIES verts_in?[T](G, w);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 131 0 137 999
body:
  % Subtype TCC generated (at line 21, column 47) for  length(u) - 1
      % expected type  below[length(u)]
  walks_concat_red_TCC3: OBLIGATION
    FORALL (G: graph[T], u, w: prewalk[T]):
           walk?(G, u) AND walk?(G, w) AND length(u) >= 2 AND length(w) >= 2
       AND reduced?(G, u) AND reduced?(G, w)
       IMPLIES length(u) - 1 >= 0 AND length(u) - 1 < length(u);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 139 0 145 999
body:
  % Subtype TCC generated (at line 21, column 64) for  0
      % expected type  below[length(w)]
  walks_concat_red_TCC4: OBLIGATION
    FORALL (G: graph[T], u, w: prewalk[T]):
           walk?(G, u) AND walk?(G, w) AND length(u) >= 2 AND length(w) >= 2
       AND reduced?(G, u) AND reduced?(G, w)
       IMPLIES 0 < length(w);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 147 0 154 999
body:
  % Subtype TCC generated (at line 22, column 29) for  length(u) - 2
      % expected type  below[length(u)]
  walks_concat_red_TCC5: OBLIGATION
    FORALL (G: graph[T], u, w: prewalk[T]):
           walk?(G, u) AND walk?(G, w) AND length(u) >= 2 AND length(w) >= 2
       AND reduced?(G, u) AND reduced?(G, w)
       AND finseq_appl[T](u)(length(u) - 1) = finseq_appl[T](w)(0)
       IMPLIES length(u) - 2 >= 0 AND length(u) - 2 < length(u);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 156 0 163 999
body:
  % Subtype TCC generated (at line 22, column 47) for  1
      % expected type  below[length(w)]
  walks_concat_red_TCC6: OBLIGATION
    FORALL (G: graph[T], u, w: prewalk[T]):
           walk?(G, u) AND walk?(G, w) AND length(u) >= 2 AND length(w) >= 2
       AND reduced?(G, u) AND reduced?(G, w)
       AND finseq_appl[T](u)(length(u) - 1) = finseq_appl[T](w)(0)
       IMPLIES 1 < length(w);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 165 0 175 999
body:
  % Subtype TCC generated (at line 22, column 69) for  trunc1(u) o w
      % expected type  Seq[T](G)
  walks_concat_red_TCC7: OBLIGATION
    FORALL (G: graph[T], u, w: prewalk[T]):
           finseq_appl[T](u)(length(u) - 2) /= finseq_appl[T](w)(1)
       AND finseq_appl[T](u)(length(u) - 1) = finseq_appl[T](w)(0)
       AND reduced?(G, w) AND reduced?(G, u) AND length(w) >= 2
       AND length(u) >= 2 AND walk?(G, w) AND walk?(G, u)
       IMPLIES
       length(o[T](trunc1[T](u), w)) > 0 AND
        verts_in?[T](G, o[T](trunc1[T](u), w));


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 177 0 182 999
body:
  % Subtype TCC generated (at line 25, column 50) for  0
      % expected type  below[length(rev(q))]
  index_rev_TCC1: OBLIGATION
    FORALL (q: prewalk[T]):
      length(q) >= 2 AND length(rev(q)) = length(q) IMPLIES
       0 < length(rev[T](q));


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 184 0 189 999
body:
  % Subtype TCC generated (at line 25, column 57) for  length(q) - 1
      % expected type  below[length(q)]
  index_rev_TCC2: OBLIGATION
    FORALL (q: prewalk[T]):
      length(q) >= 2 AND length(rev(q)) = length(q) IMPLIES
       length(q) - 1 >= 0 AND length(q) - 1 < length(q);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 191 0 198 999
body:
  % Subtype TCC generated (at line 26, column 50) for  1
      % expected type  below[length(rev(q))]
  index_rev_TCC3: OBLIGATION
    FORALL (q: prewalk[T]):
      length(q) >= 2 AND
       length(rev(q)) = length(q) AND
        finseq_appl(rev(q))(0) = finseq_appl[T](q)(length(q) - 1)
       IMPLIES 1 < length(rev[T](q));


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 200 0 207 999
body:
  % Subtype TCC generated (at line 26, column 57) for  length(q) - 2
      % expected type  below[length(q)]
  index_rev_TCC4: OBLIGATION
    FORALL (q: prewalk[T]):
      length(q) >= 2 AND
       length(rev(q)) = length(q) AND
        finseq_appl(rev(q))(0) = finseq_appl[T](q)(length(q) - 1)
       IMPLIES length(q) - 2 >= 0 AND length(q) - 2 < length(q);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 209 0 214 999
body:
  % Subtype TCC generated (at line 30, column 56) for  length(q) - 1
      % expected type  below[length(rev(q))]
  ind_rev_rev_TCC1: OBLIGATION
    FORALL (q: prewalk[T]):
      length(q) >= 2 IMPLIES
       length(q) - 1 >= 0 AND length(q) - 1 < length(rev[T](q));


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 216 0 219 999
body:
  % Subtype TCC generated (at line 30, column 73) for  0
      % expected type  below[length(q)]
  ind_rev_rev_TCC2: OBLIGATION
    FORALL (q: prewalk[T]): length(q) >= 2 IMPLIES 0 < length(q);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 221 0 227 999
body:
  % Subtype TCC generated (at line 31, column 51) for  length(q) - 2
      % expected type  below[length(rev(q))]
  ind_rev_rev_TCC3: OBLIGATION
    FORALL (q: prewalk[T]):
      length(q) >= 2 AND
       finseq_appl(rev(q))(length(q) - 1) = finseq_appl[T](q)(0)
       IMPLIES length(q) - 2 >= 0 AND length(q) - 2 < length(rev[T](q));


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 229 0 235 999
body:
  % Subtype TCC generated (at line 31, column 68) for  1
      % expected type  below[length(q)]
  ind_rev_rev_TCC4: OBLIGATION
    FORALL (q: prewalk[T]):
      length(q) >= 2 AND
       finseq_appl(rev(q))(length(q) - 1) = finseq_appl[T](q)(0)
       IMPLIES 1 < length(q);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 237 0 241 999
body:
  % Subtype TCC generated (at line 34, column 33) for  1
      % expected type  below[length(p)]
  second_in_cat_TCC1: OBLIGATION
    FORALL (p, q: prewalk[T], s, t: T):
      from?(q, s, t) AND from?(p, s, t) AND s /= t IMPLIES 1 < length(p);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 243 0 248 999
body:
  % Subtype TCC generated (at line 34, column 59) for  1
      % expected type  below[length((trunc1(p) o rev(q)))]
  second_in_cat_TCC2: OBLIGATION
    FORALL (p, q: prewalk[T], s, t: T):
      from?(q, s, t) AND from?(p, s, t) AND s /= t IMPLIES
       1 < length((o[T](trunc1[T](p), rev[T](q))));


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 250 0 254 999
body:
  % Subtype TCC generated (at line 34, column 46) for  p
      % expected type  Longprewalk[T]
  second_in_cat_TCC3: OBLIGATION
    FORALL (p, q: prewalk[T], s, t: T):
      from?(q, s, t) AND from?(p, s, t) AND s /= t IMPLIES length(p) >= 2;


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 256 0 260 999
body:
  % Subtype TCC generated (at line 37, column 29) for  1
      % expected type  below[length(q)]
  sec_from_last_TCC1: OBLIGATION
    FORALL (p, q: prewalk[T], s, t: T):
      from?(q, s, t) AND from?(p, s, t) AND s /= t IMPLIES 1 < length(q);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 262 0 270 999
body:
  % Subtype TCC generated (at line 37, column 55) for
      % length(trunc1(p) o rev(q)) - 2
      % expected type  below[length((trunc1(p) o rev(q)))]
  sec_from_last_TCC2: OBLIGATION
    FORALL (p, q: prewalk[T], s, t: T):
      from?(q, s, t) AND from?(p, s, t) AND s /= t IMPLIES
       length(o[T](trunc1[T](p), rev[T](q))) - 2 >= 0 AND
        length(o[T](trunc1[T](p), rev[T](q))) - 2 <
         length((o[T](trunc1[T](p), rev[T](q))));


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 272 0 277 999
body:
  % Subtype TCC generated (at line 44, column 29) for  length(p) - 2
      % expected type  below[length(p)]
  compose_long_TCC1: OBLIGATION
    FORALL (p, q: prewalk[T], s, t: T):
      s /= t AND from?(p, s, t) AND from?(q, s, t) IMPLIES
       length(p) - 2 >= 0 AND length(p) - 2 < length(p);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 279 0 284 999
body:
  % Subtype TCC generated (at line 44, column 47) for  length(q) - 2
      % expected type  below[length(q)]
  compose_long_TCC2: OBLIGATION
    FORALL (p, q: prewalk[T], s, t: T):
      s /= t AND from?(p, s, t) AND from?(q, s, t) IMPLIES
       length(q) - 2 >= 0 AND length(q) - 2 < length(q);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 286 0 291 999
body:
  % Subtype TCC generated (at line 47, column 53) for  length(p) - 2
      % expected type  below[length(p)]
  red_compos_TCC1: OBLIGATION
    FORALL (G: graph[T], p, q: prewalk[T], s, t: T):
      s /= t AND path_from?(G, p, s, t) AND path_from?(G, q, s, t) IMPLIES
       length(p) - 2 >= 0 AND length(p) - 2 < length(p);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 293 0 298 999
body:
  % Subtype TCC generated (at line 47, column 71) for  length(q) - 2
      % expected type  below[length(q)]
  red_compos_TCC2: OBLIGATION
    FORALL (G: graph[T], p, q: prewalk[T], s, t: T):
      s /= t AND path_from?(G, p, s, t) AND path_from?(G, q, s, t) IMPLIES
       length(q) - 2 >= 0 AND length(q) - 2 < length(q);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 300 0 306 999
body:
  % Subtype TCC generated (at line 48, column 56) for  p
      % expected type  Longprewalk[T]
  red_compos_TCC3: OBLIGATION
    FORALL (G: graph[T], p, q: prewalk[T], s, t: T):
      finseq_appl[T](p)(length(p) - 2) /= finseq_appl[T](q)(length(q) - 2)
       AND path_from?(G, q, s, t) AND path_from?(G, p, s, t) AND s /= t
       IMPLIES length(p) >= 2;


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 308 0 316 999
body:
  % Subtype TCC generated (at line 48, column 49) for  trunc1(p) o rev(q)
      % expected type  Seq[T](G)
  red_compos_TCC4: OBLIGATION
    FORALL (G: graph[T], p, q: prewalk[T], s, t: T):
      finseq_appl[T](p)(length(p) - 2) /= finseq_appl[T](q)(length(q) - 2)
       AND path_from?(G, q, s, t) AND path_from?(G, p, s, t) AND s /= t
       IMPLIES
       length(o[T](trunc1[T](p), rev[T](q))) > 0 AND
        verts_in?[T](G, o[T](trunc1[T](p), rev[T](q)));


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 318 0 326 999
body:
  % Subtype TCC generated (at line 52, column 29) for  1
      % expected type  below[length(p)]
  cycl_red_compos_TCC1: OBLIGATION
    FORALL (G: graph[T], p, q: prewalk[T], s, t: T):
      s /= t AND
       path_from?(G, p, s, t) AND
        path_from?(G, q, s, t) AND
         finseq_appl[T](p)(length(p) - 2) /= finseq_appl[T](q)(length(q) - 2)
       IMPLIES 1 < length(p);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 328 0 336 999
body:
  % Subtype TCC generated (at line 52, column 37) for  1
      % expected type  below[length(q)]
  cycl_red_compos_TCC2: OBLIGATION
    FORALL (G: graph[T], p, q: prewalk[T], s, t: T):
      s /= t AND
       path_from?(G, p, s, t) AND
        path_from?(G, q, s, t) AND
         finseq_appl[T](p)(length(p) - 2) /= finseq_appl[T](q)(length(q) - 2)
       IMPLIES 1 < length(q);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 338 0 340 999
body:
  % Subtype TCC generated (at line 55, column 42) for  0
      % expected type  below[length(p)]
  walkers_TCC1: OBLIGATION FORALL (p: prewalk[T]): 0 < length(p);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 342 0 347 999
body:
  % Subtype TCC generated (at line 56, column 42) for  length(p) - 1
      % expected type  below[length(p)]
  walkers_TCC2: OBLIGATION
    FORALL (p, q: prewalk[T]):
      finseq_appl(p)(0) = finseq_appl(q)(0) IMPLIES
       length(p) - 1 >= 0 AND length(p) - 1 < length(p);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 349 0 354 999
body:
  % Subtype TCC generated (at line 56, column 70) for  length(q) - 1
      % expected type  below[length(q)]
  walkers_TCC3: OBLIGATION
    FORALL (p, q: prewalk[T]):
      finseq_appl(p)(0) = finseq_appl(q)(0) IMPLIES
       length(q) - 1 >= 0 AND length(q) - 1 < length(q);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 356 0 361 999
body:
  % Subtype TCC generated (at line 61, column 89) for  p
      % expected type  Seq[T](G)
  path_one_TCC1: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t: T):
      path_from?(G, p, s, t) AND s = t AND NOT length(p) = 1 IMPLIES
       verts_in?[T](G, p);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 363 0 367 999
body:
  % Subtype TCC generated (at line 66, column 43) for  0
      % expected type  below[length(q)]
  front_back_TCC1: OBLIGATION
    FORALL (p, q: prewalk[T], s, t: T):
      from?(q, s, t) AND from?(p, s, t) IMPLIES 0 < length(q);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 369 0 373 999
body:
  % Subtype TCC generated (at line 71, column 36) for  q
      % expected type  Longprewalk[T]
  plus_up_TCC1: OBLIGATION
    FORALL (p, q: prewalk[T], s, t: T):
      from?(q, s, t) AND from?(p, s, t) AND s /= t IMPLIES length(q) >= 2;


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 375 0 381 999
body:
  % Subtype TCC generated (at line 76, column 52) for  trunc1(p) o rev(q)
      % expected type  prewalk[T]
  two_walks_TCC1: OBLIGATION
    FORALL (G: graph[T], p, q: prewalk[T], s, t: T):
           from?(q, s, t) AND from?(p, s, t) AND walk?(G, q) AND walk?(G, p)
       AND s /= t
       IMPLIES length(o[T](trunc1[T](p), rev[T](q))) > 0;


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 383 0 387 999
body:
  % Subtype TCC generated (at line 88, column 54) for  rev(p)
      % expected type  prewalk[T]
  from_rev_TCC1: OBLIGATION
    FORALL (p: prewalk[T], s, t: T):
      from?(p, s, t) IMPLIES length(rev[T](p)) > 0;


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 389 0 394 999
body:
  % Subtype TCC generated (at line 92, column 28) for  1
      % expected type  below[length(p)]
  front_short_TCC1: OBLIGATION
    FORALL (G: graph[T], p, q: prewalk[T], s, t: T):
      path_from?(G, q, s, t) AND path_from?(G, p, s, t) AND s /= t IMPLIES
       1 < length(p);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 396 0 401 999
body:
  % Subtype TCC generated (at line 92, column 33) for  1
      % expected type  below[length(q)]
  front_short_TCC2: OBLIGATION
    FORALL (G: graph[T], p, q: prewalk[T], s, t: T):
      path_from?(G, q, s, t) AND path_from?(G, p, s, t) AND s /= t IMPLIES
       1 < length(q);


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 403 0 407 999
body:
  % Subtype TCC generated (at line 100, column 47) for  length(w) - 1
      % expected type  below[w`length]
  add1_rev_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Seq[T](G), x: (vert(G))):
      length(w) > 1 IMPLIES length(w) - 1 >= 0 AND length(w) - 1 < w`length;


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 409 0 413 999
body:
  % Subtype TCC generated (at line 101, column 44) for  w
      % expected type  Longprewalk[T]
  add1_rev_TCC2: OBLIGATION
    FORALL (G: graph[T], w: Seq[T](G), x: (vert(G))):
      length(w) > 1 AND x /= seq(w)(length(w) - 1) IMPLIES length(w) >= 2;


decl_type: tcc
theory: path_circ
library: graphs
signature: nil
location: 415 0 420 999
body:
  % Subtype TCC generated (at line 101, column 66) for  seq(w)(length(w) - 1)
      % expected type  (vert(G))
  add1_rev_TCC3: OBLIGATION
    FORALL (G: graph[T], w: Seq[T](G), x: (vert(G))):
      length(w) > 1 AND x /= seq(w)(length(w) - 1) IMPLIES
       vert(G)(seq(w)(length(w) - 1));


decl_type: formula
theory: subgraphs_from_walk
library: graphs
signature: nil
location: 18 3 19 62
body:
     vert_G_from     : LEMMA FORALL (w: Walk(G), i: below(length(w))): 
                                        vert(G_from(G, w))(w(i))


decl_type: formula
theory: subgraphs_from_walk
library: graphs
signature: nil
location: 21 3 22 71
body:
     edge?_G_from    : LEMMA FORALL (w: Walk(G), i: below(length(w)-1)): 
                                        edge?(G_from(G, w))(w(i), w(i+1)) 


decl_type: formula
theory: subgraphs_from_walk
library: graphs
signature: nil
location: 24 3 25 70
body:
     edge?_G_from_rev: LEMMA FORALL (w: Walk(G), i: below(length(w)-1)): 
                                       edge?(G_from(G, w))(w(i+1), w(i))


decl_type: formula
theory: subgraphs_from_walk
library: graphs
signature: nil
location: 28 3 32 75
body:
     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)))


decl_type: formula
theory: subgraphs_from_walk
library: graphs
signature: nil
location: 36 3 39 76
body:
     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))


decl_type: function
theory: subgraphs_from_walk
library: graphs
signature: [d: [G: graph[T], Walk[T](G)] -> Subgraph[T](d`1)]
location: 11 3 12 68
body:
     G_from(G, (w: Walk(G))): Subgraph(G) = (# vert  := verts_of(w),
                                               edges := edges_of(w) #)


decl_type: tcc
theory: subgraphs_from_walk
library: graphs
signature: nil
location: 46 0 55 999
body:
  % Subtype TCC generated (at line 11, column 42) for
      % (# vert := verts_of(w), edges := edges_of(w) #)
      % expected type  Subgraph[T](G)
  G_from_TCC1: OBLIGATION
    FORALL (G: graph[T], (w: Walk[T](G))):
      (FORALL (e: doubleton[T]):
         edges_of[T](w)(e) IMPLIES
          (FORALL (x: T): e(x) IMPLIES verts_of[T](w)(x)))
       AND
       subgraph?[T]((# vert := verts_of[T](w), edges := edges_of[T](w) #), G);


decl_type: tcc
theory: subgraphs_from_walk
library: graphs
signature: nil
location: 57 0 61 999
body:
  % Subtype TCC generated (at line 22, column 60) for  i
      % expected type  below[length(w)]
  edge?_G_from_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Walk[T](G), i: below(length(w) - 1)):
      i < length(w);


decl_type: tcc
theory: subgraphs_from_walk
library: graphs
signature: nil
location: 63 0 67 999
body:
  % Subtype TCC generated (at line 22, column 66) for  i + 1
      % expected type  below[length(w)]
  edge?_G_from_TCC2: OBLIGATION
    FORALL (G: graph[T], w: Walk[T](G), i: below(length(w) - 1)):
      i + 1 < length(w);


decl_type: formula
theory: circuit_deg
library: graphs
signature: nil
location: 13 3 15 43
body:
     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


decl_type: formula
theory: circuit_deg
library: graphs
signature: nil
location: 17 3 18 62
body:
     circuit_deg: LEMMA FORALL (w: Walk(G),i: below(length(w))): circuit?(G,w) 
                              IMPLIES deg(w(i),G_from(G,w)) >= 2


decl_type: formula
theory: circuit_deg
library: graphs
signature: nil
location: 21 3 22 67
body:
     circuit_subgraph_len_1: LEMMA FORALL (w: Walk(G)): circuit?(G,w) 
                                  IMPLIES card(vert(G_from(G,w))) > 1


decl_type: function
theory: circuit_deg
library: graphs
signature: [[doubleton[T], doubleton[T]] -> finite_set[doubleton[T]]]
location: 9 3 10 68
body:
     e_duo(e1,e2: doubleton[T]): finite_set[doubleton[T]] =
                     add[doubleton[T]](e1,singleton[doubleton[T]](e2))


decl_type: tcc
theory: circuit_deg
library: graphs
signature: nil
location: 31 0 35 999
body:
  % Subtype TCC generated (at line 17, column 74) for  w
      % expected type  Seq[T](G)
  circuit_deg_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Walk[T](G), i: below(length(w))):
      verts_in?[T](G, w);


decl_type: tcc
theory: circuit_deg
library: graphs
signature: nil
location: 37 0 40 999
body:
  % Subtype TCC generated (at line 21, column 65) for  w
      % expected type  Seq[T](G)
  circuit_subgraph_len_1_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Walk[T](G)): verts_in?[T](G, w);


decl_type: formula
theory: graph_inductions
library: graphs
signature: nil
location: 12 2 13 78
body:
    size_prep              : LEMMA (FORALL G : P(G)) IFF 
                                        (FORALL n, G : size(G) = n IMPLIES P(G)) 


decl_type: formula
theory: graph_inductions
library: graphs
signature: nil
location: 16 2 19 58
body:
    graph_induction_vert    : THEOREM (FORALL G:
                                  (FORALL GG: size(GG) < size(G) IMPLIES P(GG))
                                                  IMPLIES P(G))
                                    IMPLIES (FORALL G: P(G))


decl_type: formula
theory: graph_inductions
library: graphs
signature: nil
location: 22 2 26 55
body:
    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))


decl_type: formula
theory: graph_inductions
library: graphs
signature: nil
location: 30 2 31 80
body:
    num_edges_prep         : LEMMA (FORALL G : P(G)) IFF 
                                     (FORALL n, G : num_edges(G) = n IMPLIES P(G)) 


decl_type: formula
theory: graph_inductions
library: graphs
signature: nil
location: 33 2 36 58
body:
    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))


decl_type: formula
theory: trees
library: graphs
signature: nil
location: 23 3 26 73
body:
     tree_edge_k: LEMMA (FORALL G,v,k: tree?(G) AND size(G) = k+2 AND vert(G)(v)
                         IMPLIES deg(v,G)>0 OR card[T](vert(G)) = 1) IMPLIES 
                              (FORALL G,v: tree?(G) AND vert(G)(v) 
                                IMPLIES deg(v,G)>0 OR card[T](vert(G)) = 1)


decl_type: formula
theory: trees
library: graphs
signature: nil
location: 28 3 29 61
body:
     tree_edge: LEMMA (FORALL G,v,k: tree?(G) AND size(G) = k+2 AND vert(G)(v)
                           IMPLIES deg(v,G)>0 OR card[T](vert(G)) = 1)


decl_type: formula
theory: trees
library: graphs
signature: nil
location: 31 3 32 39
body:
     tree_edge_all: LEMMA tree?(G) AND vert(G)(v) IMPLIES deg(v,G)>0 OR 
                            card[T](vert(G)) = 1 


decl_type: formula
theory: trees
library: graphs
signature: nil
location: 34 3 40 68
body:
     del_tree_k: LEMMA ( FORALL G,v,k: tree?(G) and size(G) = k+1 AND 
                         vert(G)(v) AND deg(v,G)=1 
                        IMPLIES tree?(del_vert(G,v))) 
                            IMPLIES (FORALL G,v: tree?(G) AND 
                                                 vert(G)(v) AND 
                                                 deg(v,G)=1 
                                         IMPLIES tree?(del_vert(G,v)))


decl_type: formula
theory: trees
library: graphs
signature: nil
location: 42 2 44 56
body:
    del_tree: LEMMA ( FORALL G,v,k: tree?(G) AND size(G) = k+1 AND 
                                    vert(G)(v) AND deg(v,G)=1 
                             IMPLIES tree?(del_vert(G,v)))


decl_type: formula
theory: trees
library: graphs
signature: nil
location: 47 2 48 42
body:
    del_tree_all: LEMMA tree?(G) AND vert(G)(v) AND deg(v,G)=1 IMPLIES
                               tree?(del_vert(G,v))


decl_type: function
theory: trees
library: graphs
signature: [graph[T] -> bool]
location: 10 3 13 28
body:
     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)


decl_type: tcc
theory: trees
library: graphs
signature: nil
location: 59 0 65 999
body:
  % Termination TCC generated (at line 12, column 34) for
      % tree?(del_vert[T](G, v))
  tree?_TCC1: OBLIGATION
    FORALL (G: graph[T]):
      NOT card[T](vert(G)) = 1 IMPLIES
       (FORALL (v: (vert(G))):
          deg(v, G) = 1 IMPLIES size[T](del_vert[T](G, v)) < size[T](G));


decl_type: formula
theory: tree_circ
library: graphs
signature: nil
location: 13 3 14 78
body:
     exists_c_tree: LEMMA FORALL (w: Walk(GT)): 
                                EXISTS (t: Tree[T]): subgraph?(G_from(GT, w), t)


decl_type: formula
theory: tree_circ
library: graphs
signature: nil
location: 20 3 24 75
body:
     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))


decl_type: formula
theory: tree_circ
library: graphs
signature: nil
location: 26 3 29 66
body:
     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


decl_type: formula
theory: tree_circ
library: graphs
signature: nil
location: 31 3 32 71
body:
     small_tree_lem: LEMMA FORALL (w: Walk(G)): tree?(G) =>
                                   size(G) <= 1 IMPLIES NOT circuit?(G,w)


decl_type: formula
theory: tree_circ
library: graphs
signature: nil
location: 34 3 35 53
body:
     tree_no_circuits: THEOREM (FORALL (w: Walk(G)): tree?(G) =>
                                     NOT circuit?(G,w))


decl_type: function
theory: tree_circ
library: graphs
signature: [[TR: Tree, Subgraph[T](TR)] -> Tree[T]]
location: 16 3 18 54
body:
     c_tree(TR: Tree, C: Subgraph(TR)): Tree =
              min[Tree[T],(LAMBDA GT: size(GT)),
                           (LAMBDA GT: subgraph?(C,GT))]


decl_type: tcc
theory: tree_circ
library: graphs
signature: nil
location: 45 0 50 999
body:
  % Assuming TCC generated (at line 17, column 12) for
      % min[Tree[T], (LAMBDA GT: size(GT)), (LAMBDA GT: subgraph?(C, GT))]
      % generated from assumption abstract_min.T_ne
  c_tree_TCC1: OBLIGATION
    FORALL (TR: Tree[T], C: Subgraph[T](TR)):
      EXISTS (t: Tree[T]): subgraph?[T](C, t);


decl_type: tcc
theory: tree_circ
library: graphs
signature: nil
location: 52 0 56 999
body:
  % Subtype TCC generated (at line 32, column 69) for  w
      % expected type  Seq[T](G)
  small_tree_lem_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Walk[T](G)):
      size(G) <= 1 AND tree?(G) IMPLIES verts_in?[T](G, w);


decl_type: tcc
theory: tree_circ
library: graphs
signature: nil
location: 58 0 61 999
body:
  % Subtype TCC generated (at line 35, column 50) for  w
      % expected type  Seq[T](G)
  tree_no_circuits_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Walk[T](G)): tree?(G) IMPLIES verts_in?[T](G, w);


decl_type: formula
theory: tree_paths
library: graphs
signature: nil
location: 30 3 36 70
body:
     min_dual_def: LEMMA FORALL (G: Graph[T], r: Path(G), s: Path(G)):
                            dual_paths?(G,r,s) IMPLIES
                            is_min_dual?(G,proj_1(min_dual_paths(G,r,s)),
                                           proj_2(min_dual_paths(G,r,s))) 
                        AND  
                            dual_paths?(G,proj_1(min_dual_paths(G,r,s)),
                                          proj_2(min_dual_paths(G,r,s)))


decl_type: formula
theory: tree_paths
library: graphs
signature: nil
location: 39 3 40 77
body:
     min_dual_exists: LEMMA FORALL (G: Graph[T], r: Path(G), s: Path(G)):
           dual_paths?(G,r,s) IMPLIES EXISTS (p,q:Path(G)): is_min_dual?(G,p,q)


decl_type: formula
theory: tree_paths
library: graphs
signature: nil
location: 42 3 46 88
body:
     dual_path_trunc: LEMMA  FORALL (G: Graph[T], p: Path(G), q: Path(G)): 
       dual_paths?(G,p,q) IMPLIES 
           length(p)>1 AND length(q)>1 AND path?[T](G, p ^ (0, length(p) - 2)) 
           AND path?[T](G, q ^ (0, length(q) - 2)) 
           AND path?[T](G, p ^ (1, length(p) - 1)) AND path?[T](G, q ^ (1, length(q) - 1))


decl_type: formula
theory: tree_paths
library: graphs
signature: nil
location: 48 3 49 62
body:
     dual_path_length: LEMMA FORALL (G: Graph[T], p: Path(G), q: Path(G)): 
           dual_paths?(G,p,q) IMPLIES length(p)>2 OR length(q)>2


decl_type: formula
theory: tree_paths
library: graphs
signature: nil
location: 51 3 52 86
body:
     min_dual_reduc: LEMMA  FORALL (G: Graph[T], p: Path(G), q: Path(G)): 
           is_min_dual?(G,p,q) IMPLIES p(1) /= q(1) AND p(length(p)-2) /= q(length(q)-2)


decl_type: formula
theory: tree_paths
library: graphs
signature: nil
location: 55 3 58 60
body:
     min_dual_distin: LEMMA  FORALL (G: Graph[T], p: Path(G), q: Path(G)): 
                is_min_dual?(G,p,q) IMPLIES 
                           (FORALL (i,j:nat):i<length(p)-1 AND j<length(q)-1 AND p(i)=q(j) 
                                        IMPLIES (i=0 AND j=0))


decl_type: formula
theory: tree_paths
library: graphs
signature: nil
location: 60 3 64 58
body:
     dual_cycle: LEMMA  FORALL (G: Graph[T], p: Path(G), q: Path(G)): 
                    dual_paths?(G,p,q) AND 
                    (FORALL (i,j:nat):i<length(p)-1 AND j<length(q)-1 AND p(i)=q(j) 
                                         IMPLIES (i=0 AND j=0)) 
                        IMPLIES cycle?(G,trunc1(p) o rev(q)) 


decl_type: formula
theory: tree_paths
library: graphs
signature: nil
location: 67 3 70 39
body:
     tree_one_path: LEMMA  tree?(G) AND
                                 path_from?(G,p,u,v) AND
                                 path_from?(G,q,u,v) IMPLIES
                                      p=q


decl_type: function
theory: tree_paths
library: graphs
signature: [[G: graph[T], Path[T](G), Path[T](G)] -> bool]
location: 12 3 13 37
body:
     dual_paths?(G,(p:Path(G)),(q:Path(G))):bool = p /= q AND p(0)=q(0)
      AND p(length(p)-1)=q(length(q)-1)


decl_type: function
theory: tree_paths
library: graphs
location: 20 3 23 54
signature:
  [d:
          [G: Graph[T], r: Path[T](G),
           {s: Path(G) | dual_paths?(G, r, s)}] ->
          Dual_paths(d`1)]

body:
     min_dual_paths(G: Graph[T], r: Path(G), s: Path(G) | dual_paths?(G,r,s)): 
              Dual_paths(G) = min[[Path(G),Path(G)],
     (LAMBDA (r:Path(G),s:Path(G)): length(r)+length(s)),
     (LAMBDA (r:Path(G),s:Path(G)): dual_paths?(G,r,s))]


decl_type: function
theory: tree_paths
library: graphs
signature: [[G: graph[T], Path[T](G), Path[T](G)] -> bool]
location: 26 3 28 81
body:
     is_min_dual?(G,(p:Path(G)),(q:Path(G))):bool = dual_paths?(G,p,q) 
                        AND FORALL (r:Path(G),s:Path(G)): dual_paths?(G,r,s) 
                              IMPLIES  length(r) + length(s) >= length(p)+length(q)


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 78 0 82 999
body:
  % Subtype TCC generated (at line 12, column 62) for  0
      % expected type  below[length(p)]
  dual_paths?_TCC1: OBLIGATION
    FORALL (G: graph[T], (p: Path[T](G)), (q: Path[T](G))):
      p /= q IMPLIES 0 < length(p);


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 84 0 88 999
body:
  % Subtype TCC generated (at line 12, column 67) for  0
      % expected type  below[length(q)]
  dual_paths?_TCC2: OBLIGATION
    FORALL (G: graph[T], (p: Path[T](G)), (q: Path[T](G))):
      p /= q IMPLIES 0 < length(q);


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 90 0 95 999
body:
  % Subtype TCC generated (at line 13, column 10) for  length(p) - 1
      % expected type  below[length(p)]
  dual_paths?_TCC3: OBLIGATION
    FORALL (G: graph[T], (p: Path[T](G)), (q: Path[T](G))):
      finseq_appl[T](p)(0) = finseq_appl[T](q)(0) AND p /= q IMPLIES
       length(p) - 1 >= 0 AND length(p) - 1 < length(p);


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 97 0 102 999
body:
  % Subtype TCC generated (at line 13, column 25) for  length(q) - 1
      % expected type  below[length(q)]
  dual_paths?_TCC4: OBLIGATION
    FORALL (G: graph[T], (p: Path[T](G)), (q: Path[T](G))):
      finseq_appl[T](p)(0) = finseq_appl[T](q)(0) AND p /= q IMPLIES
       length(q) - 1 >= 0 AND length(q) - 1 < length(q);


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 104 0 113 999
body:
  % Assuming TCC generated (at line 21, column 28) for
      % min
      %     [[Path(G), Path(G)],
      %      (LAMBDA (r: Path(G), s: Path(G)): length(r) + length(s)),
      %      (LAMBDA (r: Path(G), s: Path(G)): dual_paths?(G, r, s))]
      % generated from assumption abstract_min.T_ne
  min_dual_paths_TCC1: OBLIGATION
    FORALL (G: Graph[T], r: Path[T](G),
            s: Path[T](G) | dual_paths?(G, r, s)):
      EXISTS (t: [Path[T](G), Path[T](G)]): dual_paths?(G, t`1, t`2);


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 115 0 136 999
body:
  % Subtype TCC generated (at line 21, column 28) for
      % min
      %     [[Path(G), Path(G)],
      %      (LAMBDA (r: Path(G), s: Path(G)): length(r) + length(s)),
      %      (LAMBDA (r: Path(G), s: Path(G)): dual_paths?(G, r, s))]
      % expected type  Dual_paths(G)
  min_dual_paths_TCC2: OBLIGATION
    FORALL (G: Graph[T], r: Path[T](G),
            s: Path[T](G) | dual_paths?(G, r, s)):
      dual_paths?(G,
                  min
                      [[Path[T](G), Path[T](G)],
                       (LAMBDA (r: Path[T](G), s: Path[T](G)):
                          length(r) + length(s)),
                       (LAMBDA (r: Path[T](G), s: Path[T](G)):
                          dual_paths?(G, r, s))]`1,
                  min
                      [[Path[T](G), Path[T](G)],
                       (LAMBDA (r: Path[T](G), s: Path[T](G)):
                          length(r) + length(s)),
                       (LAMBDA (r: Path[T](G), s: Path[T](G)):
                          dual_paths?(G, r, s))]`2);


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 138 0 143 999
body:
  % Subtype TCC generated (at line 44, column 61) for  length(p) - 2
      % expected type  nat
  dual_path_trunc_TCC1: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      length(q) > 1 AND length(p) > 1 AND dual_paths?(G, p, q) IMPLIES
       length(p) - 2 >= 0;


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 145 0 150 999
body:
  % Subtype TCC generated (at line 44, column 53) for  p ^ (0, length(p) - 2)
      % expected type  prewalk[T]
  dual_path_trunc_TCC2: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      length(q) > 1 AND length(p) > 1 AND dual_paths?(G, p, q) IMPLIES
       length(^[T](p, (0, length(p) - 2))) > 0;


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 152 0 158 999
body:
  % Subtype TCC generated (at line 45, column 33) for  length(q) - 2
      % expected type  nat
  dual_path_trunc_TCC3: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      path?[T](G, p ^ (0, length(p) - 2)) AND
       length(q) > 1 AND length(p) > 1 AND dual_paths?(G, p, q)
       IMPLIES length(q) - 2 >= 0;


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 160 0 166 999
body:
  % Subtype TCC generated (at line 45, column 25) for  q ^ (0, length(q) - 2)
      % expected type  prewalk[T]
  dual_path_trunc_TCC4: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      path?[T](G, p ^ (0, length(p) - 2)) AND
       length(q) > 1 AND length(p) > 1 AND dual_paths?(G, p, q)
       IMPLIES length(^[T](q, (0, length(q) - 2))) > 0;


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 168 0 175 999
body:
  % Subtype TCC generated (at line 46, column 33) for  length(p) - 1
      % expected type  nat
  dual_path_trunc_TCC5: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
           path?[T](G, q ^ (0, length(q) - 2))
       AND path?[T](G, p ^ (0, length(p) - 2)) AND length(q) > 1
       AND length(p) > 1 AND dual_paths?(G, p, q)
       IMPLIES length(p) - 1 >= 0;


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 177 0 184 999
body:
  % Subtype TCC generated (at line 46, column 25) for  p ^ (1, length(p) - 1)
      % expected type  prewalk[T]
  dual_path_trunc_TCC6: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
           path?[T](G, q ^ (0, length(q) - 2))
       AND path?[T](G, p ^ (0, length(p) - 2)) AND length(q) > 1
       AND length(p) > 1 AND dual_paths?(G, p, q)
       IMPLIES length(^[T](p, (1, length(p) - 1))) > 0;


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 186 0 194 999
body:
  % Subtype TCC generated (at line 46, column 73) for  length(q) - 1
      % expected type  nat
  dual_path_trunc_TCC7: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
           path?[T](G, p ^ (1, length(p) - 1))
       AND path?[T](G, q ^ (0, length(q) - 2))
       AND path?[T](G, p ^ (0, length(p) - 2)) AND length(q) > 1
       AND length(p) > 1 AND dual_paths?(G, p, q)
       IMPLIES length(q) - 1 >= 0;


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 196 0 204 999
body:
  % Subtype TCC generated (at line 46, column 65) for  q ^ (1, length(q) - 1)
      % expected type  prewalk[T]
  dual_path_trunc_TCC8: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
           path?[T](G, p ^ (1, length(p) - 1))
       AND path?[T](G, q ^ (0, length(q) - 2))
       AND path?[T](G, p ^ (0, length(p) - 2)) AND length(q) > 1
       AND length(p) > 1 AND dual_paths?(G, p, q)
       IMPLIES length(^[T](q, (1, length(q) - 1))) > 0;


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 206 0 210 999
body:
  % Subtype TCC generated (at line 52, column 39) for  1
      % expected type  below[length(p)]
  min_dual_reduc_TCC1: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      is_min_dual?(G, p, q) IMPLIES 1 < length(p);


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 212 0 216 999
body:
  % Subtype TCC generated (at line 52, column 47) for  1
      % expected type  below[length(q)]
  min_dual_reduc_TCC2: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      is_min_dual?(G, p, q) IMPLIES 1 < length(q);


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 218 0 223 999
body:
  % Subtype TCC generated (at line 52, column 56) for  length(p) - 2
      % expected type  below[length(p)]
  min_dual_reduc_TCC3: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      finseq_appl[T](p)(1) /= finseq_appl[T](q)(1) AND is_min_dual?(G, p, q)
       IMPLIES length(p) - 2 >= 0 AND length(p) - 2 < length(p);


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 225 0 230 999
body:
  % Subtype TCC generated (at line 52, column 74) for  length(q) - 2
      % expected type  below[length(q)]
  min_dual_reduc_TCC4: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      finseq_appl[T](p)(1) /= finseq_appl[T](q)(1) AND is_min_dual?(G, p, q)
       IMPLIES length(q) - 2 >= 0 AND length(q) - 2 < length(q);


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 232 0 238 999
body:
  % Subtype TCC generated (at line 57, column 81) for  i
      % expected type  below[length(p)]
  min_dual_distin_TCC1: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      is_min_dual?(G, p, q) IMPLIES
       (FORALL (i, j: nat):
          j < length(q) - 1 AND i < length(p) - 1 IMPLIES i < length(p));


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 240 0 246 999
body:
  % Subtype TCC generated (at line 57, column 86) for  j
      % expected type  below[length(q)]
  min_dual_distin_TCC2: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      is_min_dual?(G, p, q) IMPLIES
       (FORALL (i, j: nat):
          j < length(q) - 1 AND i < length(p) - 1 IMPLIES j < length(q));


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 248 0 254 999
body:
  % Subtype TCC generated (at line 62, column 74) for  i
      % expected type  below[length(p)]
  dual_cycle_TCC1: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      dual_paths?(G, p, q) IMPLIES
       (FORALL (i, j: nat):
          j < length(q) - 1 AND i < length(p) - 1 IMPLIES i < length(p));


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 256 0 262 999
body:
  % Subtype TCC generated (at line 62, column 79) for  j
      % expected type  below[length(q)]
  dual_cycle_TCC2: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      dual_paths?(G, p, q) IMPLIES
       (FORALL (i, j: nat):
          j < length(q) - 1 AND i < length(p) - 1 IMPLIES j < length(q));


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 264 0 273 999
body:
  % Subtype TCC generated (at line 64, column 46) for  p
      % expected type  Longprewalk[T]
  dual_cycle_TCC3: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      (dual_paths?(G, p, q) AND
        (FORALL (i, j: nat):
           i < length(p) - 1 AND
            j < length(q) - 1 AND finseq_appl[T](p)(i) = finseq_appl[T](q)(j)
            IMPLIES (i = 0 AND j = 0)))
       IMPLIES length(p) >= 2;


decl_type: tcc
theory: tree_paths
library: graphs
signature: nil
location: 275 0 286 999
body:
  % Subtype TCC generated (at line 64, column 39) for  trunc1(p) o rev(q)
      % expected type  Seq[T](G)
  dual_cycle_TCC4: OBLIGATION
    FORALL (G: Graph[T], p: Path[T](G), q: Path[T](G)):
      (dual_paths?(G, p, q) AND
        (FORALL (i, j: nat):
           i < length(p) - 1 AND
            j < length(q) - 1 AND finseq_appl[T](p)(i) = finseq_appl[T](q)(j)
            IMPLIES (i = 0 AND j = 0)))
       IMPLIES
       length(o[T](trunc1[T](p), rev[T](q))) > 0 AND
        verts_in?[T](G, o[T](trunc1[T](p), rev[T](q)));


decl_type: formula
theory: graph_pair
library: graphs
signature: nil
location: 16 2 19 59
body:
    NAT_pair_induct: LEMMA (FORALL gh: LET (g,h) = gh IN 
                             (FORALL (l,m): lsth((l,m),(g,h))
                                IMPLIES p((l,m))) IMPLIES p((g,h)))
                                  IMPLIES (FORALL (i,j): p((i,j)))


decl_type: formula
theory: graph_pair
library: graphs
signature: nil
location: 28 2 30 62
body:
    size_up: LEMMA (FORALL (G,H): Q((G,H))) IFF 
                       (FORALL (G,H): (FORALL (m,n) :
                          (size(G),size(H)) = (m, n) IMPLIES Q((G,H))))


decl_type: formula
theory: graph_pair
library: graphs
signature: nil
location: 32 2 37 74
body:
    graph_induct_pair    : THEOREM (FORALL (G,H): (FORALL (GG,HH): 
                                   (size(GG) < size(G) OR
                                   (size(GG)=size(G) AND size(HH) < size(H) ))
                                      IMPLIES Q((GG,HH)))
                                         IMPLIES Q((G,H)))
                                            IMPLIES (FORALL (G,H): Q((G,H)))


decl_type: formula
theory: graph_pair
library: graphs
signature: nil
location: 39 2 43 72
body:
    graph_induct_pair_B  : THEOREM (FORALL (G,H): (FORALL (GG,HH): 
                                    lsth((size(GG),size(HH)),(size(G),size(H))) 
                                    IMPLIES Q((GG,HH)))
                                       IMPLIES Q((G,H)))
                                          IMPLIES (FORALL (G,H): Q((G,H)))


decl_type: formula
theory: graph_pair
library: graphs
signature: nil
location: 45 2 49 71
body:
    graph_pair_induct_not: THEOREM (FORALL (G,H): P(G,H) IMPLIES
                                     (EXISTS (GG,HH): (size(GG) < size(G) 
                                     OR (size(GG) = size(G) AND size(HH) < size(H)))
                                     AND P(GG,HH)))
                                       IMPLIES (FORALL (G,H): NOT P(G,H))


decl_type: function
theory: graph_pair
library: graphs
signature: [[[nat, nat], [nat, nat]] -> bool]
location: 6 2 7 67
body:
    lsth(p1:[nat,nat], p2:[nat,nat]): bool = LET (i,j) = p1, (k,l) = p2 IN
                                                 i<k OR (i=k AND j<l)


decl_type: function
theory: graph_conn_defs
library: graphs
signature: [graph[T] -> bool]
location: 9 3 12 33
body:
     connected?(G): RECURSIVE bool = singleton?(G) OR
                                     (EXISTS (v: (vert(G))): deg(v,G) > 0 
                                         AND connected?(del_vert(G,v))) 
                    MEASURE size(G)


decl_type: function
theory: graph_conn_defs
library: graphs
signature: [graph[T] -> bool]
location: 16 3 19 82
body:
     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)(length(w)-1) = y))


decl_type: function
theory: graph_conn_defs
library: graphs
signature: [graph[T] -> bool]
location: 23 3 27 78
body:
     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))))


decl_type: function
theory: graph_conn_defs
library: graphs
signature: [graph[T] -> bool]
location: 29 3 36 31
body:
     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


decl_type: tcc
theory: graph_conn_defs
library: graphs
signature: nil
location: 44 0 50 999
body:
  % Termination TCC generated (at line 11, column 43) for
      % connected?(del_vert(G, v))
  connected?_TCC1: OBLIGATION
    FORALL (G: graph[T]):
      NOT singleton?(G) IMPLIES
       (FORALL (v: (vert(G))):
          deg(v, G) > 0 IMPLIES size[T](del_vert[T](G, v)) < size[T](G));


decl_type: tcc
theory: graph_conn_defs
library: graphs
signature: nil
location: 52 0 57 999
body:
  % Subtype TCC generated (at line 18, column 64) for  0
      % expected type  below[w`length]
  path_connected?_TCC1: OBLIGATION
    FORALL (G: graph[T]):
      NOT empty?(G) IMPLIES
       (FORALL (x, y: (vert(G)), w: Walk[T](G)): 0 < w`length);


decl_type: tcc
theory: graph_conn_defs
library: graphs
signature: nil
location: 59 0 66 999
body:
  % Subtype TCC generated (at line 19, column 64) for  length(w) - 1
      % expected type  below[w`length]
  path_connected?_TCC2: OBLIGATION
    FORALL (G: graph[T]):
      NOT empty?(G) IMPLIES
       (FORALL (x, y: (vert(G)), w: Walk[T](G)):
          seq(w)(0) = x IMPLIES
           length(w) - 1 >= 0 AND length(w) - 1 < w`length);


decl_type: formula
theory: graph_complected
library: graphs
signature: nil
location: 16 3 17 63
body:
     two_vertices: LEMMA FORALL (v1,v2: T): edges(G)(e) AND e(v2) AND
                              vert(G) = dbl(v1, v2) IMPLIES e(v1)


decl_type: formula
theory: graph_complected
library: graphs
signature: nil
location: 19 3 21 54
body:
     sub_T: LEMMA FORALL (v: (vert(G))): 
                            NOT empty?(vert(del_vert(G,v))) AND deg(v,G) = 0
                               IMPLIES NOT connected?(G)


decl_type: formula
theory: graph_complected
library: graphs
signature: nil
location: 23 3 26 55
body:
     rev_lem2  : LEMMA FORALL (v: (vert(G))): 
                       connected?(G) AND
                       deg(v, G) = 1 IMPLIES
                               connected?(del_vert(G, v))


decl_type: formula
theory: graph_complected
library: graphs
signature: nil
location: 29 3 33 68
body:
     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)))


decl_type: formula
theory: graph_complected
library: graphs
signature: nil
location: 35 3 36 74
body:
     del_rem_lem: LEMMA edges(G)(e) AND e(v)
                        IMPLIES del_vert(del_edge(G, e), v) = del_vert(G, v)


decl_type: formula
theory: graph_complected
library: graphs
signature: nil
location: 38 3 41 76
body:
     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)))


decl_type: formula
theory: graph_complected
library: graphs
signature: nil
location: 46 3 50 39
body:
     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 )


decl_type: formula
theory: graph_complected
library: graphs
signature: nil
location: 52 3 60 30
body:
     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)


decl_type: formula
theory: graph_complected
library: graphs
signature: nil
location: 62 4 63 47
body:
      conn_del_vert: LEMMA  (EXISTS (v: (vert(G))): deg(v,G) = 1 AND                                             connected?(del_vert(G,v)))
                            IMPLIES connected?(G) 


decl_type: formula
theory: graph_complected
library: graphs
signature: nil
location: 67 1 67 95
body:
          connect_deg_0: LEMMA connected?(G) and vert(G)(v) and deg(v,G)= 0 IMPLIES G=singleton_graph(v)


decl_type: formula
theory: walk_inductions
library: graphs
signature: nil
location: 10 3 11 81
body:
     walk_prep              : LEMMA (FORALL w: P(w)) IFF 
                                         (FORALL n, w : length(w) = n IMPLIES P(w)) 


decl_type: formula
theory: walk_inductions
library: graphs
signature: nil
location: 14 3 17 59
body:
     graph_induction_walk    : THEOREM (FORALL w:
                                   (FORALL ww: length(ww) < length(w) IMPLIES P(ww))
                                                   IMPLIES P(w))
                                     IMPLIES (FORALL w: P(w))


decl_type: formula
theory: sep_sets
library: graphs
signature: nil
location: 37 3 38 62
body:
     min_sep_set_edge: LEMMA NOT separable?(G,s,t) IMPLIES 
                                    min_sep_set(G,s,t) = vert(G)


decl_type: formula
theory: sep_sets
library: graphs
signature: nil
location: 40 3 41 77
body:
     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)  


decl_type: formula
theory: sep_sets
library: graphs
signature: nil
location: 43 3 44 66
body:
     min_sep_set_seps: LEMMA separable?(G,s,t) IMPLIES 
                                 separates(G,min_sep_set(G,s,t),s,t)


decl_type: formula
theory: sep_sets
library: graphs
signature: nil
location: 46 3 47 54
body:
     min_sep_set_vert: LEMMA separable?(G,s,t) AND min_sep_set(G,s,t)(v) 
                                      IMPLIES vert(G)(v)


decl_type: formula
theory: sep_sets
library: graphs
signature: nil
location: 49 3 50 59
body:
     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


decl_type: formula
theory: sep_sets
library: graphs
signature: nil
location: 54 3 56 71
body:
     walk?_del_verts_not : LEMMA walk?(G, w) AND 
                                    empty?(intersection(verts_of(w),V))
                                        IMPLIES walk?(del_verts(G, V), w)


decl_type: formula
theory: sep_sets
library: graphs
signature: nil
location: 69 3 71 63
body:
     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))


decl_type: type
theory: sep_sets
library: graphs
signature: nil
location: 21 3 24 49
body:
     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}


decl_type: function
theory: sep_sets
library: graphs
signature: [[graph[T], finite_set[T]] -> graph[T]]
location: 13 3 16 64
body:
     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))} #)


decl_type: function
theory: sep_sets
library: graphs
signature: [[graph[T], finite_set[T], T, T] -> bool]
location: 18 3 19 78
body:
     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))


decl_type: function
theory: sep_sets
library: graphs
signature: [[graph[T], T, T] -> finite_set[T]]
location: 30 3 32 66
body:
     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)]


decl_type: function
theory: sep_sets
library: graphs
signature: [[graph[T], T] -> finite_set[T]]
location: 63 3 65 67
body:
     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)}


decl_type: tcc
theory: sep_sets
library: graphs
signature: nil
location: 84 0 90 999
body:
  % Subtype TCC generated (at line 15, column 23) for
      % {e | edges(G)(e) AND (FORALL v: V(v) IMPLIES NOT e(v))}
      % expected type  finite_set[doubleton[T]]
  del_verts_TCC1: OBLIGATION
    FORALL (G: graph[T], V: finite_set[T]):
      is_finite[doubleton[T]]
          ({e | edges(G)(e) AND (FORALL v: V(v) IMPLIES NOT e(v))});


decl_type: tcc
theory: sep_sets
library: graphs
signature: nil
location: 92 0 100 999
body:
  % Subtype TCC generated (at line 14, column 11) for
      % (# vert := difference[T](vert(G), V),
      %    edges := {e | edges(G)(e) AND (FORALL v: V(v) IMPLIES NOT e(v))} #)
      % expected type  graph[T]
  del_verts_TCC2: OBLIGATION
    FORALL (G: graph[T], V: finite_set[T]):
      FORALL (e_1: doubleton[T]):
        (edges(G)(e_1) AND (FORALL v: V(v) IMPLIES NOT e_1(v))) IMPLIES
         (FORALL (x: T): e_1(x) IMPLIES difference[T](vert(G), V)(x));


decl_type: tcc
theory: sep_sets
library: graphs
signature: nil
location: 102 0 108 999
body:
  % Assuming TCC generated (at line 30, column 39) for
      % min
      %     [seps(G, s, t), (LAMBDA (v: seps(G, s, t)): card(v)),
      %      (LAMBDA (v: seps(G, s, t)): TRUE)]
      % generated from assumption abstract_min.T_ne
  min_sep_set_TCC1: OBLIGATION
    FORALL (G: graph[T], s: T, t: T): EXISTS (t_1: seps(G, s, t)): TRUE;


decl_type: tcc
theory: sep_sets
library: graphs
signature: nil
location: 110 0 120 999
body:
  % Subtype TCC generated (at line 63, column 35) for
      % {v: T |
      %    (EXISTS (e: Dbl[T]):
      %       incident_edges[T](s, G)(e) AND e(v) AND NOT v = s)}
      % expected type  finite_set[T]
  adj_verts_TCC1: OBLIGATION
    FORALL (G: graph[T], s: T):
      is_finite[T]
          ({v: T |
              EXISTS (e: Dbl[T]):
                incident_edges[T](s, G)(e) AND e(v) AND NOT v = s});


decl_type: formula
theory: path_ops
library: graphs
signature: nil
location: 14 3 15 74
body:
     walk?_del_vert_not : LEMMA walk?(G, w) AND NOT verts_of(w)(v)
                                            IMPLIES walk?(del_vert(G, v), w)


decl_type: formula
theory: path_ops
library: graphs
signature: nil
location: 18 3 19 77
body:
     path?_del_vert     : LEMMA FORALL (w: prewalk): path?(del_vert(G, v), w) 
                                                         IMPLIES path?[T](G, w)


decl_type: formula
theory: path_ops
library: graphs
signature: nil
location: 21 3 22 77
body:
     path?_del_verts    : LEMMA FORALL (w: prewalk): path?(del_verts(G, W), w) 
                                                         IMPLIES path?[T](G, w)


decl_type: formula
theory: path_ops
library: graphs
signature: nil
location: 27 3 29 71
body:
     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))


decl_type: formula
theory: path_ops
library: graphs
signature: nil
location: 31 3 33 95
body:
     walk_to_path_less      : LEMMA  walk_from?(G,w,s,t) IMPLIES
                                   (EXISTS (p: prewalk): path?(G,p) AND
                                                     walk_from?(G,p,s,t)and length(p)<=length(w))


decl_type: formula
theory: path_ops
library: graphs
signature: nil
location: 37 3 38 75
body:
     walk_to_path_from : LEMMA walk_from?(G,w,s,t) IMPLIES
                                   (EXISTS (p: prewalk): path_from?(G,p,s,t))


decl_type: formula
theory: path_ops
library: graphs
signature: nil
location: 40 3 42 76
body:
     walk_to_path_from_less : LEMMA walk_from?(G,w,s,t) IMPLIES
                                   (EXISTS (p: prewalk): path_from?(G,p,s,t) AND 
                                                         length(p)<=length(w))


decl_type: formula
theory: path_ops
library: graphs
signature: nil
location: 46 3 49 63
body:
     path_disjoint: LEMMA u /= yt AND path_from?(G, p, u, yt) 
                                  AND path_from?(G, q, yt, v) 
                                  AND empty?(intersection(verts_of(trunc1(p)),verts_of(q))) 
                          IMPLIES path_from?(G,trunc1(p) o q,u,v)


decl_type: tcc
theory: path_ops
library: graphs
signature: nil
location: 64 0 69 999
body:
  % Subtype TCC generated (at line 48, column 72) for  p
      % expected type  Longprewalk[T]
  path_disjoint_TCC1: OBLIGATION
    FORALL (G: graph[T], p, q: prewalk[T], u, v, yt: T):
      u /= yt AND path_from?(G, p, u, yt) AND path_from?(G, q, yt, v) IMPLIES
       length(p) >= 2;


decl_type: tcc
theory: path_ops
library: graphs
signature: nil
location: 71 0 77 999
body:
  % Subtype TCC generated (at line 49, column 45) for  trunc1(p) o q
      % expected type  prewalk[T]
  path_disjoint_TCC2: OBLIGATION
    FORALL (G: graph[T], p, q: prewalk[T], u, v, yt: T):
      empty?(intersection(verts_of(trunc1(p)), verts_of(q))) AND
       path_from?(G, q, yt, v) AND path_from?(G, p, u, yt) AND u /= yt
       IMPLIES length(o[T](trunc1[T](p), q)) > 0;


decl_type: formula
theory: max_subgraphs
library: graphs
signature: nil
location: 16 3 17 75
body:
     prep0: LEMMA FORALL (G: graph[T], P: Gpred(G)):
         nonempty?[upto[size(G)]]({n: upto[size(G)] | is_one_of_size(G,P,n)})


decl_type: formula
theory: max_subgraphs
library: graphs
signature: nil
location: 22 3 24 71
body:
     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)})


decl_type: formula
theory: max_subgraphs
library: graphs
signature: nil
location: 37 3 38 68
body:
     max_subgraph_def    : LEMMA FORALL (P: Gpred(G)): 
                                       maximal?(G,max_subgraph(G,P),P)


decl_type: formula
theory: max_subgraphs
library: graphs
signature: nil
location: 42 3 44 78
body:
     max_subgraph_is_max : LEMMA FORALL (P: Gpred(G)):
                            (FORALL (SS: Subgraph(G)): P(SS) IMPLIES 
                                            size(SS) <= size(max_subgraph(G,P))) 


decl_type: type
theory: max_subgraphs
library: graphs
signature: nil
location: 8 3 9 70
body:
     Gpred(G): TYPE = {P: pred[graph[T]] | (EXISTS (S: graph[T]): 
                                               subgraph?(S,G) AND P(S))}


decl_type: function
theory: max_subgraphs
library: graphs
signature: [[G: graph[T], Gpred(G), nat] -> bool]
location: 13 3 14 59
body:
     is_one_of_size(G: graph[T], P: Gpred(G),n: nat): bool =
              (EXISTS (S: Subgraph(G)): P(S) AND size(S) = n)


decl_type: function
theory: max_subgraphs
library: graphs
signature: [d: [G: graph[T], Gpred(G)] -> upto[size(d`1)]]
location: 19 3 20 60
body:
     max_size(G: graph[T], P: Gpred(G)): upto[size(G)] =
               max({n: upto[size(G)] | is_one_of_size(G,P,n)})


decl_type: function
theory: max_subgraphs
library: graphs
signature: [[G: graph[T], Subgraph[T](G), Gpred(G)] -> bool]
location: 27 3 29 76
body:
     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))


decl_type: tcc
theory: max_subgraphs
library: graphs
signature: nil
location: 52 0 58 999
body:
  % Subtype TCC generated (at line 20, column 17) for
      % {n: upto[size(G)] | is_one_of_size(G, P, n)}
      % expected type  S: (nonempty?[upto[size(G)]])
  max_size_TCC1: OBLIGATION
    FORALL (G: graph[T], P: Gpred(G)):
      nonempty?[upto[size[T](G)]]
          ({n: upto[size[T](G)] | is_one_of_size(G, P, n)});


decl_type: tcc
theory: max_subgraphs
library: graphs
signature: nil
location: 60 0 67 999
body:
  % Existence TCC generated (at line 35, column 3) for
      % max_subgraph(G: graph[T], P: Gpred(G)):
      %       {S: Subgraph(G) | maximal?(G, S, P)}
  max_subgraph_TCC1: OBLIGATION
    EXISTS (x:
              [d: [G: graph[T], Gpred(G)] ->
                 {S: Subgraph[T](d`1) | maximal?(d`1, S, d`2)}]):
      TRUE;


decl_type: formula
theory: max_subtrees
library: graphs
signature: nil
location: 13 3 14 49
body:
     tree_in: LEMMA (EXISTS (Tr: Tree[T]): subgraph?(Tr,G) AND
                            nonempty?[T](vert(Tr)))


decl_type: formula
theory: max_subtrees
library: graphs
signature: nil
location: 26 3 27 73
body:
     max_subtree_max     : LEMMA FORALL (SS: Subtree(G)): 
                                           size(SS) <= size(max_subtree(G)) 


decl_type: tcc
theory: max_subtrees
library: graphs
signature: nil
location: 36 0 43 999
body:
  % Subtype TCC generated (at line 20, column 58) for
      % (extend[graph[T], Graph[T], bool, FALSE]((LAMBDA G: tree?(G))))
      % expected type  Gpred[T](G)
  max_subtree_TCC1: OBLIGATION
    FORALL (G: Graph[T]):
      EXISTS (S: graph[T]):
        subgraph?[T](S, G) AND
         extend[graph[T], Graph[T], bool, FALSE]((LAMBDA G: tree?[T](G)))(S);


decl_type: tcc
theory: max_subtrees
library: graphs
signature: nil
location: 45 0 63 999
body:
  % Subtype TCC generated (at line 20, column 42) for
      % max_subgraph(G,
      %              (extend[graph[T], Graph[T], bool, FALSE]
      %                   ((LAMBDA G: tree?(G)))))
      % expected type  Subtree(G)
  max_subtree_TCC2: OBLIGATION
    FORALL (G: Graph[T]):
      tree?[T]
          (max_subgraph[T]
               (G,
                (extend[graph[T], Graph[T], bool, FALSE]
                     ((LAMBDA G: tree?[T](G))))))
       AND
       subgraph?[T]
           (max_subgraph[T]
                (G,
                 (extend[graph[T], Graph[T], bool, FALSE]
                      ((LAMBDA G: tree?[T](G))))),
            G);


decl_type: formula
theory: subtrees
library: graphs
signature: nil
location: 11 3 15 81
body:
     walk_acr: LEMMA FORALL (w: Walk(G)): n < length(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)))))


decl_type: formula
theory: subtrees
library: graphs
signature: nil
location: 18 3 22 81
body:
     walk_acr2: LEMMA FORALL (w: Walk(G)): n < length(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)))))


decl_type: formula
theory: subtrees
library: graphs
signature: nil
location: 26 4 28 70
body:
      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))


decl_type: formula
theory: subtrees
library: graphs
signature: nil
location: 30 4 31 61
body:
      max_tree_all_verts: LEMMA path_connected?(G)   IMPLIES
                                 vert(max_subtree(G)) = vert(G)


decl_type: tcc
theory: subtrees
library: graphs
signature: nil
location: 41 0 45 999
body:
  % Subtype TCC generated (at line 12, column 47) for  0
      % expected type  below[w`length]
  walk_acr_TCC1: OBLIGATION
    FORALL (G: Graph[T], n: nat, w: Walk[T](G)):
      n < length(w) IMPLIES 0 < w`length;


decl_type: tcc
theory: subtrees
library: graphs
signature: nil
location: 47 0 52 999
body:
  % Subtype TCC generated (at line 15, column 44) for  j - 1
      % expected type  below[w`length]
  walk_acr_TCC2: OBLIGATION
    FORALL (G: Graph[T], S: graph[T], n: nat, w: Walk[T](G)):
      n < length(w) AND vert(S)(seq(w)(0)) AND NOT vert(S)(seq(w)(n)) IMPLIES
       (FORALL (j: posnat): j <= n IMPLIES j - 1 >= 0 AND j - 1 < w`length);


decl_type: tcc
theory: subtrees
library: graphs
signature: nil
location: 54 0 60 999
body:
  % Subtype TCC generated (at line 15, column 75) for  j
      % expected type  below[w`length]
  walk_acr_TCC3: OBLIGATION
    FORALL (G: Graph[T], S: graph[T], n: nat, w: Walk[T](G)):
      n < length(w) AND vert(S)(seq(w)(0)) AND NOT vert(S)(seq(w)(n)) IMPLIES
       (FORALL (j: posnat):
          vert(S)(seq(w)(j - 1)) AND j <= n IMPLIES j < w`length);


decl_type: tcc
theory: subtrees
library: graphs
signature: nil
location: 62 0 67 999
body:
  % Subtype TCC generated (at line 27, column 21) for  dbl[T](v, w)
      % expected type  doubleton[T]
  add_dbl_TCC1: OBLIGATION
    FORALL (G: Graph[T], v, w: T):
      vert(G)(v) AND v /= w IMPLIES
       (EXISTS (x: T), (y: T): x /= y AND dbl[T](v, w) = dbl[T](x, y));


decl_type: formula
theory: graph_path_conn
library: graphs
signature: nil
location: 9 3 10 62
body:
     isolated_not_path: LEMMA isolated?(G) AND NOT singleton?(G)
                                  IMPLIES NOT path_connected?(G)


decl_type: formula
theory: graph_path_conn
library: graphs
signature: nil
location: 13 3 14 68
body:
     pic_A: LEMMA (EXISTS v: vert(G)(v) AND deg(v,G) = 0)
                      IMPLIES path_connected?(G) IMPLIES connected?(G)


decl_type: formula
theory: graph_path_conn
library: graphs
signature: nil
location: 21 3 29 51
body:
     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))


decl_type: formula
theory: graph_path_conn
library: graphs
signature: nil
location: 33 3 36 56
body:
     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))


decl_type: formula
theory: graph_piece_path
library: graphs
signature: nil
location: 11 3 17 46
body:
     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)


decl_type: tcc
theory: graph_piece_path
library: graphs
signature: nil
location: 30 0 34 999
body:
  % Subtype TCC generated (at line 13, column 66) for  w
      % expected type  {y: T | y /= u}
  union_edge_disj_TCC1: OBLIGATION
    FORALL (H1, H2: graph[T], u, w: T):
      u /= w AND vert(H2)(w) AND vert(H1)(u) IMPLIES w /= u;


decl_type: formula
theory: graph_conn_piece
library: graphs
signature: nil
location: 19 3 20 39
body:
     not_piece_has_2: LEMMA NOT piece_connected?(G) IMPLIES empty?(G) OR
                              size(G) > 1


decl_type: formula
theory: graph_conn_piece
library: graphs
signature: nil
location: 25 3 28 47
body:
     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)


decl_type: formula
theory: graph_conn_piece
library: graphs
signature: nil
location: 30 3 32 75
body:
     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)


decl_type: formula
theory: graph_conn_piece
library: graphs
signature: nil
location: 36 3 42 53
body:
     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))


decl_type: formula
theory: graph_conn_piece
library: graphs
signature: nil
location: 44 3 52 65
body:
     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)))


decl_type: formula
theory: graph_conn_piece
library: graphs
signature: nil
location: 55 3 61 65
body:
     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)))


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 43 2 44 79
body:
    path_reach1: LEMMA path_connected?(G) IFF
                         (EXISTS (x: T): vert(G)(x) AND reachable(G,x) = vert(G))


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 46 2 49 39
body:
    path_reach2:  LEMMA path_connected?(G) IFF
                        (FORALL (x: T): vert(G)(x) 
                             IMPLIES reachable(G,x) = vert(G)) 
                        AND NOT empty?(G)


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 51 2 52 69
body:
    reachable_conn: LEMMA FORALL (x:(vert(G))): 
                                 connected?(subgraph(G,reachable(G,x)))


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 54 2 58 72
body:
    sub_tree_k: LEMMA (FORALL k,H,G: subgraph?(H,G) AND tree?(G) AND 
                                     connected?(H) AND size(G)=size(H)+k 
                         IMPLIES tree?(H)) 
                    IMPLIES (FORALL H,G: subgraph?(H,G) AND 
                             tree?(G) AND connected?(H)  IMPLIES tree?(H))


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 60 2 61 41
body:
    sub_tree_0     : LEMMA tree?(G) AND subgraph?(H,G) AND size(H)=size(G) 
                            AND connected?(H) IMPLIES H=G


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 63 2 64 73
body:
    sub_tree_k_lemm: LEMMA (FORALL k,H,G: subgraph?(H,G) AND tree?(G) AND
                             connected?(H) AND size(G)=size(H)+k IMPLIES tree?(H))


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 66 2 67 44
body:
    sub_tree_all    : LEMMA tree?(G) AND subgraph?(H,G) AND connected?(H)
                              IMPLIES tree?(H)


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 69 2 70 61
body:
    path_reach4    : LEMMA tree?(G) AND edges(G)(e) IMPLIES
                             NOT path_connected?(del_edge(G,e))


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 74 2 75 66
body:
    path_gap     : LEMMA tree?(G) AND edges(G)(e) AND e(x) AND e(y) AND
                         walk_from?(del_edge(G,e),w,x,y) IMPLIES x=y


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 77 2 78 72
body:
    set_card_less: LEMMA FORALL (A: finite_set[T], B: finite_set[T]):
                          subset?(A,B) AND B(x) IMPLIES card(A) < card(B) OR A(x)


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 80 2 83 68
body:
    conn_compon  : LEMMA FORALL (  x: (vert(G))): EXISTS H:
                                 (subgraph?(H,G) AND connected?(H) AND
                                  vert(H)(x) AND 
                                   FORALL (y:(vert(H))): (deg(y,G)=deg(y,H)))  


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 89 2 92 65
body:
    Bush_less: LEMMA FORALL (Tr: Tree,v,z:(vert(Tr)), e:(incident_edges(v,Tr)),
                             f:(incident_edges(z,Tr))): 
                       f(v) AND NOT e(z) 
                           IMPLIES size(Bush(Tr,z,f)) < size(Bush(Tr,v,e))


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 99 2 100 85
body:
    short_hound: LEMMA FORALL (Tr:Tree, phi:map(Tr,Tr)): 
                       path_from?(Tr,w,x,phi(x)) AND length(w)=1 IMPLIES fixed?(Tr,phi)


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 102 2 104 68
body:
    back_hound : LEMMA FORALL (Tr:Tree, phi:map(Tr,Tr)): 
                       path_from?(Tr,w,x,phi(x)) AND length(w)=2 AND 
                       phi(w(1))=w(length(w)-2) IMPLIES fixed?(Tr,phi)


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 106 2 111 95
body:
    stuck_hound: LEMMA FORALL (Tr:Tree, phi:map(Tr,Tr)): 
                      path_from?(Tr,w,x,phi(x)) AND length(w)>1 AND phi(w(1))=w(length(w)-1)
                  IMPLIES
                      EXISTS (p:prewalk):
                                path_from?(Tr,p,w(1),phi(w(1))) AND length(p)<length(w) AND 
                              ((length(p)>1 AND p(length(p)-2)=w(length(w)-2)) OR fixed?(Tr,phi))


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 113 2 118 69
body:
    whole_hound: LEMMA FORALL (Tr:Tree, phi:map(Tr,Tr)): 
                       path_from?(Tr,w,x,phi(x)) AND length(w)>2 AND 
                       phi(w(1))=w(length(w)-2) IMPLIES
                  EXISTS (p:prewalk):
                      path_from?(Tr,p,w(1),phi(w(1))) AND length(p)<length(w) AND 
                    (length(p)>1 IMPLIES p(length(p)-2)=w(length(w)-3))


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 120 2 122 40
body:
    fixed_fox  : LEMMA FORALL (Tr:Tree, phi:map(Tr,Tr)):
                         (EXISTS (G,H:Subgraph(Tr)):Fox(Tr,G,H,phi)) 
                         OR fixed?(Tr,phi)


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 124 2 129 42
body:
    small_fox  : LEMMA FORALL (Tr:Tree, phi:map(Tr,Tr),(G,H:Subgraph(Tr))): 
                       Fox(Tr,G,H,phi) 
                       IMPLIES (EXISTS (GG,HH:Subgraph(Tr)): 
                                     Fox(Tr,GG,HH,phi) AND
                                      lsth((size(GG),size(HH)),(size(G),size(H)))) 
                           OR fixed?(Tr,phi)


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 131 2 132 38
body:
    num_edge_tree: LEMMA connected?(G) AND num_edges(G)<size(G) 
                               IMPLIES tree?(G)


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 137 2 138 80
body:
    uniq_del_vert: LEMMA FORALL ( v:(vert(G))): uniq_paths?(G) 
                                                IMPLIES uniq_paths?(del_vert(G,v))


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 140 2 141 61
body:
    del_edge_uniq: LEMMA FORALL ( e:(edges(G))):connected?(del_edge(G,e)) 
                                     IMPLIES NOT uniq_paths?(G) 


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 149 2 150 36
body:
    tree_map     : LEMMA FORALL (phi:map(G,G)):tree?(G)
                              IMPLIES fixed?(G,phi)


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 157 2 158 65
body:
    sub_cycle     : LEMMA FORALL (w: Seq(H)): subgraph?(H,G) and cycle?(H,w) 
                                                IMPLIES cycle?(G,w)


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 160 2 161 74
body:
    exclus_cycl   : THEOREM connected?(G) IMPLIES 
                               tree?(G) XOR (EXISTS (w:Seq(G)): cycle?(G,w))


decl_type: formula
theory: mappings
library: graphs
signature: nil
location: 163 2 164 80
body:
    deg_gt_1_cycle: LEMMA (FORALL (v: T): vert(G)(v) IMPLIES deg(v,G) > 1)
                            IMPLIES (EXISTS (w: Seq(G)): cycle?(G,w)) OR empty?(G)


decl_type: type
theory: mappings
library: graphs
signature: nil
location: 13 2 14 71
body:
    premap(G1,G2): TYPE = {psi:[T -> T]| FORALL (x:T):
                                    vert(G1)(x) IMPLIES vert(G2)(psi(x))}


decl_type: type
theory: mappings
library: graphs
signature: nil
location: 16 2 18 75
body:
    map(G1,G2)   : TYPE = {phi: premap(G1,G2) | FORALL (x,y: T):
                             edge?(G1)(x,y) IMPLIES
                                 edge?(G2)(phi(x),phi(y)) OR phi(x) = phi(y)} 


decl_type: function
theory: mappings
library: graphs
signature: [[G1: graph[T], G2: graph[T], map(G1, G2)] -> bool]
location: 20 2 22 47
body:
    proper?(G1:graph[T],G2:graph[T],M: map(G1,G2)): bool = 
                  (FORALL (x,y: T): edge?(G1)(x,y) IMPLIES
                            edge?(G2)(M(x),M(y)))


decl_type: function
theory: mappings
library: graphs
signature: [[G: graph[T], map(G, G)] -> bool]
location: 27 2 30 75
body:
    fixed?(G:graph[T], phi:map(G,G)):bool = (FORALL (v: (vert(G))):  
                                             v /= phi(v))
                             IMPLIES (EXISTS (x,y: (vert(G))): 
                                 y = phi(x) AND x = phi(y) AND edge?(G)(x,y))


decl_type: function
theory: mappings
library: graphs
signature: [[graph[T], T] -> finite_set[T]]
location: 32 2 33 78
body:
    reachable(G,x): finite_set[T] = {y: T |  vert(G)(y) AND 
                                      (EXISTS (w: Seq(G)): walk_from?(G,w,x,y))}


decl_type: function
theory: mappings
library: graphs
signature:
  [d: [Tr: Tree, v: (vert(Tr)), (incident_edges(v, Tr))] ->
  Subgraph[T](d`1)]

location: 86 2 87 73
body:
    Bush(Tr:Tree, v:(vert(Tr)), e:(incident_edges(v,Tr))): Subgraph(Tr) = 
                                  subgraph(Tr, reachable(del_edge(Tr,e),v))


decl_type: function
theory: mappings
library: graphs
signature:
  [[Tr: Tree, Subgraph[T](Tr), Subgraph[T](Tr), map(Tr, Tr)] ->
  bool]

location: 94 2 97 91
body:
    Fox(Tr:Tree, G: Subgraph(Tr), H: Subgraph(Tr), phi:map(Tr,Tr)): bool =
                     ( EXISTS w:path?(Tr,w) AND length(w)>1 AND 
                              phi(w(0))=w(length(w)-1) AND G = G_from(Tr,w) AND
                              H = Bush(Tr,w(length(w)-1),dbl(w(length(w)-2),w(length(w)-1))))


decl_type: function
theory: mappings
library: graphs
signature: [graph[T] -> bool]
location: 134 2 135 76
body:
    uniq_paths?(G): bool = FORALL (s,t,p,q): path_from?(G,p,s,t) AND
                                             path_from?(G,q,s,t) IMPLIES p = q


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 174 0 182 999
body:
  % Subtype TCC generated (at line 32, column 34) for
      % {y: T | vert(G)(y) AND (EXISTS (w: Seq(G)): walk_from?(G, w, x, y))}
      % expected type  finite_set[T]
  reachable_TCC1: OBLIGATION
    FORALL (G: graph[T], x: T):
      is_finite[T]
          ({y: T |
              vert(G)(y) AND
               (EXISTS (w: Seq[T](G)): walk_from?[T](G, w, x, y))});


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 184 0 187 999
body:
  % Subtype TCC generated (at line 72, column 61) for  p
      % expected type  Walk[T](G)
  size_subgraph_path_TCC1: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T]): path?(G, p) IMPLIES walk?[T](G, p);


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 189 0 194 999
body:
  % Subtype TCC generated (at line 96, column 34) for  0
      % expected type  below[length(w)]
  Fox_TCC1: OBLIGATION
    FORALL (Tr: Tree[T], G: Subgraph[T](Tr), H: Subgraph[T](Tr),
            phi: map(Tr, Tr), w):
      length(w) > 1 AND path?(Tr, w) IMPLIES 0 < length(w);


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 196 0 202 999
body:
  % Subtype TCC generated (at line 96, column 40) for  length(w) - 1
      % expected type  below[length(w)]
  Fox_TCC2: OBLIGATION
    FORALL (Tr: Tree[T], G: Subgraph[T](Tr), H: Subgraph[T](Tr),
            phi: map(Tr, Tr), w):
      length(w) > 1 AND path?(Tr, w) IMPLIES
       length(w) - 1 >= 0 AND length(w) - 1 < length(w);


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 204 0 211 999
body:
  % Subtype TCC generated (at line 96, column 71) for  w
      % expected type  Walk[T](Tr)
  Fox_TCC3: OBLIGATION
    FORALL (Tr: Tree[T], G: Subgraph[T](Tr), H: Subgraph[T](Tr),
            phi: map(Tr, Tr), w):
      phi(finseq_appl[T](w)(0)) = finseq_appl[T](w)(length(w) - 1) AND
       length(w) > 1 AND path?(Tr, w)
       IMPLIES walk?[T](Tr, w);


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 213 0 222 999
body:
  % Subtype TCC generated (at line 97, column 40) for
      % finseq_appl[T](w)(length(w) - 1)
      % expected type  (vert(Tr))
  Fox_TCC4: OBLIGATION
    FORALL (Tr: Tree[T], G: Subgraph[T](Tr), H: Subgraph[T](Tr),
            phi: map(Tr, Tr), w):
      G = G_from(Tr, w) AND
       phi(finseq_appl[T](w)(0)) = finseq_appl[T](w)(length(w) - 1) AND
        length(w) > 1 AND path?(Tr, w)
       IMPLIES vert(Tr)(finseq_appl[T](w)(length(w) - 1));


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 224 0 232 999
body:
  % Subtype TCC generated (at line 97, column 61) for  length(w) - 2
      % expected type  below[length(w)]
  Fox_TCC5: OBLIGATION
    FORALL (Tr: Tree[T], G: Subgraph[T](Tr), H: Subgraph[T](Tr),
            phi: map(Tr, Tr), w):
      G = G_from(Tr, w) AND
       phi(finseq_appl[T](w)(0)) = finseq_appl[T](w)(length(w) - 1) AND
        length(w) > 1 AND path?(Tr, w)
       IMPLIES length(w) - 2 >= 0 AND length(w) - 2 < length(w);


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 234 0 256 999
body:
  % Subtype TCC generated (at line 97, column 55) for
      % dbl(finseq_appl[T](w)(length(w) - 2),
      %     finseq_appl[T](w)(length(w) - 1))
      % expected type  (incident_edges(finseq_appl[T](w)(length(w) - 1), Tr))
  Fox_TCC6: OBLIGATION
    FORALL (Tr: Tree[T], G: Subgraph[T](Tr), H: Subgraph[T](Tr),
            phi: map(Tr, Tr), w):
      G = G_from(Tr, w) AND
       phi(finseq_appl[T](w)(0)) = finseq_appl[T](w)(length(w) - 1) AND
        length(w) > 1 AND path?(Tr, w)
       IMPLIES
       (EXISTS (x: T), (y: T):
          x /= y AND
           dbl[T]
               (finseq_appl[T](w)(length(w) - 2),
                finseq_appl[T](w)(length(w) - 1))
            = dbl[T](x, y))
        AND
        incident_edges[T]
            (finseq_appl[T](w)(length(w) - 1), Tr)
            (dbl[T]
                 (finseq_appl[T](w)(length(w) - 2),
                  finseq_appl[T](w)(length(w) - 1)));


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 258 0 262 999
body:
  % Subtype TCC generated (at line 104, column 27) for  1
      % expected type  below[length(w)]
  back_hound_TCC1: OBLIGATION
    FORALL (w: prewalk[T], x: T, Tr: Tree[T], phi: map(Tr, Tr)):
      length(w) = 2 AND path_from?(Tr, w, x, phi(x)) IMPLIES 1 < length(w);


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 264 0 269 999
body:
  % Subtype TCC generated (at line 104, column 33) for  length(w) - 2
      % expected type  below[length(w)]
  back_hound_TCC2: OBLIGATION
    FORALL (w: prewalk[T], x: T, Tr: Tree[T], phi: map(Tr, Tr)):
      length(w) = 2 AND path_from?(Tr, w, x, phi(x)) IMPLIES
       length(w) - 2 >= 0 AND length(w) - 2 < length(w);


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 271 0 275 999
body:
  % Subtype TCC generated (at line 107, column 72) for  1
      % expected type  below[length(w)]
  stuck_hound_TCC1: OBLIGATION
    FORALL (w: prewalk[T], x: T, Tr: Tree[T], phi: map(Tr, Tr)):
      length(w) > 1 AND path_from?(Tr, w, x, phi(x)) IMPLIES 1 < length(w);


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 277 0 282 999
body:
  % Subtype TCC generated (at line 107, column 78) for  length(w) - 1
      % expected type  below[length(w)]
  stuck_hound_TCC2: OBLIGATION
    FORALL (w: prewalk[T], x: T, Tr: Tree[T], phi: map(Tr, Tr)):
      length(w) > 1 AND path_from?(Tr, w, x, phi(x)) IMPLIES
       length(w) - 1 >= 0 AND length(w) - 1 < length(w);


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 284 0 297 999
body:
  % Subtype TCC generated (at line 111, column 48) for  length(p) - 2
      % expected type  below[length(p)]
  stuck_hound_TCC3: OBLIGATION
    FORALL (w: prewalk[T], x: T, Tr: Tree[T], phi: map(Tr, Tr)):
      path_from?(Tr, w, x, phi(x)) AND
       length(w) > 1 AND
        phi(finseq_appl[T](w)(1)) = finseq_appl[T](w)(length(w) - 1)
       IMPLIES
       (FORALL (p: prewalk[T]):
          length(p) > 1 AND
           length(p) < length(w) AND
            path_from?(Tr, p, finseq_appl[T](w)(1),
                       phi(finseq_appl[T](w)(1)))
           IMPLIES length(p) - 2 >= 0 AND length(p) - 2 < length(p));


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 299 0 312 999
body:
  % Subtype TCC generated (at line 111, column 63) for  length(w) - 2
      % expected type  below[length(w)]
  stuck_hound_TCC4: OBLIGATION
    FORALL (w: prewalk[T], x: T, Tr: Tree[T], phi: map(Tr, Tr)):
      path_from?(Tr, w, x, phi(x)) AND
       length(w) > 1 AND
        phi(finseq_appl[T](w)(1)) = finseq_appl[T](w)(length(w) - 1)
       IMPLIES
       (FORALL (p: prewalk[T]):
          length(p) > 1 AND
           length(p) < length(w) AND
            path_from?(Tr, p, finseq_appl[T](w)(1),
                       phi(finseq_appl[T](w)(1)))
           IMPLIES length(w) - 2 >= 0 AND length(w) - 2 < length(w));


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 314 0 318 999
body:
  % Subtype TCC generated (at line 115, column 27) for  1
      % expected type  below[length(w)]
  whole_hound_TCC1: OBLIGATION
    FORALL (w: prewalk[T], x: T, Tr: Tree[T], phi: map(Tr, Tr)):
      length(w) > 2 AND path_from?(Tr, w, x, phi(x)) IMPLIES 1 < length(w);


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 320 0 325 999
body:
  % Subtype TCC generated (at line 115, column 33) for  length(w) - 2
      % expected type  below[length(w)]
  whole_hound_TCC2: OBLIGATION
    FORALL (w: prewalk[T], x: T, Tr: Tree[T], phi: map(Tr, Tr)):
      length(w) > 2 AND path_from?(Tr, w, x, phi(x)) IMPLIES
       length(w) - 2 >= 0 AND length(w) - 2 < length(w);


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 327 0 340 999
body:
  % Subtype TCC generated (at line 118, column 41) for  length(p) - 2
      % expected type  below[length(p)]
  whole_hound_TCC3: OBLIGATION
    FORALL (w: prewalk[T], x: T, Tr: Tree[T], phi: map(Tr, Tr)):
      path_from?(Tr, w, x, phi(x)) AND
       length(w) > 2 AND
        phi(finseq_appl[T](w)(1)) = finseq_appl[T](w)(length(w) - 2)
       IMPLIES
       (FORALL (p: prewalk[T]):
          length(p) > 1 AND
           length(p) < length(w) AND
            path_from?(Tr, p, finseq_appl[T](w)(1),
                       phi(finseq_appl[T](w)(1)))
           IMPLIES length(p) - 2 >= 0 AND length(p) - 2 < length(p));


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 342 0 355 999
body:
  % Subtype TCC generated (at line 118, column 56) for  length(w) - 3
      % expected type  below[length(w)]
  whole_hound_TCC4: OBLIGATION
    FORALL (w: prewalk[T], x: T, Tr: Tree[T], phi: map(Tr, Tr)):
      path_from?(Tr, w, x, phi(x)) AND
       length(w) > 2 AND
        phi(finseq_appl[T](w)(1)) = finseq_appl[T](w)(length(w) - 2)
       IMPLIES
       (FORALL (p: prewalk[T]):
          length(p) > 1 AND
           length(p) < length(w) AND
            path_from?(Tr, p, finseq_appl[T](w)(1),
                       phi(finseq_appl[T](w)(1)))
           IMPLIES length(w) - 3 >= 0 AND length(w) - 3 < length(w));


decl_type: tcc
theory: mappings
library: graphs
signature: nil
location: 357 0 361 999
body:
  % Subtype TCC generated (at line 158, column 63) for  w
      % expected type  Seq[T](G)
  sub_cycle_TCC1: OBLIGATION
    FORALL (G, H: graph[T], w: Seq[T](H)):
      subgraph?(H, G) AND cycle?(H, w) IMPLIES verts_in?[T](G, w);


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 53 0 54 54
body:
  exst_tri: LEMMA (edge?(G)(x,y) AND common_neighbor?(G)(x,y)
                                   IMPLIES tri?(G)(x,y))


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 60 0 61 62
body:
  disj_neighbor_sets: LEMMA ( disjoint?(adjacent(G,x), adjacent(G,y)) 
                           IMPLIES NOT common_neighbor?(G)(x,y))


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 67 0 68 63
body:
  no_cn: LEMMA NOT common_neighbor?(G)(x,y) 
                  IMPLIES disjoint?(adjacent(G,x), adjacent(G,y))


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 70 0 71 77
body:
  disj_adj_card: LEMMA disjoint?(adjacent(G,x), adjacent(G,y))
                       IMPLIES card(adjacent(G,x))+card(adjacent(G,y))<=size(G)


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 73 0 74 77
body:
  pre_edges_del21: LEMMA edges(G) = union(edges(del2_vert(G,x,y)),
                               union(incident_edges(x,G), incident_edges(y,G)))


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 76 0 77 77
body:
  pre_edges_del22: LEMMA disjoint?(edges(del2_vert(G,x,y)),
                               union(incident_edges(x,G), incident_edges(y,G)))


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 79 0 81 32
body:
  edges_del2: LEMMA  num_edges(del2_vert(G,x,y))+ 
                     card(union(incident_edges(x,G), incident_edges(y,G)))
                     =num_edges(G) 


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 83 0 84 60
body:
  verts_del2: LEMMA vert(G)(x) AND vert(G)(y) AND x/=y 
                    IMPLIES size(del2_vert(G,x,y)) = size(G)-2 


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 88 0 90 67
body:
  int_lem:    LEMMA edge?(G)(x,y) 
                    IMPLIES singleton?({e: doubleton[T] | 
                    (edges(G)(e) AND e(x)) AND edges(G)(e) AND e(y)}) 


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 92 0 94 71
body:
  card_union: LEMMA edge?(G)(x,y) IMPLIES 
                    card(union(incident_edges(x,G),incident_edges(y,G))) =
                    card(incident_edges(x,G))+card(incident_edges(y,G))-1


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 102 0 103 48
body:
  adj_helper2: LEMMA edges(G)=emptyset[doubleton[T]] 
                     IMPLIES card(adjacent(G,x))=0


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 105 0 107 36
body:
  inc_ind1: LEMMA edges(G)(e) AND NOT e(x) IMPLIES
                  incident_edges(x, del_edge(G,e)) = 
                  incident_edges(x, G)


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 108 0 110 29
body:
  adj_ind1: LEMMA edges(G)(e) AND NOT e(x) IMPLIES
                  adjacent(del_edge(G,e),x)=
                  adjacent(G,x)


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 111 0 113 44
body:
  inc_ind2: LEMMA edges(G)(e) AND e(x) IMPLIES
                  card(incident_edges(x, del_edge(G,e))) = 
                  card(incident_edges(x, G))-1


decl_type: formula
theory: mantel
library: graphs
signature: nil
location: 114 0 116 37
body:
  adj_ind2: LEMMA edges(G)(e) AND e(x) IMPLIES
                 card(adjacent(del_edge(G,e),x))=
                  card(adjacent(G,x))-1


decl_type: function
theory: mantel
library: graphs
signature: [graph[T] -> [[T, T, T] -> bool]]
location: 31 0 32 80
body:
  tri?(G)(x,y,z): bool = vert(G)(x) AND vert(G)(y) AND vert(G)(z) 
  AND x/=y AND y/=z AND x/=z AND edge?(G)(x,y) AND edge?(G)(y,z) AND edge?(G)(x,z)


decl_type: function
theory: mantel
library: graphs
signature: [graph[T] -> [[T, T] -> bool]]
location: 40 0 41 68
body:
  common_neighbor?(G)(x,y): bool = EXISTS z: x/=z AND y/=z 
                                   AND edge?(G)(x,z) AND edge?(G)(y,z) 


decl_type: formula
theory: sep_set_lems
library: graphs
signature: nil
location: 13 3 14 57
body:
     sep_num_0: LEMMA separable?(G,s,t) AND sep_num(G, s, t) = 0 IMPLIES
                            separates(G, emptyset[T], s, t)


decl_type: formula
theory: sep_set_lems
library: graphs
signature: nil
location: 16 3 18 72
body:
     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))


decl_type: formula
theory: sep_set_lems
library: graphs
signature: nil
location: 21 3 24 56
body:
     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(length(p))): seq(p)(i) = v))
                               IMPLIES sep_num(G,s,t) <= 1


decl_type: formula
theory: sep_set_lems
library: graphs
signature: nil
location: 27 3 32 77
body:
     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))


decl_type: formula
theory: sep_set_lems
library: graphs
signature: nil
location: 39 3 40 59
body:
     sep_num_comm:    LEMMA vert(G)(s) AND vert(G)(t) IMPLIES
                              sep_num(G,s,t) = sep_num(G,t,s)


decl_type: formula
theory: sep_set_lems
library: graphs
signature: nil
location: 43 3 45 59
body:
     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)


decl_type: formula
theory: sep_set_lems
library: graphs
signature: nil
location: 48 3 53 81
body:
     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))


decl_type: formula
theory: sep_set_lems
library: graphs
signature: nil
location: 57 3 62 61
body:
     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)))


decl_type: formula
theory: los_graph
library: graphs
signature: nil
location: 7 0 12 44
body:
  los_graphic: LEMMA (FORALL x,y,z: P(x,y)&P(y,z)=>P(x,z)) &
          (FORALL x,y: P(x,y) => P(y,x)) &
          (FORALL x,y,z: Q(x,y)&Q(y,z)=>Q(x,z)) &
          (FORALL x,y: Q(x,y) => Q(y,x)) &
          (FORALL x,y: P(x,y) OR Q(x,y)) =>
          (FORALL x,y:P(x,y)) OR (FORALL x,y: Q(x,y))


decl_type: formula
theory: los_graph
library: graphs
signature: nil
location: 25 0 29 44
body:
  Los: LEMMA (FORALL x,y,z: P(x,y)&P(y,z)=>P(x,z)) &
          (FORALL x,y,z: Q(x,y)&Q(y,z)=>Q(x,z)) &
          (FORALL x,y: Q(x,y) => Q(y,x)) &
          (FORALL x,y: P(x,y) OR Q(x,y)) =>
          (FORALL x,y:P(x,y)) OR (FORALL x,y: Q(x,y))


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 59 2 60 61
body:
    path_or_not_path: THEOREM empty?(G) OR path_connected?(G) 
                              OR path_connected?(complement(G))


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 64 2 68 90
body:
    five_degrees_separation: PROPOSITION 
                             FORALL (x,y: (vert(G))): x = y 
                             OR (EXISTS w: walk_from?(G,w,x,y) and length(w)<5) 
                             OR FORALL (x,y: (vert(G))): x = y
                             OR (EXISTS w: walk_from?(complement(G),w,x,y) and length(w)<4 )


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 77 2 82 90
body:
    five_degrees_separated: PROPOSITION 
                            (FORALL (x,y: (vert(G))): 
                                EXISTS w: walk_from?(G,w,x,y) AND length(w) < 5) 
                         OR
                            (FORALL (x,y: (vert(G))): 
                                EXISTS w: walk_from?(complement(G),w,x,y) AND length(w) < 4)


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 116 2 118 61
body:
    trans_complem: LEMMA vert(G)=vert(H) AND strong_transitive?(G) 
                         AND strong_transitive?(H) AND union(G,H)=completion(G) 
                     IMPLIES G=completion(G) or H=completion(G)


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 126 2 127 84
body:
    t_close_1: LEMMA H=t_close(G) 
                     IMPLIES vert(H)=vert(G) AND super(G)(H) AND strong_transitive?(H)


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 129 2 131 58
body:
    t_close_2: LEMMA H=t_close(G) AND super(G)(K) AND strong_transitive?(K) 
                     AND vert(K)=vert(G) 
                  IMPLIES num_edges[T](H) <= num_edges[T](K)


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 135 2 136 70
body:
    trans_fill: LEMMA vert(G)=vert(H) AND union(G,H)=completion(G) 
                      IMPLIES union(t_close(G),t_close(H))=completion(G)


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 138 2 139 84
body:
    complem_fill: THEOREM vert(G)=vert(H) AND  union(G,H)=completion(G) 
                          IMPLIES t_close(G)=completion(G) or t_close(H)=completion(G)


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 144 2 145 44
body:
    subgraph_conn: LEMMA subgraph?[T](H,G) AND connected?(H) AND vert(H)=vert(G) 
                         IMPLIES connected?(G)


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 149 2 151 89
body:
    short_path     : LEMMA path_from?(G,p,x,y) AND length(p)>2 
                         AND edge?(G)(seq(p)(length(p)-3),seq(p)(length(p)-1)) 
                       IMPLIES (EXISTS p1: path_from?(G,p1,x,y) AND length(p1)=length(p)-1)


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 153 2 154 48
body:
    trans_walk     : LEMMA strong_transitive?(G) AND walk_from?(G,w,x,y) 
                      IMPLIES x=y or edge?(G)(x,y)


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 156 2 157 50
body:
    trans_connected: THEOREM strong_transitive?(G) AND connected?(G) 
                             IMPLIES G=completion(G)


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 159 2 160 74
body:
    disjoint_trans : LEMMA empty?(intersection(vert(H),vert(K))) AND transitive?(H) 
                          AND transitive?(K) IMPLIES transitive?(union(H,K))


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 162 2 164 65
body:
    disjoint_trans_strong: LEMMA empty?(intersection(vert(H),vert(K))) 
                                 AND strong_transitive?(H) AND strong_transitive?(K) 
                             IMPLIES strong_transitive?(union(H,K))


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 166 2 167 60
body:
    subgraph_trans  : LEMMA subset?(V,vert(G)) AND transitive?(G) 
                            IMPLIES transitive?(subgraph(G,V))


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 169 2 170 72
body:
    subgraph_trans_strong: LEMMA subset?(V,vert(G)) AND strong_transitive?(G) 
                                 IMPLIES strong_transitive?(subgraph(G,V))


decl_type: formula
theory: complem
library: graphs
signature: nil
location: 172 2 174 43
body:
    t_close_4       : LEMMA subgraph?[T](G,K) AND subgraph?[T](K,t_close(G))
                            AND strong_transitive?(K) 
                         IMPLIES K=t_close(G)


decl_type: function
theory: complem
library: graphs
signature: [finite_set[T] -> set[doubleton[T]]]
location: 17 2 19 65
body:
    all_edges(V):set[doubleton[T]] =
             {d: doubleton[T] | EXISTS (x,y: T): x /=y AND d = dbl[T](x,y) 
                                                 AND V(x) AND V(y)}


decl_type: function
theory: complem
library: graphs
signature: [graph[T] -> graph[T]]
location: 26 2 28 51
body:
    completion(G: graph[T]): graph[T] = 
                    (# vert  := vert(G),
                       edges := all_edges(vert(G)) #)


decl_type: function
theory: complem
library: graphs
signature: [graph[T] -> graph[T]]
location: 34 2 36 72
body:
    complement(G: graph[T]): graph[T] = 
                    (# vert := vert(G),
                       edges := difference(all_edges(vert(G)),edges(G)) #)


decl_type: function
theory: complem
library: graphs
signature: [graph[T] -> graph[T]]
location: 42 2 44 55
body:
    isol(G: graph[T]): graph[T] = 
                    (# vert := vert(G),
                       edges := emptyset[doubleton[T]] #)


decl_type: function
theory: complem
library: graphs
signature: [graph[T] -> bool]
location: 88 2 90 53
body:
    strong_transitive?(G): bool = FORALL (x,y,z:(vert(G))): 
                                     edge?(G)(x,y) AND edge?(G)(y,z) AND x /= z 
                                  IMPLIES edge?(G)(x,z)


decl_type: function
theory: complem
library: graphs
signature: [graph[T] -> bool]
location: 92 2 94 46
body:
    transitive?(G): bool = FORALL (x,y,z: T):
                              edge?(G)(x,y) AND edge?(G)(y,z) AND x /= z 
                           IMPLIES edge?(G)(x,z)


decl_type: function
theory: complem
library: graphs
signature: [graph[T] -> graph[T]]
location: 121 2 124 29
body:
    t_close(G): graph[T] = min[graph[T], num_edges[T],
                                 (LAMBDA (H: graph[T]): vert(H)=vert(G) AND super(G)(H) 
                                                        AND strong_transitive?(H))
                              ]


decl_type: function
theory: complem
library: graphs
signature: [graph[T] -> graph[T]]
location: 184 2 188 16
body:
    p_close(G): graph[T] = 
                (# vert:= vert(G), 
                   edges := {e:doubleton[T] | (FORALL (x,y:T): x /=y AND e(x) 
                             AND e(y) IMPLIES EXISTS (p:prewalk[T]): walk_from?(G,p,x,y))} 
                #)


decl_type: tcc
theory: complem
library: graphs
signature: nil
location: 207 0 210 999
body:
  % Subtype TCC generated (at line 28, column 30) for  all_edges(vert(G))
      % expected type  finite_set[doubleton[T]]
  completion_TCC1: OBLIGATION
    FORALL (G: graph[T]): is_finite[doubleton[T]](all_edges(vert(G)));


decl_type: tcc
theory: complem
library: graphs
signature: nil
location: 212 0 219 999
body:
  % Subtype TCC generated (at line 27, column 18) for
      % (# vert := vert(G), edges := all_edges(vert(G)) #)
      % expected type  graph[T]
  completion_TCC2: OBLIGATION
    FORALL (G: graph[T]):
      FORALL (e: doubleton[T]):
        all_edges(vert(G))(e) IMPLIES
         (FORALL (x: T): e(x) IMPLIES vert(G)(x));


decl_type: tcc
theory: complem
library: graphs
signature: nil
location: 221 0 227 999
body:
  % Subtype TCC generated (at line 36, column 30) for
      % difference(all_edges(vert(G)), edges(G))
      % expected type  finite_set[doubleton[T]]
  complement_TCC1: OBLIGATION
    FORALL (G: graph[T]):
      is_finite[doubleton[T]]
          (difference[doubleton[T]](all_edges(vert(G)), edges(G)));


decl_type: tcc
theory: complem
library: graphs
signature: nil
location: 229 0 237 999
body:
  % Subtype TCC generated (at line 35, column 18) for
      % (# vert := vert(G),
      %    edges := difference(all_edges(vert(G)), edges(G)) #)
      % expected type  graph[T]
  complement_TCC2: OBLIGATION
    FORALL (G: graph[T]):
      FORALL (e: doubleton[T]):
        difference[doubleton[T]](all_edges(vert(G)), edges(G))(e) IMPLIES
         (FORALL (x: T): e(x) IMPLIES vert(G)(x));


decl_type: tcc
theory: complem
library: graphs
signature: nil
location: 239 0 246 999
body:
  % Subtype TCC generated (at line 43, column 18) for
      % (# vert := vert(G), edges := emptyset[doubleton[T]] #)
      % expected type  graph[T]
  isol_TCC1: OBLIGATION
    FORALL (G: graph[T]):
      FORALL (e: doubleton[T]):
        emptyset[doubleton[T]](e) IMPLIES
         (FORALL (x: T): e(x) IMPLIES vert(G)(x));


decl_type: tcc
theory: complem
library: graphs
signature: nil
location: 248 0 257 999
body:
  % Assuming TCC generated (at line 121, column 25) for
      % min
      %     [graph[T], num_edges[T],
      %      (LAMBDA (H: graph[T]):
      %         vert(H) = vert(G) AND super(G)(H) AND strong_transitive?(H))]
      % generated from assumption abstract_min.T_ne
  t_close_TCC1: OBLIGATION
    FORALL (G: graph[T]):
      EXISTS (t: graph[T]):
        vert(t) = vert(G) AND super(G)(t) AND strong_transitive?(t);


decl_type: tcc
theory: complem
library: graphs
signature: nil
location: 259 0 264 999
body:
  % Subtype TCC generated (at line 150, column 43) for  length(p) - 3
      % expected type  below[p`length]
  short_path_TCC1: OBLIGATION
    FORALL (G: graph[T], p: walks[T].prewalk, x, y: T):
      path_from?(G, p, x, y) AND length(p) > 2 IMPLIES
       length(p) - 3 >= 0 AND length(p) - 3 < p`length;


decl_type: tcc
theory: complem
library: graphs
signature: nil
location: 266 0 271 999
body:
  % Subtype TCC generated (at line 150, column 63) for  length(p) - 1
      % expected type  below[p`length]
  short_path_TCC2: OBLIGATION
    FORALL (G: graph[T], p: walks[T].prewalk, x, y: T):
      path_from?(G, p, x, y) AND length(p) > 2 IMPLIES
       length(p) - 1 >= 0 AND length(p) - 1 < p`length;


decl_type: tcc
theory: complem
library: graphs
signature: nil
location: 273 0 285 999
body:
  % Subtype TCC generated (at line 186, column 26) for
      % {e: doubleton[T] |
      %    (FORALL (x, y: T):
      %       x /= y AND e(x) AND e(y) IMPLIES
      %        (EXISTS (p: prewalk[T]): walk_from?(G, p, x, y)))}
      % expected type  finite_set[doubleton[T]]
  p_close_TCC1: OBLIGATION
    FORALL (G: graph[T]):
      is_finite[doubleton[T]]
          ({e: doubleton[T] |
              FORALL (x, y: T):
                x /= y AND e(x) AND e(y) IMPLIES
                 (EXISTS (p: prewalk[T]): walk_from?[T](G, p, x, y))});


decl_type: tcc
theory: complem
library: graphs
signature: nil
location: 287 0 301 999
body:
  % Subtype TCC generated (at line 185, column 14) for
      % (# vert := vert(G),
      %    edges
      %      := {e: doubleton[T] |
      %            (FORALL (x, y: T):
      %               x /= y AND e(x) AND e(y) IMPLIES
      %                (EXISTS (p: prewalk[T]): walk_from?(G, p, x, y)))} #)
      % expected type  graph[T]
  p_close_TCC2: OBLIGATION
    FORALL (G: graph[T]):
      FORALL (e_1: doubleton[T]):
        (FORALL (x, y: T):
           x /= y AND e_1(x) AND e_1(y) IMPLIES
            (EXISTS (p: prewalk[T]): walk_from?[T](G, p, x, y)))
         IMPLIES (FORALL (x_1: T): e_1(x_1) IMPLIES vert(G)(x_1));


decl_type: formula
theory: ind_paths
library: graphs
signature: nil
location: 20 3 21 55
body:
     independent?_comm: LEMMA independent?(p1,p2) IMPLIES
                                      independent?(p2,p1)


decl_type: formula
theory: ind_paths
library: graphs
signature: nil
location: 36 3 42 77
body:
     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) )


decl_type: function
theory: ind_paths
library: graphs
signature: [[prewalk[T], prewalk[T]] -> bool]
location: 14 3 17 61
body:
     independent?(w1,w2: prewalk): bool = 
                         (FORALL (i,j: nat): i > 0 AND i < length(w1) - 1 AND
                                             j > 0 AND j < length(w2) - 1 IMPLIES
                                      seq(w1)(i) /= seq(w2)(j))


decl_type: function
theory: ind_paths
library: graphs
signature: [[G: graph[T], s: T, t: T, set_of_paths(G, s, t)] -> bool]
location: 31 3 34 69
body:
     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))


decl_type: function
theory: ind_paths
library: graphs
signature: [prewalk[T] -> finite_set[T]]
location: 44 3 45 83
body:
     internal_verts(w: prewalk): finite_set[T] = 
                 {t: T | (EXISTS (i: nat): i > 0 AND i < length(w) - 1 AND w(i) = t)}


decl_type: function
theory: ind_paths
library: graphs
signature: [[prewalk[T], prewalk[T]] -> bool]
location: 48 3 49 74
body:
     indep?(w1,w2: prewalk): bool = empty?(intersection(internal_verts(w1),
                                                        internal_verts(w2)))


decl_type: formula
theory: easy_menger
library: graphs
signature: nil
location: 13 3 16 52
body:
     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)


decl_type: formula
theory: easy_menger
library: graphs
signature: nil
location: 22 3 25 52
body:
     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)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 59 2 60 70
body:
    card_extension_W   : LEMMA subset?(V,W) IMPLIES 
                               card(extend[T,(W),bool,false](V))=card(V)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 81 3 82 75
body:
     sep_set_small: LEMMA B(G,s,t,k) AND green?(V,s,t) AND card(V) < k 
                          IMPLIES EXISTS p : path_from?(del_verts(G,V),p,s,t)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 92 2 94 87
body:
    smaller_tight : LEMMA separates(G,W,s,t) 
                          IMPLIES tight?(G,s,t,W)
                             OR EXISTS V :subset?(V,W) AND NOT V=W AND separates(G,V,s,t)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 96 2 97 89
body:
    small_tight   : LEMMA separates(G,W,s,t) IMPLIES
                          EXISTS V :subset?(V,W) AND separates(G,V,s,t) AND tight?(G,s,t,V)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 99 2 100 83
body:
    exists_tight  : LEMMA good?(G,s,t) IMPLIES 
                                     EXISTS V: separates(G,V,s,t) AND tight?(G,s,t,V)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 108 2 110 80
body:
    smaller_close : LEMMA separates(G,W,s,t) AND tight?(G,s,t,W) IMPLIES
                         close?(G,s,t,W) OR EXISTS V :subset?(V,W) AND 
                                NOT V=W AND separates(G,V,s,t) AND tight?(G,s,t,V)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 112 2 113 89
body:
    small_close   : LEMMA separates(G,W,s,t) IMPLIES
                          EXISTS V :subset?(V,W) AND separates(G,V,s,t) AND close?(G,s,t,V)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 115 2 116 80
body:
    exists_close: LEMMA good?(G,s,t) 
                          IMPLIES EXISTS V: separates(G,V,s,t) AND close?(G,s,t,V)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 118 2 119 75
body:
    closed_minimal: LEMMA separates(G,W,s,t) AND close?(G,s,t,W) 
                          AND subset?(V,W) AND separates(G,V,s,t) IMPLIES V=W


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 142 2 143 80
body:
    Hst_intersect: LEMMA separates(G,W,s,t) 
                         IMPLIES empty?(intersection(Hverts(G,W,s),Hverts(G,W,t)))       


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 145 2 146 63
body:
    subset_Ws: LEMMA good?(G,s,t) AND separates(G,W,s,t) AND NOT attached?(G,s,t,W) 
                     IMPLIES subset?(vert(Mgraph(G,W,s)),vert(G))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 148 2 149 63
body:
    subset_Wt: LEMMA good?(G,s,t) AND separates(G,W,s,t) AND NOT attached?(G,s,t,W) 
                     IMPLIES subset?(vert(Mgraph(G,W,t)),vert(G))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 151 2 153 54
body:
    size_Ws: LEMMA good?(G,s,t) AND separates(G,W,s,t) 
                   AND close?(G,s,t,W) AND NOT attached?(G,s,t,W) 
                   IMPLIES size(Mgraph(G,W,s)) < size(G)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 155 2 157 54
body:
    size_Wt: LEMMA good?(G,s,t) AND separates(G,W,s,t) 
                   AND close?(G,s,t,W) AND NOT attached?(G,s,t,W) 
                   IMPLIES size(Mgraph(G,W,t)) < size(G)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 162 2 163 47
body:
    Menger_hard: LEMMA (FORALL G:C_induct(G,s,t)) IMPLIES
                             (FORALL G: C(G,s,t))          %Proved from graph inductions.


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 173 2 174 52
body:
    subgraph_paths: LEMMA subgraph?(GG,G) AND path_from?(GG,p1,s,t) 
                          IMPLIES path_from?(G,p1,s,t)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 186 2 188 84
body:
    set_small_s: LEMMA B(G,s,t,k) AND good?(G,s,t) 
                       AND separates(G,W,s,t) AND green?(V,s,t) AND card(V) < k 
                       IMPLIES EXISTS p : path_from?(del_verts(Mgraph(G,W,s),V),p,s,t)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 190 2 192 84
body:
    set_small_t: LEMMA B(G,s,t,k) AND good?(G,s,t) AND separates(G,W,s,t) 
                       AND green?(V,s,t) AND card(V) < k 
                       IMPLIES EXISTS p : path_from?(del_verts(Mgraph(G,W,t),V),p,s,t)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 199 2 200 46
body:
    separ_sub: LEMMA subgraph?(GG,G) AND separates(G,V,s,t) 
                     IMPLIES separates(GG,V,s,t)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 202 2 203 67
body:
    separ_plus: LEMMA separates(del_vert(G,a),V,s,t) 
                      IMPLIES separates(G,add(a,V),s,t) or a=s or a=t


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 208 2 210 47
body:
    super_separ: LEMMA good?(G,s,t) AND subset?(V,W) 
                       AND green?(W,s,t) AND separates(G,V,s,t) 
                       IMPLIES separates(G,W,s,t)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 214 2 218 64
body:
    intermediate_subgraph: LEMMA (good?(G,s,t) AND subgraph?(H,G) AND green?(vert(H),s,t) 
                                  AND size(H)<=k AND k< size(G)-1) 
                            IMPLIES (EXISTS HH: (green?(vert(HH),s,t) AND 
                                                 subgraph?(H,HH) AND size(HH)=k AND 
                                                 subgraph?(HH,G)))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 220 2 223 80
body:
    intermediate_verts: LEMMA good?(G,s,t) AND green?(V,s,t) 
                              AND subset?(V,vert(G)) AND card(V)<=k AND k<size(G)-1 
                          IMPLIES (EXISTS W: subset?(V,W) AND card(W)=k AND 
                                             green?(W,s,t) AND subset?(W,vert(G)))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 227 2 231 76
body:
    one_wedge_s: LEMMA good?(G,s,t) 
                       AND path_from?(G,q,s,t) IMPLIES 
                               EXISTS k: k<length(q)-1 AND edge?(G)(s,seq(q)(k)) 
                       AND (FORALL j: j < length(q) AND edge?(G)(s, seq(q)(j)) IMPLIES j <= k) 
                       AND path_from?(G,gen_seq1(G,s) o q^(k,length(q)-1),s,t)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 233 2 236 56
body:
    one_edge_s: LEMMA good?(G,s,t) 
                      AND path_from?(G,q,s,t) IMPLIES EXISTS p:path_from?(G,p,s,t) 
                      AND FORALL (i: below(length(p))):( edge?(G)(s,seq(p)(i)) IMPLIES i=1)
                      AND subset?(verts_of(p),verts_of(q))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 246 2 248 93
body:
    short_path_k: LEMMA k>=1 AND B(G,s,t,k) IMPLIES EXISTS p:path_from?(G,p,s,t) AND
                         FORALL (i: below(length(p))): ((edge?(G)(s,seq(p)(i)) 
                                IMPLIES i=1) AND (edge?(G)(seq(p)(i),t) IMPLIES i=length(p)-2))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 257 2 260 68
body:
    ips_lem1: LEMMA (FORALL q,q1:(ips(q) IMPLIES V(second(q))) AND (ips(q) AND ips(q1) 
                            AND q /= q1 IMPLIES second(q) /= second(q1)))
                 IMPLIES subset?(image(second,ips),V) AND 
                         injective?(restrict[prewalk,(ips),T](second)) 


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 262 2 265 42
body:
    ips_lem2: LEMMA (FORALL q,q1:(ips(q) IMPLIES V(second(q))) AND (ips(q) 
                            AND ips(q1) AND q /= q1 IMPLIES second(q) /= second(q1))) 
                     AND card[prewalk](ips)=card[T](V) 
                 IMPLIES image(second,ips)=V 


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 272 3 278 68
body:
     inj_ips: LEMMA (FORALL (q,q1):(ips(q) IMPLIES V(second(q))) 
                                    AND (ips(q) AND ips(q1) AND q /= q1 IMPLIES
                                        second(q) /= second(q1)))
                    AND card[prewalk](ips)=card[T](V)
                 IMPLIES EXISTS (fq:[(V) -> prewalk]): image(fq,V)=ips AND 
                         (FORALL (v:(V)): second(fq(v))=v) AND 
                         (FORALL q2:ips(q2) IMPLIES fq(second(q2))=q2)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 280 2 281 56
body:
    long_ipss_paths: LEMMA good?(G,s,t) AND st_path_set?(Mgraph(G,W,s),s,t,ipss) 
                           AND ipss(p) IMPLIES length(p)>1 


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 283 2 284 70
body:
    ipss_W: LEMMA good?(G,s,t) AND st_path_set?(Mgraph(G,W,s),s,t,ipss) 
                  AND separates(G,W,s,t) AND ipss(p) IMPLIES W(secoo(p))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 286 2 287 56
body:
    long_ipst_paths: LEMMA good?(G,s,t) AND st_path_set?(Mgraph(G,W,t),s,t,ipss) 
                           AND ipss(p) IMPLIES length(p)>1


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 289 2 290 70
body:
    ipst_W: LEMMA good?(G,s,t) AND st_path_set?(Mgraph(G,W,t),s,t,ipss) 
                  AND separates(G,W,s,t) AND ipss(p) IMPLIES W(secpp(p))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 292 2 293 75
body:
    long_ipss_2: LEMMA good?(G,s,t) AND st_path_set?(Mgraph(G,W,s),s,t,ipss) 
                       AND ipss(p) AND separates(G,W,s,t) IMPLIES length(p)>2


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 295 2 296 75
body:
    long_ipst_2: LEMMA good?(G,s,t) AND st_path_set?(Mgraph(G,W,t),s,t,ipss) 
                       AND ipss(p) AND separates(G,W,s,t) IMPLIES length(p)>2  


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 298 2 303 76
body:
    ind_path_set_secoo: LEMMA good?(G,s,t) AND card[T](W)= card[prewalk](ipss) 
                              AND separates(G,W,s,t) AND ind_prewalk_set?(ipss) 
                              AND st_path_set?(Mgraph(G,W,s),s,t,ipss) 
                          IMPLIES image(secoo, ipss)=W AND 
                                 FORALL (q,q1):(ipss(q) AND ipss(q1) AND q /=q1 
                                                IMPLIES secoo(q) /= secoo(q1))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 306 2 311 80
body:
    ind_path_set_secpp: LEMMA good?(G,s,t) AND card[T](W)= card[prewalk](ipst) 
                              AND separates(G,W,s,t) AND ind_prewalk_set?(ipst) 
                              AND st_path_set?(Mgraph(G,W,t),s,t,ipst) 
                          IMPLIES image(secpp, ipst)=W 
                                  AND FORALL (q,q1):(ipst(q) AND ipst(q1) AND q /=q1 
                                                    IMPLIES secpp(q) /= secpp(q1))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 313 2 317 38
body:
    uniq_w_ipss:   LEMMA good?(G,s,t) AND card[T](W)= card[prewalk](ipss) 
                         AND ind_prewalk_set?(ipss) 
                         AND st_path_set?(Mgraph(G,W,s),s,t,ipss) AND separates(G,W,s,t) 
                         AND ipss(p) AND verts_of(p)(w) AND W(w) 
                      IMPLIES w=secoo(p)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 320 2 324 37
body:
    uniq_w_ipst:   LEMMA good?(G,s,t) AND card[T](W)= card[prewalk](ipst) 
                         AND ind_prewalk_set?(ipst) 
                         AND st_path_set?(Mgraph(G,W,t),s,t,ipst) AND separates(G,W,s,t) 
                         AND ipst(q) AND verts_of(q)(w) AND W(w) 
                     IMPLIES w=secpp(q) 


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 328 2 330 47
body:
    low_card_sep: LEMMA B(G,s,t,k) IMPLIES EXISTS W: separates(G,W,s,t) 
                           AND card(W)>=k AND FORALL V: (separates(G,V,s,t) 
                       IMPLIES card(V)>= card(W))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 332 2 333 86
body:
    smaller_ips : LEMMA j<=card[prewalk](ips) 
                        IMPLIES EXISTS ips1: subset?(ips1,ips) AND card[prewalk](ips1)=j


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 338 2 340 70
body:
    min_B       : LEMMA B(G,s,t,k) IMPLIES 
                          EXISTS (i,W): i>=k AND B(G,s,t,i) AND
                                        separates(G,W,s,t) AND card(W)=i


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 342 2 344 77
body:
    no_sep_req  : LEMMA (FORALL k,W: B(G,s,t,k) AND separates(G,W,s,t) 
                         AND card(W)=k IMPLIES many_ind(G,s,t,k)) 
                       IMPLIES (FORALL k: B(G,s,t,k) IMPLIES many_ind(G,s,t,k))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 346 2 347 59
body:
    k_sep_close : LEMMA FORALL k,W: B(G,s,t,k) AND separates(G,W,s,t) 
                        AND card(W)=k IMPLIES close?(G,s,t,W)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 349 2 352 77
body:
    p_Ht        : LEMMA good?(G,s,t) AND separates(G,W,s,t) 
                        AND path_from?(Mgraph(G,W,s),p,s,t) AND length(p)>2 
                        AND (FORALL w: W(w) AND verts_of(p)(w) IMPLIES w=secoo(p)) 
                     IMPLIES subset?(verts_of(p^(2,length(p)-1)),Hverts(G,W,t))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 354 2 357 77
body:
    q_Hs        : LEMMA good?(G,s,t) AND separates(G,W,s,t) 
                        AND path_from?(Mgraph(G,W,t),q,s,t) AND length(q)>2 
                        AND (FORALL w: W(w) AND verts_of(q)(w) IMPLIES w=secpp(q)) 
                     IMPLIES subset?(verts_of(q^(0,length(q)-3)),Hverts(G,W,s))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 359 2 372 78
body:
    disjoint_M_paths: LEMMA good?(G,s,t) AND close?(G,s,t,W) AND separates(G,W,s,t) 
                            AND card[T](W)= card[prewalk](ipss) 
                            AND card[T](W)= card[prewalk](ipst) 
                            AND st_path_set?(Mgraph(G,W,s),s,t,ipss) 
                            AND st_path_set?(Mgraph(G,W,t),s,t,ipst) 
                            AND ind_prewalk_set?(ipss) AND ind_prewalk_set?(ipst) 
                            AND ipss(p) AND ipst(q)
                      IMPLIES (secoo(p)=secpp(q) AND 
                               intersection(verts_of(p^(1,length(p)-1)),verts_of(q^(0,length(q)-2)))
                                  =singleton[T](secoo(p)) AND 
                               W(secoo(p))) 
                          OR (secoo(p) /= secpp(q) AND 
                              empty?(intersection(verts_of(p^(1,length(p)-1)),
                                                  verts_of(q^(0,length(q)-2)))))


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 382 3 387 77
body:
     sec_image: LEMMA good?(G,s,t) AND separates(G,W,s,t) AND image(second, ipss)=W 
                      AND injective?(LAMBDA (s: (ipss)): second(s))
                            IMPLIES 
                  EXISTS (tau:[(W) -> prewalk]): image(tau,W)=ipss 
                                               AND FORALL w:(W(w) 
                                                      IMPLIES second(tau(w))=w) 


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 389 3 393 70
body:
     Map_s    : LEMMA good?(G,s,t) AND separates(G,W,s,t) 
                      AND card[T](W)= card[prewalk](ipss) AND ind_prewalk_set?(ipss) 
                      AND st_path_set?(Mgraph(G,W,s),s,t,ipss) 
                 IMPLIES EXISTS (tau:[(W) -> prewalk]): image(tau,W)=ipss 
                            AND FORALL w: (W(w) IMPLIES secoo(tau(w))=w) 


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 395 3 399 70
body:
     Map_t    : LEMMA good?(G,s,t) AND separates(G,W,s,t) 
                      AND card[T](W)= card[prewalk](ipst) AND ind_prewalk_set?(ipst) 
                      AND st_path_set?(Mgraph(G,W,t),s,t,ipst) 
               IMPLIES EXISTS (tau:[(W) -> prewalk]): image(tau,W)=ipst 
                            AND FORALL w: (W(w) IMPLIES secpp(tau(w))=w) 


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 403 3 412 59
body:
     Mapper_ips:  LEMMA good?(G,s,t) AND close?(G,s,t,W) AND separates(G,W,s,t) 
                        AND card[T](W)= card[prewalk](ipss) 
                        AND card[T](W)= card[prewalk](ipst) 
                        AND st_path_set?(Mgraph(G,W,s),s,t,ipss) 
                        AND st_path_set?(Mgraph(G,W,t),s,t,ipst) 
                        AND ind_prewalk_set?(ipss) AND ind_prewalk_set?(ipst) 
                  IMPLIES EXISTS (phi:[(W) -> prewalk]): 
                               card[prewalk](image(phi,W))=card[T](W) AND 
                               st_path_set?(G,s,t,image(phi,W)) AND 
                               ind_prewalk_set?(image(phi,W)) 


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 414 3 417 75
body:
     non_attached_induct: LEMMA good?(G,s,t) AND separates(G,W,s,t) AND B(G,s,t,k) 
                                AND card[T](W)=k 
                                AND (FORALL GG: size(GG)<size(G) IMPLIES C(GG,s,t)) 
                              IMPLIES many_ind(G,s,t,k) or attached?(G,s,t,W)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 419 3 420 72
body:
     plus_sep_vert : LEMMA good?(G,s,t) AND separates(del_vert(G,a),W,s,t) 
                           IMPLIES separates(G,add(a,W),s,t) or a=s or a=t


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 422 3 423 75
body:
     separ_del_vert: LEMMA separates(G,W,s,t) 
                           IMPLIES separates(G,remove(x,W),s,t) OR vert(G)(x)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 425 3 430 62
body:
     plus_path_set : LEMMA good?(G,s,t) AND path_from?(G,q,s,t) 
                           AND st_path_set?(del_verts(G,verts_of(q^(1,length(q)-2))),s,t,ips) 
                           AND ind_prewalk_set?(ips) 
                     IMPLIES EXISTS ipss: card[prewalk](ipss)= card[prewalk](ips)+1 AND
                                          st_path_set?(G,s,t,ipss) AND 
                                          ind_prewalk_set?(ipss)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 432 3 438 72
body:
     short_path_attach: LEMMA B(G,s,t,k) AND separates(G,W,s,t) AND card[T](W)=k 
                              AND (FORALL V: separates(G,V,s,t) 
                              AND card[T](V)=k  IMPLIES attached?(G,s,t,V)) 
                              AND (FORALL GG: size(GG)<size(G) IMPLIES C(GG,s,t)) 
                     IMPLIES many_ind(G,s,t,k) 
                             OR EXISTS a: edge?(G)(s,a) AND (edge?(G)(a,t) 
                             OR EXISTS c: edge?(G)(a,c) AND edge?(G)(c,t))    


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 440 3 442 42
body:
     bridge_one  : LEMMA edge?(G)(s,a) AND edge?(G)(a,t) 
                         AND (FORALL GG: size(GG)<size(G) IMPLIES C(GG,s,t)) 
                     IMPLIES B_many(G,s,t,k)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 444 3 447 42
body:
     bridge_two  : LEMMA k>=1 AND edge?(G)(s,a) AND edge?(G)(a,c) AND edge?(G)(c,t) 
                         AND  B(del_verts(G,dbl[T](a,c)),s,t,k-1) 
                         AND (FORALL GG: size(GG)<size(G) IMPLIES C(GG,s,t)) 
                     IMPLIES B_many(G,s,t,k)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 449 3 454 59
body:
     bridge_three: LEMMA  k>=1 AND edge?(G)(s,a) AND edge?(G)(a,c) AND edge?(G)(c,t) 
                          AND B(G,s,t,k) AND separates(G,W,s,t) AND card[T](W)=k 
                          AND (FORALL V: separates(G,V,s,t) 
                          AND card[T](V)=k IMPLIES attached?(G,s,t,V)) 
                    IMPLIES B(del_verts(G,dbl[T](a,c)),s,t,k-1) 
                            OR edge?(G)(s,c) OR edge?(G)(a,t)    


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 468 3 472 54
body:
     Many_indep_paths: THEOREM good?(G,s,t) AND k<=size(G)-2 
                               AND (FORALL W: card[T](W)=k 
                               AND subset?(W,difference(vert(G), dbl(s,t))) 
                                      IMPLIES EXISTS q: walk_from?(del_verts(G,W),q,s,t)) 
                             IMPLIES many_ind(G,s,t,k+1)


decl_type: formula
theory: k_menger
library: graphs
signature: nil
location: 480 3 484 78
body:
     hard_menger_trad: THEOREM  separable?(G,s,t) AND sep_num(G,s,t) = k 
                                AND vert(G)(s) AND vert(G)(t) 
                          IMPLIES
                              (EXISTS (ips: set_of_paths(G,s,t)):
                                     card(ips) = k AND ind_path_set?(G,s,t,ips))


decl_type: function
theory: k_menger
library: graphs
signature: [set_of_prewalks -> bool]
location: 31 3 34 69
body:
     ind_prewalk_set?(ips): bool = 
                     (FORALL (p1,p2): 
                               ips(p1) AND ips(p2) AND  p1 /= p2
                                           IMPLIES independent?(p1,p2))


decl_type: function
theory: k_menger
library: graphs
signature: [[graph[T], T, T, nat] -> bool]
location: 37 3 39 66
body:
     many_ind(G,s,t,j):bool = EXISTS (ips): ind_prewalk_set?(ips) 
                                            AND st_path_set?(G,s,t,ips) 
                                            AND card[prewalk](ips)=j


decl_type: function
theory: k_menger
library: graphs
signature: [[graph[T], T, T, finite_set[T]] -> bool]
location: 102 2 104 89
body:
    close?(G,s,t,W): bool = FORALL (w:T) :  W(w) 
                            IMPLIES EXISTS p: path_from?(G,p,s,t) 
                                      AND intersection(W,internal_verts(p))=singleton[T](w)


decl_type: function
theory: k_menger
library: graphs
signature: [[graph[T], T, T, finite_set[T]] -> bool]
location: 123 2 124 67
body:
    attached?(G,s,t,W): bool = (FORALL w: W(w) IMPLIES edge?(G)(s,w)) OR 
                               (FORALL w: W(w) IMPLIES edge?(G)(t,w))


decl_type: function
theory: k_menger
library: graphs
signature: [[finite_set[T], T] -> finite_set[doubleton[T]]]
location: 126 2 127 77
body:
    attach_edges(W,x): finite_set[doubleton[T]] 
                           = {e :doubleton[T]|EXISTS w: W(w) AND e=dbl[T](w,x)}


decl_type: function
theory: k_menger
library: graphs
signature: [[graph[T], finite_set[T], T] -> graph[T]]
location: 135 2 138 27
body:
    Mgraph(G,W,x):graph = (# vert :=  add(x,vert(Kgraph(G,W,x))), 
                             edges := union(edges(Kgraph(G,W,x)),
                                            attach_edges(intersection(vert(G),W),x))
                           #)


decl_type: function
theory: k_menger
library: graphs
signature: [[graph[T], T, T] -> bool]
location: 159 2 160 46
body:
    C_induct(G,s,t):bool = (FORALL GG: size(GG)<size(G) IMPLIES C(GG,s,t))
                                IMPLIES C(G,s,t)


decl_type: function
theory: k_menger
library: graphs
signature: [[prewalk[T], finite_set[T], nat] -> bool]
location: 176 2 177 72
body:
    greatest?(p,V,i): bool = i<length(p) AND V(seq(p)(i)) AND 
                      FORALL j:(j<length(p) AND V(seq(p)(j)) IMPLIES j<=i)


decl_type: function
theory: k_menger
library: graphs
signature: [[prewalk[T], finite_set[T], nat] -> bool]
location: 179 2 180 37
body:
    least?(p,V,i): bool = i<length(p) AND V(seq(p)(i)) AND FORALL j:(j<length(p) AND V(seq(p)(j)) 
                          IMPLIES j>=i)


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 493 0 499 999
body:
  % Subtype TCC generated (at line 127, column 27) for
      % {e: doubleton[T] | EXISTS w: W(w) AND e = dbl[T](w, x)}
      % expected type  finite_set[doubleton[T]]
  attach_edges_TCC1: OBLIGATION
    FORALL (W: finite_set[T], x: T):
      is_finite[doubleton[T]]
          ({e: doubleton[T] | EXISTS w: W(w) AND e = dbl[T](w, x)});


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 501 0 506 999
body:
  % Subtype TCC generated (at line 131, column 33) for
      % path_verts(del_verts(G, W), x)
      % expected type  finite_set[T]
  Hverts_TCC1: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], x: T):
      is_finite[T](path_verts[T](del_verts[T](G, W), x));


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 508 0 523 999
body:
  % Subtype TCC generated (at line 135, column 24) for
      % (# vert := add(x, vert(Kgraph(G, W, x))),
      %    edges
      %      := union(edges(Kgraph(G, W, x)),
      %               attach_edges(intersection(vert(G), W), x)) #)
      % expected type  graph[T]
  Mgraph_TCC1: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], x: T):
      FORALL (e: doubleton[T]):
        union[doubleton[T]]
            (edges(Kgraph(G, W, x)),
             attach_edges(intersection[T](vert(G), W), x))
            (e)
         IMPLIES
         (FORALL (x_1: T):
            e(x_1) IMPLIES add[T](x, vert(Kgraph(G, W, x)))(x_1));


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 525 0 530 999
body:
  % Subtype TCC generated (at line 229, column 75) for  k
      % expected type  below[q`length]
  one_wedge_s_TCC1: OBLIGATION
    FORALL (G: graph[T], q: prewalk[T], s, t: T):
      path_from?(G, q, s, t) AND good?(G, s, t) IMPLIES
       (FORALL (k): k < length(q) - 1 IMPLIES k < q`length);


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 532 0 540 999
body:
  % Subtype TCC generated (at line 231, column 49) for  s
      % expected type  (vert(G))
  one_wedge_s_TCC2: OBLIGATION
    FORALL (G: graph[T], q: prewalk[T], s, t: T):
      path_from?(G, q, s, t) AND good?(G, s, t) IMPLIES
       (FORALL (k):
          (FORALL j: j < length(q) AND edge?(G)(s, seq(q)(j)) IMPLIES j <= k)
           AND edge?(G)(s, seq(q)(k)) AND k < length(q) - 1
           IMPLIES vert(G)(s));


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 542 0 550 999
body:
  % Subtype TCC generated (at line 231, column 59) for  length(q) - 1
      % expected type  nat
  one_wedge_s_TCC3: OBLIGATION
    FORALL (G: graph[T], q: prewalk[T], s, t: T):
      path_from?(G, q, s, t) AND good?(G, s, t) IMPLIES
       (FORALL (k):
          (FORALL j: j < length(q) AND edge?(G)(s, seq(q)(j)) IMPLIES j <= k)
           AND edge?(G)(s, seq(q)(k)) AND k < length(q) - 1
           IMPLIES length(q) - 1 >= 0);


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 552 0 562 999
body:
  % Subtype TCC generated (at line 231, column 38) for
      % gen_seq1(G, s) o q ^ (k, length(q) - 1)
      % expected type  prewalk[T]
  one_wedge_s_TCC4: OBLIGATION
    FORALL (G: graph[T], q: prewalk[T], s, t: T):
      path_from?(G, q, s, t) AND good?(G, s, t) IMPLIES
       (FORALL (k):
          (FORALL j: j < length(q) AND edge?(G)(s, seq(q)(j)) IMPLIES j <= k)
           AND edge?(G)(s, seq(q)(k)) AND k < length(q) - 1
           IMPLIES
           length(o[T](gen_seq1[T](G, s), ^[T](q, (k, length(q) - 1)))) > 0);


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 564 0 567 999
body:
  % Subtype TCC generated (at line 268, column 40) for  1
      % expected type  below[length(p)]
  secoo_TCC1: OBLIGATION
    FORALL (p: prewalk[T] | length(p) > 1): 1 < length(p);


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 569 0 573 999
body:
  % Subtype TCC generated (at line 270, column 38) for  length(p) - 2
      % expected type  below[length(p)]
  secpp_TCC1: OBLIGATION
    FORALL (p: prewalk[T] | length(p) > 1):
      length(p) - 2 >= 0 AND length(p) - 2 < length(p);


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 575 0 589 999
body:
  % Subtype TCC generated (at line 278, column 53) for  second(q2)
      % expected type  (V)
  inj_ips_TCC1: OBLIGATION
    FORALL (V: finite_set[T], ips: set_of_prewalks,
            second: [prewalk[T] -> T]):
      (card[prewalk](ips) = card[T](V) AND
        (FORALL (q, q1):
           (ips(q) IMPLIES V(second(q))) AND
            (ips(q) AND ips(q1) AND q /= q1 IMPLIES
              second(q) /= second(q1))))
       IMPLIES
       (FORALL (fq: [(V) -> prewalk[T]]):
          (FORALL (v: (V)): second(fq(v)) = v) AND
           image(fq, restrict[T, (V), boolean](V)) = ips
           IMPLIES (FORALL (q2): ips(q2) IMPLIES V(second(q2))));


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 591 0 599 999
body:
  % Subtype TCC generated (at line 284, column 67) for  p
      % expected type  {p: prewalk | length(p) > 1}
  ipss_W_TCC1: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss: set_of_prewalks,
            p: prewalk[T], s, t: T):
      ipss(p) AND
       separates(G, W, s, t) AND
        st_path_set?(Mgraph(G, W, s), s, t, ipss) AND good?(G, s, t)
       IMPLIES length(p) > 1;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 601 0 609 999
body:
  % Subtype TCC generated (at line 290, column 67) for  p
      % expected type  {p: prewalk | length(p) > 1}
  ipst_W_TCC1: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss: set_of_prewalks,
            p: prewalk[T], s, t: T):
      ipss(p) AND
       separates(G, W, s, t) AND
        st_path_set?(Mgraph(G, W, t), s, t, ipss) AND good?(G, s, t)
       IMPLIES length(p) > 1;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 611 0 625 999
body:
  % Subtype TCC generated (at line 303, column 72) for  q1
      % expected type  {p: prewalk | length(p) > 1}
  ind_path_set_secoo_TCC1: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss: set_of_prewalks, s, t: T):
           st_path_set?(Mgraph(G, W, s), s, t, ipss)
       AND ind_prewalk_set?(ipss) AND separates(G, W, s, t)
       AND card[T](W) = card[prewalk](ipss) AND good?(G, s, t)
       AND image(secoo,
                 restrict
                     [prewalk[T], {p: prewalk[T] | length(p) > 1}, boolean]
                     (ipss))
            = W
       IMPLIES
       (FORALL (q: prewalk[T], q1: prewalk[T]):
          ipss(q) AND ipss(q1) AND q /= q1 IMPLIES length(q1) > 1);


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 627 0 641 999
body:
  % Subtype TCC generated (at line 311, column 76) for  q1
      % expected type  {p: prewalk | length(p) > 1}
  ind_path_set_secpp_TCC1: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipst: set_of_prewalks, s, t: T):
           st_path_set?(Mgraph(G, W, t), s, t, ipst)
       AND ind_prewalk_set?(ipst) AND separates(G, W, s, t)
       AND card[T](W) = card[prewalk](ipst) AND good?(G, s, t)
       AND image(secpp,
                 restrict
                     [prewalk[T], {p: prewalk[T] | length(p) > 1}, boolean]
                     (ipst))
            = W
       IMPLIES
       (FORALL (q: prewalk[T], q1: prewalk[T]):
          ipst(q) AND ipst(q1) AND q /= q1 IMPLIES length(q1) > 1);


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 643 0 650 999
body:
  % Subtype TCC generated (at line 351, column 77) for  p
      % expected type  {p: prewalk | length(p) > 1}
  p_Ht_TCC1: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], p: prewalk[T], s, t: T):
      good?(G, s, t) AND
       separates(G, W, s, t) AND
        path_from?(Mgraph(G, W, s), p, s, t) AND length(p) > 2
       IMPLIES (FORALL (w): W(w) AND verts_of(p)(w) IMPLIES length(p) > 1);


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 652 0 659 999
body:
  % Subtype TCC generated (at line 352, column 49) for  length(p) - 1
      % expected type  nat
  p_Ht_TCC2: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], p: prewalk[T], s, t: T):
           FORALL w: W(w) AND verts_of(p)(w) IMPLIES w = secoo(p)
       AND length(p) > 2 AND path_from?(Mgraph(G, W, s), p, s, t)
       AND separates(G, W, s, t) AND good?(G, s, t)
       IMPLIES length(p) - 1 >= 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 661 0 668 999
body:
  % Subtype TCC generated (at line 352, column 44) for  p ^ (2, length(p) - 1)
      % expected type  prewalk[T]
  p_Ht_TCC3: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], p: prewalk[T], s, t: T):
           FORALL w: W(w) AND verts_of(p)(w) IMPLIES w = secoo(p)
       AND length(p) > 2 AND path_from?(Mgraph(G, W, s), p, s, t)
       AND separates(G, W, s, t) AND good?(G, s, t)
       IMPLIES length(^[T](p, (2, length(p) - 1))) > 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 670 0 677 999
body:
  % Subtype TCC generated (at line 356, column 77) for  q
      % expected type  {p: prewalk | length(p) > 1}
  q_Hs_TCC1: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], q: prewalk[T], s, t: T):
      good?(G, s, t) AND
       separates(G, W, s, t) AND
        path_from?(Mgraph(G, W, t), q, s, t) AND length(q) > 2
       IMPLIES (FORALL (w): W(w) AND verts_of(q)(w) IMPLIES length(q) > 1);


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 679 0 686 999
body:
  % Subtype TCC generated (at line 357, column 49) for  length(q) - 3
      % expected type  nat
  q_Hs_TCC2: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], q: prewalk[T], s, t: T):
           FORALL w: W(w) AND verts_of(q)(w) IMPLIES w = secpp(q)
       AND length(q) > 2 AND path_from?(Mgraph(G, W, t), q, s, t)
       AND separates(G, W, s, t) AND good?(G, s, t)
       IMPLIES length(q) - 3 >= 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 688 0 695 999
body:
  % Subtype TCC generated (at line 357, column 44) for  q ^ (0, length(q) - 3)
      % expected type  prewalk[T]
  q_Hs_TCC3: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], q: prewalk[T], s, t: T):
           FORALL w: W(w) AND verts_of(q)(w) IMPLIES w = secpp(q)
       AND length(q) > 2 AND path_from?(Mgraph(G, W, t), q, s, t)
       AND separates(G, W, s, t) AND good?(G, s, t)
       IMPLIES length(^[T](q, (0, length(q) - 3))) > 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 697 0 709 999
body:
  % Subtype TCC generated (at line 366, column 44) for  q
      % expected type  {p: prewalk | length(p) > 1}
  disjoint_M_paths_TCC1: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss, ipst: set_of_prewalks,
            p, q: prewalk[T], s, t: T):
           ipst(q) AND ipss(p) AND ind_prewalk_set?(ipst)
       AND ind_prewalk_set?(ipss)
       AND st_path_set?(Mgraph(G, W, t), s, t, ipst)
       AND st_path_set?(Mgraph(G, W, s), s, t, ipss)
       AND card[T](W) = card[prewalk](ipst)
       AND card[T](W) = card[prewalk](ipss) AND separates(G, W, s, t)
       AND close?(G, s, t, W) AND good?(G, s, t)
       IMPLIES length(q) > 1;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 711 0 723 999
body:
  % Subtype TCC generated (at line 367, column 56) for  length(p) - 1
      % expected type  nat
  disjoint_M_paths_TCC2: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss, ipst: set_of_prewalks,
            p, q: prewalk[T], s, t: T):
           ipst(q) AND ipss(p) AND ind_prewalk_set?(ipst)
       AND ind_prewalk_set?(ipss)
       AND st_path_set?(Mgraph(G, W, t), s, t, ipst)
       AND st_path_set?(Mgraph(G, W, s), s, t, ipss)
       AND card[T](W) = card[prewalk](ipst)
       AND card[T](W) = card[prewalk](ipss) AND separates(G, W, s, t)
       AND close?(G, s, t, W) AND good?(G, s, t) AND secoo(p) = secpp(q)
       IMPLIES length(p) - 1 >= 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 725 0 737 999
body:
  % Subtype TCC generated (at line 367, column 51) for  p ^ (1, length(p) - 1)
      % expected type  prewalk[T]
  disjoint_M_paths_TCC3: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss, ipst: set_of_prewalks,
            p, q: prewalk[T], s, t: T):
           ipst(q) AND ipss(p) AND ind_prewalk_set?(ipst)
       AND ind_prewalk_set?(ipss)
       AND st_path_set?(Mgraph(G, W, t), s, t, ipst)
       AND st_path_set?(Mgraph(G, W, s), s, t, ipss)
       AND card[T](W) = card[prewalk](ipst)
       AND card[T](W) = card[prewalk](ipss) AND separates(G, W, s, t)
       AND close?(G, s, t, W) AND good?(G, s, t) AND secoo(p) = secpp(q)
       IMPLIES length(^[T](p, (1, length(p) - 1))) > 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 739 0 751 999
body:
  % Subtype TCC generated (at line 367, column 84) for  length(q) - 2
      % expected type  nat
  disjoint_M_paths_TCC4: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss, ipst: set_of_prewalks,
            p, q: prewalk[T], s, t: T):
           ipst(q) AND ipss(p) AND ind_prewalk_set?(ipst)
       AND ind_prewalk_set?(ipss)
       AND st_path_set?(Mgraph(G, W, t), s, t, ipst)
       AND st_path_set?(Mgraph(G, W, s), s, t, ipss)
       AND card[T](W) = card[prewalk](ipst)
       AND card[T](W) = card[prewalk](ipss) AND separates(G, W, s, t)
       AND close?(G, s, t, W) AND good?(G, s, t) AND secoo(p) = secpp(q)
       IMPLIES length(q) - 2 >= 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 753 0 765 999
body:
  % Subtype TCC generated (at line 367, column 79) for  q ^ (0, length(q) - 2)
      % expected type  prewalk[T]
  disjoint_M_paths_TCC5: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss, ipst: set_of_prewalks,
            p, q: prewalk[T], s, t: T):
           ipst(q) AND ipss(p) AND ind_prewalk_set?(ipst)
       AND ind_prewalk_set?(ipss)
       AND st_path_set?(Mgraph(G, W, t), s, t, ipst)
       AND st_path_set?(Mgraph(G, W, s), s, t, ipss)
       AND card[T](W) = card[prewalk](ipst)
       AND card[T](W) = card[prewalk](ipss) AND separates(G, W, s, t)
       AND close?(G, s, t, W) AND good?(G, s, t) AND secoo(p) = secpp(q)
       IMPLIES length(^[T](q, (0, length(q) - 2))) > 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 767 0 785 999
body:
  % Subtype TCC generated (at line 371, column 62) for  length(p) - 1
      % expected type  nat
  disjoint_M_paths_TCC6: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss, ipst: set_of_prewalks,
            p, q: prewalk[T], s, t: T):
           ipst(q) AND ipss(p) AND ind_prewalk_set?(ipst)
       AND ind_prewalk_set?(ipss)
       AND st_path_set?(Mgraph(G, W, t), s, t, ipst)
       AND st_path_set?(Mgraph(G, W, s), s, t, ipss)
       AND card[T](W) = card[prewalk](ipst)
       AND card[T](W) = card[prewalk](ipss) AND separates(G, W, s, t)
       AND close?(G, s, t, W) AND good?(G, s, t)
       AND NOT (secoo(p) = secpp(q) AND
                 intersection(verts_of(p ^ (1, length(p) - 1)),
                              verts_of(q ^ (0, length(q) - 2)))
                  = singleton[T](secoo(p))
                  AND W(secoo(p)))
       AND secoo(p) /= secpp(q)
       IMPLIES length(p) - 1 >= 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 787 0 805 999
body:
  % Subtype TCC generated (at line 371, column 57) for  p ^ (1, length(p) - 1)
      % expected type  prewalk[T]
  disjoint_M_paths_TCC7: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss, ipst: set_of_prewalks,
            p, q: prewalk[T], s, t: T):
           ipst(q) AND ipss(p) AND ind_prewalk_set?(ipst)
       AND ind_prewalk_set?(ipss)
       AND st_path_set?(Mgraph(G, W, t), s, t, ipst)
       AND st_path_set?(Mgraph(G, W, s), s, t, ipss)
       AND card[T](W) = card[prewalk](ipst)
       AND card[T](W) = card[prewalk](ipss) AND separates(G, W, s, t)
       AND close?(G, s, t, W) AND good?(G, s, t)
       AND NOT (secoo(p) = secpp(q) AND
                 intersection(verts_of(p ^ (1, length(p) - 1)),
                              verts_of(q ^ (0, length(q) - 2)))
                  = singleton[T](secoo(p))
                  AND W(secoo(p)))
       AND secoo(p) /= secpp(q)
       IMPLIES length(^[T](p, (1, length(p) - 1))) > 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 807 0 825 999
body:
  % Subtype TCC generated (at line 372, column 62) for  length(q) - 2
      % expected type  nat
  disjoint_M_paths_TCC8: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss, ipst: set_of_prewalks,
            p, q: prewalk[T], s, t: T):
           ipst(q) AND ipss(p) AND ind_prewalk_set?(ipst)
       AND ind_prewalk_set?(ipss)
       AND st_path_set?(Mgraph(G, W, t), s, t, ipst)
       AND st_path_set?(Mgraph(G, W, s), s, t, ipss)
       AND card[T](W) = card[prewalk](ipst)
       AND card[T](W) = card[prewalk](ipss) AND separates(G, W, s, t)
       AND close?(G, s, t, W) AND good?(G, s, t)
       AND NOT (secoo(p) = secpp(q) AND
                 intersection(verts_of(p ^ (1, length(p) - 1)),
                              verts_of(q ^ (0, length(q) - 2)))
                  = singleton[T](secoo(p))
                  AND W(secoo(p)))
       AND secoo(p) /= secpp(q)
       IMPLIES length(q) - 2 >= 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 827 0 845 999
body:
  % Subtype TCC generated (at line 372, column 57) for  q ^ (0, length(q) - 2)
      % expected type  prewalk[T]
  disjoint_M_paths_TCC9: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss, ipst: set_of_prewalks,
            p, q: prewalk[T], s, t: T):
           ipst(q) AND ipss(p) AND ind_prewalk_set?(ipst)
       AND ind_prewalk_set?(ipss)
       AND st_path_set?(Mgraph(G, W, t), s, t, ipst)
       AND st_path_set?(Mgraph(G, W, s), s, t, ipss)
       AND card[T](W) = card[prewalk](ipst)
       AND card[T](W) = card[prewalk](ipss) AND separates(G, W, s, t)
       AND close?(G, s, t, W) AND good?(G, s, t)
       AND NOT (secoo(p) = secpp(q) AND
                 intersection(verts_of(p ^ (1, length(p) - 1)),
                              verts_of(q ^ (0, length(q) - 2)))
                  = singleton[T](secoo(p))
                  AND W(secoo(p)))
       AND secoo(p) /= secpp(q)
       IMPLIES length(^[T](q, (0, length(q) - 2))) > 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 847 0 857 999
body:
  % Subtype TCC generated (at line 393, column 60) for  tau(w)
      % expected type  {p: prewalk | length(p) > 1}
  Map_s_TCC1: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipss: set_of_prewalks, s, t: T):
           st_path_set?(Mgraph(G, W, s), s, t, ipss)
       AND ind_prewalk_set?(ipss) AND card[T](W) = card[prewalk](ipss)
       AND separates(G, W, s, t) AND good?(G, s, t)
       IMPLIES
       (FORALL (tau: [(W) -> prewalk[T]]):
          image(tau, restrict[T, (W), boolean](W)) = ipss IMPLIES
           (FORALL (w): W(w) IMPLIES length(tau(w)) > 1));


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 859 0 869 999
body:
  % Subtype TCC generated (at line 399, column 60) for  tau(w)
      % expected type  {p: prewalk | length(p) > 1}
  Map_t_TCC1: OBLIGATION
    FORALL (G: graph[T], W: finite_set[T], ipst: set_of_prewalks, s, t: T):
           st_path_set?(Mgraph(G, W, t), s, t, ipst)
       AND ind_prewalk_set?(ipst) AND card[T](W) = card[prewalk](ipst)
       AND separates(G, W, s, t) AND good?(G, s, t)
       IMPLIES
       (FORALL (tau: [(W) -> prewalk[T]]):
          image(tau, restrict[T, (W), boolean](W)) = ipst IMPLIES
           (FORALL (w): W(w) IMPLIES length(tau(w)) > 1));


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 871 0 875 999
body:
  % Subtype TCC generated (at line 426, column 68) for  length(q) - 2
      % expected type  nat
  plus_path_set_TCC1: OBLIGATION
    FORALL (G: graph[T], q: prewalk[T], s, t: T):
      good?(G, s, t) AND path_from?(G, q, s, t) IMPLIES length(q) - 2 >= 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 877 0 882 999
body:
  % Subtype TCC generated (at line 426, column 63) for  q ^ (1, length(q) - 2)
      % expected type  prewalk[T]
  plus_path_set_TCC2: OBLIGATION
    FORALL (G: graph[T], q: prewalk[T], s, t: T):
      good?(G, s, t) AND path_from?(G, q, s, t) IMPLIES
       length(^[T](q, (1, length(q) - 2))) > 0;


decl_type: tcc
theory: k_menger
library: graphs
signature: nil
location: 884 0 889 999
body:
  % Subtype TCC generated (at line 445, column 59) for  k - 1
      % expected type  nat
  bridge_two_TCC1: OBLIGATION
    FORALL (G: graph[T], a, c: T, k: nat, s, t: T):
      k >= 1 AND edge?(G)(s, a) AND edge?(G)(a, c) AND edge?(G)(c, t) IMPLIES
       k - 1 >= 0;


decl_type: formula
theory: min_walks
library: graphs
signature: nil
location: 24 3 26 63
body:
     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) 


decl_type: formula
theory: min_walks
library: graphs
signature: nil
location: 28 3 29 66
body:
     min_walk_in : LEMMA FORALL (Gw: gr_walk(x,y)): 
                            walk_from?(Gw,min_walk_from(x,y,Gw),x,y) 


decl_type: formula
theory: min_walks
library: graphs
signature: nil
location: 31 3 33 83
body:
     min_walk_is_min: LEMMA FORALL (Gw: gr_walk(x,y), ww: Seq(Gw)):
                                walk_from?(Gw,ww,x,y) IMPLIES 
                                          length(min_walk_from(x,y,Gw)) <= length(ww)


decl_type: type
theory: min_walks
library: graphs
signature: nil
location: 12 3 14 66
body:
     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))}


decl_type: function
theory: min_walks
library: graphs
signature: [d: [x: T, y: T, gr_walk(x, y)] -> Walk[T](d`3)]
location: 16 3 18 76
body:
     min_walk_from(x,y,(Gw:gr_walk(x,y))): Walk(Gw) =
                          min[Seq(Gw),(LAMBDA (w: Seq(Gw)): length(w)),
                                  (LAMBDA (w: Seq(Gw)): walk_from?(Gw,w,x,y))]


decl_type: function
theory: min_walks
library: graphs
signature: [[G: graph[T], Seq[T](G), T, T] -> bool]
location: 20 3 22 80
body:
     is_min(G,(w: Seq(G)),x,y): bool = walk?(G,w) AND 
                         (FORALL (ww: Seq(G)): walk_from?(G,ww,x,y) IMPLIES 
                                                          length(w) <= length(ww))


decl_type: formula
theory: menger
library: graphs
signature: nil
location: 22 3 26 78
body:
     hard_menger: THEOREM  separable?(G,s,t) AND sep_num(G,s,t) = k 
                                AND vert(G)(s) AND vert(G)(t) 
                          IMPLIES
                              (EXISTS (ips: set_of_paths(G,s,t)):
                                     card(ips) = k AND ind_path_set?(G,s,t,ips))


decl_type: formula
theory: meng_scaff_defs
library: graphs
signature: nil
location: 41 3 42 53
body:
     vert_H_s: LEMMA vert(G)(s) AND s /= w1 AND s /= w2
                       IMPLIES vert(H(G, s, w1, w2))(s)


decl_type: formula
theory: meng_scaff_defs
library: graphs
signature: nil
location: 45 3 46 73
body:
     path_H_W        : LEMMA path?(H(G,s,w1,w2),p) IMPLIES
                                NOT verts_of(p)(w1) AND NOT verts_of(p)(w2)


decl_type: formula
theory: meng_scaff_defs
library: graphs
signature: nil
location: 58 3 60 58
body:
     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)


decl_type: formula
theory: meng_scaff_defs
library: graphs
signature: nil
location: 62 3 63 80
body:
     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))


decl_type: formula
theory: meng_scaff_defs
library: graphs
signature: nil
location: 65 3 66 63
body:
     del_vert_comm   : LEMMA del_vert(del_vert(G,w2),w1) = 
                                      del_vert(del_vert(G,w1),w2)


decl_type: formula
theory: meng_scaff_defs
library: graphs
signature: nil
location: 72 3 75 81
body:
     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)


decl_type: function
theory: meng_scaff_defs
library: graphs
signature: [[T, graph[T], T, T, T] -> finite_set[doubleton[T]]]
location: 22 3 24 73
body:
     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))}


decl_type: function
theory: meng_scaff_defs
library: graphs
location: 26 3 32 21
signature:
  [[G: graph[T], (vert(G)), y: (vert(G)),
         {t | vert(G)(t) AND t /= y}, {t | vert(G)(t) AND t /= y}] ->
          graph[T]]

body:
     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)))))
                     #)


decl_type: function
theory: meng_scaff_defs
library: graphs
signature: [[graph[T], T, T, T, T] -> bool]
location: 35 3 36 47
body:
     in?(G,s,t,w1,w2): bool = vert(G)(s) AND vert(G)(t) AND vert(G)(w1)
                                  AND vert(G)(w2) 


decl_type: function
theory: meng_scaff_defs
library: graphs
signature: [[T, T, T, T] -> bool]
location: 38 3 39 61
body:
     disjoint?(s,t,w1,w2): bool = (s /= t AND w1 /= w2 AND w1 /= s AND w2 /= s 
                                       AND w1 /= t AND w2 /= t) 


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 84 0 89 999
body:
  % Subtype TCC generated (at line 19, column 35) for
      % path_comp(del_vert(del_vert(G, w1), w2), x)
      % expected type  Subgraph[T](G)
  H_TCC1: OBLIGATION
    FORALL (G: graph[T], (x, w1, w2: T)):
      subgraph?[T](path_comp(del_vert[T](del_vert[T](G, w1), w2), x), G);


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 91 0 102 999
body:
  % Subtype TCC generated (at line 23, column 16) for
      % {e: doubleton[T] |
      %    (EXISTS z:
      %       edges(G)(e) AND e = dbl(v, z) AND vert(H(G, x, w1, w2))(z))}
      % expected type  finite_set[doubleton[T]]
  incident_TCC1: OBLIGATION
    FORALL (v: T, G: graph[T], (x, w1, w2: T)):
      is_finite[doubleton[T]]
          ({e: doubleton[T] |
              EXISTS z:
                edges(G)(e) AND
                 e = dbl[T](v, z) AND vert(H(G, x, w1, w2))(z)});


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 104 0 109 999
body:
  % Subtype TCC generated (at line 28, column 35) for  dbl(w1, y)
      % expected type  doubleton[T]
  meng_TCC1: OBLIGATION
    FORALL (G: graph[T], (x, y: (vert(G))),
            (w1, w2: {t | vert(G)(t) AND t /= y})):
      EXISTS (x: T), (y_1: T): x /= y_1 AND dbl[T](w1, y) = dbl[T](x, y_1);


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 111 0 116 999
body:
  % Subtype TCC generated (at line 28, column 50) for  dbl(w2, y)
      % expected type  doubleton[T]
  meng_TCC2: OBLIGATION
    FORALL (G: graph[T], (x, y: (vert(G))),
            (w1, w2: {t | vert(G)(t) AND t /= y})):
      EXISTS (x: T), (y_1: T): x /= y_1 AND dbl[T](w2, y) = dbl[T](x, y_1);


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 118 0 144 999
body:
  % Subtype TCC generated (at line 27, column 19) for
      % (# 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))))) #)
      % expected type  graph[T]
  meng_TCC3: OBLIGATION
    FORALL (G: graph[T], (x, y: (vert(G))),
            (w1, w2: {t | vert(G)(t) AND t /= y})):
      FORALL (e: doubleton[T]):
        add[doubleton[T]]
            (dbl[T](w1, y),
             add[doubleton[T]]
                 (dbl[T](w2, y),
                  union[doubleton[T]]
                      (edges(H(G, x, w1, w2)),
                       union[doubleton[T]]
                           (incident(w1, G, x, w1, w2),
                            incident(w2, G, x, w1, w2)))))
            (e)
         IMPLIES
         (FORALL (x_1: T):
            e(x_1) IMPLIES
             add[T](y, add[T](w1, add[T](w2, vert(H(G, x, w1, w2)))))(x_1));


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 146 0 149 999
body:
  % Subtype TCC generated (at line 58, column 50) for  0
      % expected type  below[p`length]
  walk?_H_TCC1: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T]): walk?(G, p) IMPLIES 0 < p`length;


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 151 0 155 999
body:
  % Subtype TCC generated (at line 63, column 56) for  s
      % expected type  (vert(G))
  vert_meng_sub_TCC1: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
      disjoint?(s, t, w1, w2) AND in?(G, s, t, w1, w2) IMPLIES vert(G)(s);


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 157 0 161 999
body:
  % Subtype TCC generated (at line 63, column 59) for  t
      % expected type  (vert(G))
  vert_meng_sub_TCC2: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
      disjoint?(s, t, w1, w2) AND in?(G, s, t, w1, w2) IMPLIES vert(G)(t);


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 163 0 168 999
body:
  % Subtype TCC generated (at line 63, column 62) for  w1
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  vert_meng_sub_TCC3: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
      disjoint?(s, t, w1, w2) AND in?(G, s, t, w1, w2) IMPLIES
       vert(G)(w1) AND w1 /= t;


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 170 0 175 999
body:
  % Subtype TCC generated (at line 63, column 66) for  w2
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  vert_meng_sub_TCC4: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
      disjoint?(s, t, w1, w2) AND in?(G, s, t, w1, w2) IMPLIES
       vert(G)(w2) AND w2 /= t;


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 177 0 183 999
body:
  % Subtype TCC generated (at line 75, column 50) for  w1
      % expected type  {t | vert(G)(t) AND t /= s}
  meng_comm_TCC1: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           w2 /= s AND vert(G)(w2) AND w1 /= s AND vert(G)(w1) AND vert(G)(t)
       AND vert(G)(s)
       IMPLIES vert(G)(w1) AND w1 /= s;


decl_type: tcc
theory: meng_scaff_defs
library: graphs
signature: nil
location: 185 0 191 999
body:
  % Subtype TCC generated (at line 75, column 54) for  w2
      % expected type  {t | vert(G)(t) AND t /= s}
  meng_comm_TCC2: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           w2 /= s AND vert(G)(w2) AND w1 /= s AND vert(G)(w1) AND vert(G)(t)
       AND vert(G)(s)
       IMPLIES vert(G)(w2) AND w2 /= s;


decl_type: formula
theory: meng_scaff
library: graphs
signature: nil
location: 24 2 25 26
body:
    first_not: LEMMA FORALL (ps: ps_ptype(P)): i < first(P,ps) IMPLIES
                                             NOT  P(seq(ps)(i))


decl_type: formula
theory: meng_scaff
library: graphs
signature: nil
location: 30 2 36 50
body:
    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


decl_type: formula
theory: meng_scaff
library: graphs
signature: nil
location: 38 2 46 45
body:
    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


decl_type: formula
theory: meng_scaff
library: graphs
signature: nil
location: 48 3 54 64
body:
     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 


decl_type: formula
theory: meng_scaff
library: graphs
signature: nil
location: 57 3 62 68
body:
     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)))


decl_type: formula
theory: meng_scaff
library: graphs
signature: nil
location: 65 3 69 49
body:
     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


decl_type: formula
theory: meng_scaff
library: graphs
signature: nil
location: 71 3 75 77
body:
     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


decl_type: formula
theory: meng_scaff
library: graphs
signature: nil
location: 77 3 83 75
body:
     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 length(p) > 2 AND (  seq(p)(length(p)-2) = w1
                                                 OR seq(p)(length(p)-2) = w2)


decl_type: formula
theory: meng_scaff
library: graphs
signature: nil
location: 88 3 91 55
body:
     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)


decl_type: formula
theory: meng_scaff
library: graphs
signature: nil
location: 94 3 99 68
body:
     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)


decl_type: formula
theory: meng_scaff
library: graphs
signature: nil
location: 101 3 110 69
body:
     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)                 ) 


decl_type: function
theory: meng_scaff
library: graphs
signature: [d: [P: pred[T], ps_ptype(P)] -> below(length(d`2))]
location: 19 2 20 66
body:
    first(P: pred[T],ps: ps_ptype(P)): below(length(ps)) = 
                    min({i: nat | i < length(ps) AND P(seq(ps)(i))})


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 126 0 131 999
body:
  % Subtype TCC generated (at line 20, column 22) for
      % {i: nat | i < length(ps) AND P(seq(ps)(i))}
      % expected type  S: (nonempty?[nat])
  first_TCC1: OBLIGATION
    FORALL (P: pred[T], ps: ps_ptype(P)):
      nonempty?[nat]({i: nat | i < length(ps) AND P(seq(ps)(i))});


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 133 0 137 999
body:
  % Subtype TCC generated (at line 25, column 23) for  i
      % expected type  below[ps`length]
  first_not_TCC1: OBLIGATION
    FORALL (P: pred[T], i: nat, ps: ps_ptype(P)):
      i < first(P, ps) IMPLIES i < ps`length;


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 139 0 145 999
body:
  % Subtype TCC generated (at line 32, column 42) for  s
      % expected type  (vert(G))
  meng_to_G_sep_TCC1: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t, w1, w2: T):
      walk_from?(G, p, s, t) AND
       in?(G, s, t, w1, w2) AND disjoint?(s, t, w1, w2)
       IMPLIES vert(G)(s);


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 147 0 153 999
body:
  % Subtype TCC generated (at line 32, column 45) for  t
      % expected type  (vert(G))
  meng_to_G_sep_TCC2: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t, w1, w2: T):
      walk_from?(G, p, s, t) AND
       in?(G, s, t, w1, w2) AND disjoint?(s, t, w1, w2)
       IMPLIES vert(G)(t);


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 155 0 161 999
body:
  % Subtype TCC generated (at line 32, column 48) for  w1
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  meng_to_G_sep_TCC3: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t, w1, w2: T):
      walk_from?(G, p, s, t) AND
       in?(G, s, t, w1, w2) AND disjoint?(s, t, w1, w2)
       IMPLIES vert(G)(w1) AND w1 /= t;


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 163 0 169 999
body:
  % Subtype TCC generated (at line 32, column 52) for  w2
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  meng_to_G_sep_TCC4: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t, w1, w2: T):
      walk_from?(G, p, s, t) AND
       in?(G, s, t, w1, w2) AND disjoint?(s, t, w1, w2)
       IMPLIES vert(G)(w2) AND w2 /= t;


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 171 0 177 999
body:
  % Subtype TCC generated (at line 41, column 41) for  w1
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  prep_14_TCC1: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           vert(G)(s) AND vert(G)(t) AND vert(G)(w1) AND vert(G)(w2)
       AND disjoint?(s, t, w1, w2)
       IMPLIES vert(G)(w1) AND w1 /= t;


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 179 0 185 999
body:
  % Subtype TCC generated (at line 41, column 45) for  w2
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  prep_14_TCC2: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           vert(G)(s) AND vert(G)(t) AND vert(G)(w1) AND vert(G)(w2)
       AND disjoint?(s, t, w1, w2)
       IMPLIES vert(G)(w2) AND w2 /= t;


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 187 0 194 999
body:
  % Subtype TCC generated (at line 54, column 40) for  s
      % expected type  (vert(G))
  line14_TCC1: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           disjoint?(s, t, w1, w2) AND separates(G, dbl(w1, w2), s, t)
       AND sep_num(G, s, t) = 2 AND in?(G, s, t, w1, w2)
       AND separable?(G, s, t)
       IMPLIES vert(G)(s);


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 196 0 203 999
body:
  % Subtype TCC generated (at line 54, column 43) for  t
      % expected type  (vert(G))
  line14_TCC2: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           disjoint?(s, t, w1, w2) AND separates(G, dbl(w1, w2), s, t)
       AND sep_num(G, s, t) = 2 AND in?(G, s, t, w1, w2)
       AND separable?(G, s, t)
       IMPLIES vert(G)(t);


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 205 0 212 999
body:
  % Subtype TCC generated (at line 54, column 46) for  w1
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  line14_TCC3: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           disjoint?(s, t, w1, w2) AND separates(G, dbl(w1, w2), s, t)
       AND sep_num(G, s, t) = 2 AND in?(G, s, t, w1, w2)
       AND separable?(G, s, t)
       IMPLIES vert(G)(w1) AND w1 /= t;


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 214 0 221 999
body:
  % Subtype TCC generated (at line 54, column 50) for  w2
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  line14_TCC4: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           disjoint?(s, t, w1, w2) AND separates(G, dbl(w1, w2), s, t)
       AND sep_num(G, s, t) = 2 AND in?(G, s, t, w1, w2)
       AND separable?(G, s, t)
       IMPLIES vert(G)(w2) AND w2 /= t;


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 223 0 229 999
body:
  % Subtype TCC generated (at line 79, column 39) for  s
      % expected type  (vert(G))
  line19_TCC1: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
      separable?(G, s, t) AND
       in?(G, s, t, w1, w2) AND disjoint?(s, t, w1, w2)
       IMPLIES vert(G)(s);


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 231 0 237 999
body:
  % Subtype TCC generated (at line 79, column 42) for  t
      % expected type  (vert(G))
  line19_TCC2: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
      separable?(G, s, t) AND
       in?(G, s, t, w1, w2) AND disjoint?(s, t, w1, w2)
       IMPLIES vert(G)(t);


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 239 0 245 999
body:
  % Subtype TCC generated (at line 79, column 45) for  w1
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  line19_TCC3: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
      separable?(G, s, t) AND
       in?(G, s, t, w1, w2) AND disjoint?(s, t, w1, w2)
       IMPLIES vert(G)(w1) AND w1 /= t;


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 247 0 253 999
body:
  % Subtype TCC generated (at line 79, column 49) for  w2
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  line19_TCC4: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
      separable?(G, s, t) AND
       in?(G, s, t, w1, w2) AND disjoint?(s, t, w1, w2)
       IMPLIES vert(G)(w2) AND w2 /= t;


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 255 0 262 999
body:
  % Subtype TCC generated (at line 82, column 62) for  length(p) - 2
      % expected type  below[p`length]
  line19_TCC5: OBLIGATION
    FORALL (G, MM: graph[T], p: prewalk[T], s, t, w1, w2: T):
           path_from?(MM, p, s, t) AND separates(G, dbl(w1, w2), s, t)
       AND MM = meng(G, s, t, w1, w2) AND disjoint?(s, t, w1, w2)
       AND in?(G, s, t, w1, w2) AND separable?(G, s, t) AND length(p) > 2
       IMPLIES length(p) - 2 >= 0 AND length(p) - 2 < p`length;


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 264 0 271 999
body:
  % Subtype TCC generated (at line 99, column 44) for  s
      % expected type  (vert(G))
  line17_TCC1: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2, yt: T):
           separates(G, dbl(w1, w2), s, t) AND yt /= t
       AND disjoint?(s, t, w1, w2) AND in?(G, s, t, w1, w2)
       AND vert(H(G, t, w1, w2))(yt)
       IMPLIES vert(G)(s);


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 273 0 280 999
body:
  % Subtype TCC generated (at line 99, column 47) for  t
      % expected type  (vert(G))
  line17_TCC2: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2, yt: T):
           separates(G, dbl(w1, w2), s, t) AND yt /= t
       AND disjoint?(s, t, w1, w2) AND in?(G, s, t, w1, w2)
       AND vert(H(G, t, w1, w2))(yt)
       IMPLIES vert(G)(t);


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 282 0 289 999
body:
  % Subtype TCC generated (at line 99, column 50) for  w1
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  line17_TCC3: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2, yt: T):
           separates(G, dbl(w1, w2), s, t) AND yt /= t
       AND disjoint?(s, t, w1, w2) AND in?(G, s, t, w1, w2)
       AND vert(H(G, t, w1, w2))(yt)
       IMPLIES vert(G)(w1) AND w1 /= t;


decl_type: tcc
theory: meng_scaff
library: graphs
signature: nil
location: 291 0 298 999
body:
  % Subtype TCC generated (at line 99, column 54) for  w2
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  line17_TCC4: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2, yt: T):
           separates(G, dbl(w1, w2), s, t) AND yt /= t
       AND disjoint?(s, t, w1, w2) AND in?(G, s, t, w1, w2)
       AND vert(H(G, t, w1, w2))(yt)
       IMPLIES vert(G)(w2) AND w2 /= t;


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 26 3 39 50
body:
     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 length(P1) > 2 AND
                                path_from?(MM,P2,s,t) AND length(P2) > 2 AND
                                seq(P1)(length(P1)-2) = w1 AND NOT verts_of(P1)(w2) AND
                                seq(P2)(length(P2)-2) = w2 AND NOT verts_of(P2)(w1) AND
                                independent?(P1,P2))      


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 47 3 49 64
body:
     path_meng_t  : LEMMA path_from?(G, p, s, t) AND length(p) > 0 
                             IMPLIES (i < length(p) AND seq(p)(i) = t
                                        IMPLIES i = length(p) - 1)


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 51 3 52 74
body:
     path_H_def   : LEMMA path?(H(G,s,w1,w2),p) AND j < length(p) IMPLIES 
                             walk?(del_verts[T](G, dbl[T](w1, w2)), p^(0,j))


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 55 3 60 49
body:
     path_H_ind   : LEMMA length(p1) > 1 AND length(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)


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 63 3 68 70
body:
     path_comps_ind3: LEMMA length(p1) > 2 AND length(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))


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 71 3 79 46
body:
     path_H_trunc: LEMMA length(p) >= 2 AND
                      path?(H(G, s, w1, w2), trunc1(p)) AND
                      from?(p, s, w1) AND 
                      edge?(G)(p(length(p)-2),p(length(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) 


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 81 3 86 80
body:
     meng_last: LEMMA length(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)(length(p) - 3), seq(p)(length(p) - 2))


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 88 3 95 68
body:
     ind_verts_W: LEMMA path_from?(G,p1,s,t) AND
                        path_from?(G,p2,t,s) AND
                        length(p1) > 2 AND seq(p1)(length(p1) - 2) = w1 AND
                        length(p2) > 2 AND seq(p2)(length(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)


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 97 2 104 71
body:
    ind_verts_w: LEMMA path_from?(G,p1,s,t) AND
                           path_from?(G,p2,s,t) AND
                                length(p1) > 2 AND seq(p1)(length(p1) - 2) = w1 AND
                                length(p2) > 2 AND seq(p2)(length(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)


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 106 3 115 63
body:
     path_meng_in: LEMMA length(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)(length(p) - 2) = w1 AND NOT verts_of(p)(w2)) OR
                          (seq(p)(length(p) - 2) = w2 AND NOT verts_of(p)(w1))    )
                     IMPLIES
                        path?(H(G, s, w1, w2), trunc1(trunc1(p)))


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 121 3 124 69
body:
     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)


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 126 3 127 56
body:
     path_from_to_walk_from: LEMMA path_from?(G,p,s,t) IMPLIES
                                       walk_from?(G,p,s,t)


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 129 3 133 47
body:
     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)


decl_type: formula
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 137 3 148 70
body:
     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))


decl_type: function
theory: meng_scaff_prelude
library: graphs
signature: [[graph[T], T, T] -> bool]
location: 15 3 23 70
body:
     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))


decl_type: function
theory: meng_scaff_prelude
library: graphs
location: 44 3 45 81
signature:
  [d:
          [G: graph[T], s: T, t: T, v: T, Long_walk_from(G, s, v),
           Walk_from[T](G, t, v)] ->
          Walk_from[T](d`1, d`2, d`3)]

body:
     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,length(p1)-2) o rev(p2)


decl_type: function
theory: meng_scaff_prelude
library: graphs
signature: [[prewalk[T], prewalk[T]] -> bool]
location: 117 3 119 67
body:
     disjoint?(w1,w2: prewalk): bool = (FORALL (i,j: nat): 
                                       i < length(w1)  AND j < length(w2) IMPLIES
                                            seq(w1)(i) /= seq(w2)(j))


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 162 0 169 999
body:
  % Subtype TCC generated (at line 30, column 35) for  s
      % expected type  (vert(G))
  line20_TCC1: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           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 vert(G)(s);


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 171 0 178 999
body:
  % Subtype TCC generated (at line 30, column 37) for  t
      % expected type  (vert(G))
  line20_TCC2: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           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 vert(G)(t);


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 180 0 187 999
body:
  % Subtype TCC generated (at line 30, column 39) for  w1
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  line20_TCC3: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           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 vert(G)(w1) AND w1 /= t;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 189 0 196 999
body:
  % Subtype TCC generated (at line 30, column 42) for  w2
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  line20_TCC4: OBLIGATION
    FORALL (G: graph[T], s, t, w1, w2: T):
           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 vert(G)(w2) AND w2 /= t;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 198 0 212 999
body:
  % Subtype TCC generated (at line 37, column 38) for  length(P1) - 2
      % expected type  below[P1`length]
  line20_TCC5: OBLIGATION
    FORALL (G, MM: graph[T], s, t, w1, w2: T):
           NOT (edge?(G)(w1, t) AND edge?(G)(w2, t))
       AND induction_step(G, s, t) AND MM = meng(G, s, t, w1, w2)
       AND disjoint?(s, t, w1, w2) AND separates(G, dbl(w1, w2), s, t)
       AND sep_num(G, s, t) = 2 AND in?(G, s, t, w1, w2)
       AND separable?(G, s, t)
       IMPLIES
       (FORALL (P1, P2: prewalk[T]):
          length(P2) > 2 AND
           path_from?(MM, P2, s, t) AND
            length(P1) > 2 AND path_from?(MM, P1, s, t)
           IMPLIES length(P1) - 2 >= 0 AND length(P1) - 2 < P1`length);


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 214 0 228 999
body:
  % Subtype TCC generated (at line 38, column 38) for  length(P2) - 2
      % expected type  below[P2`length]
  line20_TCC6: OBLIGATION
    FORALL (G, MM: graph[T], s, t, w1, w2: T):
           NOT (edge?(G)(w1, t) AND edge?(G)(w2, t))
       AND induction_step(G, s, t) AND MM = meng(G, s, t, w1, w2)
       AND disjoint?(s, t, w1, w2) AND separates(G, dbl(w1, w2), s, t)
       AND sep_num(G, s, t) = 2 AND in?(G, s, t, w1, w2)
       AND separable?(G, s, t)
       IMPLIES
       (FORALL (P1, P2: prewalk[T]):
               NOT verts_of(P1)(w2) AND seq(P1)(length(P1) - 2) = w1
           AND length(P2) > 2 AND path_from?(MM, P2, s, t) AND length(P1) > 2
           AND path_from?(MM, P1, s, t)
           IMPLIES length(P2) - 2 >= 0 AND length(P2) - 2 < P2`length);


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 230 0 235 999
body:
  % Subtype TCC generated (at line 45, column 58) for  length(p1) - 2
      % expected type  nat
  join2_TCC1: OBLIGATION
    FORALL (G: graph[T], s: T, t: T, v: T, (p1: Long_walk_from(G, s, v)),
            (p2: Walk_from[T](G, t, v))):
      length(p1) - 2 >= 0;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 237 0 245 999
body:
  % Subtype TCC generated (at line 45, column 52) for
      % p1 ^ (0, length(p1) - 2) o rev(p2)
      % expected type  Walk_from[T](G, s, t)
  join2_TCC2: OBLIGATION
    FORALL (G: graph[T], s: T, t: T, v: T, (p1: Long_walk_from(G, s, v)),
            (p2: Walk_from[T](G, t, v))):
      length(o[T](^[T](p1, (0, length(p1) - 2)), rev[T](p2))) > 0 AND
       walk_from?[T]
           (G, o[T](^[T](p1, (0, length(p1) - 2)), rev[T](p2)), s, t);


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 247 0 252 999
body:
  % Subtype TCC generated (at line 52, column 66) for  p ^ (0, j)
      % expected type  prewalk[T]
  path_H_def_TCC1: OBLIGATION
    FORALL (G: graph[T], j: nat, p: prewalk[T], s, w1, w2: T):
      j < length(p) AND path?(H(G, s, w1, w2), p) IMPLIES
       length(^[T](p, (0, j))) > 0;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 254 0 258 999
body:
  % Subtype TCC generated (at line 56, column 50) for  p1
      % expected type  Longprewalk[T]
  path_H_ind_TCC1: OBLIGATION
    FORALL (p1, p2: prewalk[T]):
      length(p1) > 1 AND length(p2) > 1 IMPLIES length(p1) >= 2;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 260 0 266 999
body:
  % Subtype TCC generated (at line 57, column 50) for  p2
      % expected type  Longprewalk[T]
  path_H_ind_TCC2: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, w1, w2: T):
      length(p1) > 1 AND
       length(p2) > 1 AND path?(H(G, s, w1, w2), trunc1(p1))
       IMPLIES length(p2) >= 2;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 268 0 276 999
body:
  % Subtype TCC generated (at line 59, column 32) for  0
      % expected type  below[p1`length]
  path_H_ind_TCC3: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, w1, w2: T):
           length(p1) > 1 AND length(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)
       IMPLIES 0 < p1`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 278 0 286 999
body:
  % Subtype TCC generated (at line 59, column 51) for  0
      % expected type  below[p2`length]
  path_H_ind_TCC4: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, w1, w2: T):
           length(p1) > 1 AND length(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
       IMPLIES 0 < p2`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 288 0 292 999
body:
  % Subtype TCC generated (at line 64, column 62) for  p1
      % expected type  Longprewalk[T]
  path_comps_ind3_TCC1: OBLIGATION
    FORALL (p1, p2: prewalk[T]):
      length(p1) > 2 AND length(p2) > 2 IMPLIES length(p1) >= 2;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 294 0 298 999
body:
  % Subtype TCC generated (at line 64, column 55) for  trunc1(p1)
      % expected type  Longprewalk[T]
  path_comps_ind3_TCC2: OBLIGATION
    FORALL (p1, p2: prewalk[T]):
      length(p1) > 2 AND length(p2) > 2 IMPLIES length(trunc1[T](p1)) >= 2;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 300 0 306 999
body:
  % Subtype TCC generated (at line 65, column 62) for  p2
      % expected type  Longprewalk[T]
  path_comps_ind3_TCC3: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, w1, w2: T):
      length(p1) > 2 AND
       length(p2) > 2 AND path?(H(G, s, w1, w2), trunc1(trunc1(p1)))
       IMPLIES length(p2) >= 2;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 308 0 314 999
body:
  % Subtype TCC generated (at line 65, column 55) for  trunc1(p2)
      % expected type  Longprewalk[T]
  path_comps_ind3_TCC4: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, w1, w2: T):
      length(p1) > 2 AND
       length(p2) > 2 AND path?(H(G, s, w1, w2), trunc1(trunc1(p1)))
       IMPLIES length(trunc1[T](p2)) >= 2;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 316 0 324 999
body:
  % Subtype TCC generated (at line 67, column 37) for  0
      % expected type  below[p1`length]
  path_comps_ind3_TCC5: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, w1, w2: T):
           length(p1) > 2 AND length(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)
       IMPLIES 0 < p1`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 326 0 334 999
body:
  % Subtype TCC generated (at line 67, column 56) for  0
      % expected type  below[p2`length]
  path_comps_ind3_TCC6: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, w1, w2: T):
           length(p1) > 2 AND length(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
       IMPLIES 0 < p2`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 336 0 342 999
body:
  % Subtype TCC generated (at line 74, column 31) for  length(p) - 2
      % expected type  below[length(p)]
  path_H_trunc_TCC1: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, w1, w2: T):
      length(p) >= 2 AND
       path?(H(G, s, w1, w2), trunc1(p)) AND from?(p, s, w1)
       IMPLIES length(p) - 2 >= 0 AND length(p) - 2 < length(p);


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 344 0 350 999
body:
  % Subtype TCC generated (at line 74, column 46) for  length(p) - 1
      % expected type  below[length(p)]
  path_H_trunc_TCC2: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, w1, w2: T):
      length(p) >= 2 AND
       path?(H(G, s, w1, w2), trunc1(p)) AND from?(p, s, w1)
       IMPLIES length(p) - 1 >= 0 AND length(p) - 1 < length(p);


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 352 0 358 999
body:
  % Subtype TCC generated (at line 85, column 45) for  w1
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  meng_last_TCC1: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t, w1, w2: T):
           length(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)
       IMPLIES vert(G)(w1) AND w1 /= t;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 360 0 366 999
body:
  % Subtype TCC generated (at line 85, column 49) for  w2
      % expected type  {t_1 | vert(G)(t_1) AND t_1 /= t}
  meng_last_TCC2: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t, w1, w2: T):
           length(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)
       IMPLIES vert(G)(w2) AND w2 /= t;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 368 0 375 999
body:
  % Subtype TCC generated (at line 86, column 42) for  length(p) - 3
      % expected type  below[p`length]
  meng_last_TCC3: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t, w1, w2: T):
           path_from?(meng(G, s, t, w1, w2), p, s, t) AND vert(G)(w2)
       AND vert(G)(w1) AND w2 /= t AND w2 /= s AND vert(G)(t) AND w1 /= t
       AND w1 /= s AND vert(G)(s) AND length(p) > 2
       IMPLIES length(p) - 3 >= 0 AND length(p) - 3 < p`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 377 0 384 999
body:
  % Subtype TCC generated (at line 86, column 65) for  length(p) - 2
      % expected type  below[p`length]
  meng_last_TCC4: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t, w1, w2: T):
           path_from?(meng(G, s, t, w1, w2), p, s, t) AND vert(G)(w2)
       AND vert(G)(w1) AND w2 /= t AND w2 /= s AND vert(G)(t) AND w1 /= t
       AND w1 /= s AND vert(G)(s) AND length(p) > 2
       IMPLIES length(p) - 2 >= 0 AND length(p) - 2 < p`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 386 0 391 999
body:
  % Subtype TCC generated (at line 90, column 49) for  length(p1) - 2
      % expected type  below[p1`length]
  ind_verts_W_TCC1: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t: T):
      path_from?(G, p1, s, t) AND path_from?(G, p2, t, s) AND length(p1) > 2
       IMPLIES length(p1) - 2 >= 0 AND length(p1) - 2 < p1`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 393 0 399 999
body:
  % Subtype TCC generated (at line 91, column 49) for  length(p2) - 2
      % expected type  below[p2`length]
  ind_verts_W_TCC2: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, w1: T):
           path_from?(G, p1, s, t) AND path_from?(G, p2, t, s)
       AND length(p1) > 2 AND seq(p1)(length(p1) - 2) = w1 AND length(p2) > 2
       IMPLIES length(p2) - 2 >= 0 AND length(p2) - 2 < p2`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 401 0 406 999
body:
  % Subtype TCC generated (at line 99, column 52) for  length(p1) - 2
      % expected type  below[p1`length]
  ind_verts_w_TCC1: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t: T):
      path_from?(G, p1, s, t) AND path_from?(G, p2, s, t) AND length(p1) > 2
       IMPLIES length(p1) - 2 >= 0 AND length(p1) - 2 < p1`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 408 0 414 999
body:
  % Subtype TCC generated (at line 100, column 52) for  length(p2) - 2
      % expected type  below[p2`length]
  ind_verts_w_TCC2: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, w1: T):
           path_from?(G, p1, s, t) AND path_from?(G, p2, s, t)
       AND length(p1) > 2 AND seq(p1)(length(p1) - 2) = w1 AND length(p2) > 2
       IMPLIES length(p2) - 2 >= 0 AND length(p2) - 2 < p2`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 416 0 423 999
body:
  % Subtype TCC generated (at line 112, column 32) for  length(p) - 2
      % expected type  below[p`length]
  path_meng_in_TCC1: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t, w1, w2: T):
           length(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)
       IMPLIES length(p) - 2 >= 0 AND length(p) - 2 < p`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 425 0 434 999
body:
  % Subtype TCC generated (at line 115, column 59) for  p
      % expected type  Longprewalk[T]
  path_meng_in_TCC2: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t, w1, w2: T):
           ((seq(p)(length(p) - 2) = w1 AND NOT verts_of(p)(w2)) OR
             (seq(p)(length(p) - 2) = w2 AND NOT verts_of(p)(w1)))
       AND from?(p, s, t) AND path?(meng(G, s, t, w1, w2), p) AND vert(G)(w2)
       AND vert(G)(w1) AND w2 /= t AND w2 /= s AND vert(G)(t) AND w1 /= t
       AND w1 /= s AND vert(G)(s) AND length(p) > 2
       IMPLIES length(p) >= 2;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 436 0 445 999
body:
  % Subtype TCC generated (at line 115, column 52) for  trunc1(p)
      % expected type  Longprewalk[T]
  path_meng_in_TCC3: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], s, t, w1, w2: T):
           ((seq(p)(length(p) - 2) = w1 AND NOT verts_of(p)(w2)) OR
             (seq(p)(length(p) - 2) = w2 AND NOT verts_of(p)(w1)))
       AND from?(p, s, t) AND path?(meng(G, s, t, w1, w2), p) AND vert(G)(w2)
       AND vert(G)(w1) AND w2 /= t AND w2 /= s AND vert(G)(t) AND w1 /= t
       AND w1 /= s AND vert(G)(s) AND length(p) > 2
       IMPLIES length(trunc1[T](p)) >= 2;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 447 0 453 999
body:
  % Subtype TCC generated (at line 123, column 37) for  p1
      % expected type  Longprewalk[T]
  join2_lem_TCC1: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, v: T):
           path_from?(G, p1, s, v) AND path_from?(G, p2, t, v) AND s /= v
       AND t /= v AND s /= t
       IMPLIES length(p1) >= 2;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 455 0 461 999
body:
  % Subtype TCC generated (at line 123, column 48) for  p2
      % expected type  Longprewalk[T]
  join2_lem_TCC2: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, v: T):
           path_from?(G, p1, s, v) AND path_from?(G, p2, t, v) AND s /= v
       AND t /= v AND s /= t
       IMPLIES length(p2) >= 2;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 463 0 469 999
body:
  % Subtype TCC generated (at line 124, column 58) for  p1
      % expected type  Long_walk_from(G, s, v)
  join2_lem_TCC3: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, v: T):
           disjoint?(trunc1(p1), trunc1(p2)) AND s /= t AND t /= v AND s /= v
       AND path_from?(G, p2, t, v) AND path_from?(G, p1, s, v)
       IMPLIES walk_from?[T](G, p1, s, v) AND length(p1) > 1;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 471 0 477 999
body:
  % Subtype TCC generated (at line 124, column 61) for  p2
      % expected type  Walk_from[T](G, t, v)
  join2_lem_TCC4: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, v: T):
           disjoint?(trunc1(p1), trunc1(p2)) AND s /= t AND t /= v AND s /= v
       AND path_from?(G, p2, t, v) AND path_from?(G, p1, s, v)
       IMPLIES walk_from?[T](G, p2, t, v);


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 479 0 485 999
body:
  % Subtype TCC generated (at line 132, column 36) for  0
      % expected type  below[p1`length]
  paths_H_disj_TCC1: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, w1, w2: T):
      path?(H(G, t, w1, w2), p2) AND
       path?(H(G, s, w1, w2), p1) AND separates(G, dbl(w1, w2), s, t)
       IMPLIES 0 < p1`length;


decl_type: tcc
theory: meng_scaff_prelude
library: graphs
signature: nil
location: 487 0 494 999
body:
  % Subtype TCC generated (at line 132, column 55) for  0
      % expected type  below[p2`length]
  paths_H_disj_TCC2: OBLIGATION
    FORALL (G: graph[T], p1, p2: prewalk[T], s, t, w1, w2: T):
      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
       IMPLIES 0 < p2`length;


decl_type: formula
theory: h_menger
library: graphs
signature: nil
location: 14 3 19 81
body:
     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)))


decl_type: formula
theory: h_menger
library: graphs
signature: nil
location: 22 2 33 71
body:
    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))


decl_type: formula
theory: h_menger
library: graphs
signature: nil
location: 36 2 38 70
body:
    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)


decl_type: formula
theory: h_menger
library: graphs
signature: nil
location: 42 2 46 56
body:
    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)


decl_type: formula
theory: h_menger
library: graphs
signature: nil
location: 50 2 54 55
body:
    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)


decl_type: formula
theory: h_menger
library: graphs
signature: nil
location: 56 2 60 62
body:
    seq_j: LEMMA (length(p) > 3 AND edge?(G)(seq(p)(length(p)-2),t) AND
                 NOT edge?(G)(seq(p)(0),t)) IMPLIES 
                   (EXISTS (j: nat): j > 0 AND j < length(p) AND
                                     NOT edge?(G)(seq(p)(j - 1), t)
                                     AND edge?(G)(seq(p)(j), t))


decl_type: formula
theory: h_menger
library: graphs
signature: nil
location: 62 2 69 77
body:
    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))


decl_type: formula
theory: h_menger
library: graphs
signature: nil
location: 71 2 77 67
body:
    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))


decl_type: formula
theory: h_menger
library: graphs
signature: nil
location: 79 2 84 67
body:
    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))


decl_type: formula
theory: h_menger
library: graphs
signature: nil
location: 87 2 91 76
body:
    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))


decl_type: tcc
theory: h_menger
library: graphs
signature: nil
location: 104 0 108 999
body:
  % Subtype TCC generated (at line 56, column 50) for  length(p) - 2
      % expected type  below[p`length]
  seq_j_TCC1: OBLIGATION
    FORALL (p: prewalk[T]):
      length(p) > 3 IMPLIES length(p) - 2 >= 0 AND length(p) - 2 < p`length;


decl_type: tcc
theory: h_menger
library: graphs
signature: nil
location: 110 0 115 999
body:
  % Subtype TCC generated (at line 57, column 35) for  0
      % expected type  below[p`length]
  seq_j_TCC2: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], t: T):
      length(p) > 3 AND edge?(G)(seq(p)(length(p) - 2), t) IMPLIES
       0 < p`length;


decl_type: tcc
theory: h_menger
library: graphs
signature: nil
location: 117 0 125 999
body:
  % Subtype TCC generated (at line 59, column 55) for  j - 1
      % expected type  below[p`length]
  seq_j_TCC3: OBLIGATION
    FORALL (G: graph[T], p: prewalk[T], t: T):
      NOT edge?(G)(seq(p)(0), t) AND
       edge?(G)(seq(p)(length(p) - 2), t) AND length(p) > 3
       IMPLIES
       (FORALL (j: nat):
          j < length(p) AND j > 0 IMPLIES j - 1 >= 0 AND j - 1 < p`length);


decl_type: formula
theory: old_menger
library: graphs
signature: nil
location: 22 3 26 76
body:
     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))


decl_type: function
theory: abstract_max
library: graphs
signature: [T -> bool]
location: 53 3 54 74
body:
     maximal?(S): bool = P(S) AND 
                         (FORALL (SS: T): P(SS) IMPLIES size(S) >= size(SS))


decl_type: formula
theory: cycle_deg
library: graphs
signature: nil
location: 24 4 27 61
body:
      conn_compon: LEMMA FORALL (G: graph[T], x: (vert(G))): EXISTS H:
                        (subgraph?(H,G) AND 
                          connected?(H) and vert(H)(x) and 
                            FORALL (y:(vert(H))): (deg(y,G)=deg(y,H)))  


decl_type: formula
theory: cycle_deg
library: graphs
signature: nil
location: 31 4 32 67
body:
      sub_cycle: LEMMA FORALL (G,H: graph[T], w: Seq(H)): subgraph?(H,G) 
                                  and cycle?(H,w) IMPLIES cycle?(G,w)


decl_type: formula
theory: cycle_deg
library: graphs
signature: nil
location: 38 4 39 64
body:
      uniq_del_vert: LEMMA FORALL (G:graph[T], v:(vert(G))): uniq_paths?(G) 
                                IMPLIES uniq_paths?(del_vert(G,v))


decl_type: formula
theory: cycle_deg
library: graphs
signature: nil
location: 41 4 42 76
body:
      del_edge_uniq: LEMMA FORALL (G:graph[T], e:(edges(G))): 
                          connected?(del_edge(G,e)) IMPLIES NOT uniq_paths?(G) 


decl_type: formula
theory: cycle_deg
library: graphs
signature: nil
location: 47 4 48 70
body:
      exclus_cycl: THEOREM connected?(G) IMPLIES 
                           tree?(G) XOR (EXISTS (w:Seq(G)): cycle?(G,w))


decl_type: formula
theory: cycle_deg
library: graphs
signature: nil
location: 59 4 61 35
body:
      deg_gt_1_cycle: LEMMA  (FORALL (v: T): vert(G)(v) IMPLIES deg(v,G) > 1)
                              IMPLIES (EXISTS (w: Seq(G)): cycle?(G,w)) OR 
                            empty?(G)


decl_type: function
theory: cycle_deg
library: graphs
signature: [[graph[T], T] -> finite_set[T]]
location: 14 3 16 70
body:
     reachable(G: graph[T],x:T): finite_set[T] = 
                        {y: T |  vert(G)(y) AND 
                              (EXISTS (w: Seq(G)): walk_from?(G,w,x,y))}


decl_type: function
theory: cycle_deg
library: graphs
signature: [graph[T] -> bool]
location: 35 4 36 64
body:
      uniq_paths?(G):bool = FORALL (s,t,p,q): path_from?(G,p,s,t) AND
                                 path_from?(G,q,s,t) IMPLIES   p=q


decl_type: tcc
theory: cycle_deg
library: graphs
signature: nil
location: 70 0 78 999
body:
  % Subtype TCC generated (at line 15, column 22) for
      % {y: T | vert(G)(y) AND (EXISTS (w: Seq(G)): walk_from?(G, w, x, y))}
      % expected type  finite_set[T]
  reachable_TCC1: OBLIGATION
    FORALL (G: graph[T], x: T):
      is_finite[T]
          ({y: T |
              vert(G)(y) AND
               (EXISTS (w: Seq[T](G)): walk_from?[T](G, w, x, y))});


decl_type: tcc
theory: cycle_deg
library: graphs
signature: nil
location: 80 0 84 999
body:
  % Subtype TCC generated (at line 32, column 65) for  w
      % expected type  Seq[T](G)
  sub_cycle_TCC1: OBLIGATION
    FORALL (G, H: graph[T], w: Seq[T](H)):
      subgraph?(H, G) AND cycle?(H, w) IMPLIES verts_in?[T](G, w);


decl_type: formula
theory: reduce_walks
library: graphs
signature: nil
location: 23 3 26 57
body:
     reduce_lem: LEMMA FORALL (w: Walk(G), 
                              k: {n: nat | n > 0 AND n < length(w)-1}):
         w(k-1) = w(k+1) AND length(w) > 3 IMPLIES
            reduce(G,w,k) = w^(0,k-1) o w^(k+2,length(w)-1)


decl_type: function
theory: reduce_walks
library: graphs
location: 11 3 21 27
signature:
  [d:
          [G: graph[T], w: Long_walk(G),
           {n: nat | n > 0 AND n < length(w) - 1}] ->
          Walk[T](d`1)]

body:
     reduce(G: graph[T], w: Long_walk(G), 
            k: {n: nat | n > 0 AND n < length(w)-1}): Walk(G) =
                        IF w(k-1) = w(k+1) THEN
                            (# length := length(w) - 2,
                            seq := (LAMBDA (i: below(length(w)-2)):
                                       IF i < k THEN w(i)
                                       ELSE w(i+2)
                                       ENDIF) #) 
                        ELSE
                            w
                        ENDIF


decl_type: tcc
theory: reduce_walks
library: graphs
signature: nil
location: 36 0 41 999
body:
  % Subtype TCC generated (at line 13, column 27) for  k - 1
      % expected type  below[length(w)]
  reduce_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      k - 1 >= 0 AND k - 1 < length(w);


decl_type: tcc
theory: reduce_walks
library: graphs
signature: nil
location: 43 0 48 999
body:
  % Subtype TCC generated (at line 13, column 36) for  k + 1
      % expected type  below[length(w)]
  reduce_TCC2: OBLIGATION
    FORALL (G: graph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      k + 1 < length(w);


decl_type: tcc
theory: reduce_walks
library: graphs
signature: nil
location: 50 0 56 999
body:
  % Subtype TCC generated (at line 14, column 39) for  length(w) - 2
      % expected type  nat
  reduce_TCC3: OBLIGATION
    FORALL (G: graph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) IMPLIES
       length(w) - 2 >= 0;


decl_type: tcc
theory: reduce_walks
library: graphs
signature: nil
location: 58 0 64 999
body:
  % Subtype TCC generated (at line 16, column 53) for  i
      % expected type  below[length(w)]
  reduce_TCC4: OBLIGATION
    FORALL (G: graph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) IMPLIES
       (FORALL (i: below(length(w) - 2)): i < k IMPLIES i < length(w));


decl_type: tcc
theory: reduce_walks
library: graphs
signature: nil
location: 66 0 73 999
body:
  % Subtype TCC generated (at line 17, column 44) for  i + 2
      % expected type  below[length(w)]
  reduce_TCC5: OBLIGATION
    FORALL (G: graph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) IMPLIES
       (FORALL (i: below(length(w) - 2)):
          NOT i < k IMPLIES i + 2 < length(w));


decl_type: tcc
theory: reduce_walks
library: graphs
signature: nil
location: 75 0 95 999
body:
  % Subtype TCC generated (at line 14, column 26) for
      % (# length := length(w) - 2,
      %    seq
      %      := (LAMBDA (i: below(length(w) - 2)):
      %            IF i < k THEN finseq_appl[T](w)(i)
      %            ELSE finseq_appl[T](w)(i + 2)
      %            ENDIF) #)
      % expected type  Walk[T](G)
  reduce_TCC6: OBLIGATION
    FORALL (G: graph[T], w: Long_walk(G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) IMPLIES
       length(w) - 2 > 0 AND
        walk?[T]
            (G,
             (# length := length(w) - 2,
                seq
                  := (LAMBDA (i: below(length(w) - 2)):
                        IF i < k THEN finseq_appl[T](w)(i)
                        ELSE finseq_appl[T](w)(i + 2)
                        ENDIF) #));


decl_type: tcc
theory: reduce_walks
library: graphs
signature: nil
location: 97 0 102 999
body:
  % Subtype TCC generated (at line 25, column 9) for  k - 1
      % expected type  below[length(w)]
  reduce_lem_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Walk[T](G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      k - 1 >= 0 AND k - 1 < length(w);


decl_type: tcc
theory: reduce_walks
library: graphs
signature: nil
location: 104 0 109 999
body:
  % Subtype TCC generated (at line 25, column 18) for  k + 1
      % expected type  below[length(w)]
  reduce_lem_TCC2: OBLIGATION
    FORALL (G: graph[T], w: Walk[T](G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      k + 1 < length(w);


decl_type: tcc
theory: reduce_walks
library: graphs
signature: nil
location: 111 0 117 999
body:
  % Subtype TCC generated (at line 26, column 31) for  k - 1
      % expected type  nat
  reduce_lem_TCC3: OBLIGATION
    FORALL (G: graph[T], w: Walk[T](G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) AND length(w) > 3
       IMPLIES k - 1 >= 0;


decl_type: tcc
theory: reduce_walks
library: graphs
signature: nil
location: 119 0 125 999
body:
  % Subtype TCC generated (at line 26, column 45) for  length(w) - 1
      % expected type  nat
  reduce_lem_TCC4: OBLIGATION
    FORALL (G: graph[T], w: Walk[T](G),
            k: {n: nat | n > 0 AND n < length(w) - 1}):
      finseq_appl[T](w)(k - 1) = finseq_appl[T](w)(k + 1) AND length(w) > 3
       IMPLIES length(w) - 1 >= 0;


decl_type: formula
theory: min_walk_reduced
library: graphs
signature: nil
location: 12 3 13 73
body:
     min_walk_vert: LEMMA FORALL (Gw: gr_walk(x,y)): i < length(min_walk_from(x,y,Gw))
                                 IMPLIES vert(Gw)(min_walk_from(x,y,Gw)(i))


decl_type: formula
theory: min_walk_reduced
library: graphs
signature: nil
location: 15 3 16 71
body:
     min_walk_is_reduced: LEMMA FORALL (Gw: gr_walk(x,y)):
                                       reduced?(Gw,min_walk_from(x,y,Gw))


decl_type: function
theory: min_walk_reduced
library: graphs
signature: [[G: graph[T], Seq[T](G)] -> bool]
location: 7 3 8 81
body:
     reduced?(G: graph[T], w: Seq(G)): bool = 
            (FORALL (k: nat): k > 0 AND k < length(w) - 1 IMPLIES w(k-1) /= w(k+1))


decl_type: tcc
theory: min_walk_reduced
library: graphs
signature: nil
location: 24 0 28 999
body:
  % Subtype TCC generated (at line 8, column 66) for  k - 1
      % expected type  below[length(w)]
  reduced?_TCC1: OBLIGATION
    FORALL (G: graph[T], w: Seq[T](G), k: nat):
      k > 0 AND k < length(w) - 1 IMPLIES k - 1 >= 0 AND k - 1 < length(w);


decl_type: tcc
theory: min_walk_reduced
library: graphs
signature: nil
location: 30 0 34 999
body:
  % Subtype TCC generated (at line 8, column 76) for  k + 1
      % expected type  below[length(w)]
  reduced?_TCC2: OBLIGATION
    FORALL (G: graph[T], w: Seq[T](G), k: nat):
      k > 0 AND k < length(w) - 1 IMPLIES k + 1 < length(w);


decl_type: formula
theory: ramsey_new
library: graphs
signature: nil
location: 22 2 24 59
body:
    subgraph_clique: LEMMA (FORALL (V: set[T]): 
                               contains_clique(subgraph(g, V), p)
                               IMPLIES contains_clique(g, p))


decl_type: formula
theory: ramsey_new
library: graphs
signature: nil
location: 26 2 28 58
body:
    subgraph_indep : LEMMA (FORALL (V: set[T]): 
                               contains_indep(subgraph(g, V), p)
                               IMPLIES contains_indep(g, p))


decl_type: formula
theory: ramsey_new
library: graphs
signature: nil
location: 59 2 63 48
body:
    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)))))


decl_type: formula
theory: ramsey_new
library: graphs
signature: nil
location: 66 2 69 68
body:
    ramseys_theorem: THEOREM (EXISTS (n: posnat):
                                 (FORALL (G: Graph[T]): size(G) >= n
                                     IMPLIES (contains_clique(G, l1) OR
                                              contains_indep(G, l2))))


decl_type: function
theory: ramsey_new
library: graphs
signature: [[graph[T], nat] -> bool]
location: 12 2 15 69
body:
    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)))


decl_type: function
theory: ramsey_new
library: graphs
signature: [[graph[T], nat] -> bool]
location: 17 2 20 74
body:
    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)))


decl_type: function
theory: ramsey_new
library: graphs
signature: [Graph[T] -> finite_set[T]]
location: 32 2 33 63
body:
    r1(G): finite_set[T] = (LET v0 = choose(vert(G)) IN
             { n: T | vert(G)(n) AND n /= v0 AND edge?(G)(v0,n)})


decl_type: function
theory: ramsey_new
library: graphs
signature: [Graph[T] -> finite_set[T]]
location: 35 2 36 67
body:
    r2(G): finite_set[T] = (LET v0 = choose(vert(G)) IN
             { n: T | vert(G)(n) AND n /= v0 AND NOT edge?(G)(v0,n)})


decl_type: tcc
theory: ramsey_new
library: graphs
signature: nil
location: 78 0 80 999
body:
  % Subtype TCC generated (at line 32, column 42) for  vert(G)
      % expected type  p: (nonempty?[T])
  r1_TCC1: OBLIGATION FORALL (G: Graph[T]): nonempty?[T](vert(G));


decl_type: tcc
theory: ramsey_new
library: graphs
signature: nil
location: 82 0 88 999
body:
  % Subtype TCC generated (at line 33, column 11) for
      % {n: T | vert(G)(n) AND n /= v0 AND edge?(G)(v0, n)}
      % expected type  finite_set[T]
  r1_TCC2: OBLIGATION
    FORALL (G: Graph[T], v0: (vert(G))):
      v0 = choose(vert(G)) IMPLIES
       is_finite[T]({n: T | vert(G)(n) AND n /= v0 AND edge?[T](G)(v0, n)});


decl_type: tcc
theory: ramsey_new
library: graphs
signature: nil
location: 90 0 97 999
body:
  % Subtype TCC generated (at line 36, column 11) for
      % {n: T | vert(G)(n) AND n /= v0 AND NOT edge?(G)(v0, n)}
      % expected type  finite_set[T]
  r2_TCC1: OBLIGATION
    FORALL (G: Graph[T], v0: (vert(G))):
      v0 = choose(vert(G)) IMPLIES
       is_finite[T]
           ({n: T | vert(G)(n) AND n /= v0 AND NOT edge?[T](G)(v0, n)});


decl_type: formula
theory: graph_from_edges
library: graphs
signature: nil
location: 20 3 21 69
body:
     Union_to_pred: LEMMA FORALL x: Union(ES)(x) 
                            => EXISTS (d: doubleton[T]): ES(d) AND d(x)


decl_type: formula
theory: graph_from_edges
library: graphs
signature: nil
location: 23 3 24 34
body:
     pred_to_Union: LEMMA FORALL x: (EXISTS (d: doubleton[T]): ES(d) AND d(x))
                            => Union(ES)(x)


decl_type: formula
theory: graph_from_edges
library: graphs
signature: nil
location: 51 3 53 54
body:
     no_isolated_verts: LEMMA Let G = graph_from_edgeset(ES) IN 
                              vert(G)(v) IMPLIES
                                 NOT isolated_vert?(G,v)


decl_type: type
theory: graph_from_edges
library: graphs
signature: nil
location: 40 3 41 63
body:
     es_graph: TYPE = {G: graph[T] | FORALL (v: (vert(G))):
                                         NOT isolated_vert?(G,v)}


decl_type: function
theory: graph_from_edges
library: graphs
signature: [finite_set[doubleton[T]] -> finite_set[T]]
location: 30 3 31 55
body:
     verts_from(ES): finite_set[T] = {t:T | EXISTS (d: doubleton[T]): 
                                          d(t) AND ES(d)}


decl_type: function
theory: graph_from_edges
library: graphs
signature: [finite_set[doubleton[T]] -> es_graph]
location: 43 3 46 15
body:
     graph_from_edgeset(ES): es_graph =
               (# vert := verts_of(ES),
                  edges := ES
               #)


decl_type: tcc
theory: graph_from_edges
library: graphs
signature: nil
location: 64 0 69 999
body:
  % Subtype TCC generated (at line 27, column 33) for
      % Union(extend[setof[T], doubleton[T], bool, FALSE](ES))
      % expected type  finite_set[T]
  verts_of_TCC1: OBLIGATION
    FORALL (ES: finite_set[doubleton[T]]):
      is_finite[T](Union[T](extend[setof[T], doubleton[T], bool, FALSE](ES)));


decl_type: tcc
theory: graph_from_edges
library: graphs
signature: nil
location: 71 0 76 999
body:
  % Subtype TCC generated (at line 30, column 35) for
      % {t: T | EXISTS (d: doubleton[T]): d(t) AND ES(d)}
      % expected type  finite_set[T]
  verts_from_TCC1: OBLIGATION
    FORALL (ES: finite_set[doubleton[T]]):
      is_finite[T]({t: T | EXISTS (d: doubleton[T]): d(t) AND ES(d)});


decl_type: tcc
theory: graph_from_edges
library: graphs
signature: nil
location: 78 0 87 999
body:
  % Subtype TCC generated (at line 44, column 13) for
      % (# vert := verts_of(ES), edges := ES #)
      % expected type  es_graph
  graph_from_edgeset_TCC1: OBLIGATION
    FORALL (ES: finite_set[doubleton[T]]):
      (FORALL (e: doubleton[T]):
         ES(e) IMPLIES (FORALL (x: T): e(x) IMPLIES verts_of(ES)(x)))
       AND
       (FORALL (v: (verts_of(ES))):
          NOT isolated_vert?((# vert := verts_of(ES), edges := ES #), v));


decl_type: tcc
theory: top
library: groups
signature: nil
location: 38 0 41 999
body:
  % Assuming TCC generated (at line 31, column 13) for
      % sylow_theorems[T, *, one]
      % generated from assumption sylow_theorems.T_is_group
  IMP_sylow_theorems_TCC1: OBLIGATION group?[T, *, one](fullset[T]);


decl_type: formula
theory: cauchy_scaf
library: groups
signature: nil
location: 43 1 46 72
body:
   add_element_add_set: LEMMA NOT member(a, M) IMPLIES 
                          LET B = add_set(S)(M),
                              A = add_element(S)(a) IN
                          Union(add_set(S)(add(a, M)))= union(Union(B), A)


decl_type: formula
theory: cauchy_scaf
library: groups
signature: nil
location: 48 1 50 61
body:
   card_add_element_aux: LEMMA 
                           LET A = add_element(S)(a) IN
                           EXISTS (g:[(A)->(S)]): bijective?(g)


decl_type: formula
theory: cauchy_scaf
library: groups
signature: nil
location: 53 1 55 42
body:
   card_add_element: LEMMA 
                           LET A = add_element(S)(a) IN
                           card(A) = card(S)


decl_type: formula
theory: cauchy_scaf
library: groups
signature: nil
location: 57 1 60 69
body:
   disjoint_add_set: LEMMA 
                       LET B = add_set(S)(M),
                           A = add_element(S)(a) IN
                         NOT member(a, M) IMPLIES disjoint?(Union(B),A)


decl_type: formula
theory: cauchy_scaf
library: groups
signature: nil
location: 62 1 65 60
body:
   add_set_is_add_ele: LEMMA 
                         LET B = add_set(S)(M),
                             A = add_element(S)(a) IN
                         M = singleton(a) IMPLIES Union(B) = A


decl_type: formula
theory: cauchy_scaf
library: groups
signature: nil
location: 67 1 70 64
body:
   add_set_is_finite_aux: LEMMA
                           nonempty?(S) IMPLIES
                              LET B = add_set(S)(M) IN
                              EXISTS (g:[(M)->(B)]): bijective?(g)


decl_type: formula
theory: cauchy_scaf
library: groups
signature: nil
location: 72 1 74 33
body:
   add_set_is_finite: LEMMA
                       LET B = add_set(S)(M) IN
                       is_finite(B)


decl_type: formula
theory: cauchy_scaf
library: groups
signature: nil
location: 78 1 80 50
body:
   card_add_set: LEMMA 
                    LET B = add_set(S)(M) IN
                    card(Union(B)) = card(S)*card(M)


decl_type: formula
theory: cauchy_scaf
library: groups
signature: nil
location: 83 1 85 34
body:
   set_seq_is_finite: LEMMA 
                        LET C = set_seq(M)(n) IN
                        is_finite(C)


decl_type: formula
theory: cauchy_scaf
library: groups
signature: nil
location: 87 1 90 48
body:
   set_seq_is_add_set: LEMMA 
                          LET C = set_seq(M)(p),
                              D = set_seq(M)(p-1) IN
                          C = Union(add_set(D)(M))


decl_type: formula
theory: cauchy_scaf
library: groups
signature: nil
location: 94 1 96 39
body:
   card_set_seq: LEMMA 
                      LET C = set_seq(M)(n) IN
                      card(C) = card(M)^n


decl_type: function
theory: cauchy_scaf
library: groups
signature: [finite_set[T] -> [nat -> set[finseq]]]
location: 31 1 32 85
body:
   set_seq(M)(n): set[finseq] = {seq: finseq | length(seq) = n AND 
                                               FORALL (i: below[n]): member(seq(i), M)}


decl_type: tcc
theory: cauchy_scaf
library: groups
signature: nil
location: 103 0 107 999
body:
  % Subtype TCC generated (at line 33, column 78) for  i
      % expected type  below[length(seq)]
  set_seq_TCC1: OBLIGATION
    FORALL (n: nat, seq: finseq[T]):
      length(seq) = n IMPLIES (FORALL (i: below[n]): i < length(seq));


decl_type: tcc
theory: cauchy_scaf
library: groups
signature: nil
location: 109 0 113 999
body:
  % Subtype TCC generated (at line 56, column 30) for  A
      % expected type  S: finite_set[finseq[T]]
  card_add_element_TCC1: OBLIGATION
    FORALL (S: finite_set[finseq], a: T, A: set[finseq[T]]):
      A = add_element(S)(a) IMPLIES is_finite[finseq[T]](A);


decl_type: tcc
theory: cauchy_scaf
library: groups
signature: nil
location: 115 0 120 999
body:
  % Subtype TCC generated (at line 81, column 23) for  Union(B)
      % expected type  S: finite_set[finseq[T]]
  card_add_set_TCC1: OBLIGATION
    FORALL (M: finite_set[T], S: finite_set[finseq],
            B: setofsets[finseq[T]]):
      B = add_set(S)(M) IMPLIES is_finite[finseq[T]](Union[finseq[T]](B));


decl_type: tcc
theory: cauchy_scaf
library: groups
signature: nil
location: 122 0 126 999
body:
  % Subtype TCC generated (at line 90, column 43) for  p - 1
      % expected type  nat
  set_seq_is_add_set_TCC1: OBLIGATION
    FORALL (M: finite_set[T], p: posnat, C: set[finseq[T]]):
      C = set_seq(M)(p) IMPLIES p - 1 >= 0;


decl_type: tcc
theory: cauchy_scaf
library: groups
signature: nil
location: 128 0 134 999
body:
  % Subtype TCC generated (at line 91, column 42) for  D
      % expected type  finite_set[finseq]
  set_seq_is_add_set_TCC2: OBLIGATION
    FORALL (M: finite_set[T], p: posnat, C: set[finseq[T]]):
      C = set_seq(M)(p) IMPLIES
       (FORALL (D: set[finseq[T]]):
          D = set_seq(M)(p - 1) IMPLIES is_finite[finseq[T]](D));


decl_type: tcc
theory: cauchy_scaf
library: groups
signature: nil
location: 136 0 140 999
body:
  % Subtype TCC generated (at line 97, column 25) for  C
      % expected type  S: finite_set[finseq[T]]
  card_set_seq_TCC1: OBLIGATION
    FORALL (M: finite_set[T], n: nat, C: set[finseq[T]]):
      C = set_seq(M)(n) IMPLIES is_finite[finseq[T]](C);


decl_type: tcc
theory: cauchy_scaf
library: groups
signature: nil
location: 142 0 146 999
body:
  % Subtype TCC generated (at line 97, column 38) for  n
      % expected type  {i: int | card(M) /= 0 OR i >= 0}
  card_set_seq_TCC2: OBLIGATION
    FORALL (M: finite_set[T], n: nat, C: set[finseq[T]]):
      C = set_seq(M)(n) IMPLIES card[T](M) /= 0 OR n >= 0;


decl_type: tcc
theory: zp_group
library: groups
signature: nil
location: 35 0 37 999
body:
  % Subtype TCC generated (at line 24, column 40) for  0
      % expected type  below(n)
  Zn_group_TCC1: OBLIGATION 0 < n;


decl_type: tcc
theory: zp_group
library: groups
signature: nil
location: 39 0 41 999
body:
  % Existence TCC generated (at line 24, column 19) for
      % group?[below(n), ++, 0]
  Zn_group_TCC2: OBLIGATION EXISTS (x: below(n)): TRUE;


decl_type: tcc
theory: zp_group
library: groups
signature: nil
location: 43 0 45 999
body:
  % Subtype TCC generated (at line 28, column 23) for  Zn
      % expected type  S: finite_set[below(n)]
  Zn_card_TCC1: OBLIGATION is_finite[below(n)](Zn);


decl_type: formula
theory: right_left_cosets
library: groups
signature: nil
location: 38 3 39 78
body:
     nonempty_left_coset: LEMMA  subgroup?(H,G) AND member(a,G) IMPLIES
                                                   nonempty?(left_coset(G,H)(a))


decl_type: formula
theory: right_left_cosets
library: groups
signature: nil
location: 42 3 44 60
body:
     left_coset_finite: LEMMA 
         FORALL (G:finite_group): subgroup?(H,G) AND member(a,G) IMPLIES
                                 is_finite(left_coset(G,H)(a))


decl_type: formula
theory: right_left_cosets
library: groups
signature: nil
location: 47 3 50 49
body:
     left_coset_correspondence: LEMMA 
          FORALL (A:set[T]): subgroup?(H,G) AND member(a,G) AND A = left_coset(G,H)(a)
            IMPLIES
               EXISTS (f:[(H)->(A)]): bijective?(f)


decl_type: formula
theory: right_left_cosets
library: groups
signature: nil
location: 52 3 55 58
body:
     left_coset_correspondence_inv: LEMMA 
         subgroup?(H,G) AND member(a,G)
            IMPLIES
               EXISTS (f:[(H)->(a*H*inv(a))]): bijective?(f) 


decl_type: formula
theory: right_left_cosets
library: groups
signature: nil
location: 58 3 61 66
body:
     finite_left_coset_correspondence: LEMMA 
          FORALL (G:finite_group): subgroup?(H,G) AND member(a,G) AND member(b,G) 
            IMPLIES
                 card(left_coset(G,H)(a)) = card(left_coset(G,H)(b))


decl_type: formula
theory: right_left_cosets
library: groups
signature: nil
location: 67 3 68 60
body:
     left_cosets_disjoint: LEMMA FORALL (H: subgroup(G), A,B: left_cosets(G, H)):
                                       A = B OR disjoint?(A,B)


decl_type: formula
theory: right_left_cosets
library: groups
signature: nil
location: 70 3 71 75
body:
     left_cosets_partition: LEMMA FORALL (G:finite_group, H: subgroup(G)):
                                      finite_partition?[T](left_cosets(G, H))


decl_type: formula
theory: right_left_cosets
library: groups
signature: nil
location: 77 3 79 81
body:
     right_left_correspondence: LEMMA  
       subgroup?(H,G) IMPLIES
             EXISTS (f:[(right_cosets(G, H)) -> (left_cosets(G,H))]): bijective?(f)


decl_type: formula
theory: right_left_cosets
library: groups
signature: nil
location: 82 3 85 74
body:
     finite_right_left_correspondence: LEMMA  
          FORALL (G:finite_group): subgroup?(H,G) 
           IMPLIES
            card[set[T]](right_cosets(G,H)) = card[set[T]](left_cosets(G,H))


decl_type: formula
theory: right_left_cosets
library: groups
signature: nil
location: 92 3 94 1
body:
     index_gt1: LEMMA FORALL (G:finite_group, H:subgroup(G)): index(G,H) >= 1

  ;%% define G/N as set of all left cosets of N in G


decl_type: formula
theory: right_left_cosets
library: groups
signature: nil
location: 101 3 102 68
body:
     card_factor: LEMMA finite_group?(G) AND normal_subgroup?(N, G)
                                IMPLIES card[set[T]](G/N) = index(G,N)


decl_type: function
theory: right_left_cosets
library: groups
location: 96 3 99 1
signature:
  [d: [G: group[T, *, one], normal_subgroup[T, *, one](G)] ->
          group
              [left_cosets[T, *, one](d`1, d`2), mult(d`1, d`2), d`2]]

body:
     /(G: group[T,*,one], N: normal_subgroup(G)): group[left_cosets(G,N),mult(G,N),N] = left_cosets(G, N)


  ;%% order of G/N


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 110 0 113 999
body:
  % Assuming TCC generated (at line 22, column 13) for
      % algebra@lagrange[T, *, one]
      % generated from assumption lagrange.fullset_is_group
  IMP_lagrange_TCC1: OBLIGATION group?[T, *, one](fullset[T]);


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 115 0 119 999
body:
  % Subtype TCC generated (at line 40, column 75) for  a
      % expected type  (G)
  nonempty_left_coset_TCC1: OBLIGATION
    FORALL (G, H: group[T, *, one], a: T):
      member(a, G) AND subgroup?(H, G) IMPLIES G(a);


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 121 0 125 999
body:
  % Subtype TCC generated (at line 45, column 57) for  a
      % expected type  (G)
  left_coset_finite_TCC1: OBLIGATION
    FORALL (H: group[T, *, one], a: T, G: finite_group[T, *, one]):
      subgroup?(H, G) AND member(a, G) IMPLIES G(a);


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 127 0 132 999
body:
  % Subtype TCC generated (at line 62, column 20) for  left_coset(G, H)(a)
      % expected type  S: finite_set[T]
  finite_left_coset_correspondence_TCC1: OBLIGATION
    FORALL (H: group[T, *, one], a, b: T, G: finite_group[T, *, one]):
      subgroup?(H, G) AND member(a, G) AND member(b, G) IMPLIES
       is_finite[T](left_coset[T, *, one](G, H)(a));


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 134 0 138 999
body:
  % Subtype TCC generated (at line 62, column 63) for  b
      % expected type  (G)
  finite_left_coset_correspondence_TCC2: OBLIGATION
    FORALL (H: group[T, *, one], a, b: T, G: finite_group[T, *, one]):
      subgroup?(H, G) AND member(a, G) AND member(b, G) IMPLIES G(b);


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 140 0 145 999
body:
  % Subtype TCC generated (at line 62, column 47) for  left_coset(G, H)(b)
      % expected type  S: finite_set[T]
  finite_left_coset_correspondence_TCC3: OBLIGATION
    FORALL (H: group[T, *, one], a, b: T, G: finite_group[T, *, one]):
      subgroup?(H, G) AND member(a, G) AND member(b, G) IMPLIES
       is_finite[T](left_coset[T, *, one](G, H)(b));


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 147 0 151 999
body:
  % Subtype TCC generated (at line 86, column 23) for  right_cosets(G, H)
      % expected type  S: finite_set[set[T]]
  finite_right_left_correspondence_TCC1: OBLIGATION
    FORALL (H: group[T, *, one], G: finite_group[T, *, one]):
      subgroup?(H, G) IMPLIES is_finite[set[T]](right_cosets(G, H));


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 153 0 157 999
body:
  % Subtype TCC generated (at line 86, column 57) for  left_cosets(G, H)
      % expected type  S: finite_set[set[T]]
  finite_right_left_correspondence_TCC2: OBLIGATION
    FORALL (H: group[T, *, one], G: finite_group[T, *, one]):
      subgroup?(H, G) IMPLIES is_finite[set[T]](left_cosets(G, H));


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 159 0 163 999
body:
  % Subtype TCC generated (at line 91, column 60) for  left_cosets(G, H)
      % expected type  S: finite_set[set[T]]
  index_TCC1: OBLIGATION
    FORALL (G: finite_group[T, *, one], H: subgroup[T, *, one](G)):
      is_finite[set[T]](left_cosets(G, H));


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 165 0 170 999
body:
  % Subtype TCC generated (at line 97, column 48) for
      % group[left_cosets(G, N), mult(G, N), N]
      % expected type  left_cosets[T, *, one](G, N)
  divide_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], N: normal_subgroup(G)):
      EXISTS (a: (G)): N = *[T, *, one](a, N);


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 172 0 177 999
body:
  % Assuming TCC generated (at line 97, column 48) for
      % group[left_cosets(G, N), mult(G, N), N]
      % generated from assumption group.fullset_is_group
  divide_TCC2: OBLIGATION
    FORALL (G: group[T, *, one], N: normal_subgroup(G)):
      group?[left_cosets(G, N), mult(G, N), N](fullset[left_cosets(G, N)]);


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 179 0 183 999
body:
  % Existence TCC generated (at line 97, column 48) for
      % group[left_cosets(G, N), mult(G, N), N]
  divide_TCC3: OBLIGATION
    FORALL (G: group[T, *, one], N: normal_subgroup(G)):
      EXISTS (x: left_cosets[T, *, one](G, N)): TRUE;


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 185 0 189 999
body:
  % Subtype TCC generated (at line 97, column 101) for  N
      % expected type  subgroup[T, *, one](G)
  divide_TCC4: OBLIGATION
    FORALL (G: group[T, *, one], N: normal_subgroup[T, *, one](G)):
      subgroup?[T, *, one](N, G);


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 191 0 199 999
body:
  % Subtype TCC generated (at line 97, column 86) for
      % restrict[setof[T], left_cosets[T, *, one](G, N), boolean]
      %     (left_cosets(G, N))
      % expected type  group[left_cosets(G, N), mult(G, N), N]
  divide_TCC5: OBLIGATION
    FORALL (G: group[T, *, one], N: normal_subgroup[T, *, one](G)):
      group?[left_cosets[T, *, one](G, N), mult[T, *, one](G, N), N]
          (restrict[setof[T], left_cosets[T, *, one](G, N), boolean]
               (left_cosets(G, N)));


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 201 0 208 999
body:
  % Subtype TCC generated (at line 103, column 51) for
      % extend[set[T], left_cosets[T, *, one](G, N), bool, FALSE](G / N)
      % expected type  S: finite_set[set[T]]
  card_factor_TCC1: OBLIGATION
    FORALL (G, N: group[T, *, one]):
      normal_subgroup?(N, G) AND finite_group?(G) IMPLIES
       is_finite[set[T]]
           (extend[set[T], left_cosets[T, *, one](G, N), bool, FALSE](G / N));


decl_type: tcc
theory: right_left_cosets
library: groups
signature: nil
location: 210 0 215 999
body:
  % Subtype TCC generated (at line 103, column 66) for  N
      % expected type  subgroup[T, *, one](G)
  card_factor_TCC2: OBLIGATION
    FORALL (G, N: group[T, *, one]):
      normal_subgroup?(N, G) AND finite_group?(G) IMPLIES
       subgroup?[T, *, one](N, G);


decl_type: formula
theory: general_properties
library: groups
signature: nil
location: 49 3 50 64
body:
     product_only_power: LEMMA only_power_p(fs, p) IMPLIES 
                                EXISTS (n: nat): product(fs) = p^n


decl_type: formula
theory: general_properties
library: groups
signature: nil
location: 54 3 55 83
body:
     divides_prime_power: LEMMA prime?(p) AND divides(q, p^j) 
                                        IMPLIES (EXISTS (i: nat): i <= j AND q = p^i)


decl_type: formula
theory: general_properties
library: groups
signature: nil
location: 62 3 62 106
body:
     gcd_1_ndp: LEMMA prime?(p) AND gcd(m,p) = 1 AND m = x*y IMPLIES (NOT divides(p,x) AND NOT divides(p,y))


decl_type: function
theory: general_properties
library: groups
signature: [[posnat, posnat] -> fseq[posnat]]
location: 32 3 33 95
body:
     seq_power(p,i): fseq = (# length := i,
                                  seq := (LAMBDA (j: nat): IF j < i THEN p ELSE default ENDIF) #)


decl_type: tcc
theory: general_properties
library: groups
signature: nil
location: 72 0 79 999
body:
  % Subtype TCC generated (at line 34, column 40) for
      % (LAMBDA (j: nat): IF j < i THEN p ELSE default ENDIF)
      % expected type  barray[posnat](i)
  seq_power_TCC1: OBLIGATION
    FORALL (p: posnat, i: posnat):
      FORALL (i_1: nat):
        i_1 >= i IMPLIES
         IF i_1 < i THEN p ELSE default[posnat] ENDIF = default[posnat];


decl_type: tcc
theory: general_properties
library: groups
signature: nil
location: 81 0 85 999
body:
  % Subtype TCC generated (at line 36, column 93) for  i
      % expected type  {i: int | p /= 0 OR i >= 0}
  only_power_p_TCC1: OBLIGATION
    FORALL (fs: fseq[posnat], p: posnat, j: below(fs`length), i: nat):
      p /= 0 OR i >= 0;


decl_type: tcc
theory: general_properties
library: groups
signature: nil
location: 87 0 90 999
body:
  % Subtype TCC generated (at line 44, column 54) for  k
      % expected type  {jj: int | x = 0 => jj /= 0}
  divides_rel_primes_TCC1: OBLIGATION
    FORALL (k: posnat, x, y: int): divides(x, k * y) IMPLIES x = 0 => k /= 0;


decl_type: tcc
theory: general_properties
library: groups
signature: nil
location: 92 0 94 999
body:
  % Subtype TCC generated (at line 48, column 26) for  i
      % expected type  {i: int | p /= 0 OR i >= 0}
  product_power_TCC1: OBLIGATION FORALL (i, p: posnat): p /= 0 OR i >= 0;


decl_type: tcc
theory: general_properties
library: groups
signature: nil
location: 96 0 100 999
body:
  % Subtype TCC generated (at line 51, column 63) for  n
      % expected type  {i: int | p /= 0 OR i >= 0}
  product_only_power_TCC1: OBLIGATION
    FORALL (fs: fseq[posnat], p: posnat):
      only_power_p(fs, p) IMPLIES (FORALL (n: nat): p /= 0 OR n >= 0);


decl_type: tcc
theory: general_properties
library: groups
signature: nil
location: 102 0 105 999
body:
  % Subtype TCC generated (at line 55, column 57) for  j
      % expected type  {i: int | p /= 0 OR i >= 0}
  divides_prime_power_TCC1: OBLIGATION
    FORALL (j: nat, p: posnat): prime?(p) IMPLIES p /= 0 OR j >= 0;


decl_type: tcc
theory: general_properties
library: groups
signature: nil
location: 107 0 112 999
body:
  % Subtype TCC generated (at line 56, column 81) for  i
      % expected type  {i: int | p /= 0 OR i >= 0}
  divides_prime_power_TCC2: OBLIGATION
    FORALL (j: nat, p, q: posnat):
      divides(q, p ^ j) AND prime?(p) IMPLIES
       (FORALL (i: nat): i <= j IMPLIES p /= 0 OR i >= 0);


decl_type: tcc
theory: general_properties
library: groups
signature: nil
location: 114 0 116 999
body:
  % Subtype TCC generated (at line 59, column 22) for  1
      % expected type  {jj: int | m = 0 => jj /= 0}
  gcd_1_TCC1: OBLIGATION FORALL (m: int): m = 0 => 1 /= 0;


decl_type: tcc
theory: general_properties
library: groups
signature: nil
location: 118 0 121 999
body:
  % Subtype TCC generated (at line 61, column 39) for  p
      % expected type  {jj: int | m = 0 => jj /= 0}
  gcd_1_nd_TCC1: OBLIGATION
    FORALL (m: int, p: posnat): prime?(p) IMPLIES m = 0 => p /= 0;


decl_type: tcc
theory: general_properties
library: groups
signature: nil
location: 123 0 127 999
body:
  % Subtype TCC generated (at line 65, column 75) for  p
      % expected type  {jj: int | x = 0 => jj /= 0}
  gcd_1_gcd_1_TCC1: OBLIGATION
    FORALL (m: int, p: posnat, x, y: int):
      m = x * y AND gcd(m, p) = 1 AND prime?(p) IMPLIES x = 0 => p /= 0;


decl_type: tcc
theory: general_properties
library: groups
signature: nil
location: 129 0 134 999
body:
  % Subtype TCC generated (at line 65, column 92) for  p
      % expected type  {jj: int | y = 0 => jj /= 0}
  gcd_1_gcd_1_TCC2: OBLIGATION
    FORALL (m: int, p: posnat, x, y: int):
      m = x * y AND gcd(m, p) = 1 AND prime?(p) AND gcd(x, p) = 1 IMPLIES
       y = 0 => p /= 0;


decl_type: formula
theory: groups_scaf
library: groups
signature: nil
location: 43 3 44 54
body:
     subgroup_transitive: LEMMA subgroup?(H,G) AND  subgroup?(K,H)
                                  IMPLIES subgroup?(K,G)


decl_type: formula
theory: groups_scaf
library: groups
signature: nil
location: 46 3 48 61
body:
     normal_subgroup_tran: LEMMA subgroup?(H,G) AND subgroup?(N,H) AND
                            normal_subgroup?(N,G)
                                  IMPLIES normal_subgroup?(N,H)


decl_type: formula
theory: groups_scaf
library: groups
signature: nil
location: 50 3 51 70
body:
     subgroup_intersection: LEMMA  subgroup?(H,G) AND subgroup?(K,G) 
                                  IMPLIES subgroup?(intersection(H,K),G)


decl_type: formula
theory: groups_scaf
library: groups
signature: nil
location: 60 3 61 77
body:
     order_gt_1: LEMMA FORALL (G:finite_group): 
                        prime?(p) AND divides(p, order(G)) IMPLIES order(G) > 1


decl_type: formula
theory: groups_scaf
library: groups
signature: nil
location: 63 3 64 78
body:
     order_gt_p: LEMMA FORALL (G:finite_group): 
                        prime?(p) AND divides(p, order(G)) IMPLIES order(G) >= p


decl_type: formula
theory: groups_scaf
library: groups
signature: nil
location: 66 3 67 79
body:
     exists_diff_one: LEMMA FORALL (G:finite_group):
                                   order(G) > 1 IMPLIES EXISTS (x: (G)): x /= one


decl_type: formula
theory: groups_scaf
library: groups
signature: nil
location: 69 3 70 66
body:
     one_iff_divides: LEMMA FORALL (G:finite_group, a:(G)): 
                               a^m = one IFF divides(period(G,a), m)


decl_type: formula
theory: groups_scaf
library: groups
signature: nil
location: 72 3 74 59
body:
     order_power: LEMMA FORALL (G:finite_group, a:(G)): 
                                 LET n = period(G,a) IN
                                 period(G,a^k) = n / gcd(k,n)


decl_type: formula
theory: groups_scaf
library: groups
signature: nil
location: 77 3 78 78
body:
     coset_power_nat: LEMMA FORALL (x:(G), H:normal_subgroup(G)): 
                               ^[left_cosets(G,H),mult(G,H),H](x*H, i) = (x^i)*H


decl_type: formula
theory: groups_scaf
library: groups
signature: nil
location: 80 3 81 78
body:
     coset_power_int: LEMMA FORALL (x:(G), H:normal_subgroup(G)): 
                               ^[left_cosets(G,H),mult(G,H),H](x*H, m) = (x^m)*H


decl_type: tcc
theory: groups_scaf
library: groups
signature: nil
location: 87 0 90 999
body:
  % Assuming TCC generated (at line 24, column 12) for
      % algebra@finite_groups[T, *, one]
      % generated from assumption finite_groups.fullset_is_group
  IMP_finite_groups_TCC1: OBLIGATION group?[T, *, one](fullset[T]);


decl_type: tcc
theory: groups_scaf
library: groups
signature: nil
location: 92 0 95 999
body:
  % Subtype TCC generated (at line 56, column 45) for  center(G)
      % expected type  group[T, *, one]
  center_is_normal_TCC1: OBLIGATION
    FORALL (G: group[T, *, one]): group?[T, *, one](center[T, *, one](G));


decl_type: tcc
theory: groups_scaf
library: groups
signature: nil
location: 97 0 101 999
body:
  % Subtype TCC generated (at line 75, column 40) for  a ^ k
      % expected type  (G)
  order_power_TCC1: OBLIGATION
    FORALL (k: posnat, G: finite_group[T, *, one], a: (G), n: posnat):
      n = period(G, a) IMPLIES G(^[T, *, one](a, k));


decl_type: tcc
theory: groups_scaf
library: groups
signature: nil
location: 103 0 107 999
body:
  % Subtype TCC generated (at line 75, column 57) for  n
      % expected type  {jj: int | k = 0 => jj /= 0}
  order_power_TCC2: OBLIGATION
    FORALL (k: posnat, G: finite_group[T, *, one], a: (G), n: posnat):
      n = period(G, a) IMPLIES k = 0 => n /= 0;


decl_type: tcc
theory: groups_scaf
library: groups
signature: nil
location: 109 0 113 999
body:
  % Subtype TCC generated (at line 79, column 61) for  x * H
      % expected type  left_cosets[T, *, one](G, H)
  coset_power_nat_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], x: (G), H: normal_subgroup[T, *, one](G)):
      EXISTS (a: (G)): *[T, *, one](x, H) = *[T, *, one](a, H);


decl_type: tcc
theory: groups_scaf
library: groups
signature: nil
location: 115 0 119 999
body:
  % Subtype TCC generated (at line 79, column 58) for  H
      % expected type  left_cosets[T, *, one](G, H)
  coset_power_nat_TCC2: OBLIGATION
    FORALL (G: group[T, *, one], x: (G), H: normal_subgroup[T, *, one](G)):
      EXISTS (a: (G)): H = *[T, *, one](a, H);


decl_type: tcc
theory: groups_scaf
library: groups
signature: nil
location: 121 0 127 999
body:
  % Assuming TCC generated (at line 45, column 7) for
      % algebra@group[left_cosets(G, H), mult(G, H), H]
      % generated from assumption group.fullset_is_group
  coset_power_nat_TCC3: OBLIGATION
    FORALL (G: group[T, *, one], x: (G), H: normal_subgroup[T, *, one](G)):
      group?[left_cosets[T, *, one](G, H), mult(G, H), H]
          (fullset[left_cosets[T, *, one](G, H)]);


decl_type: tcc
theory: groups_scaf
library: groups
signature: nil
location: 129 0 133 999
body:
  % Existence TCC generated (at line 79, column 29) for
      % ^[left_cosets(G, H), mult(G, H), H]
  coset_power_nat_TCC4: OBLIGATION
    FORALL (G: group[T, *, one], x: (G), H: normal_subgroup[T, *, one](G)):
      EXISTS (x1: left_cosets[T, *, one](G, H)): TRUE;


decl_type: formula
theory: class_equation_scaf
library: groups
signature: nil
location: 27 0 28 81
body:
  card_rest_aux: LEMMA nonempty?(FP) IMPLIES 
                         card(Union(FP)) = card(choose(FP)) + card(Union(rest(FP)))


decl_type: formula
theory: class_equation_scaf
library: groups
signature: nil
location: 31 0 32 72
body:
  card_partition: LEMMA (nonempty?(FP) AND FORALL (A: (FP)): card(A) /= 0) IMPLIES 
                               card(Union(FP)) = sigma_set.sigma(FP, card)


decl_type: formula
theory: class_equation_scaf
library: groups
signature: nil
location: 35 0 37 65
body:
  divide_sigma: LEMMA (nonempty?(FP) AND 
                            FORALL (A: (FP)): card(A) /= 0 AND divides(n, card(A))) IMPLIES 
                               divides(n,sigma_set.sigma(FP, card))


decl_type: tcc
theory: class_equation_scaf
library: groups
signature: nil
location: 44 0 48 999
body:
  % Subtype TCC generated (at line 29, column 28) for  Union(FP)
      % expected type  S: finite_set[T]
  card_rest_aux_TCC1: OBLIGATION
    FORALL (FP: finite_partition[T]):
      nonempty?(FP) IMPLIES is_finite[T](Union[T](FP));


decl_type: tcc
theory: class_equation_scaf
library: groups
signature: nil
location: 50 0 54 999
body:
  % Subtype TCC generated (at line 29, column 46) for  choose(FP)
      % expected type  S: finite_set[T]
  card_rest_aux_TCC2: OBLIGATION
    FORALL (FP: finite_partition[T]):
      nonempty?(FP) IMPLIES is_finite[T](choose[setof[T]](FP));


decl_type: tcc
theory: class_equation_scaf
library: groups
signature: nil
location: 56 0 60 999
body:
  % Subtype TCC generated (at line 29, column 65) for  Union(rest(FP))
      % expected type  S: finite_set[T]
  card_rest_aux_TCC3: OBLIGATION
    FORALL (FP: finite_partition[T]):
      nonempty?(FP) IMPLIES is_finite[T](Union[T](rest[setof[T]](FP)));


decl_type: tcc
theory: class_equation_scaf
library: groups
signature: nil
location: 62 0 66 999
body:
  % Subtype TCC generated (at line 32, column 64) for  A
      % expected type  S: finite_set[T]
  card_partition_TCC1: OBLIGATION
    FORALL (FP: finite_partition[T]):
      nonempty?(FP) IMPLIES (FORALL (A: (FP)): is_finite[T](A));


decl_type: tcc
theory: class_equation_scaf
library: groups
signature: nil
location: 68 0 75 999
body:
  % Subtype TCC generated (at line 33, column 67) for  card
      % expected type  (convergent?(restrict[setof[T], finite_set[T], boolean]
                     %                  (FP)))
  card_partition_TCC2: OBLIGATION
    FORALL (FP: finite_partition[T]):
      (FORALL (A: (FP)): card(A) /= 0) AND nonempty?(FP) IMPLIES
       convergent?[finite_set[T]]
           (restrict[setof[T], finite_set[T], boolean](FP))(card[T]);


decl_type: tcc
theory: class_equation_scaf
library: groups
signature: nil
location: 77 0 86 999
body:
  % Subtype TCC generated (at line 38, column 59) for  card
      % expected type  (convergent?(restrict[setof[T], finite_set[T], boolean]
                     %                  (FP)))
  divide_sigma_TCC1: OBLIGATION
    FORALL (FP: finite_partition[T], n: int):
      (FORALL (A: (FP)): card(A) /= 0 AND divides(n, card(A))) AND
       nonempty?(FP)
       IMPLIES
       convergent?[finite_set[T]]
           (restrict[setof[T], finite_set[T], boolean](FP))(card[T]);


decl_type: tcc
theory: class_equation_scaf
library: groups
signature: nil
location: 88 0 102 999
body:
  % Subtype TCC generated (at line 38, column 39) for
      % sigma_set.sigma(restrict[setof[T], finite_set[T], boolean](FP), card)
      % expected type  int
  divide_sigma_TCC2: OBLIGATION
    FORALL (FP: finite_partition[T], n: int):
      (FORALL (A: (FP)): card(A) /= 0 AND divides(n, card(A))) AND
       nonempty?(FP)
       IMPLIES
       rational_pred(sigma_set[finite_set[T]].sigma
                         (restrict[setof[T], finite_set[T], boolean](FP),
                          card[T]))
        AND
        integer_pred(sigma_set[finite_set[T]].sigma
                         (restrict[setof[T], finite_set[T], boolean](FP),
                          card[T]));


decl_type: tcc
theory: lagrange_index
library: groups
signature: nil
location: 41 0 44 999
body:
  % Assuming TCC generated (at line 24, column 13) for
      % right_left_cosets[T, *, one]
      % generated from assumption right_left_cosets.fullset_is_group
  IMP_right_left_cosets_TCC1: OBLIGATION group?[T, *, one](fullset[T]);


decl_type: tcc
theory: lagrange_index
library: groups
signature: nil
location: 46 0 54 999
body:
  % Subtype TCC generated (at line 34, column 66) for
      % extend[set[T], left_cosets[T, *, one](G, N), bool, FALSE](G / N)
      % expected type  S: finite_set[set[T]]
  order_factor_TCC1: OBLIGATION
    FORALL (G, N: finite_group[T, *, one]):
      normal_subgroup?(N, G) IMPLIES
       is_finite[set[T]]
           (extend[set[T], left_cosets[T, *, one](G, N), bool, FALSE]
                (/[T, *, one](G, N)));


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 58 3 59 96
body:
     stabilizer_is_subgroup: LEMMA FORALL (x:(X), f:F(G,X)): 
                                group_action?(G, X)(f) IMPLIES subgroup?(stabilizer(G,X)(f, x), G)


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 62 3 65 89
body:
     singleton_iff_Fix: LEMMA FORALL (x:(X), f:F(G,X)): 
                           group_action?(G, X)(f)
                              IMPLIES
                                (orbit(G,X)(f,x) = singleton(x) IFF member(x, Fix(G,X)(f)))


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 67 3 70 85
body:
     empty_iff_eq_Fix: LEMMA FORALL (f:F(G,X)): 
                                group_action?(G, X)(f)
                                   IMPLIES
                                      (empty?(orbits_nFix(G,X)(f)) IFF X = Fix(G,X)(f))


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 72 3 74 88
body:
     orbits_nFix_disj_Fix: LEMMA FORALL (f:F(G,X)): 
                              group_action?(G, X)(f) 
                                 IMPLIES disjoint?(Fix(G,X)(f),Union(orbits_nFix(G,X)(f)))


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 77 3 79 104
body:
     orbits_is_union: LEMMA FORALL (f:F(G,X)): 
                         group_action?(G, X)(f) 
                            IMPLIES Union(orbits(G,X)(f)) = union(Fix(G,X)(f), Union(orbits_nFix(G,X)(f)))


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 81 3 82 79
body:
     orbit_nonempty: LEMMA FORALL (x:(X), f:F(G,X)): 
                        group_action?(G, X)(f) IMPLIES nonempty?(orbit(G,X)(f,x))


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 84 3 85 62
body:
     orbits_nonempty: LEMMA FORALL (f:F(G,X)): nonempty?(X) AND group_action?(G, X)(f) 
                               IMPLIES nonempty?(orbits(G,X)(f))


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 87 3 88 59
body:
     set_orbits_is: LEMMA FORALL (f:F(G,X)): group_action?(G, X)(f) 
                            IMPLIES Union(orbits(G,X)(f)) = X


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 90 3 93 60
body:
     orbit_is_finite: LEMMA FORALL (x:(X), f:F(G,X)):
                              is_finite(X) AND group_action?(G, X)(f)
                                 IMPLIES
                                    is_finite(orbit(G,X)(f,x))


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 95 3 98 58
body:
     orbits_disjoint: LEMMA FORALL (f:F(G,X), A,B: (orbits(G,X)(f))):
                               group_action?(G, X)(f)
                                  IMPLIES 
                                     A = B OR disjoint?(A,B)


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 100 3 103 68
body:
     orbits_partition: LEMMA  FORALL (f:F(G,X)): 
                                is_finite(X) AND group_action?(G, X)(f) 
                                  IMPLIES
                                     finite_partition?(orbits(G,X)(f))


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 105 3 108 79
body:
     orbits_nFix_partition: LEMMA FORALL (f:F(G,X)): 
                                     is_finite(X) AND group_action?(G, X)(f) 
                                        IMPLIES
                                           finite_partition?(orbits_nFix(G,X)(f))


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 110 3 113 97
body:
     orbits_eq_index_aux: LEMMA 
        FORALL (x:(X), f:F(G,X)): group_action?(G, X)(f) 
          IMPLIES
            EXISTS (f:[(left_cosets(G,stabilizer(G,X)(f, x))) -> (orbit(G,X)(f,x))]): bijective?(f)


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 115 3 118 85
body:
     orbits_eq_index: LEMMA FORALL (G:finite_group, x:(X), f:F(G,X)):
                           is_finite(X) AND group_action?(G, X)(f)
                              IMPLIES
                                index(G, stabilizer(G,X)(f, x)) = card(orbit(G,X)(f,x))


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 130 3 134 81
body:
     counting_formula: LEMMA FORALL (f:F(G,X)):
                               finite_group?(G) AND is_finite(X) AND 
                               nonempty?(X)     AND group_action?(G, X)(f)
                                  IMPLIES
                                    card(X) = sigma_set.sigma(orbits(G,X)(f), card)


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 136 3 140 106
body:
     class_equation: LEMMA FORALL (f:F(G,X)):
                              finite_group?(G) AND is_finite(X) AND 
                              nonempty?(X)     AND group_action?(G, X)(f)
                                 IMPLIES 
                                    card(X) = card(Fix(G,X)(f)) + sigma_set.sigma(orbits_nFix(G,X)(f), card)


decl_type: formula
theory: group_action
library: groups
signature: nil
location: 142 3 147 72
body:
     Fix_congruence: LEMMA FORALL (f:F(G,X)):
                              finite_group?(G) AND order(G) = p^n AND 
                              is_finite(X)     AND nonempty?(X)   AND 
                              prime?(p)        AND group_action?(G, X)(f)
                                IMPLIES 
                                   divides(p, card(X) - card(Fix(G,X)(f)))


decl_type: function
theory: group_action
library: groups
signature: [d: [group[T, *, one], set[T1]] -> [F(d`1, d`2) -> bool]]
location: 38 3 39 78
body:
     group_action?(G, X)(f:F(G,X)): bool = FORALL (g1, g2:(G), x: (X)):   
                               f(one, x) = x AND f(g1 * g2, x) = f(g1, f(g2, x))


decl_type: function
theory: group_action
library: groups
location: 44 3 44 101
signature:
  [d: [group[T, *, one], set[T1]] ->
          [[F(d`1, d`2), (d`2)] -> {Y: set[T1] | subset?(Y, d`2)}]]

body:
     orbit(G,X)(f: F(G,X), x: (X)): {Y: set[T1] | subset?(Y,X)} = {y:(X) | EXISTS (g:(G)): y = f(g, x)}


decl_type: function
theory: group_action
library: groups
signature:
  [d: [group[T, *, one], set[T1]] ->
  [F(d`1, d`2) -> setofsets[T1]]]

location: 53 3 54 107
body:
     orbits_nFix(G,X)(f: F(G,X)): setofsets[T1] = {Y: (orbits(G,X)(f)) | 
                                       EXISTS (x: {x:(X) | NOT member(x, Fix(G,X)(f))}): Y = orbit(G,X)(f,x)}


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 156 0 159 999
body:
  % Assuming TCC generated (at line 23, column 13) for
      % algebra@group[T, *, one]
      % generated from assumption group.fullset_is_group
  IMP_group_TCC1: OBLIGATION group?[T, *, one](fullset[T]);


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 161 0 166 999
body:
  % Subtype TCC generated (at line 40, column 31) for  one
      % expected type  (G)
  group_action?_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], X: set[T1], f: F(G, X), g1, g2: (G),
            x: (X)):
      G(one);


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 168 0 173 999
body:
  % Subtype TCC generated (at line 40, column 49) for  g1 * g2
      % expected type  (G)
  group_action?_TCC2: OBLIGATION
    FORALL (G: group[T, *, one], X: set[T1], f: F(G, X), g1, g2: (G),
            x: (X)):
      f(one, x) = x IMPLIES G(g1 * g2);


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 175 0 180 999
body:
  % Subtype TCC generated (at line 42, column 68) for
      % extend[T, (G), bool, FALSE]({g: (G) | f(g, x) = x})
      % expected type  {S: set[T] | subset?(S, G)}
  stabilizer_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], X: set[T1], f: F(G, X), x: (X)):
      subset?[T](extend[T, (G), bool, FALSE]({g: (G) | f(g, x) = x}), G);


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 182 0 190 999
body:
  % Subtype TCC generated (at line 45, column 64) for
      % extend[T1, (X), bool, FALSE]({y: (X) | EXISTS (g: (G)): y = f(g, x)})
      % expected type  {Y: set[T1] | subset?(Y, X)}
  orbit_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], X: set[T1], f: F(G, X), x: (X)):
      subset?[T1]
          (extend[T1, (X), bool, FALSE]
               ({y: (X) | EXISTS (g: (G)): y = f(g, x)}),
           X);


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 192 0 200 999
body:
  % Subtype TCC generated (at line 51, column 54) for
      % extend[T1, (X), bool, FALSE]({x: (X) | FORALL (g: (G)): f(g, x) = x})
      % expected type  {Y: set[T1] | subset?(Y, X)}
  Fix_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], X: set[T1], f: F(G, X)):
      subset?[T1]
          (extend[T1, (X), bool, FALSE]
               ({x: (X) | FORALL (g: (G)): f(g, x) = x}),
           X);


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 202 0 211 999
body:
  % Subtype TCC generated (at line 114, column 36) for  stabilizer(G, X)(f, x)
      % expected type  subgroup[T, *, one](G)
  orbits_eq_index_aux_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], X: set[T1], x: (X), f: F(G, X)):
      group_action?(G, X)(f) IMPLIES
       (FORALL (f1:
                  [(left_cosets[T, *, one](G, stabilizer(G, X)(f, x))) ->
                     (orbit(G, X)(f, x))]):
          group?[T, *, one](stabilizer(G, X)(f, x)) AND
           subgroup?[T, *, one](stabilizer(G, X)(f, x), G));


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 213 0 219 999
body:
  % Subtype TCC generated (at line 119, column 39) for  stabilizer(G, X)(f, x)
      % expected type  subgroup[T, *, one](G)
  orbits_eq_index_TCC1: OBLIGATION
    FORALL (X: set[T1], G: finite_group[T, *, one], x: (X), f: F(G, X)):
      is_finite(X) AND group_action?(G, X)(f) IMPLIES
       group?[T, *, one](stabilizer(G, X)(f, x)) AND
        subgroup?[T, *, one](stabilizer(G, X)(f, x), G);


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 221 0 226 999
body:
  % Subtype TCC generated (at line 119, column 69) for  orbit(G, X)(f, x)
      % expected type  S: finite_set[T1]
  orbits_eq_index_TCC2: OBLIGATION
    FORALL (X: set[T1], G: finite_group[T, *, one], x: (X), f: F(G, X)):
      is_finite(X) AND group_action?(G, X)(f) IMPLIES
       is_finite[T1](orbit(G, X)(f, x));


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 228 0 239 999
body:
  % Subtype TCC generated (at line 135, column 76) for  card
      % expected type  (convergent?(restrict
                     %                  [setof[T1], finite_set[T1], boolean]
                     %                  (orbits(G, X)(f))))
  counting_formula_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], X: set[T1], f: F(G, X)):
      finite_group?(G) AND
       is_finite(X) AND nonempty?(X) AND group_action?(G, X)(f)
       IMPLIES
       convergent?[finite_set[T1]]
           (restrict[setof[T1], finite_set[T1], boolean](orbits(G, X)(f)))
           (card[T1]);


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 241 0 247 999
body:
  % Subtype TCC generated (at line 141, column 49) for  Fix(G, X)(f)
      % expected type  S: finite_set[T1]
  class_equation_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], X: set[T1], f: F(G, X)):
      finite_group?(G) AND
       is_finite(X) AND nonempty?(X) AND group_action?(G, X)(f)
       IMPLIES is_finite[T1](Fix(G, X)(f));


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 249 0 261 999
body:
  % Subtype TCC generated (at line 141, column 101) for  card
      % expected type  (convergent?(restrict
                     %                  [setof[T1], finite_set[T1], boolean]
                     %                  (orbits_nFix(G, X)(f))))
  class_equation_TCC2: OBLIGATION
    FORALL (G: group[T, *, one], X: set[T1], f: F(G, X)):
      finite_group?(G) AND
       is_finite(X) AND nonempty?(X) AND group_action?(G, X)(f)
       IMPLIES
       convergent?[finite_set[T1]]
           (restrict[setof[T1], finite_set[T1], boolean]
                (orbits_nFix(G, X)(f)))
           (card[T1]);


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 263 0 267 999
body:
  % Subtype TCC generated (at line 144, column 55) for  G
      % expected type  finite_monad[T, *, one]
  Fix_congruence_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], X: set[T1], f: F(G, X)):
      finite_group?(G) IMPLIES finite_monad?[T, *, one](G);


decl_type: tcc
theory: group_action
library: groups
signature: nil
location: 269 0 273 999
body:
  % Subtype TCC generated (at line 144, column 62) for  n
      % expected type  {i: int | p /= 0 OR i >= 0}
  Fix_congruence_TCC2: OBLIGATION
    FORALL (G: group[T, *, one], X: set[T1], n: nat, p: posnat, f: F(G, X)):
      finite_group?(G) IMPLIES p /= 0 OR n >= 0;


decl_type: formula
theory: cauchy
library: groups
signature: nil
location: 55 3 56 65
body:
     fseq_product_in: LEMMA (FORALL (i: below[length(fs)]): member(fs`seq(i), G))
                                IMPLIES member(fseq_product(fs), G)


decl_type: formula
theory: cauchy
library: groups
signature: nil
location: 58 3 61 103
body:
     fseq_product_o: LEMMA (FORALL (i: below[length(fs1)]): member(fs1`seq(i), G)) AND
                                (FORALL (j: below[length(fs2)]): member(fs2`seq(j), G))
                                       IMPLIES
                                          fseq_product(fs1 o fs2) = fseq_product(fs1) * fseq_product(fs2)


decl_type: formula
theory: cauchy
library: groups
signature: nil
location: 64 3 65 89
body:
     fseq_product_one: LEMMA (FORALL (i: below[length(fs)]): member(fs`seq(i), G))
                                    IMPLIES  inv(fseq_product(fs)) * fseq_product(fs) = one


decl_type: formula
theory: cauchy
library: groups
signature: nil
location: 67 3 67 105
body:
     fseq_product_power: LEMMA FORALL (g: (G)): same_element(g, fs) IMPLIES fseq_product(fs) = g^length(fs)


decl_type: formula
theory: cauchy
library: groups
signature: nil
location: 71 3 73 67
body:
     order_SE: LEMMA FORALL (g: (G)): prime?(p) AND g /= one AND 
                                           same_element(g, fs) AND member(fs, SE(G)(p))
                                              IMPLIES period(G,g) = p


decl_type: formula
theory: cauchy
library: groups
signature: nil
location: 75 3 77 64
body:
     S_bij_set_seq: LEMMA LET A = set_seq(G)(p - 1),
                                  B = S(G)(p)         IN
                              EXISTS (g:[(A)->(B)]): bijective?(g)


decl_type: formula
theory: cauchy
library: groups
signature: nil
location: 117 3 120 68
body:
     Fixed_subset: LEMMA  LET H = Zn[p],
                              X = S(G)(p),
                              f = F(p, G) IN
                          Fix[below(p),++,0,finseq](H,X)(f) = SE(G)(p)


decl_type: formula
theory: cauchy
library: groups
signature: nil
location: 127 3 127 105
body:
     cauchy_cor: COROLLARY prime?(p) AND divides(p, order(G)) IMPLIES EXISTS (H: subgroup(G)): order(H) = p


decl_type: function
theory: cauchy
library: groups
signature: [finseq[T] -> T]
location: 36 3 39 54
body:
     fseq_product(fs): RECURSIVE T =  IF length(fs) = 0 THEN one
                                      ELSE fs`seq(0)*fseq_product(rest(fs))
                                      ENDIF
                                      MEASURE length(fs)


decl_type: function
theory: cauchy
library: groups
signature: [finite_group[T, *, one] -> [nat -> set[finseq]]]
location: 41 3 43 63
body:
     S(G)(n): set[finseq] = {fs: finseq | length(fs) = n AND 
                                          (FORALL (i: below[n]): member(fs`seq(i), G)) AND 
                                          fseq_product(fs) = one}


decl_type: function
theory: cauchy
library: groups
signature:
  [d: [posnat, finite_group[T, *, one]] ->
  [[(Zn[d`1]), (S(d`2)(d`1))] -> finseq[T]]]

location: 88 3 89 108
body:
     F(p, G)(k: (Zn[p]), fs: (S(G)(p))): finseq = (# length := p,
                                                        seq := (LAMBDA (i: below[p]):fs`seq(rem(p)(i + k))) #)


decl_type: function
theory: cauchy
library: groups
signature: [fs: finseq[T] -> [below[length(fs)] -> finseq[T]]]
location: 92 3 94 94
body:
     F_1(fs)(k: below[length(fs)]): finseq = (# length := length(fs) - k,
                                                   seq := (LAMBDA (i: below[length(fs) - k]): 
                                                              fs`seq(rem(length(fs))(i + k))) #)


decl_type: function
theory: cauchy
library: groups
signature: [fs: finseq[T] -> [below[length(fs)] -> finseq[T]]]
location: 96 3 97 91
body:
     F_2(fs)(k: below[length(fs)]): finseq = (# length := k,
                                                  seq := (LAMBDA (i: below[k]): fs`seq(i)) #)


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 135 0 138 999
body:
  % Assuming TCC generated (at line 24, column 14) for
      % algebra@finite_cyclic_groups[T, *, one]
      % generated from assumption finite_cyclic_groups.fullset_is_group
  IMP_finite_cyclic_groups_TCC1: OBLIGATION group?[T, *, one](fullset[T]);


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 140 0 143 999
body:
  % Subtype TCC generated (at line 38, column 48) for  0
      % expected type  below[fs`length]
  fseq_product_TCC1: OBLIGATION
    FORALL (fs: finseq[T]): NOT length(fs) = 0 IMPLIES 0 < fs`length;


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 145 0 149 999
body:
  % Termination TCC generated (at line 38, column 51) for
      % fseq_product(rest(fs))
  fseq_product_TCC2: OBLIGATION
    FORALL (fs: finseq[T]):
      NOT length(fs) = 0 IMPLIES length(rest[T](fs)) < length(fs);


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 151 0 155 999
body:
  % Subtype TCC generated (at line 43, column 77) for  i
      % expected type  below[fs`length]
  S_TCC1: OBLIGATION
    FORALL (n: nat, fs: finseq[T]):
      length(fs) = n IMPLIES (FORALL (i: below[n]): i < fs`length);


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 157 0 159 999
body:
  % Subtype TCC generated (at line 76, column 43) for  p - 1
      % expected type  nat
  S_bij_set_seq_TCC1: OBLIGATION FORALL (p: posnat): p - 1 >= 0;


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 161 0 164 999
body:
  % Subtype TCC generated (at line 76, column 40) for  G
      % expected type  finite_set[T]
  S_bij_set_seq_TCC2: OBLIGATION
    FORALL (G: finite_group[T, *, one]): is_finite[T](G);


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 166 0 170 999
body:
  % Subtype TCC generated (at line 82, column 22) for  S(G)(p)
      % expected type  S: finite_set[finseq[T]]
  S_card_TCC1: OBLIGATION
    FORALL (G: finite_group[T, *, one], p: posnat):
      is_finite[finseq[T]](S(G)(p));


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 172 0 177 999
body:
  % Subtype TCC generated (at line 90, column 90) for  rem(p)(i + k)
      % expected type  below[fs`length]
  F_TCC1: OBLIGATION
    FORALL (p: posnat, G: finite_group[T, *, one], k: (Zn[p]), fs: (S(G)(p)),
            i: below[p]):
      rem(p)(i + k) < fs`length;


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 179 0 182 999
body:
  % Subtype TCC generated (at line 93, column 56) for  length(fs) - k
      % expected type  nat
  F_1_TCC1: OBLIGATION
    FORALL (fs: finseq[T], k: below[length(fs)]): length(fs) - k >= 0;


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 184 0 188 999
body:
  % Subtype TCC generated (at line 95, column 71) for  length(fs)
      % expected type  b: posnat
  F_1_TCC2: OBLIGATION
    FORALL (fs: finseq[T], k: below[length(fs)], i: below[length(fs) - k]):
      length(fs) > 0;


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 190 0 193 999
body:
  % Subtype TCC generated (at line 98, column 85) for  i
      % expected type  below[fs`length]
  F_2_TCC1: OBLIGATION
    FORALL (fs: finseq[T], k: below[length(fs)], i: below[k]): i < fs`length;


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 195 0 200 999
body:
  % Subtype TCC generated (at line 102, column 78) for  k
      % expected type  below[length(fs)]
  F_o_F12_TCC1: OBLIGATION
    FORALL (G: finite_group[T, *, one], p: posnat, k: (Zn[p]),
            fs: (S(G)(p))):
      k < length(fs);


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 202 0 206 999
body:
  % Subtype TCC generated (at line 111, column 73) for  F(p, G)
      % expected type  F[below(p), ++, 0, finseq](Zn[p], S(G)(p))
  F_is_action_TCC1: OBLIGATION
    FORALL (G: finite_group[T, *, one], p: posnat, x1: [(Zn[p]), (S(G)(p))]):
      S(G)(p)(F(p, G)(x1));


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 208 0 211 999
body:
  % Subtype TCC generated (at line 111, column 58) for  Zn[p]
      % expected type  group[below(p), ++, 0]
  F_is_action_TCC2: OBLIGATION
    FORALL (p: posnat): group?[below(p), ++[p], 0](Zn[p]);


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 213 0 215 999
body:
  % Subtype TCC generated (at line 111, column 48) for  0
      % expected type  below(p)
  F_is_action_TCC3: OBLIGATION FORALL (p: posnat): 0 < p;


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 217 0 221 999
body:
  % Assuming TCC generated (at line 18, column 7) for
      % group_action[below(p), ++, 0, finseq]
      % generated from assumption group_action.fullset_is_group
  F_is_action_TCC4: OBLIGATION
    FORALL (p: posnat): group?[below(p), ++, 0](fullset[below(p)]);


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 223 0 234 999
body:
  % Subtype TCC generated (at line 121, column 55) for  f
      % expected type  F[below(p), ++, 0, finseq](H, X)
  Fixed_subset_TCC1: OBLIGATION
    FORALL (G: finite_group[T, *, one], p: posnat, H: set[below(p)]):
      H = Zn[p] IMPLIES
       (FORALL (X: set[finseq[T]]):
          X = S(G)(p) IMPLIES
           (FORALL (f: [[(Zn[p]), (S(G)(p))] -> finseq[T]]):
              f = F(p, G) IMPLIES
               ((FORALL (x: below(p)): Zn[p](x) IFF H(x)) AND
                 (FORALL (x: finseq[T]): S(G)(p)(x) IFF X(x)))
                AND (FORALL (x1: [(Zn[p]), (S(G)(p))]): X(f(x1)))));


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 236 0 244 999
body:
  % Subtype TCC generated (at line 121, column 50) for  H
      % expected type  group[below(p), ++, 0]
  Fixed_subset_TCC2: OBLIGATION
    FORALL (G: finite_group[T, *, one], p: posnat, H: set[below(p)]):
      H = Zn[p] IMPLIES
       (FORALL (X: set[finseq[T]]):
          X = S(G)(p) IMPLIES
           (FORALL (f: [[(Zn[p]), (S(G)(p))] -> finseq[T]]):
              f = F(p, G) IMPLIES group?[below(p), ++[p], 0](H)));


decl_type: tcc
theory: cauchy
library: groups
signature: nil
location: 246 0 251 999
body:
  % Subtype TCC generated (at line 128, column 99) for  H
      % expected type  finite_monad[T, *, one]
  cauchy_cor_TCC1: OBLIGATION
    FORALL (G: finite_group[T, *, one], p: posnat):
      divides(p, order(G)) AND prime?(p) IMPLIES
       (FORALL (H: subgroup[T, *, one](G)): finite_monad?[T, *, one](H));


decl_type: formula
theory: normalizer_centralizer
library: groups
signature: nil
location: 54 3 55 74
body:
     normal_in_normalizer: LEMMA subgroup?(H,G) IMPLIES 
                                        normal_subgroup?(H, normalizer(G,H)) 


decl_type: formula
theory: normalizer_centralizer
library: groups
signature: nil
location: 65 3 65 103
body:
     stabilizer_is_centralizer: LEMMA FORALL (x:(G)): stabilizer(G,G)(a_by_c(G,G), x) = centralizer(G)(x)


decl_type: formula
theory: normalizer_centralizer
library: groups
signature: nil
location: 86 2 87 91
body:
    class_equation_2: LEMMA  FORALL (G:finite_group): 
                                order(G) = card(center(G)) + sigma_set.sigma(CLs_nc(G), card)


decl_type: function
theory: normalizer_centralizer
library: groups
signature: [group[T, *, one] -> setofsets[T]]
location: 44 3 45 91
body:
     CLs_nc(G): setofsets[T] = {X: (CLs(G)) | EXISTS (x: {x:(G) | 
                                                    NOT member(x, center(G))}): X = CL(G)(x)}


decl_type: tcc
theory: normalizer_centralizer
library: groups
signature: nil
location: 94 0 97 999
body:
  % Assuming TCC generated (at line 22, column 12) for
      % algebra@normal_subgroups[T, *, one]
      % generated from assumption normal_subgroups.fullset_is_group
  IMP_normal_subgroups_TCC1: OBLIGATION group?[T, *, one](fullset[T]);


decl_type: tcc
theory: normalizer_centralizer
library: groups
signature: nil
location: 99 0 108 999
body:
  % Subtype TCC generated (at line 32, column 68) for
      % extend[T, (G), bool, FALSE]({x: (G) | inv(x) * H * x = H})
      % expected type  {S: set[T] | subset?(S, G)}
  normalizer_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], H: subgroup[T, *, one](G)):
      subset?[T]
          (extend[T, (G), bool, FALSE]
               ({x: (G) |
                   *[T, *, one](*[T, *, one](inv[T, *, one](x), H), x) = H}),
           G);


decl_type: tcc
theory: normalizer_centralizer
library: groups
signature: nil
location: 110 0 115 999
body:
  % Subtype TCC generated (at line 34, column 51) for
      % extend[T, (G), bool, FALSE]({x: (G) | x * a = a * x})
      % expected type  {S: set[T] | subset?(S, G)}
  centralizer_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], a: T):
      subset?[T](extend[T, (G), bool, FALSE]({x: (G) | x * a = a * x}), G);


decl_type: tcc
theory: normalizer_centralizer
library: groups
signature: nil
location: 117 0 121 999
body:
  % Subtype TCC generated (at line 36, column 55) for  h * x * inv(h)
      % expected type  (G)
  a_by_c_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], H: subgroup[T, *, one](G), h: (H), x: (G)):
      G(h * x * inv[T, *, one](h));


decl_type: tcc
theory: normalizer_centralizer
library: groups
signature: nil
location: 123 0 132 999
body:
  % Subtype TCC generated (at line 39, column 42) for
      % extend[T, (G), bool, FALSE]
      %     ({y: (G) | EXISTS (g: (G)): y = g * x * inv(g)})
      % expected type  {X: set[T] | subset?(X, G)}
  CL_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], x: T):
      subset?[T]
          (extend[T, (G), bool, FALSE]
               ({y: (G) | EXISTS (g: (G)): y = g * x * inv[T, *, one](g)}),
           G);


decl_type: tcc
theory: normalizer_centralizer
library: groups
signature: nil
location: 134 0 138 999
body:
  % Subtype TCC generated (at line 56, column 58) for  normalizer(G, H)
      % expected type  group[T, *, one]
  normal_in_normalizer_TCC1: OBLIGATION
    FORALL (G, H: group[T, *, one]):
      subgroup?(H, G) IMPLIES group?[T, *, one](normalizer(G, H));


decl_type: tcc
theory: normalizer_centralizer
library: groups
signature: nil
location: 140 0 143 999
body:
  % Subtype TCC generated (at line 64, column 42) for  G
      % expected type  subgroup[T, *, one](G)
  Fix_is_center_TCC1: OBLIGATION
    FORALL (G: group[T, *, one]): subgroup?[T, *, one](G, G);


decl_type: tcc
theory: normalizer_centralizer
library: groups
signature: nil
location: 145 0 150 999
body:
  % Subtype TCC generated (at line 74, column 64) for  centralizer(G)(x)
      % expected type  subgroup[T, *, one](G)
  CLs_eq_index_TCC1: OBLIGATION
    FORALL (G: finite_group[T, *, one], x: (G)):
      group?[T, *, one](centralizer(G)(x)) AND
       subgroup?[T, *, one](centralizer(G)(x), G);


decl_type: tcc
theory: normalizer_centralizer
library: groups
signature: nil
location: 152 0 155 999
body:
  % Subtype TCC generated (at line 74, column 90) for  CL(G)(x)
      % expected type  S: finite_set[T]
  CLs_eq_index_TCC2: OBLIGATION
    FORALL (G: finite_group[T, *, one], x: (G)): is_finite[T](CL(G)(x));


decl_type: tcc
theory: normalizer_centralizer
library: groups
signature: nil
location: 157 0 160 999
body:
  % Subtype TCC generated (at line 88, column 46) for  center(G)
      % expected type  S: finite_set[T]
  class_equation_2_TCC1: OBLIGATION
    FORALL (G: finite_group[T, *, one]): is_finite[T](center[T, *, one](G));


decl_type: tcc
theory: normalizer_centralizer
library: groups
signature: nil
location: 162 0 168 999
body:
  % Subtype TCC generated (at line 88, column 86) for  card
      % expected type  (convergent?(restrict[setof[T], finite_set[T], boolean]
                     %                  (CLs_nc(G))))
  class_equation_2_TCC2: OBLIGATION
    FORALL (G: finite_group[T, *, one]):
      convergent?[finite_set[T]]
          (restrict[setof[T], finite_set[T], boolean](CLs_nc(G)))(card[T]);


decl_type: formula
theory: p_groups
library: groups
signature: nil
location: 44 3 45 73
body:
     alt_is_action: LEMMA FORALL (H, K: subgroup(G)):
                             group_action?(H, left_cosets(G,K))(alt(G,H,K))


decl_type: formula
theory: p_groups
library: groups
signature: nil
location: 48 3 49 104
body:
     Fix_iff_subset: LEMMA FORALL (H, K: subgroup(G), g: (G)): 
                              member(g*K,  Fix(H,left_cosets(G,K))(alt(G,H,K))) IFF subset?(H, g*K*inv(g))


decl_type: formula
theory: p_groups
library: groups
signature: nil
location: 52 3 53 100
body:
     Fix_iff_subset_cor: LEMMA FORALL (G:finite_group, H, K: subgroup(G), g: (G)): 
                                  member(g*H,  Fix(H,left_cosets(G,H))(alt(G,H,H))) IFF H = g*H*inv(g)


decl_type: formula
theory: p_groups
library: groups
signature: nil
location: 55 3 56 82
body:
     subgroup_is_p_group: LEMMA FORALL (G:finite_group,H: subgroup(G)): 
                                   prime?(p) AND p_group?(G,p) IMPLIES p_group?(H,p)


decl_type: formula
theory: p_groups
library: groups
signature: nil
location: 58 3 59 104
body:
     p_group_iff_power: LEMMA FORALL (G:finite_group): 
                                    prime?(p) IMPLIES (p_group?(G,p) IFF (EXISTS (m:nat): order(G) = p^m))


decl_type: formula
theory: p_groups
library: groups
signature: nil
location: 61 3 62 97
body:
     p_divides_index: LEMMA FORALL (G:finite_group, H:subgroup(G)): 
                              prime?(p) AND p_group?(G,p) AND H /= G IMPLIES divides(p, index(G,H))


decl_type: formula
theory: p_groups
library: groups
signature: nil
location: 66 3 68 80
body:
     normalizer_index: LEMMA FORALL (G:finite_group, H:subgroup(G)): 
                                   prime?(p) AND p_group?(H,p) AND divides(p, index(G,H))
                                     IMPLIES divides(p, index(normalizer(G,H), H))


decl_type: formula
theory: p_groups
library: groups
signature: nil
location: 70 3 72 63
body:
     subgroup_proper: LEMMA  FORALL (G:finite_group, H:subgroup(G)): 
                                   prime?(p) AND p_group?(G,p) AND H /= G
                                     IMPLIES H /= normalizer(G,H)


decl_type: formula
theory: p_groups
library: groups
signature: nil
location: 76 2 78 66
body:
    burside_theorem: THEOREM FORALL (G:finite_group): 
                                    order(G) > 1 AND prime?(p) AND p_group?(G,p)
                                       IMPLIES order(center(G)) >= p


decl_type: formula
theory: p_groups
library: groups
signature: nil
location: 80 2 81 56
body:
    p_square_is_abelian: LEMMA FORALL (G:finite_group): prime?(p) AND order(G) = p^2 
                                 IMPLIES abelian_group?(G)


decl_type: function
theory: p_groups
library: groups
signature: [[finite_group[T, *, one], {p: posnat | prime?(p)}] -> bool]
location: 34 3 35 98
body:
     p_group?(G:finite_group, p: {p:posnat | prime?(p)} ): bool = FORALL (a:(G)): 
                                                                (EXISTS (n: nat): period(G,a) = p^n)


decl_type: function
theory: p_groups
library: groups
location: 38 3 41 1
signature:
  [d: [G: group, subgroup[T, *, one](G), subgroup[T, *, one](G)] ->
          [[(d`2), (left_cosets(d`1, d`3))] -> set[T]]]

body:
     alt(G:group,H: subgroup(G),K: subgroup(G))(h:(H), A: (left_cosets(G,K))): set[T] = h*A


  ; %%%%% Properties and results %%%%%


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 90 0 93 999
body:
  % Assuming TCC generated (at line 24, column 13) for
      % algebra@finite_groups[T, *, one]
      % generated from assumption finite_groups.fullset_is_group
  IMP_finite_groups_TCC1: OBLIGATION group?[T, *, one](fullset[T]);


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 95 0 100 999
body:
  % Subtype TCC generated (at line 36, column 96) for  n
      % expected type  {i: int | p /= 0 OR i >= 0}
  p_group?_TCC1: OBLIGATION
    FORALL (G: finite_group[T, *, one], p: {p: posnat | prime?(p)}, a: (G),
            n: nat):
      p /= 0 OR n >= 0;


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 102 0 107 999
body:
  % Subtype TCC generated (at line 46, column 62) for  alt(G, H, K)
      % expected type  F[T, *, one, setof[T]](H, left_cosets(G, K))
  alt_is_action_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], H, K: subgroup[T, *, one](G)):
      FORALL (x1: [(H), (left_cosets[T, *, one](G, K))]):
        left_cosets[T, *, one](G, K)(alt(G, H, K)(x1));


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 109 0 115 999
body:
  % Subtype TCC generated (at line 54, column 69) for  alt(G, H, H)
      % expected type  F[T, *, one, setof[T]](H, left_cosets(G, H))
  Fix_iff_subset_cor_TCC1: OBLIGATION
    FORALL (G: finite_group[T, *, one], H, K: subgroup[T, *, one](G),
            g: (G)):
      FORALL (x1: [(H), (left_cosets[T, *, one](G, H))]):
        left_cosets[T, *, one](G, H)(alt(G, H, H)(x1));


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 117 0 122 999
body:
  % Subtype TCC generated (at line 57, column 78) for  H
      % expected type  finite_group[T, *, one]
  subgroup_is_p_group_TCC1: OBLIGATION
    FORALL (p: posnat, G: finite_group[T, *, one],
            H: subgroup[T, *, one](G)):
      prime?(p) AND p_group?(G, p) IMPLIES finite_group?[T, *, one](H);


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 124 0 127 999
body:
  % Subtype TCC generated (at line 60, column 101) for  m
      % expected type  {i: int | p /= 0 OR i >= 0}
  p_group_iff_power_TCC1: OBLIGATION
    FORALL (p: posnat): prime?(p) IMPLIES (FORALL (m: nat): p /= 0 OR m >= 0);


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 129 0 134 999
body:
  % Subtype TCC generated (at line 65, column 34) for  center(G)
      % expected type  normal_subgroup[T, *, one](G)
  factor_cyclic_TCC1: OBLIGATION
    FORALL (G: group[T, *, one]):
      group?[T, *, one](center[T, *, one](G)) AND
       normal_subgroup?[T, *, one](center[T, *, one](G), G);


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 136 0 141 999
body:
  % Subtype TCC generated (at line 65, column 34) for  center(G)
      % expected type  left_cosets[T, *, one](G, center(G))
  factor_cyclic_TCC2: OBLIGATION
    FORALL (G: group[T, *, one]):
      EXISTS (a: (G)):
        center[T, *, one](G) = *[T, *, one](a, center[T, *, one](G));


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 143 0 153 999
body:
  % Assuming TCC generated (at line 24, column 13) for
      % algebra@group
      %     [left_cosets[T, *, one](G, center(G)), mult(G, center(G)),
      %      center(G)]
      % generated from assumption group.fullset_is_group
  factor_cyclic_TCC3: OBLIGATION
    FORALL (G: group[T, *, one]):
      group?
          [left_cosets[T, *, one](G, center(G)), mult(G, center(G)),
           center(G)]
          (fullset[left_cosets[T, *, one](G, center(G))]);


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 155 0 160 999
body:
  % Subtype TCC generated (at line 68, column 56) for  H
      % expected type  finite_group[T, *, one]
  normalizer_index_TCC1: OBLIGATION
    FORALL (p: posnat, G: finite_group[T, *, one],
            H: subgroup[T, *, one](G)):
      prime?(p) IMPLIES finite_group?[T, *, one](H);


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 162 0 168 999
body:
  % Subtype TCC generated (at line 69, column 60) for  normalizer(G, H)
      % expected type  finite_group[T, *, one]
  normalizer_index_TCC2: OBLIGATION
    FORALL (p: posnat, G: finite_group[T, *, one],
            H: subgroup[T, *, one](G)):
      prime?(p) AND p_group?(H, p) AND divides(p, index(G, H)) IMPLIES
       finite_group?[T, *, one](normalizer[T, *, one](G, H));


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 170 0 176 999
body:
  % Subtype TCC generated (at line 69, column 77) for  H
      % expected type  subgroup[T, *, one](normalizer(G, H))
  normalizer_index_TCC3: OBLIGATION
    FORALL (p: posnat, G: finite_group[T, *, one],
            H: subgroup[T, *, one](G)):
      prime?(p) AND p_group?(H, p) AND divides(p, index(G, H)) IMPLIES
       subgroup?[T, *, one](H, normalizer[T, *, one](G, H));


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 178 0 183 999
body:
  % Subtype TCC generated (at line 79, column 51) for  center(G)
      % expected type  finite_monad[T, *, one]
  burside_theorem_TCC1: OBLIGATION
    FORALL (p: posnat, G: finite_group[T, *, one]):
      order(G) > 1 AND prime?(p) AND p_group?(G, p) IMPLIES
       finite_monad?[T, *, one](center[T, *, one](G));


decl_type: tcc
theory: p_groups
library: groups
signature: nil
location: 185 0 188 999
body:
  % Subtype TCC generated (at line 81, column 81) for  2
      % expected type  {i: int | p /= 0 OR i >= 0}
  p_square_is_abelian_TCC1: OBLIGATION
    FORALL (p: posnat): prime?(p) IMPLIES p /= 0 OR 2 >= 0;


decl_type: formula
theory: products_subgroups
library: groups
signature: nil
location: 33 0 34 52
body:
  HK_subgroup: LEMMA FORALL (H, N: subgroup(G)): normal_subgroup?(N,G) 
                        IMPLIES subgroup?(prod(H,N),G)


decl_type: formula
theory: products_subgroups
library: groups
signature: nil
location: 37 0 38 83
body:
  HK_subgroup_permute: LEMMA FORALL (H, K: subgroup(G)): 
                                   subgroup?(prod(H,K),G) IFF prod(H,K) = prod(K,H) ;


decl_type: formula
theory: products_subgroups
library: groups
signature: nil
location: 41 0 44 47
body:
  H_K_are_subgroups: LEMMA FORALL (H, K: subgroup(G)):
                     group?(prod(H,K)) IMPLIES 
                          subgroup?(H, prod(H,K)) AND 
                          subgroup?(K, prod(H,K))


decl_type: tcc
theory: products_subgroups
library: groups
signature: nil
location: 52 0 55 999
body:
  % Assuming TCC generated (at line 23, column 14) for
      % algebra@normal_subgroups[T, *, one]
      % generated from assumption normal_subgroups.fullset_is_group
  IMP_normal_subgroups_TCC1: OBLIGATION group?[T, *, one](fullset[T]);


decl_type: formula
theory: homomorphism_lemmas
library: groups
signature: nil
location: 33 0 38 38
body:
  natural_homo: LEMMA FORALL (K: normal_subgroup(G)):  
                EXISTS (pi: [(G) -> (G/K)]): 
                   pi = (LAMBDA (x:(G)): *[T1, *, one1](x, K)) AND
                   homomorphism?(G,G/K,pi)                     AND 
                   surjective?(pi)                             AND  
                   K = kernel(G,G/K)(pi) 


decl_type: formula
theory: homomorphism_lemmas
library: groups
signature: nil
location: 41 0 42 90
body:
  homo_inv:  LEMMA FORALL (phi: homomorphism(G,GP), x: (G)): 
                                         phi(inv[T1, *, one1](x)) = inv[T2, o, one2](phi(x)) 


decl_type: formula
theory: homomorphism_lemmas
library: groups
signature: nil
location: 45 0 47 61
body:
  kernel_normal: LEMMA FORALL (phi: homomorphism(G,GP)):
                                     LET K = kernel(G,GP)(phi) IN
                                         normal_subgroup?(K, G)


decl_type: formula
theory: homomorphism_lemmas
library: groups
signature: nil
location: 50 0 51 65
body:
  homo_image: LEMMA FORALL (phi: homomorphism(G,GP),H: subgroup(G)): 
                          subgroup?[T2, o, one2](image(phi, H), GP)


decl_type: formula
theory: homomorphism_lemmas
library: groups
signature: nil
location: 54 0 55 97
body:
  homo_image_normal: LEMMA FORALL (phi: homomorphism(G,GP),H: normal_subgroup(G)): 
                         surjective?(phi) IMPLIES  normal_subgroup?[T2, o, one2](image(phi, H), GP)


decl_type: formula
theory: homomorphism_lemmas
library: groups
signature: nil
location: 58 0 59 72
body:
  homo_inv_image:  LEMMA FORALL (phi: homomorphism(G,GP),K: subgroup(GP)): 
                          subgroup?[T1, *, one1](inverse_image(phi, K), G)


decl_type: formula
theory: homomorphism_lemmas
library: groups
signature: nil
location: 62 0 63 79
body:
  homo_inv_image_normal:  LEMMA FORALL (phi: homomorphism(G,GP),K: normal_subgroup(GP)): 
                          normal_subgroup?[T1, *, one1](inverse_image(phi, K), G)


decl_type: formula
theory: homomorphism_lemmas
library: groups
signature: nil
location: 66 0 68 64
body:
  kernel_in_inv_image: LEMMA FORALL (phi: homomorphism(G,GP),S: subgroup(GP)): 
                                 LET K = kernel(G,GP)(phi) IN
                                 subset?(K, inverse_image(phi, S))


decl_type: formula
theory: homomorphism_lemmas
library: groups
signature: nil
location: 71 0 73 91
body:
  homo_inv_image_image: LEMMA FORALL (phi: homomorphism(G,GP),H: subgroup(G)):
                                     LET K = kernel(G,GP)(phi) IN
                                     inverse_image(phi, image(phi, H)) = prod[T1,*,one1](H,K)


decl_type: formula
theory: homomorphism_lemmas
library: groups
signature: nil
location: 76 0 78 104
body:
  homo_inv_image_image_cor: LEMMA FORALL (phi: homomorphism(G,GP),H: subgroup(G)):
                                     LET K = kernel(G,GP)(phi) IN
                                     inverse_image(phi, image(phi, H)) = H IFF subgroup?[T1, *, one1](K,H)


decl_type: formula
theory: homomorphism_lemmas
library: groups
signature: nil
location: 82 0 84 99
body:
  first_isomorphism_th: LEMMA FORALL (phi: homomorphism(G,GP)): 
                           LET K = kernel(G,GP)(phi) IN
                           isomorphic?[left_cosets(G,K),mult(G,K),K, T2, o, one2](G/K, image(phi, G))


decl_type: tcc
theory: homomorphism_lemmas
library: groups
signature: nil
location: 91 0 93 999
body:
  % Assuming TCC generated (at line 29, column 13) for  group[T1, *, one1]
      % generated from assumption group.fullset_is_group
  G_TCC1: OBLIGATION group?[T1, *, one1](fullset[T1]);


decl_type: tcc
theory: homomorphism_lemmas
library: groups
signature: nil
location: 95 0 97 999
body:
  % Assuming TCC generated (at line 30, column 12) for  group[T2, o, one2]
      % generated from assumption group.fullset_is_group
  GP_TCC1: OBLIGATION group?[T2, o, one2](fullset[T2]);


decl_type: tcc
theory: homomorphism_lemmas
library: groups
signature: nil
location: 99 0 105 999
body:
  % Subtype TCC generated (at line 37, column 35) for  K
      % expected type  left_cosets[T1, *, one1](G, K)
  natural_homo_TCC1: OBLIGATION
    FORALL (G: group[T1, *, one1], K: normal_subgroup[T1, *, one1](G),
            pi: [(G) -> (/[T1, *, one1](G, K))]):
      (pi = (LAMBDA (x: (G)): (*[T1, *, one1](x, K)))) IMPLIES
       (EXISTS (a: (G)): K = *[T1, *, one1](a, K));


decl_type: tcc
theory: homomorphism_lemmas
library: groups
signature: nil
location: 107 0 117 999
body:
  % Assuming TCC generated (at line 26, column 14) for
      % algebra@homomorphisms
      %     [T1, *, one1, left_cosets[T1, *, one1](G, K),
      %      mult[T1, *, one1](G, K), K]
      % generated from assumption homomorphisms.T2_is_group
  natural_homo_TCC2: OBLIGATION
    FORALL (G: group[T1, *, one1], K: normal_subgroup[T1, *, one1](G),
            pi: [(G) -> (/[T1, *, one1](G, K))]):
      (pi = (LAMBDA (x: (G)): (*[T1, *, one1](x, K)))) IMPLIES
       group?[left_cosets[T1, *, one1](G, K), mult[T1, *, one1](G, K), K]
           (fullset[left_cosets[T1, *, one1](G, K)]);


decl_type: tcc
theory: homomorphism_lemmas
library: groups
signature: nil
location: 119 0 124 999
body:
  % Subtype TCC generated (at line 17, column 23) for  inv[T1, *, one1](x)
      % expected type  (G)
  homo_inv_TCC1: OBLIGATION
    FORALL (G: group[T1, *, one1], GP: group[T2, o, one2],
            phi: homomorphism[T1, *, one1, T2, o, one2](G, GP), x: (G)):
      G(inv[T1, *, one1](x));


decl_type: tcc
theory: homomorphism_lemmas
library: groups
signature: nil
location: 126 0 137 999
body:
  % Subtype TCC generated (at line 56, column 79) for
      % extend[T2, (GP), bool, FALSE]
      %     (image(phi, restrict[T1, (G), boolean](H)))
      % expected type  group[T2, o, one2]
  homo_image_normal_TCC1: OBLIGATION
    FORALL (G: group[T1, *, one1], GP: group[T2, o, one2],
            phi: homomorphism[T1, *, one1, T2, o, one2](G, GP),
            H: normal_subgroup[T1, *, one1](G)):
      surjective?(phi) IMPLIES
       group?[T2, o, one2]
           (extend[T2, (GP), bool, FALSE]
                (image[(G), (GP)](phi, restrict[T1, (G), boolean](H))));


decl_type: tcc
theory: homomorphism_lemmas
library: groups
signature: nil
location: 139 0 147 999
body:
  % Subtype TCC generated (at line 64, column 54) for
      % extend[T1, (G), bool, FALSE](inverse_image(phi, K))
      % expected type  group[T1, *, one1]
  homo_inv_image_normal_TCC1: OBLIGATION
    FORALL (G: group[T1, *, one1], GP: group[T2, o, one2],
            phi: homomorphism[T1, *, one1, T2, o, one2](G, GP),
            K: normal_subgroup[T2, o, one2](GP)):
      group?[T1, *, one1]
          (extend[T1, (G), bool, FALSE](inverse_image[(G), T2](phi, K)));


decl_type: tcc
theory: homomorphism_lemmas
library: groups
signature: nil
location: 149 0 155 999
body:
  % Subtype TCC generated (at line 85, column 82) for  K
      % expected type  normal_subgroup[T1, *, one1](G)
  first_isomorphism_th_TCC1: OBLIGATION
    FORALL (G: group[T1, *, one1], GP: group[T2, o, one2],
            phi: homomorphism[T1, *, one1, T2, o, one2](G, GP),
            K: subgroup[T1, *, one1](G)):
      K = kernel(G, GP)(phi) IMPLIES normal_subgroup?[T1, *, one1](K, G);


decl_type: tcc
theory: homomorphism_lemmas
library: groups
signature: nil
location: 157 0 168 999
body:
  % Subtype TCC generated (at line 85, column 85) for
      % extend[T2, (GP), bool, FALSE]
      %     (image(phi, restrict[T1, (G), boolean](G)))
      % expected type  group[T2, o, one2]
  first_isomorphism_th_TCC2: OBLIGATION
    FORALL (G: group[T1, *, one1], GP: group[T2, o, one2],
            phi: homomorphism[T1, *, one1, T2, o, one2](G, GP),
            K: subgroup[T1, *, one1](G)):
      K = kernel(G, GP)(phi) IMPLIES
       group?[T2, o, one2]
           (extend[T2, (GP), bool, FALSE]
                (image[(G), (GP)](phi, restrict[T1, (G), boolean](G))));


decl_type: tcc
theory: homomorphism_lemmas
library: groups
signature: nil
location: 170 0 177 999
body:
  % Subtype TCC generated (at line 85, column 64) for  K
      % expected type  left_cosets[T1, *, one1](G, K)
  first_isomorphism_th_TCC3: OBLIGATION
    FORALL (G: group[T1, *, one1], GP: group[T2, o, one2],
            phi: homomorphism[T1, *, one1, T2, o, one2](G, GP),
            K: subgroup[T1, *, one1](G)):
      K = kernel(G, GP)(phi) IMPLIES
       (EXISTS (a: (G)): K = *[T1, *, one1](a, K));


decl_type: tcc
theory: homomorphism_lemmas
library: groups
signature: nil
location: 179 0 188 999
body:
  % Assuming TCC generated (at line 18, column 7) for
      % algebra@homomorphisms[left_cosets(G, K), mult(G, K), K, T2, o, one2]
      % generated from assumption homomorphisms.T1_is_group
  first_isomorphism_th_TCC4: OBLIGATION
    FORALL (G: group[T1, *, one1], GP: group[T2, o, one2],
            phi: homomorphism[T1, *, one1, T2, o, one2](G, GP),
            K: subgroup[T1, *, one1](G)):
      K = kernel(G, GP)(phi) IMPLIES
       group?[left_cosets[T1, *, one1](G, K), mult[T1, *, one1](G, K), K]
           (fullset[left_cosets[T1, *, one1](G, K)]);


decl_type: formula
theory: isomorphism_theorems
library: groups
signature: nil
location: 34 0 37 67
body:
  quotient_subgroup: LEMMA 
        FORALL (M, N:normal_subgroup(G)): 
          subgroup?(N,M)
            IMPLIES subgroup?[left_cosets(G,N),mult(G,N),N](M/N, G/N)


decl_type: formula
theory: isomorphism_theorems
library: groups
signature: nil
location: 40 0 46 57
body:
  second_isomorphism_th_aux: LEMMA 
    FORALL (H: subgroup(G), N: normal_subgroup(G)):
      LET NH = prod[T1,*,one1](N,H) IN
        EXISTS (varphi: [(H) -> (NH/N)]): 
                homomorphism?(H,NH/N,varphi)                AND 
                surjective?(varphi)                        AND 
                kernel(H, NH/N)(varphi) = intersection(N,H)   


decl_type: formula
theory: isomorphism_theorems
library: groups
signature: nil
location: 49 0 53 56
body:
  second_isomorphism_th: THEOREM 
    FORALL (H: subgroup(G), N: normal_subgroup(G)):
      LET NH = prod[T1,*,one1](N,H) IN
        normal_subgroup?[T1,*,one1](intersection(N,H),H) AND 
                    isomorphic?(H/intersection(N,H), NH/N)


decl_type: formula
theory: isomorphism_theorems
library: groups
signature: nil
location: 56 0 63 44
body:
  third_isomorphism_th_aux: LEMMA 
     FORALL (M, N:  normal_subgroup(G)): 
      subgroup?(N,M)
        IMPLIES
          EXISTS (psi: [(G/N) -> (G/M)]): 
                   homomorphism?(G/N,G/M,psi)    AND 
                   surjective?(psi)              AND 
                   kernel(G/N, G/M)(psi) = M/N   


decl_type: formula
theory: isomorphism_theorems
library: groups
signature: nil
location: 66 0 71 37
body:
  third_isomorphism_th: THEOREM 
     FORALL (M, N:  normal_subgroup(G)): 
      subgroup?(N,M)
        IMPLIES
          normal_subgroup?[left_cosets(G,N),mult(G,N),N](M/N, G/N)    AND
          isomorphic?((G/N)/(M/N), G/M)


decl_type: formula
theory: isomorphism_theorems
library: groups
signature: nil
location: 77 0 86 102
body:
  correspondence_theorem: THEOREM 
          FORALL (f: homomorphism(G,GP)):
             surjective?(f)
                IMPLIES
                  EXISTS (phi: [subgroup_contain(G,kernel(G,GP)(f))  -> subgroup(GP)]):
                     phi = (LAMBDA (N: subgroup_contain(G, kernel(G, GP)(f))): image(f, N))       AND
                     bijective?(phi)                                                              AND 
                     (FORALL (N: subgroup_contain(G,kernel(G,GP)(f))):  
                         (subgroup?[T1,*,one1](N,G) IFF subgroup?[T2,o,one2](phi(N), GP))          AND
                         (normal_subgroup?[T1,*,one1](N,G) IFF normal_subgroup?[T2,o,one2](phi(N), GP)))


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 95 0 97 999
body:
  % Assuming TCC generated (at line 31, column 11) for  group[T1, *, one1]
      % generated from assumption group.fullset_is_group
  G_TCC1: OBLIGATION group?[T1, *, one1](fullset[T1]);


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 99 0 101 999
body:
  % Assuming TCC generated (at line 32, column 11) for  group[T2, o, one2]
      % generated from assumption group.fullset_is_group
  GP_TCC1: OBLIGATION group?[T2, o, one2](fullset[T2]);


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 103 0 107 999
body:
  % Subtype TCC generated (at line 38, column 60) for  N
      % expected type  normal_subgroup[T1, *, one1](M)
  quotient_subgroup_TCC1: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      subgroup?(N, M) IMPLIES normal_subgroup?[T1, *, one1](N, M);


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 109 0 117 999
body:
  % Subtype TCC generated (at line 38, column 58) for  M / N
      % expected type  set[left_cosets(G, N)]
  quotient_subgroup_TCC2: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      subgroup?(N, M) IMPLIES
       (FORALL (x: set[T1]):
          (/[T1, *, one1](M, N))(x) IMPLIES
           ((EXISTS (a: (M)): x = *[T1, *, one1](a, N)) IFF
             (EXISTS (a: (G)): x = *[T1, *, one1](a, N))));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 119 0 123 999
body:
  % Subtype TCC generated (at line 38, column 55) for  N
      % expected type  left_cosets[T1, *, one1](G, N)
  quotient_subgroup_TCC3: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      subgroup?(N, M) IMPLIES (EXISTS (a: (G)): N = *[T1, *, one1](a, N));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 125 0 130 999
body:
  % Existence TCC generated (at line 38, column 18) for
      % subgroup?[left_cosets(G, N), mult(G, N), N]
  quotient_subgroup_TCC4: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      subgroup?(N, M) IMPLIES
       (EXISTS (x: left_cosets[T1, *, one1](G, N)): TRUE);


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 132 0 139 999
body:
  % Subtype TCC generated (at line 45, column 30) for  NH
      % expected type  group[T1, *, one1]
  second_isomorphism_th_aux_TCC1: OBLIGATION
    FORALL (G: group[T1, *, one1], H: subgroup[T1, *, one1](G),
            N: normal_subgroup[T1, *, one1](G), NH: set[T1]):
      NH = prod[T1, *, one1](N, H) IMPLIES
       (FORALL (varphi: [(H) -> (/[T1, *, one1](NH, N))]):
          group?[T1, *, one1](NH));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 141 0 148 999
body:
  % Subtype TCC generated (at line 45, column 33) for  N
      % expected type  normal_subgroup[T1, *, one1](NH)
  second_isomorphism_th_aux_TCC2: OBLIGATION
    FORALL (G: group[T1, *, one1], H: subgroup[T1, *, one1](G),
            N: normal_subgroup[T1, *, one1](G), NH: set[T1]):
      NH = prod[T1, *, one1](N, H) IMPLIES
       (FORALL (varphi: [(H) -> (/[T1, *, one1](NH, N))]):
          normal_subgroup?[T1, *, one1](N, NH));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 150 0 157 999
body:
  % Subtype TCC generated (at line 45, column 33) for  N
      % expected type  left_cosets[T1, *, one1](NH, N)
  second_isomorphism_th_aux_TCC3: OBLIGATION
    FORALL (G: group[T1, *, one1], H: subgroup[T1, *, one1](G),
            N: normal_subgroup[T1, *, one1](G), NH: set[T1]):
      NH = prod[T1, *, one1](N, H) IMPLIES
       (FORALL (varphi: [(H) -> (/[T1, *, one1](NH, N))]):
          EXISTS (a: (NH)): N = *[T1, *, one1](a, N));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 159 0 170 999
body:
  % Assuming TCC generated (at line 26, column 14) for
      % algebra@homomorphisms
      %     [T1, *, one1, left_cosets[T1, *, one1](NH, N),
      %      mult[T1, *, one1](NH, N), N]
      % generated from assumption homomorphisms.T2_is_group
  second_isomorphism_th_aux_TCC4: OBLIGATION
    FORALL (G: group[T1, *, one1], H: subgroup[T1, *, one1](G),
            N: normal_subgroup[T1, *, one1](G), NH: set[T1]):
      NH = prod[T1, *, one1](N, H) IMPLIES
       (FORALL (varphi: [(H) -> (/[T1, *, one1](NH, N))]):
          group?[left_cosets[T1, *, one1](NH, N), mult[T1, *, one1](NH, N), N]
              (fullset[left_cosets[T1, *, one1](NH, N)]));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 172 0 178 999
body:
  % Subtype TCC generated (at line 53, column 34) for  intersection(N, H)
      % expected type  group[T1, *, one1]
  second_isomorphism_th_TCC1: OBLIGATION
    FORALL (G: group[T1, *, one1], H: subgroup[T1, *, one1](G),
            N: normal_subgroup[T1, *, one1](G), NH: set[T1]):
      NH = prod[T1, *, one1](N, H) IMPLIES
       group?[T1, *, one1](intersection[T1](N, H));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 180 0 187 999
body:
  % Subtype TCC generated (at line 54, column 51) for  NH
      % expected type  group[T1, *, one1]
  second_isomorphism_th_TCC2: OBLIGATION
    FORALL (G: group[T1, *, one1], H: subgroup[T1, *, one1](G),
            N: normal_subgroup[T1, *, one1](G), NH: set[T1]):
      normal_subgroup?[T1, *, one1](intersection(N, H), H) AND
       NH = prod[T1, *, one1](N, H)
       IMPLIES group?[T1, *, one1](NH);


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 189 0 196 999
body:
  % Subtype TCC generated (at line 54, column 54) for  N
      % expected type  normal_subgroup[T1, *, one1](NH)
  second_isomorphism_th_TCC3: OBLIGATION
    FORALL (G: group[T1, *, one1], H: subgroup[T1, *, one1](G),
            N: normal_subgroup[T1, *, one1](G), NH: set[T1]):
      normal_subgroup?[T1, *, one1](intersection(N, H), H) AND
       NH = prod[T1, *, one1](N, H)
       IMPLIES normal_subgroup?[T1, *, one1](N, NH);


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 198 0 207 999
body:
  % Subtype TCC generated (at line 54, column 32) for  intersection(N, H)
      % expected type  left_cosets[T1, *, one1](H, intersection(N, H))
  second_isomorphism_th_TCC4: OBLIGATION
    FORALL (G: group[T1, *, one1], H: subgroup[T1, *, one1](G),
            N: normal_subgroup[T1, *, one1](G), NH: set[T1]):
      normal_subgroup?[T1, *, one1](intersection(N, H), H) AND
       NH = prod[T1, *, one1](N, H)
       IMPLIES
       (EXISTS (a: (H)):
          intersection[T1](N, H) = *[T1, *, one1](a, intersection[T1](N, H)));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 209 0 216 999
body:
  % Subtype TCC generated (at line 54, column 54) for  N
      % expected type  left_cosets[T1, *, one1](NH, N)
  second_isomorphism_th_TCC5: OBLIGATION
    FORALL (G: group[T1, *, one1], H: subgroup[T1, *, one1](G),
            N: normal_subgroup[T1, *, one1](G), NH: set[T1]):
      normal_subgroup?[T1, *, one1](intersection(N, H), H) AND
       NH = prod[T1, *, one1](N, H)
       IMPLIES (EXISTS (a: (NH)): N = *[T1, *, one1](a, N));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 218 0 234 999
body:
  % Assuming TCC generated (at line 26, column 14) for
      % algebra@homomorphisms
      %     [left_cosets[T1, *, one1](H, intersection(N, H)),
      %      mult[T1, *, one1](H, intersection(N, H)), intersection(N, H),
      %      left_cosets[T1, *, one1](NH, N), mult[T1, *, one1](NH, N), N]
      % generated from assumption homomorphisms.T1_is_group
  second_isomorphism_th_TCC6: OBLIGATION
    FORALL (G: group[T1, *, one1], H: subgroup[T1, *, one1](G),
            N: normal_subgroup[T1, *, one1](G), NH: set[T1]):
      normal_subgroup?[T1, *, one1](intersection(N, H), H) AND
       NH = prod[T1, *, one1](N, H)
       IMPLIES
       group?
           [left_cosets[T1, *, one1](H, intersection(N, H)),
            mult[T1, *, one1](H, intersection[T1](N, H)),
            intersection[T1](N, H)]
           (fullset[left_cosets[T1, *, one1](H, intersection(N, H))]);


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 236 0 249 999
body:
  % Assuming TCC generated (at line 26, column 14) for
      % algebra@homomorphisms
      %     [left_cosets[T1, *, one1](H, intersection(N, H)),
      %      mult[T1, *, one1](H, intersection(N, H)), intersection(N, H),
      %      left_cosets[T1, *, one1](NH, N), mult[T1, *, one1](NH, N), N]
      % generated from assumption homomorphisms.T2_is_group
  second_isomorphism_th_TCC7: OBLIGATION
    FORALL (G: group[T1, *, one1], H: subgroup[T1, *, one1](G),
            N: normal_subgroup[T1, *, one1](G), NH: set[T1]):
      normal_subgroup?[T1, *, one1](intersection(N, H), H) AND
       NH = prod[T1, *, one1](N, H)
       IMPLIES
       group?[left_cosets[T1, *, one1](NH, N), mult[T1, *, one1](NH, N), N]
           (fullset[left_cosets[T1, *, one1](NH, N)]);


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 251 0 257 999
body:
  % Subtype TCC generated (at line 62, column 37) for  M
      % expected type  left_cosets[T1, *, one1](G, M)
  third_isomorphism_th_aux_TCC1: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      subgroup?(N, M) IMPLIES
       (FORALL (psi: [(/[T1, *, one1](G, N)) -> (/[T1, *, one1](G, M))]):
          EXISTS (a: (G)): M = *[T1, *, one1](a, M));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 259 0 269 999
body:
  % Assuming TCC generated (at line 26, column 14) for
      % algebra@homomorphisms
      %     [left_cosets[T1, *, one1](G, N), mult[T1, *, one1](G, N), N,
      %      left_cosets[T1, *, one1](G, M), mult[T1, *, one1](G, M), M]
      % generated from assumption homomorphisms.T1_is_group
  third_isomorphism_th_aux_TCC2: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      subgroup?(N, M) IMPLIES
       (FORALL (psi: [(/[T1, *, one1](G, N)) -> (/[T1, *, one1](G, M))]):
          group?[left_cosets[T1, *, one1](G, N), mult[T1, *, one1](G, N), N]
              (fullset[left_cosets[T1, *, one1](G, N)]));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 271 0 281 999
body:
  % Assuming TCC generated (at line 26, column 14) for
      % algebra@homomorphisms
      %     [left_cosets[T1, *, one1](G, N), mult[T1, *, one1](G, N), N,
      %      left_cosets[T1, *, one1](G, M), mult[T1, *, one1](G, M), M]
      % generated from assumption homomorphisms.T2_is_group
  third_isomorphism_th_aux_TCC3: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      subgroup?(N, M) IMPLIES
       (FORALL (psi: [(/[T1, *, one1](G, N)) -> (/[T1, *, one1](G, M))]):
          group?[left_cosets[T1, *, one1](G, M), mult[T1, *, one1](G, M), M]
              (fullset[left_cosets[T1, *, one1](G, M)]));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 283 0 294 999
body:
  % Subtype TCC generated (at line 71, column 55) for  M / N
      % expected type  group[left_cosets(G, N), mult(G, N), N]
  third_isomorphism_th_TCC1: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      subgroup?(N, M) IMPLIES
       (FORALL (x: set[T1]):
          (/[T1, *, one1](M, N))(x) IMPLIES
           ((EXISTS (a: (M)): x = *[T1, *, one1](a, N)) IFF
             (EXISTS (a: (G)): x = *[T1, *, one1](a, N))))
        AND
        group?[left_cosets[T1, *, one1](G, N), mult[T1, *, one1](G, N), N]
            (/[T1, *, one1](M, N));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 296 0 303 999
body:
  % Assuming TCC generated (at line 6, column 7) for
      % algebra@normal_subgroups[left_cosets(G, N), mult(G, N), N]
      % generated from assumption normal_subgroups.fullset_is_group
  third_isomorphism_th_TCC2: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      subgroup?(N, M) IMPLIES
       group?[left_cosets[T1, *, one1](G, N), mult(G, N), N]
           (fullset[left_cosets[T1, *, one1](G, N)]);


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 305 0 323 999
body:
  % Subtype TCC generated (at line 72, column 27) for  (M / N)
      % expected type  left_cosets
                     %     [left_cosets[T1, *, one1](G, N),
                     %      mult[T1, *, one1](G, N), N]((G / N), (M / N))
  third_isomorphism_th_TCC3: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      normal_subgroup?[left_cosets[T1, *, one1](G, N), mult(G, N), N]
          (M / N, G / N)
       AND subgroup?(N, M)
       IMPLIES
       (FORALL (x: set[T1]):
          (/[T1, *, one1](M, N))(x) IMPLIES
           ((EXISTS (a: (M)): x = *[T1, *, one1](a, N)) IFF
             (EXISTS (a: (G)): x = *[T1, *, one1](a, N))))
        AND
        (EXISTS (a: (/[T1, *, one1](G, N))):
           (/[T1, *, one1](M, N)) =
            *[left_cosets[T1, *, one1](G, N), mult[T1, *, one1](G, N), N]
                (a, (/[T1, *, one1](M, N))));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 325 0 332 999
body:
  % Subtype TCC generated (at line 72, column 35) for  M
      % expected type  left_cosets[T1, *, one1](G, M)
  third_isomorphism_th_TCC4: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      normal_subgroup?[left_cosets[T1, *, one1](G, N), mult(G, N), N]
          (M / N, G / N)
       AND subgroup?(N, M)
       IMPLIES (EXISTS (a: (G)): M = *[T1, *, one1](a, M));


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 334 0 360 999
body:
  % Assuming TCC generated (at line 26, column 14) for
      % algebra@homomorphisms
      %     [left_cosets
      %          [left_cosets[T1, *, one1](G, N), mult[T1, *, one1](G, N),
      %           N]((G / N), (M / N)),
      %      mult[left_cosets[T1, *, one1](G, N), mult[T1, *, one1](G, N), N]
      %          ((G / N), (M / N)),
      %      (M / N), left_cosets[T1, *, one1](G, M),
      %      mult[T1, *, one1](G, M), M]
      % generated from assumption homomorphisms.T1_is_group
  third_isomorphism_th_TCC5: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      normal_subgroup?[left_cosets[T1, *, one1](G, N), mult(G, N), N]
          (M / N, G / N)
       AND subgroup?(N, M)
       IMPLIES
       group?
           [left_cosets
                [left_cosets[T1, *, one1](G, N), mult[T1, *, one1](G, N),
                 N]((G / N), (M / N)),
            mult[left_cosets[T1, *, one1](G, N), mult[T1, *, one1](G, N), N]
                ((/[T1, *, one1](G, N)), (/[T1, *, one1](M, N))),
            (/[T1, *, one1](M, N))]
           (fullset
                [left_cosets
                     [left_cosets[T1, *, one1](G, N),
                      mult[T1, *, one1](G, N), N]((G / N), (M / N))]);


decl_type: tcc
theory: isomorphism_theorems
library: groups
signature: nil
location: 362 0 379 999
body:
  % Assuming TCC generated (at line 26, column 14) for
      % algebra@homomorphisms
      %     [left_cosets
      %          [left_cosets[T1, *, one1](G, N), mult[T1, *, one1](G, N),
      %           N]((G / N), (M / N)),
      %      mult[left_cosets[T1, *, one1](G, N), mult[T1, *, one1](G, N), N]
      %          ((G / N), (M / N)),
      %      (M / N), left_cosets[T1, *, one1](G, M),
      %      mult[T1, *, one1](G, M), M]
      % generated from assumption homomorphisms.T2_is_group
  third_isomorphism_th_TCC6: OBLIGATION
    FORALL (G: group[T1, *, one1], M, N: normal_subgroup[T1, *, one1](G)):
      normal_subgroup?[left_cosets[T1, *, one1](G, N), mult(G, N), N]
          (M / N, G / N)
       AND subgroup?(N, M)
       IMPLIES
       group?[left_cosets[T1, *, one1](G, M), mult[T1, *, one1](G, M), M]
           (fullset[left_cosets[T1, *, one1](G, M)]);


decl_type: formula
theory: sylow_theorems
library: groups
signature: nil
location: 50 3 51 89
body:
     subgroup_is_factor: LEMMA FORALL (N: normal_subgroup(G), S: subgroup(G/N)): 
                                        EXISTS (H: subgroup(G)): subgroup?(N,H) AND S = H/N


decl_type: formula
theory: sylow_theorems
library: groups
signature: nil
location: 57 3 64 93
body:
     First_Sylow_Theorem: THEOREM 
              FORALL (G:finite_group): prime?(p) AND order(G) = p^(n)*m AND gcd(p,m) = 1 AND i <= n
                 IMPLIES
                       (EXISTS (H: subgroup(G)): order(H) = p^i)
                                        AND
                       (FORALL (S: subgroup(G)): order(S) = p^(i - 1) 
                          IMPLIES 
                             EXISTS (K: subgroup(G)): order(K) = p^i AND normal_subgroup?(S,K))


decl_type: formula
theory: sylow_theorems
library: groups
signature: nil
location: 67 3 71 81
body:
     p_group_is_subgroup: COROLLARY 
                 FORALL (G:finite_group, H: subgroup(G)): 
                   prime?(p) AND gcd(p,m) = 1 AND i <= n AND order(G) = p^(n)*m  AND order(H) = p^(n - i)
                    IMPLIES
                       EXISTS (K: subgroup(G)): order(K) = p^(n) AND subgroup?(H,K)


decl_type: formula
theory: sylow_theorems
library: groups
signature: nil
location: 74 3 77 96
body:
     p_subgroup_sylow_order: COROLLARY FORALL (G:finite_group, P:subgroup(G)): 
                                          prime?(p) AND order(G) = p^(n)*m AND gcd(p,m) = 1 
                                              IMPLIES
                                                  (p_subgroup_sylow?(G,p)(P) IFF order(P) = p^(n))


decl_type: formula
theory: sylow_theorems
library: groups
signature: nil
location: 79 3 83 98
body:
     conjugate_is_p_subgroup_sylow: COROLLARY  FORALL (G:finite_group, P:subgroup(G)): 
                                          prime?(p) AND order(G) = p^(n)*m AND gcd(p,m) = 1 AND
                                          p_subgroup_sylow?(G,p)(P)
                                              IMPLIES 
                                                  FORALL (a:(G)): p_subgroup_sylow?(G,p)(a*P*inv(a))


decl_type: formula
theory: sylow_theorems
library: groups
signature: nil
location: 85 3 89 69
body:
     unique_is_normal: COROLLARY  FORALL (G:finite_group, P:subgroup(G)): 
                                          prime?(p) AND order(G) = p^(n)*m AND gcd(p,m) = 1 AND
                                          p_subgroup_sylow(G,p) = singleton(P)
                                              IMPLIES 
                                                  normal_subgroup?(P,G)


decl_type: formula
theory: sylow_theorems
library: groups
signature: nil
location: 95 3 102 77
body:
     Second_Sylow_Theorem: THEOREM 
              FORALL (G:finite_group, P, K:subgroup(G)): 
                 prime?(p) AND order(G) = p^(n)*m AND gcd(p,m) = 1 AND 
                 p_subgroup_sylow?(G,p)(P) AND p_group?[T,*,one](K,p)
                    IMPLIES
                       EXISTS (a:(G)): subgroup?(K,a*P*inv(a))
                                        AND
                       (p_subgroup_sylow?(G,p)(K) IMPLIES is_conjugate(G,P)(K))


decl_type: formula
theory: sylow_theorems
library: groups
signature: nil
location: 110 3 116 91
body:
     Third_Sylow_Theorem: THEOREM 
              FORALL (G:finite_group, P:subgroup(G)): 
                 prime?(p) AND order(G) = p^(n)*m AND gcd(p,m) = 1 AND 
                 p_subgroup_sylow?(G,p)(P)
                     IMPLIES
                       LET np = card(p_subgroup_sylow(G,p)) IN
                       np = index(G, normalizer(G,P)) AND divides(np,m) AND divides(p, np -1)


decl_type: function
theory: sylow_theorems
library: groups
location: 33 3 35 87
signature:
  [d: [finite_group[T, *, one], {p: posnat | prime?(p)}] ->
          [subgroup[T, *, one](d`1) -> bool]]

body:
     p_subgroup_sylow?(G:finite_group, p:{p: posnat | prime?(p)})(P:subgroup(G)): bool = 
        p_group?[T,*,one](P,p) AND 
       (FORALL (H: subgroup(G)): p_group?[T,*,one](H,p) AND subgroup?(P,H) IMPLIES P = H)


decl_type: function
theory: sylow_theorems
library: groups
signature:
  [[finite_group[T, *, one], {p: posnat | prime?(p)}] ->
  setofsets[T]]

location: 38 3 39 108
body:
     p_subgroup_sylow(G:finite_group, p:{p: posnat | prime?(p)}): setofsets[T] = 
                                                                  {P: subgroup(G) | p_subgroup_sylow?(G,p)(P)}


decl_type: function
theory: sylow_theorems
library: groups
signature:
  [d: [G: finite_group, subgroup[T, *, one](G)] ->
  [subgroup[T, *, one](d`1) -> bool]]

location: 42 3 42 100
body:
     is_conjugate(G:finite_group,H:subgroup(G))(S:subgroup(G)): bool = EXISTS (a: (G)): S = a*H*inv(a)


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 124 0 127 999
body:
  % Assuming TCC generated (at line 23, column 13) for
      % algebra@finite_groups[T, *, one]
      % generated from assumption finite_groups.fullset_is_group
  IMP_finite_groups_TCC1: OBLIGATION group?[T, *, one](fullset[T]);


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 129 0 134 999
body:
  % Subtype TCC generated (at line 35, column 24) for  P
      % expected type  finite_group[T, *, one]
  p_subgroup_sylow?_TCC1: OBLIGATION
    FORALL (G: finite_group[T, *, one], p: {p: posnat | prime?(p)},
            P: subgroup[T, *, one](G)):
      finite_group?[T, *, one](P);


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 136 0 142 999
body:
  % Subtype TCC generated (at line 36, column 49) for  H
      % expected type  finite_group[T, *, one]
  p_subgroup_sylow?_TCC2: OBLIGATION
    FORALL (G: finite_group[T, *, one], p: {p: posnat | prime?(p)},
            P: subgroup[T, *, one](G)):
      p_group?[T, *, one](P, p) IMPLIES
       (FORALL (H: subgroup[T, *, one](G)): finite_group?[T, *, one](H));


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 144 0 148 999
body:
  % Subtype TCC generated (at line 51, column 74) for  N
      % expected type  left_cosets[T, *, one](G, N)
  subgroup_is_factor_TCC1: OBLIGATION
    FORALL (G: group[T, *, one], N: normal_subgroup[T, *, one](G)):
      EXISTS (a: (G)): N = *[T, *, one](a, N);


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 150 0 156 999
body:
  % Assuming TCC generated (at line 24, column 13) for
      % algebra@group[left_cosets[T, *, one](G, N), mult[T, *, one](G, N), N]
      % generated from assumption group.fullset_is_group
  subgroup_is_factor_TCC2: OBLIGATION
    FORALL (G: group[T, *, one], N: normal_subgroup[T, *, one](G)):
      group?[left_cosets[T, *, one](G, N), mult[T, *, one](G, N), N]
          (fullset[left_cosets[T, *, one](G, N)]);


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 158 0 167 999
body:
  % Subtype TCC generated (at line 52, column 88) for  N
      % expected type  normal_subgroup[T, *, one](H)
  subgroup_is_factor_TCC3: OBLIGATION
    FORALL (G: group[T, *, one], N: normal_subgroup[T, *, one](G),
            S:
              subgroup
                  [left_cosets[T, *, one](G, N), mult[T, *, one](G, N),
                   N](/[T, *, one](G, N)),
            H: subgroup[T, *, one](G)):
      subgroup?(N, H) IMPLIES normal_subgroup?[T, *, one](N, H);


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 169 0 182 999
body:
  % Subtype TCC generated (at line 52, column 86) for  H / N
      % expected type  set[left_cosets[T, *, one](G, N)]
  subgroup_is_factor_TCC4: OBLIGATION
    FORALL (G: group[T, *, one], N: normal_subgroup[T, *, one](G),
            S:
              subgroup
                  [left_cosets[T, *, one](G, N), mult[T, *, one](G, N),
                   N](/[T, *, one](G, N)),
            H: subgroup[T, *, one](G)):
      subgroup?(N, H) IMPLIES
       (FORALL (x: set[T]):
          (/[T, *, one](H, N))(x) IMPLIES
           ((EXISTS (a: (H)): x = *[T, *, one](a, N)) IFF
             (EXISTS (a: (G)): x = *[T, *, one](a, N))));


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 184 0 187 999
body:
  % Subtype TCC generated (at line 59, column 65) for  (n)
      % expected type  {i: int | p /= 0 OR i >= 0}
  First_Sylow_Theorem_TCC1: OBLIGATION
    FORALL (n, p: posnat): prime?(p) IMPLIES p /= 0 OR n >= 0;


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 189 0 193 999
body:
  % Subtype TCC generated (at line 59, column 80) for  m
      % expected type  {jj: int | p = 0 => jj /= 0}
  First_Sylow_Theorem_TCC2: OBLIGATION
    FORALL (m, n, p: posnat, G: finite_group[T, *, one]):
      order(G) = p ^ n * m AND prime?(p) IMPLIES p = 0 => m /= 0;


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 195 0 200 999
body:
  % Subtype TCC generated (at line 61, column 53) for  H
      % expected type  finite_monad[T, *, one]
  First_Sylow_Theorem_TCC3: OBLIGATION
    FORALL (i, m, n, p: posnat, G: finite_group[T, *, one]):
      prime?(p) AND order(G) = p ^ n * m AND gcd(p, m) = 1 AND i <= n IMPLIES
       (FORALL (H: subgroup[T, *, one](G)): finite_monad?[T, *, one](H));


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 202 0 207 999
body:
  % Subtype TCC generated (at line 61, column 60) for  i
      % expected type  {i: int | p /= 0 OR i >= 0}
  First_Sylow_Theorem_TCC4: OBLIGATION
    FORALL (i, m, n, p: posnat, G: finite_group[T, *, one]):
      prime?(p) AND order(G) = p ^ n * m AND gcd(p, m) = 1 AND i <= n IMPLIES
       (FORALL (H: subgroup[T, *, one](G)): p /= 0 OR i >= 0);


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 209 0 215 999
body:
  % Subtype TCC generated (at line 63, column 61) for  (i - 1)
      % expected type  {i: int | p /= 0 OR i >= 0}
  First_Sylow_Theorem_TCC5: OBLIGATION
    FORALL (i, m, n, p: posnat, G: finite_group[T, *, one]):
           EXISTS (H: subgroup(G)): order(H) = p ^ i AND prime?(p)
       AND order(G) = p ^ n * m AND gcd(p, m) = 1 AND i <= n
       IMPLIES (FORALL (S: subgroup[T, *, one](G)): p /= 0 OR (i - 1) >= 0);


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 217 0 226 999
body:
  % Subtype TCC generated (at line 65, column 58) for  K
      % expected type  finite_monad[T, *, one]
  First_Sylow_Theorem_TCC6: OBLIGATION
    FORALL (i, m, n, p: posnat, G: finite_group[T, *, one]):
           EXISTS (H: subgroup(G)): order(H) = p ^ i AND prime?(p)
       AND order(G) = p ^ n * m AND gcd(p, m) = 1 AND i <= n
       IMPLIES
       (FORALL (S: subgroup[T, *, one](G)):
          order(S) = p ^ (i - 1) IMPLIES
           (FORALL (K: subgroup[T, *, one](G)): finite_monad?[T, *, one](K)));


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 228 0 233 999
body:
  % Subtype TCC generated (at line 70, column 37) for  m
      % expected type  {jj: int | p = 0 => jj /= 0}
  p_group_is_subgroup_TCC1: OBLIGATION
    FORALL (m, p: posnat, G: finite_group[T, *, one],
            H: subgroup[T, *, one](G)):
      prime?(p) IMPLIES p = 0 => m /= 0;


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 235 0 241 999
body:
  % Subtype TCC generated (at line 70, column 97) for  (n - i)
      % expected type  {i: int | p /= 0 OR i >= 0}
  p_group_is_subgroup_TCC2: OBLIGATION
    FORALL (i, m, n, p: posnat, G: finite_group[T, *, one],
            H: subgroup[T, *, one](G)):
      order(G) = p ^ n * m AND i <= n AND gcd(p, m) = 1 AND prime?(p) IMPLIES
       p /= 0 OR (n - i) >= 0;


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 243 0 251 999
body:
  % Subtype TCC generated (at line 72, column 52) for  K
      % expected type  finite_monad[T, *, one]
  p_group_is_subgroup_TCC3: OBLIGATION
    FORALL (i, m, n, p: posnat, G: finite_group[T, *, one],
            H: subgroup[T, *, one](G)):
           prime?(p) AND gcd(p, m) = 1 AND i <= n AND order(G) = p ^ n * m
       AND order(H) = p ^ (n - i)
       IMPLIES
       (FORALL (K: subgroup[T, *, one](G)): finite_monad?[T, *, one](K));


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 253 0 259 999
body:
  % Subtype TCC generated (at line 78, column 85) for  P
      % expected type  finite_monad[T, *, one]
  p_subgroup_sylow_order_TCC1: OBLIGATION
    FORALL (m, n, p: posnat, G: finite_group[T, *, one],
            P: subgroup[T, *, one](G)):
      prime?(p) AND order(G) = p ^ n * m AND gcd(p, m) = 1 IMPLIES
       finite_monad?[T, *, one](P);


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 261 0 274 999
body:
  % Subtype TCC generated (at line 84, column 87) for  a * P * inv(a)
      % expected type  subgroup[T, *, one](G)
  conjugate_is_p_subgroup_sylow_TCC1: OBLIGATION
    FORALL (m, n, p: posnat, G: finite_group[T, *, one],
            P: subgroup[T, *, one](G)):
      prime?(p) AND
       order(G) = p ^ n * m AND gcd(p, m) = 1 AND p_subgroup_sylow?(G, p)(P)
       IMPLIES
       (FORALL (a: (G)):
          group?[T, *, one]
              (*[T, *, one](*[T, *, one](a, P), inv[T, *, one](a)))
           AND
           subgroup?[T, *, one]
               (*[T, *, one](*[T, *, one](a, P), inv[T, *, one](a)), G));


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 276 0 283 999
body:
  % Subtype TCC generated (at line 99, column 63) for  K
      % expected type  finite_group[T, *, one]
  Second_Sylow_Theorem_TCC1: OBLIGATION
    FORALL (m, n, p: posnat, G: finite_group[T, *, one],
            P, K: subgroup[T, *, one](G)):
      p_subgroup_sylow?(G, p)(P) AND
       gcd(p, m) = 1 AND order(G) = p ^ n * m AND prime?(p)
       IMPLIES finite_group?[T, *, one](K);


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 285 0 295 999
body:
  % Subtype TCC generated (at line 101, column 49) for  a * P * inv(a)
      % expected type  (group?)
  Second_Sylow_Theorem_TCC2: OBLIGATION
    FORALL (m, n, p: posnat, G: finite_group[T, *, one],
            P, K: subgroup[T, *, one](G)):
           prime?(p) AND order(G) = p ^ n * m AND gcd(p, m) = 1
       AND p_subgroup_sylow?(G, p)(P) AND p_group?[T, *, one](K, p)
       IMPLIES
       (FORALL (a: (G)):
          group?[T, *, one]
              (*[T, *, one](*[T, *, one](a, P), inv[T, *, one](a))));


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 297 0 304 999
body:
  % Subtype TCC generated (at line 116, column 35) for  p_subgroup_sylow(G, p)
      % expected type  S: finite_set[setof[T]]
  Third_Sylow_Theorem_TCC1: OBLIGATION
    FORALL (m, n, p: posnat, G: finite_group[T, *, one],
            P: subgroup[T, *, one](G)):
      prime?(p) AND
       order(G) = p ^ n * m AND gcd(p, m) = 1 AND p_subgroup_sylow?(G, p)(P)
       IMPLIES is_finite[setof[T]](p_subgroup_sylow(G, p));


decl_type: tcc
theory: sylow_theorems
library: groups
signature: nil
location: 306 0 318 999
body:
  % Subtype TCC generated (at line 117, column 35) for  normalizer(G, P)
      % expected type  subgroup[T, *, one](G)
  Third_Sylow_Theorem_TCC2: OBLIGATION
    FORALL (m, n, p: posnat, G: finite_group[T, *, one],
            P: subgroup[T, *, one](G)):
      prime?(p) AND
       order(G) = p ^ n * m AND gcd(p, m) = 1 AND p_subgroup_sylow?(G, p)(P)
       IMPLIES
       (FORALL (np:
                  {n_1: nat | n_1 = Card[setof[T]](p_subgroup_sylow(G, p))}):
          np = card(p_subgroup_sylow(G, p)) IMPLIES
           group?[T, *, one](normalizer[T, *, one](G, P)) AND
            subgroup?[T, *, one](normalizer[T, *, one](G, P), G));


