equal
deleted
inserted
replaced
4 |
4 |
5 theory Weierstrass_Theorems |
5 theory Weierstrass_Theorems |
6 imports Uniform_Limit Path_Connected Derivative |
6 imports Uniform_Limit Path_Connected Derivative |
7 begin |
7 begin |
8 |
8 |
9 subsection%important \<open>Bernstein polynomials\<close> |
9 subsection \<open>Bernstein polynomials\<close> |
10 |
10 |
11 definition%important Bernstein :: "[nat,nat,real] \<Rightarrow> real" where |
11 definition%important Bernstein :: "[nat,nat,real] \<Rightarrow> real" where |
12 "Bernstein n k x \<equiv> of_nat (n choose k) * x ^ k * (1 - x) ^ (n - k)" |
12 "Bernstein n k x \<equiv> of_nat (n choose k) * x ^ k * (1 - x) ^ (n - k)" |
13 |
13 |
14 lemma%unimportant Bernstein_nonneg: "\<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> 0 \<le> Bernstein n k x" |
14 lemma%unimportant Bernstein_nonneg: "\<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> 0 \<le> Bernstein n k x" |
63 by auto |
63 by auto |
64 finally show ?thesis |
64 finally show ?thesis |
65 by auto |
65 by auto |
66 qed |
66 qed |
67 |
67 |
68 subsection%important \<open>Explicit Bernstein version of the 1D Weierstrass approximation theorem\<close> |
68 subsection \<open>Explicit Bernstein version of the 1D Weierstrass approximation theorem\<close> |
69 |
69 |
70 lemma%important Bernstein_Weierstrass: |
70 lemma%important Bernstein_Weierstrass: |
71 fixes f :: "real \<Rightarrow> real" |
71 fixes f :: "real \<Rightarrow> real" |
72 assumes contf: "continuous_on {0..1} f" and e: "0 < e" |
72 assumes contf: "continuous_on {0..1} f" and e: "0 < e" |
73 shows "\<exists>N. \<forall>n x. N \<le> n \<and> x \<in> {0..1} |
73 shows "\<exists>N. \<forall>n x. N \<le> n \<and> x \<in> {0..1} |
165 then show ?thesis |
165 then show ?thesis |
166 by auto |
166 by auto |
167 qed |
167 qed |
168 |
168 |
169 |
169 |
170 subsection%important \<open>General Stone-Weierstrass theorem\<close> |
170 subsection \<open>General Stone-Weierstrass theorem\<close> |
171 |
171 |
172 text\<open>Source: |
172 text\<open>Source: |
173 Bruno Brosowski and Frank Deutsch. |
173 Bruno Brosowski and Frank Deutsch. |
174 An Elementary Proof of the Stone-Weierstrass Theorem. |
174 An Elementary Proof of the Stone-Weierstrass Theorem. |
175 Proceedings of the American Mathematical Society |
175 Proceedings of the American Mathematical Society |
780 using PR.Stone_Weierstrass_basic [OF \<open>continuous_on S f\<close> \<open>0 < e\<close>] |
780 using PR.Stone_Weierstrass_basic [OF \<open>continuous_on S f\<close> \<open>0 < e\<close>] |
781 by blast |
781 by blast |
782 qed |
782 qed |
783 |
783 |
784 |
784 |
785 subsection%important \<open>Polynomial functions\<close> |
785 subsection \<open>Polynomial functions\<close> |
786 |
786 |
787 inductive real_polynomial_function :: "('a::real_normed_vector \<Rightarrow> real) \<Rightarrow> bool" where |
787 inductive real_polynomial_function :: "('a::real_normed_vector \<Rightarrow> real) \<Rightarrow> bool" where |
788 linear: "bounded_linear f \<Longrightarrow> real_polynomial_function f" |
788 linear: "bounded_linear f \<Longrightarrow> real_polynomial_function f" |
789 | const: "real_polynomial_function (\<lambda>x. c)" |
789 | const: "real_polynomial_function (\<lambda>x. c)" |
790 | add: "\<lbrakk>real_polynomial_function f; real_polynomial_function g\<rbrakk> \<Longrightarrow> real_polynomial_function (\<lambda>x. f x + g x)" |
790 | add: "\<lbrakk>real_polynomial_function f; real_polynomial_function g\<rbrakk> \<Longrightarrow> real_polynomial_function (\<lambda>x. f x + g x)" |
981 done |
981 done |
982 then show "real_polynomial_function (h \<circ> f)" |
982 then show "real_polynomial_function (h \<circ> f)" |
983 by (simp add: euclidean_representation_sum_fun) |
983 by (simp add: euclidean_representation_sum_fun) |
984 qed |
984 qed |
985 |
985 |
986 subsection%important \<open>Stone-Weierstrass theorem for polynomial functions\<close> |
986 subsection \<open>Stone-Weierstrass theorem for polynomial functions\<close> |
987 |
987 |
988 text\<open>First, we need to show that they are continous, differentiable and separable.\<close> |
988 text\<open>First, we need to show that they are continous, differentiable and separable.\<close> |
989 |
989 |
990 lemma%unimportant continuous_real_polymonial_function: |
990 lemma%unimportant continuous_real_polymonial_function: |
991 assumes "real_polynomial_function f" |
991 assumes "real_polynomial_function f" |
1173 qed |
1173 qed |
1174 then show ?thesis using g(1) .. |
1174 then show ?thesis using g(1) .. |
1175 qed |
1175 qed |
1176 |
1176 |
1177 |
1177 |
1178 subsection%important\<open>Polynomial functions as paths\<close> |
1178 subsection\<open>Polynomial functions as paths\<close> |
1179 |
1179 |
1180 text\<open>One application is to pick a smooth approximation to a path, |
1180 text\<open>One application is to pick a smooth approximation to a path, |
1181 or just pick a smooth path anyway in an open connected set\<close> |
1181 or just pick a smooth path anyway in an open connected set\<close> |
1182 |
1182 |
1183 lemma%unimportant path_polynomial_function: |
1183 lemma%unimportant path_polynomial_function: |