# HG changeset patch # User paulson # Date 1465916068 -3600 # Node ID d15dde801536f6c2003a8dc79d5cb5b3f34a8e90 # Parent d3c87eb0bad2c38482f14ff523cdd8bc75d49da6# Parent e7920a0abf4a271ea2a46ce83e636c42ec19a44b Merge diff -r d3c87eb0bad2 -r d15dde801536 src/Doc/Isar_Ref/Quick_Reference.thy --- a/src/Doc/Isar_Ref/Quick_Reference.thy Tue Jun 14 15:34:21 2016 +0100 +++ b/src/Doc/Isar_Ref/Quick_Reference.thy Tue Jun 14 15:54:28 2016 +0100 @@ -22,13 +22,13 @@ & & \quad\<^theory_text>\fixes vars\ \\ & & \quad\<^theory_text>\assumes name: props\ \\ & & \quad\<^theory_text>\obtains (name) vars where props | \ "proof"\ \\ - \proof\ & = & \<^theory_text>\"refinement\<^sup>*" main_proof\ \\ + \proof\ & = & \<^theory_text>\"refinement\<^sup>*" proper_proof\ \\ \refinement\ & = & \<^theory_text>\apply method\ \\ & \|\ & \<^theory_text>\supply name = thms\ \\ & \|\ & \<^theory_text>\subgoal premises name for vars "proof"\ \\ & \|\ & \<^theory_text>\using thms\ \\ & \|\ & \<^theory_text>\unfolding thms\ \\ - \main_proof\ & = & \<^theory_text>\proof "method\<^sup>?" "statement\<^sup>*" qed "method\<^sup>?"\ \\ + \proper_proof\ & = & \<^theory_text>\proof "method\<^sup>?" "statement\<^sup>*" qed "method\<^sup>?"\ \\ & \|\ & \<^theory_text>\done\ \\ \statement\ & = & \<^theory_text>\{ "statement\<^sup>*" }\ \\ & \|\ & \<^theory_text>\next\ \\ diff -r d3c87eb0bad2 -r d15dde801536 src/HOL/Deriv.thy --- a/src/HOL/Deriv.thy Tue Jun 14 15:34:21 2016 +0100 +++ b/src/HOL/Deriv.thy Tue Jun 14 15:54:28 2016 +0100 @@ -756,8 +756,9 @@ by (rule DERIV_continuous) lemma DERIV_continuous_on: - "(\x. x \ s \ (f has_field_derivative (D x)) (at x)) \ continuous_on s f" - by (metis DERIV_continuous continuous_at_imp_continuous_on) + "(\x. x \ s \ (f has_field_derivative (D x)) (at x within s)) \ continuous_on s f" + unfolding continuous_on_eq_continuous_within + by (intro continuous_at_imp_continuous_on ballI DERIV_continuous) lemma DERIV_mult': "(f has_field_derivative D) (at x within s) \ (g has_field_derivative E) (at x within s) \ diff -r d3c87eb0bad2 -r d15dde801536 src/HOL/Multivariate_Analysis/Integration.thy --- a/src/HOL/Multivariate_Analysis/Integration.thy Tue Jun 14 15:34:21 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Integration.thy Tue Jun 14 15:54:28 2016 +0100 @@ -12487,6 +12487,61 @@ by (rule integrable_by_parts_interior_strong[of _ "{}" _ _ f g f' g']) (insert assms, simp_all) +subsection \Integration by substitution\ + + +lemma has_integral_substitution_strong: + fixes f :: "real \ 'a::euclidean_space" and g :: "real \ real" + assumes s: "finite s" and le: "a \ b" "c \ d" "g a \ g b" + and subset: "g ` {a..b} \ {c..d}" + and f [continuous_intros]: "continuous_on {c..d} f" + and g [continuous_intros]: "continuous_on {a..b} g" + and deriv [derivative_intros]: + "\x. x \ {a..b} - s \ (g has_field_derivative g' x) (at x within {a..b})" + shows "((\x. g' x *\<^sub>R f (g x)) has_integral (integral {g a..g b} f)) {a..b}" +proof - + let ?F = "\x. integral {c..g x} f" + have cont_int: "continuous_on {a..b} ?F" + by (rule continuous_on_compose2[OF _ g subset] indefinite_integral_continuous + f integrable_continuous_real)+ + have deriv: "(((\x. integral {c..x} f) \ g) has_vector_derivative g' x *\<^sub>R f (g x)) + (at x within {a..b})" if "x \ {a..b} - s" for x + apply (rule has_vector_derivative_eq_rhs) + apply (rule vector_diff_chain_within) + apply (subst has_field_derivative_iff_has_vector_derivative [symmetric]) + apply (rule deriv that)+ + apply (rule has_vector_derivative_within_subset) + apply (rule integral_has_vector_derivative f)+ + using that le subset + apply blast+ + done + have deriv: "(?F has_vector_derivative g' x *\<^sub>R f (g x)) + (at x)" if "x \ {a..b} - (s \ {a,b})" for x + using deriv[of x] that by (simp add: at_within_closed_interval o_def) + + + have "((\x. g' x *\<^sub>R f (g x)) has_integral (?F b - ?F a)) {a..b}" + using le cont_int s deriv cont_int + by (intro fundamental_theorem_of_calculus_interior_strong[of "s \ {a,b}"]) simp_all + also from subset have "g x \ {c..d}" if "x \ {a..b}" for x using that by blast + from this[of a] this[of b] le have "c \ g a" "g b \ d" by auto + hence "integral {c..g a} f + integral {g a..g b} f = integral {c..g b} f" + by (intro integral_combine integrable_continuous_real continuous_on_subset[OF f] le) simp_all + hence "integral {c..g b} f - integral {c..g a} f = integral {g a..g b} f" + by (simp add: algebra_simps) + finally show ?thesis . +qed + +lemma has_integral_substitution: + fixes f :: "real \ 'a::euclidean_space" and g :: "real \ real" + assumes "a \ b" "c \ d" "g a \ g b" "g ` {a..b} \ {c..d}" + and "continuous_on {c..d} f" + and "\x. x \ {a..b} \ (g has_field_derivative g' x) (at x within {a..b})" + shows "((\x. g' x *\<^sub>R f (g x)) has_integral (integral {g a..g b} f)) {a..b}" + by (intro has_integral_substitution_strong[of "{}" a b c d] assms) + (auto intro: DERIV_continuous_on assms) + + subsection \Compute a double integral using iterated integrals and switching the order of integration\ lemma setcomp_dot1: "{z. P (z \ (i,0))} = {(x,y). P(x \ i)}"