8 theory Set_Comprehension_Pointfree_Tests |
8 theory Set_Comprehension_Pointfree_Tests |
9 imports Main |
9 imports Main |
10 begin |
10 begin |
11 |
11 |
12 lemma |
12 lemma |
13 "finite {p. EX x. p = (x, x)}" |
13 "finite (UNIV::'a set) ==> finite {p. EX x::'a. p = (x, x)}" |
14 apply simp |
14 by simp |
15 oops |
|
16 |
15 |
17 lemma |
16 lemma |
18 "finite {f a b| a b. a : A \<and> b : B}" |
17 "finite A ==> finite B ==> finite {f a b| a b. a : A \<and> b : B}" |
19 apply simp |
18 by simp |
20 oops |
19 |
|
20 lemma |
|
21 "finite B ==> finite A' ==> finite {f a b| a b. a : A \<and> a : A' \<and> b : B}" |
|
22 by simp |
21 |
23 |
22 lemma |
24 lemma |
23 "finite {f a b| a b. a : A \<and> a : A' \<and> b : B}" |
25 "finite A ==> finite B ==> finite {f a b| a b. a : A \<and> b : B \<and> b : B'}" |
24 apply simp |
26 by simp |
25 oops |
|
26 |
27 |
27 lemma |
28 lemma |
28 "finite {f a b| a b. a : A \<and> b : B \<and> b : B'}" |
29 "finite A ==> finite B ==> finite C ==> finite {f a b c| a b c. a : A \<and> b : B \<and> c : C}" |
29 apply simp |
30 by simp |
30 oops |
|
31 |
31 |
32 lemma |
32 lemma |
33 "finite {f a b c| a b c. a : A \<and> b : B \<and> c : C}" |
33 "finite A ==> finite B ==> finite C ==> finite D ==> |
34 apply simp |
34 finite {f a b c d| a b c d. a : A \<and> b : B \<and> c : C \<and> d : D}" |
35 oops |
35 by simp |
36 |
36 |
37 lemma |
37 lemma |
38 "finite {f a b c d| a b c d. a : A \<and> b : B \<and> c : C \<and> d : D}" |
38 "finite A ==> finite B ==> finite C ==> finite D ==> finite E ==> |
39 apply simp |
39 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}" |
40 oops |
40 by simp |
41 |
|
42 lemma |
|
43 "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}" |
|
44 apply simp |
|
45 oops |
|
46 |
41 |
47 lemma (* check arbitrary ordering *) |
42 lemma (* check arbitrary ordering *) |
48 "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'}" |
43 "finite A ==> finite B ==> finite C ==> finite D ==> finite E \<Longrightarrow> |
49 apply simp |
44 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'}" |
50 oops |
45 by simp |
51 |
46 |
52 lemma |
47 lemma |
53 "\<lbrakk> finite A ; finite B ; finite C ; finite D \<rbrakk> |
48 "\<lbrakk> finite A ; finite B ; finite C ; finite D \<rbrakk> |
54 \<Longrightarrow> finite ({f a b c d| a b c d. a : A \<and> b : B \<and> c : C \<and> d : D})" |
49 \<Longrightarrow> finite ({f a b c d| a b c d. a : A \<and> b : B \<and> c : C \<and> d : D})" |
55 by simp |
50 by simp |
61 |
56 |
62 lemma |
57 lemma |
63 "finite S ==> finite {s'. EX s:S. s' = f a e s}" |
58 "finite S ==> finite {s'. EX s:S. s' = f a e s}" |
64 by simp |
59 by simp |
65 |
60 |
|
61 lemma |
|
62 "finite A ==> finite B ==> finite {f a b| a b. a : A \<and> b : B \<and> a \<notin> Z}" |
|
63 by simp |
|
64 |
|
65 lemma |
|
66 "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}" |
|
67 by simp |
|
68 |
|
69 lemma |
|
70 "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}" |
|
71 by simp |
|
72 |
|
73 lemma |
|
74 "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}" |
|
75 by simp |
|
76 |
|
77 lemma |
|
78 "finite A ==> finite AA ==> finite B ==> finite {f a b| a b. (a : A \<or> a : AA) \<and> b : B \<and> a \<notin> Z}" |
|
79 by simp |
|
80 |
|
81 lemma |
|
82 "finite A1 ==> finite A2 ==> finite A3 ==> finite A4 ==> finite A5 ==> finite B ==> |
|
83 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}" |
|
84 apply simp |
|
85 oops |
|
86 |
66 schematic_lemma (* check interaction with schematics *) |
87 schematic_lemma (* check interaction with schematics *) |
67 "finite {x :: ?'A \<Rightarrow> ?'B \<Rightarrow> bool. \<exists>a b. x = Pair_Rep a b} |
88 "finite {x :: ?'A \<Rightarrow> ?'B \<Rightarrow> bool. \<exists>a b. x = Pair_Rep a b} |
68 = finite ((\<lambda>(a:: ?'A, b :: ?'B). Pair_Rep a b) ` (UNIV \<times> UNIV))" |
89 = finite ((\<lambda>(b :: ?'B, a:: ?'A). Pair_Rep a b) ` (UNIV \<times> UNIV))" |
69 by simp |
90 by simp |
70 |
91 |
71 lemma |
92 lemma |
72 assumes "finite S" shows "finite {(a,b,c,d). ([a, b], [c, d]) : S}" |
93 assumes "finite S" shows "finite {(a,b,c,d). ([a, b], [c, d]) : S}" |
73 proof - |
94 proof - |