# HG changeset patch # User haftmann # Date 1473242349 -7200 # Node ID 9f004fbf9d5c25034d3adc683d8d8991ba5387aa # Parent 58f74e90b96d07f6b1f01061faf4825b68d2cfe5 discontinued theory-local special syntax for lattice orderings diff -r 58f74e90b96d -r 9f004fbf9d5c src/HOL/Complete_Lattices.thy --- a/src/HOL/Complete_Lattices.thy Wed Sep 07 11:59:07 2016 +0200 +++ b/src/HOL/Complete_Lattices.thy Wed Sep 07 11:59:09 2016 +0200 @@ -11,11 +11,6 @@ imports Fun begin -notation - less_eq (infix "\" 50) and - less (infix "\" 50) - - subsection \Syntactic infimum and supremum operations\ class Inf = @@ -116,10 +111,10 @@ in terms of infimum and supremum.\ class complete_lattice = lattice + Inf + Sup + bot + top + - assumes Inf_lower: "x \ A \ \A \ x" - and Inf_greatest: "(\x. x \ A \ z \ x) \ z \ \A" - and Sup_upper: "x \ A \ x \ \A" - and Sup_least: "(\x. x \ A \ x \ z) \ \A \ z" + assumes Inf_lower: "x \ A \ \A \ x" + and Inf_greatest: "(\x. x \ A \ z \ x) \ z \ \A" + and Sup_upper: "x \ A \ x \ \A" + and Sup_least: "(\x. x \ A \ x \ z) \ \A \ z" and Inf_empty [simp]: "\{} = \" and Sup_empty [simp]: "\{} = \" begin @@ -158,40 +153,40 @@ "(\i. i \ A \ x \ f i) \ (\y. (\i. i \ A \ f i \ y) \ x \ y) \ (\i\A. f i) = x" using Inf_eqI [of "f ` A" x] by auto -lemma INF_lower: "i \ A \ (\i\A. f i) \ f i" +lemma INF_lower: "i \ A \ (\i\A. f i) \ f i" using Inf_lower [of _ "f ` A"] by simp -lemma INF_greatest: "(\i. i \ A \ u \ f i) \ u \ (\i\A. f i)" +lemma INF_greatest: "(\i. i \ A \ u \ f i) \ u \ (\i\A. f i)" using Inf_greatest [of "f ` A"] by auto -lemma SUP_upper: "i \ A \ f i \ (\i\A. f i)" +lemma SUP_upper: "i \ A \ f i \ (\i\A. f i)" using Sup_upper [of _ "f ` A"] by simp -lemma SUP_least: "(\i. i \ A \ f i \ u) \ (\i\A. f i) \ u" +lemma SUP_least: "(\i. i \ A \ f i \ u) \ (\i\A. f i) \ u" using Sup_least [of "f ` A"] by auto -lemma Inf_lower2: "u \ A \ u \ v \ \A \ v" +lemma Inf_lower2: "u \ A \ u \ v \ \A \ v" using Inf_lower [of u A] by auto -lemma INF_lower2: "i \ A \ f i \ u \ (\i\A. f i) \ u" +lemma INF_lower2: "i \ A \ f i \ u \ (\i\A. f i) \ u" using INF_lower [of i A f] by auto -lemma Sup_upper2: "u \ A \ v \ u \ v \ \A" +lemma Sup_upper2: "u \ A \ v \ u \ v \ \A" using Sup_upper [of u A] by auto -lemma SUP_upper2: "i \ A \ u \ f i \ u \ (\i\A. f i)" +lemma SUP_upper2: "i \ A \ u \ f i \ u \ (\i\A. f i)" using SUP_upper [of i A f] by auto -lemma le_Inf_iff: "b \ \A \ (\a\A. b \ a)" +lemma le_Inf_iff: "b \ \A \ (\a\A. b \ a)" by (auto intro: Inf_greatest dest: Inf_lower) -lemma le_INF_iff: "u \ (\i\A. f i) \ (\i\A. u \ f i)" +lemma le_INF_iff: "u \ (\i\A. f i) \ (\i\A. u \ f i)" using le_Inf_iff [of _ "f ` A"] by simp -lemma Sup_le_iff: "\A \ b \ (\a\A. a \ b)" +lemma Sup_le_iff: "\A \ b \ (\a\A. a \ b)" by (auto intro: Sup_least dest: Sup_upper) -lemma SUP_le_iff: "(\i\A. f i) \ u \ (\i\A. f i \ u)" +lemma SUP_le_iff: "(\i\A. f i) \ u \ (\i\A. f i \ u)" using Sup_le_iff [of "f ` A"] by simp lemma Inf_insert [simp]: "\insert a A = a \ \A" @@ -218,68 +213,68 @@ lemma Sup_UNIV [simp]: "\UNIV = \" by (auto intro!: antisym Sup_upper) -lemma Inf_Sup: "\A = \{b. \a \ A. b \ a}" +lemma Inf_Sup: "\A = \{b. \a \ A. b \ a}" by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least) -lemma Sup_Inf: "\A = \{b. \a \ A. a \ b}" +lemma Sup_Inf: "\A = \{b. \a \ A. a \ b}" by (auto intro: antisym Inf_lower Inf_greatest Sup_upper Sup_least) -lemma Inf_superset_mono: "B \ A \ \A \ \B" +lemma Inf_superset_mono: "B \ A \ \A \ \B" by (auto intro: Inf_greatest Inf_lower) -lemma Sup_subset_mono: "A \ B \ \A \ \B" +lemma Sup_subset_mono: "A \ B \ \A \ \B" by (auto intro: Sup_least Sup_upper) lemma Inf_mono: - assumes "\b. b \ B \ \a\A. a \ b" - shows "\A \ \B" + assumes "\b. b \ B \ \a\A. a \ b" + shows "\A \ \B" proof (rule Inf_greatest) fix b assume "b \ B" - with assms obtain a where "a \ A" and "a \ b" by blast - from \a \ A\ have "\A \ a" by (rule Inf_lower) - with \a \ b\ show "\A \ b" by auto + with assms obtain a where "a \ A" and "a \ b" by blast + from \a \ A\ have "\A \ a" by (rule Inf_lower) + with \a \ b\ show "\A \ b" by auto qed -lemma INF_mono: "(\m. m \ B \ \n\A. f n \ g m) \ (\n\A. f n) \ (\n\B. g n)" +lemma INF_mono: "(\m. m \ B \ \n\A. f n \ g m) \ (\n\A. f n) \ (\n\B. g n)" using Inf_mono [of "g ` B" "f ` A"] by auto lemma Sup_mono: - assumes "\a. a \ A \ \b\B. a \ b" - shows "\A \ \B" + assumes "\a. a \ A \ \b\B. a \ b" + shows "\A \ \B" proof (rule Sup_least) fix a assume "a \ A" - with assms obtain b where "b \ B" and "a \ b" by blast - from \b \ B\ have "b \ \B" by (rule Sup_upper) - with \a \ b\ show "a \ \B" by auto + with assms obtain b where "b \ B" and "a \ b" by blast + from \b \ B\ have "b \ \B" by (rule Sup_upper) + with \a \ b\ show "a \ \B" by auto qed -lemma SUP_mono: "(\n. n \ A \ \m\B. f n \ g m) \ (\n\A. f n) \ (\n\B. g n)" +lemma SUP_mono: "(\n. n \ A \ \m\B. f n \ g m) \ (\n\A. f n) \ (\n\B. g n)" using Sup_mono [of "f ` A" "g ` B"] by auto -lemma INF_superset_mono: "B \ A \ (\x. x \ B \ f x \ g x) \ (\x\A. f x) \ (\x\B. g x)" +lemma INF_superset_mono: "B \ A \ (\x. x \ B \ f x \ g x) \ (\x\A. f x) \ (\x\B. g x)" \ \The last inclusion is POSITIVE!\ by (blast intro: INF_mono dest: subsetD) -lemma SUP_subset_mono: "A \ B \ (\x. x \ A \ f x \ g x) \ (\x\A. f x) \ (\x\B. g x)" +lemma SUP_subset_mono: "A \ B \ (\x. x \ A \ f x \ g x) \ (\x\A. f x) \ (\x\B. g x)" by (blast intro: SUP_mono dest: subsetD) lemma Inf_less_eq: - assumes "\v. v \ A \ v \ u" + assumes "\v. v \ A \ v \ u" and "A \ {}" - shows "\A \ u" + shows "\A \ u" proof - from \A \ {}\ obtain v where "v \ A" by blast - moreover from \v \ A\ assms(1) have "v \ u" by blast + moreover from \v \ A\ assms(1) have "v \ u" by blast ultimately show ?thesis by (rule Inf_lower2) qed lemma less_eq_Sup: - assumes "\v. v \ A \ u \ v" + assumes "\v. v \ A \ u \ v" and "A \ {}" - shows "u \ \A" + shows "u \ \A" proof - from \A \ {}\ obtain v where "v \ A" by blast - moreover from \v \ A\ assms(1) have "u \ v" by blast + moreover from \v \ A\ assms(1) have "u \ v" by blast ultimately show ?thesis by (rule Sup_upper2) qed @@ -295,10 +290,10 @@ shows "SUPREMUM A f = SUPREMUM B g" by (intro antisym SUP_least) (blast intro: SUP_upper2 dest: assms)+ -lemma less_eq_Inf_inter: "\A \ \B \ \(A \ B)" +lemma less_eq_Inf_inter: "\A \ \B \ \(A \ B)" by (auto intro: Inf_greatest Inf_lower) -lemma Sup_inter_less_eq: "\(A \ B) \ \A \ \B " +lemma Sup_inter_less_eq: "\(A \ B) \ \A \ \B " by (auto intro: Sup_least Sup_upper) lemma Inf_union_distrib: "\(A \ B) = \A \ \B" @@ -574,16 +569,16 @@ lemma complete_linorder_sup_max: "sup = max" by (auto intro: antisym simp add: max_def fun_eq_iff) -lemma Inf_less_iff: "\S \ a \ (\x\S. x \ a)" +lemma Inf_less_iff: "\S < a \ (\x\S. x < a)" by (simp add: not_le [symmetric] le_Inf_iff) -lemma INF_less_iff: "(\i\A. f i) \ a \ (\x\A. f x \ a)" +lemma INF_less_iff: "(\i\A. f i) < a \ (\x\A. f x < a)" by (simp add: Inf_less_iff [of "f ` A"]) -lemma less_Sup_iff: "a \ \S \ (\x\S. a \ x)" +lemma less_Sup_iff: "a < \S \ (\x\S. a < x)" by (simp add: not_le [symmetric] Sup_le_iff) -lemma less_SUP_iff: "a \ (\i\A. f i) \ (\x\A. a \ f x)" +lemma less_SUP_iff: "a < (\i\A. f i) \ (\x\A. a < f x)" by (simp add: less_Sup_iff [of _ "f ` A"]) lemma Sup_eq_top_iff [simp]: "\A = \ \ (\x<\. \i\A. x < i)" @@ -1426,10 +1421,6 @@ text \Finally\ -no_notation - less_eq (infix "\" 50) and - less (infix "\" 50) - lemmas mem_simps = insert_iff empty_iff Un_iff Int_iff Compl_iff Diff_iff mem_Collect_eq UN_iff Union_iff INT_iff Inter_iff diff -r 58f74e90b96d -r 9f004fbf9d5c src/HOL/Lattices.thy --- a/src/HOL/Lattices.thy Wed Sep 07 11:59:07 2016 +0200 +++ b/src/HOL/Lattices.thy Wed Sep 07 11:59:09 2016 +0200 @@ -161,19 +161,15 @@ subsection \Concrete lattices\ -notation - less_eq (infix "\" 50) and - less (infix "\" 50) - class semilattice_inf = order + inf + - assumes inf_le1 [simp]: "x \ y \ x" - and inf_le2 [simp]: "x \ y \ y" - and inf_greatest: "x \ y \ x \ z \ x \ y \ z" + assumes inf_le1 [simp]: "x \ y \ x" + and inf_le2 [simp]: "x \ y \ y" + and inf_greatest: "x \ y \ x \ z \ x \ y \ z" class semilattice_sup = order + sup + - assumes sup_ge1 [simp]: "x \ x \ y" - and sup_ge2 [simp]: "y \ x \ y" - and sup_least: "y \ x \ z \ x \ y \ z \ x" + assumes sup_ge1 [simp]: "x \ x \ y" + and sup_ge2 [simp]: "y \ x \ y" + and sup_least: "y \ x \ z \ x \ y \ z \ x" begin text \Dual lattice.\ @@ -191,28 +187,28 @@ context semilattice_inf begin -lemma le_infI1: "a \ x \ a \ b \ x" +lemma le_infI1: "a \ x \ a \ b \ x" by (rule order_trans) auto -lemma le_infI2: "b \ x \ a \ b \ x" +lemma le_infI2: "b \ x \ a \ b \ x" by (rule order_trans) auto -lemma le_infI: "x \ a \ x \ b \ x \ a \ b" +lemma le_infI: "x \ a \ x \ b \ x \ a \ b" by (fact inf_greatest) (* FIXME: duplicate lemma *) -lemma le_infE: "x \ a \ b \ (x \ a \ x \ b \ P) \ P" +lemma le_infE: "x \ a \ b \ (x \ a \ x \ b \ P) \ P" by (blast intro: order_trans inf_le1 inf_le2) -lemma le_inf_iff: "x \ y \ z \ x \ y \ x \ z" +lemma le_inf_iff: "x \ y \ z \ x \ y \ x \ z" by (blast intro: le_infI elim: le_infE) -lemma le_iff_inf: "x \ y \ x \ y = x" +lemma le_iff_inf: "x \ y \ x \ y = x" by (auto intro: le_infI1 antisym dest: eq_iff [THEN iffD1] simp add: le_inf_iff) -lemma inf_mono: "a \ c \ b \ d \ a \ b \ c \ d" +lemma inf_mono: "a \ c \ b \ d \ a \ b \ c \ d" by (fast intro: inf_greatest le_infI1 le_infI2) -lemma mono_inf: "mono f \ f (A \ B) \ f A \ f B" for f :: "'a \ 'b::semilattice_inf" +lemma mono_inf: "mono f \ f (A \ B) \ f A \ f B" for f :: "'a \ 'b::semilattice_inf" by (auto simp add: mono_def intro: Lattices.inf_greatest) end @@ -220,28 +216,28 @@ context semilattice_sup begin -lemma le_supI1: "x \ a \ x \ a \ b" +lemma le_supI1: "x \ a \ x \ a \ b" by (rule order_trans) auto -lemma le_supI2: "x \ b \ x \ a \ b" +lemma le_supI2: "x \ b \ x \ a \ b" by (rule order_trans) auto -lemma le_supI: "a \ x \ b \ x \ a \ b \ x" +lemma le_supI: "a \ x \ b \ x \ a \ b \ x" by (fact sup_least) (* FIXME: duplicate lemma *) -lemma le_supE: "a \ b \ x \ (a \ x \ b \ x \ P) \ P" +lemma le_supE: "a \ b \ x \ (a \ x \ b \ x \ P) \ P" by (blast intro: order_trans sup_ge1 sup_ge2) -lemma le_sup_iff: "x \ y \ z \ x \ z \ y \ z" +lemma le_sup_iff: "x \ y \ z \ x \ z \ y \ z" by (blast intro: le_supI elim: le_supE) -lemma le_iff_sup: "x \ y \ x \ y = y" +lemma le_iff_sup: "x \ y \ x \ y = y" by (auto intro: le_supI2 antisym dest: eq_iff [THEN iffD1] simp add: le_sup_iff) -lemma sup_mono: "a \ c \ b \ d \ a \ b \ c \ d" +lemma sup_mono: "a \ c \ b \ d \ a \ b \ c \ d" by (fast intro: sup_least le_supI1 le_supI2) -lemma mono_sup: "mono f \ f A \ f B \ f (A \ B)" for f :: "'a \ 'b::semilattice_sup" +lemma mono_sup: "mono f \ f A \ f B \ f (A \ B)" for f :: "'a \ 'b::semilattice_sup" by (auto simp add: mono_def intro: Lattices.sup_least) end @@ -284,10 +280,10 @@ lemma inf_right_idem: "(x \ y) \ y = x \ y" by (fact inf.right_idem) (* already simp *) -lemma inf_absorb1: "x \ y \ x \ y = x" +lemma inf_absorb1: "x \ y \ x \ y = x" by (rule antisym) auto -lemma inf_absorb2: "y \ x \ x \ y = y" +lemma inf_absorb2: "y \ x \ x \ y = y" by (rule antisym) auto lemmas inf_aci = inf_commute inf_assoc inf_left_commute inf_left_idem @@ -326,10 +322,10 @@ lemma sup_left_idem [simp]: "x \ (x \ y) = x \ y" by (fact sup.left_idem) -lemma sup_absorb1: "y \ x \ x \ y = x" +lemma sup_absorb1: "y \ x \ x \ y = x" by (rule antisym) auto -lemma sup_absorb2: "x \ y \ x \ y = y" +lemma sup_absorb2: "x \ y \ x \ y = y" by (rule antisym) auto lemmas sup_aci = sup_commute sup_assoc sup_left_commute sup_left_idem @@ -358,10 +354,10 @@ text \Towards distributivity.\ -lemma distrib_sup_le: "x \ (y \ z) \ (x \ y) \ (x \ z)" +lemma distrib_sup_le: "x \ (y \ z) \ (x \ y) \ (x \ z)" by (auto intro: le_infI1 le_infI2 le_supI1 le_supI2) -lemma distrib_inf_le: "(x \ y) \ (x \ z) \ x \ (y \ z)" +lemma distrib_inf_le: "(x \ y) \ (x \ z) \ x \ (y \ z)" by (auto intro: le_infI1 le_infI2 le_supI1 le_supI2) text \If you have one of them, you have them all.\ @@ -402,10 +398,10 @@ context semilattice_inf begin -lemma less_infI1: "a \ x \ a \ b \ x" +lemma less_infI1: "a < x \ a \ b < x" by (auto simp add: less_le inf_absorb1 intro: le_infI1) -lemma less_infI2: "b \ x \ a \ b \ x" +lemma less_infI2: "b < x \ a \ b < x" by (auto simp add: less_le inf_absorb2 intro: le_infI2) end @@ -413,11 +409,11 @@ context semilattice_sup begin -lemma less_supI1: "x \ a \ x \ a \ b" +lemma less_supI1: "x < a \ x < a \ b" using dual_semilattice by (rule semilattice_inf.less_infI1) -lemma less_supI2: "x \ b \ x \ a \ b" +lemma less_supI2: "x < b \ x < a \ b" using dual_semilattice by (rule semilattice_inf.less_infI2) @@ -616,8 +612,8 @@ by (rule boolean_algebra.compl_inf) lemma compl_mono: - assumes "x \ y" - shows "- y \ - x" + assumes "x \ y" + shows "- y \ - x" proof - from assms have "x \ y = y" by (simp only: le_iff_sup) then have "- (x \ y) = - y" by simp @@ -626,41 +622,41 @@ then show ?thesis by (simp only: le_iff_inf) qed -lemma compl_le_compl_iff [simp]: "- x \ - y \ y \ x" +lemma compl_le_compl_iff [simp]: "- x \ - y \ y \ x" by (auto dest: compl_mono) lemma compl_le_swap1: - assumes "y \ - x" - shows "x \ -y" + assumes "y \ - x" + shows "x \ -y" proof - - from assms have "- (- x) \ - y" by (simp only: compl_le_compl_iff) + from assms have "- (- x) \ - y" by (simp only: compl_le_compl_iff) then show ?thesis by simp qed lemma compl_le_swap2: - assumes "- y \ x" - shows "- x \ y" + assumes "- y \ x" + shows "- x \ y" proof - - from assms have "- x \ - (- y)" by (simp only: compl_le_compl_iff) + from assms have "- x \ - (- y)" by (simp only: compl_le_compl_iff) then show ?thesis by simp qed -lemma compl_less_compl_iff: "- x \ - y \ y \ x" (* TODO: declare [simp] ? *) +lemma compl_less_compl_iff: "- x < - y \ y < x" (* TODO: declare [simp] ? *) by (auto simp add: less_le) lemma compl_less_swap1: - assumes "y \ - x" - shows "x \ - y" + assumes "y < - x" + shows "x < - y" proof - - from assms have "- (- x) \ - y" by (simp only: compl_less_compl_iff) + from assms have "- (- x) < - y" by (simp only: compl_less_compl_iff) then show ?thesis by simp qed lemma compl_less_swap2: - assumes "- y \ x" - shows "- x \ y" + assumes "- y < x" + shows "- x < y" proof - - from assms have "- x \ - (- y)" + from assms have "- x < - (- y)" by (simp only: compl_less_compl_iff) then show ?thesis by simp qed @@ -772,31 +768,31 @@ lemma (in semilattice_inf) inf_unique: fixes f (infixl "\" 70) - assumes le1: "\x y. x \ y \ x" - and le2: "\x y. x \ y \ y" - and greatest: "\x y z. x \ y \ x \ z \ x \ y \ z" + assumes le1: "\x y. x \ y \ x" + and le2: "\x y. x \ y \ y" + and greatest: "\x y z. x \ y \ x \ z \ x \ y \ z" shows "x \ y = x \ y" proof (rule antisym) - show "x \ y \ x \ y" + show "x \ y \ x \ y" by (rule le_infI) (rule le1, rule le2) - have leI: "\x y z. x \ y \ x \ z \ x \ y \ z" + have leI: "\x y z. x \ y \ x \ z \ x \ y \ z" by (blast intro: greatest) - show "x \ y \ x \ y" + show "x \ y \ x \ y" by (rule leI) simp_all qed lemma (in semilattice_sup) sup_unique: fixes f (infixl "\" 70) - assumes ge1 [simp]: "\x y. x \ x \ y" - and ge2: "\x y. y \ x \ y" - and least: "\x y z. y \ x \ z \ x \ y \ z \ x" + assumes ge1 [simp]: "\x y. x \ x \ y" + and ge2: "\x y. y \ x \ y" + and least: "\x y z. y \ x \ z \ x \ y \ z \ x" shows "x \ y = x \ y" proof (rule antisym) - show "x \ y \ x \ y" + show "x \ y \ x \ y" by (rule le_supI) (rule ge1, rule ge2) - have leI: "\x y z. x \ z \ y \ z \ x \ y \ z" + have leI: "\x y z. x \ z \ y \ z \ x \ y \ z" by (blast intro: least) - show "x \ y \ x \ y" + show "x \ y \ x \ y" by (rule leI) simp_all qed @@ -942,9 +938,4 @@ lemma sup2CI: "(\ B x y \ A x y) \ (A \ B) x y" by (auto simp add: sup_fun_def) - -no_notation - less_eq (infix "\" 50) and - less (infix "\" 50) - end