# HG changeset patch # User paulson # Date 1475078461 -3600 # Node ID 354808e9f44b4a06852d867e07a7c46b94dc8573 # Parent cdc1e59aa51378fbf210999cf7d546fe89faeac2 new material connected with HOL Light measure theory, plus more rationalisation diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Analysis/Borel_Space.thy --- a/src/HOL/Analysis/Borel_Space.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Analysis/Borel_Space.thy Wed Sep 28 17:01:01 2016 +0100 @@ -101,7 +101,7 @@ assumes mono: "mono_on f A" and deriv: "(f has_real_derivative D) (at x)" assumes "x \ interior A" shows "D \ 0" -proof (rule tendsto_le_const) +proof (rule tendsto_lowerbound) let ?A' = "(\y. y - x) ` interior A" from deriv show "((\h. (f (x + h) - f x) / h) \ D) (at 0)" by (simp add: field_has_derivative_at has_field_derivative_def) diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Analysis/Bounded_Linear_Function.thy --- a/src/HOL/Analysis/Bounded_Linear_Function.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Analysis/Bounded_Linear_Function.thy Wed Sep 28 17:01:01 2016 +0100 @@ -328,7 +328,7 @@ have tendsto_v: "(\m. norm (X n x - X m x)) \ norm (X n x - Blinfun v x)" by (auto intro!: tendsto_intros Bv) show "norm ((X n - Blinfun v) x) \ r' * norm x" - by (auto intro!: tendsto_ge_const tendsto_v ev_le simp: blinfun.bilinear_simps) + by (auto intro!: tendsto_upperbound tendsto_v ev_le simp: blinfun.bilinear_simps) qed (simp add: \0 < r'\ less_imp_le) thus "norm (X n - Blinfun v) < r" by (metis \r' < r\ le_less_trans) diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Analysis/Derivative.thy --- a/src/HOL/Analysis/Derivative.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Analysis/Derivative.thy Wed Sep 28 17:01:01 2016 +0100 @@ -1998,7 +1998,7 @@ by (auto simp add: algebra_simps) qed ultimately show "norm (f n x - f n y - (g x - g y)) \ e * norm (x - y)" - by (rule tendsto_ge_const[OF trivial_limit_sequentially]) + by (simp add: tendsto_upperbound) qed qed have "\x\s. ((\n. f n x) \ g x) sequentially \ (g has_derivative g' x) (at x within s)" @@ -2667,7 +2667,7 @@ qed hence "eventually (\y. (f y - f c) / (y - c) \ (f x - f c) / (x - c)) (at c within ?A')" by (blast intro: filter_leD at_le) - ultimately have "f' \ (f x - f c) / (x - c)" by (rule tendsto_ge_const) + ultimately have "f' \ (f x - f c) / (x - c)" by (simp add: tendsto_upperbound) thus ?thesis using xc by (simp add: field_simps) next assume xc: "x < c" @@ -2691,7 +2691,7 @@ qed hence "eventually (\y. (f y - f c) / (y - c) \ (f x - f c) / (x - c)) (at c within ?A')" by (blast intro: filter_leD at_le) - ultimately have "f' \ (f x - f c) / (x - c)" by (rule tendsto_le_const) + ultimately have "f' \ (f x - f c) / (x - c)" by (simp add: tendsto_lowerbound) thus ?thesis using xc by (simp add: field_simps) qed simp_all diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy --- a/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Analysis/Equivalence_Lebesgue_Henstock_Integration.thy Wed Sep 28 17:01:01 2016 +0100 @@ -1870,7 +1870,7 @@ have F_mono: "a \ x \ x \ y \ F x \ F y" for x y using f nonneg by (intro DERIV_nonneg_imp_nondecreasing[of x y F]) (auto intro: order_trans) then have F_le_T: "a \ x \ F x \ T" for x - by (intro tendsto_le_const[OF _ lim]) + by (intro tendsto_lowerbound[OF lim]) (auto simp: trivial_limit_at_top_linorder eventually_at_top_linorder) have "(SUP i::nat. ?f i x) = ?fR x" for x diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Analysis/Euclidean_Space.thy --- a/src/HOL/Analysis/Euclidean_Space.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Analysis/Euclidean_Space.thy Wed Sep 28 17:01:01 2016 +0100 @@ -93,6 +93,11 @@ by (auto intro!: exI[of _ "\i\Basis. f i *\<^sub>R i"]) qed auto +lemma (in euclidean_space) bchoice_Basis_iff: + fixes P :: "'a \ real \ bool" + shows "(\i\Basis. \x\A. P i x) \ (\x. \i\Basis. inner x i \ A \ P i (inner x i))" +by (simp add: choice_Basis_iff Bex_def) + lemma (in euclidean_space) euclidean_representation_setsum_fun: "(\x. \b\Basis. inner (f x) b *\<^sub>R b) = f" by (rule ext) (simp add: euclidean_representation_setsum) diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Analysis/Gamma_Function.thy --- a/src/HOL/Analysis/Gamma_Function.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Analysis/Gamma_Function.thy Wed Sep 28 17:01:01 2016 +0100 @@ -1812,13 +1812,13 @@ shows "G x = Gamma x" proof (rule antisym) show "G x \ Gamma x" - proof (rule tendsto_ge_const) + proof (rule tendsto_upperbound) from G_lower[of x] show "eventually (\n. Gamma_series x n \ G x) sequentially" using eventually_ge_at_top[of "1::nat"] x by (auto elim!: eventually_mono) qed (simp_all add: Gamma_series_LIMSEQ) next show "G x \ Gamma x" - proof (rule tendsto_le_const) + proof (rule tendsto_lowerbound) have "(\n. Gamma_series x n * (1 + x / real n)) \ Gamma x * (1 + 0)" by (rule tendsto_intros real_tendsto_divide_at_top Gamma_series_LIMSEQ filterlim_real_sequentially)+ diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Deriv.thy --- a/src/HOL/Deriv.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Deriv.thy Wed Sep 28 17:01:01 2016 +0100 @@ -1563,12 +1563,12 @@ and lim: "(f \ flim) at_bot" shows "flim < f b" proof - - have "flim \ f (b - 1)" - apply (rule tendsto_ge_const [OF _ lim]) - apply (auto simp: trivial_limit_at_bot_linorder eventually_at_bot_linorder) + have "\N. \n\N. f n \ f (b - 1)" apply (rule_tac x="b - 2" in exI) apply (force intro: order.strict_implies_order DERIV_pos_imp_increasing [where f=f] assms) done + then have "flim \ f (b - 1)" + by (auto simp: trivial_limit_at_bot_linorder eventually_at_bot_linorder tendsto_upperbound [OF lim]) also have "\ < f b" by (force intro: DERIV_pos_imp_increasing [where f=f] assms) finally show ?thesis . diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Fields.thy --- a/src/HOL/Fields.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Fields.thy Wed Sep 28 17:01:01 2016 +0100 @@ -1192,6 +1192,20 @@ finally show ?thesis . qed +text\For creating values between @{term u} and @{term v}.\ +lemma scaling_mono: + assumes "u \ v" "0 \ r" "r \ s" + shows "u + r * (v - u) / s \ v" +proof - + have "r/s \ 1" using assms + using divide_le_eq_1 by fastforce + then have "(r/s) * (v - u) \ 1 * (v - u)" + apply (rule mult_right_mono) + using assms by simp + then show ?thesis + by (simp add: field_simps) +qed + end text \Min/max Simplification Rules\ diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Groups_Big.thy --- a/src/HOL/Groups_Big.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Groups_Big.thy Wed Sep 28 17:01:01 2016 +0100 @@ -47,6 +47,9 @@ lemma insert_remove: "finite A \ F g (insert x A) = g x \<^bold>* F g (A - {x})" by (cases "x \ A") (simp_all add: remove insert_absorb) +lemma insert_if: "finite A \ F g (insert x A) = (if x \ A then F g A else g x \<^bold>* F g A)" + by (cases "x \ A") (simp_all add: insert_absorb) + lemma neutral: "\x\A. g x = \<^bold>1 \ F g A = \<^bold>1" by (induct A rule: infinite_finite_induct) simp_all @@ -1288,4 +1291,22 @@ qed qed +lemma setsum_image_le: + fixes g :: "'a \ 'b::ordered_ab_group_add" + assumes "finite I" "\i. i \ I \ 0 \ g(f i)" + shows "setsum g (f ` I) \ setsum (g \ f) I" + using assms +proof induction + case empty + then show ?case by auto +next + case (insert x F) then + have "setsum g (f ` insert x F) = setsum g (insert (f x) (f ` F))" by simp + also have "\ \ g (f x) + setsum g (f ` F)" + by (simp add: insert setsum.insert_if) + also have "\ \ setsum (g \ f) (insert x F)" + using insert by auto + finally show ?case . +qed + end diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Library/Extended_Real.thy --- a/src/HOL/Library/Extended_Real.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Library/Extended_Real.thy Wed Sep 28 17:01:01 2016 +0100 @@ -3856,7 +3856,7 @@ assumes "eventually (\x. f x \ 0) F" shows "((\x. inverse (f x)) \ inverse c) F" by (cases "F = bot") - (auto intro!: tendsto_le_const[of F] assms + (auto intro!: tendsto_lowerbound assms continuous_on_tendsto_compose[OF continuous_on_inverse_ereal]) diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Limits.thy --- a/src/HOL/Limits.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Limits.thy Wed Sep 28 17:01:01 2016 +0100 @@ -2368,7 +2368,7 @@ fixes f :: "real \ real" assumes ev: "b < x" "\ x' \ { b <..< x}. 0 \ f x'" and "isCont f x" shows "0 \ f x" -proof (rule tendsto_le_const) +proof (rule tendsto_lowerbound) show "(f \ f x) (at_left x)" using \isCont f x\ by (simp add: filterlim_at_split isCont_def) show "eventually (\x. 0 \ f x) (at_left x)" diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Order_Relation.thy --- a/src/HOL/Order_Relation.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Order_Relation.thy Wed Sep 28 17:01:01 2016 +0100 @@ -397,6 +397,18 @@ ultimately show ?thesis unfolding R_def by blast qed +text\A transitive relation is well-founded if all initial segments are finite.\ +corollary wf_finite_segments: + assumes "irrefl r" and "trans r" and "\x. finite {y. (y, x) \ r}" + shows "wf (r)" +proof (clarsimp simp: trans_wf_iff wf_iff_acyclic_if_finite converse_def assms) + fix a + have "trans (r \ ({x. (x, a) \ r} \ {x. (x, a) \ r}))" + using assms unfolding trans_def Field_def by blast + then show "acyclic (r \ {x. (x, a) \ r} \ {x. (x, a) \ r})" + using assms acyclic_def assms irrefl_def by fastforce +qed + text \The next lemma is a variation of \wf_eq_minimal\ from Wellfounded, allowing one to assume the set included in the field.\ diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Probability/Helly_Selection.thy --- a/src/HOL/Probability/Helly_Selection.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Probability/Helly_Selection.thy Wed Sep 28 17:01:01 2016 +0100 @@ -108,7 +108,7 @@ moreover have "(\n. f (d n) x) \ F x" if cts: "continuous (at x) F" for x proof (rule limsup_le_liminf_real) show "limsup (\n. f (d n) x) \ F x" - proof (rule tendsto_le_const) + proof (rule tendsto_lowerbound) show "(F \ ereal (F x)) (at_right x)" using cts unfolding continuous_at_split by (auto simp: continuous_within) show "\\<^sub>F i in at_right x. limsup (\n. f (d n) x) \ F i" @@ -128,7 +128,7 @@ qed qed simp show "F x \ liminf (\n. f (d n) x)" - proof (rule tendsto_ge_const) + proof (rule tendsto_upperbound) show "(F \ ereal (F x)) (at_left x)" using cts unfolding continuous_at_split by (auto simp: continuous_within) show "\\<^sub>F i in at_left x. F i \ liminf (\n. f (d n) x)" @@ -214,7 +214,7 @@ have "(\k. ?\ k {..b}) \ F b" using b(2) lim_F unfolding f_def cdf_def o_def by auto then have "1 - \ \ F b" - proof (rule tendsto_le_const[OF sequentially_bot], intro always_eventually allI) + proof (rule tendsto_lowerbound, intro always_eventually allI) fix k have "1 - \ < ?\ k {a<..b}" using ab by auto @@ -222,20 +222,20 @@ by (auto intro!: \.finite_measure_mono) finally show "1 - \ \ ?\ k {..b}" by (rule less_imp_le) - qed + qed (rule sequentially_bot) then show "\b. \x\b. 1 - \ \ F x" using F unfolding mono_def by (metis order.trans) have "(\k. ?\ k {..a}) \ F a" using a(2) lim_F unfolding f_def cdf_def o_def by auto then have Fa: "F a \ \" - proof (rule tendsto_ge_const[OF sequentially_bot], intro always_eventually allI) + proof (rule tendsto_upperbound, intro always_eventually allI) fix k have "?\ k {..a} + ?\ k {a<..b} \ 1" by (subst \.finite_measure_Union[symmetric]) auto then show "?\ k {..a} \ \" using ab[of k] by simp - qed + qed (rule sequentially_bot) then show "\a. \x\a. F x \ \" using F unfolding mono_def by (metis order.trans) qed diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Probability/Weak_Convergence.thy --- a/src/HOL/Probability/Weak_Convergence.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Probability/Weak_Convergence.thy Wed Sep 28 17:01:01 2016 +0100 @@ -200,7 +200,7 @@ using \(2) by (auto intro: tendsto_within_subset simp: continuous_at) show "limsup (\n. \.I n \) \ M.I \" using \ - by (intro tendsto_le_const[OF trivial_limit_at_right_real **]) + by (intro tendsto_lowerbound[OF **]) (auto intro!: exI[of _ 1] * simp: eventually_at_right[of _ 1]) qed @@ -391,12 +391,12 @@ } note ** = this have "limsup (\n. cdf (M_seq n) x) \ cdf M x" - proof (rule tendsto_le_const) + proof (rule tendsto_lowerbound) show "\\<^sub>F i in at_right x. limsup (\xa. ereal (cdf (M_seq xa) x)) \ ereal (cdf M i)" by (subst eventually_at_right[of _ "x + 1"]) (auto simp: * intro: exI [of _ "x+1"]) qed (insert cdf_is_right_cont, auto simp: continuous_within) moreover have "cdf M x \ liminf (\n. cdf (M_seq n) x)" - proof (rule tendsto_ge_const) + proof (rule tendsto_upperbound) show "\\<^sub>F i in at_left x. ereal (cdf M i) \ liminf (\xa. ereal (cdf (M_seq xa) x))" by (subst eventually_at_left[of "x - 1"]) (auto simp: ** intro: exI [of _ "x-1"]) qed (insert left_cont, auto simp: continuous_within) diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Series.thy --- a/src/HOL/Series.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Series.thy Wed Sep 28 17:01:01 2016 +0100 @@ -26,12 +26,16 @@ (binder "\" 10) where "suminf f = (THE s. f sums s)" +text\Variants of the definition\ lemma sums_def': "f sums s \ (\n. \i = 0..n. f i) \ s" apply (simp add: sums_def) apply (subst LIMSEQ_Suc_iff [symmetric]) apply (simp only: lessThan_Suc_atMost atLeast0AtMost) done +lemma sums_def_le: "f sums s \ (\n. \i\n. f i) \ s" + by (simp add: sums_def' atMost_atLeast0) + subsection \Infinite summability on topological monoids\ diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Set.thy --- a/src/HOL/Set.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Set.thy Wed Sep 28 17:01:01 2016 +0100 @@ -1858,6 +1858,9 @@ definition disjnt :: "'a set \ 'a set \ bool" where "disjnt A B \ A \ B = {}" +lemma disjnt_self_iff_empty [simp]: "disjnt S S \ S = {}" + by (auto simp: disjnt_def) + lemma disjnt_iff: "disjnt A B \ (\x. \ (x \ A \ x \ B))" by (force simp: disjnt_def) diff -r cdc1e59aa513 -r 354808e9f44b src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Mon Sep 26 07:56:54 2016 +0200 +++ b/src/HOL/Topological_Spaces.thy Wed Sep 28 17:01:01 2016 +0100 @@ -884,19 +884,19 @@ by (simp add: eventually_False) qed -lemma tendsto_le_const: +lemma tendsto_lowerbound: fixes f :: "'a \ 'b::linorder_topology" - assumes F: "\ trivial_limit F" - and x: "(f \ x) F" - and ev: "eventually (\i. a \ f i) F" + assumes x: "(f \ x) F" + and ev: "eventually (\i. a \ f i) F" + and F: "\ trivial_limit F" shows "a \ x" using F x tendsto_const ev by (rule tendsto_le) -lemma tendsto_ge_const: +lemma tendsto_upperbound: fixes f :: "'a \ 'b::linorder_topology" - assumes F: "\ trivial_limit F" - and x: "(f \ x) F" - and ev: "eventually (\i. a \ f i) F" + assumes x: "(f \ x) F" + and ev: "eventually (\i. a \ f i) F" + and F: "\ trivial_limit F" shows "a \ x" by (rule tendsto_le [OF F tendsto_const x ev]) @@ -1256,7 +1256,7 @@ lemma LIMSEQ_le_const: "X \ x \ \N. \n\N. a \ X n \ a \ x" for a x :: "'a::linorder_topology" - using tendsto_le_const[of sequentially X x a] by (simp add: eventually_sequentially) + by (simp add: eventually_at_top_linorder tendsto_lowerbound) lemma LIMSEQ_le: "X \ x \ Y \ y \ \N. \n\N. X n \ Y n \ x \ y" for x y :: "'a::linorder_topology"