src/HOL/Multivariate_Analysis/Integration.thy
changeset 50104 de19856feb54
parent 49996 64c8d9d3af18
child 50241 8b0fdeeefef7
equal deleted inserted replaced
50103:3d89c38408cd 50104:de19856feb54
   481 proof -
   481 proof -
   482   have *: "{..<Suc 0} = {0}" by auto
   482   have *: "{..<Suc 0} = {0}" by auto
   483   show ?thesis unfolding content_def using assms by (auto simp: *)
   483   show ?thesis unfolding content_def using assms by (auto simp: *)
   484 qed
   484 qed
   485 
   485 
       
   486 lemma content_singleton[simp]: "content {a} = 0"
       
   487 proof -
       
   488   have "content {a .. a} = 0"
       
   489     by (subst content_closed_interval) auto
       
   490   then show ?thesis by simp
       
   491 qed
       
   492 
   486 lemma content_unit[intro]: "content{0..One::'a::ordered_euclidean_space} = 1"
   493 lemma content_unit[intro]: "content{0..One::'a::ordered_euclidean_space} = 1"
   487 proof -
   494 proof -
   488   have *: "\<forall>i<DIM('a). (0::'a)$$i \<le> (One::'a)$$i" by auto
   495   have *: "\<forall>i<DIM('a). (0::'a)$$i \<le> (One::'a)$$i" by auto
   489   have "0 \<in> {0..One::'a}" unfolding mem_interval by auto
   496   have "0 \<in> {0..One::'a}" unfolding mem_interval by auto
   490   thus ?thesis unfolding content_def interval_bounds[OF *] using setprod_1 by auto
   497   thus ?thesis unfolding content_def interval_bounds[OF *] using setprod_1 by auto
  1663 lemma has_integral_cmul:
  1670 lemma has_integral_cmul:
  1664   shows "(f has_integral k) s \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) has_integral (c *\<^sub>R k)) s"
  1671   shows "(f has_integral k) s \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) has_integral (c *\<^sub>R k)) s"
  1665   unfolding o_def[THEN sym] apply(rule has_integral_linear,assumption)
  1672   unfolding o_def[THEN sym] apply(rule has_integral_linear,assumption)
  1666   by(rule bounded_linear_scaleR_right)
  1673   by(rule bounded_linear_scaleR_right)
  1667 
  1674 
       
  1675 lemma has_integral_cmult_real:
       
  1676   fixes c :: real
       
  1677   assumes "c \<noteq> 0 \<Longrightarrow> (f has_integral x) A"
       
  1678   shows "((\<lambda>x. c * f x) has_integral c * x) A"
       
  1679 proof cases
       
  1680   assume "c \<noteq> 0"
       
  1681   from has_integral_cmul[OF assms[OF this], of c] show ?thesis
       
  1682     unfolding real_scaleR_def .
       
  1683 qed simp
       
  1684 
  1668 lemma has_integral_neg:
  1685 lemma has_integral_neg:
  1669   shows "(f has_integral k) s \<Longrightarrow> ((\<lambda>x. -(f x)) has_integral (-k)) s"
  1686   shows "(f has_integral k) s \<Longrightarrow> ((\<lambda>x. -(f x)) has_integral (-k)) s"
  1670   apply(drule_tac c="-1" in has_integral_cmul) by auto
  1687   apply(drule_tac c="-1" in has_integral_cmul) by auto
  1671 
  1688 
  1672 lemma has_integral_add: fixes f::"'n::ordered_euclidean_space \<Rightarrow> 'a::real_normed_vector" 
  1689 lemma has_integral_add: fixes f::"'n::ordered_euclidean_space \<Rightarrow> 'a::real_normed_vector" 
  1743   unfolding integrable_on_def by(auto intro: has_integral_add)
  1760   unfolding integrable_on_def by(auto intro: has_integral_add)
  1744 
  1761 
  1745 lemma integrable_cmul:
  1762 lemma integrable_cmul:
  1746   shows "f integrable_on s \<Longrightarrow> (\<lambda>x. c *\<^sub>R f(x)) integrable_on s"
  1763   shows "f integrable_on s \<Longrightarrow> (\<lambda>x. c *\<^sub>R f(x)) integrable_on s"
  1747   unfolding integrable_on_def by(auto intro: has_integral_cmul)
  1764   unfolding integrable_on_def by(auto intro: has_integral_cmul)
       
  1765 
       
  1766 lemma integrable_on_cmult_iff:
       
  1767   fixes c :: real assumes "c \<noteq> 0"
       
  1768   shows "(\<lambda>x. c * f x) integrable_on s \<longleftrightarrow> f integrable_on s"
       
  1769   using integrable_cmul[of "\<lambda>x. c * f x" s "1 / c"] integrable_cmul[of f s c] `c \<noteq> 0`
       
  1770   by auto
  1748 
  1771 
  1749 lemma integrable_neg:
  1772 lemma integrable_neg:
  1750   shows "f integrable_on s \<Longrightarrow> (\<lambda>x. -f(x)) integrable_on s"
  1773   shows "f integrable_on s \<Longrightarrow> (\<lambda>x. -f(x)) integrable_on s"
  1751   unfolding integrable_on_def by(auto intro: has_integral_neg)
  1774   unfolding integrable_on_def by(auto intro: has_integral_neg)
  1752 
  1775 
  2667   unfolding has_integral apply(rule,rule,rule_tac x="\<lambda>x. ball x 1" in exI)
  2690   unfolding has_integral apply(rule,rule,rule_tac x="\<lambda>x. ball x 1" in exI)
  2668   apply(rule,rule gauge_trivial)apply(rule,rule,erule conjE)
  2691   apply(rule,rule gauge_trivial)apply(rule,rule,erule conjE)
  2669   unfolding split_def apply(subst scaleR_left.setsum[THEN sym, unfolded o_def])
  2692   unfolding split_def apply(subst scaleR_left.setsum[THEN sym, unfolded o_def])
  2670   defer apply(subst additive_content_tagged_division[unfolded split_def]) apply assumption by auto
  2693   defer apply(subst additive_content_tagged_division[unfolded split_def]) apply assumption by auto
  2671 
  2694 
       
  2695 lemma integral_const[simp]:
       
  2696   fixes a b :: "'a::ordered_euclidean_space"
       
  2697   shows "integral {a .. b} (\<lambda>x. c) = content {a .. b} *\<^sub>R c"
       
  2698   by (rule integral_unique) (rule has_integral_const)
       
  2699 
  2672 subsection {* Bounds on the norm of Riemann sums and the integral itself. *}
  2700 subsection {* Bounds on the norm of Riemann sums and the integral itself. *}
  2673 
  2701 
  2674 lemma dsum_bound: assumes "p division_of {a..b}" "norm(c) \<le> e"
  2702 lemma dsum_bound: assumes "p division_of {a..b}" "norm(c) \<le> e"
  2675   shows "norm(setsum (\<lambda>l. content l *\<^sub>R c) p) \<le> e * content({a..b})" (is "?l \<le> ?r")
  2703   shows "norm(setsum (\<lambda>l. content l *\<^sub>R c) p) \<le> e * content({a..b})" (is "?l \<le> ?r")
  2676   apply(rule order_trans,rule norm_setsum) unfolding norm_scaleR setsum_left_distrib[THEN sym]
  2704   apply(rule order_trans,rule norm_setsum) unfolding norm_scaleR setsum_left_distrib[THEN sym]