diff -r 501200635659 -r 3de230ed0547 src/HOL/Limits.thy --- a/src/HOL/Limits.thy Thu Jan 31 11:31:22 2013 +0100 +++ b/src/HOL/Limits.thy Thu Jan 31 11:31:27 2013 +0100 @@ -469,6 +469,12 @@ apply (erule le_less_trans [OF dist_triangle]) done +lemma eventually_nhds_order: + "eventually P (nhds (a::'a::linorder_topology)) \ + (\S. open_interval S \ a \ S \ (\z\S. P z))" + (is "_ \ ?rhs") + unfolding eventually_nhds by (auto dest!: open_orderD dest: open_interval_imp_open) + lemma nhds_neq_bot [simp]: "nhds a \ bot" unfolding trivial_limit_def eventually_nhds by simp @@ -901,6 +907,36 @@ using le_less_trans by (rule eventually_elim2) qed +lemma increasing_tendsto: + fixes f :: "_ \ 'a::linorder_topology" + assumes bdd: "eventually (\n. f n \ l) F" + and en: "\x. x < l \ eventually (\n. x < f n) F" + shows "(f ---> l) F" +proof (rule topological_tendstoI) + fix S assume "open S" "l \ S" + then show "eventually (\x. f x \ S) F" + proof (induct rule: open_order_induct) + case (greaterThanLessThan a b) with en bdd show ?case + by (auto elim!: eventually_elim2) + qed (insert en bdd, auto elim!: eventually_elim1) +qed + +lemma decreasing_tendsto: + fixes f :: "_ \ 'a::linorder_topology" + assumes bdd: "eventually (\n. l \ f n) F" + and en: "\x. l < x \ eventually (\n. f n < x) F" + shows "(f ---> l) F" +proof (rule topological_tendstoI) + fix S assume "open S" "l \ S" + then show "eventually (\x. f x \ S) F" + proof (induct rule: open_order_induct) + case (greaterThanLessThan a b) + with en have "eventually (\n. f n < b) F" by auto + with bdd show ?case + by eventually_elim (insert greaterThanLessThan, auto) + qed (insert en bdd, auto elim!: eventually_elim1) +qed + subsubsection {* Distance and norms *} lemma tendsto_dist [tendsto_intros]: @@ -1002,22 +1038,25 @@ by (simp add: tendsto_const) qed -lemma real_tendsto_sandwich: - fixes f g h :: "'a \ real" +lemma tendsto_sandwich: + fixes f g h :: "'a \ 'b::linorder_topology" assumes ev: "eventually (\n. f n \ g n) net" "eventually (\n. g n \ h n) net" assumes lim: "(f ---> c) net" "(h ---> c) net" shows "(g ---> c) net" -proof - - have "((\n. g n - f n) ---> 0) net" - proof (rule metric_tendsto_imp_tendsto) - show "eventually (\n. dist (g n - f n) 0 \ dist (h n - f n) 0) net" - using ev by (rule eventually_elim2) (simp add: dist_real_def) - show "((\n. h n - f n) ---> 0) net" - using tendsto_diff[OF lim(2,1)] by simp - qed - from tendsto_add[OF this lim(1)] show ?thesis by simp +proof (rule topological_tendstoI) + fix S assume "open S" "c \ S" + from open_orderD[OF this] obtain T where "open_interval T" "c \ T" "T \ S" by auto + with lim[THEN topological_tendstoD, of T] + have "eventually (\x. f x \ T) net" "eventually (\x. h x \ T) net" + by (auto dest: open_interval_imp_open) + with ev have "eventually (\x. g x \ T) net" + by eventually_elim (insert `open_interval T`, auto dest: open_intervalD) + with `T \ S` show "eventually (\x. g x \ S) net" + by (auto elim: eventually_elim1) qed +lemmas real_tendsto_sandwich = tendsto_sandwich[where 'b=real] + subsubsection {* Linear operators and multiplication *} lemma (in bounded_linear) tendsto: @@ -1082,29 +1121,33 @@ by (simp add: tendsto_const) qed -lemma tendsto_le_const: - fixes f :: "_ \ real" +lemma tendsto_le: + fixes f g :: "'a \ 'b::linorder_topology" assumes F: "\ trivial_limit F" - assumes x: "(f ---> x) F" and a: "eventually (\x. a \ f x) F" - shows "a \ x" + assumes x: "(f ---> x) F" and y: "(g ---> y) F" + assumes ev: "eventually (\x. g x \ f x) F" + shows "y \ x" proof (rule ccontr) - assume "\ a \ x" - with x have "eventually (\x. f x < a) F" - by (auto simp add: tendsto_def elim!: allE[of _ "{..< a}"]) - with a have "eventually (\x. False) F" - by eventually_elim auto + assume "\ y \ x" + then have "x < y" by simp + from less_separate[OF this] obtain a b where xy: "x \ {.. {b <..}" "{.. {b<..} = {}" + by auto + then have less: "\x y. x < a \ b < y \ x < y" + by auto + from x[THEN topological_tendstoD, of "{..x. f x \ {..x. g x \ {b <..}) F" by auto + with ev have "eventually (\x. False) F" + by eventually_elim (auto dest!: less) with F show False by (simp add: eventually_False) qed -lemma tendsto_le: - fixes f g :: "_ \ real" +lemma tendsto_le_const: + fixes f :: "'a \ 'b::linorder_topology" assumes F: "\ trivial_limit F" - assumes x: "(f ---> x) F" and y: "(g ---> y) F" - assumes ev: "eventually (\x. g x \ f x) F" - shows "y \ x" - using tendsto_le_const[OF F tendsto_diff[OF x y], of 0] ev - by (simp add: sign_simps) + assumes x: "(f ---> x) F" and a: "eventually (\x. a \ f x) F" + shows "a \ x" + using F x tendsto_const a by (rule tendsto_le) subsubsection {* Inverse and division *}