src/HOL/equalities.ML
author nipkow
Wed, 05 Jul 1995 20:14:22 +0200
changeset 1179 7678408f9751
parent 923 ff1574a81019
child 1264 3eb91524b938
permissions -rw-r--r--
Added insert_not_empty, UN_empty and UN_insert (to set_ss).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     1
(*  Title: 	HOL/equalities
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1994  University of Cambridge
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     5
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     6
Equalities involving union, intersection, inclusion, etc.
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     7
*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     8
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     9
writeln"File HOL/equalities";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    10
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    11
val eq_cs = set_cs addSIs [equalityI];
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    12
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    13
(** The membership relation, : **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    14
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    15
goal Set.thy "x ~: {}";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    16
by(fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    17
qed "in_empty";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    18
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    19
goal Set.thy "x : insert y A = (x=y | x:A)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    20
by(fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    21
qed "in_insert";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    22
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    23
(** insert **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    24
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
    25
goal Set.thy "insert a A ~= {}";
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
    26
by (fast_tac (set_cs addEs [equalityCE]) 1);
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
    27
qed"insert_not_empty";
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
    28
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
    29
bind_thm("empty_not_insert",insert_not_empty RS not_sym);
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
    30
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    31
goal Set.thy "!!a. a:A ==> insert a A = A";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    32
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    33
qed "insert_absorb";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    34
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    35
goal Set.thy "(insert x A <= B) = (x:B & A <= B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    36
by (fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    37
qed "insert_subset";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    38
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    39
(** Image **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    40
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    41
goal Set.thy "f``{} = {}";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    42
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    43
qed "image_empty";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    44
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    45
goal Set.thy "f``insert a B = insert (f a) (f``B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    46
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    47
qed "image_insert";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    48
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    49
(** Binary Intersection **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    50
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    51
goal Set.thy "A Int A = A";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    52
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    53
qed "Int_absorb";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    54
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    55
goal Set.thy "A Int B  =  B Int A";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    56
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    57
qed "Int_commute";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    58
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    59
goal Set.thy "(A Int B) Int C  =  A Int (B Int C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    60
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    61
qed "Int_assoc";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    62
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    63
goal Set.thy "{} Int B = {}";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    64
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    65
qed "Int_empty_left";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    66
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    67
goal Set.thy "A Int {} = {}";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    68
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    69
qed "Int_empty_right";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    70
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    71
goal Set.thy "A Int (B Un C)  =  (A Int B) Un (A Int C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    72
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    73
qed "Int_Un_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    74
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    75
goal Set.thy "(A<=B) = (A Int B = A)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    76
by (fast_tac (eq_cs addSEs [equalityE]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    77
qed "subset_Int_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    78
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    79
(** Binary Union **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    80
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    81
goal Set.thy "A Un A = A";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    82
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    83
qed "Un_absorb";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    84
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    85
goal Set.thy "A Un B  =  B Un A";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    86
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    87
qed "Un_commute";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    88
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    89
goal Set.thy "(A Un B) Un C  =  A Un (B Un C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    90
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    91
qed "Un_assoc";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    92
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    93
goal Set.thy "{} Un B = B";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    94
by(fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    95
qed "Un_empty_left";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    96
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    97
goal Set.thy "A Un {} = A";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    98
by(fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    99
qed "Un_empty_right";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   100
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   101
goal Set.thy "insert a B Un C = insert a (B Un C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   102
by(fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   103
qed "Un_insert_left";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   104
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   105
goal Set.thy "(A Int B) Un C  =  (A Un C) Int (B Un C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   106
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   107
qed "Un_Int_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   108
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   109
goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   110
 "(A Int B) Un (B Int C) Un (C Int A) = (A Un B) Int (B Un C) Int (C Un A)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   111
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   112
qed "Un_Int_crazy";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   113
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   114
goal Set.thy "(A<=B) = (A Un B = B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   115
by (fast_tac (eq_cs addSEs [equalityE]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   116
qed "subset_Un_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   117
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   118
goal Set.thy "(A <= insert b C) = (A <= C | b:A & A-{b} <= C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   119
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   120
qed "subset_insert_iff";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   121
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   122
goal Set.thy "(A Un B = {}) = (A = {} & B = {})";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   123
by (fast_tac (eq_cs addEs [equalityCE]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   124
qed "Un_empty";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   125
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   126
(** Simple properties of Compl -- complement of a set **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   127
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   128
goal Set.thy "A Int Compl(A) = {}";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   129
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   130
qed "Compl_disjoint";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   131
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   132
goal Set.thy "A Un Compl(A) = {x.True}";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   133
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   134
qed "Compl_partition";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   135
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   136
goal Set.thy "Compl(Compl(A)) = A";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   137
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   138
qed "double_complement";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   139
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   140
goal Set.thy "Compl(A Un B) = Compl(A) Int Compl(B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   141
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   142
qed "Compl_Un";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   143
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   144
goal Set.thy "Compl(A Int B) = Compl(A) Un Compl(B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   145
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   146
qed "Compl_Int";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   147
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   148
goal Set.thy "Compl(UN x:A. B(x)) = (INT x:A. Compl(B(x)))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   149
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   150
qed "Compl_UN";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   151
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   152
goal Set.thy "Compl(INT x:A. B(x)) = (UN x:A. Compl(B(x)))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   153
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   154
qed "Compl_INT";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   155
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   156
(*Halmos, Naive Set Theory, page 16.*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   157
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   158
goal Set.thy "((A Int B) Un C = A Int (B Un C)) = (C<=A)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   159
by (fast_tac (eq_cs addSEs [equalityE]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   160
qed "Un_Int_assoc_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   161
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   162
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   163
(** Big Union and Intersection **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   164
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   165
goal Set.thy "Union({}) = {}";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   166
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   167
qed "Union_empty";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   168
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   169
goal Set.thy "Union(insert a B) = a Un Union(B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   170
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   171
qed "Union_insert";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   172
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   173
goal Set.thy "Union(A Un B) = Union(A) Un Union(B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   174
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   175
qed "Union_Un_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   176
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   177
goal Set.thy "Union(A Int B) <= Union(A) Int Union(B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   178
by (fast_tac set_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   179
qed "Union_Int_subset";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   180
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   181
val prems = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   182
   "(Union(C) Int A = {}) = (! B:C. B Int A = {})";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   183
by (fast_tac (eq_cs addSEs [equalityE]) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   184
qed "Union_disjoint";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   185
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   186
goal Set.thy "Inter(A Un B) = Inter(A) Int Inter(B)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   187
by (best_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   188
qed "Inter_Un_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   189
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   190
(** Unions and Intersections of Families **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   191
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   192
(*Basic identities*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   193
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   194
goal Set.thy "(UN x:{}. B x) = {}";
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   195
by (fast_tac eq_cs 1);
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   196
qed "UN_empty";
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   197
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   198
goal Set.thy "(UN x:insert a A. B x) = B a Un UNION A B";
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   199
by (fast_tac eq_cs 1);
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   200
qed "UN_insert";
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   201
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   202
goal Set.thy "Union(range(f)) = (UN x.f(x))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   203
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   204
qed "Union_range_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   205
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   206
goal Set.thy "Inter(range(f)) = (INT x.f(x))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   207
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   208
qed "Inter_range_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   209
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   210
goal Set.thy "Union(B``A) = (UN x:A. B(x))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   211
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   212
qed "Union_image_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   213
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   214
goal Set.thy "Inter(B``A) = (INT x:A. B(x))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   215
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   216
qed "Inter_image_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   217
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   218
goal Set.thy "!!A. a: A ==> (UN y:A. c) = c";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   219
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   220
qed "UN_constant";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   221
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   222
goal Set.thy "!!A. a: A ==> (INT y:A. c) = c";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   223
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   224
qed "INT_constant";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   225
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   226
goal Set.thy "(UN x.B) = B";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   227
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   228
qed "UN1_constant";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   229
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   230
goal Set.thy "(INT x.B) = B";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   231
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   232
qed "INT1_constant";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   233
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   234
goal Set.thy "(UN x:A. B(x)) = Union({Y. ? x:A. Y=B(x)})";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   235
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   236
qed "UN_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   237
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   238
(*Look: it has an EXISTENTIAL quantifier*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   239
goal Set.thy "(INT x:A. B(x)) = Inter({Y. ? x:A. Y=B(x)})";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   240
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   241
qed "INT_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   242
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   243
(*Distributive laws...*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   244
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   245
goal Set.thy "A Int Union(B) = (UN C:B. A Int C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   246
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   247
qed "Int_Union";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   248
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   249
(* Devlin, Fundamentals of Contemporary Set Theory, page 12, exercise 5: 
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   250
   Union of a family of unions **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   251
goal Set.thy "(UN x:C. A(x) Un B(x)) = Union(A``C)  Un  Union(B``C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   252
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   253
qed "Un_Union_image";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   254
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   255
(*Equivalent version*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   256
goal Set.thy "(UN i:I. A(i) Un B(i)) = (UN i:I. A(i))  Un  (UN i:I. B(i))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   257
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   258
qed "UN_Un_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   259
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   260
goal Set.thy "A Un Inter(B) = (INT C:B. A Un C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   261
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   262
qed "Un_Inter";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   263
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   264
goal Set.thy "(INT x:C. A(x) Int B(x)) = Inter(A``C) Int Inter(B``C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   265
by (best_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   266
qed "Int_Inter_image";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   267
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   268
(*Equivalent version*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   269
goal Set.thy "(INT i:I. A(i) Int B(i)) = (INT i:I. A(i)) Int (INT i:I. B(i))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   270
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   271
qed "INT_Int_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   272
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   273
(*Halmos, Naive Set Theory, page 35.*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   274
goal Set.thy "B Int (UN i:I. A(i)) = (UN i:I. B Int A(i))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   275
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   276
qed "Int_UN_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   277
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   278
goal Set.thy "B Un (INT i:I. A(i)) = (INT i:I. B Un A(i))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   279
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   280
qed "Un_INT_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   281
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   282
goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   283
    "(UN i:I. A(i)) Int (UN j:J. B(j)) = (UN i:I. UN j:J. A(i) Int B(j))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   284
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   285
qed "Int_UN_distrib2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   286
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   287
goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   288
    "(INT i:I. A(i)) Un (INT j:J. B(j)) = (INT i:I. INT j:J. A(i) Un B(j))";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   289
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   290
qed "Un_INT_distrib2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   291
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   292
(** Simple properties of Diff -- set difference **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   293
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   294
goal Set.thy "A-A = {}";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   295
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   296
qed "Diff_cancel";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   297
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   298
goal Set.thy "{}-A = {}";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   299
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   300
qed "empty_Diff";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   301
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   302
goal Set.thy "A-{} = A";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   303
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   304
qed "Diff_empty";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   305
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   306
(*NOT SUITABLE FOR REWRITING since {a} == insert a 0*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   307
goal Set.thy "A - insert a B = A - B - {a}";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   308
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   309
qed "Diff_insert";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   310
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   311
(*NOT SUITABLE FOR REWRITING since {a} == insert a 0*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   312
goal Set.thy "A - insert a B = A - {a} - B";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   313
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   314
qed "Diff_insert2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   315
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   316
val prems = goal Set.thy "a:A ==> insert a (A-{a}) = A";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   317
by (fast_tac (eq_cs addSIs prems) 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   318
qed "insert_Diff";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   319
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   320
goal Set.thy "A Int (B-A) = {}";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   321
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   322
qed "Diff_disjoint";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   323
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   324
goal Set.thy "!!A. A<=B ==> A Un (B-A) = B";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   325
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   326
qed "Diff_partition";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   327
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   328
goal Set.thy "!!A. [| A<=B; B<= C |] ==> (B - (C - A)) = (A :: 'a set)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   329
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   330
qed "double_diff";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   331
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   332
goal Set.thy "A - (B Un C) = (A-B) Int (A-C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   333
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   334
qed "Diff_Un";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   335
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   336
goal Set.thy "A - (B Int C) = (A-B) Un (A-C)";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   337
by (fast_tac eq_cs 1);
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   338
qed "Diff_Int";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   339
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   340
val set_ss = set_ss addsimps
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   341
  [in_empty,in_insert,insert_subset,
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   342
   insert_not_empty,empty_not_insert,
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   343
   Int_absorb,Int_empty_left,Int_empty_right,
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   344
   Un_absorb,Un_empty_left,Un_empty_right,Un_empty,
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   345
   UN_empty, UN_insert,
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   346
   UN1_constant,image_empty,
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   347
   Compl_disjoint,double_complement,
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   348
   Union_empty,Union_insert,empty_subsetI,subset_refl,
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   349
   Diff_cancel,empty_Diff,Diff_empty,Diff_disjoint];