918 then show "\<exists>r. \<forall>x. r \<le> norm x \<longrightarrow> P x \<and> Q x" .. |
918 then show "\<exists>r. \<forall>x. r \<le> norm x \<longrightarrow> P x \<and> Q x" .. |
919 qed auto |
919 qed auto |
920 |
920 |
921 text {* Identify Trivial limits, where we can't approach arbitrarily closely. *} |
921 text {* Identify Trivial limits, where we can't approach arbitrarily closely. *} |
922 |
922 |
923 definition |
|
924 trivial_limit :: "'a net \<Rightarrow> bool" where |
|
925 "trivial_limit net \<longleftrightarrow> eventually (\<lambda>x. False) net" |
|
926 |
|
927 lemma trivial_limit_within: |
923 lemma trivial_limit_within: |
928 shows "trivial_limit (at a within S) \<longleftrightarrow> \<not> a islimpt S" |
924 shows "trivial_limit (at a within S) \<longleftrightarrow> \<not> a islimpt S" |
929 proof |
925 proof |
930 assume "trivial_limit (at a within S)" |
926 assume "trivial_limit (at a within S)" |
931 thus "\<not> a islimpt S" |
927 thus "\<not> a islimpt S" |
964 apply clarsimp |
960 apply clarsimp |
965 apply (rule_tac x="scaleR b (sgn 1)" in exI) |
961 apply (rule_tac x="scaleR b (sgn 1)" in exI) |
966 apply (simp add: norm_sgn) |
962 apply (simp add: norm_sgn) |
967 done |
963 done |
968 |
964 |
969 lemma trivial_limit_sequentially[intro]: "\<not> trivial_limit sequentially" |
|
970 by (auto simp add: trivial_limit_def eventually_sequentially) |
|
971 |
|
972 text {* Some property holds "sufficiently close" to the limit point. *} |
965 text {* Some property holds "sufficiently close" to the limit point. *} |
973 |
966 |
974 lemma eventually_at: (* FIXME: this replaces Limits.eventually_at *) |
967 lemma eventually_at: (* FIXME: this replaces Limits.eventually_at *) |
975 "eventually P (at a) \<longleftrightarrow> (\<exists>d>0. \<forall>x. 0 < dist x a \<and> dist x a < d \<longrightarrow> P x)" |
968 "eventually P (at a) \<longleftrightarrow> (\<exists>d>0. \<forall>x. 0 < dist x a \<and> dist x a < d \<longrightarrow> P x)" |
976 unfolding eventually_at dist_nz by auto |
969 unfolding eventually_at dist_nz by auto |
997 lemma trivial_limit_eventually: "trivial_limit net \<Longrightarrow> eventually P net" |
990 lemma trivial_limit_eventually: "trivial_limit net \<Longrightarrow> eventually P net" |
998 unfolding trivial_limit_def by (auto elim: eventually_rev_mp) |
991 unfolding trivial_limit_def by (auto elim: eventually_rev_mp) |
999 |
992 |
1000 lemma eventually_False: "eventually (\<lambda>x. False) net \<longleftrightarrow> trivial_limit net" |
993 lemma eventually_False: "eventually (\<lambda>x. False) net \<longleftrightarrow> trivial_limit net" |
1001 unfolding trivial_limit_def .. |
994 unfolding trivial_limit_def .. |
|
995 |
1002 |
996 |
1003 lemma trivial_limit_eq: "trivial_limit net \<longleftrightarrow> (\<forall>P. eventually P net)" |
997 lemma trivial_limit_eq: "trivial_limit net \<longleftrightarrow> (\<forall>P. eventually P net)" |
1004 apply (safe elim!: trivial_limit_eventually) |
998 apply (safe elim!: trivial_limit_eventually) |
1005 apply (simp add: eventually_False [symmetric]) |
999 apply (simp add: eventually_False [symmetric]) |
1006 done |
1000 done |
1341 thus False by simp |
1335 thus False by simp |
1342 qed |
1336 qed |
1343 |
1337 |
1344 text{* Uniqueness of the limit, when nontrivial. *} |
1338 text{* Uniqueness of the limit, when nontrivial. *} |
1345 |
1339 |
1346 lemma Lim_unique: |
|
1347 fixes f :: "'a \<Rightarrow> 'b::t2_space" |
|
1348 assumes "\<not> trivial_limit net" "(f ---> l) net" "(f ---> l') net" |
|
1349 shows "l = l'" |
|
1350 proof (rule ccontr) |
|
1351 assume "l \<noteq> l'" |
|
1352 obtain U V where "open U" "open V" "l \<in> U" "l' \<in> V" "U \<inter> V = {}" |
|
1353 using hausdorff [OF `l \<noteq> l'`] by fast |
|
1354 have "eventually (\<lambda>x. f x \<in> U) net" |
|
1355 using `(f ---> l) net` `open U` `l \<in> U` by (rule topological_tendstoD) |
|
1356 moreover |
|
1357 have "eventually (\<lambda>x. f x \<in> V) net" |
|
1358 using `(f ---> l') net` `open V` `l' \<in> V` by (rule topological_tendstoD) |
|
1359 ultimately |
|
1360 have "eventually (\<lambda>x. False) net" |
|
1361 proof (rule eventually_elim2) |
|
1362 fix x |
|
1363 assume "f x \<in> U" "f x \<in> V" |
|
1364 hence "f x \<in> U \<inter> V" by simp |
|
1365 with `U \<inter> V = {}` show "False" by simp |
|
1366 qed |
|
1367 with `\<not> trivial_limit net` show "False" |
|
1368 by (simp add: eventually_False) |
|
1369 qed |
|
1370 |
|
1371 lemma tendsto_Lim: |
1340 lemma tendsto_Lim: |
1372 fixes f :: "'a \<Rightarrow> 'b::t2_space" |
1341 fixes f :: "'a \<Rightarrow> 'b::t2_space" |
1373 shows "~(trivial_limit net) \<Longrightarrow> (f ---> l) net ==> Lim net f = l" |
1342 shows "~(trivial_limit net) \<Longrightarrow> (f ---> l) net ==> Lim net f = l" |
1374 unfolding Lim_def using Lim_unique[of net f] by auto |
1343 unfolding Lim_def using tendsto_unique[of net f] by auto |
1375 |
1344 |
1376 text{* Limit under bilinear function *} |
1345 text{* Limit under bilinear function *} |
1377 |
1346 |
1378 lemma Lim_bilinear: |
1347 lemma Lim_bilinear: |
1379 assumes "(f ---> l) net" and "(g ---> m) net" and "bounded_bilinear h" |
1348 assumes "(f ---> l) net" and "(g ---> m) net" and "bounded_bilinear h" |
1442 shows "netlimit (at a within S) = a" |
1411 shows "netlimit (at a within S) = a" |
1443 unfolding netlimit_def |
1412 unfolding netlimit_def |
1444 apply (rule some_equality) |
1413 apply (rule some_equality) |
1445 apply (rule Lim_at_within) |
1414 apply (rule Lim_at_within) |
1446 apply (rule Lim_ident_at) |
1415 apply (rule Lim_ident_at) |
1447 apply (erule Lim_unique [OF assms]) |
1416 apply (erule tendsto_unique [OF assms]) |
1448 apply (rule Lim_at_within) |
1417 apply (rule Lim_at_within) |
1449 apply (rule Lim_ident_at) |
1418 apply (rule Lim_ident_at) |
1450 done |
1419 done |
1451 |
1420 |
1452 lemma netlimit_at: |
1421 lemma netlimit_at: |
2482 { fix x assume "x islimpt s" |
2451 { fix x assume "x islimpt s" |
2483 then obtain f where f: "\<forall>n. f n \<in> s - {x}" "(f ---> x) sequentially" |
2452 then obtain f where f: "\<forall>n. f n \<in> s - {x}" "(f ---> x) sequentially" |
2484 unfolding islimpt_sequential by auto |
2453 unfolding islimpt_sequential by auto |
2485 then obtain l where l: "l\<in>s" "(f ---> l) sequentially" |
2454 then obtain l where l: "l\<in>s" "(f ---> l) sequentially" |
2486 using `complete s`[unfolded complete_def] using convergent_imp_cauchy[of f x] by auto |
2455 using `complete s`[unfolded complete_def] using convergent_imp_cauchy[of f x] by auto |
2487 hence "x \<in> s" using Lim_unique[of sequentially f l x] trivial_limit_sequentially f(2) by auto |
2456 hence "x \<in> s" using tendsto_unique[of sequentially f l x] trivial_limit_sequentially f(2) by auto |
2488 } |
2457 } |
2489 thus "closed s" unfolding closed_limpt by auto |
2458 thus "closed s" unfolding closed_limpt by auto |
2490 qed |
2459 qed |
2491 |
2460 |
2492 lemma complete_eq_closed: |
2461 lemma complete_eq_closed: |
3055 proof- |
3024 proof- |
3056 obtain l' where l:"\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l' x) < e" |
3025 obtain l' where l:"\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l' x) < e" |
3057 using assms(1) unfolding uniformly_convergent_eq_cauchy[THEN sym] by auto |
3026 using assms(1) unfolding uniformly_convergent_eq_cauchy[THEN sym] by auto |
3058 moreover |
3027 moreover |
3059 { fix x assume "P x" |
3028 { fix x assume "P x" |
3060 hence "l x = l' x" using Lim_unique[OF trivial_limit_sequentially, of "\<lambda>n. s n x" "l x" "l' x"] |
3029 hence "l x = l' x" using tendsto_unique[OF trivial_limit_sequentially, of "\<lambda>n. s n x" "l x" "l' x"] |
3061 using l and assms(2) unfolding Lim_sequentially by blast } |
3030 using l and assms(2) unfolding Lim_sequentially by blast } |
3062 ultimately show ?thesis by auto |
3031 ultimately show ?thesis by auto |
3063 qed |
3032 qed |
3064 |
3033 |
3065 subsection {* Continuity *} |
3034 subsection {* Continuity *} |
5878 hence "continuous_on s g" unfolding continuous_on_iff by auto |
5847 hence "continuous_on s g" unfolding continuous_on_iff by auto |
5879 |
5848 |
5880 hence "((snd \<circ> h \<circ> r) ---> g a) sequentially" unfolding continuous_on_sequentially |
5849 hence "((snd \<circ> h \<circ> r) ---> g a) sequentially" unfolding continuous_on_sequentially |
5881 apply (rule allE[where x="\<lambda>n. (fst \<circ> h \<circ> r) n"]) apply (erule ballE[where x=a]) |
5850 apply (rule allE[where x="\<lambda>n. (fst \<circ> h \<circ> r) n"]) apply (erule ballE[where x=a]) |
5882 using lima unfolding h_def o_def using fs[OF `x\<in>s`] by (auto simp add: y_def) |
5851 using lima unfolding h_def o_def using fs[OF `x\<in>s`] by (auto simp add: y_def) |
5883 hence "g a = a" using Lim_unique[OF trivial_limit_sequentially limb, of "g a"] |
5852 hence "g a = a" using tendsto_unique[OF trivial_limit_sequentially limb, of "g a"] |
5884 unfolding `a=b` and o_assoc by auto |
5853 unfolding `a=b` and o_assoc by auto |
5885 moreover |
5854 moreover |
5886 { fix x assume "x\<in>s" "g x = x" "x\<noteq>a" |
5855 { fix x assume "x\<in>s" "g x = x" "x\<noteq>a" |
5887 hence "False" using dist[THEN bspec[where x=a], THEN bspec[where x=x]] |
5856 hence "False" using dist[THEN bspec[where x=a], THEN bspec[where x=x]] |
5888 using `g a = a` and `a\<in>s` by auto } |
5857 using `g a = a` and `a\<in>s` by auto } |