author bulwahn Sun, 14 Oct 2012 19:16:33 +0200 changeset 49851 4d33963962fa parent 49850 873fa7156468 child 49852 caaa1956f0da
adding further test cases to check new functionality of the simproc; strengthened test cases to check the success of the simproc more faithfully
```--- a/src/HOL/ex/Set_Comprehension_Pointfree_Tests.thy	Sun Oct 14 19:16:32 2012 +0200
+++ b/src/HOL/ex/Set_Comprehension_Pointfree_Tests.thy	Sun Oct 14 19:16:33 2012 +0200
@@ -10,44 +10,39 @@
begin

lemma
-  "finite {p. EX x. p = (x, x)}"
-  apply simp
-  oops
+  "finite (UNIV::'a set) ==> finite {p. EX x::'a. p = (x, x)}"
+  by simp

lemma
-  "finite {f a b| a b. a : A \<and> b : B}"
-  apply simp
-  oops
+  "finite A ==> finite B ==> finite {f a b| a b. a : A \<and> b : B}"
+  by simp
+
+lemma
+  "finite B ==> finite A' ==> finite {f a b| a b. a : A \<and> a : A' \<and> b : B}"
+  by simp

lemma
-  "finite {f a b| a b. a : A \<and> a : A' \<and> b : B}"
-  apply simp
-  oops
+  "finite A ==> finite B ==> finite {f a b| a b. a : A \<and> b : B \<and> b : B'}"
+  by simp

lemma
-  "finite {f a b| a b. a : A \<and> b : B \<and> b : B'}"
-  apply simp
-  oops
+  "finite A ==> finite B ==> finite C ==> finite {f a b c| a b c. a : A \<and> b : B \<and> c : C}"
+  by simp

lemma
-  "finite {f a b c| a b c. a : A \<and> b : B \<and> c : C}"
-  apply simp
-  oops
+  "finite A ==> finite B ==> finite C ==> finite D ==>
+     finite {f a b c d| a b c d. a : A \<and> b : B \<and> c : C \<and> d : D}"
+  by simp

lemma
-  "finite {f a b c d| a b c d. a : A \<and> b : B \<and> c : C \<and> d : D}"
-  apply simp
-  oops
-
-lemma
-  "finite {f a b c d e | a b c d e. a : A \<and> b : B \<and> c : C \<and> d : D \<and> e : E}"
-  apply simp
-  oops
+  "finite A ==> finite B ==> finite C ==> finite D ==> finite E ==>
+    finite {f a b c d e | a b c d e. a : A \<and> b : B \<and> c : C \<and> d : D \<and> e : E}"
+  by simp

lemma (* check arbitrary ordering *)
-  "finite {f a d c b e | e b c d a. b : B \<and> a : A \<and> e : E' \<and> c : C \<and> d : D \<and> e : E \<and> b : B'}"
-  apply simp
-  oops
+  "finite A ==> finite B ==> finite C ==> finite D ==> finite E \<Longrightarrow>
+    finite {f a d c b e | e b c d a. b : B \<and> a : A \<and> e : E' \<and> c : C \<and> d : D \<and> e : E \<and> b : B'}"
+  by simp

lemma
"\<lbrakk> finite A ; finite B ; finite C ; finite D \<rbrakk>
@@ -63,9 +58,35 @@
"finite S ==> finite {s'. EX s:S. s' = f a e s}"
by simp

+lemma
+  "finite A ==> finite B ==> finite {f a b| a b. a : A \<and> b : B \<and> a \<notin> Z}"
+  by simp
+
+lemma
+  "finite A ==> finite B ==> finite R ==> finite {f a b x y| a b x y. a : A \<and> b : B \<and> (x,y) \<in> R}"
+by simp
+
+lemma
+  "finite A ==> finite B ==> finite R ==> finite {f a b x y| a b x y. a : A \<and> (x,y) \<in> R \<and> b : B}"
+by simp
+
+lemma
+  "finite A ==> finite B ==> finite R ==> finite {f a (x, b) y| y b x a. a : A \<and> (x,y) \<in> R \<and> b : B}"
+by simp
+
+lemma
+  "finite A ==> finite AA ==> finite B ==> finite {f a b| a b. (a : A \<or> a : AA) \<and> b : B \<and> a \<notin> Z}"
+by simp
+
+lemma
+  "finite A1 ==> finite A2 ==> finite A3 ==> finite A4 ==> finite A5 ==> finite B ==>
+     finite {f a b c | a b c. ((a : A1 \<and> a : A2) \<or> (a : A3 \<and> (a : A4 \<or> a : A5))) \<and> b : B \<and> a \<notin> Z}"
+apply simp
+oops
+
schematic_lemma (* check interaction with schematics *)
"finite {x :: ?'A \<Rightarrow> ?'B \<Rightarrow> bool. \<exists>a b. x = Pair_Rep a b}
-   = finite ((\<lambda>(a:: ?'A, b :: ?'B). Pair_Rep a b) ` (UNIV \<times> UNIV))"
+   = finite ((\<lambda>(b :: ?'B, a:: ?'A). Pair_Rep a b) ` (UNIV \<times> UNIV))"
by simp

lemma```