src/HOL/Hyperreal/Lim.thy
changeset 15086 e6a2a98d5ef5
parent 15080 7912ace86f31
child 15131 c69542757a4d
equal deleted inserted replaced
15085:5693a977a767 15086:e6a2a98d5ef5
   142 proof (simp add: linorder_neq_iff LIM_eq, elim disjE)
   142 proof (simp add: linorder_neq_iff LIM_eq, elim disjE)
   143   assume k: "k < L"
   143   assume k: "k < L"
   144   show "\<exists>r. 0 < r \<and>
   144   show "\<exists>r. 0 < r \<and>
   145         (\<forall>s. 0 < s \<longrightarrow> (\<exists>x. (x < a \<or> a < x) \<and> \<bar>x-a\<bar> < s) \<and> \<not> \<bar>k-L\<bar> < r)"
   145         (\<forall>s. 0 < s \<longrightarrow> (\<exists>x. (x < a \<or> a < x) \<and> \<bar>x-a\<bar> < s) \<and> \<not> \<bar>k-L\<bar> < r)"
   146   proof (intro exI conjI strip)
   146   proof (intro exI conjI strip)
   147     show "0 < L-k" by (simp add: k)
   147     show "0 < L-k" by (simp add: k compare_rls)
   148     fix s :: real
   148     fix s :: real
   149     assume s: "0<s"
   149     assume s: "0<s"
   150     { from s show "s/2 + a < a \<or> a < s/2 + a" by arith
   150     { from s show "s/2 + a < a \<or> a < s/2 + a" by arith
   151      next
   151      next
   152       from s show "\<bar>s / 2 + a - a\<bar> < s" by (simp add: abs_if) 
   152       from s show "\<bar>s / 2 + a - a\<bar> < s" by (simp add: abs_if) 
   156 next
   156 next
   157   assume k: "L < k"
   157   assume k: "L < k"
   158   show "\<exists>r. 0 < r \<and>
   158   show "\<exists>r. 0 < r \<and>
   159         (\<forall>s. 0 < s \<longrightarrow> (\<exists>x. (x < a \<or> a < x) \<and> \<bar>x-a\<bar> < s) \<and> \<not> \<bar>k-L\<bar> < r)"
   159         (\<forall>s. 0 < s \<longrightarrow> (\<exists>x. (x < a \<or> a < x) \<and> \<bar>x-a\<bar> < s) \<and> \<not> \<bar>k-L\<bar> < r)"
   160   proof (intro exI conjI strip)
   160   proof (intro exI conjI strip)
   161     show "0 < k-L" by (simp add: k)
   161     show "0 < k-L" by (simp add: k compare_rls)
   162     fix s :: real
   162     fix s :: real
   163     assume s: "0<s"
   163     assume s: "0<s"
   164     { from s show "s/2 + a < a \<or> a < s/2 + a" by arith
   164     { from s show "s/2 + a < a \<or> a < s/2 + a" by arith
   165      next
   165      next
   166       from s show "\<bar>s / 2 + a - a\<bar> < s" by (simp add: abs_if) 
   166       from s show "\<bar>s / 2 + a - a\<bar> < s" by (simp add: abs_if) 
  1605       hence "\<forall>x. a \<le> x & x \<le> b --> isCont (%x. inverse (M - f x)) x"
  1605       hence "\<forall>x. a \<le> x & x \<le> b --> isCont (%x. inverse (M - f x)) x"
  1606         by (auto simp add: isCont_inverse isCont_diff con)
  1606         by (auto simp add: isCont_inverse isCont_diff con)
  1607       from isCont_bounded [OF le this]
  1607       from isCont_bounded [OF le this]
  1608       obtain k where k: "!!x. a \<le> x & x \<le> b --> inverse (M - f x) \<le> k" by auto
  1608       obtain k where k: "!!x. a \<le> x & x \<le> b --> inverse (M - f x) \<le> k" by auto
  1609       have Minv: "!!x. a \<le> x & x \<le> b --> 0 < inverse (M - f (x))"
  1609       have Minv: "!!x. a \<le> x & x \<le> b --> 0 < inverse (M - f (x))"
  1610         by (simp add: M3) 
  1610         by (simp add: M3 compare_rls) 
  1611       have "!!x. a \<le> x & x \<le> b --> inverse (M - f x) < k+1" using k 
  1611       have "!!x. a \<le> x & x \<le> b --> inverse (M - f x) < k+1" using k 
  1612         by (auto intro: order_le_less_trans [of _ k]) 
  1612         by (auto intro: order_le_less_trans [of _ k]) 
  1613       with Minv 
  1613       with Minv 
  1614       have "!!x. a \<le> x & x \<le> b --> inverse(k+1) < inverse(inverse(M - f x))" 
  1614       have "!!x. a \<le> x & x \<le> b --> inverse(k+1) < inverse(inverse(M - f x))" 
  1615         by (intro strip less_imp_inverse_less, simp_all)
  1615         by (intro strip less_imp_inverse_less, simp_all)