Thm* f:(A B A). ( a:A, b1,b2:B. f(a,b1) = f(a,b2)  b1 = b2)  ( a,a':A. Dec( b:B. a' = f(a,b)))  Graph(a:A -- > f(a,b) | b:B) Graph(a,a':A. b:B. a' = f(a,b)) | [fun-graph-rel-graph] |
Thm* R1,R2:(T T Prop). ( x,y:T. R1(x,y)  R2(x,y))  Graph(x,y:T. R1(x,y)) Graph(x,y:T. R2(x,y)) | [rel-graph_functionality] |
Thm* G,H:Graph. G H  H G | [graph-isomorphic_inversion] |
Thm* G,H,K:Graph. G H  H K  G K | [graph-isomorphic_transitivity] |
Thm* G,H:Graph. G = H  G H | [graph-isomorphic_weakening] |
Thm* For any graph
L1,L2:V List, s:Traversal. L1-- > *L2  dfsl-traversal(the_graph;L1;s)  dfsl-traversal(the_graph;L1 @ L2;s) | [dfsl-traversal-append] |
Thm* For any graph
L:V List, i:V, s:Traversal. (inr(i) s)  dfl-traversal(the_graph;L;s)  dfl-traversal(the_graph;L;[inl(i) / s]) | [dfl-traversal-consl] |
Thm* For any graph
L:V List, i:V, s:Traversal. ( j:V. (inr(j) s)  (inl(j) s)  j-the_graph- > *i)  L-- > *i  dfl-traversal(the_graph;L;s)  dfl-traversal(the_graph;L;[inr(i) / s]) | [dfl-traversal-consr] |
Thm* For any graph
L1,L2:V List, s:Traversal. L1-- > *L2  dfl-traversal(the_graph;L2;s)  dfl-traversal(the_graph;L1;s) | [dfl-traversal-connect] |
Thm* G:Graph. ( x,y:Vertices(G). Dec(x = y))  ( s:traversal(G). paren(Vertices(G);s)  no_repeats(Vertices(G)+Vertices(G);s)  df-traversal(G;s)  depthfirst-traversal(G;s)) | [paren-df-traversal] |
Thm* For any graph
i:V, s:Traversal. ( j:V. (inr(j) s)  (inl(j) s)  j-the_graph- > *i)  df-traversal(the_graph;s)  df-traversal(the_graph;[inr(i) / s]) | [df-traversal-cons2] |
Thm* For any graph
A,B,C:V List. A-- > *C B-- > *C  A @ B-- > *C | [list-list-connect-append2] |
Thm* For any graph
A,B:V List. A = B  A-- > *B | [list-list-connect_weakening] |
Thm* For any graph
A,B:V List. B A  A-- > *B | [list-list-connect-iseg] |
Thm* For any graph
A,B,C:V List. A-- > *B  B-- > *C  A-- > *C | [list-list-connect_transitivity] |
Thm* For any graph
( x,y:V. Dec(x = y))  ( x,y:V. x-the_graph- > *y  x = y ( z:V. z = x & x-the_graph- > z & z-the_graph- > *y)) | [connect-iff] |
Thm* For any graph
p:V List. 1 < ||p||  path(the_graph;p)  path(the_graph;tl(p)) | [path-tl] |
Thm* For any graph
x,y:V. x-the_graph- > y  x-the_graph- > *y | [edge-connect] |
Thm* For any graph
x,y:V. x = y  x-the_graph- > *y | [connect_weakening] |
Thm* For any graph
x,y,z:V. x-the_graph- > *y  y-the_graph- > *z  x-the_graph- > *z | [connect_transitivity] |
Thm* ( x,y:T. Dec(x = y))  ( s:(T+T) List, i:T. Dec((inl(i) s))) | [decidable__l_member_paren] |
Thm* s:(T+T) List. paren(T;s)  no_repeats(T+T;s)  ( s1,s2,s3:(T+T) List, x:T. s = (s1 @ [inl(x)] @ s2 @ [inr(x)] @ s3)  paren(T;s2)) | [paren_interval] |
Thm* s:(T+T) List. paren(T;s)  ( i:T, s1,s2:(T+T) List. s = (s1 @ [inl(i)] @ s2)  (inr(i) s2)) | [paren_order1] |
Thm* s',s3:(T+T) List. paren(T;s')  paren(T;s3)  paren(T;s3 @ s') | [append_paren] |
Thm* s':(T+T) List. paren(T;s')  ( i:T. (inr(i) s')  (inl(i) s')) | [paren_balance2] |
Thm* E:(T T  ). ( x,y:T. E(x,y)  x = y)  ( i:T, s:(T+T) List. member-left-paren(x,y.E(x,y);i;s)  (inl(i) s)) | [assert-member-left-paren] |
Thm* E:(T T  ). ( x,y:T. E(x,y)  x = y)  ( i:T, s:(T+T) List. member-right-paren(x,y.E(x,y);i;s)  (inr(i) s)) | [assert-member-right-paren] |
Thm* E:(T T  ). ( x,y:T. E(x,y)  x = y)  ( i:T, s:(T+T) List. member-paren(x,y.E(x,y);i;s)  (inl(i) s) (inr(i) s)) | [assert-member-paren] |
Thm* s':(T+T) List. paren(T;s')  ( i:T. (inl(i) s')  (inr(i) s')) | [paren_balance1] |
Thm* P:(((T+T) List) Prop). P(nil)  ( s1,s2:(T+T) List. P(s1)  P(s2)  paren(T;s1)  paren(T;s2)  P(s1 @ s2))  ( s:(T+T) List, t:T. P(s)  paren(T;s)  P([inl(t)] @ s @ [inr(t)]))  ( s:(T+T) List. paren(T;s)  P(s)) | [paren_induction] |
Thm* k: , L: List. 0 < ||L||  ( r: . r- > L^k) | [Ramsey] |
Thm* r,k: , L,R: List. 2 k  ||R|| = ||L||  ( i: ||L||. 0 < L[i]  R[i]- > L[i--]^k)  r- > R^k-1  r+1- > L^k | [Ramsey-recursion] |
Thm* L: List, i,j: ||L||. 0 < L[i]  L[i--][j] = if j= i L[j]-1 else L[j] fi | [list-dec-select] |
Thm* L: List, i: ||L||. 0 < L[i]  ||L[i--]|| = ||L||  | [list-dec-length] |
Thm* L: List, i: ||L||. 0 < L[i]  L[i--] List | [list-dec_wf] |
Thm* k: , L: List, r1,r2: . r1 r2  r1- > L^k  r2- > L^k | [arrows-monotone1] |
Thm* n,m: , f:( n  m). Inj( n; m; f)  n m | [pigeon-hole] |
Thm* n,k: , c:( n  k). p:( k ( List)). sum(||p(j)|| | j < k) = n & ( j: k, x,y: ||p(j)||. x < y  (p(j))[x] > (p(j))[y]) & ( j: k, x: ||p(j)||. (p(j))[x] < n & c((p(j))[x]) = j) | [finite-partition] |
Thm* n,m: , f:( (n-1)  (m-1)). Inj( (n-1); (m-1); f)  Inj( n; m; f[n-1:=m-1]) | [fappend-inject] |
Thm* n,m: , f:( (n-1)  (m-1)). increasing(f;n-1)  increasing(f[n-1:=m-1];n) | [fappend-increasing] |
Thm* p:  . prime(p)  ( m,n: . m m = p n n  n = 0) | [sqrt_prime_irrational] |
Def topsortedl(the_graph;L;s) == ( i,j:Vertices(the_graph). j = i  i-the_graph- > *j  i before j s) & ( i,j,k:Vertices(the_graph). k-the_graph- > *j  k-the_graph- > *i  ( k':Vertices(the_graph). k' before k L  k'-the_graph- > *i)  i before j s) | [topsortedl] |
Def dfsl-traversal(the_graph;L;s) == df-traversal(the_graph;s) & ( i:Vertices(the_graph). (inl(i) s)  L-the_graph- > *i) & (( i:Vertices(the_graph). L-the_graph- > *i  non-trivial-loop(the_graph;i))  ( L1,L2:Vertices(the_graph) List. L = (L1 @ L2)  ( s1,s2:traversal(the_graph). s = (s2 @ s1) traversal(the_graph) & paren(Vertices(the_graph);s1) & paren(Vertices(the_graph);s2) & ( j:Vertices(the_graph). ((inl(j) s1)  L1-the_graph- > *j) & ((inl(j) s2)  L2-the_graph- > *j & L1-the_graph- > *j))))) | [dfsl-traversal] |
Def dfl-traversal(the_graph;L;s) == ( i:Vertices(the_graph), s1,s2:traversal(the_graph). s = (s1 @ [inr(i)] @ s2) traversal(the_graph)  ( j:Vertices(the_graph). (inr(j) s2)  (inl(j) s2)  j-the_graph- > *i)) & ( j:Vertices(the_graph). (inr(j) s)  L-the_graph- > *j) & ( i:Vertices(the_graph), s1,s2:traversal(the_graph). ( j:Vertices(the_graph). i-the_graph- > *j  non-trivial-loop(the_graph;j))  s = (s1 @ [inl(i)] @ s2) traversal(the_graph)  L-the_graph- > *i) | [dfl-traversal] |
Def topsorted(the_graph;s) == i,j:Vertices(the_graph). i-the_graph- > *j  i = j  i before j s | [topsorted] |
Def depthfirst-traversal(the_graph;s) == i:Vertices(the_graph), s1,s2:traversal(the_graph). ( j:Vertices(the_graph). i-the_graph- > *j  non-trivial-loop(the_graph;j))  s = (s1 @ [inl(i)] @ s2) traversal(the_graph)  ( j:Vertices(the_graph). j = i  i-the_graph- > *j  (inl(j) s2)) | [depthfirst-traversal] |
Def df-traversal(G;s) == ( i:Vertices(G), s1,s2:traversal(G). s = (s1 @ [inr(i)] @ s2) traversal(G)  ( j:Vertices(G). (inr(j) s2)  (inl(j) s2)  j-G- > *i)) & ( i:Vertices(G), s1,s2:traversal(G). ( j:Vertices(G). i-G- > *j  non-trivial-loop(G;j))  s = (s1 @ [inl(i)] @ s2) traversal(G)  ( j:Vertices(G). i-G- > *j  (inr(j) s2))) | [df-traversal] |
Def r- > L^k == n: . r n  ( G:({s:( n List)| ||s|| = k & ( x,y: ||s||. x < y  s[x] < s[y]) }  ||L||). c: ||L||, f:( L[c]  n). increasing(f;L[c]) & ( s: L[c] List. ||s|| = k  ( x,y: ||s||. x < y  s[x] < s[y])  G(map(f;s)) = c)) | [arrows] |