List.ML
changeset 210 1a3d3b5b5d15
parent 203 d465d3be2744
child 212 2740293cc458
--- a/List.ML	Fri Feb 03 16:21:45 1995 +0100
+++ b/List.ML	Wed Feb 08 11:34:11 1995 +0100
@@ -55,6 +55,12 @@
 by(ALLGOALS(asm_simp_tac list_ss));
 qed "append_is_Nil";
 
+goal List.thy "(xs @ ys = xs @ zs) = (ys=zs)";
+by (list.induct_tac "xs" 1);
+by(ALLGOALS(asm_simp_tac list_ss));
+qed "same_append_eq";
+
+
 (** mem **)
 
 goal List.thy "x mem (xs@ys) = (x mem xs | x mem ys)";
@@ -96,6 +102,13 @@
 by(fast_tac HOL_cs 1);
 qed "expand_list_case";
 
+goal List.thy  "(xs=[] --> P([])) & (!y ys. xs=y#ys --> P(y#ys)) --> P(xs)";
+by(list.induct_tac "xs" 1);
+by(fast_tac HOL_cs 1);
+by(fast_tac HOL_cs 1);
+bind_thm("list_eq_cases",
+  impI RSN (2,allI RSN (2,allI RSN (2,impI RS (conjI RS (result() RS mp))))));
+
 (** nth **)
 
 val [nth_0,nth_Suc] = nat_recs nth_def; 
@@ -120,7 +133,7 @@
 qed "map_compose";
 
 val list_ss = list_ss addsimps
-  [not_Cons_self, append_assoc, append_Nil2, append_is_Nil,
+  [not_Cons_self, append_assoc, append_Nil2, append_is_Nil, same_append_eq,
    mem_append, mem_filter,
    map_ident, map_append, map_compose,
    list_all_True, list_all_conj, nth_0, nth_Suc];