941 "class.complete_distrib_lattice Sup Inf sup (\<ge>) (>) inf \<top> \<bottom>" |
941 "class.complete_distrib_lattice Sup Inf sup (\<ge>) (>) inf \<top> \<bottom>" |
942 apply (rule class.complete_distrib_lattice.intro) |
942 apply (rule class.complete_distrib_lattice.intro) |
943 apply (fact dual_complete_lattice) |
943 apply (fact dual_complete_lattice) |
944 by (simp add: class.complete_distrib_lattice_axioms_def Sup_Inf) |
944 by (simp add: class.complete_distrib_lattice_axioms_def Sup_Inf) |
945 |
945 |
946 lemma sup_Inf: "a \<squnion> Inf B = (INF b:B. a \<squnion> b)" |
946 lemma sup_Inf: "a \<squnion> \<Sqinter>B = \<Sqinter>((\<squnion>) a ` B)" |
947 proof (rule antisym) |
947 proof (rule antisym) |
948 show "a \<squnion> Inf B \<le> (INF b:B. a \<squnion> b)" |
948 show "a \<squnion> \<Sqinter>B \<le> \<Sqinter>((\<squnion>) a ` B)" |
949 apply (rule INF_greatest) |
949 apply (rule INF_greatest) |
950 using Inf_lower sup.mono by fastforce |
950 using Inf_lower sup.mono by fastforce |
951 next |
951 next |
952 have "(INF b:B. a \<squnion> b) \<le> INFIMUM {{f {a}, f B} |f. f {a} = a \<and> f B \<in> B} Sup" |
952 have "\<Sqinter>((\<squnion>) a ` B) \<le> \<Sqinter>(Sup ` {{f {a}, f B} |f. f {a} = a \<and> f B \<in> B})" |
953 by (rule INF_greatest, auto simp add: INF_lower) |
953 by (rule INF_greatest, auto simp add: INF_lower) |
954 also have "... = SUPREMUM {{a}, B} Inf" |
954 also have "... = SUPREMUM {{a}, B} Inf" |
955 by (unfold Sup_Inf, simp) |
955 by (unfold Sup_Inf, simp) |
956 finally show "(INF b:B. a \<squnion> b) \<le> a \<squnion> Inf B" |
956 finally show "\<Sqinter>((\<squnion>) a ` B) \<le> a \<squnion> \<Sqinter>B" |
957 by simp |
957 by simp |
958 qed |
958 qed |
959 |
959 |
960 lemma inf_Sup: "a \<sqinter> Sup B = (SUP b:B. a \<sqinter> b)" |
960 lemma inf_Sup: "a \<sqinter> \<Squnion>B = \<Squnion>((\<sqinter>) a ` B)" |
961 using dual_complete_distrib_lattice |
961 using dual_complete_distrib_lattice |
962 by (rule complete_distrib_lattice.sup_Inf) |
962 by (rule complete_distrib_lattice.sup_Inf) |
963 |
963 |
964 lemma INF_SUP: "(INF y. SUP x. ((P x y)::'a)) = (SUP x. INF y. P (x y) y)" |
964 lemma INF_SUP: "(INF y. SUP x. ((P x y)::'a)) = (SUP x. INF y. P (x y) y)" |
965 proof (rule antisym) |
965 proof (rule antisym) |
979 also have "... \<le> (SUP x. INF y. P (x y) y)" |
979 also have "... \<le> (SUP x. INF y. P (x y) y)" |
980 proof (subst Inf_Sup, rule SUP_least, clarsimp) |
980 proof (subst Inf_Sup, rule SUP_least, clarsimp) |
981 fix f |
981 fix f |
982 assume A: "\<forall>Y. (\<exists>y. Y = {uu. \<exists>x. uu = P x y}) \<longrightarrow> f Y \<in> Y" |
982 assume A: "\<forall>Y. (\<exists>y. Y = {uu. \<exists>x. uu = P x y}) \<longrightarrow> f Y \<in> Y" |
983 |
983 |
984 have "(INF x:{uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}. f x) \<le> (INF y. P ((\<lambda> y. SOME x . f ({P x y | x. True}) = P x y) y) y)" |
984 have " \<Sqinter>(f ` {uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}) \<le> |
|
985 (\<Sqinter>y. P (SOME x. f {P x y |x. True} = P x y) y)" |
985 proof (rule INF_greatest, clarsimp) |
986 proof (rule INF_greatest, clarsimp) |
986 fix y |
987 fix y |
987 have "(INF x:{uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}. f x) \<le> f {uu. \<exists>x. uu = P x y}" |
988 have "(INF x\<in>{uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}. f x) \<le> f {uu. \<exists>x. uu = P x y}" |
988 by (rule INF_lower, blast) |
989 by (rule INF_lower, blast) |
989 also have "... \<le> P (SOME x. f {uu . \<exists>x. uu = P x y} = P x y) y" |
990 also have "... \<le> P (SOME x. f {uu . \<exists>x. uu = P x y} = P x y) y" |
990 apply (rule someI2_ex) |
991 apply (rule someI2_ex) |
991 using A by auto |
992 using A by auto |
992 finally show "(INF x:{uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}. f x) \<le> P (SOME x. f {uu . \<exists>x. uu = P x y} = P x y) y" |
993 finally show "\<Sqinter>(f ` {uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}) \<le> |
|
994 P (SOME x. f {uu. \<exists>x. uu = P x y} = P x y) y" |
993 by simp |
995 by simp |
994 qed |
996 qed |
995 also have "... \<le> (SUP x. INF y. P (x y) y)" |
997 also have "... \<le> (SUP x. INF y. P (x y) y)" |
996 by (rule SUP_upper, simp) |
998 by (rule SUP_upper, simp) |
997 finally show "(INF x:{uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}. f x) \<le> (SUP x. INF y. P (x y) y)" |
999 finally show "\<Sqinter>(f ` {uu. \<exists>y. uu = {uu. \<exists>x. uu = P x y}}) \<le> (\<Squnion>x. \<Sqinter>y. P (x y) y)" |
998 by simp |
1000 by simp |
999 qed |
1001 qed |
1000 finally show "(INF y. SUP x. P x y) \<le> (SUP x. INF y. P (x y) y)" |
1002 finally show "(INF y. SUP x. P x y) \<le> (SUP x. INF y. P (x y) y)" |
1001 by simp |
1003 by simp |
1002 qed |
1004 qed |
1003 |
1005 |
1004 lemma INF_SUP_set: "(INF x:A. SUP a:x. (g a)) = (SUP x:{f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}. INF a:x. g a)" |
1006 lemma INF_SUP_set: "(\<Sqinter>x\<in>A. \<Squnion>(g ` x)) = (\<Squnion>x\<in>{f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}. \<Sqinter>(g ` x))" |
1005 proof (rule antisym) |
1007 proof (rule antisym) |
1006 have [simp]: "\<And>f xa. \<forall>Y\<in>A. f Y \<in> Y \<Longrightarrow> xa \<in> A \<Longrightarrow> (\<Sqinter>x\<in>A. g (f x)) \<le> g (f xa)" |
1008 have [simp]: "\<And>f xa. \<forall>Y\<in>A. f Y \<in> Y \<Longrightarrow> xa \<in> A \<Longrightarrow> (\<Sqinter>x\<in>A. g (f x)) \<le> g (f xa)" |
1007 by (rule INF_lower2, blast+) |
1009 by (rule INF_lower2, blast+) |
1008 have B: "\<And>f xa. \<forall>Y\<in>A. f Y \<in> Y \<Longrightarrow> xa \<in> A \<Longrightarrow> f xa \<in> xa" |
1010 have B: "\<And>f xa. \<forall>Y\<in>A. f Y \<in> Y \<Longrightarrow> xa \<in> A \<Longrightarrow> f xa \<in> xa" |
1009 by blast |
1011 by blast |
1061 |
1063 |
1062 lemma SUP_INF: "(SUP y. INF x. ((P x y)::'a)) = (INF x. SUP y. P (x y) y)" |
1064 lemma SUP_INF: "(SUP y. INF x. ((P x y)::'a)) = (INF x. SUP y. P (x y) y)" |
1063 using dual_complete_distrib_lattice |
1065 using dual_complete_distrib_lattice |
1064 by (rule complete_distrib_lattice.INF_SUP) |
1066 by (rule complete_distrib_lattice.INF_SUP) |
1065 |
1067 |
1066 lemma SUP_INF_set: "(SUP x:A. INF a:x. (g a)) = (INF x:{f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}. SUP a:x. g a)" |
1068 lemma SUP_INF_set: "(\<Squnion>x\<in>A. \<Sqinter>(g ` x)) = (\<Sqinter>x\<in>{f ` A |f. \<forall>Y\<in>A. f Y \<in> Y}. \<Squnion>(g ` x))" |
1067 using dual_complete_distrib_lattice |
1069 using dual_complete_distrib_lattice |
1068 by (rule complete_distrib_lattice.INF_SUP_set) |
1070 by (rule complete_distrib_lattice.INF_SUP_set) |
1069 |
1071 |
1070 end |
1072 end |
1071 |
1073 |
1116 rule dual_boolean_algebra) |
1118 rule dual_boolean_algebra) |
1117 end |
1119 end |
1118 |
1120 |
1119 |
1121 |
1120 |
1122 |
1121 instantiation "set" :: (type) complete_distrib_lattice |
1123 instantiation set :: (type) complete_distrib_lattice |
1122 begin |
1124 begin |
1123 instance proof (standard, clarsimp) |
1125 instance proof (standard, clarsimp) |
1124 fix A :: "(('a set) set) set" |
1126 fix A :: "(('a set) set) set" |
1125 fix x::'a |
1127 fix x::'a |
1126 define F where "F = (\<lambda> Y . (SOME X . (Y \<in> A \<and> X \<in> Y \<and> x \<in> X)))" |
1128 define F where "F = (\<lambda> Y . (SOME X . (Y \<in> A \<and> X \<in> Y \<and> x \<in> X)))" |