src/HOL/equalities.ML
author berghofe
Mon, 03 Jun 1996 17:10:56 +0200
changeset 1786 8a31d85d27b8
parent 1763 fb07e359b59f
child 1843 a6d7aef48c2f
permissions -rw-r--r--
best_tac, deepen_tac and safe_tac now also use default claset.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1264
diff changeset
     1
(*  Title:      HOL/equalities
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1465
5d7a7e439cec expanded tabs
clasohm
parents: 1264
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
923
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
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    11
AddSIs [equalityI];
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    12
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    13
val eq_cs = set_cs addSIs [equalityI];
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    14
1548
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
    15
section "{}";
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
    16
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    17
goal Set.thy "{x.False} = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    18
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    19
qed "Collect_False_empty";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    20
Addsimps [Collect_False_empty];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    21
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    22
goal Set.thy "(A <= {}) = (A = {})";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    23
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    24
qed "subset_empty";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    25
Addsimps [subset_empty];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    26
1548
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
    27
section ":";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    28
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    29
goal Set.thy "x ~: {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    30
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    31
qed "in_empty";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    32
Addsimps[in_empty];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    33
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    34
goal Set.thy "x : insert y A = (x=y | x:A)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    35
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    36
qed "in_insert";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    37
Addsimps[in_insert];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    38
1548
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
    39
section "insert";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    40
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    41
(*NOT SUITABLE FOR REWRITING since {a} == insert a {}*)
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    42
goal Set.thy "insert a A = {a} Un A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    43
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    44
qed "insert_is_Un";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    45
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
    46
goal Set.thy "insert a A ~= {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    47
by (fast_tac (!claset addEs [equalityCE]) 1);
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
    48
qed"insert_not_empty";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    49
Addsimps[insert_not_empty];
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
    50
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
    51
bind_thm("empty_not_insert",insert_not_empty RS not_sym);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    52
Addsimps[empty_not_insert];
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
    53
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    54
goal Set.thy "!!a. a:A ==> insert a A = A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    55
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    56
qed "insert_absorb";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    57
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    58
goal Set.thy "insert x (insert x A) = insert x A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    59
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    60
qed "insert_absorb2";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    61
Addsimps [insert_absorb2];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    62
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    63
goal Set.thy "(insert x A <= B) = (x:B & A <= B)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    64
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    65
qed "insert_subset";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    66
Addsimps[insert_subset];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    67
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    68
(* use new B rather than (A-{a}) to avoid infinite unfolding *)
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    69
goal Set.thy "!!a. a:A ==> ? B. A = insert a B & a ~: B";
1553
4eb4a9c7d736 Ran expandshort
paulson
parents: 1548
diff changeset
    70
by (res_inst_tac [("x","A-{a}")] exI 1);
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    71
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    72
qed "mk_disjoint_insert";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    73
1660
8cb42cd97579 *** empty log message ***
oheimb
parents: 1618
diff changeset
    74
section "``";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    75
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    76
goal Set.thy "f``{} = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    77
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    78
qed "image_empty";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    79
Addsimps[image_empty];
923
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 "f``insert a B = insert (f a) (f``B)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    82
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    83
qed "image_insert";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
    84
Addsimps[image_insert];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    85
1660
8cb42cd97579 *** empty log message ***
oheimb
parents: 1618
diff changeset
    86
qed_goal "ball_image" Set.thy "(!y:F``S. P y) = (!x:S. P (F x))"
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    87
 (fn _ => [Fast_tac 1]);
1660
8cb42cd97579 *** empty log message ***
oheimb
parents: 1618
diff changeset
    88
1748
88650ba93c10 Added if_image_distrib.
nipkow
parents: 1660
diff changeset
    89
goalw Set.thy [image_def]
1763
fb07e359b59f expanded TABs
berghofe
parents: 1754
diff changeset
    90
"(%x. if P x then f x else g x) `` S                    \
1748
88650ba93c10 Added if_image_distrib.
nipkow
parents: 1660
diff changeset
    91
\ = (f `` ({x.x:S & P x})) Un (g `` ({x.x:S & ~(P x)}))";
88650ba93c10 Added if_image_distrib.
nipkow
parents: 1660
diff changeset
    92
by(split_tac [expand_if] 1);
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
    93
by(Fast_tac 1);
1748
88650ba93c10 Added if_image_distrib.
nipkow
parents: 1660
diff changeset
    94
qed "if_image_distrib";
88650ba93c10 Added if_image_distrib.
nipkow
parents: 1660
diff changeset
    95
Addsimps[if_image_distrib];
88650ba93c10 Added if_image_distrib.
nipkow
parents: 1660
diff changeset
    96
88650ba93c10 Added if_image_distrib.
nipkow
parents: 1660
diff changeset
    97
1660
8cb42cd97579 *** empty log message ***
oheimb
parents: 1618
diff changeset
    98
section "range";
8cb42cd97579 *** empty log message ***
oheimb
parents: 1618
diff changeset
    99
8cb42cd97579 *** empty log message ***
oheimb
parents: 1618
diff changeset
   100
qed_goal "ball_range" Set.thy "(!y:range f. P y) = (!x. P (f x))"
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   101
 (fn _ => [Fast_tac 1]);
1660
8cb42cd97579 *** empty log message ***
oheimb
parents: 1618
diff changeset
   102
8cb42cd97579 *** empty log message ***
oheimb
parents: 1618
diff changeset
   103
qed_goalw "image_range" Set.thy [image_def, range_def]
8cb42cd97579 *** empty log message ***
oheimb
parents: 1618
diff changeset
   104
 "f``range g = range (%x. f (g x))" (fn _ => [
1763
fb07e359b59f expanded TABs
berghofe
parents: 1754
diff changeset
   105
        rtac Collect_cong 1,
fb07e359b59f expanded TABs
berghofe
parents: 1754
diff changeset
   106
        Fast_tac 1]);
1660
8cb42cd97579 *** empty log message ***
oheimb
parents: 1618
diff changeset
   107
1548
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
   108
section "Int";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   109
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   110
goal Set.thy "A Int A = A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   111
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   112
qed "Int_absorb";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   113
Addsimps[Int_absorb];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   114
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   115
goal Set.thy "A Int B  =  B Int A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   116
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   117
qed "Int_commute";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   118
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   119
goal Set.thy "(A Int B) Int C  =  A Int (B Int C)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   120
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   121
qed "Int_assoc";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   122
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   123
goal Set.thy "{} Int B = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   124
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   125
qed "Int_empty_left";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   126
Addsimps[Int_empty_left];
923
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 {} = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   129
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   130
qed "Int_empty_right";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   131
Addsimps[Int_empty_right];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   132
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   133
goal Set.thy "UNIV Int B = B";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   134
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   135
qed "Int_UNIV_left";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   136
Addsimps[Int_UNIV_left];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   137
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   138
goal Set.thy "A Int UNIV = A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   139
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   140
qed "Int_UNIV_right";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   141
Addsimps[Int_UNIV_right];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   142
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   143
goal Set.thy "A Int (B Un C)  =  (A Int B) Un (A Int C)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   144
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   145
qed "Int_Un_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   146
1618
372880456b5b Library changes for mutilated checkerboard
paulson
parents: 1564
diff changeset
   147
goal Set.thy "(B Un C) Int A =  (B Int A) Un (C Int A)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   148
by (Fast_tac 1);
1618
372880456b5b Library changes for mutilated checkerboard
paulson
parents: 1564
diff changeset
   149
qed "Int_Un_distrib2";
372880456b5b Library changes for mutilated checkerboard
paulson
parents: 1564
diff changeset
   150
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   151
goal Set.thy "(A<=B) = (A Int B = A)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   152
by (fast_tac (!claset addSEs [equalityE]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   153
qed "subset_Int_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   154
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   155
goal Set.thy "(A Int B = UNIV) = (A = UNIV & B = UNIV)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   156
by (fast_tac (!claset addEs [equalityCE]) 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   157
qed "Int_UNIV";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   158
Addsimps[Int_UNIV];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   159
1548
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
   160
section "Un";
923
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
goal Set.thy "A Un A = A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   163
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   164
qed "Un_absorb";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   165
Addsimps[Un_absorb];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   166
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   167
goal Set.thy "A Un B  =  B Un A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   168
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   169
qed "Un_commute";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   170
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   171
goal Set.thy "(A Un B) Un C  =  A Un (B Un C)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   172
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   173
qed "Un_assoc";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   174
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   175
goal Set.thy "{} Un B = B";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   176
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   177
qed "Un_empty_left";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   178
Addsimps[Un_empty_left];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   179
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   180
goal Set.thy "A Un {} = A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   181
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   182
qed "Un_empty_right";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   183
Addsimps[Un_empty_right];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   184
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   185
goal Set.thy "UNIV Un B = UNIV";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   186
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   187
qed "Un_UNIV_left";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   188
Addsimps[Un_UNIV_left];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   189
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   190
goal Set.thy "A Un UNIV = UNIV";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   191
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   192
qed "Un_UNIV_right";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   193
Addsimps[Un_UNIV_right];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   194
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   195
goal Set.thy "insert a B Un C = insert a (B Un C)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   196
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   197
qed "Un_insert_left";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   198
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   199
goal Set.thy "(A Int B) Un C  =  (A Un C) Int (B Un C)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   200
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   201
qed "Un_Int_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   202
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   203
goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   204
 "(A Int B) Un (B Int C) Un (C Int A) = (A Un B) Int (B Un C) Int (C Un A)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   205
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   206
qed "Un_Int_crazy";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   207
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   208
goal Set.thy "(A<=B) = (A Un B = B)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   209
by (fast_tac (!claset addSEs [equalityE]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   210
qed "subset_Un_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   211
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   212
goal Set.thy "(A <= insert b C) = (A <= C | b:A & A-{b} <= C)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   213
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   214
qed "subset_insert_iff";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   215
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   216
goal Set.thy "(A Un B = {}) = (A = {} & B = {})";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   217
by (fast_tac (!claset addEs [equalityCE]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   218
qed "Un_empty";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   219
Addsimps[Un_empty];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   220
1548
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
   221
section "Compl";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   222
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   223
goal Set.thy "A Int Compl(A) = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   224
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   225
qed "Compl_disjoint";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   226
Addsimps[Compl_disjoint];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   227
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   228
goal Set.thy "A Un Compl(A) = UNIV";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   229
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   230
qed "Compl_partition";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   231
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   232
goal Set.thy "Compl(Compl(A)) = A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   233
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   234
qed "double_complement";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   235
Addsimps[double_complement];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   236
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   237
goal Set.thy "Compl(A Un B) = Compl(A) Int Compl(B)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   238
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   239
qed "Compl_Un";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   240
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   241
goal Set.thy "Compl(A Int B) = Compl(A) Un Compl(B)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   242
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   243
qed "Compl_Int";
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 "Compl(UN x:A. B(x)) = (INT x:A. Compl(B(x)))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   246
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   247
qed "Compl_UN";
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
goal Set.thy "Compl(INT x:A. B(x)) = (UN x:A. Compl(B(x)))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   250
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   251
qed "Compl_INT";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   252
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   253
(*Halmos, Naive Set Theory, page 16.*)
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
goal Set.thy "((A Int B) Un C = A Int (B Un C)) = (C<=A)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   256
by (fast_tac (!claset addSEs [equalityE]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   257
qed "Un_Int_assoc_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   258
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   259
1548
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
   260
section "Union";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   261
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   262
goal Set.thy "Union({}) = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   263
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   264
qed "Union_empty";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   265
Addsimps[Union_empty];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   266
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   267
goal Set.thy "Union(UNIV) = UNIV";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   268
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   269
qed "Union_UNIV";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   270
Addsimps[Union_UNIV];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   271
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   272
goal Set.thy "Union(insert a B) = a Un Union(B)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   273
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   274
qed "Union_insert";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   275
Addsimps[Union_insert];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   276
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   277
goal Set.thy "Union(A Un B) = Union(A) Un Union(B)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   278
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   279
qed "Union_Un_distrib";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   280
Addsimps[Union_Un_distrib];
923
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 "Union(A Int B) <= Union(A) Int Union(B)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   283
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   284
qed "Union_Int_subset";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   285
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   286
val prems = goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   287
   "(Union(C) Int A = {}) = (! B:C. B Int A = {})";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   288
by (fast_tac (!claset addSEs [equalityE]) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   289
qed "Union_disjoint";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   290
1548
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
   291
section "Inter";
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
   292
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   293
goal Set.thy "Inter({}) = UNIV";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   294
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   295
qed "Inter_empty";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   296
Addsimps[Inter_empty];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   297
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   298
goal Set.thy "Inter(UNIV) = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   299
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   300
qed "Inter_UNIV";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   301
Addsimps[Inter_UNIV];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   302
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   303
goal Set.thy "Inter(insert a B) = a Int Inter(B)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   304
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   305
qed "Inter_insert";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   306
Addsimps[Inter_insert];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   307
1564
822575c737bd Deleted faulty comment; proved new rule Inter_Un_subset
paulson
parents: 1553
diff changeset
   308
goal Set.thy "Inter(A) Un Inter(B) <= Inter(A Int B)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   309
by (Fast_tac 1);
1564
822575c737bd Deleted faulty comment; proved new rule Inter_Un_subset
paulson
parents: 1553
diff changeset
   310
qed "Inter_Un_subset";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   311
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   312
goal Set.thy "Inter(A Un B) = Inter(A) Int Inter(B)";
1786
8a31d85d27b8 best_tac, deepen_tac and safe_tac now also use default claset.
berghofe
parents: 1763
diff changeset
   313
by (best_tac (!claset) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   314
qed "Inter_Un_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   315
1548
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
   316
section "UN and INT";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   317
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   318
(*Basic identities*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   319
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   320
goal Set.thy "(UN x:{}. B x) = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   321
by (Fast_tac 1);
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   322
qed "UN_empty";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   323
Addsimps[UN_empty];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   324
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   325
goal Set.thy "(UN x:UNIV. B x) = (UN x. B x)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   326
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   327
qed "UN_UNIV";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   328
Addsimps[UN_UNIV];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   329
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   330
goal Set.thy "(INT x:{}. B x) = UNIV";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   331
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   332
qed "INT_empty";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   333
Addsimps[INT_empty];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   334
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   335
goal Set.thy "(INT x:UNIV. B x) = (INT x. B x)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   336
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   337
qed "INT_UNIV";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   338
Addsimps[INT_UNIV];
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   339
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   340
goal Set.thy "(UN x:insert a A. B x) = B a Un UNION A B";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   341
by (Fast_tac 1);
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   342
qed "UN_insert";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   343
Addsimps[UN_insert];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   344
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   345
goal Set.thy "(INT x:insert a A. B x) = B a Int INTER A B";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   346
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   347
qed "INT_insert";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   348
Addsimps[INT_insert];
1179
7678408f9751 Added insert_not_empty, UN_empty and UN_insert (to set_ss).
nipkow
parents: 923
diff changeset
   349
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   350
goal Set.thy "Union(range(f)) = (UN x.f(x))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   351
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   352
qed "Union_range_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   353
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   354
goal Set.thy "Inter(range(f)) = (INT x.f(x))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   355
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   356
qed "Inter_range_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   357
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   358
goal Set.thy "Union(B``A) = (UN x:A. B(x))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   359
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   360
qed "Union_image_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   361
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   362
goal Set.thy "Inter(B``A) = (INT x:A. B(x))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   363
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   364
qed "Inter_image_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   365
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   366
goal Set.thy "!!A. a: A ==> (UN y:A. c) = c";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   367
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   368
qed "UN_constant";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   369
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   370
goal Set.thy "!!A. a: A ==> (INT y:A. c) = c";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   371
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   372
qed "INT_constant";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   373
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   374
goal Set.thy "(UN x.B) = B";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   375
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   376
qed "UN1_constant";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   377
Addsimps[UN1_constant];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   378
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   379
goal Set.thy "(INT x.B) = B";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   380
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   381
qed "INT1_constant";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   382
Addsimps[INT1_constant];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   383
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   384
goal Set.thy "(UN x:A. B(x)) = Union({Y. ? x:A. Y=B(x)})";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   385
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   386
qed "UN_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   387
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   388
(*Look: it has an EXISTENTIAL quantifier*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   389
goal Set.thy "(INT x:A. B(x)) = Inter({Y. ? x:A. Y=B(x)})";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   390
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   391
qed "INT_eq";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   392
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   393
(*Distributive laws...*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   394
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   395
goal Set.thy "A Int Union(B) = (UN C:B. A Int C)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   396
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   397
qed "Int_Union";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   398
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   399
(* Devlin, Fundamentals of Contemporary Set Theory, page 12, exercise 5: 
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   400
   Union of a family of unions **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   401
goal Set.thy "(UN x:C. A(x) Un B(x)) = Union(A``C)  Un  Union(B``C)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   402
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   403
qed "Un_Union_image";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   404
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   405
(*Equivalent version*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   406
goal Set.thy "(UN i:I. A(i) Un B(i)) = (UN i:I. A(i))  Un  (UN i:I. B(i))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   407
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   408
qed "UN_Un_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   409
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   410
goal Set.thy "A Un Inter(B) = (INT C:B. A Un C)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   411
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   412
qed "Un_Inter";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   413
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   414
goal Set.thy "(INT x:C. A(x) Int B(x)) = Inter(A``C) Int Inter(B``C)";
1786
8a31d85d27b8 best_tac, deepen_tac and safe_tac now also use default claset.
berghofe
parents: 1763
diff changeset
   415
by (best_tac (!claset) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   416
qed "Int_Inter_image";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   417
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   418
(*Equivalent version*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   419
goal Set.thy "(INT i:I. A(i) Int B(i)) = (INT i:I. A(i)) Int (INT i:I. B(i))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   420
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   421
qed "INT_Int_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   422
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   423
(*Halmos, Naive Set Theory, page 35.*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   424
goal Set.thy "B Int (UN i:I. A(i)) = (UN i:I. B Int A(i))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   425
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   426
qed "Int_UN_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   427
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   428
goal Set.thy "B Un (INT i:I. A(i)) = (INT i:I. B Un A(i))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   429
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   430
qed "Un_INT_distrib";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   431
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   432
goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   433
    "(UN i:I. A(i)) Int (UN j:J. B(j)) = (UN i:I. UN j:J. A(i) Int B(j))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   434
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   435
qed "Int_UN_distrib2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   436
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   437
goal Set.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   438
    "(INT i:I. A(i)) Un (INT j:J. B(j)) = (INT i:I. INT j:J. A(i) Un B(j))";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   439
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   440
qed "Un_INT_distrib2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   441
1548
afe750876848 Added 'section' commands
nipkow
parents: 1531
diff changeset
   442
section "-";
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   443
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   444
goal Set.thy "A-A = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   445
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   446
qed "Diff_cancel";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   447
Addsimps[Diff_cancel];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   448
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   449
goal Set.thy "{}-A = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   450
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   451
qed "empty_Diff";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   452
Addsimps[empty_Diff];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   453
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   454
goal Set.thy "A-{} = A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   455
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   456
qed "Diff_empty";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   457
Addsimps[Diff_empty];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   458
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   459
goal Set.thy "A-UNIV = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   460
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   461
qed "Diff_UNIV";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   462
Addsimps[Diff_UNIV];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   463
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   464
goal Set.thy "!!x. x~:A ==> A - insert x B = A-B";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   465
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   466
qed "Diff_insert0";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   467
Addsimps [Diff_insert0];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   468
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   469
(*NOT SUITABLE FOR REWRITING since {a} == insert a 0*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   470
goal Set.thy "A - insert a B = A - B - {a}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   471
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   472
qed "Diff_insert";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   473
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   474
(*NOT SUITABLE FOR REWRITING since {a} == insert a 0*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   475
goal Set.thy "A - insert a B = A - {a} - B";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   476
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   477
qed "Diff_insert2";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   478
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   479
goal Set.thy "insert x A - B = (if x:B then A-B else insert x (A-B))";
1553
4eb4a9c7d736 Ran expandshort
paulson
parents: 1548
diff changeset
   480
by (simp_tac (!simpset setloop split_tac[expand_if]) 1);
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   481
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   482
qed "insert_Diff_if";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   483
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   484
goal Set.thy "!!x. x:B ==> insert x A - B = A-B";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   485
by (Fast_tac 1);
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   486
qed "insert_Diff1";
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   487
Addsimps [insert_Diff1];
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   488
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   489
val prems = goal Set.thy "a:A ==> insert a (A-{a}) = A";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   490
by (fast_tac (!claset addSIs prems) 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   491
qed "insert_Diff";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   492
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   493
goal Set.thy "A Int (B-A) = {}";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   494
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   495
qed "Diff_disjoint";
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   496
Addsimps[Diff_disjoint];
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   497
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   498
goal Set.thy "!!A. A<=B ==> A Un (B-A) = B";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   499
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   500
qed "Diff_partition";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   501
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   502
goal Set.thy "!!A. [| A<=B; B<= C |] ==> (B - (C - A)) = (A :: 'a set)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   503
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   504
qed "double_diff";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   505
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   506
goal Set.thy "A - (B Un C) = (A-B) Int (A-C)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   507
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   508
qed "Diff_Un";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   509
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   510
goal Set.thy "A - (B Int C) = (A-B) Un (A-C)";
1754
852093aeb0ab Replaced fast_tac by Fast_tac (which uses default claset)
berghofe
parents: 1748
diff changeset
   511
by (Fast_tac 1);
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   512
qed "Diff_Int";
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
   513
1531
e5eb247ad13c Added a constant UNIV == {x.True}
nipkow
parents: 1465
diff changeset
   514
Addsimps[subset_UNIV, empty_subsetI, subset_refl];