src/HOL/Multivariate_Analysis/Derivative.thy
changeset 44140 2c10c35dd4be
parent 44137 ac5cb4c86448
child 44282 f0de18b62d63
equal deleted inserted replaced
44139:abccf1b7ea4b 44140:2c10c35dd4be
    95     ((\<lambda>t. (f t - f x) / (t - x) - y) ---> 0) (at x within ({x<..} \<inter> I))"
    95     ((\<lambda>t. (f t - f x) / (t - x) - y) ---> 0) (at x within ({x<..} \<inter> I))"
    96     by (intro Lim_cong_within) (auto simp add: divide.diff divide.add)
    96     by (intro Lim_cong_within) (auto simp add: divide.diff divide.add)
    97   also have "\<dots> \<longleftrightarrow> ((\<lambda>t. (f t - f x) / (t - x)) ---> y) (at x within ({x<..} \<inter> I))"
    97   also have "\<dots> \<longleftrightarrow> ((\<lambda>t. (f t - f x) / (t - x)) ---> y) (at x within ({x<..} \<inter> I))"
    98     by (simp add: Lim_null[symmetric])
    98     by (simp add: Lim_null[symmetric])
    99   also have "\<dots> \<longleftrightarrow> ((\<lambda>t. (f x - f t) / (x - t)) ---> y) (at x within ({x<..} \<inter> I))"
    99   also have "\<dots> \<longleftrightarrow> ((\<lambda>t. (f x - f t) / (x - t)) ---> y) (at x within ({x<..} \<inter> I))"
   100     by (intro Lim_cong_within) (simp_all add: times_divide_eq field_simps)
   100     by (intro Lim_cong_within) (simp_all add: field_simps)
   101   finally show ?thesis
   101   finally show ?thesis
   102     by (simp add: mult.bounded_linear_right has_derivative_within)
   102     by (simp add: mult.bounded_linear_right has_derivative_within)
   103 qed
   103 qed
   104 
   104 
   105 lemma bounded_linear_imp_linear: "bounded_linear f \<Longrightarrow> linear f" (* TODO: move elsewhere *)
   105 lemma bounded_linear_imp_linear: "bounded_linear f \<Longrightarrow> linear f" (* TODO: move elsewhere *)
   114   "(f has_derivative f') net \<Longrightarrow> linear f'"
   114   "(f has_derivative f') net \<Longrightarrow> linear f'"
   115   by (rule derivative_linear [THEN bounded_linear_imp_linear])
   115   by (rule derivative_linear [THEN bounded_linear_imp_linear])
   116 
   116 
   117 subsubsection {* Combining theorems. *}
   117 subsubsection {* Combining theorems. *}
   118 
   118 
   119 lemma (in bounded_linear) has_derivative: "(f has_derivative f) net"
   119 lemma has_derivative_id: "((\<lambda>x. x) has_derivative (\<lambda>h. h)) net"
       
   120   unfolding has_derivative_def
       
   121   by (simp add: bounded_linear_ident tendsto_const)
       
   122 
       
   123 lemma has_derivative_const: "((\<lambda>x. c) has_derivative (\<lambda>h. 0)) net"
       
   124   unfolding has_derivative_def
       
   125   by (simp add: bounded_linear_zero tendsto_const)
       
   126 
       
   127 lemma (in bounded_linear) has_derivative': "(f has_derivative f) net"
   120   unfolding has_derivative_def apply(rule,rule bounded_linear_axioms)
   128   unfolding has_derivative_def apply(rule,rule bounded_linear_axioms)
   121   unfolding diff by (simp add: tendsto_const)
   129   unfolding diff by (simp add: tendsto_const)
   122 
   130 
   123 lemma has_derivative_id: "((\<lambda>x. x) has_derivative (\<lambda>h. h)) net"
   131 lemma (in bounded_linear) bounded_linear: "bounded_linear f" ..
   124   apply(rule bounded_linear.has_derivative) using bounded_linear_ident[unfolded id_def] by simp
   132 
   125 
   133 lemma (in bounded_linear) has_derivative:
   126 lemma has_derivative_const: "((\<lambda>x. c) has_derivative (\<lambda>h. 0)) net"
   134   assumes "((\<lambda>x. g x) has_derivative (\<lambda>h. g' h)) net"
   127   unfolding has_derivative_def
   135   shows "((\<lambda>x. f (g x)) has_derivative (\<lambda>h. f (g' h))) net"
   128   by (rule, rule bounded_linear_zero, simp add: tendsto_const)
   136   using assms unfolding has_derivative_def
   129 
   137   apply safe
   130 lemma (in bounded_linear) cmul: shows "bounded_linear (\<lambda>x. (c::real) *\<^sub>R f x)"
   138   apply (erule bounded_linear_compose [OF local.bounded_linear])
   131 proof -
   139   apply (drule local.tendsto)
   132   have "bounded_linear (\<lambda>x. c *\<^sub>R x)"
   140   apply (simp add: local.scaleR local.diff local.add local.zero)
   133     by (rule scaleR.bounded_linear_right)
   141   done
   134   moreover have "bounded_linear f" ..
       
   135   ultimately show ?thesis
       
   136     by (rule bounded_linear_compose)
       
   137 qed
       
   138 
       
   139 lemma has_derivative_cmul: assumes "(f has_derivative f') net" shows "((\<lambda>x. c *\<^sub>R f(x)) has_derivative (\<lambda>h. c *\<^sub>R f'(h))) net"
       
   140   unfolding has_derivative_def apply(rule,rule bounded_linear.cmul)
       
   141   using assms[unfolded has_derivative_def]
       
   142   using scaleR.tendsto[OF tendsto_const assms[unfolded has_derivative_def,THEN conjunct2]]
       
   143   unfolding scaleR_right_diff_distrib scaleR_right_distrib by auto 
       
   144 
       
   145 lemma has_derivative_cmul_eq: assumes "c \<noteq> 0" 
       
   146   shows "(((\<lambda>x. c *\<^sub>R f(x)) has_derivative (\<lambda>h. c *\<^sub>R f'(h))) net \<longleftrightarrow> (f has_derivative f') net)"
       
   147   apply(rule) defer apply(rule has_derivative_cmul,assumption) 
       
   148   apply(drule has_derivative_cmul[where c="1/c"]) using assms by auto
       
   149 
   142 
   150 lemma has_derivative_neg:
   143 lemma has_derivative_neg:
   151  "(f has_derivative f') net \<Longrightarrow> ((\<lambda>x. -(f x)) has_derivative (\<lambda>h. -(f' h))) net"
   144   assumes "(f has_derivative f') net"
   152   apply(drule has_derivative_cmul[where c="-1"]) by auto
   145   shows "((\<lambda>x. -(f x)) has_derivative (\<lambda>h. -(f' h))) net"
   153 
   146   using scaleR_right.has_derivative [where r="-1", OF assms] by auto
   154 lemma has_derivative_neg_eq: "((\<lambda>x. -(f x)) has_derivative (\<lambda>h. -(f' h))) net \<longleftrightarrow> (f has_derivative f') net"
       
   155   apply(rule, drule_tac[!] has_derivative_neg) by auto
       
   156 
   147 
   157 lemma has_derivative_add:
   148 lemma has_derivative_add:
   158   assumes "(f has_derivative f') net" and "(g has_derivative g') net"
   149   assumes "(f has_derivative f') net" and "(g has_derivative g') net"
   159   shows "((\<lambda>x. f(x) + g(x)) has_derivative (\<lambda>h. f'(h) + g'(h))) net"
   150   shows "((\<lambda>x. f(x) + g(x)) has_derivative (\<lambda>h. f'(h) + g'(h))) net"
   160 proof-
   151 proof-
   161   note as = assms[unfolded has_derivative_def]
   152   note as = assms[unfolded has_derivative_def]
   162   show ?thesis unfolding has_derivative_def apply(rule,rule bounded_linear_add)
   153   show ?thesis unfolding has_derivative_def apply(rule,rule bounded_linear_add)
   163     using tendsto_add[OF as(1)[THEN conjunct2] as(2)[THEN conjunct2]] and as
   154     using tendsto_add[OF as(1)[THEN conjunct2] as(2)[THEN conjunct2]] and as
   164     by (auto simp add:algebra_simps scaleR_right_diff_distrib scaleR_right_distrib)
   155     by (auto simp add: algebra_simps)
   165 qed
   156 qed
   166 
   157 
   167 lemma has_derivative_add_const:"(f has_derivative f') net \<Longrightarrow> ((\<lambda>x. f x + c) has_derivative f') net"
   158 lemma has_derivative_add_const:
   168   apply(drule has_derivative_add) apply(rule has_derivative_const) by auto
   159   "(f has_derivative f') net \<Longrightarrow> ((\<lambda>x. f x + c) has_derivative f') net"
       
   160   by (drule has_derivative_add, rule has_derivative_const, auto)
   169 
   161 
   170 lemma has_derivative_sub:
   162 lemma has_derivative_sub:
   171   assumes "(f has_derivative f') net" and "(g has_derivative g') net"
   163   assumes "(f has_derivative f') net" and "(g has_derivative g') net"
   172   shows "((\<lambda>x. f(x) - g(x)) has_derivative (\<lambda>h. f'(h) - g'(h))) net"
   164   shows "((\<lambda>x. f(x) - g(x)) has_derivative (\<lambda>h. f'(h) - g'(h))) net"
   173   unfolding diff_minus by (intro has_derivative_add has_derivative_neg assms)
   165   unfolding diff_minus by (intro has_derivative_add has_derivative_neg assms)
   174 
   166 
   175 lemma has_derivative_setsum:
   167 lemma has_derivative_setsum:
   176   assumes "finite s" and "\<forall>a\<in>s. ((f a) has_derivative (f' a)) net"
   168   assumes "finite s" and "\<forall>a\<in>s. ((f a) has_derivative (f' a)) net"
   177   shows "((\<lambda>x. setsum (\<lambda>a. f a x) s) has_derivative (\<lambda>h. setsum (\<lambda>a. f' a h) s)) net"
   169   shows "((\<lambda>x. setsum (\<lambda>a. f a x) s) has_derivative (\<lambda>h. setsum (\<lambda>a. f' a h) s)) net"
   178   using assms by (induct, simp_all add: has_derivative_const has_derivative_add)
   170   using assms by (induct, simp_all add: has_derivative_const has_derivative_add)
   179 
       
   180 lemma has_derivative_setsum_numseg:
       
   181   "\<forall>i. m \<le> i \<and> i \<le> n \<longrightarrow> ((f i) has_derivative (f' i)) net \<Longrightarrow>
       
   182   ((\<lambda>x. setsum (\<lambda>i. f i x) {m..n::nat}) has_derivative (\<lambda>h. setsum (\<lambda>i. f' i h) {m..n})) net"
       
   183   by (rule has_derivative_setsum) simp_all
       
   184 
       
   185 text {* Somewhat different results for derivative of scalar multiplier. *}
   171 text {* Somewhat different results for derivative of scalar multiplier. *}
   186 
   172 
   187 (** move **)
   173 (** move **)
   188 lemma linear_vmul_component:
   174 lemma linear_vmul_component: (* TODO: delete *)
   189   assumes lf: "linear f"
   175   assumes lf: "linear f"
   190   shows "linear (\<lambda>x. f x $$ k *\<^sub>R v)"
   176   shows "linear (\<lambda>x. f x $$ k *\<^sub>R v)"
   191   using lf
   177   using lf
   192   by (auto simp add: linear_def algebra_simps)
   178   by (auto simp add: linear_def algebra_simps)
   193 
   179 
   194 lemma bounded_linear_euclidean_component: "bounded_linear (\<lambda>x. x $$ k)"
       
   195   unfolding euclidean_component_def
       
   196   by (rule inner.bounded_linear_right)
       
   197 
       
   198 lemma has_derivative_vmul_component:
       
   199   fixes c::"'a::real_normed_vector \<Rightarrow> 'b::euclidean_space" and v::"'c::real_normed_vector"
       
   200   assumes "(c has_derivative c') net"
       
   201   shows "((\<lambda>x. c(x)$$k *\<^sub>R v) has_derivative (\<lambda>x. (c' x)$$k *\<^sub>R v)) net" proof-
       
   202   have *:"\<And>y. (c y $$ k *\<^sub>R v - (c (netlimit net) $$ k *\<^sub>R v + c' (y - netlimit net) $$ k *\<^sub>R v)) = 
       
   203         (c y $$ k - (c (netlimit net) $$ k + c' (y - netlimit net) $$ k)) *\<^sub>R v" 
       
   204     unfolding scaleR_left_diff_distrib scaleR_left_distrib by auto
       
   205   show ?thesis unfolding has_derivative_def and *
       
   206     apply (rule conjI)
       
   207     apply (rule bounded_linear_compose [OF scaleR.bounded_linear_left])
       
   208     apply (rule bounded_linear_compose [OF bounded_linear_euclidean_component])
       
   209     apply (rule derivative_linear [OF assms])
       
   210     apply(subst scaleR_zero_left[THEN sym, of v]) unfolding scaleR_scaleR
       
   211     apply (intro tendsto_intros)
       
   212     using assms[unfolded has_derivative_def] unfolding Lim o_def apply- apply(cases "trivial_limit net")
       
   213     apply(rule,assumption,rule disjI2,rule,rule) proof-
       
   214     have *:"\<And>x. x - 0 = (x::'a)" by auto 
       
   215     have **:"\<And>d x. d * (c x $$ k - (c (netlimit net) $$ k + c' (x - netlimit net) $$ k)) =
       
   216       (d *\<^sub>R (c x - (c (netlimit net) + c' (x - netlimit net) ))) $$k" by(auto simp add:field_simps)
       
   217     fix e assume "\<not> trivial_limit net" "0 < (e::real)"
       
   218     then have "eventually (\<lambda>x. dist ((1 / norm (x - netlimit net)) *\<^sub>R
       
   219       (c x - (c (netlimit net) + c' (x - netlimit net)))) 0 < e) net"
       
   220       using assms[unfolded has_derivative_def Lim] by auto
       
   221     thus "eventually (\<lambda>x. dist (1 / norm (x - netlimit net) *
       
   222       (c x $$ k - (c (netlimit net) $$ k + c' (x - netlimit net) $$ k))) 0 < e) net"
       
   223       proof (rule eventually_elim1)
       
   224       case goal1 thus ?case apply - unfolding dist_norm  apply(rule le_less_trans)
       
   225         prefer 2 apply assumption unfolding * **
       
   226         using component_le_norm[of "(1 / norm (x - netlimit net)) *\<^sub>R
       
   227           (c x - (c (netlimit net) + c' (x - netlimit net))) - 0" k] by auto
       
   228     qed
       
   229   qed
       
   230 qed
       
   231 
       
   232 lemma has_derivative_vmul_within: fixes c::"real \<Rightarrow> real"
       
   233   assumes "(c has_derivative c') (at x within s)"
       
   234   shows "((\<lambda>x. (c x) *\<^sub>R v) has_derivative (\<lambda>x. (c' x) *\<^sub>R v)) (at x within s)"
       
   235   using has_derivative_vmul_component[OF assms, of 0 v] by auto
       
   236 
       
   237 lemma has_derivative_vmul_at: fixes c::"real \<Rightarrow> real"
       
   238   assumes "(c has_derivative c') (at x)"
       
   239   shows "((\<lambda>x. (c x) *\<^sub>R v) has_derivative (\<lambda>x. (c' x) *\<^sub>R v)) (at x)"
       
   240   using has_derivative_vmul_within[where s=UNIV] and assms by(auto simp add: within_UNIV)
       
   241 
       
   242 lemma has_derivative_lift_dot:
       
   243   assumes "(f has_derivative f') net"
       
   244   shows "((\<lambda>x. inner v (f x)) has_derivative (\<lambda>t. inner v (f' t))) net" proof-
       
   245   show ?thesis using assms unfolding has_derivative_def apply- apply(erule conjE,rule)
       
   246     apply(rule bounded_linear_compose[of _ f']) apply(rule inner.bounded_linear_right,assumption)
       
   247     apply(drule Lim_inner[where a=v]) unfolding o_def
       
   248     by(auto simp add:inner.scaleR_right inner.add_right inner.diff_right) qed
       
   249 
       
   250 lemmas has_derivative_intros =
   180 lemmas has_derivative_intros =
   251   has_derivative_sub has_derivative_add has_derivative_cmul has_derivative_id
   181   has_derivative_id has_derivative_const
   252   has_derivative_const has_derivative_neg has_derivative_vmul_component
   182   has_derivative_add has_derivative_sub has_derivative_neg
   253   has_derivative_vmul_at has_derivative_vmul_within has_derivative_cmul 
   183   has_derivative_add_const
   254   bounded_linear.has_derivative has_derivative_lift_dot
   184   scaleR_left.has_derivative scaleR_right.has_derivative
       
   185   inner_left.has_derivative inner_right.has_derivative
       
   186   euclidean_component.has_derivative
   255 
   187 
   256 subsubsection {* Limit transformation for derivatives *}
   188 subsubsection {* Limit transformation for derivatives *}
   257 
   189 
   258 lemma has_derivative_transform_within:
   190 lemma has_derivative_transform_within:
   259   assumes "0 < d" "x \<in> s" "\<forall>x'\<in>s. dist x' x < d \<longrightarrow> f x' = g x'" "(f has_derivative f') (at x within s)"
   191   assumes "0 < d" "x \<in> s" "\<forall>x'\<in>s. dist x' x < d \<longrightarrow> f x' = g x'" "(f has_derivative f') (at x within s)"
   357     unfolding Lim_within and dist_norm
   289     unfolding Lim_within and dist_norm
   358     apply (rule, rule)
   290     apply (rule, rule)
   359     apply (erule_tac x=e in allE)
   291     apply (erule_tac x=e in allE)
   360     apply (erule impE | assumption)+
   292     apply (erule impE | assumption)+
   361     apply (erule exE, rule_tac x=d in exI)
   293     apply (erule exE, rule_tac x=d in exI)
   362     by (auto simp add: zero * elim!: allE)
   294     by (auto simp add: zero *)
   363 qed
   295 qed
   364 
   296 
   365 lemma differentiable_imp_continuous_at:
   297 lemma differentiable_imp_continuous_at:
   366   "f differentiable at x \<Longrightarrow> continuous (at x) f"
   298   "f differentiable at x \<Longrightarrow> continuous (at x) f"
   367  by(rule differentiable_imp_continuous_within[of _ x UNIV, unfolded within_UNIV])
   299  by(rule differentiable_imp_continuous_within[of _ x UNIV, unfolded within_UNIV])
   525 
   457 
   526 lemma differentiable_cmul [intro]:
   458 lemma differentiable_cmul [intro]:
   527   "f differentiable net \<Longrightarrow>
   459   "f differentiable net \<Longrightarrow>
   528   (\<lambda>x. c *\<^sub>R f(x)) differentiable (net::'a::real_normed_vector filter)"
   460   (\<lambda>x. c *\<^sub>R f(x)) differentiable (net::'a::real_normed_vector filter)"
   529   unfolding differentiable_def
   461   unfolding differentiable_def
   530   apply(erule exE, drule has_derivative_cmul) by auto
   462   apply(erule exE, drule scaleR_right.has_derivative) by auto
   531 
   463 
   532 lemma differentiable_neg [intro]:
   464 lemma differentiable_neg [intro]:
   533   "f differentiable net \<Longrightarrow>
   465   "f differentiable net \<Longrightarrow>
   534   (\<lambda>z. -(f z)) differentiable (net::'a::real_normed_vector filter)"
   466   (\<lambda>z. -(f z)) differentiable (net::'a::real_normed_vector filter)"
   535   unfolding differentiable_def
   467   unfolding differentiable_def
   834     defer
   766     defer
   835     apply(rule continuous_on_intros assms(2) continuous_on_cmul[where 'b=real, unfolded real_scaleR_def])+
   767     apply(rule continuous_on_intros assms(2) continuous_on_cmul[where 'b=real, unfolded real_scaleR_def])+
   836   proof
   768   proof
   837     fix x assume x:"x \<in> {a<..<b}"
   769     fix x assume x:"x \<in> {a<..<b}"
   838     show "((\<lambda>x. f x - (f b - f a) / (b - a) * x) has_derivative (\<lambda>xa. f' x xa - (f b - f a) / (b - a) * xa)) (at x)"
   770     show "((\<lambda>x. f x - (f b - f a) / (b - a) * x) has_derivative (\<lambda>xa. f' x xa - (f b - f a) / (b - a) * xa)) (at x)"
   839       by(rule has_derivative_intros assms(3)[rule_format,OF x]
   771       by (intro has_derivative_intros assms(3)[rule_format,OF x]
   840         has_derivative_cmul[where 'b=real, unfolded real_scaleR_def])+
   772         mult_right.has_derivative)
   841   qed(insert assms(1), auto simp add:field_simps)
   773   qed(insert assms(1), auto simp add:field_simps)
   842   then guess x ..
   774   then guess x ..
   843   thus ?thesis apply(rule_tac x=x in bexI)
   775   thus ?thesis apply(rule_tac x=x in bexI)
   844     apply(drule fun_cong[of _ _ "b - a"]) by auto
   776     apply(drule fun_cong[of _ _ "b - a"]) by auto
   845 qed
   777 qed
   880   shows "\<exists>x\<in>{a<..<b}. norm(f b - f a) \<le> norm(f'(x) (b - a))"
   812   shows "\<exists>x\<in>{a<..<b}. norm(f b - f a) \<le> norm(f'(x) (b - a))"
   881 proof-
   813 proof-
   882   have "\<exists>x\<in>{a<..<b}. (op \<bullet> (f b - f a) \<circ> f) b - (op \<bullet> (f b - f a) \<circ> f) a = (f b - f a) \<bullet> f' x (b - a)"
   814   have "\<exists>x\<in>{a<..<b}. (op \<bullet> (f b - f a) \<circ> f) b - (op \<bullet> (f b - f a) \<circ> f) a = (f b - f a) \<bullet> f' x (b - a)"
   883     apply(rule mvt) apply(rule assms(1))
   815     apply(rule mvt) apply(rule assms(1))
   884     apply(rule continuous_on_inner continuous_on_intros assms(2))+
   816     apply(rule continuous_on_inner continuous_on_intros assms(2))+
   885     unfolding o_def apply(rule,rule has_derivative_lift_dot)
   817     unfolding o_def apply(rule,rule has_derivative_intros)
   886     using assms(3) by auto
   818     using assms(3) by auto
   887   then guess x .. note x=this
   819   then guess x .. note x=this
   888   show ?thesis proof(cases "f a = f b")
   820   show ?thesis proof(cases "f a = f b")
   889     case False
   821     case False
   890     have "norm (f b - f a) * norm (f b - f a) = norm (f b - f a)^2"
   822     have "norm (f b - f a) * norm (f b - f a) = norm (f b - f a)^2"
  1359         hence "u\<in>s" using d d2 by auto
  1291         hence "u\<in>s" using d d2 by auto
  1360         have *:"(\<lambda>v. v - g' (f' u v)) = g' \<circ> (\<lambda>w. f' a w - f' u w)"
  1292         have *:"(\<lambda>v. v - g' (f' u v)) = g' \<circ> (\<lambda>w. f' a w - f' u w)"
  1361           unfolding o_def and diff using f'g' by auto
  1293           unfolding o_def and diff using f'g' by auto
  1362         show "(ph has_derivative (\<lambda>v. v - g' (f' u v))) (at u within ball a d)"
  1294         show "(ph has_derivative (\<lambda>v. v - g' (f' u v))) (at u within ball a d)"
  1363           unfolding ph' * apply(rule diff_chain_within) defer
  1295           unfolding ph' * apply(rule diff_chain_within) defer
  1364           apply(rule bounded_linear.has_derivative[OF assms(3)])
  1296           apply(rule bounded_linear.has_derivative'[OF assms(3)])
  1365           apply(rule has_derivative_intros) defer
  1297           apply(rule has_derivative_intros) defer
  1366           apply(rule has_derivative_sub[where g'="\<lambda>x.0",unfolded diff_0_right])
  1298           apply(rule has_derivative_sub[where g'="\<lambda>x.0",unfolded diff_0_right])
  1367           apply(rule has_derivative_at_within)
  1299           apply(rule has_derivative_at_within)
  1368           using assms(5) and `u\<in>s` `a\<in>s`
  1300           using assms(5) and `u\<in>s` `a\<in>s`
  1369           by(auto intro!: has_derivative_intros derivative_linear)
  1301           by(auto intro!: has_derivative_intros bounded_linear.has_derivative' derivative_linear)
  1370         have **:"bounded_linear (\<lambda>x. f' u x - f' a x)"
  1302         have **:"bounded_linear (\<lambda>x. f' u x - f' a x)"
  1371           "bounded_linear (\<lambda>x. f' a x - f' u x)"
  1303           "bounded_linear (\<lambda>x. f' a x - f' u x)"
  1372           apply(rule_tac[!] bounded_linear_sub)
  1304           apply(rule_tac[!] bounded_linear_sub)
  1373           apply(rule_tac[!] derivative_linear)
  1305           apply(rule_tac[!] derivative_linear)
  1374           using assms(5) `u\<in>s` `a\<in>s` by auto
  1306           using assms(5) `u\<in>s` `a\<in>s` by auto
  1805 lemma has_vector_derivative_id: "((\<lambda>x::real. x) has_vector_derivative 1) net"
  1737 lemma has_vector_derivative_id: "((\<lambda>x::real. x) has_vector_derivative 1) net"
  1806   unfolding has_vector_derivative_def using has_derivative_id by auto
  1738   unfolding has_vector_derivative_def using has_derivative_id by auto
  1807 
  1739 
  1808 lemma has_vector_derivative_cmul:
  1740 lemma has_vector_derivative_cmul:
  1809   "(f has_vector_derivative f') net \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) has_vector_derivative (c *\<^sub>R f')) net"
  1741   "(f has_vector_derivative f') net \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) has_vector_derivative (c *\<^sub>R f')) net"
  1810   unfolding has_vector_derivative_def apply(drule has_derivative_cmul)
  1742   unfolding has_vector_derivative_def
       
  1743   apply (drule scaleR_right.has_derivative)
  1811   by (auto simp add: algebra_simps)
  1744   by (auto simp add: algebra_simps)
  1812 
  1745 
  1813 lemma has_vector_derivative_cmul_eq:
  1746 lemma has_vector_derivative_cmul_eq:
  1814   assumes "c \<noteq> 0"
  1747   assumes "c \<noteq> 0"
  1815   shows "(((\<lambda>x. c *\<^sub>R f x) has_vector_derivative (c *\<^sub>R f')) net \<longleftrightarrow> (f has_vector_derivative f') net)"
  1748   shows "(((\<lambda>x. c *\<^sub>R f x) has_vector_derivative (c *\<^sub>R f')) net \<longleftrightarrow> (f has_vector_derivative f') net)"