src/HOL/Nonstandard_Analysis/HDeriv.thy
changeset 64604 2bf8cfc98c4d
parent 64435 c93b0e6131c3
child 67399 eab6ce8368fa
equal deleted inserted replaced
64603:a7f5e59378f7 64604:2bf8cfc98c4d
    51   apply (subgoal_tac "( *f* of_real) \<epsilon> \<in> Infinitesimal - {0::'a star}")
    51   apply (subgoal_tac "( *f* of_real) \<epsilon> \<in> Infinitesimal - {0::'a star}")
    52    apply (simp only: nsderiv_def)
    52    apply (simp only: nsderiv_def)
    53    apply (drule (1) bspec)+
    53    apply (drule (1) bspec)+
    54    apply (drule (1) approx_trans3)
    54    apply (drule (1) approx_trans3)
    55    apply simp
    55    apply simp
    56   apply (simp add: Infinitesimal_of_hypreal Infinitesimal_epsilon)
    56   apply (simp add: Infinitesimal_of_hypreal)
    57   apply (simp add: of_hypreal_eq_0_iff hypreal_epsilon_not_zero)
    57   apply (simp add: of_hypreal_eq_0_iff hypreal_epsilon_not_zero)
    58   done
    58   done
    59 
    59 
    60 text \<open>First \<open>NSDERIV\<close> in terms of \<open>NSLIM\<close>.\<close>
    60 text \<open>First \<open>NSDERIV\<close> in terms of \<open>NSLIM\<close>.\<close>
    61 
    61 
    73   by (simp add: NSDERIV_NSLIM_iff DERIV_LIM_iff LIM_NSLIM_iff [symmetric])
    73   by (simp add: NSDERIV_NSLIM_iff DERIV_LIM_iff LIM_NSLIM_iff [symmetric])
    74 
    74 
    75 text \<open>While we're at it!\<close>
    75 text \<open>While we're at it!\<close>
    76 lemma NSDERIV_iff2:
    76 lemma NSDERIV_iff2:
    77   "(NSDERIV f x :> D) \<longleftrightarrow>
    77   "(NSDERIV f x :> D) \<longleftrightarrow>
    78     (\<forall>w. w \<noteq> star_of x & w \<approx> star_of x \<longrightarrow> ( *f* (%z. (f z - f x) / (z-x))) w \<approx> star_of D)"
    78     (\<forall>w. w \<noteq> star_of x \<and> w \<approx> star_of x \<longrightarrow> ( *f* (\<lambda>z. (f z - f x) / (z - x))) w \<approx> star_of D)"
    79   by (simp add: NSDERIV_NSLIM_iff2 NSLIM_def)
    79   by (simp add: NSDERIV_NSLIM_iff2 NSLIM_def)
    80 
    80 
    81 (* FIXME delete *)
    81 (* FIXME delete *)
    82 lemma hypreal_not_eq_minus_iff: "x \<noteq> a \<longleftrightarrow> x - a \<noteq> (0::'a::ab_group_add)"
    82 lemma hypreal_not_eq_minus_iff: "x \<noteq> a \<longleftrightarrow> x - a \<noteq> (0::'a::ab_group_add)"
    83   by auto
    83   by auto
    89   apply (auto simp add: NSDERIV_iff2)
    89   apply (auto simp add: NSDERIV_iff2)
    90   apply (case_tac "u = hypreal_of_real x", auto)
    90   apply (case_tac "u = hypreal_of_real x", auto)
    91   apply (drule_tac x = u in spec, auto)
    91   apply (drule_tac x = u in spec, auto)
    92   apply (drule_tac c = "u - hypreal_of_real x" and b = "hypreal_of_real D" in approx_mult1)
    92   apply (drule_tac c = "u - hypreal_of_real x" and b = "hypreal_of_real D" in approx_mult1)
    93    apply (drule_tac [!] hypreal_not_eq_minus_iff [THEN iffD1])
    93    apply (drule_tac [!] hypreal_not_eq_minus_iff [THEN iffD1])
    94    apply (subgoal_tac [2] "( *f* (%z. z-x)) u \<noteq> (0::hypreal) ")
    94    apply (subgoal_tac [2] "( *f* (\<lambda>z. z - x)) u \<noteq> (0::hypreal) ")
    95     apply (auto simp: approx_minus_iff [THEN iffD1, THEN mem_infmal_iff [THEN iffD2]]
    95     apply (auto simp: approx_minus_iff [THEN iffD1, THEN mem_infmal_iff [THEN iffD2]]
    96       Infinitesimal_subset_HFinite [THEN subsetD])
    96       Infinitesimal_subset_HFinite [THEN subsetD])
    97   done
    97   done
    98 
    98 
    99 lemma NSDERIVD4:
    99 lemma NSDERIVD4:
   288   apply (frule_tac f = g in NSDERIV_approx)
   288   apply (frule_tac f = g in NSDERIV_approx)
   289     apply (auto simp add: starfun_lambda_cancel2 starfun_o [symmetric])
   289     apply (auto simp add: starfun_lambda_cancel2 starfun_o [symmetric])
   290   apply (case_tac "( *f* g) (star_of (x) + xa) = star_of (g x) ")
   290   apply (case_tac "( *f* g) (star_of (x) + xa) = star_of (g x) ")
   291    apply (drule_tac g = g in NSDERIV_zero)
   291    apply (drule_tac g = g in NSDERIV_zero)
   292       apply (auto simp add: divide_inverse)
   292       apply (auto simp add: divide_inverse)
   293   apply (rule_tac z1 = "( *f* g) (star_of (x) + xa) - star_of (g x) " and y1 = "inverse xa" in lemma_chain [THEN ssubst])
   293   apply (rule_tac z1 = "( *f* g) (star_of (x) + xa) - star_of (g x) " and y1 = "inverse xa"
       
   294       in lemma_chain [THEN ssubst])
   294    apply (erule hypreal_not_eq_minus_iff [THEN iffD1])
   295    apply (erule hypreal_not_eq_minus_iff [THEN iffD1])
   295   apply (rule approx_mult_star_of)
   296   apply (rule approx_mult_star_of)
   296    apply (simp_all add: divide_inverse [symmetric])
   297    apply (simp_all add: divide_inverse [symmetric])
   297    apply (blast intro: NSDERIVD1 approx_minus_iff [THEN iffD2])
   298    apply (blast intro: NSDERIVD1 approx_minus_iff [THEN iffD2])
   298   apply (blast intro: NSDERIVD2)
   299   apply (blast intro: NSDERIVD2)