17456
|
1 |
(* Title: CCL/equalities.ML
|
0
|
2 |
ID: $Id$
|
|
3 |
|
|
4 |
Equalities involving union, intersection, inclusion, etc.
|
|
5 |
*)
|
|
6 |
|
|
7 |
val eq_cs = set_cs addSIs [equalityI];
|
|
8 |
|
|
9 |
(** Binary Intersection **)
|
|
10 |
|
17456
|
11 |
goal (the_context ()) "A Int A = A";
|
0
|
12 |
by (fast_tac eq_cs 1);
|
757
|
13 |
qed "Int_absorb";
|
0
|
14 |
|
17456
|
15 |
goal (the_context ()) "A Int B = B Int A";
|
0
|
16 |
by (fast_tac eq_cs 1);
|
757
|
17 |
qed "Int_commute";
|
0
|
18 |
|
17456
|
19 |
goal (the_context ()) "(A Int B) Int C = A Int (B Int C)";
|
0
|
20 |
by (fast_tac eq_cs 1);
|
757
|
21 |
qed "Int_assoc";
|
0
|
22 |
|
17456
|
23 |
goal (the_context ()) "(A Un B) Int C = (A Int C) Un (B Int C)";
|
0
|
24 |
by (fast_tac eq_cs 1);
|
757
|
25 |
qed "Int_Un_distrib";
|
0
|
26 |
|
17456
|
27 |
goal (the_context ()) "(A<=B) <-> (A Int B = A)";
|
0
|
28 |
by (fast_tac (eq_cs addSEs [equalityE]) 1);
|
757
|
29 |
qed "subset_Int_eq";
|
0
|
30 |
|
|
31 |
(** Binary Union **)
|
|
32 |
|
17456
|
33 |
goal (the_context ()) "A Un A = A";
|
0
|
34 |
by (fast_tac eq_cs 1);
|
757
|
35 |
qed "Un_absorb";
|
0
|
36 |
|
17456
|
37 |
goal (the_context ()) "A Un B = B Un A";
|
0
|
38 |
by (fast_tac eq_cs 1);
|
757
|
39 |
qed "Un_commute";
|
0
|
40 |
|
17456
|
41 |
goal (the_context ()) "(A Un B) Un C = A Un (B Un C)";
|
0
|
42 |
by (fast_tac eq_cs 1);
|
757
|
43 |
qed "Un_assoc";
|
0
|
44 |
|
17456
|
45 |
goal (the_context ()) "(A Int B) Un C = (A Un C) Int (B Un C)";
|
0
|
46 |
by (fast_tac eq_cs 1);
|
757
|
47 |
qed "Un_Int_distrib";
|
0
|
48 |
|
17456
|
49 |
goal (the_context ())
|
0
|
50 |
"(A Int B) Un (B Int C) Un (C Int A) = (A Un B) Int (B Un C) Int (C Un A)";
|
|
51 |
by (fast_tac eq_cs 1);
|
757
|
52 |
qed "Un_Int_crazy";
|
0
|
53 |
|
17456
|
54 |
goal (the_context ()) "(A<=B) <-> (A Un B = B)";
|
0
|
55 |
by (fast_tac (eq_cs addSEs [equalityE]) 1);
|
757
|
56 |
qed "subset_Un_eq";
|
0
|
57 |
|
|
58 |
(** Simple properties of Compl -- complement of a set **)
|
|
59 |
|
17456
|
60 |
goal (the_context ()) "A Int Compl(A) = {x. False}";
|
0
|
61 |
by (fast_tac eq_cs 1);
|
757
|
62 |
qed "Compl_disjoint";
|
0
|
63 |
|
17456
|
64 |
goal (the_context ()) "A Un Compl(A) = {x. True}";
|
0
|
65 |
by (fast_tac eq_cs 1);
|
757
|
66 |
qed "Compl_partition";
|
0
|
67 |
|
17456
|
68 |
goal (the_context ()) "Compl(Compl(A)) = A";
|
0
|
69 |
by (fast_tac eq_cs 1);
|
757
|
70 |
qed "double_complement";
|
0
|
71 |
|
17456
|
72 |
goal (the_context ()) "Compl(A Un B) = Compl(A) Int Compl(B)";
|
0
|
73 |
by (fast_tac eq_cs 1);
|
757
|
74 |
qed "Compl_Un";
|
0
|
75 |
|
17456
|
76 |
goal (the_context ()) "Compl(A Int B) = Compl(A) Un Compl(B)";
|
0
|
77 |
by (fast_tac eq_cs 1);
|
757
|
78 |
qed "Compl_Int";
|
0
|
79 |
|
17456
|
80 |
goal (the_context ()) "Compl(UN x:A. B(x)) = (INT x:A. Compl(B(x)))";
|
0
|
81 |
by (fast_tac eq_cs 1);
|
757
|
82 |
qed "Compl_UN";
|
0
|
83 |
|
17456
|
84 |
goal (the_context ()) "Compl(INT x:A. B(x)) = (UN x:A. Compl(B(x)))";
|
0
|
85 |
by (fast_tac eq_cs 1);
|
757
|
86 |
qed "Compl_INT";
|
0
|
87 |
|
|
88 |
(*Halmos, Naive Set Theory, page 16.*)
|
|
89 |
|
17456
|
90 |
goal (the_context ()) "((A Int B) Un C = A Int (B Un C)) <-> (C<=A)";
|
0
|
91 |
by (fast_tac (eq_cs addSEs [equalityE]) 1);
|
757
|
92 |
qed "Un_Int_assoc_eq";
|
0
|
93 |
|
|
94 |
|
|
95 |
(** Big Union and Intersection **)
|
|
96 |
|
17456
|
97 |
goal (the_context ()) "Union(A Un B) = Union(A) Un Union(B)";
|
0
|
98 |
by (fast_tac eq_cs 1);
|
757
|
99 |
qed "Union_Un_distrib";
|
0
|
100 |
|
17456
|
101 |
val prems = goal (the_context ())
|
3837
|
102 |
"(Union(C) Int A = {x. False}) <-> (ALL B:C. B Int A = {x. False})";
|
0
|
103 |
by (fast_tac (eq_cs addSEs [equalityE]) 1);
|
757
|
104 |
qed "Union_disjoint";
|
0
|
105 |
|
17456
|
106 |
goal (the_context ()) "Inter(A Un B) = Inter(A) Int Inter(B)";
|
0
|
107 |
by (best_tac eq_cs 1);
|
757
|
108 |
qed "Inter_Un_distrib";
|
0
|
109 |
|
|
110 |
(** Unions and Intersections of Families **)
|
|
111 |
|
17456
|
112 |
goal (the_context ()) "(UN x:A. B(x)) = Union({Y. EX x:A. Y=B(x)})";
|
0
|
113 |
by (fast_tac eq_cs 1);
|
757
|
114 |
qed "UN_eq";
|
0
|
115 |
|
|
116 |
(*Look: it has an EXISTENTIAL quantifier*)
|
17456
|
117 |
goal (the_context ()) "(INT x:A. B(x)) = Inter({Y. EX x:A. Y=B(x)})";
|
0
|
118 |
by (fast_tac eq_cs 1);
|
757
|
119 |
qed "INT_eq";
|
0
|
120 |
|
17456
|
121 |
goal (the_context ()) "A Int Union(B) = (UN C:B. A Int C)";
|
0
|
122 |
by (fast_tac eq_cs 1);
|
757
|
123 |
qed "Int_Union_image";
|
0
|
124 |
|
17456
|
125 |
goal (the_context ()) "A Un Inter(B) = (INT C:B. A Un C)";
|
0
|
126 |
by (fast_tac eq_cs 1);
|
757
|
127 |
qed "Un_Inter_image";
|