# HG changeset patch # User hoelzl # Date 1454997872 -3600 # Node ID 7c288c0c7300c14307e571dbe7638a3eecb98da2 # Parent 4a35e3945cab1008f435e92e945bba51790fca0d add tendsto_add_ereal_nonneg diff -r 4a35e3945cab -r 7c288c0c7300 src/HOL/Library/Extended_Real.thy --- a/src/HOL/Library/Extended_Real.thy Tue Feb 09 07:04:20 2016 +0100 +++ b/src/HOL/Library/Extended_Real.thy Tue Feb 09 07:04:32 2016 +0100 @@ -2702,6 +2702,37 @@ by (simp add: x' y' cong: filterlim_cong) qed +lemma tendsto_add_ereal_nonneg: + fixes x y :: "ereal" + assumes "x \ -\" "y \ -\" "(f \ x) F" "(g \ y) F" + shows "((\x. f x + g x) \ x + y) F" +proof cases + assume "x = \ \ y = \" + moreover + { fix y :: ereal and f g :: "'a \ ereal" assume "y \ -\" "(f \ \) F" "(g \ y) F" + then obtain y' where "-\ < y'" "y' < y" + using dense[of "-\" y] by auto + have "((\x. f x + g x) \ \) F" + proof (rule tendsto_sandwich) + have "\\<^sub>F x in F. y' < g x" + using order_tendstoD(1)[OF \(g \ y) F\ \y' < y\] by auto + then show "\\<^sub>F x in F. f x + y' \ f x + g x" + by eventually_elim (auto intro!: add_mono) + show "\\<^sub>F n in F. f n + g n \ \" "((\n. \) \ \) F" + by auto + show "((\x. f x + y') \ \) F" + using tendsto_cadd_ereal[of y' \ f F] \(f \ \) F\ \-\ < y'\ by auto + qed } + note this[of y f g] this[of x g f] + ultimately show ?thesis + using assms by (auto simp: add_ac) +next + assume "\ (x = \ \ y = \)" + with assms tendsto_add_ereal[of x y f F g] + show ?thesis + by auto +qed + lemma ereal_inj_affinity: fixes m t :: ereal assumes "\m\ \ \"