src/HOL/Analysis/Extended_Real_Limits.thy
changeset 69683 8b3458ca0762
parent 69681 689997a8a582
child 69722 b5163b2132c5
equal deleted inserted replaced
69682:500a7acdccd4 69683:8b3458ca0762
   355   apply auto
   355   apply auto
   356   apply (metis (no_types, lifting) INF_insert centre_in_ball greaterThan_iff image_cong inf_commute insert_Diff)
   356   apply (metis (no_types, lifting) INF_insert centre_in_ball greaterThan_iff image_cong inf_commute insert_Diff)
   357   done
   357   done
   358 
   358 
   359 
   359 
   360 subsection%important \<open>Extended-Real.thy\<close> (*FIX ME change title *)
   360 subsection \<open>Extended-Real.thy\<close> (*FIX ME change title *)
   361 
   361 
   362 lemma sum_constant_ereal:
   362 lemma sum_constant_ereal:
   363   fixes a::ereal
   363   fixes a::ereal
   364   shows "(\<Sum>i\<in>I. a) = a * card I"
   364   shows "(\<Sum>i\<in>I. a) = a * card I"
   365 apply (cases "finite I", induct set: finite, simp_all)
   365 apply (cases "finite I", induct set: finite, simp_all)
   389     done
   389     done
   390   then show ?thesis by (simp only: setcompr_eq_image[symmetric])
   390   then show ?thesis by (simp only: setcompr_eq_image[symmetric])
   391 qed
   391 qed
   392 
   392 
   393 
   393 
   394 subsubsection%important \<open>Continuity of addition\<close>
   394 subsubsection \<open>Continuity of addition\<close>
   395 
   395 
   396 text \<open>The next few lemmas remove an unnecessary assumption in \<open>tendsto_add_ereal\<close>, culminating
   396 text \<open>The next few lemmas remove an unnecessary assumption in \<open>tendsto_add_ereal\<close>, culminating
   397 in \<open>tendsto_add_ereal_general\<close> which essentially says that the addition
   397 in \<open>tendsto_add_ereal_general\<close> which essentially says that the addition
   398 is continuous on ereal times ereal, except at \<open>(-\<infinity>, \<infinity>)\<close> and \<open>(\<infinity>, -\<infinity>)\<close>.
   398 is continuous on ereal times ereal, except at \<open>(-\<infinity>, \<infinity>)\<close> and \<open>(\<infinity>, -\<infinity>)\<close>.
   399 It is much more convenient in many situations, see for instance the proof of
   399 It is much more convenient in many situations, see for instance the proof of
   520   case (MInf)
   520   case (MInf)
   521   then have "y \<noteq> \<infinity>" using assms by simp
   521   then have "y \<noteq> \<infinity>" using assms by simp
   522   then show ?thesis using tendsto_add_ereal_MInf MInf f g by (metis ereal_MInfty_eq_plus)
   522   then show ?thesis using tendsto_add_ereal_MInf MInf f g by (metis ereal_MInfty_eq_plus)
   523 qed
   523 qed
   524 
   524 
   525 subsubsection%important \<open>Continuity of multiplication\<close>
   525 subsubsection \<open>Continuity of multiplication\<close>
   526 
   526 
   527 text \<open>In the same way as for addition, we prove that the multiplication is continuous on
   527 text \<open>In the same way as for addition, we prove that the multiplication is continuous on
   528 ereal times ereal, except at \<open>(\<infinity>, 0)\<close> and \<open>(-\<infinity>, 0)\<close> and \<open>(0, \<infinity>)\<close> and \<open>(0, -\<infinity>)\<close>,
   528 ereal times ereal, except at \<open>(\<infinity>, 0)\<close> and \<open>(-\<infinity>, 0)\<close> and \<open>(0, \<infinity>)\<close> and \<open>(0, -\<infinity>)\<close>,
   529 starting with specific situations.\<close>
   529 starting with specific situations.\<close>
   530 
   530 
   657   assumes "(f \<longlongrightarrow> l) F" "\<not> (l=0 \<and> abs(c) = \<infinity>)"
   657   assumes "(f \<longlongrightarrow> l) F" "\<not> (l=0 \<and> abs(c) = \<infinity>)"
   658   shows "((\<lambda>x. c * f x) \<longlongrightarrow> c * l) F"
   658   shows "((\<lambda>x. c * f x) \<longlongrightarrow> c * l) F"
   659 by (cases "c = 0", auto simp add: assms tendsto_mult_ereal)
   659 by (cases "c = 0", auto simp add: assms tendsto_mult_ereal)
   660 
   660 
   661 
   661 
   662 subsubsection%important \<open>Continuity of division\<close>
   662 subsubsection \<open>Continuity of division\<close>
   663 
   663 
   664 lemma tendsto_inverse_ereal_PInf:
   664 lemma tendsto_inverse_ereal_PInf:
   665   fixes u::"_ \<Rightarrow> ereal"
   665   fixes u::"_ \<Rightarrow> ereal"
   666   assumes "(u \<longlongrightarrow> \<infinity>) F"
   666   assumes "(u \<longlongrightarrow> \<infinity>) F"
   667   shows "((\<lambda>x. 1/ u x) \<longlongrightarrow> 0) F"
   667   shows "((\<lambda>x. 1/ u x) \<longlongrightarrow> 0) F"
   760   moreover have "l * (1/m) = l/m" by (simp add: divide_ereal_def)
   760   moreover have "l * (1/m) = l/m" by (simp add: divide_ereal_def)
   761   ultimately show ?thesis unfolding h_def using Lim_transform_eventually by auto
   761   ultimately show ?thesis unfolding h_def using Lim_transform_eventually by auto
   762 qed
   762 qed
   763 
   763 
   764 
   764 
   765 subsubsection%important \<open>Further limits\<close>
   765 subsubsection \<open>Further limits\<close>
   766 
   766 
   767 text \<open>The assumptions of @{thm tendsto_diff_ereal} are too strong, we weaken them here.\<close>
   767 text \<open>The assumptions of @{thm tendsto_diff_ereal} are too strong, we weaken them here.\<close>
   768 
   768 
   769 lemma tendsto_diff_ereal_general [tendsto_intros]:
   769 lemma tendsto_diff_ereal_general [tendsto_intros]:
   770   fixes u v::"'a \<Rightarrow> ereal"
   770   fixes u v::"'a \<Rightarrow> ereal"
   956 lemma ereal_minus_real_tendsto_MInf [tendsto_intros]:
   956 lemma ereal_minus_real_tendsto_MInf [tendsto_intros]:
   957   "(\<lambda>x. ereal (- real x)) \<longlonglongrightarrow> - \<infinity>"
   957   "(\<lambda>x. ereal (- real x)) \<longlonglongrightarrow> - \<infinity>"
   958 by (subst uminus_ereal.simps(1)[symmetric], intro tendsto_intros)
   958 by (subst uminus_ereal.simps(1)[symmetric], intro tendsto_intros)
   959 
   959 
   960 
   960 
   961 subsection%important \<open>Extended-Nonnegative-Real.thy\<close> (*FIX title *)
   961 subsection \<open>Extended-Nonnegative-Real.thy\<close> (*FIX title *)
   962 
   962 
   963 lemma tendsto_diff_ennreal_general [tendsto_intros]:
   963 lemma tendsto_diff_ennreal_general [tendsto_intros]:
   964   fixes u v::"'a \<Rightarrow> ennreal"
   964   fixes u v::"'a \<Rightarrow> ennreal"
   965   assumes "(u \<longlongrightarrow> l) F" "(v \<longlongrightarrow> m) F" "\<not>(l = \<infinity> \<and> m = \<infinity>)"
   965   assumes "(u \<longlongrightarrow> l) F" "(v \<longlongrightarrow> m) F" "\<not>(l = \<infinity> \<and> m = \<infinity>)"
   966   shows "((\<lambda>n. u n - v n) \<longlongrightarrow> l - m) F"
   966   shows "((\<lambda>n. u n - v n) \<longlongrightarrow> l - m) F"
   985   ultimately show ?thesis
   985   ultimately show ?thesis
   986     by auto
   986     by auto
   987 qed
   987 qed
   988 
   988 
   989 
   989 
   990 subsection%important \<open>monoset\<close> (*FIX ME title *)
   990 subsection \<open>monoset\<close> (*FIX ME title *)
   991 
   991 
   992 definition (in order) mono_set:
   992 definition (in order) mono_set:
   993   "mono_set S \<longleftrightarrow> (\<forall>x y. x \<le> y \<longrightarrow> x \<in> S \<longrightarrow> y \<in> S)"
   993   "mono_set S \<longleftrightarrow> (\<forall>x y. x \<le> y \<longrightarrow> x \<in> S \<longrightarrow> y \<in> S)"
   994 
   994 
   995 lemma (in order) mono_greaterThan [intro, simp]: "mono_set {B<..}" unfolding mono_set by auto
   995 lemma (in order) mono_greaterThan [intro, simp]: "mono_set {B<..}" unfolding mono_set by auto
  1757   ultimately show "(SUP n. INF n\<in>{n..}. max 0 (u n - v n))
  1757   ultimately show "(SUP n. INF n\<in>{n..}. max 0 (u n - v n))
  1758             \<le> max 0 ((INF x. max 0 (Sup (u ` {x..}))) - (INF x. max 0 (Sup (v ` {x..}))))"
  1758             \<le> max 0 ((INF x. max 0 (Sup (u ` {x..}))) - (INF x. max 0 (Sup (v ` {x..}))))"
  1759     by (auto simp: * ereal_diff_positive max.absorb2 liminf_SUP_INF[symmetric] limsup_INF_SUP[symmetric] ereal_liminf_limsup_minus)
  1759     by (auto simp: * ereal_diff_positive max.absorb2 liminf_SUP_INF[symmetric] limsup_INF_SUP[symmetric] ereal_liminf_limsup_minus)
  1760 qed
  1760 qed
  1761 
  1761 
  1762 subsection%important "Relate extended reals and the indicator function"
  1762 subsection "Relate extended reals and the indicator function"
  1763 
  1763 
  1764 lemma ereal_indicator_le_0: "(indicator S x::ereal) \<le> 0 \<longleftrightarrow> x \<notin> S"
  1764 lemma ereal_indicator_le_0: "(indicator S x::ereal) \<le> 0 \<longleftrightarrow> x \<notin> S"
  1765   by (auto split: split_indicator simp: one_ereal_def)
  1765   by (auto split: split_indicator simp: one_ereal_def)
  1766 
  1766 
  1767 lemma ereal_indicator: "ereal (indicator A x) = indicator A x"
  1767 lemma ereal_indicator: "ereal (indicator A x) = indicator A x"