src/HOL/Multivariate_Analysis/Derivative.thy
changeset 44531 1d477a2b1572
parent 44457 d366fa5551ef
child 44568 e6f291cb5810
equal deleted inserted replaced
44530:adb18b07b341 44531:1d477a2b1572
   783   shows "\<exists>x\<in>{a<..<b}. (f b - f a = (f' x) (b - a))"
   783   shows "\<exists>x\<in>{a<..<b}. (f b - f a = (f' x) (b - a))"
   784 proof-
   784 proof-
   785   have "\<exists>x\<in>{a<..<b}. (\<lambda>xa. f' x xa - (f b - f a) / (b - a) * xa) = (\<lambda>v. 0)"
   785   have "\<exists>x\<in>{a<..<b}. (\<lambda>xa. f' x xa - (f b - f a) / (b - a) * xa) = (\<lambda>v. 0)"
   786     apply(rule rolle[OF assms(1), of "\<lambda>x. f x - (f b - f a) / (b - a) * x"])
   786     apply(rule rolle[OF assms(1), of "\<lambda>x. f x - (f b - f a) / (b - a) * x"])
   787     defer
   787     defer
   788     apply(rule continuous_on_intros assms(2) continuous_on_cmul[where 'b=real, unfolded real_scaleR_def])+
   788     apply(rule continuous_on_intros assms(2))+
   789   proof
   789   proof
   790     fix x assume x:"x \<in> {a<..<b}"
   790     fix x assume x:"x \<in> {a<..<b}"
   791     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)"
   791     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)"
   792       by (intro has_derivative_intros assms(3)[rule_format,OF x]
   792       by (intro has_derivative_intros assms(3)[rule_format,OF x]
   793         mult_right_has_derivative)
   793         mult_right_has_derivative)
   867   have *:"\<And>u. u\<in>{0..1} \<Longrightarrow> x + u *\<^sub>R (y - x) \<in> s"
   867   have *:"\<And>u. u\<in>{0..1} \<Longrightarrow> x + u *\<^sub>R (y - x) \<in> s"
   868     using assms(1)[unfolded convex_alt,rule_format,OF x y]
   868     using assms(1)[unfolded convex_alt,rule_format,OF x y]
   869     unfolding scaleR_left_diff_distrib scaleR_right_diff_distrib
   869     unfolding scaleR_left_diff_distrib scaleR_right_diff_distrib
   870     by (auto simp add: algebra_simps)
   870     by (auto simp add: algebra_simps)
   871   hence 1:"continuous_on {0..1} (f \<circ> ?p)" apply-
   871   hence 1:"continuous_on {0..1} (f \<circ> ?p)" apply-
   872     apply(rule continuous_on_intros continuous_on_vmul)+
   872     apply(rule continuous_on_intros)+
   873     unfolding continuous_on_eq_continuous_within
   873     unfolding continuous_on_eq_continuous_within
   874     apply(rule,rule differentiable_imp_continuous_within)
   874     apply(rule,rule differentiable_imp_continuous_within)
   875     unfolding differentiable_def apply(rule_tac x="f' xa" in exI)
   875     unfolding differentiable_def apply(rule_tac x="f' xa" in exI)
   876     apply(rule has_derivative_within_subset)
   876     apply(rule has_derivative_within_subset)
   877     apply(rule assms(2)[rule_format]) by auto
   877     apply(rule assms(2)[rule_format]) by auto