# HG changeset patch # User hoelzl # Date 1361358282 -3600 # Node ID d63ec23c9125f7203e48807f204c8b42c9914dd8 # Parent 62c033d7f3d8ad84c16d6cc2b1616070e2d88013 move auxiliary lemmas from Library/Extended_Reals to HOL image diff -r 62c033d7f3d8 -r d63ec23c9125 src/HOL/Complete_Lattices.thy --- a/src/HOL/Complete_Lattices.thy Mon Mar 04 09:57:54 2013 +0100 +++ b/src/HOL/Complete_Lattices.thy Wed Feb 20 12:04:42 2013 +0100 @@ -89,6 +89,22 @@ by (simp add: fun_eq_iff SUP_def complete_lattice.INF_def [OF dual_complete_lattice]) +lemma Sup_eqI: + "(\y. y \ A \ y \ x) \ (\y. (\z. z \ A \ z \ y) \ x \ y) \ \A = x" + by (blast intro: antisym Sup_least Sup_upper) + +lemma Inf_eqI: + "(\i. i \ A \ x \ i) \ (\y. (\i. i \ A \ y \ i) \ y \ x) \ \A = x" + by (blast intro: antisym Inf_greatest Inf_lower) + +lemma SUP_eqI: + "(\i. i \ A \ f i \ x) \ (\y. (\i. i \ A \ f i \ y) \ x \ y) \ (\i\A. f i) = x" + unfolding SUP_def by (rule Sup_eqI) auto + +lemma INF_eqI: + "(\i. i \ A \ x \ f i) \ (\y. (\i. i \ A \ f i \ y) \ x \ y) \ (\i\A. f i) = x" + unfolding INF_def by (rule Inf_eqI) auto + lemma INF_lower: "i \ A \ (\i\A. f i) \ f i" by (auto simp add: INF_def intro: Inf_lower) @@ -242,6 +258,18 @@ ultimately show ?thesis by (rule Sup_upper2) qed +lemma SUPR_eq: + assumes "\i. i \ A \ \j\B. f i \ g j" + assumes "\j. j \ B \ \i\A. g j \ f i" + shows "(SUP i:A. f i) = (SUP j:B. g j)" + by (intro antisym SUP_least) (blast intro: SUP_upper2 dest: assms)+ + +lemma INFI_eq: + assumes "\i. i \ A \ \j\B. f i \ g j" + assumes "\j. j \ B \ \i\A. g j \ f i" + shows "(INF i:A. f i) = (INF j:B. g j)" + by (intro antisym INF_greatest) (blast intro: INF_lower2 dest: assms)+ + lemma less_eq_Inf_inter: "\A \ \B \ \(A \ B)" by (auto intro: Inf_greatest Inf_lower) @@ -378,6 +406,12 @@ "(\b. A b) = A True \ A False" by (simp add: UNIV_bool SUP_insert sup_commute) +lemma Inf_le_Sup: "A \ {} \ Inf A \ Sup A" + by (blast intro: Sup_upper2 Inf_lower ex_in_conv) + +lemma INF_le_SUP: "A \ {} \ INFI A f \ SUPR A f" + unfolding INF_def SUP_def by (rule Inf_le_Sup) auto + end class complete_distrib_lattice = complete_lattice + @@ -530,9 +564,31 @@ "(\i\A. f i) = \ \ (\x>\. \i\A. f i < x)" unfolding INF_def by auto +lemma le_Sup_iff: "x \ \A \ (\ya\A. y < a)" +proof safe + fix y assume "x \ \A" "y < x" + then have "y < \A" by auto + then show "\a\A. y < a" + unfolding less_Sup_iff . +qed (auto elim!: allE[of _ "\A"] simp add: not_le[symmetric] Sup_upper) + +lemma le_SUP_iff: "x \ SUPR A f \ (\yi\A. y < f i)" + unfolding le_Sup_iff SUP_def by simp + +lemma Inf_le_iff: "\A \ x \ (\y>x. \a\A. y > a)" +proof safe + fix y assume "x \ \A" "y > x" + then have "y > \A" by auto + then show "\a\A. y > a" + unfolding Inf_less_iff . +qed (auto elim!: allE[of _ "\A"] simp add: not_le[symmetric] Inf_lower) + +lemma INF_le_iff: + "INFI A f \ x \ (\y>x. \i\A. y > f i)" + unfolding Inf_le_iff INF_def by simp + end - subsection {* Complete lattice on @{typ bool} *} instantiation bool :: complete_lattice diff -r 62c033d7f3d8 -r d63ec23c9125 src/HOL/Library/Extended_Real.thy --- a/src/HOL/Library/Extended_Real.thy Mon Mar 04 09:57:54 2013 +0100 +++ b/src/HOL/Library/Extended_Real.thy Wed Feb 20 12:04:42 2013 +0100 @@ -18,79 +18,6 @@ *} -lemma LIMSEQ_SUP: - fixes X :: "nat \ 'a :: {complete_linorder, linorder_topology}" - assumes "incseq X" - shows "X ----> (SUP i. X i)" - using `incseq X` - by (intro increasing_tendsto) - (auto simp: SUP_upper less_SUP_iff incseq_def eventually_sequentially intro: less_le_trans) - -lemma eventually_const: "\ trivial_limit net \ eventually (\x. P) net \ P" - by (cases P) (simp_all add: eventually_False) - -lemma (in complete_lattice) Inf_le_Sup: "A \ {} \ Inf A \ Sup A" - by (metis Sup_upper2 Inf_lower ex_in_conv) - -lemma (in complete_lattice) INF_le_SUP: "A \ {} \ INFI A f \ SUPR A f" - unfolding INF_def SUP_def by (rule Inf_le_Sup) auto - -lemma (in complete_linorder) le_Sup_iff: - "x \ Sup A \ (\ya\A. y < a)" -proof safe - fix y assume "x \ Sup A" "y < x" - then have "y < Sup A" by auto - then show "\a\A. y < a" - unfolding less_Sup_iff . -qed (auto elim!: allE[of _ "Sup A"] simp add: not_le[symmetric] Sup_upper) - -lemma (in complete_linorder) le_SUP_iff: - "x \ SUPR A f \ (\yi\A. y < f i)" - unfolding le_Sup_iff SUP_def by simp - -lemma (in complete_linorder) Inf_le_iff: - "Inf A \ x \ (\y>x. \a\A. y > a)" -proof safe - fix y assume "x \ Inf A" "y > x" - then have "y > Inf A" by auto - then show "\a\A. y > a" - unfolding Inf_less_iff . -qed (auto elim!: allE[of _ "Inf A"] simp add: not_le[symmetric] Inf_lower) - -lemma (in complete_linorder) le_INF_iff: - "INFI A f \ x \ (\y>x. \i\A. y > f i)" - unfolding Inf_le_iff INF_def by simp - -lemma (in complete_lattice) Sup_eqI: - assumes "\y. y \ A \ y \ x" - assumes "\y. (\z. z \ A \ z \ y) \ x \ y" - shows "Sup A = x" - by (metis antisym Sup_least Sup_upper assms) - -lemma (in complete_lattice) Inf_eqI: - assumes "\i. i \ A \ x \ i" - assumes "\y. (\i. i \ A \ y \ i) \ y \ x" - shows "Inf A = x" - by (metis antisym Inf_greatest Inf_lower assms) - -lemma (in complete_lattice) SUP_eqI: - "(\i. i \ A \ f i \ x) \ (\y. (\i. i \ A \ f i \ y) \ x \ y) \ (SUP i:A. f i) = x" - unfolding SUP_def by (rule Sup_eqI) auto - -lemma (in complete_lattice) INF_eqI: - "(\i. i \ A \ x \ f i) \ (\y. (\i. i \ A \ f i \ y) \ x \ y) \ (INF i:A. f i) = x" - unfolding INF_def by (rule Inf_eqI) auto - -lemma (in complete_lattice) atLeast_eq_UNIV_iff: "{x..} = UNIV \ x = bot" -proof - assume "{x..} = UNIV" - show "x = bot" - proof (rule ccontr) - assume "x \ bot" then have "bot \ {x..}" by (simp add: le_less) - then show False using `{x..} = UNIV` by simp - qed -qed auto - lemma SUPR_pair: "(SUP i : A. SUP j : B. f i j) = (SUP p : A \ B. f (fst p) (snd p))" by (rule antisym) (auto intro!: SUP_least SUP_upper2) @@ -1447,43 +1374,6 @@ by (auto simp: top_ereal_def) qed -lemma ereal_le_Sup: - fixes x :: ereal - shows "(x <= (SUP i:A. f i)) <-> (ALL y. y < x --> (EX i. i : A & y <= f i))" (is "?lhs = ?rhs") -proof- -{ assume "?rhs" - { assume "~(x <= (SUP i:A. f i))" hence "(SUP i:A. f i) (ALL y. x < y --> (EX i. i : A & f i <= y))" -(is "?lhs <-> ?rhs") -proof- -{ assume "?rhs" - { assume "~((INF i:A. f i) <= x)" hence "x < (INF i:A. f i)" by (simp add: not_le) - then obtain y where y_def: "xi\A. \j\B. f i \ g j" - assumes "\j\B. \i\A. g j \ f i" - shows "(SUP i:A. f i) = (SUP j:B. g j)" -proof (intro antisym) - show "(SUP i:A. f i) \ (SUP j:B. g j)" - using assms by (metis SUP_least SUP_upper2) - show "(SUP i:B. g i) \ (SUP j:A. f j)" - using assms by (metis SUP_least SUP_upper2) -qed - -lemma INFI_eq: - assumes "\i\A. \j\B. f i \ g j" - assumes "\j\B. \i\A. g j \ f i" - shows "(INF i:A. f i) = (INF j:B. g j)" -proof (intro antisym) - show "(INF i:A. f i) \ (INF j:B. g j)" - using assms by (metis INF_greatest INF_lower2) - show "(INF i:B. g i) \ (INF j:A. f j)" - using assms by (metis INF_greatest INF_lower2) -qed - lemma SUP_ereal_le_addI: fixes f :: "'i \ ereal" assumes "\i. f i + y \ z" and "y \ -\" diff -r 62c033d7f3d8 -r d63ec23c9125 src/HOL/Limits.thy --- a/src/HOL/Limits.thy Mon Mar 04 09:57:54 2013 +0100 +++ b/src/HOL/Limits.thy Wed Feb 20 12:04:42 2013 +0100 @@ -264,6 +264,9 @@ lemma trivial_limit_def: "trivial_limit F \ eventually (\x. False) F" by (rule eventually_False [symmetric]) +lemma eventually_const: "\ trivial_limit net \ eventually (\x. P) net \ P" + by (cases P) (simp_all add: eventually_False) + subsection {* Map function for filters *} diff -r 62c033d7f3d8 -r d63ec23c9125 src/HOL/SEQ.thy --- a/src/HOL/SEQ.thy Mon Mar 04 09:57:54 2013 +0100 +++ b/src/HOL/SEQ.thy Wed Feb 20 12:04:42 2013 +0100 @@ -322,6 +322,16 @@ shows "(\n. k) ----> l \ k = l" using trivial_limit_sequentially by (rule tendsto_const_iff) +lemma LIMSEQ_SUP: + "incseq X \ X ----> (SUP i. X i :: 'a :: {complete_linorder, linorder_topology})" + by (intro increasing_tendsto) + (auto simp: SUP_upper less_SUP_iff incseq_def eventually_sequentially intro: less_le_trans) + +lemma LIMSEQ_INF: + "decseq X \ X ----> (INF i. X i :: 'a :: {complete_linorder, linorder_topology})" + by (intro decreasing_tendsto) + (auto simp: INF_lower INF_less_iff decseq_def eventually_sequentially intro: le_less_trans) + lemma LIMSEQ_ignore_initial_segment: "f ----> a \ (\n. f (n + k)) ----> a" apply (rule topological_tendstoI) diff -r 62c033d7f3d8 -r d63ec23c9125 src/HOL/Set_Interval.thy --- a/src/HOL/Set_Interval.thy Mon Mar 04 09:57:54 2013 +0100 +++ b/src/HOL/Set_Interval.thy Wed Feb 20 12:04:42 2013 +0100 @@ -330,6 +330,20 @@ shows "{a ..< b} = {c ..< d} \ a = c \ b = d" using atLeastLessThan_inj assms by auto +context complete_lattice +begin + +lemma atLeast_eq_UNIV_iff: "{x..} = UNIV \ x = bot" + by (auto simp: set_eq_iff intro: le_bot) + +lemma atMost_eq_UNIV_iff: "{..x} = UNIV \ x = top" + by (auto simp: set_eq_iff intro: top_le) + +lemma atLeastAtMost_eq_UNIV_iff: "{x..y} = UNIV \ (x = bot \ y = top)" + by (auto simp: set_eq_iff intro: top_le le_bot) + +end + subsubsection {* Intersection *} context linorder