tuned notation
authorhaftmann
Thu Jul 14 00:16:41 2011 +0200 (2011-07-14)
changeset 43817d53350bc65a4
parent 43816 05ab37be94ed
child 43818 fcc5d3ffb6f5
tuned notation
src/HOL/Complete_Lattice.thy
     1.1 --- a/src/HOL/Complete_Lattice.thy	Wed Jul 13 23:49:56 2011 +0200
     1.2 +++ b/src/HOL/Complete_Lattice.thy	Thu Jul 14 00:16:41 2011 +0200
     1.3 @@ -6,6 +6,14 @@
     1.4  imports Set
     1.5  begin
     1.6  
     1.7 +lemma ball_conj_distrib:
     1.8 +  "(\<forall>x\<in>A. P x \<and> Q x) \<longleftrightarrow> ((\<forall>x\<in>A. P x) \<and> (\<forall>x\<in>A. Q x))"
     1.9 +  by blast
    1.10 +
    1.11 +lemma bex_disj_distrib:
    1.12 +  "(\<exists>x\<in>A. P x \<or> Q x) \<longleftrightarrow> ((\<exists>x\<in>A. P x) \<or> (\<exists>x\<in>A. Q x))"
    1.13 +  by blast
    1.14 +
    1.15  notation
    1.16    less_eq (infix "\<sqsubseteq>" 50) and
    1.17    less (infix "\<sqsubset>" 50) and
    1.18 @@ -469,21 +477,21 @@
    1.19    "\<Inter>(B`A) = (\<Inter>x\<in>A. B x)"
    1.20    by (rule sym) (fact INFI_def)
    1.21  
    1.22 -lemma INT_iff [simp]: "(b: (INT x:A. B x)) = (ALL x:A. b: B x)"
    1.23 +lemma INT_iff [simp]: "b \<in> (\<Inter>x\<in>A. B x) \<longleftrightarrow> (\<forall>x\<in>A. b \<in> B x)"
    1.24    by (unfold INTER_def) blast
    1.25  
    1.26 -lemma INT_I [intro!]: "(!!x. x:A ==> b: B x) ==> b : (INT x:A. B x)"
    1.27 +lemma INT_I [intro!]: "(\<And>x. x \<in> A \<Longrightarrow> b \<in> B x) \<Longrightarrow> b \<in> (\<Inter>x\<in>A. B x)"
    1.28    by (unfold INTER_def) blast
    1.29  
    1.30 -lemma INT_D [elim, Pure.elim]: "b : (INT x:A. B x) ==> a:A ==> b: B a"
    1.31 +lemma INT_D [elim, Pure.elim]: "b : (\<Inter>x\<in>A. B x) \<Longrightarrow> a:A \<Longrightarrow> b: B a"
    1.32    by auto
    1.33  
    1.34 -lemma INT_E [elim]: "b : (INT x:A. B x) ==> (b: B a ==> R) ==> (a~:A ==> R) ==> R"
    1.35 +lemma INT_E [elim]: "b : (\<Inter>x\<in>A. B x) \<Longrightarrow> (b: B a \<Longrightarrow> R) \<Longrightarrow> (a~:A \<Longrightarrow> R) \<Longrightarrow> R"
    1.36    -- {* "Classical" elimination -- by the Excluded Middle on @{prop "a:A"}. *}
    1.37    by (unfold INTER_def) blast
    1.38  
    1.39  lemma INT_cong [cong]:
    1.40 -    "A = B ==> (!!x. x:B ==> C x = D x) ==> (INT x:A. C x) = (INT x:B. D x)"
    1.41 +    "A = B \<Longrightarrow> (\<And>x. x:B \<Longrightarrow> C x = D x) \<Longrightarrow> (\<Inter>x\<in>A. C x) = (\<Inter>x\<in>B. D x)"
    1.42    by (simp add: INTER_def)
    1.43  
    1.44  lemma Collect_ball_eq: "{x. \<forall>y\<in>A. P x y} = (\<Inter>y\<in>A. {x. P x y})"
    1.45 @@ -492,16 +500,16 @@
    1.46  lemma Collect_all_eq: "{x. \<forall>y. P x y} = (\<Inter>y. {x. P x y})"
    1.47    by blast
    1.48  
    1.49 -lemma INT_lower: "a \<in> A ==> (\<Inter>x\<in>A. B x) \<subseteq> B a"
    1.50 +lemma INT_lower: "a \<in> A \<Longrightarrow> (\<Inter>x\<in>A. B x) \<subseteq> B a"
    1.51    by (fact INF_leI)
    1.52  
    1.53 -lemma INT_greatest: "(!!x. x \<in> A ==> C \<subseteq> B x) ==> C \<subseteq> (\<Inter>x\<in>A. B x)"
    1.54 +lemma INT_greatest: "(\<And>x. x \<in> A \<Longrightarrow> C \<subseteq> B x) \<Longrightarrow> C \<subseteq> (\<Inter>x\<in>A. B x)"
    1.55    by (fact le_INFI)
    1.56  
    1.57  lemma INT_empty [simp]: "(\<Inter>x\<in>{}. B x) = UNIV"
    1.58    by blast
    1.59  
    1.60 -lemma INT_absorb: "k \<in> I ==> A k \<inter> (\<Inter>i\<in>I. A i) = (\<Inter>i\<in>I. A i)"
    1.61 +lemma INT_absorb: "k \<in> I \<Longrightarrow> A k \<inter> (\<Inter>i\<in>I. A i) = (\<Inter>i\<in>I. A i)"
    1.62    by blast
    1.63  
    1.64  lemma INT_subset_iff: "(B \<subseteq> (\<Inter>i\<in>I. A i)) = (\<forall>i\<in>I. B \<subseteq> A i)"
    1.65 @@ -514,7 +522,7 @@
    1.66    by blast
    1.67  
    1.68  lemma INT_insert_distrib:
    1.69 -    "u \<in> A ==> (\<Inter>x\<in>A. insert a (B x)) = insert a (\<Inter>x\<in>A. B x)"
    1.70 +    "u \<in> A \<Longrightarrow> (\<Inter>x\<in>A. insert a (B x)) = insert a (\<Inter>x\<in>A. B x)"
    1.71    by blast
    1.72  
    1.73  lemma INT_constant [simp]: "(\<Inter>y\<in>A. c) = (if A = {} then UNIV else c)"
    1.74 @@ -525,23 +533,23 @@
    1.75    by blast
    1.76  
    1.77  lemma INTER_UNIV_conv[simp]:
    1.78 - "(UNIV = (INT x:A. B x)) = (\<forall>x\<in>A. B x = UNIV)"
    1.79 - "((INT x:A. B x) = UNIV) = (\<forall>x\<in>A. B x = UNIV)"
    1.80 + "(UNIV = (\<Inter>x\<in>A. B x)) = (\<forall>x\<in>A. B x = UNIV)"
    1.81 + "((\<Inter>x\<in>A. B x) = UNIV) = (\<forall>x\<in>A. B x = UNIV)"
    1.82  by blast+
    1.83  
    1.84 -lemma INT_bool_eq: "(\<Inter>b::bool. A b) = (A True \<inter> A False)"
    1.85 +lemma INT_bool_eq: "(\<Inter>b. A b) = (A True \<inter> A False)"
    1.86    by (auto intro: bool_induct)
    1.87  
    1.88  lemma Pow_INT_eq: "Pow (\<Inter>x\<in>A. B x) = (\<Inter>x\<in>A. Pow (B x))"
    1.89    by blast
    1.90  
    1.91  lemma INT_anti_mono:
    1.92 -  "B \<subseteq> A ==> (!!x. x \<in> A ==> f x \<subseteq> g x) ==>
    1.93 +  "B \<subseteq> A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> f x \<subseteq> g x) \<Longrightarrow>
    1.94      (\<Inter>x\<in>A. f x) \<subseteq> (\<Inter>x\<in>A. g x)"
    1.95    -- {* The last inclusion is POSITIVE! *}
    1.96    by (blast dest: subsetD)
    1.97  
    1.98 -lemma vimage_INT: "f-`(INT x:A. B x) = (INT x:A. f -` B x)"
    1.99 +lemma vimage_INT: "f -` (\<Inter>x\<in>A. B x) = (\<Inter>x\<in>A. f -` B x)"
   1.100    by blast
   1.101  
   1.102  
   1.103 @@ -574,40 +582,40 @@
   1.104    by auto
   1.105  
   1.106  lemma UnionE [elim!]:
   1.107 -  "A \<in> \<Union>C \<Longrightarrow> (\<And>X. A\<in>X \<Longrightarrow> X\<in>C \<Longrightarrow> R) \<Longrightarrow> R"
   1.108 +  "A \<in> \<Union>C \<Longrightarrow> (\<And>X. A \<in> X \<Longrightarrow> X \<in> C \<Longrightarrow> R) \<Longrightarrow> R"
   1.109    by auto
   1.110  
   1.111 -lemma Union_upper: "B \<in> A ==> B \<subseteq> Union A"
   1.112 +lemma Union_upper: "B \<in> A \<Longrightarrow> B \<subseteq> \<Union>A"
   1.113    by (iprover intro: subsetI UnionI)
   1.114  
   1.115 -lemma Union_least: "(!!X. X \<in> A ==> X \<subseteq> C) ==> Union A \<subseteq> C"
   1.116 +lemma Union_least: "(\<And>X. X \<in> A \<Longrightarrow> X \<subseteq> C) \<Longrightarrow> \<Union>A \<subseteq> C"
   1.117    by (iprover intro: subsetI elim: UnionE dest: subsetD)
   1.118  
   1.119  lemma Un_eq_Union: "A \<union> B = \<Union>{A, B}"
   1.120    by blast
   1.121  
   1.122 -lemma Union_empty [simp]: "Union({}) = {}"
   1.123 +lemma Union_empty [simp]: "\<Union>{} = {}"
   1.124    by blast
   1.125  
   1.126 -lemma Union_UNIV [simp]: "Union UNIV = UNIV"
   1.127 +lemma Union_UNIV [simp]: "\<Union>UNIV = UNIV"
   1.128    by blast
   1.129  
   1.130 -lemma Union_insert [simp]: "Union (insert a B) = a \<union> \<Union>B"
   1.131 +lemma Union_insert [simp]: "\<Union>insert a B = a \<union> \<Union>B"
   1.132    by blast
   1.133  
   1.134 -lemma Union_Un_distrib [simp]: "\<Union>(A Un B) = \<Union>A \<union> \<Union>B"
   1.135 +lemma Union_Un_distrib [simp]: "\<Union>(A \<union> B) = \<Union>A \<union> \<Union>B"
   1.136    by blast
   1.137  
   1.138  lemma Union_Int_subset: "\<Union>(A \<inter> B) \<subseteq> \<Union>A \<inter> \<Union>B"
   1.139    by blast
   1.140  
   1.141 -lemma Union_empty_conv [simp,no_atp]: "(\<Union>A = {}) = (\<forall>x\<in>A. x = {})"
   1.142 +lemma Union_empty_conv [simp,no_atp]: "(\<Union>A = {}) \<longleftrightarrow> (\<forall>x\<in>A. x = {})"
   1.143    by blast
   1.144  
   1.145 -lemma empty_Union_conv [simp,no_atp]: "({} = \<Union>A) = (\<forall>x\<in>A. x = {})"
   1.146 +lemma empty_Union_conv [simp,no_atp]: "({} = \<Union>A) \<longleftrightarrow> (\<forall>x\<in>A. x = {})"
   1.147    by blast
   1.148  
   1.149 -lemma Union_disjoint: "(\<Union>C \<inter> A = {}) = (\<forall>B\<in>C. B \<inter> A = {})"
   1.150 +lemma Union_disjoint: "(\<Union>C \<inter> A = {}) \<longleftrightarrow> (\<forall>B\<in>C. B \<inter> A = {})"
   1.151    by blast
   1.152  
   1.153  lemma subset_Pow_Union: "A \<subseteq> Pow (\<Union>A)"
   1.154 @@ -616,7 +624,7 @@
   1.155  lemma Union_Pow_eq [simp]: "\<Union>(Pow A) = A"
   1.156    by blast
   1.157  
   1.158 -lemma Union_mono: "A \<subseteq> B ==> \<Union>A \<subseteq> \<Union>B"
   1.159 +lemma Union_mono: "A \<subseteq> B \<Longrightarrow> \<Union>A \<subseteq> \<Union>B"
   1.160    by blast
   1.161  
   1.162  
   1.163 @@ -657,7 +665,7 @@
   1.164  *} -- {* to avoid eta-contraction of body *}
   1.165  
   1.166  lemma UNION_eq_Union_image:
   1.167 -  "(\<Union>x\<in>A. B x) = \<Union>(B`A)"
   1.168 +  "(\<Union>x\<in>A. B x) = \<Union>(B ` A)"
   1.169    by (fact SUPR_def)
   1.170  
   1.171  lemma Union_def:
   1.172 @@ -669,41 +677,41 @@
   1.173    by (auto simp add: UNION_eq_Union_image Union_eq)
   1.174    
   1.175  lemma Union_image_eq [simp]:
   1.176 -  "\<Union>(B`A) = (\<Union>x\<in>A. B x)"
   1.177 +  "\<Union>(B ` A) = (\<Union>x\<in>A. B x)"
   1.178    by (rule sym) (fact UNION_eq_Union_image)
   1.179    
   1.180 -lemma UN_iff [simp]: "(b: (UN x:A. B x)) = (EX x:A. b: B x)"
   1.181 +lemma UN_iff [simp]: "(b: (\<Union>x\<in>A. B x)) = (\<exists>x\<in>A. b: B x)"
   1.182    by (unfold UNION_def) blast
   1.183  
   1.184 -lemma UN_I [intro]: "a:A ==> b: B a ==> b: (UN x:A. B x)"
   1.185 +lemma UN_I [intro]: "a:A \<Longrightarrow> b: B a \<Longrightarrow> b: (\<Union>x\<in>A. B x)"
   1.186    -- {* The order of the premises presupposes that @{term A} is rigid;
   1.187      @{term b} may be flexible. *}
   1.188    by auto
   1.189  
   1.190 -lemma UN_E [elim!]: "b : (UN x:A. B x) ==> (!!x. x:A ==> b: B x ==> R) ==> R"
   1.191 +lemma UN_E [elim!]: "b : (\<Union>x\<in>A. B x) \<Longrightarrow> (\<And>x. x:A \<Longrightarrow> b: B x \<Longrightarrow> R) \<Longrightarrow> R"
   1.192    by (unfold UNION_def) blast
   1.193  
   1.194  lemma UN_cong [cong]:
   1.195 -    "A = B ==> (!!x. x:B ==> C x = D x) ==> (UN x:A. C x) = (UN x:B. D x)"
   1.196 +    "A = B \<Longrightarrow> (\<And>x. x:B \<Longrightarrow> C x = D x) \<Longrightarrow> (\<Union>x\<in>A. C x) = (\<Union>x\<in>B. D x)"
   1.197    by (simp add: UNION_def)
   1.198  
   1.199  lemma strong_UN_cong:
   1.200 -    "A = B ==> (!!x. x:B =simp=> C x = D x) ==> (UN x:A. C x) = (UN x:B. D x)"
   1.201 +    "A = B \<Longrightarrow> (\<And>x. x:B =simp=> C x = D x) \<Longrightarrow> (\<Union>x\<in>A. C x) = (\<Union>x\<in>B. D x)"
   1.202    by (simp add: UNION_def simp_implies_def)
   1.203  
   1.204 -lemma image_eq_UN: "f`A = (UN x:A. {f x})"
   1.205 +lemma image_eq_UN: "f ` A = (\<Union>x\<in>A. {f x})"
   1.206    by blast
   1.207  
   1.208 -lemma UN_upper: "a \<in> A ==> B a \<subseteq> (\<Union>x\<in>A. B x)"
   1.209 +lemma UN_upper: "a \<in> A \<Longrightarrow> B a \<subseteq> (\<Union>x\<in>A. B x)"
   1.210    by (fact le_SUPI)
   1.211  
   1.212 -lemma UN_least: "(!!x. x \<in> A ==> B x \<subseteq> C) ==> (\<Union>x\<in>A. B x) \<subseteq> C"
   1.213 +lemma UN_least: "(\<And>x. x \<in> A \<Longrightarrow> B x \<subseteq> C) \<Longrightarrow> (\<Union>x\<in>A. B x) \<subseteq> C"
   1.214    by (iprover intro: subsetI elim: UN_E dest: subsetD)
   1.215  
   1.216  lemma Collect_bex_eq [no_atp]: "{x. \<exists>y\<in>A. P x y} = (\<Union>y\<in>A. {x. P x y})"
   1.217    by blast
   1.218  
   1.219 -lemma UN_insert_distrib: "u \<in> A ==> (\<Union>x\<in>A. insert a (B x)) = insert a (\<Union>x\<in>A. B x)"
   1.220 +lemma UN_insert_distrib: "u \<in> A \<Longrightarrow> (\<Union>x\<in>A. insert a (B x)) = insert a (\<Union>x\<in>A. B x)"
   1.221    by blast
   1.222  
   1.223  lemma UN_empty [simp,no_atp]: "(\<Union>x\<in>{}. B x) = {}"
   1.224 @@ -715,7 +723,7 @@
   1.225  lemma UN_singleton [simp]: "(\<Union>x\<in>A. {x}) = A"
   1.226    by blast
   1.227  
   1.228 -lemma UN_absorb: "k \<in> I ==> A k \<union> (\<Union>i\<in>I. A i) = (\<Union>i\<in>I. A i)"
   1.229 +lemma UN_absorb: "k \<in> I \<Longrightarrow> A k \<union> (\<Union>i\<in>I. A i) = (\<Union>i\<in>I. A i)"
   1.230    by auto
   1.231  
   1.232  lemma UN_insert [simp]: "(\<Union>x\<in>insert a A. B x) = B a \<union> UNION A B"
   1.233 @@ -740,8 +748,8 @@
   1.234    by blast
   1.235  
   1.236  lemma UNION_empty_conv[simp]:
   1.237 -  "({} = (UN x:A. B x)) = (\<forall>x\<in>A. B x = {})"
   1.238 -  "((UN x:A. B x) = {}) = (\<forall>x\<in>A. B x = {})"
   1.239 +  "{} = (\<Union>x\<in>A. B x) \<longleftrightarrow> (\<forall>x\<in>A. B x = {})"
   1.240 +  "(\<Union>x\<in>A. B x) = {} \<longleftrightarrow> (\<forall>x\<in>A. B x = {})"
   1.241  by blast+
   1.242  
   1.243  lemma Collect_ex_eq [no_atp]: "{x. \<exists>y. P x y} = (\<Union>y. {x. P x y})"
   1.244 @@ -756,29 +764,29 @@
   1.245  lemma Un_eq_UN: "A \<union> B = (\<Union>b. if b then A else B)"
   1.246    by (auto simp add: split_if_mem2)
   1.247  
   1.248 -lemma UN_bool_eq: "(\<Union>b::bool. A b) = (A True \<union> A False)"
   1.249 +lemma UN_bool_eq: "(\<Union>b. A b) = (A True \<union> A False)"
   1.250    by (auto intro: bool_contrapos)
   1.251  
   1.252  lemma UN_Pow_subset: "(\<Union>x\<in>A. Pow (B x)) \<subseteq> Pow (\<Union>x\<in>A. B x)"
   1.253    by blast
   1.254  
   1.255  lemma UN_mono:
   1.256 -  "A \<subseteq> B ==> (!!x. x \<in> A ==> f x \<subseteq> g x) ==>
   1.257 +  "A \<subseteq> B \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> f x \<subseteq> g x) \<Longrightarrow>
   1.258      (\<Union>x\<in>A. f x) \<subseteq> (\<Union>x\<in>B. g x)"
   1.259    by (blast dest: subsetD)
   1.260  
   1.261 -lemma vimage_Union: "f -` (Union A) = (UN X:A. f -` X)"
   1.262 +lemma vimage_Union: "f -` (\<Union>A) = (\<Union>X\<in>A. f -` X)"
   1.263    by blast
   1.264  
   1.265 -lemma vimage_UN: "f-`(UN x:A. B x) = (UN x:A. f -` B x)"
   1.266 +lemma vimage_UN: "f -` (\<Union>x\<in>A. B x) = (\<Union>x\<in>A. f -` B x)"
   1.267    by blast
   1.268  
   1.269 -lemma vimage_eq_UN: "f-`B = (UN y: B. f-`{y})"
   1.270 +lemma vimage_eq_UN: "f -` B = (\<Union>y\<in>B. f -` {y})"
   1.271    -- {* NOT suitable for rewriting *}
   1.272    by blast
   1.273  
   1.274 -lemma image_UN: "(f ` (UNION A B)) = (UN x:A.(f ` (B x)))"
   1.275 -by blast
   1.276 +lemma image_UN: "f ` UNION A B = (\<Union>x\<in>A. f ` B x)"
   1.277 +  by blast
   1.278  
   1.279  
   1.280  subsection {* Distributive laws *}
   1.281 @@ -789,7 +797,7 @@
   1.282  lemma Int_Union2: "\<Union>B \<inter> A = (\<Union>C\<in>B. C \<inter> A)"
   1.283    by blast
   1.284  
   1.285 -lemma Un_Union_image: "(\<Union>x\<in>C. A x \<union> B x) = \<Union>(A`C) \<union> \<Union>(B`C)"
   1.286 +lemma Un_Union_image: "(\<Union>x\<in>C. A x \<union> B x) = \<Union>(A ` C) \<union> \<Union>(B ` C)"
   1.287    -- {* Devlin, Fundamentals of Contemporary Set Theory, page 12, exercise 5: *}
   1.288    -- {* Union of a family of unions *}
   1.289    by blast
   1.290 @@ -801,7 +809,7 @@
   1.291  lemma Un_Inter: "A \<union> \<Inter>B = (\<Inter>C\<in>B. A \<union> C)"
   1.292    by blast
   1.293  
   1.294 -lemma Int_Inter_image: "(\<Inter>x\<in>C. A x \<inter> B x) = \<Inter>(A`C) \<inter> \<Inter>(B`C)"
   1.295 +lemma Int_Inter_image: "(\<Inter>x\<in>C. A x \<inter> B x) = \<Inter>(A ` C) \<inter> \<Inter>(B ` C)"
   1.296    by blast
   1.297  
   1.298  lemma INT_Int_distrib: "(\<Inter>i\<in>I. A i \<inter> B i) = (\<Inter>i\<in>I. A i) \<inter> (\<Inter>i\<in>I. B i)"
   1.299 @@ -824,10 +832,10 @@
   1.300  
   1.301  subsection {* Complement *}
   1.302  
   1.303 -lemma Compl_UN [simp]: "-(\<Union>x\<in>A. B x) = (\<Inter>x\<in>A. -B x)"
   1.304 +lemma Compl_UN [simp]: "- (\<Union>x\<in>A. B x) = (\<Inter>x\<in>A. -B x)"
   1.305    by blast
   1.306  
   1.307 -lemma Compl_INT [simp]: "-(\<Inter>x\<in>A. B x) = (\<Union>x\<in>A. -B x)"
   1.308 +lemma Compl_INT [simp]: "- (\<Inter>x\<in>A. B x) = (\<Union>x\<in>A. -B x)"
   1.309    by blast
   1.310  
   1.311  
   1.312 @@ -837,94 +845,85 @@
   1.313             and Intersections. *}
   1.314  
   1.315  lemma UN_simps [simp]:
   1.316 -  "!!a B C. (UN x:C. insert a (B x)) = (if C={} then {} else insert a (UN x:C. B x))"
   1.317 -  "!!A B C. (UN x:C. A x Un B)   = ((if C={} then {} else (UN x:C. A x) Un B))"
   1.318 -  "!!A B C. (UN x:C. A Un B x)   = ((if C={} then {} else A Un (UN x:C. B x)))"
   1.319 -  "!!A B C. (UN x:C. A x Int B)  = ((UN x:C. A x) Int B)"
   1.320 -  "!!A B C. (UN x:C. A Int B x)  = (A Int (UN x:C. B x))"
   1.321 -  "!!A B C. (UN x:C. A x - B)    = ((UN x:C. A x) - B)"
   1.322 -  "!!A B C. (UN x:C. A - B x)    = (A - (INT x:C. B x))"
   1.323 -  "!!A B. (UN x: Union A. B x) = (UN y:A. UN x:y. B x)"
   1.324 -  "!!A B C. (UN z: UNION A B. C z) = (UN  x:A. UN z: B(x). C z)"
   1.325 -  "!!A B f. (UN x:f`A. B x)     = (UN a:A. B (f a))"
   1.326 +  "\<And>a B C. (\<Union>x\<in>C. insert a (B x)) = (if C={} then {} else insert a (\<Union>x\<in>C. B x))"
   1.327 +  "\<And>A B C. (\<Union>x\<in>C. A x Un B)   = ((if C={} then {} else (\<Union>x\<in>C. A x) Un B))"
   1.328 +  "\<And>A B C. (\<Union>x\<in>C. A Un B x)   = ((if C={} then {} else A Un (\<Union>x\<in>C. B x)))"
   1.329 +  "\<And>A B C. (\<Union>x\<in>C. A x Int B)  = ((\<Union>x\<in>C. A x) Int B)"
   1.330 +  "\<And>A B C. (\<Union>x\<in>C. A Int B x)  = (A Int (\<Union>x\<in>C. B x))"
   1.331 +  "\<And>A B C. (\<Union>x\<in>C. A x - B)    = ((\<Union>x\<in>C. A x) - B)"
   1.332 +  "\<And>A B C. (\<Union>x\<in>C. A - B x)    = (A - (\<Inter>x\<in>C. B x))"
   1.333 +  "\<And>A B. (UN x: \<Union>A. B x) = (UN y:A. UN x:y. B x)"
   1.334 +  "\<And>A B C. (UN z: UNION A B. C z) = (UN  x:A. UN z: B(x). C z)"
   1.335 +  "\<And>A B f. (UN x:f`A. B x)     = (UN a:A. B (f a))"
   1.336    by auto
   1.337  
   1.338  lemma INT_simps [simp]:
   1.339 -  "!!A B C. (INT x:C. A x Int B) = (if C={} then UNIV else (INT x:C. A x) Int B)"
   1.340 -  "!!A B C. (INT x:C. A Int B x) = (if C={} then UNIV else A Int (INT x:C. B x))"
   1.341 -  "!!A B C. (INT x:C. A x - B)   = (if C={} then UNIV else (INT x:C. A x) - B)"
   1.342 -  "!!A B C. (INT x:C. A - B x)   = (if C={} then UNIV else A - (UN x:C. B x))"
   1.343 -  "!!a B C. (INT x:C. insert a (B x)) = insert a (INT x:C. B x)"
   1.344 -  "!!A B C. (INT x:C. A x Un B)  = ((INT x:C. A x) Un B)"
   1.345 -  "!!A B C. (INT x:C. A Un B x)  = (A Un (INT x:C. B x))"
   1.346 -  "!!A B. (INT x: Union A. B x) = (INT y:A. INT x:y. B x)"
   1.347 -  "!!A B C. (INT z: UNION A B. C z) = (INT x:A. INT z: B(x). C z)"
   1.348 -  "!!A B f. (INT x:f`A. B x)    = (INT a:A. B (f a))"
   1.349 +  "\<And>A B C. (\<Inter>x\<in>C. A x Int B) = (if C={} then UNIV else (\<Inter>x\<in>C. A x) Int B)"
   1.350 +  "\<And>A B C. (\<Inter>x\<in>C. A Int B x) = (if C={} then UNIV else A Int (\<Inter>x\<in>C. B x))"
   1.351 +  "\<And>A B C. (\<Inter>x\<in>C. A x - B)   = (if C={} then UNIV else (\<Inter>x\<in>C. A x) - B)"
   1.352 +  "\<And>A B C. (\<Inter>x\<in>C. A - B x)   = (if C={} then UNIV else A - (\<Union>x\<in>C. B x))"
   1.353 +  "\<And>a B C. (\<Inter>x\<in>C. insert a (B x)) = insert a (\<Inter>x\<in>C. B x)"
   1.354 +  "\<And>A B C. (\<Inter>x\<in>C. A x Un B)  = ((\<Inter>x\<in>C. A x) Un B)"
   1.355 +  "\<And>A B C. (\<Inter>x\<in>C. A Un B x)  = (A Un (\<Inter>x\<in>C. B x))"
   1.356 +  "\<And>A B. (INT x: \<Union>A. B x) = (\<Inter>y\<in>A. INT x:y. B x)"
   1.357 +  "\<And>A B C. (INT z: UNION A B. C z) = (\<Inter>x\<in>A. INT z: B(x). C z)"
   1.358 +  "\<And>A B f. (INT x:f`A. B x)    = (INT a:A. B (f a))"
   1.359    by auto
   1.360  
   1.361  lemma ball_simps [simp,no_atp]:
   1.362 -  "!!A P Q. (ALL x:A. P x | Q) = ((ALL x:A. P x) | Q)"
   1.363 -  "!!A P Q. (ALL x:A. P | Q x) = (P | (ALL x:A. Q x))"
   1.364 -  "!!A P Q. (ALL x:A. P --> Q x) = (P --> (ALL x:A. Q x))"
   1.365 -  "!!A P Q. (ALL x:A. P x --> Q) = ((EX x:A. P x) --> Q)"
   1.366 -  "!!P. (ALL x:{}. P x) = True"
   1.367 -  "!!P. (ALL x:UNIV. P x) = (ALL x. P x)"
   1.368 -  "!!a B P. (ALL x:insert a B. P x) = (P a & (ALL x:B. P x))"
   1.369 -  "!!A P. (ALL x:Union A. P x) = (ALL y:A. ALL x:y. P x)"
   1.370 -  "!!A B P. (ALL x: UNION A B. P x) = (ALL a:A. ALL x: B a. P x)"
   1.371 -  "!!P Q. (ALL x:Collect Q. P x) = (ALL x. Q x --> P x)"
   1.372 -  "!!A P f. (ALL x:f`A. P x) = (ALL x:A. P (f x))"
   1.373 -  "!!A P. (~(ALL x:A. P x)) = (EX x:A. ~P x)"
   1.374 +  "\<And>A P Q. (\<forall>x\<in>A. P x | Q) = ((\<forall>x\<in>A. P x) | Q)"
   1.375 +  "\<And>A P Q. (\<forall>x\<in>A. P | Q x) = (P | (\<forall>x\<in>A. Q x))"
   1.376 +  "\<And>A P Q. (\<forall>x\<in>A. P --> Q x) = (P --> (\<forall>x\<in>A. Q x))"
   1.377 +  "\<And>A P Q. (\<forall>x\<in>A. P x --> Q) = ((\<exists>x\<in>A. P x) --> Q)"
   1.378 +  "\<And>P. (ALL x:{}. P x) = True"
   1.379 +  "\<And>P. (ALL x:UNIV. P x) = (ALL x. P x)"
   1.380 +  "\<And>a B P. (ALL x:insert a B. P x) = (P a & (ALL x:B. P x))"
   1.381 +  "\<And>A P. (ALL x:\<Union>A. P x) = (ALL y:A. ALL x:y. P x)"
   1.382 +  "\<And>A B P. (ALL x: UNION A B. P x) = (ALL a:A. ALL x: B a. P x)"
   1.383 +  "\<And>P Q. (ALL x:Collect Q. P x) = (ALL x. Q x --> P x)"
   1.384 +  "\<And>A P f. (ALL x:f`A. P x) = (\<forall>x\<in>A. P (f x))"
   1.385 +  "\<And>A P. (~(\<forall>x\<in>A. P x)) = (\<exists>x\<in>A. ~P x)"
   1.386    by auto
   1.387  
   1.388  lemma bex_simps [simp,no_atp]:
   1.389 -  "!!A P Q. (EX x:A. P x & Q) = ((EX x:A. P x) & Q)"
   1.390 -  "!!A P Q. (EX x:A. P & Q x) = (P & (EX x:A. Q x))"
   1.391 -  "!!P. (EX x:{}. P x) = False"
   1.392 -  "!!P. (EX x:UNIV. P x) = (EX x. P x)"
   1.393 -  "!!a B P. (EX x:insert a B. P x) = (P(a) | (EX x:B. P x))"
   1.394 -  "!!A P. (EX x:Union A. P x) = (EX y:A. EX x:y. P x)"
   1.395 -  "!!A B P. (EX x: UNION A B. P x) = (EX a:A. EX x:B a. P x)"
   1.396 -  "!!P Q. (EX x:Collect Q. P x) = (EX x. Q x & P x)"
   1.397 -  "!!A P f. (EX x:f`A. P x) = (EX x:A. P (f x))"
   1.398 -  "!!A P. (~(EX x:A. P x)) = (ALL x:A. ~P x)"
   1.399 +  "\<And>A P Q. (\<exists>x\<in>A. P x & Q) = ((\<exists>x\<in>A. P x) & Q)"
   1.400 +  "\<And>A P Q. (\<exists>x\<in>A. P & Q x) = (P & (\<exists>x\<in>A. Q x))"
   1.401 +  "\<And>P. (EX x:{}. P x) = False"
   1.402 +  "\<And>P. (EX x:UNIV. P x) = (EX x. P x)"
   1.403 +  "\<And>a B P. (EX x:insert a B. P x) = (P(a) | (EX x:B. P x))"
   1.404 +  "\<And>A P. (EX x:\<Union>A. P x) = (EX y:A. EX x:y. P x)"
   1.405 +  "\<And>A B P. (EX x: UNION A B. P x) = (EX a:A. EX x:B a. P x)"
   1.406 +  "\<And>P Q. (EX x:Collect Q. P x) = (EX x. Q x & P x)"
   1.407 +  "\<And>A P f. (EX x:f`A. P x) = (\<exists>x\<in>A. P (f x))"
   1.408 +  "\<And>A P. (~(\<exists>x\<in>A. P x)) = (\<forall>x\<in>A. ~P x)"
   1.409    by auto
   1.410  
   1.411 -lemma ball_conj_distrib:
   1.412 -  "(ALL x:A. P x & Q x) = ((ALL x:A. P x) & (ALL x:A. Q x))"
   1.413 -  by blast
   1.414 -
   1.415 -lemma bex_disj_distrib:
   1.416 -  "(EX x:A. P x | Q x) = ((EX x:A. P x) | (EX x:A. Q x))"
   1.417 -  by blast
   1.418 -
   1.419 -
   1.420  text {* \medskip Maxiscoping: pulling out big Unions and Intersections. *}
   1.421  
   1.422  lemma UN_extend_simps:
   1.423 -  "!!a B C. insert a (UN x:C. B x) = (if C={} then {a} else (UN x:C. insert a (B x)))"
   1.424 -  "!!A B C. (UN x:C. A x) Un B    = (if C={} then B else (UN x:C. A x Un B))"
   1.425 -  "!!A B C. A Un (UN x:C. B x)   = (if C={} then A else (UN x:C. A Un B x))"
   1.426 -  "!!A B C. ((UN x:C. A x) Int B) = (UN x:C. A x Int B)"
   1.427 -  "!!A B C. (A Int (UN x:C. B x)) = (UN x:C. A Int B x)"
   1.428 -  "!!A B C. ((UN x:C. A x) - B) = (UN x:C. A x - B)"
   1.429 -  "!!A B C. (A - (INT x:C. B x)) = (UN x:C. A - B x)"
   1.430 -  "!!A B. (UN y:A. UN x:y. B x) = (UN x: Union A. B x)"
   1.431 -  "!!A B C. (UN  x:A. UN z: B(x). C z) = (UN z: UNION A B. C z)"
   1.432 -  "!!A B f. (UN a:A. B (f a)) = (UN x:f`A. B x)"
   1.433 +  "\<And>a B C. insert a (\<Union>x\<in>C. B x) = (if C={} then {a} else (\<Union>x\<in>C. insert a (B x)))"
   1.434 +  "\<And>A B C. (\<Union>x\<in>C. A x) Un B    = (if C={} then B else (\<Union>x\<in>C. A x Un B))"
   1.435 +  "\<And>A B C. A Un (\<Union>x\<in>C. B x)   = (if C={} then A else (\<Union>x\<in>C. A Un B x))"
   1.436 +  "\<And>A B C. ((\<Union>x\<in>C. A x) Int B) = (\<Union>x\<in>C. A x Int B)"
   1.437 +  "\<And>A B C. (A Int (\<Union>x\<in>C. B x)) = (\<Union>x\<in>C. A Int B x)"
   1.438 +  "\<And>A B C. ((\<Union>x\<in>C. A x) - B) = (\<Union>x\<in>C. A x - B)"
   1.439 +  "\<And>A B C. (A - (\<Inter>x\<in>C. B x)) = (\<Union>x\<in>C. A - B x)"
   1.440 +  "\<And>A B. (UN y:A. UN x:y. B x) = (UN x: \<Union>A. B x)"
   1.441 +  "\<And>A B C. (UN  x:A. UN z: B(x). C z) = (UN z: UNION A B. C z)"
   1.442 +  "\<And>A B f. (UN a:A. B (f a)) = (UN x:f`A. B x)"
   1.443    by auto
   1.444  
   1.445  lemma INT_extend_simps:
   1.446 -  "!!A B C. (INT x:C. A x) Int B = (if C={} then B else (INT x:C. A x Int B))"
   1.447 -  "!!A B C. A Int (INT x:C. B x) = (if C={} then A else (INT x:C. A Int B x))"
   1.448 -  "!!A B C. (INT x:C. A x) - B   = (if C={} then UNIV-B else (INT x:C. A x - B))"
   1.449 -  "!!A B C. A - (UN x:C. B x)   = (if C={} then A else (INT x:C. A - B x))"
   1.450 -  "!!a B C. insert a (INT x:C. B x) = (INT x:C. insert a (B x))"
   1.451 -  "!!A B C. ((INT x:C. A x) Un B)  = (INT x:C. A x Un B)"
   1.452 -  "!!A B C. A Un (INT x:C. B x)  = (INT x:C. A Un B x)"
   1.453 -  "!!A B. (INT y:A. INT x:y. B x) = (INT x: Union A. B x)"
   1.454 -  "!!A B C. (INT x:A. INT z: B(x). C z) = (INT z: UNION A B. C z)"
   1.455 -  "!!A B f. (INT a:A. B (f a))    = (INT x:f`A. B x)"
   1.456 +  "\<And>A B C. (\<Inter>x\<in>C. A x) Int B = (if C={} then B else (\<Inter>x\<in>C. A x Int B))"
   1.457 +  "\<And>A B C. A Int (\<Inter>x\<in>C. B x) = (if C={} then A else (\<Inter>x\<in>C. A Int B x))"
   1.458 +  "\<And>A B C. (\<Inter>x\<in>C. A x) - B   = (if C={} then UNIV-B else (\<Inter>x\<in>C. A x - B))"
   1.459 +  "\<And>A B C. A - (\<Union>x\<in>C. B x)   = (if C={} then A else (\<Inter>x\<in>C. A - B x))"
   1.460 +  "\<And>a B C. insert a (\<Inter>x\<in>C. B x) = (\<Inter>x\<in>C. insert a (B x))"
   1.461 +  "\<And>A B C. ((\<Inter>x\<in>C. A x) Un B)  = (\<Inter>x\<in>C. A x Un B)"
   1.462 +  "\<And>A B C. A Un (\<Inter>x\<in>C. B x)  = (\<Inter>x\<in>C. A Un B x)"
   1.463 +  "\<And>A B. (\<Inter>y\<in>A. INT x:y. B x) = (INT x: \<Union>A. B x)"
   1.464 +  "\<And>A B C. (\<Inter>x\<in>A. INT z: B(x). C z) = (INT z: UNION A B. C z)"
   1.465 +  "\<And>A B f. (INT a:A. B (f a))    = (INT x:f`A. B x)"
   1.466    by auto
   1.467  
   1.468