src/HOL/Lim.thy
changeset 44254 336dd390e4a4
parent 44253 c073a0bd8458
child 44282 f0de18b62d63
equal deleted inserted replaced
44253:c073a0bd8458 44254:336dd390e4a4
   541 
   541 
   542 
   542 
   543 subsection {* Relation of LIM and LIMSEQ *}
   543 subsection {* Relation of LIM and LIMSEQ *}
   544 
   544 
   545 lemma LIMSEQ_SEQ_conv1:
   545 lemma LIMSEQ_SEQ_conv1:
   546   assumes X: "X -- a --> L"
   546   fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
   547   shows "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> a \<longrightarrow> (\<lambda>n. X (S n)) ----> L"
   547   assumes f: "f -- a --> l"
   548   using tendsto_compose_eventually [OF X, where F=sequentially] by simp
   548   shows "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> a \<longrightarrow> (\<lambda>n. f (S n)) ----> l"
   549 
   549   using tendsto_compose_eventually [OF f, where F=sequentially] by simp
   550 lemma LIMSEQ_SEQ_conv2:
   550 
   551   fixes a :: real and L :: "'a::metric_space"
   551 lemma LIMSEQ_SEQ_conv2_lemma:
   552   assumes "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> a \<longrightarrow> (\<lambda>n. X (S n)) ----> L"
   552   fixes a :: "'a::metric_space"
   553   shows "X -- a --> L"
   553   assumes "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> a \<longrightarrow> eventually (\<lambda>x. P (S x)) sequentially"
       
   554   shows "eventually P (at a)"
   554 proof (rule ccontr)
   555 proof (rule ccontr)
   555   assume "\<not> (X -- a --> L)"
   556   let ?I = "\<lambda>n. inverse (real (Suc n))"
   556   hence "\<not> (\<forall>r > 0. \<exists>s > 0. \<forall>x. x \<noteq> a & norm (x - a) < s --> dist (X x) L < r)"
   557   let ?F = "\<lambda>n::nat. SOME x. x \<noteq> a \<and> dist x a < ?I n \<and> \<not> P x"
   557     unfolding LIM_def dist_norm .
   558   assume "\<not> eventually P (at a)"
   558   hence "\<exists>r > 0. \<forall>s > 0. \<exists>x. \<not>(x \<noteq> a \<and> \<bar>x - a\<bar> < s --> dist (X x) L < r)" by simp
   559   hence P: "\<forall>d>0. \<exists>x. x \<noteq> a \<and> dist x a < d \<and> \<not> P x"
   559   hence "\<exists>r > 0. \<forall>s > 0. \<exists>x. (x \<noteq> a \<and> \<bar>x - a\<bar> < s \<and> dist (X x) L \<ge> r)" by (simp add: not_less)
   560     unfolding eventually_at by simp
   560   then obtain r where rdef: "r > 0 \<and> (\<forall>s > 0. \<exists>x. (x \<noteq> a \<and> \<bar>x - a\<bar> < s \<and> dist (X x) L \<ge> r))" by auto
   561   hence "\<And>n. \<exists>x. x \<noteq> a \<and> dist x a < ?I n \<and> \<not> P x" by simp
   561 
   562   hence F: "\<And>n. ?F n \<noteq> a \<and> dist (?F n) a < ?I n \<and> \<not> P (?F n)"
   562   let ?F = "\<lambda>n::nat. SOME x. x\<noteq>a \<and> \<bar>x - a\<bar> < inverse (real (Suc n)) \<and> dist (X x) L \<ge> r"
       
   563   have "\<And>n. \<exists>x. x\<noteq>a \<and> \<bar>x - a\<bar> < inverse (real (Suc n)) \<and> dist (X x) L \<ge> r"
       
   564     using rdef by simp
       
   565   hence F: "\<And>n. ?F n \<noteq> a \<and> \<bar>?F n - a\<bar> < inverse (real (Suc n)) \<and> dist (X (?F n)) L \<ge> r"
       
   566     by (rule someI_ex)
   563     by (rule someI_ex)
   567   hence F1: "\<And>n. ?F n \<noteq> a"
   564   hence F1: "\<And>n. ?F n \<noteq> a"
   568     and F2: "\<And>n. \<bar>?F n - a\<bar> < inverse (real (Suc n))"
   565     and F2: "\<And>n. dist (?F n) a < ?I n"
   569     and F3: "\<And>n. dist (X (?F n)) L \<ge> r"
   566     and F3: "\<And>n. \<not> P (?F n)"
   570     by fast+
   567     by fast+
   571 
       
   572   have "?F ----> a"
   568   have "?F ----> a"
   573   proof (rule LIMSEQ_I, unfold real_norm_def)
   569     using LIMSEQ_inverse_real_of_nat
   574       fix e::real
   570     by (rule metric_tendsto_imp_tendsto,
   575       assume "0 < e"
   571       simp add: dist_norm F2 [THEN less_imp_le])
   576         (* choose no such that inverse (real (Suc n)) < e *)
       
   577       then have "\<exists>no. inverse (real (Suc no)) < e" by (rule reals_Archimedean)
       
   578       then obtain m where nodef: "inverse (real (Suc m)) < e" by auto
       
   579       show "\<exists>no. \<forall>n. no \<le> n --> \<bar>?F n - a\<bar> < e"
       
   580       proof (intro exI allI impI)
       
   581         fix n
       
   582         assume mlen: "m \<le> n"
       
   583         have "\<bar>?F n - a\<bar> < inverse (real (Suc n))"
       
   584           by (rule F2)
       
   585         also have "inverse (real (Suc n)) \<le> inverse (real (Suc m))"
       
   586           using mlen by auto
       
   587         also from nodef have
       
   588           "inverse (real (Suc m)) < e" .
       
   589         finally show "\<bar>?F n - a\<bar> < e" .
       
   590       qed
       
   591   qed
       
   592   
       
   593   moreover have "\<forall>n. ?F n \<noteq> a"
   572   moreover have "\<forall>n. ?F n \<noteq> a"
   594     by (rule allI) (rule F1)
   573     by (rule allI) (rule F1)
   595 
   574   ultimately have "eventually (\<lambda>n. P (?F n)) sequentially"
   596   moreover note `\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> a \<longrightarrow> (\<lambda>n. X (S n)) ----> L`
   575     using assms by simp
   597   ultimately have "(\<lambda>n. X (?F n)) ----> L" by simp
   576   thus "False" by (simp add: F3)
   598   
       
   599   moreover have "\<not> ((\<lambda>n. X (?F n)) ----> L)"
       
   600   proof -
       
   601     {
       
   602       fix no::nat
       
   603       obtain n where "n = no + 1" by simp
       
   604       then have nolen: "no \<le> n" by simp
       
   605         (* We prove this by showing that for any m there is an n\<ge>m such that |X (?F n) - L| \<ge> r *)
       
   606       have "dist (X (?F n)) L \<ge> r"
       
   607         by (rule F3)
       
   608       with nolen have "\<exists>n. no \<le> n \<and> dist (X (?F n)) L \<ge> r" by fast
       
   609     }
       
   610     then have "(\<forall>no. \<exists>n. no \<le> n \<and> dist (X (?F n)) L \<ge> r)" by simp
       
   611     with rdef have "\<exists>e>0. (\<forall>no. \<exists>n. no \<le> n \<and> dist (X (?F n)) L \<ge> e)" by auto
       
   612     thus ?thesis by (unfold LIMSEQ_def, auto simp add: not_less)
       
   613   qed
       
   614   ultimately show False by simp
       
   615 qed
   577 qed
   616 
   578 
       
   579 lemma LIMSEQ_SEQ_conv2:
       
   580   fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space"
       
   581   assumes "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> a \<longrightarrow> (\<lambda>n. f (S n)) ----> l"
       
   582   shows "f -- a --> l"
       
   583   using assms unfolding tendsto_def [where l=l]
       
   584   by (simp add: LIMSEQ_SEQ_conv2_lemma)
       
   585 
   617 lemma LIMSEQ_SEQ_conv:
   586 lemma LIMSEQ_SEQ_conv:
   618   "(\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> (a::real) \<longrightarrow> (\<lambda>n. X (S n)) ----> L) =
   587   "(\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> (a::'a::metric_space) \<longrightarrow> (\<lambda>n. X (S n)) ----> L) =
   619    (X -- a --> (L::'a::metric_space))"
   588    (X -- a --> (L::'b::topological_space))"
   620   using LIMSEQ_SEQ_conv2 LIMSEQ_SEQ_conv1 ..
   589   using LIMSEQ_SEQ_conv2 LIMSEQ_SEQ_conv1 ..
   621 
   590 
   622 end
   591 end