# HG changeset patch # User eberlm # Date 1502974376 -7200 # Node ID a1f5c5c26fa676b2f7e8bb9f3def7f459830b9ec # Parent 407de076812651abf429562f3bbf8e434927d64c Replaced subseq with strict_mono diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Bochner_Integration.thy --- a/src/HOL/Analysis/Bochner_Integration.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Bochner_Integration.thy Thu Aug 17 14:52:56 2017 +0200 @@ -2128,7 +2128,7 @@ fixes u :: "nat \ 'a \ 'b::{banach, second_countable_topology}" assumes [measurable]: "\n. integrable M (u n)" and "(\n. (\x. norm(u n x) \M)) \ 0" - shows "\r. subseq r \ (AE x in M. (\n. u (r n) x) \ 0)" + shows "\r::nat\nat. strict_mono r \ (AE x in M. (\n. u (r n) x) \ 0)" proof - { fix k @@ -2140,13 +2140,13 @@ } then have "\r. \n. True \ (r (Suc n) > r n \ (\x. norm(u (r (Suc n)) x) \M) < (1/2)^(r n))" by (intro dependent_nat_choice, auto) - then obtain r0 where r0: "subseq r0" "\n. (\x. norm(u (r0 (Suc n)) x) \M) < (1/2)^(r0 n)" - by (auto simp: subseq_Suc_iff) + then obtain r0 where r0: "strict_mono r0" "\n. (\x. norm(u (r0 (Suc n)) x) \M) < (1/2)^(r0 n)" + by (auto simp: strict_mono_Suc_iff) define r where "r = (\n. r0(n+1))" - have "subseq r" unfolding r_def using r0(1) by (simp add: subseq_Suc_iff) + have "strict_mono r" unfolding r_def using r0(1) by (simp add: strict_mono_Suc_iff) have I: "(\\<^sup>+x. norm(u (r n) x) \M) < ennreal((1/2)^n)" for n proof - - have "r0 n \ n" using \subseq r0\ by (simp add: seq_suble) + have "r0 n \ n" using \strict_mono r0\ by (simp add: seq_suble) have "(1/2::real)^(r0 n) \ (1/2)^n" by (rule power_decreasing[OF \r0 n \ n\], auto) then have "(\x. norm(u (r0 (Suc n)) x) \M) < (1/2)^n" using r0(2) less_le_trans by auto then have "(\x. norm(u (r n) x) \M) < (1/2)^n" unfolding r_def by auto @@ -2219,7 +2219,7 @@ by (simp add: tendsto_norm_zero_iff) } ultimately have "AE x in M. (\n. u (r n) x) \ 0" by auto - then show ?thesis using \subseq r\ by auto + then show ?thesis using \strict_mono r\ by auto qed subsection \Restricted measure spaces\ diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Bounded_Linear_Function.thy --- a/src/HOL/Analysis/Bounded_Linear_Function.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Bounded_Linear_Function.thy Thu Aug 17 14:52:56 2017 +0200 @@ -476,8 +476,8 @@ lemma compact_blinfun_lemma: fixes f :: "nat \ 'a::euclidean_space \\<^sub>L 'b::euclidean_space" assumes "bounded (range f)" - shows "\d\Basis. \l::'a \\<^sub>L 'b. \ r. - subseq r \ (\e>0. eventually (\n. \i\d. dist (f (r n) i) (l i) < e) sequentially)" + shows "\d\Basis. \l::'a \\<^sub>L 'b. \ r::nat\nat. + strict_mono r \ (\e>0. eventually (\n. \i\d. dist (f (r n) i) (l i) < e) sequentially)" by (rule compact_lemma_general[where unproj = "\e. blinfun_of_matrix (\i j. e j \ i)"]) (auto intro!: euclidean_eqI[where 'a='b] bounded_linear_image assms simp: blinfun_of_matrix_works blinfun_of_matrix_apply inner_Basis mult_if_delta sum.delta' @@ -501,7 +501,7 @@ proof fix f :: "nat \ 'a \\<^sub>L 'b" assume f: "bounded (range f)" - then obtain l::"'a \\<^sub>L 'b" and r where r: "subseq r" + then obtain l::"'a \\<^sub>L 'b" and r where r: "strict_mono r" and l: "\e>0. eventually (\n. \i\Basis. dist (f (r n) i) (l i) < e) sequentially" using compact_blinfun_lemma [OF f] by blast { @@ -545,7 +545,7 @@ } then have *: "((f \ r) \ l) sequentially" unfolding o_def tendsto_iff by simp - with r show "\l r. subseq r \ ((f \ r) \ l) sequentially" + with r show "\l r. strict_mono r \ ((f \ r) \ l) sequentially" by auto qed diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Cartesian_Euclidean_Space.thy --- a/src/HOL/Analysis/Cartesian_Euclidean_Space.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Cartesian_Euclidean_Space.thy Thu Aug 17 14:52:56 2017 +0200 @@ -957,7 +957,7 @@ lemma compact_lemma_cart: fixes f :: "nat \ 'a::heine_borel ^ 'n" assumes f: "bounded (range f)" - shows "\l r. subseq r \ + shows "\l r. strict_mono r \ (\e>0. eventually (\n. \i\d. dist (f (r n) $ i) (l $ i) < e) sequentially)" (is "?th d") proof - @@ -971,7 +971,7 @@ proof fix f :: "nat \ 'a ^ 'b" assume f: "bounded (range f)" - then obtain l r where r: "subseq r" + then obtain l r where r: "strict_mono r" and l: "\e>0. eventually (\n. \i\UNIV. dist (f (r n) $ i) (l $ i) < e) sequentially" using compact_lemma_cart [OF f] by blast let ?d = "UNIV::'b set" @@ -993,7 +993,7 @@ by (rule eventually_mono) } hence "((f \ r) \ l) sequentially" unfolding o_def tendsto_iff by simp - with r show "\l r. subseq r \ ((f \ r) \ l) sequentially" by auto + with r show "\l r. strict_mono r \ ((f \ r) \ l) sequentially" by auto qed lemma interval_cart: diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Complex_Transcendental.thy --- a/src/HOL/Analysis/Complex_Transcendental.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Complex_Transcendental.thy Thu Aug 17 14:52:56 2017 +0200 @@ -2420,7 +2420,7 @@ intro!: mult_pos_pos divide_pos_pos always_eventually) thus "summable (\n. g n * u^n)" by (subst summable_mono_reindex[of "\n. 2*n+1", symmetric]) - (auto simp: power_mult subseq_def g_def h_def elim!: oddE) + (auto simp: power_mult strict_mono_def g_def h_def elim!: oddE) qed (simp add: h_def) have "\c. \u\ball 0 1. Arctan u - G u = c" @@ -2436,7 +2436,7 @@ by (intro ext) (simp_all del: of_nat_Suc add: g_def diffs_def power_mult_distrib) also have "suminf \ = (\n. (-(u^2))^n)" by (subst suminf_mono_reindex[of "\n. 2*n", symmetric]) - (auto elim!: evenE simp: subseq_def power_mult power_mult_distrib) + (auto elim!: evenE simp: strict_mono_def power_mult power_mult_distrib) also from u have "norm u^2 < 1^2" by (intro power_strict_mono) simp_all hence "(\n. (-(u^2))^n) = inverse (1 + u^2)" by (subst suminf_geometric) (simp_all add: norm_power inverse_eq_divide) @@ -2450,7 +2450,7 @@ with c z have "Arctan z = G z" by simp with summable[OF z] show "(\n. g n * z^n) sums Arctan z" unfolding G_def by (simp add: sums_iff) thus "h z sums Arctan z" by (subst (asm) sums_mono_reindex[of "\n. 2*n+1", symmetric]) - (auto elim!: oddE simp: subseq_def power_mult g_def h_def) + (auto elim!: oddE simp: strict_mono_def power_mult g_def h_def) qed text \A quickly-converging series for the logarithm, based on the arctangent.\ diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Gamma_Function.thy --- a/src/HOL/Analysis/Gamma_Function.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Gamma_Function.thy Thu Aug 17 14:52:56 2017 +0200 @@ -101,7 +101,7 @@ also have "(\n. sin_coeff n *\<^sub>R z^n) sums sin z \ (\n. ((-1)^n / fact (2*n+1)) *\<^sub>R z^(2*n+1)) sums sin z" by (subst sums_mono_reindex[of "\n. 2*n+1", symmetric]) - (auto simp: sin_coeff_def subseq_def ac_simps elim!: oddE) + (auto simp: sin_coeff_def strict_mono_def ac_simps elim!: oddE) finally show ?thesis . qed @@ -111,7 +111,7 @@ also have "(\n. cos_coeff n *\<^sub>R z^n) sums cos z \ (\n. ((-1)^n / fact (2*n)) *\<^sub>R z^(2*n)) sums cos z" by (subst sums_mono_reindex[of "\n. 2*n", symmetric]) - (auto simp: cos_coeff_def subseq_def ac_simps elim!: evenE) + (auto simp: cos_coeff_def strict_mono_def ac_simps elim!: evenE) finally show ?thesis . qed @@ -2038,7 +2038,7 @@ hence "?g \ ?powr 2 (2*z) * Gamma z * Gamma (z+1/2) / Gamma (2*z)" using LIMSEQ_subseq_LIMSEQ[OF Gamma_series'_LIMSEQ, of "op*2" "2*z"] by (intro tendsto_intros Gamma_series'_LIMSEQ) - (simp_all add: o_def subseq_def Gamma_eq_zero_iff) + (simp_all add: o_def strict_mono_def Gamma_eq_zero_iff) ultimately have "?h \ ?powr 2 (2*z) * Gamma z * Gamma (z+1/2) / Gamma (2*z)" by (rule Lim_transform_eventually) } note lim = this diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Great_Picard.thy --- a/src/HOL/Analysis/Great_Picard.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Great_Picard.thy Thu Aug 17 14:52:56 2017 +0200 @@ -618,22 +618,22 @@ lemma subsequence_diagonalization_lemma: fixes P :: "nat \ (nat \ 'a) \ bool" - assumes sub: "\i r. \k. subseq k \ P i (r \ k)" + assumes sub: "\i r. \k. strict_mono (k :: nat \ nat) \ P i (r \ k)" and P_P: "\i r::nat \ 'a. \k1 k2 N. \P i (r \ k1); \j. N \ j \ \j'. j \ j' \ k2 j = k1 j'\ \ P i (r \ k2)" - obtains k where "subseq k" "\i. P i (r \ k)" + obtains k where "strict_mono (k :: nat \ nat)" "\i. P i (r \ k)" proof - - obtain kk where "\i r. subseq (kk i r) \ P i (r \ (kk i r))" + obtain kk where "\i r. strict_mono (kk i r :: nat \ nat) \ P i (r \ (kk i r))" using sub by metis - then have sub_kk: "\i r. subseq (kk i r)" and P_kk: "\i r. P i (r \ (kk i r))" + then have sub_kk: "\i r. strict_mono (kk i r)" and P_kk: "\i r. P i (r \ (kk i r))" by auto define rr where "rr \ rec_nat (kk 0 r) (\n x. x \ kk (Suc n) (r \ x))" then have [simp]: "rr 0 = kk 0 r" "\n. rr(Suc n) = rr n \ kk (Suc n) (r \ rr n)" by auto show thesis proof - have sub_rr: "subseq (rr i)" for i - using sub_kk by (induction i) (auto simp: subseq_def o_def) + have sub_rr: "strict_mono (rr i)" for i + using sub_kk by (induction i) (auto simp: strict_mono_def o_def) have P_rr: "P i (r \ rr i)" for i using P_kk by (induction i) (auto simp: o_def) have "i \ i+d \ rr i n \ rr (i+d) n" for d i n @@ -643,13 +643,13 @@ next case (Suc d) then show ?case apply simp - using seq_suble [OF sub_kk] order_trans subseq_le_mono [OF sub_rr] by blast + using seq_suble [OF sub_kk] order_trans strict_mono_less_eq [OF sub_rr] by blast qed then have "\i j n. i \ j \ rr i n \ rr j n" by (metis le_iff_add) - show "subseq (\n. rr n n)" - apply (simp add: subseq_Suc_iff) - by (meson Suc_le_eq seq_suble sub_kk sub_rr subseq_mono) + show "strict_mono (\n. rr n n)" + apply (simp add: strict_mono_Suc_iff) + by (meson lessI less_le_trans seq_suble strict_monoD sub_kk sub_rr) have "\j. i \ j \ rr (n+d) i = rr n j" for d n i apply (induction d arbitrary: i, auto) by (meson order_trans seq_suble sub_kk) @@ -663,19 +663,19 @@ lemma function_convergent_subsequence: fixes f :: "[nat,'a] \ 'b::{real_normed_vector,heine_borel}" assumes "countable S" and M: "\n::nat. \x. x \ S \ norm(f n x) \ M" - obtains k where "subseq k" "\x. x \ S \ \l. (\n. f (k n) x) \ l" + obtains k where "strict_mono (k::nat\nat)" "\x. x \ S \ \l. (\n. f (k n) x) \ l" proof (cases "S = {}") case True then show ?thesis - using subseq_id that by fastforce + using strict_mono_id that by fastforce next case False with \countable S\ obtain \ :: "nat \ 'a" where \: "S = range \" using uncountable_def by blast - obtain k where "subseq k" and k: "\i. \l. (\n. (f \ k) n (\ i)) \ l" + obtain k where "strict_mono k" and k: "\i. \l. (\n. (f \ k) n (\ i)) \ l" proof (rule subsequence_diagonalization_lemma [of "\i r. \l. ((\n. (f \ r) n (\ i)) \ l) sequentially" id]) - show "\k. subseq k \ (\l. (\n. (f \ (r \ k)) n (\ i)) \ l)" for i r + show "\k::nat\nat. strict_mono k \ (\l. (\n. (f \ (r \ k)) n (\ i)) \ l)" for i r proof - have "f (r n) (\ i) \ cball 0 M" for n by (simp add: \ M) @@ -705,7 +705,7 @@ and equicont: "\x e. \x \ S; 0 < e\ \ \d. 0 < d \ (\n y. y \ S \ norm(x - y) < d \ norm(\ n x - \ n y) < e)" - obtains g k where "continuous_on S g" "subseq k" + obtains g k where "continuous_on S g" "strict_mono (k :: nat \ nat)" "\e. 0 < e \ \N. \n x. n \ N \ x \ S \ norm(\(k n) x - g x) < e" proof - have UEQ: "\e. 0 < e \ \d. 0 < d \ (\n. \x \ S. \x' \ S. dist x' x < d \ dist (\ n x') (\ n x) < e)" @@ -727,7 +727,7 @@ moreover obtain R where "countable R" "R \ S" and SR: "S \ closure R" by (metis separable that) - obtain k where "subseq k" and k: "\x. x \ R \ \l. (\n. \ (k n) x) \ l" + obtain k where "strict_mono k" and k: "\x. x \ R \ \l. (\n. \ (k n) x) \ l" apply (rule function_convergent_subsequence [OF \countable R\ M]) using \R \ S\ apply force+ done @@ -783,7 +783,7 @@ apply (simp add: o_def dist_norm) by meson ultimately show thesis - by (metis that \subseq k\) + by (metis that \strict_mono k\) qed @@ -802,7 +802,7 @@ and bounded: "\K. \compact K; K \ S\ \ \B. \h \ \. \ z \ K. norm(h z) \ B" and rng_f: "range \ \ \" obtains g r - where "g holomorphic_on S" "subseq r" + where "g holomorphic_on S" "strict_mono (r :: nat \ nat)" "\x. x \ S \ ((\n. \ (r n) x) \ g x) sequentially" "\K. \compact K; K \ S\ \ uniform_limit K (\ \ r) g sequentially" proof - @@ -813,10 +813,10 @@ by (simp add: bounded) then obtain B where B: "\i h z. \h \ \; z \ K i\ \ norm(h z) \ B i" by metis - have *: "\r g. subseq r \ (\e > 0. \N. \n\N. \x \ K i. norm((\ \ r) n x - g x) < e)" + have *: "\r g. strict_mono (r::nat\nat) \ (\e > 0. \N. \n\N. \x \ K i. norm((\ \ r) n x - g x) < e)" if "\n. \ n \ \" for \ i proof - - obtain g k where "continuous_on (K i) g" "subseq k" + obtain g k where "continuous_on (K i) g" "strict_mono (k::nat\nat)" "\e. 0 < e \ \N. \n\N. \x \ K i. norm(\(k n) x - g x) < e" proof (rule Arzela_Ascoli [of "K i" "\" "B i"]) show "\d>0. \n y. y \ K i \ cmod (z - y) < d \ cmod (\ n z - \ n y) < e" @@ -925,13 +925,13 @@ then show ?thesis by fastforce qed - have "\k g. subseq k \ (\e > 0. \N. \n\N. \x \ K i. norm((\ \ r \ k) n x - g x) < e)" + have "\k g. strict_mono (k::nat\nat) \ (\e > 0. \N. \n\N. \x \ K i. norm((\ \ r \ k) n x - g x) < e)" for i r apply (rule *) using rng_f by auto - then have **: "\i r. \k. subseq k \ (\g. \e>0. \N. \n\N. \x \ K i. norm((\ \ (r \ k)) n x - g x) < e)" + then have **: "\i r. \k. strict_mono (k::nat\nat) \ (\g. \e>0. \N. \n\N. \x \ K i. norm((\ \ (r \ k)) n x - g x) < e)" by (force simp: o_assoc) - obtain k where "subseq k" + obtain k :: "nat \ nat" where "strict_mono k" and "\i. \g. \e>0. \N. \n\N. \x\K i. cmod ((\ \ (id \ k)) n x - g x) < e" apply (rule subsequence_diagonalization_lemma [OF **, of id]) apply (erule ex_forward all_forward imp_forward)+ @@ -988,7 +988,7 @@ with d show ?thesis by blast qed qed - qed (auto simp: \subseq k\) + qed (auto simp: \strict_mono k\) qed @@ -1332,7 +1332,7 @@ using hol\ \not0 \not1 \_le1 by (force simp: W_def)+ then obtain e where "e > 0" and e: "ball v e \ Z" by (meson open_contains_ball) - obtain h j where holh: "h holomorphic_on ball v e" and "subseq j" + obtain h j where holh: "h holomorphic_on ball v e" and "strict_mono j" and lim: "\x. x \ ball v e \ (\n. \ (j n) x) \ h x" and ulim: "\K. \compact K; K \ ball v e\ \ uniform_limit K (\ \ j) h sequentially" @@ -1347,7 +1347,7 @@ show "(\n. \ (j n) v) \ h v" using \e > 0\ lim by simp have lt_Fj: "real x \ cmod (\ (j x) v)" for x - by (metis of_nat_Suc ltF \subseq j\ add.commute less_eq_real_def less_le_trans nat_le_real_less seq_suble) + by (metis of_nat_Suc ltF \strict_mono j\ add.commute less_eq_real_def less_le_trans nat_le_real_less seq_suble) show "(\n. \ (j n) v) \ 0" proof (rule Lim_null_comparison [OF eventually_sequentiallyI seq_harmonic]) show "cmod (\ (j x) v) \ inverse (real x)" if "1 \ x" for x @@ -1428,8 +1428,8 @@ qed with that show ?thesis by metis qed - - + + lemma GPicard4: assumes "0 < k" and holf: "f holomorphic_on (ball 0 k - {0})" and AE: "\e. \0 < e; e < k\ \ \d. 0 < d \ d < e \ (\z \ sphere 0 d. norm(f z) \ B)" @@ -1500,7 +1500,8 @@ then show ?thesis proof cases case 1 - with infinite_enumerate obtain r where "subseq r" and r: "\n. r n \ {n. norm(h n w) \ 1}" + with infinite_enumerate obtain r :: "nat \ nat" + where "strict_mono r" and r: "\n. r n \ {n. norm(h n w) \ 1}" by blast obtain B where B: "\j z. \norm z = 1/2; j \ range (h \ r)\ \ norm(j z) \ B" proof (rule GPicard3 [OF _ _ w, where K = "sphere 0 (1/2)"]) @@ -1529,7 +1530,7 @@ obtain n where "(1/e - 2) / 2 < real n" using reals_Archimedean2 by blast also have "... \ r n" - using \subseq r\ by (simp add: seq_suble) + using \strict_mono r\ by (simp add: seq_suble) finally have "(1/e - 2) / 2 < real (r n)" . with \0 < e\ have e: "e > 1 / (2 + 2 * real (r n))" by (simp add: field_simps) @@ -1546,7 +1547,8 @@ using \ by auto next case 2 - with infinite_enumerate obtain r where "subseq r" and r: "\n. r n \ {n. norm(h n w) \ 1}" + with infinite_enumerate obtain r :: "nat \ nat" + where "strict_mono r" and r: "\n. r n \ {n. norm(h n w) \ 1}" by blast obtain B where B: "\j z. \norm z = 1/2; j \ range (\n. inverse \ h (r n))\ \ norm(j z) \ B" proof (rule GPicard3 [OF _ _ w, where K = "sphere 0 (1/2)"]) @@ -1579,7 +1581,7 @@ obtain n where "(1/e - 2) / 2 < real n" using reals_Archimedean2 by blast also have "... \ r n" - using \subseq r\ by (simp add: seq_suble) + using \strict_mono r\ by (simp add: seq_suble) finally have "(1/e - 2) / 2 < real (r n)" . with \0 < e\ have e: "e > 1 / (2 + 2 * real (r n))" by (simp add: field_simps) diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Harmonic_Numbers.thy --- a/src/HOL/Analysis/Harmonic_Numbers.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Harmonic_Numbers.thy Thu Aug 17 14:52:56 2017 +0200 @@ -215,7 +215,7 @@ moreover have "(\n. ?em (2*n) - ?em n + ln (2::real)) \ euler_mascheroni - euler_mascheroni + ln 2" by (intro tendsto_intros euler_mascheroni_LIMSEQ filterlim_compose[OF euler_mascheroni_LIMSEQ] - filterlim_subseq) (auto simp: subseq_def) + filterlim_subseq) (auto simp: strict_mono_def) hence "(\n. ?em (2*n) - ?em n + ln (2::real)) \ ln 2" by simp ultimately have "(\n. (\k<2*n. (-1)^k / real_of_nat (Suc k))) \ ln 2" by (rule Lim_transform_eventually) @@ -227,7 +227,7 @@ by (simp add: summable_sums_iff divide_inverse sums_def) from filterlim_compose[OF this filterlim_subseq[of "op * (2::nat)"]] have "(\n. \k<2*n. (-1)^k / real_of_nat (Suc k)) \ (\k. (-1)^k / real_of_nat (Suc k))" - by (simp add: subseq_def) + by (simp add: strict_mono_def) ultimately have "(\k. (- 1) ^ k / real_of_nat (Suc k)) = ln 2" by (intro LIMSEQ_unique) with A show ?thesis by (simp add: sums_def) qed diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Linear_Algebra.thy --- a/src/HOL/Analysis/Linear_Algebra.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Linear_Algebra.thy Thu Aug 17 14:52:56 2017 +0200 @@ -1757,8 +1757,8 @@ lemma infinite_enumerate: assumes fS: "infinite S" - shows "\r. subseq r \ (\n. r n \ S)" - unfolding subseq_def + shows "\r::nat\nat. strict_mono r \ (\n. r n \ S)" + unfolding strict_mono_def using enumerate_in_set[OF fS] enumerate_mono[of _ _ S] fS by auto lemma approachable_lt_le: "(\(d::real) > 0. \x. f x < d \ P x) \ (\d>0. \x. f x \ d \ P x)" diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Path_Connected.thy --- a/src/HOL/Analysis/Path_Connected.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Path_Connected.thy Thu Aug 17 14:52:56 2017 +0200 @@ -3305,7 +3305,8 @@ then have "\n. \x \ S. \ n = f x" by force then obtain z where zs: "\n. z n \ S" and fz: "\n. \ n = f (z n)" by metis - then obtain y K where y: "y \ closure S" and "subseq K" and Klim: "(z \ K) \ y" + then obtain y K where y: "y \ closure S" and "strict_mono (K :: nat \ nat)" + and Klim: "(z \ K) \ y" using \bounded S\ apply (simp add: compact_closure [symmetric] compact_def) apply (drule_tac x=z in spec) diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Set_Integral.thy --- a/src/HOL/Analysis/Set_Integral.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Set_Integral.thy Thu Aug 17 14:52:56 2017 +0200 @@ -193,22 +193,22 @@ lemma limsup_subseq_lim: fixes u::"nat \ 'a :: {complete_linorder, linorder_topology}" - shows "\r. subseq r \ (u o r) \ limsup u" + shows "\r::nat\nat. strict_mono r \ (u o r) \ limsup u" proof (cases) assume "\n. \p>n. \m\p. u m \ u p" then have "\r. \n. (\m\r n. u m \ u (r n)) \ r n < r (Suc n)" by (intro dependent_nat_choice) (auto simp: conj_commute) - then obtain r where "subseq r" and mono: "\n m. r n \ m \ u m \ u (r n)" - by (auto simp: subseq_Suc_iff) + then obtain r :: "nat \ nat" where "strict_mono r" and mono: "\n m. r n \ m \ u m \ u (r n)" + by (auto simp: strict_mono_Suc_iff) 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 \strict_mono 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 \strict_mono 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) @@ -262,16 +262,16 @@ 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 - have "subseq r" using r by (auto simp: subseq_Suc_iff) + have "strict_mono r" using r by (auto simp: strict_mono_Suc_iff) 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 \strict_mono 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 \strict_mono 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) @@ -281,27 +281,27 @@ 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 show ?thesis using \strict_mono r\ by auto qed lemma liminf_subseq_lim: fixes u::"nat \ 'a :: {complete_linorder, linorder_topology}" - shows "\r. subseq r \ (u o r) \ liminf u" + shows "\r::nat\nat. strict_mono r \ (u o r) \ liminf u" proof (cases) assume "\n. \p>n. \m\p. u m \ u p" then have "\r. \n. (\m\r n. u m \ u (r n)) \ r n < r (Suc n)" by (intro dependent_nat_choice) (auto simp: conj_commute) - then obtain r where "subseq r" and mono: "\n m. r n \ m \ u m \ u (r n)" - by (auto simp: subseq_Suc_iff) + then obtain r :: "nat \ nat" where "strict_mono r" and mono: "\n m. r n \ m \ u m \ u (r n)" + by (auto simp: strict_mono_Suc_iff) 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 \strict_mono 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 \strict_mono 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) @@ -354,17 +354,18 @@ 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 - have "subseq r" using r by (auto simp: subseq_Suc_iff) + then obtain r :: "nat \ nat" + where r: "\n. N < r n \ r n < r (Suc n) \ (\i\ {N<..r (Suc n)}. u i \ u (r (Suc n)))" by auto + have "strict_mono r" using r by (auto simp: strict_mono_Suc_iff) 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 \strict_mono 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 \strict_mono 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) @@ -374,7 +375,7 @@ 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 show ?thesis using \strict_mono r\ by auto qed @@ -1076,12 +1077,12 @@ then have "limsup u < \" "limsup v < \" by auto define w where "w = (\n. u n + v n)" - obtain r where r: "subseq r" "(w o r) \ limsup w" using limsup_subseq_lim by auto - obtain s where s: "subseq s" "(u o r o s) \ limsup (u o r)" using limsup_subseq_lim by auto - obtain t where t: "subseq t" "(v o r o s o t) \ limsup (v o r o s)" using limsup_subseq_lim by auto + obtain r where r: "strict_mono r" "(w o r) \ limsup w" using limsup_subseq_lim by auto + obtain s where s: "strict_mono s" "(u o r o s) \ limsup (u o r)" using limsup_subseq_lim by auto + obtain t where t: "strict_mono t" "(v o r o s o t) \ limsup (v o r o s)" using limsup_subseq_lim by auto define a where "a = r o s o t" - have "subseq a" using r s t by (simp add: a_def subseq_o) + have "strict_mono a" using r s t by (simp add: a_def strict_mono_o) have l:"(w o a) \ limsup w" "(u o a) \ limsup (u o r)" "(v o a) \ limsup (v o r o s)" @@ -1092,7 +1093,8 @@ 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 - have "limsup (v o r o s) \ limsup v" by (simp add: comp_assoc limsup_subseq_mono r(1) s(1) subseq_o) + have "limsup (v o r o s) \ limsup v" + by (simp add: comp_assoc limsup_subseq_mono r(1) s(1) strict_mono_o) 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)" @@ -1122,12 +1124,12 @@ then have "liminf u > -\" "liminf v > -\" by auto define w where "w = (\n. u n + v n)" - obtain r where r: "subseq r" "(w o r) \ liminf w" using liminf_subseq_lim by auto - obtain s where s: "subseq s" "(u o r o s) \ liminf (u o r)" using liminf_subseq_lim by auto - obtain t where t: "subseq t" "(v o r o s o t) \ liminf (v o r o s)" using liminf_subseq_lim by auto + obtain r where r: "strict_mono r" "(w o r) \ liminf w" using liminf_subseq_lim by auto + obtain s where s: "strict_mono s" "(u o r o s) \ liminf (u o r)" using liminf_subseq_lim by auto + obtain t where t: "strict_mono t" "(v o r o s o t) \ liminf (v o r o s)" using liminf_subseq_lim by auto define a where "a = r o s o t" - have "subseq a" using r s t by (simp add: a_def subseq_o) + have "strict_mono a" using r s t by (simp add: a_def strict_mono_o) have l:"(w o a) \ liminf w" "(u o a) \ liminf (u o r)" "(v o a) \ liminf (v o r o s)" @@ -1138,7 +1140,8 @@ 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 - have "liminf (v o r o s) \ liminf v" by (simp add: comp_assoc liminf_subseq_mono r(1) s(1) subseq_o) + have "liminf (v o r o s) \ liminf v" + by (simp add: comp_assoc liminf_subseq_mono r(1) s(1) strict_mono_o) 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)" @@ -1188,7 +1191,7 @@ shows "limsup (\n. u n * v n) = a * limsup v" proof - define w where "w = (\n. u n * v n)" - obtain r where r: "subseq r" "(v o r) \ limsup v" using limsup_subseq_lim by auto + obtain r where r: "strict_mono r" "(v o r) \ limsup v" using limsup_subseq_lim by auto have "(u o r) \ a" using assms(1) LIMSEQ_subseq_LIMSEQ r by auto with tendsto_mult_ereal[OF this r(2)] have "(\n. (u o r) n * (v o r) n) \ a * limsup v" using assms(2) assms(3) by auto moreover have "\n. (w o r) n = (u o r) n * (v o r) n" unfolding w_def by auto @@ -1196,7 +1199,7 @@ then have "limsup (w o r) = a * limsup v" by (simp add: tendsto_iff_Liminf_eq_Limsup) then have I: "limsup w \ a * limsup v" by (metis limsup_subseq_mono r(1)) - obtain s where s: "subseq s" "(w o s) \ limsup w" using limsup_subseq_lim by auto + obtain s where s: "strict_mono s" "(w o s) \ limsup w" using limsup_subseq_lim by auto have *: "(u o s) \ a" using assms(1) LIMSEQ_subseq_LIMSEQ s by auto have "eventually (\n. (u o s) n > 0) sequentially" using assms(2) * order_tendsto_iff by blast moreover have "eventually (\n. (u o s) n < \) sequentially" using assms(3) * order_tendsto_iff by blast @@ -1218,7 +1221,7 @@ shows "liminf (\n. u n * v n) = a * liminf v" proof - define w where "w = (\n. u n * v n)" - obtain r where r: "subseq r" "(v o r) \ liminf v" using liminf_subseq_lim by auto + obtain r where r: "strict_mono r" "(v o r) \ liminf v" using liminf_subseq_lim by auto have "(u o r) \ a" using assms(1) LIMSEQ_subseq_LIMSEQ r by auto with tendsto_mult_ereal[OF this r(2)] have "(\n. (u o r) n * (v o r) n) \ a * liminf v" using assms(2) assms(3) by auto moreover have "\n. (w o r) n = (u o r) n * (v o r) n" unfolding w_def by auto @@ -1226,7 +1229,7 @@ then have "liminf (w o r) = a * liminf v" by (simp add: tendsto_iff_Liminf_eq_Limsup) then have I: "liminf w \ a * liminf v" by (metis liminf_subseq_mono r(1)) - obtain s where s: "subseq s" "(w o s) \ liminf w" using liminf_subseq_lim by auto + obtain s where s: "strict_mono s" "(w o s) \ liminf w" using liminf_subseq_lim by auto have *: "(u o s) \ a" using assms(1) LIMSEQ_subseq_LIMSEQ s by auto have "eventually (\n. (u o s) n > 0) sequentially" using assms(2) * order_tendsto_iff by blast moreover have "eventually (\n. (u o s) n < \) sequentially" using assms(3) * order_tendsto_iff by blast @@ -1286,12 +1289,12 @@ then have "limsup v < \" "liminf u < \" by auto define w where "w = (\n. u n + v n)" - obtain r where r: "subseq r" "(u o r) \ liminf u" using liminf_subseq_lim by auto - obtain s where s: "subseq s" "(w o r o s) \ liminf (w o r)" using liminf_subseq_lim by auto - obtain t where t: "subseq t" "(v o r o s o t) \ limsup (v o r o s)" using limsup_subseq_lim by auto + obtain r where r: "strict_mono r" "(u o r) \ liminf u" using liminf_subseq_lim by auto + obtain s where s: "strict_mono s" "(w o r o s) \ liminf (w o r)" using liminf_subseq_lim by auto + obtain t where t: "strict_mono t" "(v o r o s o t) \ limsup (v o r o s)" using limsup_subseq_lim by auto define a where "a = r o s o t" - have "subseq a" using r s t by (simp add: a_def subseq_o) + have "strict_mono a" using r s t by (simp add: a_def strict_mono_o) have l:"(u o a) \ liminf u" "(w o a) \ liminf (w o r)" "(v o a) \ limsup (v o r o s)" @@ -1301,7 +1304,8 @@ done 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) + have "limsup (v o r o s) \ limsup v" + by (simp add: comp_assoc limsup_subseq_mono r(1) s(1) strict_mono_o) 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)" diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Summation_Tests.thy --- a/src/HOL/Analysis/Summation_Tests.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Summation_Tests.thy Thu Aug 17 14:52:56 2017 +0200 @@ -189,7 +189,7 @@ also have "\ \ Bseq (\n. \k=1.. \ Bseq (\n. \k=1..<2^n. f k)" by (rule nonneg_incseq_Bseq_subseq_iff[symmetric]) - (auto intro!: sum_nonneg incseq_SucI nonneg simp: subseq_def) + (auto intro!: sum_nonneg incseq_SucI nonneg simp: strict_mono_def) also have "\ \ Bseq (\n. \kn. \k=1..<2^n. f k)" diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Analysis/Topology_Euclidean_Space.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Analysis/Topology_Euclidean_Space.thy Thu Aug 17 14:52:56 2017 +0200 @@ -4468,7 +4468,7 @@ lemma acc_point_range_imp_convergent_subsequence: fixes l :: "'a :: first_countable_topology" assumes l: "\U. l\U \ open U \ infinite (U \ range f)" - shows "\r. subseq r \ (f \ r) \ l" + shows "\r::nat\nat. strict_mono r \ (f \ r) \ l" proof - from countable_basis_at_decseq[of l] obtain A where A: @@ -4492,8 +4492,8 @@ } note s = this define r where "r = rec_nat (s 0 0) s" - have "subseq r" - by (auto simp: r_def s subseq_Suc_iff) + have "strict_mono r" + by (auto simp: r_def s strict_mono_Suc_iff) moreover have "(\n. f (r n)) \ l" proof (rule topological_tendstoI) @@ -4513,7 +4513,7 @@ ultimately show "eventually (\i. f (r i) \ S) sequentially" by eventually_elim auto qed - ultimately show "\r. subseq r \ (f \ r) \ l" + ultimately show "\r::nat\nat. strict_mono r \ (f \ r) \ l" by (auto simp: convergent_def comp_def) qed @@ -4616,7 +4616,7 @@ lemma islimpt_range_imp_convergent_subsequence: fixes l :: "'a :: {t1_space, first_countable_topology}" assumes l: "l islimpt (range f)" - shows "\r. subseq r \ (f \ r) \ l" + shows "\r::nat\nat. strict_mono r \ (f \ r) \ l" using l unfolding islimpt_eq_acc_point by (rule acc_point_range_imp_convergent_subsequence) @@ -4949,16 +4949,16 @@ definition seq_compact :: "'a::topological_space set \ bool" where "seq_compact S \ - (\f. (\n. f n \ S) \ (\l\S. \r. subseq r \ ((f \ r) \ l) sequentially))" + (\f. (\n. f n \ S) \ (\l\S. \r::nat\nat. strict_mono r \ ((f \ r) \ l) sequentially))" lemma seq_compactI: - assumes "\f. \n. f n \ S \ \l\S. \r. subseq r \ ((f \ r) \ l) sequentially" + assumes "\f. \n. f n \ S \ \l\S. \r::nat\nat. strict_mono r \ ((f \ r) \ l) sequentially" shows "seq_compact S" unfolding seq_compact_def using assms by fast lemma seq_compactE: assumes "seq_compact S" "\n. f n \ S" - obtains l r where "l \ S" "subseq r" "((f \ r) \ l) sequentially" + obtains l r where "l \ S" "strict_mono (r :: nat \ nat)" "((f \ r) \ l) sequentially" using assms unfolding seq_compact_def by fast lemma closed_sequentially: (* TODO: move upwards *) @@ -4980,13 +4980,13 @@ hence "\n. f n \ s" and "\n. f n \ t" by simp_all from \seq_compact s\ and \\n. f n \ s\ - obtain l r where "l \ s" and r: "subseq r" and l: "(f \ r) \ l" + obtain l r where "l \ s" and r: "strict_mono r" and l: "(f \ r) \ l" by (rule seq_compactE) from \\n. f n \ t\ have "\n. (f \ r) n \ t" by simp from \closed t\ and this and l have "l \ t" by (rule closed_sequentially) - with \l \ s\ and r and l show "\l\s \ t. \r. subseq r \ (f \ r) \ l" + with \l \ s\ and r and l show "\l\s \ t. \r. strict_mono r \ (f \ r) \ l" by fast qed @@ -5002,7 +5002,7 @@ proof (safe intro!: countably_compactI) fix A assume A: "\a\A. open a" "U \ \A" "countable A" - have subseq: "\X. range X \ U \ \r x. x \ U \ subseq r \ (X \ r) \ x" + have subseq: "\X. range X \ U \ \r x. x \ U \ strict_mono (r :: nat \ nat) \ (X \ r) \ x" using \seq_compact U\ by (fastforce simp: seq_compact_def subset_eq) show "\T\A. finite T \ U \ \T" proof cases @@ -5023,7 +5023,7 @@ using \A \ {}\ unfolding X_def by (intro T) (auto intro: from_nat_into) then have "range X \ U" by auto - with subseq[of X] obtain r x where "x \ U" and r: "subseq r" "(X \ r) \ x" + with subseq[of X] obtain r x where "x \ U" and r: "strict_mono r" "(X \ r) \ x" by auto from \x\U\ \U \ \A\ from_nat_into_surj[OF \countable A\] obtain n where "x \ from_nat_into A n" by auto @@ -5034,7 +5034,7 @@ by (auto simp: eventually_sequentially) moreover from X have "\i. n \ r i \ X (r i) \ from_nat_into A n" by auto - moreover from \subseq r\[THEN seq_suble, of "max n N"] have "\i. n \ r i \ N \ i" + moreover from \strict_mono r\[THEN seq_suble, of "max n N"] have "\i. n \ r i \ N \ i" by (auto intro!: exI[of _ "max n N"]) ultimately show False by auto @@ -5087,8 +5087,8 @@ } note s = this define r where "r = rec_nat (s 0 0) s" - have "subseq r" - by (auto simp: r_def s subseq_Suc_iff) + have "strict_mono r" + by (auto simp: r_def s strict_mono_Suc_iff) moreover have "(\n. X (r n)) \ x" proof (rule topological_tendstoI) @@ -5108,7 +5108,7 @@ ultimately show "eventually (\i. X (r i) \ S) sequentially" by eventually_elim auto qed - ultimately show "\x \ U. \r. subseq r \ (X \ r) \ x" + ultimately show "\x \ U. \r. strict_mono r \ (X \ r) \ x" using \x \ U\ by (auto simp: convergent_def comp_def) qed @@ -5159,25 +5159,25 @@ { fix f :: "nat \ 'a" assume f: "\n. f n \ s" - have "\l\s. \r. subseq r \ ((f \ r) \ l) sequentially" + have "\l\s. \r. strict_mono r \ ((f \ r) \ l) sequentially" proof (cases "finite (range f)") case True obtain l where "infinite {n. f n = f l}" using pigeonhole_infinite[OF _ True] by auto - then obtain r where "subseq r" and fr: "\n. f (r n) = f l" + then obtain r :: "nat \ nat" where "strict_mono r" and fr: "\n. f (r n) = f l" using infinite_enumerate by blast - then have "subseq r \ (f \ r) \ f l" + then have "strict_mono r \ (f \ r) \ f l" by (simp add: fr o_def) - with f show "\l\s. \r. subseq r \ (f \ r) \ l" + with f show "\l\s. \r. strict_mono r \ (f \ r) \ l" by auto next case False with f assms have "\x\s. \U. x\U \ open U \ infinite (U \ range f)" by auto then obtain l where "l \ s" "\U. l\U \ open U \ infinite (U \ range f)" .. - from this(2) have "\r. subseq r \ ((f \ r) \ l) sequentially" + from this(2) have "\r. strict_mono r \ ((f \ r) \ l) sequentially" using acc_point_range_imp_convergent_subsequence[of l f] by auto - with \l \ s\ show "\l\s. \r. subseq r \ ((f \ r) \ l) sequentially" .. + with \l \ s\ show "\l\s. \r. strict_mono r \ ((f \ r) \ l) sequentially" .. qed } then show ?thesis @@ -5237,14 +5237,14 @@ qed simp then obtain x where "\n::nat. x n \ s" and x:"\n m. m < n \ \ (dist (x m) (x n) < e)" by blast - then obtain l r where "l \ s" and r:"subseq r" and "((x \ r) \ l) sequentially" + then obtain l r where "l \ s" and r:"strict_mono r" and "((x \ r) \ l) sequentially" using assms by (metis seq_compact_def) from this(3) have "Cauchy (x \ r)" using LIMSEQ_imp_Cauchy by auto then obtain N::nat where "\m n. N \ m \ N \ n \ dist ((x \ r) m) ((x \ r) n) < e" unfolding cauchy_def using \e > 0\ by blast then have False - using x[of "r N" "r (N+1)"] r by (auto simp: subseq_def) } + using x[of "r N" "r (N+1)"] r by (auto simp: strict_mono_def) } then show ?thesis by metis qed @@ -5302,7 +5302,7 @@ lemma compact_def: \\this is the definition of compactness in HOL Light\ "compact (S :: 'a::metric_space set) \ - (\f. (\n. f n \ S) \ (\l\S. \r. subseq r \ (f \ r) \ l))" + (\f. (\n. f n \ S) \ (\l\S. \r::nat\nat. strict_mono r \ (f \ r) \ l))" unfolding compact_eq_seq_compact_metric seq_compact_def by auto subsubsection \Complete the chain of compactness variants\ @@ -5335,7 +5335,7 @@ class heine_borel = metric_space + assumes bounded_imp_convergent_subsequence: - "bounded (range f) \ \l r. subseq r \ ((f \ r) \ l) sequentially" + "bounded (range f) \ \l r. strict_mono (r::nat\nat) \ ((f \ r) \ l) sequentially" lemma bounded_closed_imp_seq_compact: fixes s::"'a::heine_borel set" @@ -5347,13 +5347,13 @@ assume f: "\n. f n \ s" with \bounded s\ have "bounded (range f)" by (auto intro: bounded_subset) - obtain l r where r: "subseq r" and l: "((f \ r) \ l) sequentially" + obtain l r where r: "strict_mono (r :: nat \ nat)" and l: "((f \ r) \ l) sequentially" using bounded_imp_convergent_subsequence [OF \bounded (range f)\] by auto from f have fr: "\n. (f \ r) n \ s" by simp have "l \ s" using \closed s\ fr l by (rule closed_sequentially) - show "\l\s. \r. subseq r \ ((f \ r) \ l) sequentially" + show "\l\s. \r. strict_mono r \ ((f \ r) \ l) sequentially" using \l \ s\ r l by blast qed @@ -5393,11 +5393,11 @@ proof fix f :: "nat \ real" assume f: "bounded (range f)" - obtain r where r: "subseq r" "monoseq (f \ r)" + obtain r :: "nat \ nat" where r: "strict_mono r" "monoseq (f \ r)" unfolding comp_def by (metis seq_monosub) then have "Bseq (f \ r)" unfolding Bseq_eq_bounded using f by (force intro: bounded_subset) - with r show "\l r. subseq r \ (f \ r) \ l" + with r show "\l r. strict_mono r \ (f \ r) \ l" using Bseq_monoseq_convergent[of "f \ r"] by (auto simp: convergent_def) qed @@ -5409,19 +5409,19 @@ assumes bounded_proj: "\k. k \ basis \ bounded ((\x. x proj k) ` range f)" assumes proj_unproj: "\e k. k \ basis \ (unproj e) proj k = e k" assumes unproj_proj: "\x. unproj (\k. x proj k) = x" - shows "\d\basis. \l::'a. \ r. - subseq r \ (\e>0. eventually (\n. \i\d. dist (f (r n) proj i) (l proj i) < e) sequentially)" + shows "\d\basis. \l::'a. \ r::nat\nat. + strict_mono r \ (\e>0. eventually (\n. \i\d. dist (f (r n) proj i) (l proj i) < e) sequentially)" proof safe fix d :: "'b set" assume d: "d \ basis" with finite_basis have "finite d" by (blast intro: finite_subset) - from this d show "\l::'a. \r. subseq r \ + from this d show "\l::'a. \r::nat\nat. strict_mono r \ (\e>0. eventually (\n. \i\d. dist (f (r n) proj i) (l proj i) < e) sequentially)" proof (induct d) case empty then show ?case - unfolding subseq_def by auto + unfolding strict_mono_def by auto next case (insert k d) have k[intro]: "k \ basis" @@ -5429,19 +5429,19 @@ have s': "bounded ((\x. x proj k) ` range f)" using k by (rule bounded_proj) - obtain l1::"'a" and r1 where r1: "subseq r1" + obtain l1::"'a" and r1 where r1: "strict_mono r1" and lr1: "\e > 0. eventually (\n. \i\d. dist (f (r1 n) proj i) (l1 proj i) < e) sequentially" using insert(3) using insert(4) by auto have f': "\n. f (r1 n) proj k \ (\x. x proj k) ` range f" by simp have "bounded (range (\i. f (r1 i) proj k))" by (metis (lifting) bounded_subset f' image_subsetI s') - then obtain l2 r2 where r2:"subseq r2" and lr2:"((\i. f (r1 (r2 i)) proj k) \ l2) sequentially" + then obtain l2 r2 where r2:"strict_mono r2" and lr2:"((\i. f (r1 (r2 i)) proj k) \ l2) sequentially" using bounded_imp_convergent_subsequence[of "\i. f (r1 i) proj k"] by (auto simp: o_def) define r where "r = r1 \ r2" - have r:"subseq r" - using r1 and r2 unfolding r_def o_def subseq_def by auto + have r:"strict_mono r" + using r1 and r2 unfolding r_def o_def strict_mono_def by auto moreover define l where "l = unproj (\i. if i = k then l2 else l1 proj i)" { @@ -5465,7 +5465,7 @@ fixes f :: "nat \ 'a::euclidean_space" assumes "bounded (range f)" shows "\d\Basis. \l::'a. \ r. - subseq r \ (\e>0. eventually (\n. \i\d. dist (f (r n) \ i) (l \ i) < e) sequentially)" + strict_mono r \ (\e>0. eventually (\n. \i\d. dist (f (r n) \ i) (l \ i) < e) sequentially)" by (rule compact_lemma_general[where unproj="\e. \i\Basis. e i *\<^sub>R i"]) (auto intro!: assms bounded_linear_inner_left bounded_linear_image simp: euclidean_representation) @@ -5474,7 +5474,7 @@ proof fix f :: "nat \ 'a" assume f: "bounded (range f)" - then obtain l::'a and r where r: "subseq r" + then obtain l::'a and r where r: "strict_mono r" and l: "\e>0. eventually (\n. \i\Basis. dist (f (r n) \ i) (l \ i) < e) sequentially" using compact_lemma [OF f] by blast { @@ -5505,7 +5505,7 @@ } then have *: "((f \ r) \ l) sequentially" unfolding o_def tendsto_iff by simp - with r show "\l r. subseq r \ ((f \ r) \ l) sequentially" + with r show "\l r. strict_mono r \ ((f \ r) \ l) sequentially" by auto qed @@ -5525,20 +5525,20 @@ by (rule bounded_fst) then have s1: "bounded (range (fst \ f))" by (simp add: image_comp) - obtain l1 r1 where r1: "subseq r1" and l1: "(\n. fst (f (r1 n))) \ l1" + obtain l1 r1 where r1: "strict_mono r1" and l1: "(\n. fst (f (r1 n))) \ l1" using bounded_imp_convergent_subsequence [OF s1] unfolding o_def by fast from f have s2: "bounded (range (snd \ f \ r1))" by (auto simp add: image_comp intro: bounded_snd bounded_subset) - obtain l2 r2 where r2: "subseq r2" and l2: "((\n. snd (f (r1 (r2 n)))) \ l2) sequentially" + obtain l2 r2 where r2: "strict_mono r2" and l2: "((\n. snd (f (r1 (r2 n)))) \ l2) sequentially" using bounded_imp_convergent_subsequence [OF s2] unfolding o_def by fast have l1': "((\n. fst (f (r1 (r2 n)))) \ l1) sequentially" using LIMSEQ_subseq_LIMSEQ [OF l1 r2] unfolding o_def . have l: "((f \ (r1 \ r2)) \ (l1, l2)) sequentially" using tendsto_Pair [OF l1' l2] unfolding o_def by simp - have r: "subseq (r1 \ r2)" - using r1 r2 unfolding subseq_def by simp - show "\l r. subseq r \ ((f \ r) \ l) sequentially" + have r: "strict_mono (r1 \ r2)" + using r1 r2 unfolding strict_mono_def by simp + show "\l r. strict_mono r \ ((f \ r) \ l) sequentially" using l r by fast qed @@ -5641,7 +5641,7 @@ { fix f assume as: "(\n::nat. f n \ s)" "Cauchy f" - from as(1) obtain l r where lr: "l\s" "subseq r" "(f \ r) \ l" + from as(1) obtain l r where lr: "l\s" "strict_mono r" "(f \ r) \ l" using assms unfolding compact_def by blast note lr' = seq_suble [OF lr(2)] @@ -5752,8 +5752,8 @@ qed define t where "t = rec_nat (sel 0 0) (\n i. sel (Suc n) i)" - have "subseq t" - unfolding subseq_Suc_iff by (simp add: t_def sel) + have "strict_mono t" + unfolding strict_mono_Suc_iff by (simp add: t_def sel) moreover have "\i. (f \ t) i \ s" using f by auto moreover @@ -5777,7 +5777,7 @@ by (simp add: dist_commute) qed - ultimately show "\l\s. \r. subseq r \ (f \ r) \ l" + ultimately show "\l\s. \r. strict_mono r \ (f \ r) \ l" using assms unfolding complete_def by blast qed qed @@ -5974,7 +5974,7 @@ using choice[of "\n x. x \ s n"] by auto from assms(4,1) have "seq_compact (s 0)" by (simp add: bounded_closed_imp_seq_compact) - then obtain l r where lr: "l \ s 0" "subseq r" "(x \ r) \ l" + then obtain l r where lr: "l \ s 0" "strict_mono r" "(x \ r) \ l" using x and assms(3) unfolding seq_compact_def by blast have "\n. l \ s n" proof @@ -7670,7 +7670,7 @@ using neg by simp then obtain f where "\n. f n \ S" and fG: "\G n. G \ \ \ \ ball (f n) (1 / Suc n) \ G" by metis - then obtain l r where "l \ S" "subseq r" and to_l: "(f \ r) \ l" + then obtain l r where "l \ S" "strict_mono r" and to_l: "(f \ r) \ l" using \compact S\ compact_def that by metis then obtain G where "l \ G" "G \ \" using Ssub by auto @@ -7687,7 +7687,7 @@ by simp also have "... \ 1 / real (Suc (max N1 N2))" apply (simp add: divide_simps del: max.bounded_iff) - using \subseq r\ seq_suble by blast + using \strict_mono r\ seq_suble by blast also have "... \ 1 / real (Suc N2)" by (simp add: field_simps) also have "... < e/2" @@ -7851,7 +7851,7 @@ apply (clarify, rename_tac l2 r2) apply (rule_tac x="(l1, l2)" in rev_bexI, simp) apply (rule_tac x="r1 \ r2" in exI) - apply (rule conjI, simp add: subseq_def) + apply (rule conjI, simp add: strict_mono_def) apply (drule_tac f=r2 in LIMSEQ_subseq_LIMSEQ, assumption) apply (drule (1) tendsto_Pair) back apply (simp add: o_def) @@ -8287,7 +8287,7 @@ assume as: "\n. x n \ ?S" "(x \ l) sequentially" from as(1) obtain f where f: "\n. x n = fst (f n) + snd (f n)" "\n. fst (f n) \ S" "\n. snd (f n) \ T" using choice[of "\n y. x n = (fst y) + (snd y) \ fst y \ S \ snd y \ T"] by auto - obtain l' r where "l'\S" and r: "subseq r" and lr: "(((\n. fst (f n)) \ r) \ l') sequentially" + obtain l' r where "l'\S" and r: "strict_mono r" and lr: "(((\n. fst (f n)) \ r) \ l') sequentially" using assms(1)[unfolded compact_def, THEN spec[where x="\ n. fst (f n)"]] using f(2) by auto have "((\n. snd (f (r n))) \ l - l') sequentially" using tendsto_diff[OF LIMSEQ_subseq_LIMSEQ[OF as(2) r] lr] and f(1) diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Computational_Algebra/Fundamental_Theorem_Algebra.thy --- a/src/HOL/Computational_Algebra/Fundamental_Theorem_Algebra.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Computational_Algebra/Fundamental_Theorem_Algebra.thy Thu Aug 17 14:52:56 2017 +0200 @@ -236,13 +236,13 @@ lemma bolzano_weierstrass_complex_disc: assumes r: "\n. cmod (s n) \ r" - shows "\f z. subseq f \ (\e >0. \N. \n \ N. cmod (s (f n) - z) < e)" + shows "\f z. strict_mono (f :: nat \ nat) \ (\e >0. \N. \n \ N. cmod (s (f n) - z) < e)" proof - from seq_monosub[of "Re \ s"] - obtain f where f: "subseq f" "monoseq (\n. Re (s (f n)))" + obtain f where f: "strict_mono f" "monoseq (\n. Re (s (f n)))" unfolding o_def by blast from seq_monosub[of "Im \ s \ f"] - obtain g where g: "subseq g" "monoseq (\n. Im (s (f (g n))))" + obtain g where g: "strict_mono g" "monoseq (\n. Im (s (f (g n))))" unfolding o_def by blast let ?h = "f \ g" from r[rule_format, of 0] have rp: "r \ 0" @@ -284,8 +284,8 @@ then have y: "\r>0. \n0. \n\n0. \Im (s (f (g n))) - y\ < r" unfolding LIMSEQ_iff real_norm_def . let ?w = "Complex x y" - from f(1) g(1) have hs: "subseq ?h" - unfolding subseq_def by auto + from f(1) g(1) have hs: "strict_mono ?h" + unfolding strict_mono_def by auto have "\N. \n\N. cmod (s (?h n) - ?w) < e" if "e > 0" for e proof - from that have e2: "e/2 > 0" @@ -400,7 +400,7 @@ g: "\n. cmod (g n) \ r" "\n. cmod (poly p (g n)) e>0. \N. \n\N. cmod (g (f n) - z) < e" + obtain f z where fz: "strict_mono (f :: nat \ nat)" "\e>0. \N. \n\N. cmod (g (f n) - z) < e" by blast { fix w diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Library/Diagonal_Subsequence.thy --- a/src/HOL/Library/Diagonal_Subsequence.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Library/Diagonal_Subsequence.thy Thu Aug 17 14:52:56 2017 +0200 @@ -8,28 +8,28 @@ locale subseqs = fixes P::"nat\(nat\nat)\bool" - assumes ex_subseq: "\n s. subseq s \ \r'. subseq r' \ P n (s o r')" + assumes ex_subseq: "\n s. strict_mono (s::nat\nat) \ \r'. strict_mono r' \ P n (s o r')" begin -definition reduce where "reduce s n = (SOME r'. subseq r' \ P n (s o r'))" +definition reduce where "reduce s n = (SOME r'::nat\nat. strict_mono r' \ P n (s o r'))" lemma subseq_reduce[intro, simp]: - "subseq s \ subseq (reduce s n)" + "strict_mono s \ strict_mono (reduce s n)" unfolding reduce_def by (rule someI2_ex[OF ex_subseq]) auto lemma reduce_holds: - "subseq s \ P n (s o reduce s n)" + "strict_mono s \ P n (s o reduce s n)" unfolding reduce_def by (rule someI2_ex[OF ex_subseq]) (auto simp: o_def) -primrec seqseq where +primrec seqseq :: "nat \ nat \ nat" where "seqseq 0 = id" | "seqseq (Suc n) = seqseq n o reduce (seqseq n) n" -lemma subseq_seqseq[intro, simp]: "subseq (seqseq n)" +lemma subseq_seqseq[intro, simp]: "strict_mono (seqseq n)" proof (induct n) - case 0 thus ?case by (simp add: subseq_def) + case 0 thus ?case by (simp add: strict_mono_def) next - case (Suc n) thus ?case by (subst seqseq.simps) (auto intro!: subseq_o) + case (Suc n) thus ?case by (subst seqseq.simps) (auto intro!: strict_mono_o) qed lemma seqseq_holds: @@ -40,35 +40,29 @@ thus ?thesis by simp qed -definition diagseq where "diagseq i = seqseq i i" - -lemma subseq_mono: "subseq f \ a \ b \ f a \ f b" - by (metis le_eq_less_or_eq subseq_mono) - -lemma subseq_strict_mono: "subseq f \ a < b \ f a < f b" - by (simp add: subseq_def) +definition diagseq :: "nat \ nat" where "diagseq i = seqseq i i" lemma diagseq_mono: "diagseq n < diagseq (Suc n)" proof - have "diagseq n < seqseq n (Suc n)" - using subseq_seqseq[of n] by (simp add: diagseq_def subseq_def) + using subseq_seqseq[of n] by (simp add: diagseq_def strict_mono_def) also have "\ \ seqseq n (reduce (seqseq n) n (Suc n))" - by (auto intro: subseq_mono seq_suble) + using strict_mono_less_eq seq_suble by blast also have "\ = diagseq (Suc n)" by (simp add: diagseq_def) finally show ?thesis . qed -lemma subseq_diagseq: "subseq diagseq" - using diagseq_mono by (simp add: subseq_Suc_iff diagseq_def) +lemma subseq_diagseq: "strict_mono diagseq" + using diagseq_mono by (simp add: strict_mono_Suc_iff diagseq_def) primrec fold_reduce where "fold_reduce n 0 = id" | "fold_reduce n (Suc k) = fold_reduce n k o reduce (seqseq (n + k)) (n + k)" -lemma subseq_fold_reduce[intro, simp]: "subseq (fold_reduce n k)" +lemma subseq_fold_reduce[intro, simp]: "strict_mono (fold_reduce n k)" proof (induct k) - case (Suc k) from subseq_o[OF this subseq_reduce] show ?case by (simp add: o_def) -qed (simp add: subseq_def) + case (Suc k) from strict_mono_o[OF this subseq_reduce] show ?case by (simp add: o_def) +qed (simp add: strict_mono_def) lemma ex_subseq_reduce_index: "seqseq (n + k) = seqseq n o fold_reduce n k" by (induct k) simp_all @@ -95,14 +89,14 @@ assumes "m \ n" shows "diagseq n = (seqseq m o (fold_reduce m (n - m))) n" using diagseq_add[of m "n - m"] assms by simp -lemma subseq_diagonal_rest: "subseq (\x. fold_reduce k x (k + x))" - unfolding subseq_Suc_iff fold_reduce.simps o_def +lemma subseq_diagonal_rest: "strict_mono (\x. fold_reduce k x (k + x))" + unfolding strict_mono_Suc_iff fold_reduce.simps o_def proof fix n have "fold_reduce k n (k + n) < fold_reduce k n (k + Suc n)" (is "?lhs < _") - by (auto intro: subseq_strict_mono) + by (auto intro: strict_monoD) also have "\ \ fold_reduce k n (reduce (seqseq (k + n)) (k + n) (k + Suc n))" - by (rule subseq_mono) (auto intro!: seq_suble subseq_mono) + by (auto intro: less_mono_imp_le_mono seq_suble strict_monoD) finally show "?lhs < \" . qed @@ -110,7 +104,7 @@ by (auto simp: o_def diagseq_add) lemma diagseq_holds: - assumes subseq_stable: "\r s n. subseq r \ P n s \ P n (s o r)" + assumes subseq_stable: "\r s n. strict_mono r \ P n s \ P n (s o r)" shows "P k (diagseq o (op + (Suc k)))" unfolding diagseq_seqseq by (intro subseq_stable subseq_diagonal_rest seqseq_holds) diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Library/Liminf_Limsup.thy --- a/src/HOL/Library/Liminf_Limsup.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Library/Liminf_Limsup.thy Thu Aug 17 14:52:56 2017 +0200 @@ -379,20 +379,20 @@ lemma liminf_subseq_mono: fixes X :: "nat \ 'a :: complete_linorder" - assumes "subseq r" + assumes "strict_mono r" shows "liminf X \ liminf (X \ r) " proof- have "\n. (INF m:{n..}. X m) \ (INF m:{n..}. (X \ r) m)" proof (safe intro!: INF_mono) fix n m :: nat assume "n \ m" then show "\ma\{n..}. X ma \ (X \ r) m" - using seq_suble[OF \subseq r\, of m] by (intro bexI[of _ "r m"]) auto + using seq_suble[OF \strict_mono r\, of m] by (intro bexI[of _ "r m"]) auto qed then show ?thesis by (auto intro!: SUP_mono simp: liminf_SUP_INF comp_def) qed lemma limsup_subseq_mono: fixes X :: "nat \ 'a :: complete_linorder" - assumes "subseq r" + assumes "strict_mono r" shows "limsup (X \ r) \ limsup X" proof- have "(SUP m:{n..}. (X \ r) m) \ (SUP m:{n..}. X m)" for n @@ -400,7 +400,7 @@ fix m :: nat assume "n \ m" then show "\ma\{n..}. (X \ r) m \ X ma" - using seq_suble[OF \subseq r\, of m] by (intro bexI[of _ "r m"]) auto + using seq_suble[OF \strict_mono r\, of m] by (intro bexI[of _ "r m"]) auto qed then show ?thesis by (auto intro!: INF_mono simp: limsup_INF_SUP comp_def) @@ -587,9 +587,9 @@ lemma compact_complete_linorder: fixes X :: "nat \ 'a::{complete_linorder,linorder_topology}" - shows "\l r. subseq r \ (X \ r) \ l" + shows "\l r. strict_mono r \ (X \ r) \ l" proof - - obtain r where "subseq r" and mono: "monoseq (X \ r)" + obtain r where "strict_mono r" and mono: "monoseq (X \ r)" using seq_monosub[of X] unfolding comp_def by auto @@ -599,7 +599,7 @@ using lim_increasing_cl[of "X \ r"] lim_decreasing_cl[of "X \ r"] by auto then show ?thesis - using \subseq r\ by auto + using \strict_mono r\ by auto qed lemma tendsto_Limsup: diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Limits.thy --- a/src/HOL/Limits.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Limits.thy Thu Aug 17 14:52:56 2017 +0200 @@ -325,7 +325,7 @@ using Bseq_offset[of f 1] by (auto intro: Bseq_subseq) lemma increasing_Bseq_subseq_iff: - assumes "\x y. x \ y \ norm (f x :: 'a::real_normed_vector) \ norm (f y)" "subseq g" + assumes "\x y. x \ y \ norm (f x :: 'a::real_normed_vector) \ norm (f y)" "strict_mono g" shows "Bseq (\x. f (g x)) \ Bseq f" proof assume "Bseq (\x. f (g x))" @@ -346,7 +346,7 @@ lemma nonneg_incseq_Bseq_subseq_iff: fixes f :: "nat \ real" and g :: "nat \ nat" - assumes "\x. f x \ 0" "incseq f" "subseq g" + assumes "\x. f x \ 0" "incseq f" "strict_mono g" shows "Bseq (\x. f (g x)) \ Bseq f" using assms by (intro increasing_Bseq_subseq_iff) (auto simp: incseq_def) @@ -1398,11 +1398,11 @@ lemma mult_nat_left_at_top: "c > 0 \ filterlim (\x. c * x) at_top sequentially" for c :: nat - by (rule filterlim_subseq) (auto simp: subseq_def) + by (rule filterlim_subseq) (auto simp: strict_mono_def) lemma mult_nat_right_at_top: "c > 0 \ filterlim (\x. x * c) at_top sequentially" for c :: nat - by (rule filterlim_subseq) (auto simp: subseq_def) + by (rule filterlim_subseq) (auto simp: strict_mono_def) lemma at_to_infinity: "(at (0::'a::{real_normed_field,field})) = filtermap inverse at_infinity" proof (rule antisym) diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Probability/Helly_Selection.thy --- a/src/HOL/Probability/Helly_Selection.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Probability/Helly_Selection.thy Thu Aug 17 14:52:56 2017 +0200 @@ -19,7 +19,7 @@ assumes rcont: "\n x. continuous (at_right x) (f n)" assumes mono: "\n. mono (f n)" assumes bdd: "\n x. \f n x\ \ M" - shows "\s. subseq s \ (\F. (\x. continuous (at_right x) F) \ mono F \ (\x. \F x\ \ M) \ + shows "\s. strict_mono (s::nat \ nat) \ (\F. (\x. continuous (at_right x) F) \ mono F \ (\x. \F x\ \ M) \ (\x. continuous (at x) F \ (\n. f (s n) x) \ F x))" proof - obtain m :: "real \ nat" where "bij_betw m \ UNIV" @@ -33,18 +33,18 @@ let ?P = "\n. \s. convergent (\k. f (s k) (r n))" interpret nat: subseqs ?P proof (unfold convergent_def, unfold subseqs_def, auto) - fix n :: nat and s :: "nat \ nat" assume s: "subseq s" + fix n :: nat and s :: "nat \ nat" assume s: "strict_mono s" have "bounded {-M..M}" using bounded_closed_interval by auto moreover have "\k. f (s k) (r n) \ {-M..M}" using bdd by (simp add: abs_le_iff minus_le_iff) - ultimately have "\l s'. subseq s' \ ((\k. f (s k) (r n)) \ s') \ l" + ultimately have "\l s'. strict_mono s' \ ((\k. f (s k) (r n)) \ s') \ l" using compact_Icc compact_imp_seq_compact seq_compactE by metis - thus "\s'. subseq s' \ (\l. (\k. f (s (s' k)) (r n)) \ l)" + thus "\s'. strict_mono (s'::nat\nat) \ (\l. (\k. f (s (s' k)) (r n)) \ l)" by (auto simp: comp_def) qed define d where "d = nat.diagseq" - have subseq: "subseq d" + have subseq: "strict_mono d" unfolding d_def using nat.subseq_diagseq by auto have rat_cnv: "?P n d" for n proof - @@ -157,8 +157,8 @@ (* Can strengthen to equivalence. *) theorem tight_imp_convergent_subsubsequence: - assumes \: "tight \" "subseq s" - shows "\r M. subseq r \ real_distribution M \ weak_conv_m (\ \ s \ r) M" + assumes \: "tight \" "strict_mono s" + shows "\r M. strict_mono (r :: nat \ nat) \ real_distribution M \ weak_conv_m (\ \ s \ r) M" proof - define f where "f k = cdf (\ (s k))" for k interpret \: real_distribution "\ k" for k @@ -174,7 +174,7 @@ by (auto simp add: abs_le_iff minus_le_iff f_def \.cdf_nonneg \.cdf_bounded_prob) from Helly_selection[OF rcont mono bdd, of "\x. x"] obtain r F - where F: "subseq r" "\x. continuous (at_right x) F" "mono F" "\x. \F x\ \ 1" + where F: "strict_mono r" "\x. continuous (at_right x) F" "mono F" "\x. \F x\ \ 1" and lim_F: "\x. continuous (at x) F \ (\n. f (r n) x) \ F x" by blast @@ -265,14 +265,14 @@ using F by (auto intro!: real_distribution_interval_measure cdf_interval_measure simp: mono_def) with lim_F LIMSEQ_subseq_LIMSEQ M have "weak_conv_m (\ \ s \ r) (interval_measure F)" by (auto simp: weak_conv_def weak_conv_m_def f_def comp_def) - then show "\r M. subseq r \ (real_distribution M \ weak_conv_m (\ \ s \ r) M)" + then show "\r M. strict_mono (r :: nat \ nat) \ (real_distribution M \ weak_conv_m (\ \ s \ r) M)" using F M by auto qed corollary tight_subseq_weak_converge: fixes \ :: "nat \ real measure" and M :: "real measure" assumes "\n. real_distribution (\ n)" "real_distribution M" and tight: "tight \" and - subseq: "\s \. subseq s \ real_distribution \ \ weak_conv_m (\ \ s) \ \ weak_conv_m (\ \ s) M" + subseq: "\s \. strict_mono s \ real_distribution \ \ weak_conv_m (\ \ s) \ \ weak_conv_m (\ \ s) M" shows "weak_conv_m \ M" proof (rule ccontr) define f where "f n = cdf (\ n)" for n @@ -283,12 +283,12 @@ by (auto simp: weak_conv_m_def weak_conv_def f_def F_def) then obtain \ where "\ > 0" and "infinite {n. \ dist (f n x) (F x) < \}" by (auto simp: tendsto_iff not_eventually INFM_iff_infinite cofinite_eq_sequentially[symmetric]) - then obtain s where s: "\n. \ dist (f (s n) x) (F x) < \" and "subseq s" - using enumerate_in_set enumerate_mono by (fastforce simp: subseq_def) - then obtain r \ where r: "subseq r" "real_distribution \" "weak_conv_m (\ \ s \ r) \" + then obtain s :: "nat \ nat" where s: "\n. \ dist (f (s n) x) (F x) < \" and "strict_mono s" + using enumerate_in_set enumerate_mono by (fastforce simp: strict_mono_def) + then obtain r \ where r: "strict_mono r" "real_distribution \" "weak_conv_m (\ \ s \ r) \" using tight_imp_convergent_subsubsequence[OF tight] by blast then have "weak_conv_m (\ \ (s \ r)) M" - using \subseq s\ r by (intro subseq subseq_o) (auto simp: comp_assoc) + using \strict_mono s\ r by (intro subseq strict_mono_o) (auto simp: comp_assoc) then have "(\n. f (s (r n)) x) \ F x" using x by (auto simp: weak_conv_m_def weak_conv_def F_def f_def) then show False diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Probability/Levy.thy --- a/src/HOL/Probability/Levy.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Probability/Levy.thy Thu Aug 17 14:52:56 2017 +0200 @@ -500,7 +500,7 @@ show ?thesis proof (rule tight_subseq_weak_converge [OF real_distr_M real_distr_M' tight]) fix s \ - assume s: "subseq s" + assume s: "strict_mono (s :: nat \ nat)" assume nu: "weak_conv_m (M \ s) \" assume *: "real_distribution \" have 2: "\n. real_distribution ((M \ s) n)" unfolding comp_def by (rule assms) diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Probability/Projective_Limit.thy --- a/src/HOL/Probability/Projective_Limit.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Probability/Projective_Limit.thy Thu Aug 17 14:52:56 2017 +0200 @@ -45,20 +45,20 @@ lemma compactE': fixes S :: "'a :: metric_space set" assumes "compact S" "\n\m. f n \ S" - obtains l r where "l \ S" "subseq r" "((f \ r) \ l) sequentially" + obtains l r where "l \ S" "strict_mono (r::nat\nat)" "((f \ r) \ l) sequentially" proof atomize_elim - have "subseq (op + m)" by (simp add: subseq_def) + have "strict_mono (op + m)" by (simp add: strict_mono_def) have "\n. (f o (\i. m + i)) n \ S" using assms by auto from seq_compactE[OF \compact S\[unfolded compact_eq_seq_compact_metric] this] guess l r . - hence "l \ S" "subseq ((\i. m + i) o r) \ (f \ ((\i. m + i) o r)) \ l" - using subseq_o[OF \subseq (op + m)\ \subseq r\] by (auto simp: o_def) - thus "\l r. l \ S \ subseq r \ (f \ r) \ l" by blast + hence "l \ S" "strict_mono ((\i. m + i) o r) \ (f \ ((\i. m + i) o r)) \ l" + using strict_mono_o[OF \strict_mono (op + m)\ \strict_mono r\] by (auto simp: o_def) + thus "\l r. l \ S \ strict_mono r \ (f \ r) \ l" by blast qed sublocale finmap_seqs_into_compact \ subseqs "\n s. (\l. (\i. ((f o s) i)\<^sub>F n) \ l)" proof - fix n s - assume "subseq s" + fix n and s :: "nat \ nat" + assume "strict_mono s" from proj_in_KE[of n] guess n0 . note n0 = this have "\i \ n0. ((f \ s) i)\<^sub>F n \ (\k. (k)\<^sub>F n) ` K n0" proof safe @@ -69,7 +69,7 @@ by auto qed from compactE'[OF compact_projset this] guess ls rs . - thus "\r'. subseq r' \ (\l. (\i. ((f \ (s \ r')) i)\<^sub>F n) \ l)" by (auto simp: o_def) + thus "\r'. strict_mono r' \ (\l. (\i. ((f \ (s \ r')) i)\<^sub>F n) \ l)" by (auto simp: o_def) qed lemma (in finmap_seqs_into_compact) diagonal_tendsto: "\l. (\i. (f (diagseq i))\<^sub>F n) \ l" @@ -77,11 +77,11 @@ obtain l where "(\i. ((f o (diagseq o op + (Suc n))) i)\<^sub>F n) \ l" proof (atomize_elim, rule diagseq_holds) fix r s n - assume "subseq r" + assume "strict_mono (r :: nat \ nat)" assume "\l. (\i. ((f \ s) i)\<^sub>F n) \ l" then obtain l where "((\i. (f i)\<^sub>F n) o s) \ l" by (auto simp: o_def) - hence "((\i. (f i)\<^sub>F n) o s o r) \ l" using \subseq r\ + hence "((\i. (f i)\<^sub>F n) o s o r) \ l" using \strict_mono r\ by (rule LIMSEQ_subseq_LIMSEQ) thus "\l. (\i. ((f \ (s \ r)) i)\<^sub>F n) \ l" by (auto simp add: o_def) qed @@ -406,7 +406,7 @@ have "(\i. fm n (y (Suc (diagseq i)))) \ finmap_of (Utn ` J n) z" by (rule tendsto_finmap) hence "((\i. fm n (y (Suc (diagseq i)))) o (\i. i + n)) \ finmap_of (Utn ` J n) z" - by (rule LIMSEQ_subseq_LIMSEQ) (simp add: subseq_def) + by (rule LIMSEQ_subseq_LIMSEQ) (simp add: strict_mono_def) moreover have "(\i. ((\i. fm n (y (Suc (diagseq i)))) o (\i. i + n)) i \ K' n)" apply (auto simp add: o_def intro!: fm_in_K' \1 \ n\ le_SucI) diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Series.thy --- a/src/HOL/Series.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Series.thy Thu Aug 17 14:52:56 2017 +0200 @@ -1107,7 +1107,7 @@ qed lemma sums_mono_reindex: - assumes subseq: "subseq g" + assumes subseq: "strict_mono g" and zero: "\n. n \ range g \ f n = 0" shows "(\n. f (g n)) sums c \ f sums c" unfolding sums_def @@ -1117,10 +1117,10 @@ proof fix n :: nat from subseq have "(\kk\g`{.. = (\kkk \ c" @@ -1150,7 +1150,7 @@ have "g l < g (g_inv n)" by (rule less_le_trans[OF _ g_inv]) (use k l in simp_all) with subseq have "l < g_inv n" - by (simp add: subseq_strict_mono strict_mono_less) + by (simp add: strict_mono_less) with k l show False by simp qed @@ -1160,7 +1160,7 @@ with g_inv_least' g_inv have "(\kk\g`{.. = (\kkk g (g_inv n)" by (rule g_inv) finally have "K \ g_inv n" - using subseq by (simp add: strict_mono_less_eq subseq_strict_mono) + using subseq by (simp add: strict_mono_less_eq) } then have "filterlim g_inv at_top sequentially" by (auto simp: filterlim_at_top eventually_at_top_linorder) @@ -1179,14 +1179,14 @@ qed lemma summable_mono_reindex: - assumes subseq: "subseq g" + assumes subseq: "strict_mono g" and zero: "\n. n \ range g \ f n = 0" shows "summable (\n. f (g n)) \ summable f" using sums_mono_reindex[of g f, OF assms] by (simp add: summable_def) lemma suminf_mono_reindex: fixes f :: "nat \ 'a::{t2_space,comm_monoid_add}" - assumes "subseq g" "\n. n \ range g \ f n = 0" + assumes "strict_mono g" "\n. n \ range g \ f n = 0" shows "suminf (\n. f (g n)) = suminf f" proof (cases "summable f") case True diff -r 407de0768126 -r a1f5c5c26fa6 src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Thu Aug 17 14:40:42 2017 +0200 +++ b/src/HOL/Topological_Spaces.thy Thu Aug 17 14:52:56 2017 +0200 @@ -1069,14 +1069,13 @@ unfolding antimono_def .. text \Definition of subsequence.\ -definition subseq :: "(nat \ nat) \ bool" - where "subseq f \ (\m. \n>m. f m < f n)" - -lemma subseq_le_mono: "subseq r \ m \ n \ r m \ r n" - by (simp add: less_mono_imp_le_mono subseq_def) - -lemma subseq_id: "subseq id" - by (simp add: subseq_def) + +(* For compatibility with the old "subseq" *) +lemma strict_mono_leD: "strict_mono r \ m \ n \ r m \ r n" + by (erule (1) monoD [OF strict_mono_mono]) + +lemma strict_mono_id: "strict_mono id" + by (simp add: strict_mono_def) lemma incseq_SucI: "(\n. X n \ X (Suc n)) \ incseq X" using lift_Suc_mono_le[of X] by (auto simp: incseq_def) @@ -1144,28 +1143,30 @@ text \Subsequence (alternative definition, (e.g. Hoskins)\ -lemma subseq_Suc_iff: "subseq f \ (\n. f n < f (Suc n))" - apply (simp add: subseq_def) - apply (auto dest!: less_imp_Suc_add) - apply (induct_tac k) - apply (auto intro: less_trans) - done - -lemma subseq_add: "subseq (\n. n + k)" - by (auto simp: subseq_Suc_iff) +lemma strict_mono_Suc_iff: "strict_mono f \ (\n. f n < f (Suc n))" +proof (intro iffI strict_monoI) + assume *: "\n. f n < f (Suc n)" + fix m n :: nat assume "m < n" + thus "f m < f n" + by (induction rule: less_Suc_induct) (use * in auto) +qed (auto simp: strict_mono_def) + +lemma strict_mono_add: "strict_mono (\n::'a::linordered_semidom. n + k)" + by (auto simp: strict_mono_def) text \For any sequence, there is a monotonic subsequence.\ lemma seq_monosub: fixes s :: "nat \ 'a::linorder" - shows "\f. subseq f \ monoseq (\n. (s (f n)))" + shows "\f. strict_mono f \ monoseq (\n. (s (f n)))" proof (cases "\n. \p>n. \m\p. s m \ s p") case True then have "\f. \n. (\m\f n. s m \ s (f n)) \ f n < f (Suc n)" by (intro dependent_nat_choice) (auto simp: conj_commute) - then obtain f where f: "subseq f" and mono: "\n m. f n \ m \ s m \ s (f n)" - by (auto simp: subseq_Suc_iff) + then obtain f :: "nat \ nat" + where f: "strict_mono f" and mono: "\n m. f n \ m \ s m \ s (f n)" + by (auto simp: strict_mono_Suc_iff) then have "incseq f" - unfolding subseq_Suc_iff incseq_Suc_iff by (auto intro: less_imp_le) + unfolding strict_mono_Suc_iff incseq_Suc_iff by (auto intro: less_imp_le) then have "monoseq (\n. s (f n))" by (auto simp add: incseq_def intro!: mono monoI2) with f show ?thesis @@ -1182,29 +1183,29 @@ by (auto intro: less_trans) qed auto then show ?thesis - by (auto simp: monoseq_iff incseq_Suc_iff subseq_Suc_iff) + by (auto simp: monoseq_iff incseq_Suc_iff strict_mono_Suc_iff) qed lemma seq_suble: - assumes sf: "subseq f" + assumes sf: "strict_mono (f :: nat \ nat)" shows "n \ f n" proof (induct n) case 0 show ?case by simp next case (Suc n) - with sf [unfolded subseq_Suc_iff, rule_format, of n] have "n < f (Suc n)" + with sf [unfolded strict_mono_Suc_iff, rule_format, of n] have "n < f (Suc n)" by arith then show ?case by arith qed lemma eventually_subseq: - "subseq r \ eventually P sequentially \ eventually (\n. P (r n)) sequentially" + "strict_mono r \ eventually P sequentially \ eventually (\n. P (r n)) sequentially" unfolding eventually_sequentially by (metis seq_suble le_trans) lemma not_eventually_sequentiallyD: assumes "\ eventually P sequentially" - shows "\r. subseq r \ (\n. \ P (r n))" + shows "\r::nat\nat. strict_mono r \ (\n. \ P (r n))" proof - from assms have "\n. \m\n. \ P m" unfolding eventually_sequentially by (simp add: not_less) @@ -1212,29 +1213,14 @@ by (auto simp: choice_iff) then show ?thesis by (auto intro!: exI[of _ "\n. r (((Suc \ r) ^^ Suc n) 0)"] - simp: less_eq_Suc_le subseq_Suc_iff) + simp: less_eq_Suc_le strict_mono_Suc_iff) qed -lemma filterlim_subseq: "subseq f \ filterlim f sequentially sequentially" +lemma filterlim_subseq: "strict_mono f \ filterlim f sequentially sequentially" unfolding filterlim_iff by (metis eventually_subseq) -lemma subseq_o: "subseq r \ subseq s \ subseq (r \ s)" - unfolding subseq_def by simp - -lemma subseq_mono: "subseq r \ m < n \ r m < r n" - by (auto simp: subseq_def) - -lemma subseq_imp_inj_on: "subseq g \ inj_on g A" -proof (rule inj_onI) - assume g: "subseq g" - fix x y - assume "g x = g y" - with subseq_mono[OF g, of x y] subseq_mono[OF g, of y x] show "x = y" - by (cases x y rule: linorder_cases) simp_all -qed - -lemma subseq_strict_mono: "subseq g \ strict_mono g" - by (intro strict_monoI subseq_mono[of g]) +lemma strict_mono_o: "strict_mono r \ strict_mono s \ strict_mono (r \ s)" + unfolding strict_mono_def by simp lemma incseq_imp_monoseq: "incseq X \ monoseq X" by (simp add: incseq_def monoseq_def) @@ -1324,10 +1310,10 @@ for x :: "'a::linorder_topology" by (metis LIMSEQ_le_const LIMSEQ_le_const2 decseq_def incseq_def monoseq_iff) -lemma LIMSEQ_subseq_LIMSEQ: "X \ L \ subseq f \ (X \ f) \ L" +lemma LIMSEQ_subseq_LIMSEQ: "X \ L \ strict_mono f \ (X \ f) \ L" unfolding comp_def by (rule filterlim_compose [of X, OF _ filterlim_subseq]) -lemma convergent_subseq_convergent: "convergent X \ subseq f \ convergent (X \ f)" +lemma convergent_subseq_convergent: "convergent X \ strict_mono f \ convergent (X \ f)" by (auto simp: convergent_def intro: LIMSEQ_subseq_LIMSEQ) lemma limI: "X \ L \ lim X = L" @@ -1651,7 +1637,7 @@ and "(\n. X (s n)) \ a" and "\ P (X (s n))" for n - by (auto simp: subseq_Suc_iff Suc_le_eq incseq_Suc_iff + by (auto simp: strict_mono_Suc_iff Suc_le_eq incseq_Suc_iff intro!: LIMSEQ_subseq_LIMSEQ[OF \X \ a\, unfolded comp_def]) from *[OF this(1,2,3,4)] this(5) show False by auto @@ -1700,7 +1686,7 @@ and "(\n. X (s n)) \ a" and "\ P (X (s n))" for n - by (auto simp: subseq_Suc_iff Suc_le_eq decseq_Suc_iff + by (auto simp: strict_mono_Suc_iff Suc_le_eq decseq_Suc_iff intro!: LIMSEQ_subseq_LIMSEQ[OF \X \ a\, unfolded comp_def]) from *[OF this(1,2,3,4)] this(5) show False by auto @@ -3143,11 +3129,11 @@ unfolding Cauchy_uniform filterlim_def by (intro nhds_imp_cauchy_filter) lemma Cauchy_subseq_Cauchy: - assumes "Cauchy X" "subseq f" + assumes "Cauchy X" "strict_mono f" shows "Cauchy (X \ f)" unfolding Cauchy_uniform comp_def filtermap_filtermap[symmetric] cauchy_filter_def by (rule order_trans[OF _ \Cauchy X\[unfolded Cauchy_uniform cauchy_filter_def]]) - (intro prod_filter_mono filtermap_mono filterlim_subseq[OF \subseq f\, unfolded filterlim_def]) + (intro prod_filter_mono filtermap_mono filterlim_subseq[OF \strict_mono f\, unfolded filterlim_def]) lemma convergent_Cauchy: "convergent X \ Cauchy X" unfolding convergent_def by (erule exE, erule LIMSEQ_imp_Cauchy)