author  nipkow 
Tue, 06 Sep 2011 14:25:16 +0200  
changeset 44744  bdf8eb8f126b 
parent 44490  e3e8d20a6ebc 
child 45121  5e495ccf6e56 
permissions  rwrr 
32139  1 
(* Author: Tobias Nipkow, Lawrence C Paulson and Markus Wenzel *) 
923  2 

11979  3 
header {* Set theory for higherorder logic *} 
4 

15131  5 
theory Set 
30304
d8e4cd2ac2a1
set operations Int, Un, INTER, UNION, Inter, Union, empty, UNIV are now proper qualified constants with authentic syntax
haftmann
parents:
29901
diff
changeset

6 
imports Lattices 
15131  7 
begin 
11979  8 

32081  9 
subsection {* Sets as predicates *} 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

10 

42163
392fd6c4669c
renewing specifications in HOL: replacing types by type_synonym
bulwahn
parents:
41107
diff
changeset

11 
type_synonym 'a set = "'a \<Rightarrow> bool" 
3820  12 

37677  13 
definition Collect :: "('a \<Rightarrow> bool) \<Rightarrow> 'a set" where  "comprehension" 
14 
"Collect P = P" 

30304
d8e4cd2ac2a1
set operations Int, Un, INTER, UNION, Inter, Union, empty, UNIV are now proper qualified constants with authentic syntax
haftmann
parents:
29901
diff
changeset

15 

37677  16 
definition member :: "'a \<Rightarrow> 'a set \<Rightarrow> bool" where  "membership" 
17 
mem_def: "member x A = A x" 

19656
09be06943252
tuned concrete syntax  abbreviation/const_syntax;
wenzelm
parents:
19637
diff
changeset

18 

21210  19 
notation 
37677  20 
member ("op :") and 
21 
member ("(_/ : _)" [50, 51] 50) 

11979  22 

37677  23 
abbreviation not_member where 
24 
"not_member x A \<equiv> ~ (x : A)"  "nonmembership" 

19656
09be06943252
tuned concrete syntax  abbreviation/const_syntax;
wenzelm
parents:
19637
diff
changeset

25 

21210  26 
notation 
37677  27 
not_member ("op ~:") and 
28 
not_member ("(_/ ~: _)" [50, 51] 50) 

19656
09be06943252
tuned concrete syntax  abbreviation/const_syntax;
wenzelm
parents:
19637
diff
changeset

29 

21210  30 
notation (xsymbols) 
37677  31 
member ("op \<in>") and 
32 
member ("(_/ \<in> _)" [50, 51] 50) and 

33 
not_member ("op \<notin>") and 

34 
not_member ("(_/ \<notin> _)" [50, 51] 50) 

19656
09be06943252
tuned concrete syntax  abbreviation/const_syntax;
wenzelm
parents:
19637
diff
changeset

35 

21210  36 
notation (HTML output) 
37677  37 
member ("op \<in>") and 
38 
member ("(_/ \<in> _)" [50, 51] 50) and 

39 
not_member ("op \<notin>") and 

40 
not_member ("(_/ \<notin> _)" [50, 51] 50) 

19656
09be06943252
tuned concrete syntax  abbreviation/const_syntax;
wenzelm
parents:
19637
diff
changeset

41 

41107  42 

43 

32081  44 
text {* Set comprehensions *} 
45 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

46 
syntax 
35115  47 
"_Coll" :: "pttrn => bool => 'a set" ("(1{_./ _})") 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

48 
translations 
35115  49 
"{x. P}" == "CONST Collect (%x. P)" 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

50 

32081  51 
syntax 
35115  52 
"_Collect" :: "idt => 'a set => bool => 'a set" ("(1{_ :/ _./ _})") 
32081  53 
syntax (xsymbols) 
35115  54 
"_Collect" :: "idt => 'a set => bool => 'a set" ("(1{_ \<in>/ _./ _})") 
32081  55 
translations 
35115  56 
"{x:A. P}" => "{x. x:A & P}" 
32081  57 

41107  58 
lemma mem_Collect_eq [iff]: "a \<in> {x. P x} = P a" 
32081  59 
by (simp add: Collect_def mem_def) 
60 

41107  61 
lemma Collect_mem_eq [simp]: "{x. x \<in> A} = A" 
32081  62 
by (simp add: Collect_def mem_def) 
63 

41107  64 
lemma CollectI: "P a \<Longrightarrow> a \<in> {x. P x}" 
32081  65 
by simp 
66 

41107  67 
lemma CollectD: "a \<in> {x. P x} \<Longrightarrow> P a" 
32081  68 
by simp 
69 

41107  70 
lemma Collect_cong: "(\<And>x. P x = Q x) ==> {x. P x} = {x. Q x}" 
32081  71 
by simp 
72 

32117
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

73 
text {* 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

74 
Simproc for pulling @{text "x=t"} in @{text "{x. \<dots> & x=t & \<dots>}"} 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

75 
to the front (and similarly for @{text "t=x"}): 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

76 
*} 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

77 

42455  78 
simproc_setup defined_Collect ("{x. P x & Q x}") = {* 
42459  79 
fn _ => 
80 
Quantifier1.rearrange_Collect 

81 
(rtac @{thm Collect_cong} 1 THEN 

42455  82 
rtac @{thm iffI} 1 THEN 
42459  83 
ALLGOALS 
84 
(EVERY' [REPEAT_DETERM o etac @{thm conjE}, DEPTH_SOLVE_1 o ares_tac @{thms conjI}])) 

32117
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

85 
*} 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

86 

32081  87 
lemmas CollectE = CollectD [elim_format] 
88 

41107  89 
lemma set_eqI: 
90 
assumes "\<And>x. x \<in> A \<longleftrightarrow> x \<in> B" 

91 
shows "A = B" 

92 
proof  

93 
from assms have "{x. x \<in> A} = {x. x \<in> B}" by simp 

94 
then show ?thesis by simp 

95 
qed 

96 

97 
lemma set_eq_iff [no_atp]: 

98 
"A = B \<longleftrightarrow> (\<forall>x. x \<in> A \<longleftrightarrow> x \<in> B)" 

99 
by (auto intro:set_eqI) 

100 

32081  101 
text {* Set enumerations *} 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

102 

32264
0be31453f698
Set.UNIV and Set.empty are mere abbreviations for top and bot
haftmann
parents:
32139
diff
changeset

103 
abbreviation empty :: "'a set" ("{}") where 
0be31453f698
Set.UNIV and Set.empty are mere abbreviations for top and bot
haftmann
parents:
32139
diff
changeset

104 
"{} \<equiv> bot" 
31456  105 

106 
definition insert :: "'a \<Rightarrow> 'a set \<Rightarrow> 'a set" where 

32081  107 
insert_compr: "insert a B = {x. x = a \<or> x \<in> B}" 
31456  108 

109 
syntax 

35115  110 
"_Finset" :: "args => 'a set" ("{(_)}") 
31456  111 
translations 
35115  112 
"{x, xs}" == "CONST insert x {xs}" 
113 
"{x}" == "CONST insert x {}" 

31456  114 

32081  115 

116 
subsection {* Subsets and bounded quantifiers *} 

117 

118 
abbreviation 

119 
subset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool" where 

120 
"subset \<equiv> less" 

121 

122 
abbreviation 

123 
subset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool" where 

124 
"subset_eq \<equiv> less_eq" 

125 

126 
notation (output) 

127 
subset ("op <") and 

128 
subset ("(_/ < _)" [50, 51] 50) and 

129 
subset_eq ("op <=") and 

130 
subset_eq ("(_/ <= _)" [50, 51] 50) 

131 

132 
notation (xsymbols) 

133 
subset ("op \<subset>") and 

134 
subset ("(_/ \<subset> _)" [50, 51] 50) and 

135 
subset_eq ("op \<subseteq>") and 

136 
subset_eq ("(_/ \<subseteq> _)" [50, 51] 50) 

137 

138 
notation (HTML output) 

139 
subset ("op \<subset>") and 

140 
subset ("(_/ \<subset> _)" [50, 51] 50) and 

141 
subset_eq ("op \<subseteq>") and 

142 
subset_eq ("(_/ \<subseteq> _)" [50, 51] 50) 

143 

144 
abbreviation (input) 

145 
supset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool" where 

146 
"supset \<equiv> greater" 

147 

148 
abbreviation (input) 

149 
supset_eq :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool" where 

150 
"supset_eq \<equiv> greater_eq" 

151 

152 
notation (xsymbols) 

153 
supset ("op \<supset>") and 

154 
supset ("(_/ \<supset> _)" [50, 51] 50) and 

155 
supset_eq ("op \<supseteq>") and 

156 
supset_eq ("(_/ \<supseteq> _)" [50, 51] 50) 

157 

37387
3581483cca6c
qualified types "+" and nat; qualified constants Ball, Bex, Suc, curry; modernized some specifications
haftmann
parents:
36009
diff
changeset

158 
definition Ball :: "'a set \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool" where 
3581483cca6c
qualified types "+" and nat; qualified constants Ball, Bex, Suc, curry; modernized some specifications
haftmann
parents:
36009
diff
changeset

159 
"Ball A P \<longleftrightarrow> (\<forall>x. x \<in> A \<longrightarrow> P x)"  "bounded universal quantifiers" 
32077
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

160 

37387
3581483cca6c
qualified types "+" and nat; qualified constants Ball, Bex, Suc, curry; modernized some specifications
haftmann
parents:
36009
diff
changeset

161 
definition Bex :: "'a set \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> bool" where 
3581483cca6c
qualified types "+" and nat; qualified constants Ball, Bex, Suc, curry; modernized some specifications
haftmann
parents:
36009
diff
changeset

162 
"Bex A P \<longleftrightarrow> (\<exists>x. x \<in> A \<and> P x)"  "bounded existential quantifiers" 
32077
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

163 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

164 
syntax 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

165 
"_Ball" :: "pttrn => 'a set => bool => bool" ("(3ALL _:_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

166 
"_Bex" :: "pttrn => 'a set => bool => bool" ("(3EX _:_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

167 
"_Bex1" :: "pttrn => 'a set => bool => bool" ("(3EX! _:_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

168 
"_Bleast" :: "id => 'a set => bool => 'a" ("(3LEAST _:_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

169 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

170 
syntax (HOL) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

171 
"_Ball" :: "pttrn => 'a set => bool => bool" ("(3! _:_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

172 
"_Bex" :: "pttrn => 'a set => bool => bool" ("(3? _:_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

173 
"_Bex1" :: "pttrn => 'a set => bool => bool" ("(3?! _:_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

174 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

175 
syntax (xsymbols) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

176 
"_Ball" :: "pttrn => 'a set => bool => bool" ("(3\<forall>_\<in>_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

177 
"_Bex" :: "pttrn => 'a set => bool => bool" ("(3\<exists>_\<in>_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

178 
"_Bex1" :: "pttrn => 'a set => bool => bool" ("(3\<exists>!_\<in>_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

179 
"_Bleast" :: "id => 'a set => bool => 'a" ("(3LEAST_\<in>_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

180 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

181 
syntax (HTML output) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

182 
"_Ball" :: "pttrn => 'a set => bool => bool" ("(3\<forall>_\<in>_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

183 
"_Bex" :: "pttrn => 'a set => bool => bool" ("(3\<exists>_\<in>_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

184 
"_Bex1" :: "pttrn => 'a set => bool => bool" ("(3\<exists>!_\<in>_./ _)" [0, 0, 10] 10) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

185 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

186 
translations 
35115  187 
"ALL x:A. P" == "CONST Ball A (%x. P)" 
188 
"EX x:A. P" == "CONST Bex A (%x. P)" 

189 
"EX! x:A. P" => "EX! x. x:A & P" 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

190 
"LEAST x:A. P" => "LEAST x. x:A & P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

191 

19656
09be06943252
tuned concrete syntax  abbreviation/const_syntax;
wenzelm
parents:
19637
diff
changeset

192 
syntax (output) 
14804
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

193 
"_setlessAll" :: "[idt, 'a, bool] => bool" ("(3ALL _<_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

194 
"_setlessEx" :: "[idt, 'a, bool] => bool" ("(3EX _<_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

195 
"_setleAll" :: "[idt, 'a, bool] => bool" ("(3ALL _<=_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

196 
"_setleEx" :: "[idt, 'a, bool] => bool" ("(3EX _<=_./ _)" [0, 0, 10] 10) 
20217
25b068a99d2b
linear arithmetic splits certain operators (e.g. min, max, abs)
webertj
parents:
19870
diff
changeset

197 
"_setleEx1" :: "[idt, 'a, bool] => bool" ("(3EX! _<=_./ _)" [0, 0, 10] 10) 
14804
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

198 

8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

199 
syntax (xsymbols) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

200 
"_setlessAll" :: "[idt, 'a, bool] => bool" ("(3\<forall>_\<subset>_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

201 
"_setlessEx" :: "[idt, 'a, bool] => bool" ("(3\<exists>_\<subset>_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

202 
"_setleAll" :: "[idt, 'a, bool] => bool" ("(3\<forall>_\<subseteq>_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

203 
"_setleEx" :: "[idt, 'a, bool] => bool" ("(3\<exists>_\<subseteq>_./ _)" [0, 0, 10] 10) 
20217
25b068a99d2b
linear arithmetic splits certain operators (e.g. min, max, abs)
webertj
parents:
19870
diff
changeset

204 
"_setleEx1" :: "[idt, 'a, bool] => bool" ("(3\<exists>!_\<subseteq>_./ _)" [0, 0, 10] 10) 
14804
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

205 

19656
09be06943252
tuned concrete syntax  abbreviation/const_syntax;
wenzelm
parents:
19637
diff
changeset

206 
syntax (HOL output) 
14804
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

207 
"_setlessAll" :: "[idt, 'a, bool] => bool" ("(3! _<_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

208 
"_setlessEx" :: "[idt, 'a, bool] => bool" ("(3? _<_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

209 
"_setleAll" :: "[idt, 'a, bool] => bool" ("(3! _<=_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

210 
"_setleEx" :: "[idt, 'a, bool] => bool" ("(3? _<=_./ _)" [0, 0, 10] 10) 
20217
25b068a99d2b
linear arithmetic splits certain operators (e.g. min, max, abs)
webertj
parents:
19870
diff
changeset

211 
"_setleEx1" :: "[idt, 'a, bool] => bool" ("(3?! _<=_./ _)" [0, 0, 10] 10) 
14804
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

212 

8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

213 
syntax (HTML output) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

214 
"_setlessAll" :: "[idt, 'a, bool] => bool" ("(3\<forall>_\<subset>_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

215 
"_setlessEx" :: "[idt, 'a, bool] => bool" ("(3\<exists>_\<subset>_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

216 
"_setleAll" :: "[idt, 'a, bool] => bool" ("(3\<forall>_\<subseteq>_./ _)" [0, 0, 10] 10) 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

217 
"_setleEx" :: "[idt, 'a, bool] => bool" ("(3\<exists>_\<subseteq>_./ _)" [0, 0, 10] 10) 
20217
25b068a99d2b
linear arithmetic splits certain operators (e.g. min, max, abs)
webertj
parents:
19870
diff
changeset

218 
"_setleEx1" :: "[idt, 'a, bool] => bool" ("(3\<exists>!_\<subseteq>_./ _)" [0, 0, 10] 10) 
14804
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

219 

8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

220 
translations 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

221 
"\<forall>A\<subset>B. P" => "ALL A. A \<subset> B > P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

222 
"\<exists>A\<subset>B. P" => "EX A. A \<subset> B & P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

223 
"\<forall>A\<subseteq>B. P" => "ALL A. A \<subseteq> B > P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

224 
"\<exists>A\<subseteq>B. P" => "EX A. A \<subseteq> B & P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

225 
"\<exists>!A\<subseteq>B. P" => "EX! A. A \<subseteq> B & P" 
14804
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

226 

8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

227 
print_translation {* 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

228 
let 
35115  229 
val Type (set_type, _) = @{typ "'a set"}; (* FIXME 'a => bool (!?!) *) 
42287
d98eb048a2e4
discontinued special treatment of structure Mixfix;
wenzelm
parents:
42284
diff
changeset

230 
val All_binder = Mixfix.binder_name @{const_syntax All}; 
d98eb048a2e4
discontinued special treatment of structure Mixfix;
wenzelm
parents:
42284
diff
changeset

231 
val Ex_binder = Mixfix.binder_name @{const_syntax Ex}; 
38786
e46e7a9cb622
formerly unnamed infix impliciation now named HOL.implies
haftmann
parents:
38715
diff
changeset

232 
val impl = @{const_syntax HOL.implies}; 
38795
848be46708dc
formerly unnamed infix conjunction and disjunction now named HOL.conj and HOL.disj
haftmann
parents:
38786
diff
changeset

233 
val conj = @{const_syntax HOL.conj}; 
35115  234 
val sbset = @{const_syntax subset}; 
235 
val sbset_eq = @{const_syntax subset_eq}; 

21819  236 

237 
val trans = 

35115  238 
[((All_binder, impl, sbset), @{syntax_const "_setlessAll"}), 
239 
((All_binder, impl, sbset_eq), @{syntax_const "_setleAll"}), 

240 
((Ex_binder, conj, sbset), @{syntax_const "_setlessEx"}), 

241 
((Ex_binder, conj, sbset_eq), @{syntax_const "_setleEx"})]; 

21819  242 

243 
fun mk v v' c n P = 

244 
if v = v' andalso not (Term.exists_subterm (fn Free (x, _) => x = v  _ => false) n) 

42284  245 
then Syntax.const c $ Syntax_Trans.mark_bound v' $ n $ P else raise Match; 
21819  246 

247 
fun tr' q = (q, 

35115  248 
fn [Const (@{syntax_const "_bound"}, _) $ Free (v, Type (T, _)), 
249 
Const (c, _) $ 

250 
(Const (d, _) $ (Const (@{syntax_const "_bound"}, _) $ Free (v', _)) $ n) $ P] => 

251 
if T = set_type then 

252 
(case AList.lookup (op =) trans (q, c, d) of 

253 
NONE => raise Match 

254 
 SOME l => mk v v' l n P) 

255 
else raise Match 

256 
 _ => raise Match); 

14804
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

257 
in 
21819  258 
[tr' All_binder, tr' Ex_binder] 
14804
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

259 
end 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

260 
*} 
8de39d3e8eb6
Corrected printer bug for bounded quantifiers Q x<=y. P
nipkow
parents:
14752
diff
changeset

261 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

262 

11979  263 
text {* 
264 
\medskip Translate between @{text "{e  x1...xn. P}"} and @{text 

265 
"{u. EX x1..xn. u = e & P}"}; @{text "{y. EX x1..xn. y = e & P}"} is 

266 
only translated if @{text "[0..n] subset bvs(e)"}. 

267 
*} 

268 

35115  269 
syntax 
270 
"_Setcompr" :: "'a => idts => bool => 'a set" ("(1{_ /_./ _})") 

271 

11979  272 
parse_translation {* 
273 
let 

42284  274 
val ex_tr = snd (Syntax_Trans.mk_binder_tr ("EX ", @{const_syntax Ex})); 
3947  275 

35115  276 
fun nvars (Const (@{syntax_const "_idts"}, _) $ _ $ idts) = nvars idts + 1 
11979  277 
 nvars _ = 1; 
278 

279 
fun setcompr_tr [e, idts, b] = 

280 
let 

38864
4abe644fcea5
formerly unnamed infix equality now named HOL.eq
haftmann
parents:
38795
diff
changeset

281 
val eq = Syntax.const @{const_syntax HOL.eq} $ Bound (nvars idts) $ e; 
38795
848be46708dc
formerly unnamed infix conjunction and disjunction now named HOL.conj and HOL.disj
haftmann
parents:
38786
diff
changeset

282 
val P = Syntax.const @{const_syntax HOL.conj} $ eq $ b; 
11979  283 
val exP = ex_tr [idts, P]; 
44241  284 
in Syntax.const @{const_syntax Collect} $ absdummy dummyT exP end; 
11979  285 

35115  286 
in [(@{syntax_const "_Setcompr"}, setcompr_tr)] end; 
11979  287 
*} 
923  288 

35115  289 
print_translation {* 
42284  290 
[Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax Ball} @{syntax_const "_Ball"}, 
291 
Syntax_Trans.preserve_binder_abs2_tr' @{const_syntax Bex} @{syntax_const "_Bex"}] 

35115  292 
*}  {* to avoid etacontraction of body *} 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

293 

13763
f94b569cd610
added print translations tha avoid eta contraction for important binders.
nipkow
parents:
13653
diff
changeset

294 
print_translation {* 
f94b569cd610
added print translations tha avoid eta contraction for important binders.
nipkow
parents:
13653
diff
changeset

295 
let 
42284  296 
val ex_tr' = snd (Syntax_Trans.mk_binder_tr' (@{const_syntax Ex}, "DUMMY")); 
13763
f94b569cd610
added print translations tha avoid eta contraction for important binders.
nipkow
parents:
13653
diff
changeset

297 

f94b569cd610
added print translations tha avoid eta contraction for important binders.
nipkow
parents:
13653
diff
changeset

298 
fun setcompr_tr' [Abs (abs as (_, _, P))] = 
f94b569cd610
added print translations tha avoid eta contraction for important binders.
nipkow
parents:
13653
diff
changeset

299 
let 
35115  300 
fun check (Const (@{const_syntax Ex}, _) $ Abs (_, _, P), n) = check (P, n + 1) 
38795
848be46708dc
formerly unnamed infix conjunction and disjunction now named HOL.conj and HOL.disj
haftmann
parents:
38786
diff
changeset

301 
 check (Const (@{const_syntax HOL.conj}, _) $ 
38864
4abe644fcea5
formerly unnamed infix equality now named HOL.eq
haftmann
parents:
38795
diff
changeset

302 
(Const (@{const_syntax HOL.eq}, _) $ Bound m $ e) $ P, n) = 
13763
f94b569cd610
added print translations tha avoid eta contraction for important binders.
nipkow
parents:
13653
diff
changeset

303 
n > 0 andalso m = n andalso not (loose_bvar1 (P, n)) andalso 
33038  304 
subset (op =) (0 upto (n  1), add_loose_bnos (e, 0, [])) 
35115  305 
 check _ = false; 
923  306 

11979  307 
fun tr' (_ $ abs) = 
308 
let val _ $ idts $ (_ $ (_ $ _ $ e) $ Q) = ex_tr' [abs] 

35115  309 
in Syntax.const @{syntax_const "_Setcompr"} $ e $ idts $ Q end; 
310 
in 

311 
if check (P, 0) then tr' P 

312 
else 

313 
let 

42284  314 
val (x as _ $ Free(xN, _), t) = Syntax_Trans.atomic_abs_tr' abs; 
35115  315 
val M = Syntax.const @{syntax_const "_Coll"} $ x $ t; 
316 
in 

317 
case t of 

38795
848be46708dc
formerly unnamed infix conjunction and disjunction now named HOL.conj and HOL.disj
haftmann
parents:
38786
diff
changeset

318 
Const (@{const_syntax HOL.conj}, _) $ 
37677  319 
(Const (@{const_syntax Set.member}, _) $ 
35115  320 
(Const (@{syntax_const "_bound"}, _) $ Free (yN, _)) $ A) $ P => 
321 
if xN = yN then Syntax.const @{syntax_const "_Collect"} $ x $ A $ P else M 

322 
 _ => M 

323 
end 

13763
f94b569cd610
added print translations tha avoid eta contraction for important binders.
nipkow
parents:
13653
diff
changeset

324 
end; 
35115  325 
in [(@{const_syntax Collect}, setcompr_tr')] end; 
11979  326 
*} 
327 

42455  328 
simproc_setup defined_Bex ("EX x:A. P x & Q x") = {* 
329 
let 

330 
val unfold_bex_tac = unfold_tac @{thms Bex_def}; 

331 
fun prove_bex_tac ss = unfold_bex_tac ss THEN Quantifier1.prove_one_point_ex_tac; 

42459  332 
in fn _ => fn ss => Quantifier1.rearrange_bex (prove_bex_tac ss) ss end 
42455  333 
*} 
334 

335 
simproc_setup defined_All ("ALL x:A. P x > Q x") = {* 

336 
let 

337 
val unfold_ball_tac = unfold_tac @{thms Ball_def}; 

338 
fun prove_ball_tac ss = unfold_ball_tac ss THEN Quantifier1.prove_one_point_all_tac; 

42459  339 
in fn _ => fn ss => Quantifier1.rearrange_ball (prove_ball_tac ss) ss end 
32117
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

340 
*} 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

341 

11979  342 
lemma ballI [intro!]: "(!!x. x:A ==> P x) ==> ALL x:A. P x" 
343 
by (simp add: Ball_def) 

344 

345 
lemmas strip = impI allI ballI 

346 

347 
lemma bspec [dest?]: "ALL x:A. P x ==> x:A ==> P x" 

348 
by (simp add: Ball_def) 

349 

350 
text {* 

351 
Gives better instantiation for bound: 

352 
*} 

353 

26339  354 
declaration {* fn _ => 
355 
Classical.map_cs (fn cs => cs addbefore ("bspec", datac @{thm bspec} 1)) 

11979  356 
*} 
357 

32117
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

358 
ML {* 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

359 
structure Simpdata = 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

360 
struct 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

361 

0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

362 
open Simpdata; 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

363 

0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

364 
val mksimps_pairs = [(@{const_name Ball}, @{thms bspec})] @ mksimps_pairs; 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

365 

0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

366 
end; 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

367 

0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

368 
open Simpdata; 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

369 
*} 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

370 

0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

371 
declaration {* fn _ => 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

372 
Simplifier.map_ss (fn ss => ss setmksimps (mksimps mksimps_pairs)) 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

373 
*} 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

374 

0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

375 
lemma ballE [elim]: "ALL x:A. P x ==> (P x ==> Q) ==> (x ~: A ==> Q) ==> Q" 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

376 
by (unfold Ball_def) blast 
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

377 

11979  378 
lemma bexI [intro]: "P x ==> x:A ==> EX x:A. P x" 
379 
 {* Normally the best argument order: @{prop "P x"} constrains the 

380 
choice of @{prop "x:A"}. *} 

381 
by (unfold Bex_def) blast 

382 

13113  383 
lemma rev_bexI [intro?]: "x:A ==> P x ==> EX x:A. P x" 
11979  384 
 {* The best argument order when there is only one @{prop "x:A"}. *} 
385 
by (unfold Bex_def) blast 

386 

387 
lemma bexCI: "(ALL x:A. ~P x ==> P a) ==> a:A ==> EX x:A. P x" 

388 
by (unfold Bex_def) blast 

389 

390 
lemma bexE [elim!]: "EX x:A. P x ==> (!!x. x:A ==> P x ==> Q) ==> Q" 

391 
by (unfold Bex_def) blast 

392 

393 
lemma ball_triv [simp]: "(ALL x:A. P) = ((EX x. x:A) > P)" 

394 
 {* Trival rewrite rule. *} 

395 
by (simp add: Ball_def) 

396 

397 
lemma bex_triv [simp]: "(EX x:A. P) = ((EX x. x:A) & P)" 

398 
 {* Dual form for existentials. *} 

399 
by (simp add: Bex_def) 

400 

401 
lemma bex_triv_one_point1 [simp]: "(EX x:A. x = a) = (a:A)" 

402 
by blast 

403 

404 
lemma bex_triv_one_point2 [simp]: "(EX x:A. a = x) = (a:A)" 

405 
by blast 

406 

407 
lemma bex_one_point1 [simp]: "(EX x:A. x = a & P x) = (a:A & P a)" 

408 
by blast 

409 

410 
lemma bex_one_point2 [simp]: "(EX x:A. a = x & P x) = (a:A & P a)" 

411 
by blast 

412 

413 
lemma ball_one_point1 [simp]: "(ALL x:A. x = a > P x) = (a:A > P a)" 

414 
by blast 

415 

416 
lemma ball_one_point2 [simp]: "(ALL x:A. a = x > P x) = (a:A > P a)" 

417 
by blast 

418 

43818  419 
lemma ball_conj_distrib: 
420 
"(\<forall>x\<in>A. P x \<and> Q x) \<longleftrightarrow> ((\<forall>x\<in>A. P x) \<and> (\<forall>x\<in>A. Q x))" 

421 
by blast 

422 

423 
lemma bex_disj_distrib: 

424 
"(\<exists>x\<in>A. P x \<or> Q x) \<longleftrightarrow> ((\<exists>x\<in>A. P x) \<or> (\<exists>x\<in>A. Q x))" 

425 
by blast 

426 

11979  427 

32081  428 
text {* Congruence rules *} 
11979  429 

16636
1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

430 
lemma ball_cong: 
11979  431 
"A = B ==> (!!x. x:B ==> P x = Q x) ==> 
432 
(ALL x:A. P x) = (ALL x:B. Q x)" 

433 
by (simp add: Ball_def) 

434 

16636
1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

435 
lemma strong_ball_cong [cong]: 
1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

436 
"A = B ==> (!!x. x:B =simp=> P x = Q x) ==> 
1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

437 
(ALL x:A. P x) = (ALL x:B. Q x)" 
1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

438 
by (simp add: simp_implies_def Ball_def) 
1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

439 

1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

440 
lemma bex_cong: 
11979  441 
"A = B ==> (!!x. x:B ==> P x = Q x) ==> 
442 
(EX x:A. P x) = (EX x:B. Q x)" 

443 
by (simp add: Bex_def cong: conj_cong) 

1273  444 

16636
1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

445 
lemma strong_bex_cong [cong]: 
1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

446 
"A = B ==> (!!x. x:B =simp=> P x = Q x) ==> 
1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

447 
(EX x:A. P x) = (EX x:B. Q x)" 
1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

448 
by (simp add: simp_implies_def Bex_def cong: conj_cong) 
1ed737a98198
Added strong_ball_cong and strong_bex_cong (these are now the standard
berghofe
parents:
15950
diff
changeset

449 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

450 

32081  451 
subsection {* Basic operations *} 
452 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

453 
subsubsection {* Subsets *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

454 

33022
c95102496490
Removal of the unused atpset concept, the atp attribute and some related code.
paulson
parents:
32888
diff
changeset

455 
lemma subsetI [intro!]: "(\<And>x. x \<in> A \<Longrightarrow> x \<in> B) \<Longrightarrow> A \<subseteq> B" 
32888  456 
unfolding mem_def by (rule le_funI, rule le_boolI) 
30352  457 

11979  458 
text {* 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

459 
\medskip Map the type @{text "'a set => anything"} to just @{typ 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

460 
'a}; for overloading constants whose first argument has type @{typ 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

461 
"'a set"}. 
11979  462 
*} 
463 

30596  464 
lemma subsetD [elim, intro?]: "A \<subseteq> B ==> c \<in> A ==> c \<in> B" 
32888  465 
unfolding mem_def by (erule le_funE, erule le_boolE) 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

466 
 {* Rule in Modus Ponens style. *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

467 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

468 
lemma rev_subsetD [no_atp,intro?]: "c \<in> A ==> A \<subseteq> B ==> c \<in> B" 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

469 
 {* The same, with reversed premises for use with @{text erule}  
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

470 
cf @{text rev_mp}. *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

471 
by (rule subsetD) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

472 

11979  473 
text {* 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

474 
\medskip Converts @{prop "A \<subseteq> B"} to @{prop "x \<in> A ==> x \<in> B"}. 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

475 
*} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

476 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

477 
lemma subsetCE [no_atp,elim]: "A \<subseteq> B ==> (c \<notin> A ==> P) ==> (c \<in> B ==> P) ==> P" 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

478 
 {* Classical elimination rule. *} 
32888  479 
unfolding mem_def by (blast dest: le_funE le_boolE) 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

480 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

481 
lemma subset_eq [no_atp]: "A \<le> B = (\<forall>x\<in>A. x \<in> B)" by blast 
2388  482 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

483 
lemma contra_subsetD [no_atp]: "A \<subseteq> B ==> c \<notin> B ==> c \<notin> A" 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

484 
by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

485 

33022
c95102496490
Removal of the unused atpset concept, the atp attribute and some related code.
paulson
parents:
32888
diff
changeset

486 
lemma subset_refl [simp]: "A \<subseteq> A" 
32081  487 
by (fact order_refl) 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

488 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

489 
lemma subset_trans: "A \<subseteq> B ==> B \<subseteq> C ==> A \<subseteq> C" 
32081  490 
by (fact order_trans) 
491 

492 
lemma set_rev_mp: "x:A ==> A \<subseteq> B ==> x:B" 

493 
by (rule subsetD) 

494 

495 
lemma set_mp: "A \<subseteq> B ==> x:A ==> x:B" 

496 
by (rule subsetD) 

497 

33044  498 
lemma eq_mem_trans: "a=b ==> b \<in> A ==> a \<in> A" 
499 
by simp 

500 

32081  501 
lemmas basic_trans_rules [trans] = 
33044  502 
order_trans_rules set_rev_mp set_mp eq_mem_trans 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

503 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

504 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

505 
subsubsection {* Equality *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

506 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

507 
lemma subset_antisym [intro!]: "A \<subseteq> B ==> B \<subseteq> A ==> A = B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

508 
 {* Antisymmetry of the subset relation. *} 
39302
d7728f65b353
renamed lemmas: ext_iff > fun_eq_iff, set_ext_iff > set_eq_iff, set_ext > set_eqI
nipkow
parents:
39213
diff
changeset

509 
by (iprover intro: set_eqI subsetD) 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

510 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

511 
text {* 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

512 
\medskip Equality rules from ZF set theory  are they appropriate 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

513 
here? 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

514 
*} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

515 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

516 
lemma equalityD1: "A = B ==> A \<subseteq> B" 
34209  517 
by simp 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

518 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

519 
lemma equalityD2: "A = B ==> B \<subseteq> A" 
34209  520 
by simp 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

521 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

522 
text {* 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

523 
\medskip Be careful when adding this to the claset as @{text 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

524 
subset_empty} is in the simpset: @{prop "A = {}"} goes to @{prop "{} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

525 
\<subseteq> A"} and @{prop "A \<subseteq> {}"} and then back to @{prop "A = {}"}! 
30352  526 
*} 
527 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

528 
lemma equalityE: "A = B ==> (A \<subseteq> B ==> B \<subseteq> A ==> P) ==> P" 
34209  529 
by simp 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

530 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

531 
lemma equalityCE [elim]: 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

532 
"A = B ==> (c \<in> A ==> c \<in> B ==> P) ==> (c \<notin> A ==> c \<notin> B ==> P) ==> P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

533 
by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

534 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

535 
lemma eqset_imp_iff: "A = B ==> (x : A) = (x : B)" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

536 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

537 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

538 
lemma eqelem_imp_iff: "x = y ==> (x : A) = (y : A)" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

539 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

540 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

541 

41082  542 
subsubsection {* The empty set *} 
543 

544 
lemma empty_def: 

545 
"{} = {x. False}" 

43818  546 
by (simp add: bot_fun_def Collect_def) 
41082  547 

548 
lemma empty_iff [simp]: "(c : {}) = False" 

549 
by (simp add: empty_def) 

550 

551 
lemma emptyE [elim!]: "a : {} ==> P" 

552 
by simp 

553 

554 
lemma empty_subsetI [iff]: "{} \<subseteq> A" 

555 
 {* One effect is to delete the ASSUMPTION @{prop "{} <= A"} *} 

556 
by blast 

557 

558 
lemma equals0I: "(!!y. y \<in> A ==> False) ==> A = {}" 

559 
by blast 

560 

561 
lemma equals0D: "A = {} ==> a \<notin> A" 

562 
 {* Use for reasoning about disjointness: @{text "A Int B = {}"} *} 

563 
by blast 

564 

565 
lemma ball_empty [simp]: "Ball {} P = True" 

566 
by (simp add: Ball_def) 

567 

568 
lemma bex_empty [simp]: "Bex {} P = False" 

569 
by (simp add: Bex_def) 

570 

571 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

572 
subsubsection {* The universal set  UNIV *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

573 

32264
0be31453f698
Set.UNIV and Set.empty are mere abbreviations for top and bot
haftmann
parents:
32139
diff
changeset

574 
abbreviation UNIV :: "'a set" where 
0be31453f698
Set.UNIV and Set.empty are mere abbreviations for top and bot
haftmann
parents:
32139
diff
changeset

575 
"UNIV \<equiv> top" 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

576 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

577 
lemma UNIV_def: 
32117
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

578 
"UNIV = {x. True}" 
43818  579 
by (simp add: top_fun_def Collect_def) 
32081  580 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

581 
lemma UNIV_I [simp]: "x : UNIV" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

582 
by (simp add: UNIV_def) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

583 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

584 
declare UNIV_I [intro]  {* unsafe makes it less likely to cause problems *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

585 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

586 
lemma UNIV_witness [intro?]: "EX x. x : UNIV" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

587 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

588 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

589 
lemma subset_UNIV [simp]: "A \<subseteq> UNIV" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

590 
by (rule subsetI) (rule UNIV_I) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

591 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

592 
text {* 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

593 
\medskip Etacontracting these two rules (to remove @{text P}) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

594 
causes them to be ignored because of their interaction with 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

595 
congruence rules. 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

596 
*} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

597 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

598 
lemma ball_UNIV [simp]: "Ball UNIV P = All P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

599 
by (simp add: Ball_def) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

600 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

601 
lemma bex_UNIV [simp]: "Bex UNIV P = Ex P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

602 
by (simp add: Bex_def) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

603 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

604 
lemma UNIV_eq_I: "(\<And>x. x \<in> A) \<Longrightarrow> UNIV = A" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

605 
by auto 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

606 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

607 
lemma UNIV_not_empty [iff]: "UNIV ~= {}" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

608 
by (blast elim: equalityE) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

609 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

610 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

611 
subsubsection {* The Powerset operator  Pow *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

612 

32077
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

613 
definition Pow :: "'a set => 'a set set" where 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

614 
Pow_def: "Pow A = {B. B \<le> A}" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

615 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

616 
lemma Pow_iff [iff]: "(A \<in> Pow B) = (A \<subseteq> B)" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

617 
by (simp add: Pow_def) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

618 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

619 
lemma PowI: "A \<subseteq> B ==> A \<in> Pow B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

620 
by (simp add: Pow_def) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

621 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

622 
lemma PowD: "A \<in> Pow B ==> A \<subseteq> B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

623 
by (simp add: Pow_def) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

624 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

625 
lemma Pow_bottom: "{} \<in> Pow B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

626 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

627 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

628 
lemma Pow_top: "A \<in> Pow A" 
34209  629 
by simp 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

630 

40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

631 
lemma Pow_not_empty: "Pow A \<noteq> {}" 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

632 
using Pow_top by blast 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

633 

41076
a7fba340058c
primitive definitions of bot/top/inf/sup for bool and fun are named with canonical suffix `_def` rather than `_eq`;
haftmann
parents:
40872
diff
changeset

634 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

635 
subsubsection {* Set complement *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

636 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

637 
lemma Compl_iff [simp]: "(c \<in> A) = (c \<notin> A)" 
43818  638 
by (simp add: mem_def fun_Compl_def) 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

639 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

640 
lemma ComplI [intro!]: "(c \<in> A ==> False) ==> c \<in> A" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

641 
by (unfold mem_def fun_Compl_def bool_Compl_def) blast 
923  642 

11979  643 
text {* 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

644 
\medskip This form, with negated conclusion, works well with the 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

645 
Classical prover. Negated assumptions behave like formulae on the 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

646 
right side of the notional turnstile ... *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

647 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

648 
lemma ComplD [dest!]: "c : A ==> c~:A" 
43818  649 
by (simp add: mem_def fun_Compl_def) 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

650 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

651 
lemmas ComplE = ComplD [elim_format] 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

652 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

653 
lemma Compl_eq: " A = {x. ~ x : A}" by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

654 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

655 

41082  656 
subsubsection {* Binary intersection *} 
657 

658 
abbreviation inter :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "Int" 70) where 

659 
"op Int \<equiv> inf" 

660 

661 
notation (xsymbols) 

662 
inter (infixl "\<inter>" 70) 

663 

664 
notation (HTML output) 

665 
inter (infixl "\<inter>" 70) 

666 

667 
lemma Int_def: 

668 
"A \<inter> B = {x. x \<in> A \<and> x \<in> B}" 

43818  669 
by (simp add: inf_fun_def Collect_def mem_def) 
41082  670 

671 
lemma Int_iff [simp]: "(c : A Int B) = (c:A & c:B)" 

672 
by (unfold Int_def) blast 

673 

674 
lemma IntI [intro!]: "c:A ==> c:B ==> c : A Int B" 

675 
by simp 

676 

677 
lemma IntD1: "c : A Int B ==> c:A" 

678 
by simp 

679 

680 
lemma IntD2: "c : A Int B ==> c:B" 

681 
by simp 

682 

683 
lemma IntE [elim!]: "c : A Int B ==> (c:A ==> c:B ==> P) ==> P" 

684 
by simp 

685 

686 
lemma mono_Int: "mono f \<Longrightarrow> f (A \<inter> B) \<subseteq> f A \<inter> f B" 

687 
by (fact mono_inf) 

688 

689 

690 
subsubsection {* Binary union *} 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

691 

32683
7c1fe854ca6a
inter and union are mere abbreviations for inf and sup
haftmann
parents:
32456
diff
changeset

692 
abbreviation union :: "'a set \<Rightarrow> 'a set \<Rightarrow> 'a set" (infixl "Un" 65) where 
41076
a7fba340058c
primitive definitions of bot/top/inf/sup for bool and fun are named with canonical suffix `_def` rather than `_eq`;
haftmann
parents:
40872
diff
changeset

693 
"union \<equiv> sup" 
32081  694 

695 
notation (xsymbols) 

32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

696 
union (infixl "\<union>" 65) 
32081  697 

698 
notation (HTML output) 

32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

699 
union (infixl "\<union>" 65) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

700 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

701 
lemma Un_def: 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

702 
"A \<union> B = {x. x \<in> A \<or> x \<in> B}" 
43818  703 
by (simp add: sup_fun_def Collect_def mem_def) 
32081  704 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

705 
lemma Un_iff [simp]: "(c : A Un B) = (c:A  c:B)" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

706 
by (unfold Un_def) blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

707 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

708 
lemma UnI1 [elim?]: "c:A ==> c : A Un B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

709 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

710 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

711 
lemma UnI2 [elim?]: "c:B ==> c : A Un B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

712 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

713 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

714 
text {* 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

715 
\medskip Classical introduction rule: no commitment to @{prop A} vs 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

716 
@{prop B}. 
11979  717 
*} 
718 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

719 
lemma UnCI [intro!]: "(c~:B ==> c:A) ==> c : A Un B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

720 
by auto 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

721 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

722 
lemma UnE [elim!]: "c : A Un B ==> (c:A ==> P) ==> (c:B ==> P) ==> P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

723 
by (unfold Un_def) blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

724 

32117
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

725 
lemma insert_def: "insert a B = {x. x = a} \<union> B" 
32081  726 
by (simp add: Collect_def mem_def insert_compr Un_def) 
727 

728 
lemma mono_Un: "mono f \<Longrightarrow> f A \<union> f B \<subseteq> f (A \<union> B)" 

32683
7c1fe854ca6a
inter and union are mere abbreviations for inf and sup
haftmann
parents:
32456
diff
changeset

729 
by (fact mono_sup) 
32081  730 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

731 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

732 
subsubsection {* Set difference *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

733 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

734 
lemma Diff_iff [simp]: "(c : A  B) = (c:A & c~:B)" 
43818  735 
by (simp add: mem_def fun_diff_def) 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

736 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

737 
lemma DiffI [intro!]: "c : A ==> c ~: B ==> c : A  B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

738 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

739 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

740 
lemma DiffD1: "c : A  B ==> c : A" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

741 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

742 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

743 
lemma DiffD2: "c : A  B ==> c : B ==> P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

744 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

745 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

746 
lemma DiffE [elim!]: "c : A  B ==> (c:A ==> c~:B ==> P) ==> P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

747 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

748 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

749 
lemma set_diff_eq: "A  B = {x. x : A & ~ x : B}" by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

750 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

751 
lemma Compl_eq_Diff_UNIV: "A = (UNIV  A)" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

752 
by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

753 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

754 

31456  755 
subsubsection {* Augmenting a set  @{const insert} *} 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

756 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

757 
lemma insert_iff [simp]: "(a : insert b A) = (a = b  a:A)" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

758 
by (unfold insert_def) blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

759 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

760 
lemma insertI1: "a : insert a B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

761 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

762 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

763 
lemma insertI2: "a : B ==> a : insert b B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

764 
by simp 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

765 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

766 
lemma insertE [elim!]: "a : insert b A ==> (a = b ==> P) ==> (a:A ==> P) ==> P" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

767 
by (unfold insert_def) blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

768 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

769 
lemma insertCI [intro!]: "(a~:B ==> a = b) ==> a: insert b B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

770 
 {* Classical introduction rule. *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

771 
by auto 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

772 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

773 
lemma subset_insert_iff: "(A \<subseteq> insert x B) = (if x:A then A  {x} \<subseteq> B else A \<subseteq> B)" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

774 
by auto 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

775 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

776 
lemma set_insert: 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

777 
assumes "x \<in> A" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

778 
obtains B where "A = insert x B" and "x \<notin> B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

779 
proof 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

780 
from assms show "A = insert x (A  {x})" by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

781 
next 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

782 
show "x \<notin> A  {x}" by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

783 
qed 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

784 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

785 
lemma insert_ident: "x ~: A ==> x ~: B ==> (insert x A = insert x B) = (A = B)" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

786 
by auto 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

787 

44744  788 
lemma insert_eq_iff: assumes "a \<notin> A" "b \<notin> B" 
789 
shows "insert a A = insert b B \<longleftrightarrow> 

790 
(if a=b then A=B else \<exists>C. A = insert b C \<and> b \<notin> C \<and> B = insert a C \<and> a \<notin> C)" 

791 
(is "?L \<longleftrightarrow> ?R") 

792 
proof 

793 
assume ?L 

794 
show ?R 

795 
proof cases 

796 
assume "a=b" with assms `?L` show ?R by (simp add: insert_ident) 

797 
next 

798 
assume "a\<noteq>b" 

799 
let ?C = "A  {b}" 

800 
have "A = insert b ?C \<and> b \<notin> ?C \<and> B = insert a ?C \<and> a \<notin> ?C" 

801 
using assms `?L` `a\<noteq>b` by auto 

802 
thus ?R using `a\<noteq>b` by auto 

803 
qed 

804 
next 

805 
assume ?R thus ?L by(auto split: if_splits) 

806 
qed 

807 

30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

808 
subsubsection {* Singletons, using insert *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

809 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

810 
lemma singletonI [intro!,no_atp]: "a : {a}" 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

811 
 {* Redundant? But unlike @{text insertCI}, it proves the subgoal immediately! *} 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

812 
by (rule insertI1) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

813 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

814 
lemma singletonD [dest!,no_atp]: "b : {a} ==> b = a" 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

815 
by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

816 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

817 
lemmas singletonE = singletonD [elim_format] 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

818 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

819 
lemma singleton_iff: "(b : {a}) = (b = a)" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

820 
by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

821 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

822 
lemma singleton_inject [dest!]: "{a} = {b} ==> a = b" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

823 
by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

824 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

825 
lemma singleton_insert_inj_eq [iff,no_atp]: 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

826 
"({b} = insert a A) = (a = b & A \<subseteq> {b})" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

827 
by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

828 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

829 
lemma singleton_insert_inj_eq' [iff,no_atp]: 
30531
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

830 
"(insert a A = {b}) = (a = b & A \<subseteq> {b})" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

831 
by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

832 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

833 
lemma subset_singletonD: "A \<subseteq> {x} ==> A = {}  A = {x}" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

834 
by fast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

835 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

836 
lemma singleton_conv [simp]: "{x. x = a} = {a}" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

837 
by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

838 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

839 
lemma singleton_conv2 [simp]: "{x. a = x} = {a}" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

840 
by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

841 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

842 
lemma diff_single_insert: "A  {x} \<subseteq> B ==> x \<in> A ==> A \<subseteq> insert x B" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

843 
by blast 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

844 

ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

845 
lemma doubleton_eq_iff: "({a,b} = {c,d}) = (a=c & b=d  a=d & b=c)" 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

846 
by (blast elim: equalityE) 
ab3d61baf66a
reverted to old version of Set.thy  strange effects have to be traced first
haftmann
parents:
30352
diff
changeset

847 

11979  848 

32077
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

849 
subsubsection {* Image of a set under a function *} 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

850 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

851 
text {* 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

852 
Frequently @{term b} does not have the syntactic form of @{term "f x"}. 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

853 
*} 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

854 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

855 
definition image :: "('a => 'b) => 'a set => 'b set" (infixr "`" 90) where 
35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

856 
image_def [no_atp]: "f ` A = {y. EX x:A. y = f(x)}" 
32077
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

857 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

858 
abbreviation 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

859 
range :: "('a => 'b) => 'b set" where  "of function" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

860 
"range f == f ` UNIV" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

861 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

862 
lemma image_eqI [simp, intro]: "b = f x ==> x:A ==> b : f`A" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

863 
by (unfold image_def) blast 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

864 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

865 
lemma imageI: "x : A ==> f x : f ` A" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

866 
by (rule image_eqI) (rule refl) 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

867 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

868 
lemma rev_image_eqI: "x:A ==> b = f x ==> b : f`A" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

869 
 {* This version's more effective when we already have the 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

870 
required @{term x}. *} 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

871 
by (unfold image_def) blast 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

872 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

873 
lemma imageE [elim!]: 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

874 
"b : (%x. f x)`A ==> (!!x. b = f x ==> x:A ==> P) ==> P" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

875 
 {* The etaexpansion gives variablename preservation. *} 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

876 
by (unfold image_def) blast 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

877 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

878 
lemma image_Un: "f`(A Un B) = f`A Un f`B" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

879 
by blast 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

880 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

881 
lemma image_iff: "(z : f`A) = (EX x:A. z = f x)" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

882 
by blast 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

883 

38648
52ea97d95e4b
"no_atp" a few facts that often lead to unsound proofs
blanchet
parents:
37767
diff
changeset

884 
lemma image_subset_iff [no_atp]: "(f`A \<subseteq> B) = (\<forall>x\<in>A. f x \<in> B)" 
32077
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

885 
 {* This rewrite rule would confuse users if made default. *} 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

886 
by blast 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

887 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

888 
lemma subset_image_iff: "(B \<subseteq> f`A) = (EX AA. AA \<subseteq> A & B = f`AA)" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

889 
apply safe 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

890 
prefer 2 apply fast 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

891 
apply (rule_tac x = "{a. a : A & f a : B}" in exI, fast) 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

892 
done 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

893 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

894 
lemma image_subsetI: "(!!x. x \<in> A ==> f x \<in> B) ==> f`A \<subseteq> B" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

895 
 {* Replaces the three steps @{text subsetI}, @{text imageE}, 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

896 
@{text hypsubst}, but breaks too many existing proofs. *} 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

897 
by blast 
11979  898 

899 
text {* 

32077
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

900 
\medskip Range of a function  just a translation for image! 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

901 
*} 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

902 

43898  903 
lemma image_ident [simp]: "(%x. x) ` Y = Y" 
904 
by blast 

905 

32077
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

906 
lemma range_eqI: "b = f x ==> b \<in> range f" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

907 
by simp 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

908 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

909 
lemma rangeI: "f x \<in> range f" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

910 
by simp 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

911 

3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

912 
lemma rangeE [elim?]: "b \<in> range (\<lambda>x. f x) ==> (!!x. b = f x ==> P) ==> P" 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

913 
by blast 
3698947146b2
closer relation of sets and complete lattices; corresponding consts, defs and syntax at similar places in theory text
haftmann
parents:
32064
diff
changeset

914 

32117
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

915 
subsubsection {* Some rules with @{text "if"} *} 
32081  916 

917 
text{* Elimination of @{text"{x. \<dots> & x=t & \<dots>}"}. *} 

918 

919 
lemma Collect_conv_if: "{x. x=a & P x} = (if P a then {a} else {})" 

32117
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

920 
by auto 
32081  921 

922 
lemma Collect_conv_if2: "{x. a=x & P x} = (if P a then {a} else {})" 

32117
0762b9ad83df
Set.thy: prefer = over == where possible; tuned ML setup; dropped (moved) ML legacy
haftmann
parents:
32115
diff
changeset

923 
by auto 
32081  924 

925 
text {* 

926 
Rewrite rules for boolean casesplitting: faster than @{text 

927 
"split_if [split]"}. 

928 
*} 

929 

930 
lemma split_if_eq1: "((if Q then x else y) = b) = ((Q > x = b) & (~ Q > y = b))" 

931 
by (rule split_if) 

932 

933 
lemma split_if_eq2: "(a = (if Q then x else y)) = ((Q > a = x) & (~ Q > a = y))" 

934 
by (rule split_if) 

935 

936 
text {* 

937 
Split ifs on either side of the membership relation. Not for @{text 

938 
"[simp]"}  can cause goals to blow up! 

939 
*} 

940 

941 
lemma split_if_mem1: "((if Q then x else y) : b) = ((Q > x : b) & (~ Q > y : b))" 

942 
by (rule split_if) 

943 

944 
lemma split_if_mem2: "(a : (if Q then x else y)) = ((Q > a : x) & (~ Q > a : y))" 

945 
by (rule split_if [where P="%S. a : S"]) 

946 

947 
lemmas split_ifs = if_bool_eq_conj split_if_eq1 split_if_eq2 split_if_mem1 split_if_mem2 

948 

949 
(*Would like to add these, but the existing code only searches for the 

37677  950 
outerlevel constant, which in this case is just Set.member; we instead need 
32081  951 
to use termnets to associate patterns with rules. Also, if a rule fails to 
952 
apply, then the formula should be kept. 

34974
18b41bba42b5
new theory Algebras.thy for generic algebraic structures
haftmann
parents:
34209
diff
changeset

953 
[("uminus", Compl_iff RS iffD1), ("minus", [Diff_iff RS iffD1]), 
32081  954 
("Int", [IntD1,IntD2]), 
955 
("Collect", [CollectD]), ("Inter", [InterD]), ("INTER", [INT_D])] 

956 
*) 

957 

958 

32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

959 
subsection {* Further operations and lemmas *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

960 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

961 
subsubsection {* The ``proper subset'' relation *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

962 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

963 
lemma psubsetI [intro!,no_atp]: "A \<subseteq> B ==> A \<noteq> B ==> A \<subset> B" 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

964 
by (unfold less_le) blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

965 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

966 
lemma psubsetE [elim!,no_atp]: 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

967 
"[A \<subset> B; [A \<subseteq> B; ~ (B\<subseteq>A)] ==> R] ==> R" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

968 
by (unfold less_le) blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

969 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

970 
lemma psubset_insert_iff: 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

971 
"(A \<subset> insert x B) = (if x \<in> B then A \<subset> B else if x \<in> A then A  {x} \<subset> B else A \<subseteq> B)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

972 
by (auto simp add: less_le subset_insert_iff) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

973 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

974 
lemma psubset_eq: "(A \<subset> B) = (A \<subseteq> B & A \<noteq> B)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

975 
by (simp only: less_le) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

976 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

977 
lemma psubset_imp_subset: "A \<subset> B ==> A \<subseteq> B" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

978 
by (simp add: psubset_eq) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

979 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

980 
lemma psubset_trans: "[ A \<subset> B; B \<subset> C ] ==> A \<subset> C" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

981 
apply (unfold less_le) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

982 
apply (auto dest: subset_antisym) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

983 
done 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

984 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

985 
lemma psubsetD: "[ A \<subset> B; c \<in> A ] ==> c \<in> B" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

986 
apply (unfold less_le) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

987 
apply (auto dest: subsetD) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

988 
done 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

989 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

990 
lemma psubset_subset_trans: "A \<subset> B ==> B \<subseteq> C ==> A \<subset> C" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

991 
by (auto simp add: psubset_eq) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

992 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

993 
lemma subset_psubset_trans: "A \<subseteq> B ==> B \<subset> C ==> A \<subset> C" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

994 
by (auto simp add: psubset_eq) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

995 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

996 
lemma psubset_imp_ex_mem: "A \<subset> B ==> \<exists>b. b \<in> (B  A)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

997 
by (unfold less_le) blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

998 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

999 
lemma atomize_ball: 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1000 
"(!!x. x \<in> A ==> P x) == Trueprop (\<forall>x\<in>A. P x)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1001 
by (simp only: Ball_def atomize_all atomize_imp) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1002 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1003 
lemmas [symmetric, rulify] = atomize_ball 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1004 
and [symmetric, defn] = atomize_ball 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1005 

40703
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1006 
lemma image_Pow_mono: 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1007 
assumes "f ` A \<le> B" 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1008 
shows "(image f) ` (Pow A) \<le> Pow B" 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1009 
using assms by blast 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1010 

d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1011 
lemma image_Pow_surj: 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1012 
assumes "f ` A = B" 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1013 
shows "(image f) ` (Pow A) = Pow B" 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1014 
using assms unfolding Pow_def proof(auto) 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1015 
fix Y assume *: "Y \<le> f ` A" 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1016 
obtain X where X_def: "X = {x \<in> A. f x \<in> Y}" by blast 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1017 
have "f ` X = Y \<and> X \<le> A" unfolding X_def using * by auto 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1018 
thus "Y \<in> (image f) ` {X. X \<le> A}" by blast 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1019 
qed 
d1fc454d6735
Move some missing lemmas from Andrei Popescus 'Ordinals and Cardinals' AFP entry to the HOLimage.
hoelzl
parents:
39910
diff
changeset

1020 

32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1021 
subsubsection {* Derived rules involving subsets. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1022 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1023 
text {* @{text insert}. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1024 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1025 
lemma subset_insertI: "B \<subseteq> insert a B" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1026 
by (rule subsetI) (erule insertI2) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1027 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1028 
lemma subset_insertI2: "A \<subseteq> B \<Longrightarrow> A \<subseteq> insert b B" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1029 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1030 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1031 
lemma subset_insert: "x \<notin> A ==> (A \<subseteq> insert x B) = (A \<subseteq> B)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1032 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1033 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1034 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1035 
text {* \medskip Finite Union  the least upper bound of two sets. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1036 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1037 
lemma Un_upper1: "A \<subseteq> A \<union> B" 
36009  1038 
by (fact sup_ge1) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1039 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1040 
lemma Un_upper2: "B \<subseteq> A \<union> B" 
36009  1041 
by (fact sup_ge2) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1042 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1043 
lemma Un_least: "A \<subseteq> C ==> B \<subseteq> C ==> A \<union> B \<subseteq> C" 
36009  1044 
by (fact sup_least) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1045 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1046 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1047 
text {* \medskip Finite Intersection  the greatest lower bound of two sets. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1048 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1049 
lemma Int_lower1: "A \<inter> B \<subseteq> A" 
36009  1050 
by (fact inf_le1) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1051 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1052 
lemma Int_lower2: "A \<inter> B \<subseteq> B" 
36009  1053 
by (fact inf_le2) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1054 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1055 
lemma Int_greatest: "C \<subseteq> A ==> C \<subseteq> B ==> C \<subseteq> A \<inter> B" 
36009  1056 
by (fact inf_greatest) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1057 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1058 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1059 
text {* \medskip Set difference. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1060 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1061 
lemma Diff_subset: "A  B \<subseteq> A" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1062 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1063 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1064 
lemma Diff_subset_conv: "(A  B \<subseteq> C) = (A \<subseteq> B \<union> C)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1065 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1066 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1067 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1068 
subsubsection {* Equalities involving union, intersection, inclusion, etc. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1069 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1070 
text {* @{text "{}"}. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1071 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1072 
lemma Collect_const [simp]: "{s. P} = (if P then UNIV else {})" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1073 
 {* supersedes @{text "Collect_False_empty"} *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1074 
by auto 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1075 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1076 
lemma subset_empty [simp]: "(A \<subseteq> {}) = (A = {})" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1077 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1078 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1079 
lemma not_psubset_empty [iff]: "\<not> (A < {})" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1080 
by (unfold less_le) blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1081 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1082 
lemma Collect_empty_eq [simp]: "(Collect P = {}) = (\<forall>x. \<not> P x)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1083 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1084 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1085 
lemma empty_Collect_eq [simp]: "({} = Collect P) = (\<forall>x. \<not> P x)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1086 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1087 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1088 
lemma Collect_neg_eq: "{x. \<not> P x} =  {x. P x}" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1089 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1090 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1091 
lemma Collect_disj_eq: "{x. P x  Q x} = {x. P x} \<union> {x. Q x}" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1092 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1093 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1094 
lemma Collect_imp_eq: "{x. P x > Q x} = {x. P x} \<union> {x. Q x}" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1095 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1096 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1097 
lemma Collect_conj_eq: "{x. P x & Q x} = {x. P x} \<inter> {x. Q x}" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1098 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1099 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1100 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1101 
text {* \medskip @{text insert}. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1102 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1103 
lemma insert_is_Un: "insert a A = {a} Un A" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1104 
 {* NOT SUITABLE FOR REWRITING since @{text "{a} == insert a {}"} *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1105 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1106 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1107 
lemma insert_not_empty [simp]: "insert a A \<noteq> {}" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1108 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1109 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1110 
lemmas empty_not_insert = insert_not_empty [symmetric, standard] 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1111 
declare empty_not_insert [simp] 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1112 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1113 
lemma insert_absorb: "a \<in> A ==> insert a A = A" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1114 
 {* @{text "[simp]"} causes recursive calls when there are nested inserts *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1115 
 {* with \emph{quadratic} running time *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1116 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1117 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1118 
lemma insert_absorb2 [simp]: "insert x (insert x A) = insert x A" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1119 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1120 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1121 
lemma insert_commute: "insert x (insert y A) = insert y (insert x A)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1122 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1123 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1124 
lemma insert_subset [simp]: "(insert x A \<subseteq> B) = (x \<in> B & A \<subseteq> B)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1125 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1126 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1127 
lemma mk_disjoint_insert: "a \<in> A ==> \<exists>B. A = insert a B & a \<notin> B" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1128 
 {* use new @{text B} rather than @{text "A  {a}"} to avoid infinite unfolding *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1129 
apply (rule_tac x = "A  {a}" in exI, blast) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1130 
done 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1131 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1132 
lemma insert_Collect: "insert a (Collect P) = {u. u \<noteq> a > P u}" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1133 
by auto 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1134 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1135 
lemma insert_inter_insert[simp]: "insert a A \<inter> insert a B = insert a (A \<inter> B)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1136 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1137 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

1138 
lemma insert_disjoint [simp,no_atp]: 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1139 
"(insert a A \<inter> B = {}) = (a \<notin> B \<and> A \<inter> B = {})" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1140 
"({} = insert a A \<inter> B) = (a \<notin> B \<and> {} = A \<inter> B)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1141 
by auto 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1142 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

1143 
lemma disjoint_insert [simp,no_atp]: 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1144 
"(B \<inter> insert a A = {}) = (a \<notin> B \<and> B \<inter> A = {})" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1145 
"({} = A \<inter> insert b B) = (b \<notin> A \<and> {} = A \<inter> B)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1146 
by auto 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1147 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1148 
text {* \medskip @{text image}. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1149 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1150 
lemma image_empty [simp]: "f`{} = {}" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1151 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1152 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1153 
lemma image_insert [simp]: "f ` insert a B = insert (f a) (f`B)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1154 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1155 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1156 
lemma image_constant: "x \<in> A ==> (\<lambda>x. c) ` A = {c}" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1157 
by auto 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1158 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1159 
lemma image_constant_conv: "(%x. c) ` A = (if A = {} then {} else {c})" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1160 
by auto 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1161 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1162 
lemma image_image: "f ` (g ` A) = (\<lambda>x. f (g x)) ` A" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1163 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1164 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1165 
lemma insert_image [simp]: "x \<in> A ==> insert (f x) (f`A) = f`A" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1166 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1167 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1168 
lemma image_is_empty [iff]: "(f`A = {}) = (A = {})" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1169 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1170 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1171 
lemma empty_is_image[iff]: "({} = f ` A) = (A = {})" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1172 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1173 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1174 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

1175 
lemma image_Collect [no_atp]: "f ` {x. P x} = {f x  x. P x}" 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1176 
 {* NOT suitable as a default simprule: the RHS isn't simpler than the LHS, 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1177 
with its implicit quantifier and conjunction. Also image enjoys better 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1178 
equational properties than does the RHS. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1179 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1180 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1181 
lemma if_image_distrib [simp]: 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1182 
"(\<lambda>x. if P x then f x else g x) ` S 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1183 
= (f ` (S \<inter> {x. P x})) \<union> (g ` (S \<inter> {x. \<not> P x}))" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1184 
by (auto simp add: image_def) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1185 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1186 
lemma image_cong: "M = N ==> (!!x. x \<in> N ==> f x = g x) ==> f`M = g`N" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1187 
by (simp add: image_def) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1188 

43898  1189 
lemma image_Int_subset: "f`(A Int B) <= f`A Int f`B" 
1190 
by blast 

1191 

1192 
lemma image_diff_subset: "f`A  f`B <= f`(A  B)" 

1193 
by blast 

1194 

32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1195 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1196 
text {* \medskip @{text range}. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1197 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

1198 
lemma full_SetCompr_eq [no_atp]: "{u. \<exists>x. u = f x} = range f" 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1199 
by auto 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1200 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1201 
lemma range_composition: "range (\<lambda>x. f (g x)) = f`range g" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1202 
by (subst image_image, simp) 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1203 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1204 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1205 
text {* \medskip @{text Int} *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1206 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1207 
lemma Int_absorb [simp]: "A \<inter> A = A" 
36009  1208 
by (fact inf_idem) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1209 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1210 
lemma Int_left_absorb: "A \<inter> (A \<inter> B) = A \<inter> B" 
36009  1211 
by (fact inf_left_idem) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1212 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1213 
lemma Int_commute: "A \<inter> B = B \<inter> A" 
36009  1214 
by (fact inf_commute) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1215 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1216 
lemma Int_left_commute: "A \<inter> (B \<inter> C) = B \<inter> (A \<inter> C)" 
36009  1217 
by (fact inf_left_commute) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1218 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1219 
lemma Int_assoc: "(A \<inter> B) \<inter> C = A \<inter> (B \<inter> C)" 
36009  1220 
by (fact inf_assoc) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1221 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1222 
lemmas Int_ac = Int_assoc Int_left_absorb Int_commute Int_left_commute 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1223 
 {* Intersection is an ACoperator *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1224 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1225 
lemma Int_absorb1: "B \<subseteq> A ==> A \<inter> B = B" 
36009  1226 
by (fact inf_absorb2) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1227 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1228 
lemma Int_absorb2: "A \<subseteq> B ==> A \<inter> B = A" 
36009  1229 
by (fact inf_absorb1) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1230 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1231 
lemma Int_empty_left [simp]: "{} \<inter> B = {}" 
36009  1232 
by (fact inf_bot_left) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1233 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1234 
lemma Int_empty_right [simp]: "A \<inter> {} = {}" 
36009  1235 
by (fact inf_bot_right) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1236 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1237 
lemma disjoint_eq_subset_Compl: "(A \<inter> B = {}) = (A \<subseteq> B)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1238 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1239 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1240 
lemma disjoint_iff_not_equal: "(A \<inter> B = {}) = (\<forall>x\<in>A. \<forall>y\<in>B. x \<noteq> y)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1241 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1242 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1243 
lemma Int_UNIV_left [simp]: "UNIV \<inter> B = B" 
36009  1244 
by (fact inf_top_left) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1245 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1246 
lemma Int_UNIV_right [simp]: "A \<inter> UNIV = A" 
36009  1247 
by (fact inf_top_right) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1248 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1249 
lemma Int_Un_distrib: "A \<inter> (B \<union> C) = (A \<inter> B) \<union> (A \<inter> C)" 
36009  1250 
by (fact inf_sup_distrib1) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1251 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1252 
lemma Int_Un_distrib2: "(B \<union> C) \<inter> A = (B \<inter> A) \<union> (C \<inter> A)" 
36009  1253 
by (fact inf_sup_distrib2) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1254 

35828
46cfc4b8112e
now use "Named_Thms" for "noatp", and renamed "noatp" to "no_atp"
blanchet
parents:
35576
diff
changeset

1255 
lemma Int_UNIV [simp,no_atp]: "(A \<inter> B = UNIV) = (A = UNIV & B = UNIV)" 
36009  1256 
by (fact inf_eq_top_iff) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1257 

38648
52ea97d95e4b
"no_atp" a few facts that often lead to unsound proofs
blanchet
parents:
37767
diff
changeset

1258 
lemma Int_subset_iff [no_atp, simp]: "(C \<subseteq> A \<inter> B) = (C \<subseteq> A & C \<subseteq> B)" 
36009  1259 
by (fact le_inf_iff) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1260 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1261 
lemma Int_Collect: "(x \<in> A \<inter> {x. P x}) = (x \<in> A & P x)" 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1262 
by blast 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1263 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1264 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1265 
text {* \medskip @{text Un}. *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1266 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1267 
lemma Un_absorb [simp]: "A \<union> A = A" 
36009  1268 
by (fact sup_idem) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1269 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1270 
lemma Un_left_absorb: "A \<union> (A \<union> B) = A \<union> B" 
36009  1271 
by (fact sup_left_idem) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1272 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1273 
lemma Un_commute: "A \<union> B = B \<union> A" 
36009  1274 
by (fact sup_commute) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1275 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1276 
lemma Un_left_commute: "A \<union> (B \<union> C) = B \<union> (A \<union> C)" 
36009  1277 
by (fact sup_left_commute) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1278 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1279 
lemma Un_assoc: "(A \<union> B) \<union> C = A \<union> (B \<union> C)" 
36009  1280 
by (fact sup_assoc) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1281 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1282 
lemmas Un_ac = Un_assoc Un_left_absorb Un_commute Un_left_commute 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1283 
 {* Union is an ACoperator *} 
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1284 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1285 
lemma Un_absorb1: "A \<subseteq> B ==> A \<union> B = B" 
36009  1286 
by (fact sup_absorb2) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1287 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1288 
lemma Un_absorb2: "B \<subseteq> A ==> A \<union> B = A" 
36009  1289 
by (fact sup_absorb1) 
32135
f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1290 

f645b51e8e54
set intersection and union now named inter and union; closer connection between set and lattice operations; factored out complete lattice
haftmann
parents:
32120
diff
changeset

1291 
lemma Un_empty_left [simp]: "{} \<union> B = B" 
36009 