diff -r 6108dddad9f0 -r f0e07600de47 src/HOL/Analysis/Set_Integral.thy --- a/src/HOL/Analysis/Set_Integral.thy Tue Jan 17 11:26:21 2017 +0100 +++ b/src/HOL/Analysis/Set_Integral.thy Tue Jan 17 13:59:10 2017 +0100 @@ -14,7 +14,7 @@ lemma bij_inv_eq_iff: "bij p \ x = inv p y \ p x = y" (* COPIED FROM Permutations *) using surj_f_inv_f[of p] by (auto simp add: bij_def) -subsection {*Fun.thy*} +subsection \Fun.thy\ lemma inj_fn: fixes f::"'a \ 'a" @@ -129,7 +129,7 @@ shows "Inf K \ K" by (auto simp add: Min_def Inf_nat_def) (meson LeastI assms bot.extremum_unique subsetI) -subsection {*Liminf-Limsup.thy*} +subsection \Liminf-Limsup.thy\ lemma limsup_shift: "limsup (\n. u (n+1)) = limsup u" @@ -140,7 +140,7 @@ have b: "(INF n. (SUP m:{n+1..}. u m)) = (INF n:{1..}. (SUP m:{n..}. u m))" apply (rule INF_eq) using Suc_le_D by auto have "(INF n:{1..}. v n) = (INF n. v n)" if "decseq v" for v::"nat \ 'a" - apply (rule INF_eq) using `decseq v` decseq_Suc_iff by auto + apply (rule INF_eq) using \decseq v\ decseq_Suc_iff by auto moreover have "decseq (\n. (SUP m:{n..}. u m))" by (simp add: SUP_subset_mono decseq_def) ultimately have c: "(INF n:{1..}. (SUP m:{n..}. u m)) = (INF n. (SUP m:{n..}. u m))" by simp have "(INF n. SUPREMUM {n..} u) = (INF n. SUP m:{n..}. u (m + 1))" using a b c by simp @@ -164,7 +164,7 @@ have b: "(SUP n. (INF m:{n+1..}. u m)) = (SUP n:{1..}. (INF m:{n..}. u m))" apply (rule SUP_eq) using Suc_le_D by (auto) have "(SUP n:{1..}. v n) = (SUP n. v n)" if "incseq v" for v::"nat \ 'a" - apply (rule SUP_eq) using `incseq v` incseq_Suc_iff by auto + apply (rule SUP_eq) using \incseq v\ incseq_Suc_iff by auto moreover have "incseq (\n. (INF m:{n..}. u m))" by (simp add: INF_superset_mono mono_def) ultimately have c: "(SUP n:{1..}. (INF m:{n..}. u m)) = (SUP n. (INF m:{n..}. u m))" by simp have "(SUP n. INFIMUM {n..} u) = (SUP n. INF m:{n..}. u (m + 1))" using a b c by simp @@ -188,8 +188,8 @@ then show ?thesis by (metis eventually_True mem_Collect_eq less_INF_D less_SUP_iff) qed -text {* The next lemma is extremely useful, as it often makes it possible to reduce statements -about limsups to statements about limits.*} +text \The next lemma is extremely useful, as it often makes it possible to reduce statements +about limsups to statements about limits.\ lemma limsup_subseq_lim: fixes u::"nat \ 'a :: {complete_linorder, linorder_topology}" @@ -203,12 +203,12 @@ define umax where "umax = (\n. (SUP m:{n..}. u m))" have "decseq umax" unfolding umax_def by (simp add: SUP_subset_mono antimono_def) then have "umax \ limsup u" unfolding umax_def by (metis LIMSEQ_INF limsup_INF_SUP) - then have *: "(umax o r) \ limsup u" by (simp add: LIMSEQ_subseq_LIMSEQ `subseq r`) + then have *: "(umax o r) \ limsup u" by (simp add: LIMSEQ_subseq_LIMSEQ \subseq r\) have "\n. umax(r n) = u(r n)" unfolding umax_def using mono by (metis SUP_le_iff antisym atLeast_def mem_Collect_eq order_refl) then have "umax o r = u o r" unfolding o_def by simp then have "(u o r) \ limsup u" using * by simp - then show ?thesis using `subseq r` by blast + then show ?thesis using \subseq r\ by blast next assume "\ (\n. \p>n. (\m\p. u m \ u p))" then obtain N where N: "\p. p > N \ \m>p. u p < u m" by (force simp: not_le le_less) @@ -219,18 +219,18 @@ have "Max {u i |i. i \ {N<..x}} \ {u i |i. i \ {N<..x}}" apply (rule Max_in) using a by (auto) then obtain p where "p \ {N<..x}" and upmax: "u p = Max{u i |i. i \ {N<..x}}" by auto define U where "U = {m. m > p \ u p < u m}" - have "U \ {}" unfolding U_def using N[of p] `p \ {N<..x}` by auto + have "U \ {}" unfolding U_def using N[of p] \p \ {N<..x}\ by auto define y where "y = Inf U" - then have "y \ U" using `U \ {}` by (simp add: Inf_nat_def1) + then have "y \ U" using \U \ {}\ by (simp add: Inf_nat_def1) have a: "\i. i \ {N<..x} \ u i \ u p" proof - fix i assume "i \ {N<..x}" then have "u i \ {u i |i. i \ {N<..x}}" by blast then show "u i \ u p" using upmax by simp qed - moreover have "u p < u y" using `y \ U` U_def by auto + moreover have "u p < u y" using \y \ U\ U_def by auto ultimately have "y \ {N<..x}" using not_le by blast - moreover have "y > N" using `y \ U` U_def `p \ {N<..x}` by auto + moreover have "y > N" using \y \ U\ U_def \p \ {N<..x}\ by auto ultimately have "y > x" by auto have "\i. i \ {N<..y} \ u i \ u y" @@ -241,7 +241,7 @@ then show ?thesis by simp next assume "\(i=y)" - then have i:"i \ {N<.. {N<..y}` by simp + then have i:"i \ {N<..i \ {N<..y}\ by simp have "u i \ u p" proof (cases) assume "i \ x" @@ -250,15 +250,15 @@ next assume "\(i \ x)" then have "i > x" by simp - then have *: "i > p" using `p \ {N<..x}` by simp + then have *: "i > p" using \p \ {N<..x}\ by simp have "i < Inf U" using i y_def by simp then have "i \ U" using Inf_nat_def not_less_Least by auto then show ?thesis using U_def * by auto qed - then show "u i \ u y" using `u p < u y` by auto + then show "u i \ u y" using \u p < u y\ by auto qed qed - then have "N < y \ x < y \ (\i\{N<..y}. u i \ u y)" using `y > x` `y > N` by auto + then have "N < y \ x < y \ (\i\{N<..y}. u i \ u y)" using \y > x\ \y > N\ by auto then show "\y>N. x < y \ (\i\{N<..y}. u i \ u y)" by auto qed (auto) then obtain r where r: "\n. N < r n \ r n < r (Suc n) \ (\i\ {N<..r (Suc n)}. u i \ u (r (Suc n)))" by auto @@ -266,12 +266,12 @@ have "incseq (u o r)" unfolding o_def using r by (simp add: incseq_SucI order.strict_implies_order) then have "(u o r) \ (SUP n. (u o r) n)" using LIMSEQ_SUP by blast then have "limsup (u o r) = (SUP n. (u o r) n)" by (simp add: lim_imp_Limsup) - moreover have "limsup (u o r) \ limsup u" using `subseq r` by (simp add: limsup_subseq_mono) + moreover have "limsup (u o r) \ limsup u" using \subseq r\ by (simp add: limsup_subseq_mono) ultimately have "(SUP n. (u o r) n) \ limsup u" by simp { fix i assume i: "i \ {N<..}" - obtain n where "i < r (Suc n)" using `subseq r` using Suc_le_eq seq_suble by blast + obtain n where "i < r (Suc n)" using \subseq r\ using Suc_le_eq seq_suble by blast then have "i \ {N<..r(Suc n)}" using i by simp then have "u i \ u (r(Suc n))" using r by simp then have "u i \ (SUP n. (u o r) n)" unfolding o_def by (meson SUP_upper2 UNIV_I) @@ -279,9 +279,9 @@ then have "(SUP i:{N<..}. u i) \ (SUP n. (u o r) n)" using SUP_least by blast then have "limsup u \ (SUP n. (u o r) n)" unfolding Limsup_def by (metis (mono_tags, lifting) INF_lower2 atLeast_Suc_greaterThan atLeast_def eventually_ge_at_top mem_Collect_eq) - then have "limsup u = (SUP n. (u o r) n)" using `(SUP n. (u o r) n) \ limsup u` by simp - then have "(u o r) \ limsup u" using `(u o r) \ (SUP n. (u o r) n)` by simp - then show ?thesis using `subseq r` by auto + then have "limsup u = (SUP n. (u o r) n)" using \(SUP n. (u o r) n) \ limsup u\ by simp + then have "(u o r) \ limsup u" using \(u o r) \ (SUP n. (u o r) n)\ by simp + then show ?thesis using \subseq r\ by auto qed lemma liminf_subseq_lim: @@ -296,12 +296,12 @@ define umin where "umin = (\n. (INF m:{n..}. u m))" have "incseq umin" unfolding umin_def by (simp add: INF_superset_mono incseq_def) then have "umin \ liminf u" unfolding umin_def by (metis LIMSEQ_SUP liminf_SUP_INF) - then have *: "(umin o r) \ liminf u" by (simp add: LIMSEQ_subseq_LIMSEQ `subseq r`) + then have *: "(umin o r) \ liminf u" by (simp add: LIMSEQ_subseq_LIMSEQ \subseq r\) have "\n. umin(r n) = u(r n)" unfolding umin_def using mono by (metis le_INF_iff antisym atLeast_def mem_Collect_eq order_refl) then have "umin o r = u o r" unfolding o_def by simp then have "(u o r) \ liminf u" using * by simp - then show ?thesis using `subseq r` by blast + then show ?thesis using \subseq r\ by blast next assume "\ (\n. \p>n. (\m\p. u m \ u p))" then obtain N where N: "\p. p > N \ \m>p. u p > u m" by (force simp: not_le le_less) @@ -312,18 +312,18 @@ have "Min {u i |i. i \ {N<..x}} \ {u i |i. i \ {N<..x}}" apply (rule Min_in) using a by (auto) then obtain p where "p \ {N<..x}" and upmin: "u p = Min{u i |i. i \ {N<..x}}" by auto define U where "U = {m. m > p \ u p > u m}" - have "U \ {}" unfolding U_def using N[of p] `p \ {N<..x}` by auto + have "U \ {}" unfolding U_def using N[of p] \p \ {N<..x}\ by auto define y where "y = Inf U" - then have "y \ U" using `U \ {}` by (simp add: Inf_nat_def1) + then have "y \ U" using \U \ {}\ by (simp add: Inf_nat_def1) have a: "\i. i \ {N<..x} \ u i \ u p" proof - fix i assume "i \ {N<..x}" then have "u i \ {u i |i. i \ {N<..x}}" by blast then show "u i \ u p" using upmin by simp qed - moreover have "u p > u y" using `y \ U` U_def by auto + moreover have "u p > u y" using \y \ U\ U_def by auto ultimately have "y \ {N<..x}" using not_le by blast - moreover have "y > N" using `y \ U` U_def `p \ {N<..x}` by auto + moreover have "y > N" using \y \ U\ U_def \p \ {N<..x}\ by auto ultimately have "y > x" by auto have "\i. i \ {N<..y} \ u i \ u y" @@ -334,7 +334,7 @@ then show ?thesis by simp next assume "\(i=y)" - then have i:"i \ {N<.. {N<..y}` by simp + then have i:"i \ {N<..i \ {N<..y}\ by simp have "u i \ u p" proof (cases) assume "i \ x" @@ -343,15 +343,15 @@ next assume "\(i \ x)" then have "i > x" by simp - then have *: "i > p" using `p \ {N<..x}` by simp + then have *: "i > p" using \p \ {N<..x}\ by simp have "i < Inf U" using i y_def by simp then have "i \ U" using Inf_nat_def not_less_Least by auto then show ?thesis using U_def * by auto qed - then show "u i \ u y" using `u p > u y` by auto + then show "u i \ u y" using \u p > u y\ by auto qed qed - then have "N < y \ x < y \ (\i\{N<..y}. u i \ u y)" using `y > x` `y > N` by auto + then have "N < y \ x < y \ (\i\{N<..y}. u i \ u y)" using \y > x\ \y > N\ by auto then show "\y>N. x < y \ (\i\{N<..y}. u i \ u y)" by auto qed (auto) then obtain r where r: "\n. N < r n \ r n < r (Suc n) \ (\i\ {N<..r (Suc n)}. u i \ u (r (Suc n)))" by auto @@ -359,12 +359,12 @@ have "decseq (u o r)" unfolding o_def using r by (simp add: decseq_SucI order.strict_implies_order) then have "(u o r) \ (INF n. (u o r) n)" using LIMSEQ_INF by blast then have "liminf (u o r) = (INF n. (u o r) n)" by (simp add: lim_imp_Liminf) - moreover have "liminf (u o r) \ liminf u" using `subseq r` by (simp add: liminf_subseq_mono) + moreover have "liminf (u o r) \ liminf u" using \subseq r\ by (simp add: liminf_subseq_mono) ultimately have "(INF n. (u o r) n) \ liminf u" by simp { fix i assume i: "i \ {N<..}" - obtain n where "i < r (Suc n)" using `subseq r` using Suc_le_eq seq_suble by blast + obtain n where "i < r (Suc n)" using \subseq r\ using Suc_le_eq seq_suble by blast then have "i \ {N<..r(Suc n)}" using i by simp then have "u i \ u (r(Suc n))" using r by simp then have "u i \ (INF n. (u o r) n)" unfolding o_def by (meson INF_lower2 UNIV_I) @@ -372,15 +372,15 @@ then have "(INF i:{N<..}. u i) \ (INF n. (u o r) n)" using INF_greatest by blast then have "liminf u \ (INF n. (u o r) n)" unfolding Liminf_def by (metis (mono_tags, lifting) SUP_upper2 atLeast_Suc_greaterThan atLeast_def eventually_ge_at_top mem_Collect_eq) - then have "liminf u = (INF n. (u o r) n)" using `(INF n. (u o r) n) \ liminf u` by simp - then have "(u o r) \ liminf u" using `(u o r) \ (INF n. (u o r) n)` by simp - then show ?thesis using `subseq r` by auto + then have "liminf u = (INF n. (u o r) n)" using \(INF n. (u o r) n) \ liminf u\ by simp + then have "(u o r) \ liminf u" using \(u o r) \ (INF n. (u o r) n)\ by simp + then show ?thesis using \subseq r\ by auto qed -subsection {*Extended-Real.thy*} +subsection \Extended-Real.thy\ -text{* The proof of this one is copied from \verb+ereal_add_mono+. *} +text\The proof of this one is copied from \verb+ereal_add_mono+.\ lemma ereal_add_strict_mono2: fixes a b c d :: ereal assumes "a < b" @@ -392,7 +392,7 @@ apply (cases rule: ereal3_cases[of b c d], auto) done -text {* The next ones are analogues of \verb+mult_mono+ and \verb+mult_mono'+ in ereal.*} +text \The next ones are analogues of \verb+mult_mono+ and \verb+mult_mono'+ in ereal.\ lemma ereal_mult_mono: fixes a b c d::ereal @@ -411,7 +411,7 @@ assumes "b > 0" "c > 0" "a < b" "c < d" shows "a * c < b * d" proof - - have "c < \" using `c < d` by auto + have "c < \" using \c < d\ by auto then have "a * c < b * c" by (metis ereal_mult_strict_left_mono[OF assms(3) assms(2)] mult.commute) moreover have "b * c \ b * d" using assms(2) assms(4) by (simp add: assms(1) ereal_mult_left_mono less_imp_le) ultimately show ?thesis by simp @@ -465,13 +465,13 @@ qed -subsubsection {*Continuity of addition*} +subsubsection \Continuity of addition\ -text {*The next few lemmas remove an unnecessary assumption in \verb+tendsto_add_ereal+, culminating +text \The next few lemmas remove an unnecessary assumption in \verb+tendsto_add_ereal+, culminating in \verb+tendsto_add_ereal_general+ which essentially says that the addition is continuous on ereal times ereal, except at $(-\infty, \infty)$ and $(\infty, -\infty)$. It is much more convenient in many situations, see for instance the proof of -\verb+tendsto_sum_ereal+ below. *} +\verb+tendsto_sum_ereal+ below.\ lemma tendsto_add_ereal_PInf: fixes y :: ereal @@ -507,9 +507,9 @@ then show ?thesis by (simp add: tendsto_PInfty) qed -text{* One would like to deduce the next lemma from the previous one, but the fact +text\One would like to deduce the next lemma from the previous one, but the fact that $-(x+y)$ is in general different from $(-x) + (-y)$ in ereal creates difficulties, -so it is more efficient to copy the previous proof.*} +so it is more efficient to copy the previous proof.\ lemma tendsto_add_ereal_MInf: fixes y :: ereal @@ -574,8 +574,8 @@ ultimately show ?thesis by simp qed -text {* The next lemma says that the addition is continuous on ereal, except at -the pairs $(-\infty, \infty)$ and $(\infty, -\infty)$. *} +text \The next lemma says that the addition is continuous on ereal, except at +the pairs $(-\infty, \infty)$ and $(\infty, -\infty)$.\ lemma tendsto_add_ereal_general [tendsto_intros]: fixes x y :: ereal @@ -596,11 +596,11 @@ then show ?thesis using tendsto_add_ereal_MInf MInf f g by (metis ereal_MInfty_eq_plus) qed -subsubsection {*Continuity of multiplication*} +subsubsection \Continuity of multiplication\ -text {* In the same way as for addition, we prove that the multiplication is continuous on +text \In the same way as for addition, we prove that the multiplication is continuous on ereal times ereal, except at $(\infty, 0)$ and $(-\infty, 0)$ and $(0, \infty)$ and $(0, -\infty)$, -starting with specific situations.*} +starting with specific situations.\ lemma tendsto_mult_real_ereal: assumes "(u \ ereal l) F" "(v \ ereal m) F" @@ -631,15 +631,15 @@ shows "((\x. f x * g x) \ \) F" proof - obtain a::real where "0 < ereal a" "a < l" using assms(2) using ereal_dense2 by blast - have *: "eventually (\x. f x > a) F" using `a < l` assms(1) by (simp add: order_tendsto_iff) + have *: "eventually (\x. f x > a) F" using \a < l\ assms(1) by (simp add: order_tendsto_iff) { fix K::real define M where "M = max K 1" then have "M > 0" by simp - then have "ereal(M/a) > 0" using `ereal a > 0` by simp + then have "ereal(M/a) > 0" using \ereal a > 0\ by simp then have "\x. ((f x > a) \ (g x > M/a)) \ (f x * g x > ereal a * ereal(M/a))" - using ereal_mult_mono_strict'[where ?c = "M/a", OF `0 < ereal a`] by auto - moreover have "ereal a * ereal(M/a) = M" using `ereal a > 0` by simp + using ereal_mult_mono_strict'[where ?c = "M/a", OF \0 < ereal a\] by auto + moreover have "ereal a * ereal(M/a) = M" using \ereal a > 0\ by simp ultimately have "\x. ((f x > a) \ (g x > M/a)) \ (f x * g x > M)" by simp moreover have "M \ K" unfolding M_def by simp ultimately have Imp: "\x. ((f x > a) \ (g x > M/a)) \ (f x * g x > K)" @@ -674,13 +674,13 @@ assume "\(l = \ \ m = \)" then have "l < \" "m < \" by auto then obtain lr mr where "l = ereal lr" "m = ereal mr" - using `l>0` `m>0` by (metis ereal_cases ereal_less(6) not_less_iff_gr_or_eq) + using \l>0\ \m>0\ by (metis ereal_cases ereal_less(6) not_less_iff_gr_or_eq) then show ?thesis using tendsto_mult_real_ereal assms by auto qed -text {*We reduce the general situation to the positive case by multiplying by suitable signs. +text \We reduce the general situation to the positive case by multiplying by suitable signs. Unfortunately, as ereal is not a ring, all the neat sign lemmas are not available there. We -give the bare minimum we need.*} +give the bare minimum we need.\ lemma ereal_sgn_abs: fixes l::ereal @@ -720,9 +720,9 @@ have "((\x. (sgn(l) * sgn(m)) * ((sgn(l) * f x) * (sgn(m) * g x))) \ (sgn(l) * sgn(m)) * ((sgn(l) * l) * (sgn(m) * m))) F" by (rule tendsto_cmult_ereal, auto simp add: sgn_finite2 *) moreover have "\x. (sgn(l) * sgn(m)) * ((sgn(l) * f x) * (sgn(m) * g x)) = f x * g x" - by (metis mult.left_neutral sgn_squared_ereal[OF `l \ 0`] sgn_squared_ereal[OF `m \ 0`] mult.assoc mult.commute) + by (metis mult.left_neutral sgn_squared_ereal[OF \l \ 0\] sgn_squared_ereal[OF \m \ 0\] mult.assoc mult.commute) moreover have "(sgn(l) * sgn(m)) * ((sgn(l) * l) * (sgn(m) * m)) = l * m" - by (metis mult.left_neutral sgn_squared_ereal[OF `l \ 0`] sgn_squared_ereal[OF `m \ 0`] mult.assoc mult.commute) + by (metis mult.left_neutral sgn_squared_ereal[OF \l \ 0\] sgn_squared_ereal[OF \m \ 0\] mult.assoc mult.commute) ultimately show ?thesis by auto qed @@ -733,7 +733,7 @@ by (cases "c = 0", auto simp add: assms tendsto_mult_ereal) -subsubsection {*Continuity of division*} +subsubsection \Continuity of division\ lemma tendsto_inverse_ereal_PInf: fixes u::"_ \ ereal" @@ -747,9 +747,9 @@ moreover { fix z::ereal assume "z>1/e" - then have "z>0" using `e>0` using less_le_trans not_le by fastforce + then have "z>0" using \e>0\ using less_le_trans not_le by fastforce then have "1/z \ 0" by auto - moreover have "1/z < e" using `e>0` `z>1/e` + moreover have "1/z < e" using \e>0\ \z>1/e\ apply (cases z) apply auto by (metis (mono_tags, hide_lams) less_ereal.simps(2) less_ereal.simps(4) divide_less_eq ereal_divide_less_pos ereal_less(4) ereal_less_eq(4) less_le_trans mult_eq_0_iff not_le not_one_less_zero times_ereal.simps(1)) @@ -765,11 +765,11 @@ fix a::ereal assume "a>0" then obtain e::real where "e>0" "a>e" using ereal_dense2 ereal_less(2) by blast then have "eventually (\n. 1/u n < e) F" using *(1) by auto - then show "eventually (\n. 1/u n < a) F" using `a>e` by (metis (mono_tags, lifting) eventually_mono less_trans) + then show "eventually (\n. 1/u n < a) F" using \a>e\ by (metis (mono_tags, lifting) eventually_mono less_trans) qed qed -text {* The next lemma deserves to exist by itself, as it is so common and useful. *} +text \The next lemma deserves to exist by itself, as it is so common and useful.\ lemma tendsto_inverse_real [tendsto_intros]: fixes u::"_ \ real" @@ -836,7 +836,7 @@ qed -subsubsection {*Further limits*} +subsubsection \Further limits\ lemma id_nat_ereal_tendsto_PInf [tendsto_intros]: "(\ n::nat. real n) \ \" @@ -860,8 +860,8 @@ proof (rule ccontr) assume "\(N > C)" have "u N \ Max {u n| n. n \ C}" - apply (rule Max_ge) using `\(N > C)` by auto - then show False using `u N \ n` `n \ M` unfolding M_def by auto + apply (rule Max_ge) using \\(N > C)\ by auto + then show False using \u N \ n\ \n \ M\ unfolding M_def by auto qed then have **: "{N. u N \ n} \ {C..}" by fastforce have "Inf {N. u N \ n} \ C" @@ -981,7 +981,7 @@ ultimately show ?thesis using MInf by auto qed (simp add: assms) -text {* the next one is copied from \verb+tendsto_sum+. *} +text \the next one is copied from \verb+tendsto_sum+.\ lemma tendsto_sum_ereal [tendsto_intros]: fixes f :: "'a \ 'b \ ereal" assumes "\i. i \ S \ (f i \ a i) F" @@ -992,7 +992,7 @@ by (induct, simp, simp add: tendsto_add_ereal_general2 assms) qed(simp) -subsubsection {*Limsups and liminfs*} +subsubsection \Limsups and liminfs\ lemma limsup_finite_then_bounded: fixes u::"nat \ real" @@ -1017,7 +1017,7 @@ assume "\(n \ N)" then have "n \ N" by simp then have "u n < C" using N by auto - then have "u n < real_of_ereal C" using `C = ereal(real_of_ereal C)` less_ereal.simps(1) by fastforce + then have "u n < real_of_ereal C" using \C = ereal(real_of_ereal C)\ less_ereal.simps(1) by fastforce then show "u n \ D" unfolding D_def by linarith qed qed @@ -1047,7 +1047,7 @@ assume "\(n \ N)" then have "n \ N" by simp then have "u n > C" using N by auto - then have "u n > real_of_ereal C" using `C = ereal(real_of_ereal C)` less_ereal.simps(1) by fastforce + then have "u n > real_of_ereal C" using \C = ereal(real_of_ereal C)\ less_ereal.simps(1) by fastforce then show "u n \ D" unfolding D_def by linarith qed qed @@ -1060,9 +1060,9 @@ shows "\N>k. u N < l" by (metis assms gt_ex less_le_trans liminf_bounded_iff not_less) -text {* The following statement about limsups is reduced to a statement about limits using +text \The following statement about limsups is reduced to a statement about limits using subsequences thanks to \verb+limsup_subseq_lim+. The statement for limits follows for instance from -\verb+tendsto_add_ereal_general+.*} +\verb+tendsto_add_ereal_general+.\ lemma ereal_limsup_add_mono: fixes u v::"nat \ ereal" @@ -1091,9 +1091,9 @@ done have "limsup (u o r) \ limsup u" by (simp add: limsup_subseq_mono r(1)) - then have a: "limsup (u o r) \ \" using `limsup u < \` by auto + then have a: "limsup (u o r) \ \" using \limsup u < \\ by auto have "limsup (v o r o s) \ limsup v" by (simp add: comp_assoc limsup_subseq_mono r(1) s(1) subseq_o) - then have b: "limsup (v o r o s) \ \" using `limsup v < \` by auto + then have b: "limsup (v o r o s) \ \" using \limsup v < \\ by auto have "(\n. (u o a) n + (v o a) n) \ limsup (u o r) + limsup (v o r o s)" using l tendsto_add_ereal_general a b by fastforce @@ -1101,13 +1101,13 @@ ultimately have "(w o a) \ limsup (u o r) + limsup (v o r o s)" by simp then have "limsup w = limsup (u o r) + limsup (v o r o s)" using l(1) LIMSEQ_unique by blast then have "limsup w \ limsup u + limsup v" - using `limsup (u o r) \ limsup u` `limsup (v o r o s) \ limsup v` ereal_add_mono by simp + using \limsup (u o r) \ limsup u\ \limsup (v o r o s) \ limsup v\ ereal_add_mono by simp then show ?thesis unfolding w_def by simp qed -text {* There is an asymmetry between liminfs and limsups in ereal, as $\infty + (-\infty) = \infty$. +text \There is an asymmetry between liminfs and limsups in ereal, as $\infty + (-\infty) = \infty$. This explains why there are more assumptions in the next lemma dealing with liminfs that in the -previous one about limsups.*} +previous one about limsups.\ lemma ereal_liminf_add_mono: fixes u v::"nat \ ereal" @@ -1137,9 +1137,9 @@ done have "liminf (u o r) \ liminf u" by (simp add: liminf_subseq_mono r(1)) - then have a: "liminf (u o r) \ -\" using `liminf u > -\` by auto + then have a: "liminf (u o r) \ -\" using \liminf u > -\\ by auto have "liminf (v o r o s) \ liminf v" by (simp add: comp_assoc liminf_subseq_mono r(1) s(1) subseq_o) - then have b: "liminf (v o r o s) \ -\" using `liminf v > -\` by auto + then have b: "liminf (v o r o s) \ -\" using \liminf v > -\\ by auto have "(\n. (u o a) n + (v o a) n) \ liminf (u o r) + liminf (v o r o s)" using l tendsto_add_ereal_general a b by fastforce @@ -1147,7 +1147,7 @@ ultimately have "(w o a) \ liminf (u o r) + liminf (v o r o s)" by simp then have "liminf w = liminf (u o r) + liminf (v o r o s)" using l(1) LIMSEQ_unique by blast then have "liminf w \ liminf u + liminf v" - using `liminf (u o r) \ liminf u` `liminf (v o r o s) \ liminf v` ereal_add_mono by simp + using \liminf (u o r) \ liminf u\ \liminf (v o r o s) \ liminf v\ ereal_add_mono by simp then show ?thesis unfolding w_def by simp qed @@ -1162,7 +1162,7 @@ have "limsup (\n. u n + v n) \ limsup u + limsup v" by (rule ereal_limsup_add_mono) - then have up: "limsup (\n. u n + v n) \ a + limsup v" using `limsup u = a` by simp + then have up: "limsup (\n. u n + v n) \ a + limsup v" using \limsup u = a\ by simp have a: "limsup (\n. (u n + v n) + (-u n)) \ limsup (\n. u n + v n) + limsup (\n. -u n)" by (rule ereal_limsup_add_mono) @@ -1177,7 +1177,7 @@ ultimately have "eventually (\n. u n + v n + (-u n) = v n) sequentially" using eventually_mono by force then have "limsup v = limsup (\n. u n + v n + (-u n))" using Limsup_eq by force - then have "limsup v \ limsup (\n. u n + v n) -a" using a `limsup (\n. -u n) = -a` by (simp add: minus_ereal_def) + then have "limsup v \ limsup (\n. u n + v n) -a" using a \limsup (\n. -u n) = -a\ by (simp add: minus_ereal_def) then have "limsup (\n. u n + v n) \ a + limsup v" using assms(2) by (metis add.commute ereal_le_minus) then show ?thesis using up by simp qed @@ -1255,7 +1255,7 @@ have "liminf (\n. u n + v n) \ liminf u + liminf v" apply (rule ereal_liminf_add_mono) using * by auto - then have up: "liminf (\n. u n + v n) \ a + liminf v" using `liminf u = a` by simp + then have up: "liminf (\n. u n + v n) \ a + liminf v" using \liminf u = a\ by simp have a: "liminf (\n. (u n + v n) + (-u n)) \ liminf (\n. u n + v n) + liminf (\n. -u n)" apply (rule ereal_liminf_add_mono) using ** by auto @@ -1270,7 +1270,7 @@ ultimately have "eventually (\n. u n + v n + (-u n) = v n) sequentially" using eventually_mono by force then have "liminf v = liminf (\n. u n + v n + (-u n))" using Liminf_eq by force - then have "liminf v \ liminf (\n. u n + v n) -a" using a `liminf (\n. -u n) = -a` by (simp add: minus_ereal_def) + then have "liminf v \ liminf (\n. u n + v n) -a" using a \liminf (\n. -u n) = -a\ by (simp add: minus_ereal_def) then have "liminf (\n. u n + v n) \ a + liminf v" using assms(2) by (metis add.commute ereal_minus_le) then show ?thesis using up by simp qed @@ -1302,15 +1302,15 @@ have "liminf (w o r) \ liminf w" by (simp add: liminf_subseq_mono r(1)) have "limsup (v o r o s) \ limsup v" by (simp add: comp_assoc limsup_subseq_mono r(1) s(1) subseq_o) - then have b: "limsup (v o r o s) < \" using `limsup v < \` by auto + then have b: "limsup (v o r o s) < \" using \limsup v < \\ by auto have "(\n. (u o a) n + (v o a) n) \ liminf u + limsup (v o r o s)" - apply (rule tendsto_add_ereal_general) using b `liminf u < \` l(1) l(3) by force+ + apply (rule tendsto_add_ereal_general) using b \liminf u < \\ l(1) l(3) by force+ moreover have "(\n. (u o a) n + (v o a) n) = (w o a)" unfolding w_def by auto ultimately have "(w o a) \ liminf u + limsup (v o r o s)" by simp then have "liminf (w o r) = liminf u + limsup (v o r o s)" using l(2) using LIMSEQ_unique by blast then have "liminf w \ liminf u + limsup v" - using `liminf (w o r) \ liminf w` `limsup (v o r o s) \ limsup v` + using \liminf (w o r) \ liminf w\ \limsup (v o r o s) \ limsup v\ by (metis add_mono_thms_linordered_semiring(2) le_less_trans not_less) then show ?thesis unfolding w_def by simp qed @@ -1858,8 +1858,8 @@ by (rule set_borel_measurable_continuous[OF _ assms]) simp -text{* This notation is from Sébastien Gouëzel: His use is not directly in line with the -notations in this file, they are more in line with sum, and more readable he thinks. *} +text\This notation is from Sébastien Gouëzel: His use is not directly in line with the +notations in this file, they are more in line with sum, and more readable he thinks.\ abbreviation "set_nn_integral M A f \ nn_integral M (\x. f x * indicator A x)" @@ -1921,7 +1921,7 @@ assume "x \ (\n. B n)" then obtain n where "x \ B n" by blast have a: "finite {n}" by simp - have "\i. i \ n \ x \ B i" using `x \ B n` assms(3) disjoint_family_on_def + have "\i. i \ n \ x \ B i" using \x \ B n\ assms(3) disjoint_family_on_def by (metis IntI UNIV_I empty_iff) then have "\i. i \ {n} \ indicator (B i) x = (0::ennreal)" using indicator_def by simp then have b: "\i. i \ {n} \ f x * indicator (B i) x = (0::ennreal)" by simp @@ -1932,14 +1932,14 @@ by (metis sums_unique[OF sums_finite[OF a]]) then have "(\i. h i) = h n" by simp then have "(\n. f x * indicator (B n) x) = f x * indicator (B n) x" using h_def by simp - then have "(\n. f x * indicator (B n) x) = f x" using `x \ B n` indicator_def by simp - then show ?thesis using `x \ (\n. B n)` by auto + then have "(\n. f x * indicator (B n) x) = f x" using \x \ B n\ indicator_def by simp + then show ?thesis using \x \ (\n. B n)\ by auto next assume "x \ (\n. B n)" then have "\n. f x * indicator (B n) x = 0" by simp have "(\n. f x * indicator (B n) x) = 0" - by (simp add: `\n. f x * indicator (B n) x = 0`) - then show ?thesis using `x \ (\n. B n)` by auto + by (simp add: \\n. f x * indicator (B n) x = 0\) + then show ?thesis using \x \ (\n. B n)\ by auto qed ultimately show ?thesis by simp qed @@ -2035,14 +2035,14 @@ proof - have "AE x in M. indicator A x * f x = 0" apply (subst integral_nonneg_eq_0_iff_AE[symmetric]) - using assms integrable_mult_indicator[OF `A \ sets M` assms(1)] by auto + using assms integrable_mult_indicator[OF \A \ sets M\ assms(1)] by auto then have "AE x\A in M. f x = 0" by auto then have "AE x\A in M. False" using assms(3) by auto then show "A \ null_sets M" using assms(2) by (simp add: AE_iff_null_sets) qed -text{*The next lemma is a variant of \density_unique\. Note that it uses the notation -for nonnegative set integrals introduced earlier.*} +text\The next lemma is a variant of \density_unique\. Note that it uses the notation +for nonnegative set integrals introduced earlier.\ lemma (in sigma_finite_measure) density_unique2: assumes [measurable]: "f \ borel_measurable M" "f' \ borel_measurable M" @@ -2054,9 +2054,9 @@ qed (auto simp add: assms) -text {* The next lemma implies the same statement for Banach-space valued functions +text \The next lemma implies the same statement for Banach-space valued functions using Hahn-Banach theorem and linear forms. Since they are not yet easily available, I -only formulate it for real-valued functions.*} +only formulate it for real-valued functions.\ lemma density_unique_real: fixes f f'::"_ \ real" @@ -2067,7 +2067,7 @@ define A where "A = {x \ space M. f x < f' x}" then have [measurable]: "A \ sets M" by simp have "(\x \ A. (f' x - f x) \M) = (\x \ A. f' x \M) - (\x \ A. f x \M)" - using `A \ sets M` assms(1) assms(2) integrable_mult_indicator by blast + using \A \ sets M\ assms(1) assms(2) integrable_mult_indicator by blast then have "(\x \ A. (f' x - f x) \M) = 0" using assms(3) by simp then have "A \ null_sets M" using A_def null_if_pos_func_has_zero_int[where ?f = "\x. f' x - f x" and ?A = A] assms by auto @@ -2078,7 +2078,7 @@ define B where "B = {x \ space M. f' x < f x}" then have [measurable]: "B \ sets M" by simp have "(\x \ B. (f x - f' x) \M) = (\x \ B. f x \M) - (\x \ B. f' x \M)" - using `B \ sets M` assms(1) assms(2) integrable_mult_indicator by blast + using \B \ sets M\ assms(1) assms(2) integrable_mult_indicator by blast then have "(\x \ B. (f x - f' x) \M) = 0" using assms(3) by simp then have "B \ null_sets M" using B_def null_if_pos_func_has_zero_int[where ?f = "\x. f x - f' x" and ?A = B] assms by auto @@ -2088,13 +2088,13 @@ then show ?thesis using * by auto qed -text {* The next lemma shows that $L^1$ convergence of a sequence of functions follows from almost +text \The next lemma shows that $L^1$ convergence of a sequence of functions follows from almost everywhere convergence and the weaker condition of the convergence of the integrated norms (or even just the nontrivial inequality about them). Useful in a lot of contexts! This statement (or its variations) are known as Scheffe lemma. The formalization is more painful as one should jump back and forth between reals and ereals and justify -all the time positivity or integrability (thankfully, measurability is handled more or less automatically).*} +all the time positivity or integrability (thankfully, measurability is handled more or less automatically).\ lemma Scheffe_lemma1: assumes "\n. integrable M (F n)" "integrable M f"