author | hoelzl |
Fri, 22 Mar 2013 10:41:42 +0100 | |
changeset 51471 | cad22a3cc09c |
parent 50331 | 4b6dc5077e98 |
child 51472 | adb441e4b9e9 |
permissions | -rw-r--r-- |
10751 | 1 |
(* Title : Lim.thy |
2 |
Author : Jacques D. Fleuriot |
|
3 |
Copyright : 1998 University of Cambridge |
|
14477 | 4 |
Conversion to Isar and new proofs by Lawrence C Paulson, 2004 |
10751 | 5 |
*) |
6 |
||
21165
8fb49f668511
moved DERIV stuff from Lim.thy to new Deriv.thy; cleaned up LIMSEQ_SEQ proofs
huffman
parents:
21141
diff
changeset
|
7 |
header{* Limits and Continuity *} |
10751 | 8 |
|
15131 | 9 |
theory Lim |
29197
6d4cb27ed19c
adapted HOL source structure to distribution layout
haftmann
parents:
28952
diff
changeset
|
10 |
imports SEQ |
15131 | 11 |
begin |
14477 | 12 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
21399
diff
changeset
|
13 |
definition |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
14 |
isUCont :: "['a::metric_space \<Rightarrow> 'b::metric_space] \<Rightarrow> bool" where |
37767 | 15 |
"isUCont f = (\<forall>r>0. \<exists>s>0. \<forall>x y. dist x y < s \<longrightarrow> dist (f x) (f y) < r)" |
10751 | 16 |
|
31392 | 17 |
subsection {* Limits of Functions *} |
31349
2261c8781f73
new theory of filters and limits; prove LIMSEQ and LIM lemmas using filters
huffman
parents:
31338
diff
changeset
|
18 |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
19 |
lemma metric_LIM_I: |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
20 |
"(\<And>r. 0 < r \<Longrightarrow> \<exists>s>0. \<forall>x. x \<noteq> a \<and> dist x a < s \<longrightarrow> dist (f x) L < r) |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
21 |
\<Longrightarrow> f -- a --> L" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
22 |
by (simp add: LIM_def) |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
23 |
|
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
24 |
lemma metric_LIM_D: |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
25 |
"\<lbrakk>f -- a --> L; 0 < r\<rbrakk> |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
26 |
\<Longrightarrow> \<exists>s>0. \<forall>x. x \<noteq> a \<and> dist x a < s \<longrightarrow> dist (f x) L < r" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
27 |
by (simp add: LIM_def) |
14477 | 28 |
|
29 |
lemma LIM_eq: |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
30 |
fixes a :: "'a::real_normed_vector" and L :: "'b::real_normed_vector" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
31 |
shows "f -- a --> L = |
20561
6a6d8004322f
generalize type of (NS)LIM to work on functions with vector space domain types
huffman
parents:
20552
diff
changeset
|
32 |
(\<forall>r>0.\<exists>s>0.\<forall>x. x \<noteq> a & norm (x-a) < s --> norm (f x - L) < r)" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
33 |
by (simp add: LIM_def dist_norm) |
14477 | 34 |
|
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
20432
diff
changeset
|
35 |
lemma LIM_I: |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
36 |
fixes a :: "'a::real_normed_vector" and L :: "'b::real_normed_vector" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
37 |
shows "(!!r. 0<r ==> \<exists>s>0.\<forall>x. x \<noteq> a & norm (x-a) < s --> norm (f x - L) < r) |
20552
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
20432
diff
changeset
|
38 |
==> f -- a --> L" |
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
20432
diff
changeset
|
39 |
by (simp add: LIM_eq) |
2c31dd358c21
generalized types of many constants to work over arbitrary vector spaces;
huffman
parents:
20432
diff
changeset
|
40 |
|
14477 | 41 |
lemma LIM_D: |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
42 |
fixes a :: "'a::real_normed_vector" and L :: "'b::real_normed_vector" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
43 |
shows "[| f -- a --> L; 0<r |] |
20561
6a6d8004322f
generalize type of (NS)LIM to work on functions with vector space domain types
huffman
parents:
20552
diff
changeset
|
44 |
==> \<exists>s>0.\<forall>x. x \<noteq> a & norm (x-a) < s --> norm (f x - L) < r" |
14477 | 45 |
by (simp add: LIM_eq) |
46 |
||
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
47 |
lemma LIM_offset: |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
48 |
fixes a :: "'a::real_normed_vector" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
49 |
shows "f -- a --> L \<Longrightarrow> (\<lambda>x. f (x + k)) -- a - k --> L" |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
50 |
apply (rule topological_tendstoI) |
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
51 |
apply (drule (2) topological_tendstoD) |
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
52 |
apply (simp only: eventually_at dist_norm) |
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
53 |
apply (clarify, rule_tac x=d in exI, safe) |
20756 | 54 |
apply (drule_tac x="x + k" in spec) |
29667 | 55 |
apply (simp add: algebra_simps) |
20756 | 56 |
done |
57 |
||
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
58 |
lemma LIM_offset_zero: |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
59 |
fixes a :: "'a::real_normed_vector" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
60 |
shows "f -- a --> L \<Longrightarrow> (\<lambda>h. f (a + h)) -- 0 --> L" |
21239 | 61 |
by (drule_tac k="a" in LIM_offset, simp add: add_commute) |
62 |
||
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
63 |
lemma LIM_offset_zero_cancel: |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
64 |
fixes a :: "'a::real_normed_vector" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
65 |
shows "(\<lambda>h. f (a + h)) -- 0 --> L \<Longrightarrow> f -- a --> L" |
21239 | 66 |
by (drule_tac k="- a" in LIM_offset, simp) |
67 |
||
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
68 |
lemma LIM_zero: |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
69 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
44570 | 70 |
shows "(f ---> l) F \<Longrightarrow> ((\<lambda>x. f x - l) ---> 0) F" |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
71 |
unfolding tendsto_iff dist_norm by simp |
21239 | 72 |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
73 |
lemma LIM_zero_cancel: |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
74 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
44570 | 75 |
shows "((\<lambda>x. f x - l) ---> 0) F \<Longrightarrow> (f ---> l) F" |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
76 |
unfolding tendsto_iff dist_norm by simp |
21239 | 77 |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
78 |
lemma LIM_zero_iff: |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
79 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::real_normed_vector" |
44570 | 80 |
shows "((\<lambda>x. f x - l) ---> 0) F = (f ---> l) F" |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
81 |
unfolding tendsto_iff dist_norm by simp |
21399 | 82 |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
83 |
lemma metric_LIM_imp_LIM: |
21257 | 84 |
assumes f: "f -- a --> l" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
85 |
assumes le: "\<And>x. x \<noteq> a \<Longrightarrow> dist (g x) m \<le> dist (f x) l" |
21257 | 86 |
shows "g -- a --> m" |
44251 | 87 |
by (rule metric_tendsto_imp_tendsto [OF f], |
88 |
auto simp add: eventually_at_topological le) |
|
21257 | 89 |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
90 |
lemma LIM_imp_LIM: |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
91 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
92 |
fixes g :: "'a::topological_space \<Rightarrow> 'c::real_normed_vector" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
93 |
assumes f: "f -- a --> l" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
94 |
assumes le: "\<And>x. x \<noteq> a \<Longrightarrow> norm (g x - m) \<le> norm (f x - l)" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
95 |
shows "g -- a --> m" |
44251 | 96 |
by (rule metric_LIM_imp_LIM [OF f], |
97 |
simp add: dist_norm le) |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
98 |
|
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
99 |
lemma metric_LIM_equal2: |
21282
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
100 |
assumes 1: "0 < R" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
101 |
assumes 2: "\<And>x. \<lbrakk>x \<noteq> a; dist x a < R\<rbrakk> \<Longrightarrow> f x = g x" |
21282
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
102 |
shows "g -- a --> l \<Longrightarrow> f -- a --> l" |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
103 |
apply (rule topological_tendstoI) |
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
104 |
apply (drule (2) topological_tendstoD) |
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
105 |
apply (simp add: eventually_at, safe) |
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
106 |
apply (rule_tac x="min d R" in exI, safe) |
21282
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
107 |
apply (simp add: 1) |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
108 |
apply (simp add: 2) |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
109 |
done |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
110 |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
111 |
lemma LIM_equal2: |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
112 |
fixes f g :: "'a::real_normed_vector \<Rightarrow> 'b::topological_space" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
113 |
assumes 1: "0 < R" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
114 |
assumes 2: "\<And>x. \<lbrakk>x \<noteq> a; norm (x - a) < R\<rbrakk> \<Longrightarrow> f x = g x" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
115 |
shows "g -- a --> l \<Longrightarrow> f -- a --> l" |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
116 |
by (rule metric_LIM_equal2 [OF 1 2], simp_all add: dist_norm) |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
117 |
|
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
118 |
lemma metric_LIM_compose2: |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
119 |
assumes f: "f -- a --> b" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
120 |
assumes g: "g -- b --> c" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
121 |
assumes inj: "\<exists>d>0. \<forall>x. x \<noteq> a \<and> dist x a < d \<longrightarrow> f x \<noteq> b" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
122 |
shows "(\<lambda>x. g (f x)) -- a --> c" |
44314 | 123 |
using g f inj [folded eventually_at] |
124 |
by (rule tendsto_compose_eventually) |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
125 |
|
23040 | 126 |
lemma LIM_compose2: |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
127 |
fixes a :: "'a::real_normed_vector" |
23040 | 128 |
assumes f: "f -- a --> b" |
129 |
assumes g: "g -- b --> c" |
|
130 |
assumes inj: "\<exists>d>0. \<forall>x. x \<noteq> a \<and> norm (x - a) < d \<longrightarrow> f x \<noteq> b" |
|
131 |
shows "(\<lambda>x. g (f x)) -- a --> c" |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
132 |
by (rule metric_LIM_compose2 [OF f g inj [folded dist_norm]]) |
23040 | 133 |
|
21282
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
134 |
lemma real_LIM_sandwich_zero: |
36662
621122eeb138
generalize types of LIMSEQ and LIM; generalize many lemmas
huffman
parents:
36661
diff
changeset
|
135 |
fixes f g :: "'a::topological_space \<Rightarrow> real" |
21282
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
136 |
assumes f: "f -- a --> 0" |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
137 |
assumes 1: "\<And>x. x \<noteq> a \<Longrightarrow> 0 \<le> g x" |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
138 |
assumes 2: "\<And>x. x \<noteq> a \<Longrightarrow> g x \<le> f x" |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
139 |
shows "g -- a --> 0" |
51471 | 140 |
proof (rule LIM_imp_LIM [OF f]) (* FIXME: use tendsto_sandwich *) |
21282
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
141 |
fix x assume x: "x \<noteq> a" |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
142 |
have "norm (g x - 0) = g x" by (simp add: 1 x) |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
143 |
also have "g x \<le> f x" by (rule 2 [OF x]) |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
144 |
also have "f x \<le> \<bar>f x\<bar>" by (rule abs_ge_self) |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
145 |
also have "\<bar>f x\<bar> = norm (f x - 0)" by simp |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
146 |
finally show "norm (g x - 0) \<le> norm (f x - 0)" . |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
147 |
qed |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
148 |
|
14477 | 149 |
|
20755 | 150 |
subsection {* Continuity *} |
14477 | 151 |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
152 |
lemma LIM_isCont_iff: |
36665 | 153 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::topological_space" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
154 |
shows "(f -- a --> f a) = ((\<lambda>h. f (a + h)) -- 0 --> f a)" |
21239 | 155 |
by (rule iffI [OF LIM_offset_zero LIM_offset_zero_cancel]) |
156 |
||
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
157 |
lemma isCont_iff: |
36665 | 158 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::topological_space" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
159 |
shows "isCont f x = (\<lambda>h. f (x + h)) -- 0 --> f x" |
21239 | 160 |
by (simp add: isCont_def LIM_isCont_iff) |
161 |
||
44233 | 162 |
lemma isCont_norm [simp]: |
36665 | 163 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
164 |
shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. norm (f x)) a" |
44314 | 165 |
unfolding isCont_def by (rule tendsto_norm) |
21786 | 166 |
|
44233 | 167 |
lemma isCont_rabs [simp]: |
168 |
fixes f :: "'a::topological_space \<Rightarrow> real" |
|
169 |
shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. \<bar>f x\<bar>) a" |
|
44314 | 170 |
unfolding isCont_def by (rule tendsto_rabs) |
22627
2b093ba973bc
new LIM/isCont lemmas for abs, of_real, and power
huffman
parents:
22613
diff
changeset
|
171 |
|
44233 | 172 |
lemma isCont_add [simp]: |
36665 | 173 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
174 |
shows "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x + g x) a" |
44314 | 175 |
unfolding isCont_def by (rule tendsto_add) |
21239 | 176 |
|
44233 | 177 |
lemma isCont_minus [simp]: |
36665 | 178 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
179 |
shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. - f x) a" |
44314 | 180 |
unfolding isCont_def by (rule tendsto_minus) |
21239 | 181 |
|
44233 | 182 |
lemma isCont_diff [simp]: |
36665 | 183 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
184 |
shows "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x - g x) a" |
44314 | 185 |
unfolding isCont_def by (rule tendsto_diff) |
21239 | 186 |
|
44233 | 187 |
lemma isCont_mult [simp]: |
36665 | 188 |
fixes f g :: "'a::topological_space \<Rightarrow> 'b::real_normed_algebra" |
21786 | 189 |
shows "\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x * g x) a" |
44314 | 190 |
unfolding isCont_def by (rule tendsto_mult) |
21239 | 191 |
|
44233 | 192 |
lemma isCont_inverse [simp]: |
36665 | 193 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_div_algebra" |
21786 | 194 |
shows "\<lbrakk>isCont f a; f a \<noteq> 0\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. inverse (f x)) a" |
44314 | 195 |
unfolding isCont_def by (rule tendsto_inverse) |
21239 | 196 |
|
44233 | 197 |
lemma isCont_divide [simp]: |
198 |
fixes f g :: "'a::topological_space \<Rightarrow> 'b::real_normed_field" |
|
199 |
shows "\<lbrakk>isCont f a; isCont g a; g a \<noteq> 0\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x / g x) a" |
|
200 |
unfolding isCont_def by (rule tendsto_divide) |
|
201 |
||
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
202 |
lemma metric_isCont_LIM_compose2: |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
203 |
assumes f [unfolded isCont_def]: "isCont f a" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
204 |
assumes g: "g -- f a --> l" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
205 |
assumes inj: "\<exists>d>0. \<forall>x. x \<noteq> a \<and> dist x a < d \<longrightarrow> f x \<noteq> f a" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
206 |
shows "(\<lambda>x. g (f x)) -- a --> l" |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
207 |
by (rule metric_LIM_compose2 [OF f g inj]) |
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
208 |
|
23040 | 209 |
lemma isCont_LIM_compose2: |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
210 |
fixes a :: "'a::real_normed_vector" |
23040 | 211 |
assumes f [unfolded isCont_def]: "isCont f a" |
212 |
assumes g: "g -- f a --> l" |
|
213 |
assumes inj: "\<exists>d>0. \<forall>x. x \<noteq> a \<and> norm (x - a) < d \<longrightarrow> f x \<noteq> f a" |
|
214 |
shows "(\<lambda>x. g (f x)) -- a --> l" |
|
215 |
by (rule LIM_compose2 [OF f g inj]) |
|
216 |
||
44233 | 217 |
lemma (in bounded_linear) isCont: |
218 |
"isCont g a \<Longrightarrow> isCont (\<lambda>x. f (g x)) a" |
|
44314 | 219 |
unfolding isCont_def by (rule tendsto) |
21282
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
220 |
|
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
221 |
lemma (in bounded_bilinear) isCont: |
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
222 |
"\<lbrakk>isCont f a; isCont g a\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. f x ** g x) a" |
44314 | 223 |
unfolding isCont_def by (rule tendsto) |
21282
dd647b4d7952
added bounded_linear and bounded_bilinear locales
huffman
parents:
21257
diff
changeset
|
224 |
|
44282
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44254
diff
changeset
|
225 |
lemmas isCont_scaleR [simp] = |
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44254
diff
changeset
|
226 |
bounded_bilinear.isCont [OF bounded_bilinear_scaleR] |
21239 | 227 |
|
44282
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44254
diff
changeset
|
228 |
lemmas isCont_of_real [simp] = |
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44254
diff
changeset
|
229 |
bounded_linear.isCont [OF bounded_linear_of_real] |
22627
2b093ba973bc
new LIM/isCont lemmas for abs, of_real, and power
huffman
parents:
22613
diff
changeset
|
230 |
|
44233 | 231 |
lemma isCont_power [simp]: |
36665 | 232 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::{power,real_normed_algebra}" |
22627
2b093ba973bc
new LIM/isCont lemmas for abs, of_real, and power
huffman
parents:
22613
diff
changeset
|
233 |
shows "isCont f a \<Longrightarrow> isCont (\<lambda>x. f x ^ n) a" |
44314 | 234 |
unfolding isCont_def by (rule tendsto_power) |
22627
2b093ba973bc
new LIM/isCont lemmas for abs, of_real, and power
huffman
parents:
22613
diff
changeset
|
235 |
|
44233 | 236 |
lemma isCont_sgn [simp]: |
36665 | 237 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::real_normed_vector" |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
238 |
shows "\<lbrakk>isCont f a; f a \<noteq> 0\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. sgn (f x)) a" |
44314 | 239 |
unfolding isCont_def by (rule tendsto_sgn) |
29885 | 240 |
|
44233 | 241 |
lemma isCont_setsum [simp]: |
242 |
fixes f :: "'a \<Rightarrow> 'b::topological_space \<Rightarrow> 'c::real_normed_vector" |
|
243 |
fixes A :: "'a set" |
|
244 |
shows "\<forall>i\<in>A. isCont (f i) a \<Longrightarrow> isCont (\<lambda>x. \<Sum>i\<in>A. f i x) a" |
|
245 |
unfolding isCont_def by (simp add: tendsto_setsum) |
|
15228 | 246 |
|
44233 | 247 |
lemmas isCont_intros = |
248 |
isCont_ident isCont_const isCont_norm isCont_rabs isCont_add isCont_minus |
|
249 |
isCont_diff isCont_mult isCont_inverse isCont_divide isCont_scaleR |
|
250 |
isCont_of_real isCont_power isCont_sgn isCont_setsum |
|
29803
c56a5571f60a
Added derivation lemmas for power series and theorems for the pi, arcus tangens and logarithm series
hoelzl
parents:
29667
diff
changeset
|
251 |
|
20755 | 252 |
subsection {* Uniform Continuity *} |
253 |
||
14477 | 254 |
lemma isUCont_isCont: "isUCont f ==> isCont f x" |
23012 | 255 |
by (simp add: isUCont_def isCont_def LIM_def, force) |
14477 | 256 |
|
23118 | 257 |
lemma isUCont_Cauchy: |
258 |
"\<lbrakk>isUCont f; Cauchy X\<rbrakk> \<Longrightarrow> Cauchy (\<lambda>n. f (X n))" |
|
259 |
unfolding isUCont_def |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
260 |
apply (rule metric_CauchyI) |
23118 | 261 |
apply (drule_tac x=e in spec, safe) |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
262 |
apply (drule_tac e=s in metric_CauchyD, safe) |
23118 | 263 |
apply (rule_tac x=M in exI, simp) |
264 |
done |
|
265 |
||
266 |
lemma (in bounded_linear) isUCont: "isUCont f" |
|
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
267 |
unfolding isUCont_def dist_norm |
23118 | 268 |
proof (intro allI impI) |
269 |
fix r::real assume r: "0 < r" |
|
270 |
obtain K where K: "0 < K" and norm_le: "\<And>x. norm (f x) \<le> norm x * K" |
|
271 |
using pos_bounded by fast |
|
272 |
show "\<exists>s>0. \<forall>x y. norm (x - y) < s \<longrightarrow> norm (f x - f y) < r" |
|
273 |
proof (rule exI, safe) |
|
274 |
from r K show "0 < r / K" by (rule divide_pos_pos) |
|
275 |
next |
|
276 |
fix x y :: 'a |
|
277 |
assume xy: "norm (x - y) < r / K" |
|
278 |
have "norm (f x - f y) = norm (f (x - y))" by (simp only: diff) |
|
279 |
also have "\<dots> \<le> norm (x - y) * K" by (rule norm_le) |
|
280 |
also from K xy have "\<dots> < r" by (simp only: pos_less_divide_eq) |
|
281 |
finally show "norm (f x - f y) < r" . |
|
282 |
qed |
|
283 |
qed |
|
284 |
||
285 |
lemma (in bounded_linear) Cauchy: "Cauchy X \<Longrightarrow> Cauchy (\<lambda>n. f (X n))" |
|
286 |
by (rule isUCont [THEN isUCont_Cauchy]) |
|
287 |
||
14477 | 288 |
|
21165
8fb49f668511
moved DERIV stuff from Lim.thy to new Deriv.thy; cleaned up LIMSEQ_SEQ proofs
huffman
parents:
21141
diff
changeset
|
289 |
subsection {* Relation of LIM and LIMSEQ *} |
19023
5652a536b7e8
* include generalised MVT in HyperReal (contributed by Benjamin Porter)
kleing
parents:
17318
diff
changeset
|
290 |
|
44532 | 291 |
lemma sequentially_imp_eventually_within: |
292 |
fixes a :: "'a::metric_space" |
|
293 |
assumes "\<forall>f. (\<forall>n. f n \<in> s \<and> f n \<noteq> a) \<and> f ----> a \<longrightarrow> |
|
294 |
eventually (\<lambda>n. P (f n)) sequentially" |
|
295 |
shows "eventually P (at a within s)" |
|
296 |
proof (rule ccontr) |
|
297 |
let ?I = "\<lambda>n. inverse (real (Suc n))" |
|
298 |
def F \<equiv> "\<lambda>n::nat. SOME x. x \<in> s \<and> x \<noteq> a \<and> dist x a < ?I n \<and> \<not> P x" |
|
299 |
assume "\<not> eventually P (at a within s)" |
|
300 |
hence P: "\<forall>d>0. \<exists>x. x \<in> s \<and> x \<noteq> a \<and> dist x a < d \<and> \<not> P x" |
|
51471 | 301 |
unfolding eventually_within eventually_at by fast |
44532 | 302 |
hence "\<And>n. \<exists>x. x \<in> s \<and> x \<noteq> a \<and> dist x a < ?I n \<and> \<not> P x" by simp |
303 |
hence F: "\<And>n. F n \<in> s \<and> F n \<noteq> a \<and> dist (F n) a < ?I n \<and> \<not> P (F n)" |
|
304 |
unfolding F_def by (rule someI_ex) |
|
305 |
hence F0: "\<forall>n. F n \<in> s" and F1: "\<forall>n. F n \<noteq> a" |
|
306 |
and F2: "\<forall>n. dist (F n) a < ?I n" and F3: "\<forall>n. \<not> P (F n)" |
|
307 |
by fast+ |
|
308 |
from LIMSEQ_inverse_real_of_nat have "F ----> a" |
|
309 |
by (rule metric_tendsto_imp_tendsto, |
|
310 |
simp add: dist_norm F2 less_imp_le) |
|
311 |
hence "eventually (\<lambda>n. P (F n)) sequentially" |
|
312 |
using assms F0 F1 by simp |
|
313 |
thus "False" by (simp add: F3) |
|
314 |
qed |
|
315 |
||
316 |
lemma sequentially_imp_eventually_at: |
|
317 |
fixes a :: "'a::metric_space" |
|
318 |
assumes "\<forall>f. (\<forall>n. f n \<noteq> a) \<and> f ----> a \<longrightarrow> |
|
319 |
eventually (\<lambda>n. P (f n)) sequentially" |
|
320 |
shows "eventually P (at a)" |
|
45031 | 321 |
using assms sequentially_imp_eventually_within [where s=UNIV] by simp |
44532 | 322 |
|
19023
5652a536b7e8
* include generalised MVT in HyperReal (contributed by Benjamin Porter)
kleing
parents:
17318
diff
changeset
|
323 |
lemma LIMSEQ_SEQ_conv1: |
44254
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
324 |
fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space" |
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
325 |
assumes f: "f -- a --> l" |
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
326 |
shows "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> a \<longrightarrow> (\<lambda>n. f (S n)) ----> l" |
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
327 |
using tendsto_compose_eventually [OF f, where F=sequentially] by simp |
31338
d41a8ba25b67
generalize constants from Lim.thy to class metric_space
huffman
parents:
31336
diff
changeset
|
328 |
|
44254
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
329 |
lemma LIMSEQ_SEQ_conv2: |
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
330 |
fixes f :: "'a::metric_space \<Rightarrow> 'b::topological_space" |
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
331 |
assumes "\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> a \<longrightarrow> (\<lambda>n. f (S n)) ----> l" |
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
332 |
shows "f -- a --> l" |
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
333 |
using assms unfolding tendsto_def [where l=l] |
44532 | 334 |
by (simp add: sequentially_imp_eventually_at) |
44254
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
335 |
|
19023
5652a536b7e8
* include generalised MVT in HyperReal (contributed by Benjamin Porter)
kleing
parents:
17318
diff
changeset
|
336 |
lemma LIMSEQ_SEQ_conv: |
44254
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
337 |
"(\<forall>S. (\<forall>n. S n \<noteq> a) \<and> S ----> (a::'a::metric_space) \<longrightarrow> (\<lambda>n. X (S n)) ----> L) = |
336dd390e4a4
Lim.thy: generalize and simplify proofs of LIM/LIMSEQ theorems
huffman
parents:
44253
diff
changeset
|
338 |
(X -- a --> (L::'b::topological_space))" |
44253
c073a0bd8458
add lemma tendsto_compose_eventually; use it to shorten some proofs
huffman
parents:
44251
diff
changeset
|
339 |
using LIMSEQ_SEQ_conv2 LIMSEQ_SEQ_conv1 .. |
19023
5652a536b7e8
* include generalised MVT in HyperReal (contributed by Benjamin Porter)
kleing
parents:
17318
diff
changeset
|
340 |
|
50331 | 341 |
lemma LIM_less_bound: |
342 |
fixes f :: "real \<Rightarrow> real" |
|
343 |
assumes ev: "b < x" "\<forall> x' \<in> { b <..< x}. 0 \<le> f x'" and "isCont f x" |
|
344 |
shows "0 \<le> f x" |
|
345 |
proof (rule tendsto_le_const) |
|
346 |
show "(f ---> f x) (at_left x)" |
|
347 |
using `isCont f x` by (simp add: filterlim_at_split isCont_def) |
|
348 |
show "eventually (\<lambda>x. 0 \<le> f x) (at_left x)" |
|
349 |
using ev by (auto simp: eventually_within_less dist_real_def intro!: exI[of _ "x - b"]) |
|
350 |
qed simp |
|
351 |
||
10751 | 352 |
end |