Thm* A:AdjList, T:Type, s:T, x:Vertices(adjl-graph(A)), f:(T Vertices(adjl-graph(A)) T). L:Vertices(adjl-graph(A)) List. ( y:Vertices(adjl-graph(A)). x-adjl-graph(A)- > y  (y L)) & adjl-edge-accum(A;s',x'.f(s',x');s;x) = list_accum(s',x'.f(s',x');s;L) | [adjl-edge-accum-properties] |
Thm* M:AdjMatrix, T:Type, s:T, x:Vertices(adjm-graph(M)), f:(T Vertices(adjm-graph(M)) T). L:Vertices(adjm-graph(M)) List. ( y:Vertices(adjm-graph(M)). x-adjm-graph(M)- > y  (y L)) & adjm-edge-accum(M;s',x'.f(s',x');s;x) = list_accum(s',x'.f(s',x');s;L) | [adjm-edge-accum-properties] |
Thm* For any graph
the_obj:GraphObject(the_graph), P:(V Traversal Traversal Prop), s:Traversal, i:V. ( s:Traversal, i:V. (inl(i) s) (inr(i) s)  P(i,s,nil))  ( s1,s2,s3:Traversal, i,j:V. i-the_graph- > j  paren(V;s2)  ( k:V. (inr(k) s2)  j-the_graph- > *k)  paren(V;s3)  P(j,s1,s2)  P(i,s2 @ s1,s3)  P(i,s1,s3 @ s2))  ( s1,s2:Traversal, i:V. (inr(i) s1)  (inl(i) s1)  paren(V;s2)  l_disjoint(V+V;s2;s1)  no_repeats(V+V;s2)  ( j:V. (inr(j) s2)  i-the_graph- > *j)  ( j:V. i-the_graph- > j  j = i  (inl(j) s2) (inl(j) s1) (inr(j) s1))  P(i,[inr(i) / s1],s2)  P(i,s1,[inl(i) / (s2 @ [inr(i)])]))  ( s':Traversal. P(i,s,s') & l_disjoint(V+V;s';s) & no_repeats(V+V;s') & paren(V;s') & ( j:V. (inr(j) s')  i-the_graph- > *j) & dfs(the_obj;s;i) = (s' @ s)) | [dfs_induction4] |
Thm* For any graph
the_obj:GraphObject(the_graph), P:(V Traversal Traversal Prop), s:Traversal, i:V. ( s1,s2:Traversal, i:V. P(i,s1,s2)  l_disjoint(V+V;s2;s1) & no_repeats(V+V;s2))  ( s:Traversal, i:V. member-paren(x,y.the_obj.eq(x,y);i;s)  P(i,s,nil))  ( s1,s2,s3:Traversal, i,j:V. i-the_graph- > j  P(j,s1,s2)  P(i,s2 @ s1,s3)  P(i,s1,s3 @ s2))  ( s1,s2:Traversal, i:V. member-paren(x,y.the_obj.eq(x,y);i;s1)  ( j:V. i-the_graph- > j  j = i  (inl(j) s2) member-paren(x,y.the_obj.eq(x,y);j;s1))  P(i,[inr(i) / s1],s2)  P(i,s1,[inl(i) / (s2 @ [inr(i)])]))  ( s':Traversal. P(i,s,s') & dfs(the_obj;s;i) = (s' @ s)) | [dfs_induction3] |
Thm* For any graph
the_obj:GraphObject(the_graph), P:(V Traversal Traversal Prop), s:Traversal, i:V. ( s:Traversal, i:V. (inl(i) s) (inr(i) s)  P(i,s,nil))  ( s1,s2,s3:Traversal, i,j:V. i-the_graph- > j  paren(V;s2)  paren(V;s3)  P(j,s1,s2)  P(i,s2 @ s1,s3)  P(i,s1,s3 @ s2))  ( s1,s2:Traversal, i:V. (inl(i) s1)  (inr(i) s1)  P(i,[inr(i) / s1],s2)  P(i,s1,[inl(i) / (s2 @ [inr(i)])]))  ( s':Traversal. P(i,s,s') & l_disjoint(V+V;s';s) & no_repeats(V+V;s') & paren(V;s') & dfs(the_obj;s;i) = (s' @ s)) | [dfs_induction2] |
Thm* For any graph
the_obj:GraphObject(the_graph), P:(V Traversal Traversal Prop), s:Traversal, i:V. ( s1,s2:Traversal, i:V. P(i,s1,s2)  l_disjoint(V+V;s2;s1) & no_repeats(V+V;s2))  ( s:Traversal, i:V. member-paren(x,y.the_obj.eq(x,y);i;s)  P(i,s,nil))  ( s1,s2,s3:Traversal, i,j:V. i-the_graph- > j  P(j,s1,s2)  P(i,s2 @ s1,s3)  P(i,s1,s3 @ s2))  ( s1,s2:Traversal, i:V. member-paren(x,y.the_obj.eq(x,y);i;s1)  P(i,[inr(i) / s1],s2)  P(i,s1,[inl(i) / (s2 @ [inr(i)])]))  ( s':Traversal. P(i,s,s') & dfs(the_obj;s;i) = (s' @ s)) | [dfs_induction] |
Thm* For any graph
the_obj:GraphObject(the_graph). ( x,y:V. the_obj.eq(x,y)  x = y) & ( T:Type, s:T, x:V, f:(T V T). L:V List. ( y:V. x-the_graph- > y  (y L)) & the_obj.eacc(f,s,x) = list_accum(s',x'.f(s',x');s;L)) & ( T:Type, s:T, f:(T V T). L:V List. no_repeats(V;L) & ( y:V. (y L)) & the_obj.vacc(f,s) = list_accum(s',x'.f(s',x');s;L)) | [graphobj-properties] |
Thm* For any graph
eq:(V V  ), eqw:( x,y:V. eq(x,y)  x = y), eacc:( T:Type. (T V T) T V T), eaccw:( T:Type, s:T, x:V, f:(T V T). L:V List. ( y:V. x-the_graph- > y  (y L)) & eacc(f,s,x) = list_accum(s',x'.f(s',x');s;L)), vacc:( T:Type. (T V T) T T), vaccw:( T:Type, s:T, f:(T V T). L:V List. no_repeats(V;L) & ( y:V. (y L)) & vacc(f,s) = list_accum(s',x'.f(s',x');s;L)), other:Top. mkgraphobj(eq, eqw, eacc, eaccw, vacc, vaccw, other) GraphObject(the_graph) | [mkgraphobj_wf] |
Thm* For any graph
t:GraphObject(the_graph). t.eaccw ( T:Type, s:T, x:V, f:(T V T). L:V List. ( y:V. x-the_graph- > y  (y L)) & t.eacc(f,s,x) = list_accum(s',x'.f(s',x');s;L)) | [gro_eaccw_wf] |
Def GraphObject(the_graph) == eq:Vertices(the_graph) Vertices(the_graph)   ( x,y:Vertices(the_graph). (eq(x,y))  x = y) (eacc:( T:Type. (T Vertices(the_graph) T) T Vertices(the_graph) T) ( T:Type, s:T, x:Vertices(the_graph), f:(T Vertices(the_graph) T). L:Vertices(the_graph) List. ( y:Vertices(the_graph). x-the_graph- > y  (y L)) & eacc(f,s,x) = list_accum(s',x'.f(s',x');s;L)) (vacc:( T:Type. (T Vertices(the_graph) T) T T) ( T:Type, s:T, f:(T Vertices(the_graph) T). L:Vertices(the_graph) List. no_repeats(Vertices(the_graph);L) & ( y:Vertices(the_graph). (y L)) & vacc(f,s) = list_accum(s',x'.f(s',x');s;L)) Top)) | [graphobj] |