# HG changeset patch # User wenzelm # Date 1196114364 -3600 # Node ID f81b3be9dfdd1d4498a146bfa3e10f8137c2f9db # Parent d2c6183909287899062b7c12deb07fb3aea7a468 some more lemmas due to Peter Lammich; diff -r d2c618390928 -r f81b3be9dfdd src/HOL/Lattice/CompleteLattice.thy --- a/src/HOL/Lattice/CompleteLattice.thy Mon Nov 26 22:59:21 2007 +0100 +++ b/src/HOL/Lattice/CompleteLattice.thy Mon Nov 26 22:59:24 2007 +0100 @@ -117,24 +117,70 @@ *} theorem Knaster_Tarski: - "(\x y. x \ y \ f x \ f y) \ \a::'a::complete_lattice. f a = a" -proof - assume mono: "\x y. x \ y \ f x \ f y" - let ?H = "{u. f u \ u}" let ?a = "\?H" - have ge: "f ?a \ ?a" - proof - fix x assume x: "x \ ?H" - then have "?a \ x" .. - then have "f ?a \ f x" by (rule mono) - also from x have "... \ x" .. - finally show "f ?a \ x" . + assumes mono: "\x y. x \ y \ f x \ f y" + shows "\a::'a::complete_lattice. f a = a \ (\a'. f a' = a' \ a \ a')" +proof - + let ?H = "{u. f u \ u}" + let ?a = "\?H" + have "f ?a = ?a" + proof - + have ge: "f ?a \ ?a" + proof + fix x assume x: "x \ ?H" + then have "?a \ x" .. + then have "f ?a \ f x" by (rule mono) + also from x have "... \ x" .. + finally show "f ?a \ x" . + qed + also have "?a \ f ?a" + proof + from ge have "f (f ?a) \ f ?a" by (rule mono) + then show "f ?a \ ?H" .. + qed + finally show ?thesis . qed - also have "?a \ f ?a" - proof - from ge have "f (f ?a) \ f ?a" by (rule mono) - then show "f ?a \ ?H" .. + moreover { + fix a' + assume "f a' = a'" + then have "f a' \ a'" by (simp only: leq_refl) + then have "a' \ ?H" .. + then have "?a \ a'" .. + } + ultimately show ?thesis by blast +qed + + +theorem Knaster_Tarski_dual: + assumes mono: "\x y. x \ y \ f x \ f y" + shows "\a::'a::complete_lattice. f a = a \ (\a'. f a' = a' \ a' \ a)" +proof - + let ?H = "{u. u \ f u}" + let ?a = "\?H" + have "f ?a = ?a" + proof - + have le: "?a \ f ?a" + proof + fix x assume x: "x \ ?H" + then have "x \ f x" .. + also from x have "x \ ?a" .. + then have "f x \ f ?a" by (rule mono) + finally show "x \ f ?a" . + qed + have "f ?a \ ?a" + proof + from le have "f ?a \ f (f ?a)" by (rule mono) + then show "f ?a \ ?H" .. + qed + from this and le show ?thesis by (rule leq_antisym) qed - finally show "f ?a = ?a" . + moreover { + fix a' + assume "f a' = a'" + then have "a' \ f a'" by (simp only: leq_refl) + then have "a' \ ?H" .. + then have "a' \ ?a" .. + } + ultimately show ?thesis by blast qed @@ -146,10 +192,11 @@ *} definition - bottom :: "'a::complete_lattice" ("\") where + bottom :: "'a::complete_lattice" ("\") where "\ = \UNIV" + definition - top :: "'a::complete_lattice" ("\") where + top :: "'a::complete_lattice" ("\") where "\ = \UNIV" lemma bottom_least [intro?]: "\ \ x" diff -r d2c618390928 -r f81b3be9dfdd src/HOL/Lattice/Lattice.thy --- a/src/HOL/Lattice/Lattice.thy Mon Nov 26 22:59:21 2007 +0100 +++ b/src/HOL/Lattice/Lattice.thy Mon Nov 26 22:59:24 2007 +0100 @@ -582,18 +582,19 @@ qed text {* - \medskip A semi-morphisms is a function $f$ that preserves the + \medskip A semi-morphisms is a function @{text f} that preserves the lattice operations in the following manner: @{term "f (x \ y) \ f x \ f y"} and @{term "f x \ f y \ f (x \ y)"}, respectively. Any of these properties is equivalent with monotonicity. -*} (* FIXME dual version !? *) +*} theorem meet_semimorph: "(\x y. f (x \ y) \ f x \ f y) \ (\x y. x \ y \ f x \ f y)" proof assume morph: "\x y. f (x \ y) \ f x \ f y" fix x y :: "'a::lattice" - assume "x \ y" then have "x \ y = x" .. + assume "x \ y" + then have "x \ y = x" .. then have "x = x \ y" .. also have "f \ \ f x \ f y" by (rule morph) also have "\ \ f y" .. @@ -611,4 +612,27 @@ qed qed +lemma join_semimorph: + "(\x y. f x \ f y \ f (x \ y)) \ (\x y. x \ y \ f x \ f y)" +proof + assume morph: "\x y. f x \ f y \ f (x \ y)" + fix x y :: "'a::lattice" + assume "x \ y" then have "x \ y = y" .. + have "f x \ f x \ f y" .. + also have "\ \ f (x \ y)" by (rule morph) + also from `x \ y` have "x \ y = y" .. + finally show "f x \ f y" . +next + assume mono: "\x y. x \ y \ f x \ f y" + show "\x y. f x \ f y \ f (x \ y)" + proof - + fix x y + show "f x \ f y \ f (x \ y)" + proof + have "x \ x \ y" .. then show "f x \ f (x \ y)" by (rule mono) + have "y \ x \ y" .. then show "f y \ f (x \ y)" by (rule mono) + qed + qed +qed + end