equal
deleted
inserted
replaced
859 by (subst of_real_numeral [symmetric], subst norm_of_real, simp) |
859 by (subst of_real_numeral [symmetric], subst norm_of_real, simp) |
860 |
860 |
861 lemma norm_neg_numeral [simp]: |
861 lemma norm_neg_numeral [simp]: |
862 "norm (- numeral w::'a::real_normed_algebra_1) = numeral w" |
862 "norm (- numeral w::'a::real_normed_algebra_1) = numeral w" |
863 by (subst of_real_neg_numeral [symmetric], subst norm_of_real, simp) |
863 by (subst of_real_neg_numeral [symmetric], subst norm_of_real, simp) |
|
864 |
|
865 lemma norm_of_real_add1 [simp]: |
|
866 "norm (of_real x + 1 :: 'a :: real_normed_div_algebra) = abs (x + 1)" |
|
867 by (metis norm_of_real of_real_1 of_real_add) |
|
868 |
|
869 lemma norm_of_real_addn [simp]: |
|
870 "norm (of_real x + numeral b :: 'a :: real_normed_div_algebra) = abs (x + numeral b)" |
|
871 by (metis norm_of_real of_real_add of_real_numeral) |
864 |
872 |
865 lemma norm_of_int [simp]: |
873 lemma norm_of_int [simp]: |
866 "norm (of_int z::'a::real_normed_algebra_1) = \<bar>of_int z\<bar>" |
874 "norm (of_int z::'a::real_normed_algebra_1) = \<bar>of_int z\<bar>" |
867 by (subst of_real_of_int_eq [symmetric], rule norm_of_real) |
875 by (subst of_real_of_int_eq [symmetric], rule norm_of_real) |
868 |
876 |
1296 by (cases "0::real" x rule: linorder_cases) simp_all |
1304 by (cases "0::real" x rule: linorder_cases) simp_all |
1297 |
1305 |
1298 lemma norm_conv_dist: "norm x = dist x 0" |
1306 lemma norm_conv_dist: "norm x = dist x 0" |
1299 unfolding dist_norm by simp |
1307 unfolding dist_norm by simp |
1300 |
1308 |
|
1309 declare norm_conv_dist [symmetric, simp] |
|
1310 |
1301 lemma dist_diff [simp]: "dist a (a - b) = norm b" "dist (a - b) a = norm b" |
1311 lemma dist_diff [simp]: "dist a (a - b) = norm b" "dist (a - b) a = norm b" |
1302 by (simp_all add: dist_norm) |
1312 by (simp_all add: dist_norm) |
1303 |
1313 |
1304 lemma dist_of_int: "dist (of_int m) (of_int n :: 'a :: real_normed_algebra_1) = of_int \<bar>m - n\<bar>" |
1314 lemma dist_of_int: "dist (of_int m) (of_int n :: 'a :: real_normed_algebra_1) = of_int \<bar>m - n\<bar>" |
1305 proof - |
1315 proof - |
1866 fix e :: real assume e: "e > 0" |
1876 fix e :: real assume e: "e > 0" |
1867 fix n :: nat assume n: "n \<ge> nat \<lceil>inverse e + 1\<rceil>" |
1877 fix n :: nat assume n: "n \<ge> nat \<lceil>inverse e + 1\<rceil>" |
1868 have "inverse e < of_nat (nat \<lceil>inverse e + 1\<rceil>)" by linarith |
1878 have "inverse e < of_nat (nat \<lceil>inverse e + 1\<rceil>)" by linarith |
1869 also note n |
1879 also note n |
1870 finally show "dist (1 / of_nat n :: 'a) 0 < e" using e |
1880 finally show "dist (1 / of_nat n :: 'a) 0 < e" using e |
1871 by (simp add: divide_simps mult.commute norm_conv_dist[symmetric] norm_divide) |
1881 by (simp add: divide_simps mult.commute norm_divide) |
1872 qed |
1882 qed |
1873 |
1883 |
1874 lemma (in metric_space) complete_def: |
1884 lemma (in metric_space) complete_def: |
1875 shows "complete S = (\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l))" |
1885 shows "complete S = (\<forall>f. (\<forall>n. f n \<in> S) \<and> Cauchy f \<longrightarrow> (\<exists>l\<in>S. f \<longlonglongrightarrow> l))" |
1876 unfolding complete_uniform |
1886 unfolding complete_uniform |