1210 lemmas closed_real_atLeastAtMost = closed_atLeastAtMost[where 'a=real] |
1210 lemmas closed_real_atLeastAtMost = closed_atLeastAtMost[where 'a=real] |
1211 |
1211 |
1212 |
1212 |
1213 subsection \<open>Extra type constraints\<close> |
1213 subsection \<open>Extra type constraints\<close> |
1214 |
1214 |
1215 text \<open>Only allow @{term "open"} in class \<open>topological_space\<close>.\<close> |
1215 text \<open>Only allow \<^term>\<open>open\<close> in class \<open>topological_space\<close>.\<close> |
1216 setup \<open>Sign.add_const_constraint |
1216 setup \<open>Sign.add_const_constraint |
1217 (@{const_name "open"}, SOME @{typ "'a::topological_space set \<Rightarrow> bool"})\<close> |
1217 (\<^const_name>\<open>open\<close>, SOME \<^typ>\<open>'a::topological_space set \<Rightarrow> bool\<close>)\<close> |
1218 |
1218 |
1219 text \<open>Only allow @{term "uniformity"} in class \<open>uniform_space\<close>.\<close> |
1219 text \<open>Only allow \<^term>\<open>uniformity\<close> in class \<open>uniform_space\<close>.\<close> |
1220 setup \<open>Sign.add_const_constraint |
1220 setup \<open>Sign.add_const_constraint |
1221 (@{const_name "uniformity"}, SOME @{typ "('a::uniformity \<times> 'a) filter"})\<close> |
1221 (\<^const_name>\<open>uniformity\<close>, SOME \<^typ>\<open>('a::uniformity \<times> 'a) filter\<close>)\<close> |
1222 |
1222 |
1223 text \<open>Only allow @{term dist} in class \<open>metric_space\<close>.\<close> |
1223 text \<open>Only allow \<^term>\<open>dist\<close> in class \<open>metric_space\<close>.\<close> |
1224 setup \<open>Sign.add_const_constraint |
1224 setup \<open>Sign.add_const_constraint |
1225 (@{const_name dist}, SOME @{typ "'a::metric_space \<Rightarrow> 'a \<Rightarrow> real"})\<close> |
1225 (\<^const_name>\<open>dist\<close>, SOME \<^typ>\<open>'a::metric_space \<Rightarrow> 'a \<Rightarrow> real\<close>)\<close> |
1226 |
1226 |
1227 text \<open>Only allow @{term norm} in class \<open>real_normed_vector\<close>.\<close> |
1227 text \<open>Only allow \<^term>\<open>norm\<close> in class \<open>real_normed_vector\<close>.\<close> |
1228 setup \<open>Sign.add_const_constraint |
1228 setup \<open>Sign.add_const_constraint |
1229 (@{const_name norm}, SOME @{typ "'a::real_normed_vector \<Rightarrow> real"})\<close> |
1229 (\<^const_name>\<open>norm\<close>, SOME \<^typ>\<open>'a::real_normed_vector \<Rightarrow> real\<close>)\<close> |
1230 |
1230 |
1231 |
1231 |
1232 subsection \<open>Sign function\<close> |
1232 subsection \<open>Sign function\<close> |
1233 |
1233 |
1234 lemma norm_sgn: "norm (sgn x) = (if x = 0 then 0 else 1)" |
1234 lemma norm_sgn: "norm (sgn x) = (if x = 0 then 0 else 1)" |
2085 Proof that Cauchy sequences converge based on the one from |
2085 Proof that Cauchy sequences converge based on the one from |
2086 \<^url>\<open>http://pirate.shu.edu/~wachsmut/ira/numseq/proofs/cauconv.html\<close> |
2086 \<^url>\<open>http://pirate.shu.edu/~wachsmut/ira/numseq/proofs/cauconv.html\<close> |
2087 \<close> |
2087 \<close> |
2088 |
2088 |
2089 text \<open> |
2089 text \<open> |
2090 If sequence @{term "X"} is Cauchy, then its limit is the lub of |
2090 If sequence \<^term>\<open>X\<close> is Cauchy, then its limit is the lub of |
2091 @{term "{r::real. \<exists>N. \<forall>n\<ge>N. r < X n}"} |
2091 \<^term>\<open>{r::real. \<exists>N. \<forall>n\<ge>N. r < X n}\<close> |
2092 \<close> |
2092 \<close> |
2093 lemma increasing_LIMSEQ: |
2093 lemma increasing_LIMSEQ: |
2094 fixes f :: "nat \<Rightarrow> real" |
2094 fixes f :: "nat \<Rightarrow> real" |
2095 assumes inc: "\<And>n. f n \<le> f (Suc n)" |
2095 assumes inc: "\<And>n. f n \<le> f (Suc n)" |
2096 and bdd: "\<And>n. f n \<le> l" |
2096 and bdd: "\<And>n. f n \<le> l" |