# HG changeset patch # User haftmann # Date 1535044228 0 # Node ID e79c771c0619d1a74a64fbb81ad8208683ec656d # Parent 9ca183045102454c1a239e2dbf9cf8978d5be6a0 tuned diff -r 9ca183045102 -r e79c771c0619 src/HOL/Complete_Lattices.thy --- a/src/HOL/Complete_Lattices.thy Thu Aug 23 17:09:39 2018 +0000 +++ b/src/HOL/Complete_Lattices.thy Thu Aug 23 17:10:28 2018 +0000 @@ -21,22 +21,6 @@ abbreviation (input) INFIMUM :: "'b set \ ('b \ 'a) \ 'a" \ \legacy\ where "INFIMUM A f \ \(f ` A)" -lemma INF_image [simp]: "INFIMUM (f ` A) g = INFIMUM A (g \ f)" - by (simp add: image_comp) - -lemma INF_identity_eq [simp]: "INFIMUM A (\x. x) = \A" - by simp - -lemma INF_id_eq [simp]: "INFIMUM A id = \A" - by simp - -lemma INF_cong: "A = B \ (\x. x \ B \ C x = D x) \ INFIMUM A C = INFIMUM B D" - by (simp add: image_def) - -lemma strong_INF_cong [cong]: - "A = B \ (\x. x \ B =simp=> C x = D x) \ INFIMUM A C = INFIMUM B D" - unfolding simp_implies_def by (fact INF_cong) - end class Sup = @@ -46,22 +30,6 @@ abbreviation (input) SUPREMUM :: "'b set \ ('b \ 'a) \ 'a" \ \legacy\ where "SUPREMUM A f \ \(f ` A)" -lemma SUP_image [simp]: "SUPREMUM (f ` A) g = SUPREMUM A (g \ f)" - by (simp add: image_comp) - -lemma SUP_identity_eq [simp]: "SUPREMUM A (\x. x) = \A" - by simp - -lemma SUP_id_eq [simp]: "SUPREMUM A id = \A" - by (simp add: id_def) - -lemma SUP_cong: "A = B \ (\x. x \ B \ C x = D x) \ SUPREMUM A C = SUPREMUM B D" - by (simp add: image_def) - -lemma strong_SUP_cong [cong]: - "A = B \ (\x. x \ B =simp=> C x = D x) \ SUPREMUM A C = SUPREMUM B D" - unfolding simp_implies_def by (fact SUP_cong) - end syntax (ASCII) @@ -90,6 +58,48 @@ "\x. f" \ "\CONST range (\x. f)" "\x\A. f" \ "CONST Sup ((\x. f) ` A)" +context Inf +begin + +lemma INF_image [simp]: " \(g ` f ` A) = \((g \ f) ` A)" + by (simp add: image_comp) + +lemma INF_identity_eq [simp]: "(\x\A. x) = \A" + by simp + +lemma INF_id_eq [simp]: "\(id ` A) = \A" + by simp + +lemma INF_cong: "A = B \ (\x. x \ B \ C x = D x) \ \(C ` A) = \(D ` B)" + by (simp add: image_def) + +lemma strong_INF_cong [cong]: + "A = B \ (\x. x \ B =simp=> C x = D x) \ \(C ` A) = \(D ` B)" + unfolding simp_implies_def by (fact INF_cong) + +end + +context Sup +begin + +lemma SUP_image [simp]: "\(g ` f ` A) = \((g \ f) ` A)" + by (simp add: image_comp) + +lemma SUP_identity_eq [simp]: "(\x\A. x) = \A" + by simp + +lemma SUP_id_eq [simp]: "\(id ` A) = \A" + by (simp add: id_def) + +lemma SUP_cong: "A = B \ (\x. x \ B \ C x = D x) \ \(C ` A) = \(D ` B)" + by (simp add: image_def) + +lemma strong_SUP_cong [cong]: + "A = B \ (\x. x \ B =simp=> C x = D x) \ \(C ` A) = \(D ` B)" + unfolding simp_implies_def by (fact SUP_cong) + +end + subsection \Abstract complete lattices\ @@ -180,13 +190,13 @@ lemma Inf_insert [simp]: "\insert a A = a \ \A" by (auto intro: le_infI le_infI1 le_infI2 antisym Inf_greatest Inf_lower) -lemma INF_insert [simp]: "(\x\insert a A. f x) = f a \ INFIMUM A f" +lemma INF_insert [simp]: "(\x\insert a A. f x) = f a \ \(f ` A)" by (simp cong del: strong_INF_cong) lemma Sup_insert [simp]: "\insert a A = a \ \A" by (auto intro: le_supI le_supI1 le_supI2 antisym Sup_least Sup_upper) -lemma SUP_insert [simp]: "(\x\insert a A. f x) = f a \ SUPREMUM A f" +lemma SUP_insert [simp]: "(\x\insert a A. f x) = f a \ \(f ` A)" by (simp cong del: strong_SUP_cong) lemma INF_empty [simp]: "(\x\{}. f x) = \" @@ -269,13 +279,13 @@ lemma INF_eq: assumes "\i. i \ A \ \j\B. f i \ g j" and "\j. j \ B \ \i\A. g j \ f i" - shows "INFIMUM A f = INFIMUM B g" + shows "\(f ` A) = \(g ` B)" by (intro antisym INF_greatest) (blast intro: INF_lower2 dest: assms)+ lemma SUP_eq: assumes "\i. i \ A \ \j\B. f i \ g j" and "\j. j \ B \ \i\A. g j \ f i" - shows "SUPREMUM A f = SUPREMUM B g" + shows "\(f ` A) = \(g ` B)" by (intro antisym SUP_least) (blast intro: SUP_upper2 dest: assms)+ lemma less_eq_Inf_inter: "\A \ \B \ \(A \ B)" @@ -422,20 +432,20 @@ lemma Inf_le_Sup: "A \ {} \ Inf A \ Sup A" by (blast intro: Sup_upper2 Inf_lower ex_in_conv) -lemma INF_le_SUP: "A \ {} \ INFIMUM A f \ SUPREMUM A f" +lemma INF_le_SUP: "A \ {} \ \(f ` A) \ \(f ` A)" using Inf_le_Sup [of "f ` A"] by simp -lemma INF_eq_const: "I \ {} \ (\i. i \ I \ f i = x) \ INFIMUM I f = x" +lemma INF_eq_const: "I \ {} \ (\i. i \ I \ f i = x) \ \(f ` I) = x" by (auto intro: INF_eqI) -lemma SUP_eq_const: "I \ {} \ (\i. i \ I \ f i = x) \ SUPREMUM I f = x" +lemma SUP_eq_const: "I \ {} \ (\i. i \ I \ f i = x) \ \(f ` I) = x" by (auto intro: SUP_eqI) -lemma INF_eq_iff: "I \ {} \ (\i. i \ I \ f i \ c) \ INFIMUM I f = c \ (\i\I. f i = c)" +lemma INF_eq_iff: "I \ {} \ (\i. i \ I \ f i \ c) \ \(f ` I) = c \ (\i\I. f i = c)" using INF_eq_const [of I f c] INF_lower [of _ I f] by (auto intro: antisym cong del: strong_INF_cong) -lemma SUP_eq_iff: "I \ {} \ (\i. i \ I \ c \ f i) \ SUPREMUM I f = c \ (\i\I. f i = c)" +lemma SUP_eq_iff: "I \ {} \ (\i. i \ I \ c \ f i) \ \(f ` I) = c \ (\i\I. f i = c)" using SUP_eq_const [of I f c] SUP_upper [of _ I f] by (auto intro: antisym cong del: strong_SUP_cong) @@ -467,7 +477,8 @@ by (rule le_infI1, simp) have [simp]: "b \ a \ a \ b \ c" by (rule le_infI2, simp) - have " INFIMUM {{a, b}, {a, c}} Sup = SUPREMUM {f ` {{a, b}, {a, c}} |f. \Y\{{a, b}, {a, c}}. f Y \ Y} Inf" + have "\(Sup ` {{a, b}, {a, c}}) = + \(Inf ` {f ` {{a, b}, {a, c}} | f. \Y\{{a, b}, {a, c}}. f Y \ Y})" by (rule Inf_Sup) from this show "(a \ b) \ (a \ c) \ a \ b \ c" apply simp