# HG changeset patch # User wenzelm # Date 1331158860 -3600 # Node ID be56a254d880ea708677f5990a258a7a676b390a # Parent a5fa1dc5594534d547d57494571c963fcb4a4692# Parent 050e344825c83a5b800057356479dedbc2465c5d merged diff -r 050e344825c8 -r be56a254d880 NEWS --- a/NEWS Wed Mar 07 23:21:24 2012 +0100 +++ b/NEWS Wed Mar 07 23:21:00 2012 +0100 @@ -83,11 +83,15 @@ used as predicates by "%x. x : S" and predicates P accidentally used as sets by "{x. P x}". Corresponding proofs in a first step should be pruned from any tinkering with former theorems mem_def and -Collect_def. For developments which deliberately mixed predicates and +Collect_def as far as possible. +For developments which deliberately mixed predicates and sets, a planning step is necessary to determine what should become a predicate and what a set. It can be helpful to carry out that step in Isabelle2011-1 before jumping right into the current release. +* Code generation by default implements sets as container type rather +than predicates. INCOMPATIBILITY. + * New type synonym 'a rel = ('a * 'a) set * More default pred/set conversions on a couple of relation operations diff -r 050e344825c8 -r be56a254d880 src/HOL/Relation.thy --- a/src/HOL/Relation.thy Wed Mar 07 23:21:24 2012 +0100 +++ b/src/HOL/Relation.thy Wed Mar 07 23:21:00 2012 +0100 @@ -60,16 +60,16 @@ subsubsection {* Conversions between set and predicate relations *} -lemma pred_equals_eq [pred_set_conv]: "((\x. x \ R) = (\x. x \ S)) \ (R = S)" +lemma pred_equals_eq [pred_set_conv]: "(\x. x \ R) = (\x. x \ S) \ R = S" by (simp add: set_eq_iff fun_eq_iff) -lemma pred_equals_eq2 [pred_set_conv]: "((\x y. (x, y) \ R) = (\x y. (x, y) \ S)) \ (R = S)" +lemma pred_equals_eq2 [pred_set_conv]: "(\x y. (x, y) \ R) = (\x y. (x, y) \ S) \ R = S" by (simp add: set_eq_iff fun_eq_iff) -lemma pred_subset_eq [pred_set_conv]: "((\x. x \ R) \ (\x. x \ S)) \ (R \ S)" +lemma pred_subset_eq [pred_set_conv]: "(\x. x \ R) \ (\x. x \ S) \ R \ S" by (simp add: subset_iff le_fun_def) -lemma pred_subset_eq2 [pred_set_conv]: "((\x y. (x, y) \ R) \ (\x y. (x, y) \ S)) \ (R \ S)" +lemma pred_subset_eq2 [pred_set_conv]: "(\x y. (x, y) \ R) \ (\x y. (x, y) \ S) \ R \ S" by (simp add: subset_iff le_fun_def) lemma bot_empty_eq (* CANDIDATE [pred_set_conv] *): "\ = (\x. x \ {})" @@ -96,12 +96,54 @@ lemma sup_Un_eq2 [pred_set_conv]: "(\x y. (x, y) \ R) \ (\x y. (x, y) \ S) = (\x y. (x, y) \ R \ S)" by (simp add: sup_fun_def) +lemma Inf_INT_eq [pred_set_conv]: "\S = (\x. x \ INTER S Collect)" + by (simp add: fun_eq_iff Inf_apply) + +(* CANDIDATE +lemma INF_Int_eq [pred_set_conv]: "(\i\S. (\x. x \ i)) = (\x. x \ \S)" + by (simp add: fun_eq_iff INF_apply) + +lemma Inf_INT_eq2 [pred_set_conv]: "\S = (\x y. (x, y) \ INTER (prod_case ` S) Collect)" + by (simp add: fun_eq_iff Inf_apply INF_apply) + +lemma INF_Int_eq2 [pred_set_conv]: "(\i\S. (\x y. (x, y) \ i)) = (\x y. (x, y) \ \S)" + by (simp add: fun_eq_iff INF_apply) + +lemma Sup_SUP_eq [pred_set_conv]: "\S = (\x. x \ UNION S Collect)" + by (simp add: fun_eq_iff Sup_apply) + +lemma SUP_Sup_eq [pred_set_conv]: "(\i\S. (\x. x \ i)) = (\x. x \ \S)" + by (simp add: fun_eq_iff SUP_apply) + +lemma Sup_SUP_eq2 [pred_set_conv]: "\S = (\x y. (x, y) \ UNION (prod_case ` S) Collect)" + by (simp add: fun_eq_iff Sup_apply SUP_apply) + +lemma SUP_Sup_eq2 [pred_set_conv]: "(\i\S. (\x y. (x, y) \ i)) = (\x y. (x, y) \ \S)" + by (simp add: fun_eq_iff SUP_apply) +*) + +(* CANDIDATE prefer those generalized versions: +lemma INF_INT_eq [pred_set_conv]: "(\i\S. (\x. x \ r i)) = (\x. x \ (\i\S. r i))" + by (simp add: INF_apply fun_eq_iff) + +lemma INF_INT_eq2 [pred_set_conv]: "(\i\S. (\x y. (x, y) \ r i)) = (\x y. (x, y) \ (\i\S. r i))" + by (simp add: INF_apply fun_eq_iff) +*) + lemma INF_INT_eq (* CANDIDATE [pred_set_conv] *): "(\i. (\x. x \ r i)) = (\x. x \ (\i. r i))" by (simp add: INF_apply fun_eq_iff) lemma INF_INT_eq2 (* CANDIDATE [pred_set_conv] *): "(\i. (\x y. (x, y) \ r i)) = (\x y. (x, y) \ (\i. r i))" by (simp add: INF_apply fun_eq_iff) +(* CANDIDATE prefer those generalized versions: +lemma SUP_UN_eq [pred_set_conv]: "(\i\S. (\x. x \ r i)) = (\x. x \ (\i\S. r i))" + by (simp add: SUP_apply fun_eq_iff) + +lemma SUP_UN_eq2 [pred_set_conv]: "(\i\S. (\x y. (x, y) \ r i)) = (\x y. (x, y) \ (\i\S. r i))" + by (simp add: SUP_apply fun_eq_iff) +*) + lemma SUP_UN_eq [pred_set_conv]: "(\i. (\x. x \ r i)) = (\x. x \ (\i. r i))" by (simp add: SUP_apply fun_eq_iff)