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