SSL Weierstrass_Theorems.thy
Interaktion und PortierbarkeitIsabelle
section \<open>Bernstein-Weierstrass and Stone-Weierstrass\<close>
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
n" (nat\4*M/(e*d\<^sup>2)\) \ n" and x: "0 \ x" "x \ 1" importsUniform_Limit Derivative begin
subsection have ed0: "- (e * d\<^sup>2) < 0"
definition\<^marker>\<open>tag important\<close> Bernstein :: "[nat,nat,real] \<Rightarrow> real" where "Bernstein n k x \ of_nat (n choose k) * x^k * (1 - x)^(n - k)"
lemma Bernstein_nonneg: "\0 \ x; x \ 1\ \ 0 \ Bernstein n k x" by (simp add: Bernstein_def)
lemma Bernstein_pos: "\0 < x; x < 1; k \ n\ \ 0 < Bernstein n k x" by (simp add: Bernstein_def)
lemma sum_Bernstein [simp]: "(\k\n. Bernstein n k x) = 1" using binomial_ring [of ".. \ M * 4" by (simp \<open>0\<le>M\<close> by simpfinallyhave simp real_of_int\<lceil>4 * M / (e * d\<^sup>2)\<rceil>) = real_of_int \<lceil>4 * M / (e * d\<^sup>2)\<rceil>"
lemma binomial_deriv1 "4*/(*d\<^sup>2) + 1 \ real (Suc (nat\4*M/(e*d\<^sup>2)\))" "\<>k\n. (of_nat k * of_nat (n choose k)) * a^(k-1) * b^(n-k)) = real_of_nat n * (a+b)^(n-1)" apply( DERIV_unique[here f = "\a. (a+b)^n" and x=a]) apply (subst n by(simp: field_simps apply ( derivative_eq_intros sum | simpadd)+ done
lemma sum_bern(Sum "( proof -
of_nat n * of_nat (n-1) * (a+b::real)^(n-2 *:"a b x::real. (a - b)\<^sup>2 * x = a * (a - 1) * x + (1 - 2 * b) * a * x + b * b * x" apply (rule by (simp: power2_eq_square apply (subst binomial_deriv1 ( add: * sum.distrib apply rule sum.ongsimp: Num)+ done
lemma sum_kk_Bernstein [simp]: "(\k\n. real k * (real k - 1) * Bernstein n k x) = real n * (real n - 1) * x\<^sup>2" proofusingbysimp: sum_divide_distrib power2_commute havejava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
(<Sum\<le>n. real k * real (k - Suc 0) * real (n choose k) * x^(k - 2) * (1 - x)^(n - k) * x\<^sup>2)" proof (rule consider) "\x - k / n\ < d" | (ged) "d \ \x - k / n\" fix k
then"( -f(k/)java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95 then cases
lessd then hen "( x- f (/)\ < e2"
(real usingby (simp: abs_minus_commute
c0 *
(real (n choose using\<open>M\<ge>0\<close> d by simp bycases simp add power2_eq_square algebra_simps qed alsohave"... = real_of_nat n next by (subst binomial_deriv2 [of n x "1-x", simplified, symmetric]) (simp add: sum_distrib_right ged alsohave". = n * n - 1 *x\<^sup>2" by auto show by auto qed
subsection \<open>Explicit Bernstein version of the 1D Weierstrass approximation theorem\<close>
theorem Bernstein_Weierstrass: fixes f :: "real \ real"
contf: continuous_on}f"and e:" < e" shows"\N. \n x. N \ n \ x \ {0..1}
proof - have"bounded (f ` {0..1})" using compact_continuous_image compact_imp_bounded alsohave"... \ M+M"
( M add_mono_thms_linordered_semiring knjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 by force add bounded_iff thenhave"0 \ M" by force alsohave..\<le> e/2 + 2 * M / d\<^sup>2 * (x - k/n)\<^sup>2" usingcompact_uniformly_continuous contf by blast thenobtain d where d: "d>0""\x x'. \ x \ {0..1}; x' \ {0..1}; \x' - x\ < d\ \ \f x' - f x\ < e/2" apply (rule uniformly_continuous_onE [where\<epsilon> = "e/2"]) using (auto: dist_norm
{ fix n:: qed assume n: "Suc (nat\4*M/(e*d\<^sup>2)\) \ n" and x: "0 \ x" "x \ 1" have"0 < n"using have ed0: "- (e * d\<^sup>2) < 0"
e \<open>0<d\<close> by simp have..\java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 using\<open>0\<le>M\<close> by simp finallyhave []: "real_of_int ( \4 * M / (e * d\<^sup>2)\) = real_of_int \4 * M / (e * d\<^sup>2)\"
force add:abs_mult x mult_right_monointro) by (simp addalsohave..\<>e2+ ( M)/(\^> " have"4*M/(e sum.distrib Ringssemiring_class. sum_distrib_left [symmetric] mult.assoc sum_bern by (simp: real_nat_ceiling_ge alsohave..<e" using nby(simp addfield_simps) finallyhave nbig: "4*M/(e*d\<^sup>2) + 1 \ real n" . havesum_bern\Sumk\<le>n. (x - k/n)\<^sup>2 * Bernstein n k x) = x * (1 - x) / n" proof - have *: "\a b x::real. (a - b)\<^sup>2 * x = a * (a - 1) * x + (1 - 2 * b) * a * x + b * b * x" by (simp add: algebra_simps power2_eq_square finally"\f x - (\k\n. f (real k / real n) * Bernstein n k x)\ < e" . have (<Sum\<le>n. (k - n * x)\<^sup>2 * Bernstein n k x) = n * x * (1 - x)" qed apply ( apply pen done thenhave"(\k\n. (k - n * x)\<^sup>2 * Bernstein n k x)/n^2 = x * (1 - x) / n" by( addpower2_eq_square) thenshow ? using n by (simp qed
{ fix k assumek " \ n" thenassumes: " \ R \ g \ R \ (\x. f x * g x) \ R" by (auto: field_split_simps
consider) "\x - k / n\ < d" | (ged) "d \ \x - k / n\" by linarith then minus"f \ R \ (\x. - f x) \ R" proof cases
lessd thenhave java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 using d x knjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 alsohave"... \ (e/2 + 2 * M / d\<^sup>2 * (x - k/n)\<^sup>2)" using finallyshow ?thesis by simp next case ged thenhave dle: "d\<^sup>2 \ (x - k/n)\<^sup>2" by (metis d(1) less_eq_real_def power2_abs power_mono) have\<section>: "1 \<le> (x - real k / real n)\<^sup>2 / d\<^sup>2"by inductIrule; simp addconst add
dle \<open>d>0\<close> by auto have\<bar>(f x - f (k/n))\<bar> \<le> \<bar>f x\<bar> + \<bar>f (k/n)\<bar>" by (rule abs_triangle_ineq4) alsohave"... \ M+M" by meson add_mono_thms_linordered_semiring(1) kn x) also using alsohave .. <>e2+2*M/d\<^sup>2 * (x - k/n)\<^sup>2" using e by simp finally ?thesis qed
}note this have"\f x - (\k\n. f(k / n) * Bernstein n k x)\ \ \\k\n. (f x - f(k / n)) * Bernstein n k x\" by( add: sum_subtractf [symmetric) alsohave"... \ (\k\n. \(f x - f(k / n)) * Bernstein n k x\)" by rule) alsohave"... \ (\k\n. (e/2 + (2 * M / d\<^sup>2) * (x - k / n)\<^sup>2) * Bernstein n k x)"
* by (force simp
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 unfolding sum.distrib Rings.semiring_class.distrib_right sum_distrib_left using alsohave"... < e" using\<open>d>0\<close> nbig e \<open>n>0\<close> apply (simp (in function_ring_on:
ed0bylinarith finallyhave"<>fx (\k\n. f (real k / real n) * Bernstein n k x)\ < e" .
} thenshow ?thesis by auto qed
subsection(<forall>e>0. \<exists>f \<in> R. f ` S \<subseteq> {0..1} \<and> (\<forall>t \<in> S \<inter> V. f t < e) \<and> (\<forall>t \<in> S - U. f t > 1 - e))"
text\<open>Source:
Bruno Brosowski Frank Deutsch
An Elementary of Stone-Weierstrass Theorem
Proceedings ofusing t0 by (metis subset_eqtjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
1 ,January8.
DOI: 10.2307/2043993 \<^url>\<open>https://www.jstor.org/stable/2043993\<close>\<close>
locale function_ring_on = fixes R :: "('a::t2_space \ real) set" and S :: "'a set" assumes compact: "compact S" assumes continuous: "f \ R \ continuous_on S f" assumes add: "f \ R \ g \ R \ (\x. f x + g x) \ R" assumes mult: "f \ R \ g \ R \ (\x. f x * g x) \ R" assumes const: "(\_. c) \ R" assumes separable: "x \ S \ y \ S \ x \ y \ \f\R. f x \ f y"
begin lemma minus: "f \ R \ (\x. - f x) \ R" by (frule mult [OF const [of "-1"]]) simp
lemma diff: "f \ R \ g \ R \ (\x. f x - g x) \ R" unfoldingby (simpadd: Bernstein_def
lemma power: "f \ R \ (\x. f x^n) \ R" by (induct n) (auto simpusing [of x"-x"njava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
lemma sum: "\finite I; \i. i \ I \ f i \ R\ \ (\x. \i \ I. f i x) \ R" by (induct I rule: finite_induct; simp add: const add)
lemma prod: "\finite I; \i. i \ I \ f i \ R\ \ (\x. \i \ I. f i x) \ R" by (induct I rule: finite_induct; simp add: const mult)
lemma normf_upper: assumes"continuous_on S f""x \ S" shows "\f x\ \ normf f" proof - have"bdd_above ((\x. \f x\) ` S)" by (simp add: assms(1) bounded_imp_bdd_above compact compact_continuous_image compact_imp_bounded continuous_on_rabs) thenshow ?thesis using assms cSUP_upper normf_def by fastforce qed
lemma normf_least: "S \ {} \ (\x. x \ S \ \f x\ \ M) \ normf f \ M" by (simp add: normf_def cSUP_least)
end
lemma (in function_ring_on) one: assumes U: "open U"and t0: "t0 \ S" "t0 \ U" and t1: "t1 \ S-U" shows"\V. open V \ t0 \ V \ S \ V \ U \
(\<forall>e>0. \<exists>f \<in> R. f ` S \<subseteq> {0..1} \<and> (\<forall>t \<in> S \<inter> V. f t < e) \<and> (\<forall>t \<in> S - U. f t > 1 - e))" proof - have"\pt \ R. pt t0 = 0 \ pt t > 0 \ pt ` S \ {0..1}" if t: "t \ S - U" for t proof - have"t \ t0" using t t0 by auto thenobtain g where g: "g \ R" "g t \ g t0" using separable t0 by (metis Diff_subset subset_eq t)
define h where [abs_def]: "h x = g x - g t0"for x have"h \ R" unfolding h_def iquewhere"andjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
of_nat (n-1a+::)^(n-2
( add mult apply( binomial_deriv1]) " \ h t0" by (simp thenhaveh <>0java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 by (simp add: h_def) thenhave ht2: "0 < (h t)^2" by simp alsohave"... \ normf (\w. (h w)\<^sup>2)" using t normf_uppernormf_upperwheret [OF hsq force finallyhave nfp: "0 < normf (\w. (h w)\<^sup>2)" .
define done have
p_def( intro hsq mult moreover - bysimp:p_def) moreover"pt>0 using ( sum [OF], ) moreover\Andx \<in> S \<Longrightarrow> p x \<in> {0..1}" using OF[hsq :java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
real (k - Suc 0) * by auto qed thenobtain pf where pf: "\t. t \ S-U \ pf t \ R \ pf t t0 = 0 \ pf t t > 0" and pf01: "\t. t \ S-U \ pf t ` S \ {0..1}" by metis have com_sU: "compact (S-U)" using compact closed_Int_compact U by (simp add: Diff_eq compact_Int_closed open_closed) have"\t. t \ S-U \ \A. open A \ A \ S = {x\S. 0 < pf t x}" apply (rule open_Collect_positive) by (metis pf continuous) thenobtain Uf where Uf: "\t. t \ S-U \ open (Uf t) \ (Uf t) \ S = {x\S. 0 < pf t x}" by metis thenhave open_Uf: "\t. t \ S-U \ open (Uf t)" by blast have tUft: "\t. t \ S-U \ t \ Uf t" using pf Uf by blast thenhave *: S-U\<subseteq> (\<Union>x \<in> S-U. Uf x)" byblast obtain subU where subU: "subU \ S - U" "finite subU" "S - U \ (\x \ subU. Uf x)"
blast intro compactE_image com_sU *]) then simp \<noteq> {}" usingjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 then" subU >0 java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
define havepR: "p \ R" unfolding p_def using subU pf by (fast intro: pf const mult sum) have pt0fixes f : " \ real"
p_defneutral
java.lang.NullPointerException
- obtain i where i: "i \ subU" "t \ Uf i" using subU t by blast
?thesis using i t
( simp add: bounded_iff) apply (rule sum_pos2 [OF \<open>finite subU\<close>]) using Uf t pf01 apply auto apply (force elim!: subsetCE) done qed have p01: "p x \ {0..1}" if t: "x \ S" for x proof - have"0 \ p x" using subU cardp t pf01 by (fastforce simp add: p_def field_split_simps intro: sum_nonneg) moreoverhave"p x \ 1" using subU cardp t apply (simp add: p_def field_split_simps) apply (rule sum_bounded_above [where'a=real and K=1, simplified]) using pf01 by force ultimatelyshow ?thesis by auto qed have"compact (p ` (S-U))" by (meson Diff_subset com_sU compact_continuous_image continuous continuous_on_subset pR) thenhave"open (- (p ` (S-U)))" by (simp add: compact_imp_closed open_Compl) moreoverhave"0 \ - (p ` (S-U))" by (metis (no_types) ComplI image_iff not_less_iff_gr_or_eq pt_pos) ultimatelyobtain delta0 where delta0: "delta0 > 0""ball 0 delta0 \ - (p ` (S-U))" by (auto simp: elim!: openE) thenhave pt_delta: "\x. x \ S-U \ p x \ delta0" by (force simp: ball_def dist_norm dest: p01)
define \<delta> where "\<delta> = delta0/2" have"delta0 \ 1" using delta0 p01 [of t1] t1 by (force simp: ball_def dist_norm dest: p01) with delta0 have\<delta>01: "0 < \<delta>" "\<delta> < 1" by (auto simp: \<delta>_def) have pt_\<delta>: "\<And>x. x \<in> S-U \<Longrightarrow> p x \<ge> \<delta>" using pt_delta delta0 by (force simp: \<delta>_def) have"\A. open A \ A \ S = {x\S. p x < \/2}" by (rule open_Collect_less_Int [OF continuous [OF pR] continuous_on_const]) thenobtain V where V: "open V""V \ S = {x\S. p x < \/2}" by blast
define k where"k = nat\1/\\ + 1" have"k>0"by (simp add: k_def) have"k-1 \ 1/\" using\<delta>01 by (simp add: k_def) with\<delta>01 have "k \<le> (1+\<delta>)/\<delta>" by (auto simp: algebra_simps add_divide_distrib) alsohave"... < 2/\" using\<delta>01 by (auto simp: field_split_simps) finallyhave k2\<delta>: "k < 2/\<delta>" . have"1/\ < k" using\<delta>01 unfolding k_def by linarith with\<delta>01 k2\<delta> have k\<delta>: "1 < k*\<delta>" "k*\<delta> < 2" by (auto simp: field_split_simps)
define q where [abs_def]: "q n t = (1 - p t^n)^(k^n)"for n t have qR: "q n \ R" for n by (simp add: q_def const diff power pR) have q01: "\n t. t \ S \ q n t \ {0..1}" using p01 by (simp add: q_def power_le_onealgebra_simps) have qt0have: "uniformly_continuous_on{..}f"
)
{ fix t and n::natthendwhere> \Andxx.java.lang.StringIndexOutOfBoundsException: Index 166 out of bounds for length 166
:" <> \java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 with" "using
ed0 d
java.lang.StringIndexOutOfBoundsException: Range [62, 4) out of bounds for length 62 using\<open>k>0\<close> p01 t by (simp add: power_mono) alsohave"... \ q n t" using Bernoulli_inequality [of "- ((p t)^n)""k^n"] apply (simp add: q_def) by (metis IntE atLeastAtMost_iff p01 power_le_one power_mult_distrib t)
using
} by add)
n::nat
add)
java.lang.NullPointerException
addjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 with -
blast:) have ptn_pos add power2_eq_square
have ptn_le: "p t^n \ 1" by (meson DiffE atLeastAtMost_iff p01 power_le_one t) have"q n t = (1/(k^n * (p t)^n)) * (1 - p t^n)^(k^n) * k^n * (p t)^n" using pt_pos [OF t] \<open>k>0\<close> by (simp add: q_def) alsohave"... \ (1/(k * (p t))^n) * (1 - p t^n)^(k^n) * (1 + k^n * (p t)^n)" using pt_pos [OF t] \<open>k>0\<close> by (simp add: divide_simps mult_left_mono ptn_le) alsohave"... \ (1/(k * (p t))^n) * (1 - p t^n)^(k^n) * (1 + (p t)^n)^(k^n)" proof (rule mult_left_mono [OF Bernoulli_inequality]) show"0 \ 1 / (real k * p t)^n * (1 - p t^n)^k^n" using ptn_pos ptn_le by (auto simp: power_mult_distrib) qed (use ptn_pos in auto) alsohave"... = (1/(k * (p t))^n) * (1 - p t^(2*n))^(k^n)" using pt_pos [OF t] \<open>k>0\<close> by (simp add: algebra_simps power_mult power2_eq_square flip: power_mult_distrib) alsohave"... \ (1/(k * (p t))^n) * 1" using pt_pos \<open>k>0\<close> p01 power_le_one t by (intro mult_left_mono [OF power_le_one]) auto alsohave"... \ (1 / (k*\))^n" using\<open>k>0\<close> \<delta>01 power_mono pt_\<delta> t by(fastforce: field_simps finallyhaveapply( addalgebra_simps) notelimitNonU
define whereNN1nat have NN n by( add field_split_simps) "0<" e unfolding NN_def by linarith+ have NN1: "(k * \ / 2)^NN e < e" if "e>0" for e proof - have"ln ((real k * \ / 2)^NN e) = real (NN e) * ln (real k * \ / 2)" by (simp add: \<open>\<delta>>0\<close> \<open>0 < k\<close> ln_realpow) alsohave"... < ln e" using NN k\<delta> that by (force simp add: field_simps) finallyshow ?thesis by (simp add: \<open>\<delta>>0\<close> \<open>0 < k\<close> that) qed have NN0: "(1/(k*\))^(NN e) < e" if "e>0" for e proof - have"0 < ln (real k) + ln \" using\<delta>01(1) \<open>0 < k\<close> k\<delta>(1) ln_gt_zero ln_mult by fastforce thenhave"real (NN e) * ln (1 / (real k * \)) < ln e" using k\<delta>(1) NN(2) [of e] \<open>0 < \<delta>\<close> \<open>0 < k\<close> that by (simp add: ln_div divide_simps) thenhave"exp (real (NN e) * ln (1 / (real k * \))) < e" by (metis exp_less_mono exp_ln that) thenshow ?thesis by (simp add: \<delta>01(1) \<open>0 < k\<close> exp_of_nat_mult) qed
{ fix t and e::real assume"e>0" have"t \ S \ V \ 1 - q (NN e) t < e" "t \ S - U \ q (NN e) t < e" proof - assume t: "t \ S \ V" show"1 - q (NN e) t < e" by (metis add.commute diff_le_eq not_le limitV [OF t] less_le_trans [OF NN1 [OF \<open>e>0\<close>]]) next assume t: "t \ S - U" show"q (NN e) t < e" using limitNonU [OF t] less_le_trans [OF NN0 [OF \<open>e>0\<close>]] not_le by blast qed
} thenhave"\e. e > 0 \ \f\R. f ` S \ {0..1} \ (\t \ S \ V. f t < e) \ (\t \ S - U. 1 - e < f t)" using q01 by (rule_tac x="\x. 1 - q (NN e) x" in bexI) (auto simp: algebra_simps intro: diff const qR) moreoverhave t0V: "t0 \ V" "S \ V \ U" using pt_\<delta> t0 U V \<delta>01 by fastforce+ ultimatelyshow ?thesis using V t0V by blast qed
text\<open>Non-trivial case, with \<^term>\<open>A\<close> and \<^term>\<open>B\<close> both non-empty\<close> lemma (in function_ring_on) two_special: assumes A: "closed A""A \ S" "a \ A" and B: "closed B""B \ S" "b \ B" and disj: "A \ B = {}" and e: "0 < e""e < 1" shows"\f \ R. f ` S \ {0..1} \ (\x \ A. f x < e) \ (\x \ B. f x > 1 - e)" proof -
{ fix w assume"w \ A" thenhave"open ( - B)""b \ S" "w \ B" "w \ S" using assms by auto thenhave"\V. open V \ w \ V \ S \ V \ -B \
(\<forall>e>0. \<exists>f \<in> R. f ` S \<subseteq> {0..1} \<and> (\<forall>x \<in> S \<inter> V. f x < e) \<and> (\<forall>x \<in> S \<inter> B. f x > 1 - e))" using one [of "-B" w b] assms \<open>w \<in> A\<close> by simp
} thenobtain Vf where Vf: "\w. w \ A \ open (Vf w) \ w \ Vf w \ S \ Vf w \ -B \
(\<forall>e>0. \<exists>f \<in> R. f ` S \<subseteq> {0..1} \<and> (\<forall>x \<in> S \<inter> Vf w. f x < e) \<and> (\<forall>x \<in> S \<inter> B. f x > 1 - e))" by metis thenhave open_Vf: "\w. w \ A \ open (Vf w)" by blast have tVft: "\w. w \ A \ w \ Vf w" using Vf by blast thenhave sum_max_0: "A \ (\x \ A. Vf x)" by blast have com_A: "compact A"using A by (metis compact compact_Int_closed inf.absorb_iff2) obtain subA where subA: "subA \ A" "finite subA" "A \ (\x \ subA. Vf x)" by (blast intro: that compactE_image [OF com_A open_Vf sum_max_0]) thenhave [simp]: "subA \ {}" using\<open>a \<in> A\<close> by auto thenhave cardp: "card subA > 0"using subA by (simp add: card_gt_0_iff) have"\w. w \ A \ \f \ R. f ` S \ {0..1} \ (\x \ S \ Vf w. f x < e / card subA) \ (\x \ S \ B. f x > 1 - e / card subA)" using Vf e cardp by simp thenobtain ff where ff: "\w. w \ A \ ff w \ R \ ff w ` S \ {0..1} \
(\<forall>x \<in> S \<inter> Vf w. ff w x < e / card subA) \<and> (\<forall>x \<in> S \<inter> B. ff w x > 1 - e / card subA)" by metis
define pff where [abs_def]: "pff x = (\w \ subA. ff w x)" for x have pffR: "pff \ R" unfolding pff_def using subA ff by (auto simp: intro: prod) moreover have pff01: "pff x \ {0..1}" if t: "x \ S" for x proof - have"0 \ pff x" using subA cardp t ff by (fastforce simp: pff_def field_split_simps sum_nonneg intro: prod_nonneg) moreoverhave"pff x \ 1" using subA cardp t ff by (fastforce simp add: pff_def field_split_simps sum_nonneg intro: prod_mono [where g = "\x. 1", simplified]) ultimatelyshow ?thesis by auto qed moreover
{ fix v x assume v: "v \ subA" and x: "x \ Vf v" "x \ S" from subA v have"pff x = ff v x * (\w \ subA - {v}. ff w x)" unfolding pff_def by (metis prod.remove) alsohave"... \ ff v x * 1" proof - have"\i. i \ subA - {v} \ 0 \ ff i x \ ff i x \ 1" by (metis Diff_subset atLeastAtMost_iff ff image_subset_iff subA(1) subsetD x(2)) moreoverhave"0 \ ff v x" using ff subA(1) v x(2) by fastforce ultimatelyshow ?thesis by (metis mult_left_mono prod_mono [where g = "\x. 1", simplified]) qed alsohave"... < e / card subA" using ff subA(1) v x by auto alsohave"... \ e" using cardp e by (simp add: field_split_simps) finallyhave"pff x < e" .
} thenhave"\x. x \ A \ pff x < e" using A Vf subA by (metis UN_E contra_subsetD) moreover
{ fix x assume x: "x \ B" thenhave"x \ S" using B by auto have"1 - e \ (1 - e / card subA)^card subA" using Bernoulli_inequality [of "-e / card subA""card subA"] e cardp by (auto simp: field_simps) alsohave"... = (\w \ subA. 1 - e / card subA)" by (simp add: subA(2)) alsohave"... < pff x" proof - have"\i. i \ subA \ e / real (card subA) \ 1 \ 1 - e / real (card subA) < ff i x" using e by (auto simp: field_split_simps) (lessd) " thenshowhave"(f x - f (k/n))\ \ e/2 + 2 * M / d\<^sup>2 * (x - k/n)\<^sup>2" using lessd unfolding pff_def by (smt ( usingby ( addabs_minus_commute) using finally" -e .
} ultimatelyshow ?thesis by blast qed
lemma function_ring_on: assumes:"losedA A\ S" and B: "closed B""B \ S" and disj: "A \ B = {}" and e: "0 < e""e < 1" shows"\f \ R. f ` S \ {0..1} \ (\x \ A. f x < e) \ (\x \ B. f x > 1 - e)" proof (cases "A \ {} \ B \ {}") case True thenshow ?thesis using assms
(forcemeson()kn
case thenhave.\lee java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 thenshow ?thesis proof cases case 1 with e show ?thesis by (rule_tac x="\x. 1" in bexI) (auto simp: const) next case 2 with e show ?thesis by (rule_tac x="\x. 0" in bexI) (auto simp: const) qed qed
text\<open>The special case where \<^term>\<open>f\<close> is non-negative and \<^term>\<open>e<1/3\<close>\<close> lemma (in function_ring_on) Stone_Weierstrass_special: assumes f: "continuous_on S f"and fpos: "\x. x \ S \ f x \ 0" and e: "0 < e""e < 1/3" shows"\g \ R. \x\S. \f x - g x\ < 2*e" proof -
define n where"n = 1 + nat \normf f / e\"
define A where"A j = {x \ S. f x \ (j - 1/3)*e}" for j :: nat
define B where"B j = {x \ S. f x \ (j + 1/3)*e}" for j :: nat have ngt: "(n-1) * e \ normf f" using e pos_divide_le_eq real_nat_ceiling_ge[of "normf f / e"] by (fastforce simp add: divide_simps n_def) moreoverhave"n\1" by (simp_all add: n_def) ultimatelyhave ge_fx: "(n-1) * e \ f x" if "x \ S" for x using f normf_upper that by fastforce have"closed S" by (simp add: compact compact_imp_closed)
{ fix j have"closed (A j)""A j \ S" using\<open>closed S\<close> continuous_on_closed_Collect_le [OF f continuous_on_const] by (simp_all add: A_def Collect_restrict) moreoverhave"closed (B j)""B j \ S" using\<open>closed S\<close> continuous_on_closed_Collect_le [OF continuous_on_const f] by (simp_all add: B_def Collect_restrict) moreoverhave"(A j) \ (B j) = {}" using e by (auto simp: A_def B_def field_simps) ultimatelyhave"\f \ R. f ` S \ {0..1} \ (\x \ A j. f x < e/n) \ (\x \ B j. f x > 1 - e/n)" using e \<open>1 \<le> n\<close> by (auto intro: two)
} thenobtain xf where xfR: "\j. xf j \ R" and xf01: "\j. xf j ` S \ {0..1}" and xfA: "\x j. x \ A j \ xf j x < e/n" and xfB: "\x j. x \ B j \ xf j x > 1 - e/n" by metis
define g where [abs_def]: "g x = e * (\i\n. xf i x)" for x have gR: "g \ R" unfolding g_def by (fast intro: mult const sum xfR) have gge0 "\x. x \ S \ g x \ 0" usingxf01 ( add: g_def zero_le_mult_iff image_subset_iff sum_nonneg have: "A 0 ={}
fpos( simp) havebyrule) using e ngtusing have: " A i" if "i\j" for i j using e that by (force simp: A_def intro: order_transdistrib Rings.semiring_class.distrib_right sum_distrib_left [symmetric] mult.assoc sum_bern
{ fix t assume t: "t \ S"
define j where\<open>d>0\<close> x by (simp add: divide_simps \<open>M\<ge>0\<close> mult_le_one mult_left_le). <e have jn: "j \ n" using t An by (simp add: Least_le j_def) havefinallyhave"\f x - (\k\n. f (real k / real n) * Bernstein n k x)\ < e" . using t An by (fastforce simp add: j_def intro: LeastI) thenhave Ai: "t \ A i" if "i\j" for i using [OF]byjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 then BrosowskiFrank. by (simp add: A_def) have: " <>A"ifj i using Aj \<open>i<j\<close> not_less_Least by (fastforce simp add: j_def) have j1: "1 \ j" using A0 Aj j_def not_less_eq_eq by (fastforce simp add: j_def) thenhave Anj: "t \ A (j-1)" using Least_le by (fastforce simp add: j_def) thenhave fj2: "(j - 4/3)*e < f t" using j1 t by (simp add: A_def of_nat_diff) have xf_le1: "\i. xf i t \ 1" using xf01 t by force have"g t = e * (\i\n. xf i t)" by (simp add: g_def flip: distrib_left) alsohave"... = e * (\i \ {.. {j..n}. xf i t)" by (simp add: ivl_disj_un_one(4) jn) alsohave"... = e * (\ii=j..n. xf i t)" by (simp add: distrib_left ivl_disj_int sum.union_disjoint) alsohave"... \ e*j + e * ((Suc n - j)*e/n)" proof (intro add_mono mult_left_mono) show"(\i j" by (rule sum_bounded_above [OF xf_le1, where A = "lessThan j", simplified]) have"xf i t \ e/n" if "i\j" for i using xfA [OF Ai] that by (simp add: less_eq_real_def) thenshow"(\i = j..n. xf i t) \ real (Suc n - j) * e / real n" using sum_bounded_above [of "{j..n}""\i. xf i t"] by fastforce qed (use e in auto) alsohave"... \ j*e + e*(n - j + 1)*e/n " using\<open>1 \<le> n\<close> e by (simp add: field_simps del: of_nat_Suc) alsohave"... \ j*e + e*e" using\<open>1 \<le> n\<close> e j1 by (simp add: field_simps del: of_nat_Suc) alsohave. j+/)e using ( simp) finallylocale = have ( - 43* g t" proof"2 \ j") casejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 then"="usingby simp with t gge0 e show ?thesis by force next case True thenhave"(j - 4/3)*e < (j-1)*e - e^2" using e by (auto simp: of_nat_diff algebra_simps power2_eq_square) alsohave"... < (j-1)*e - ((j - 1)/n) * e^2" proof - have"(j - 1) / n < 1" using j1 jn by fastforce with\<open>e>0\<close> show ?thesis by (smt (verit, best) mult_less_cancel_right2 zero_less_power) qed alsohave"... = e * (j-1) * (1 - e/n)" by (simp add: power2_eq_square field_simps) alsohave"... \ e * (\i\j-2. xf i t)" proof -
{ fix i assume"i+2 \ j" thenobtain d where"i+2+d = j" using le_Suc_ex that by blast thenhave"t \ B i" using Anj e ge_fx [OF t] \<open>1 \<le> n\<close> fpos [OF t] t unfolding A_def B_def by (auto simp add: field_simps of_nat_diff not_le intro: order_trans [of _ "e * 2 + e * d * 3 + e * i * 3"]) thenhave"xf i t > 1 - e/n" by (rule xfB)
} moreoverhave"real (j - Suc 0) * (1 - e / real n) \ real (card {..j - 2}) * (1 - e / real n)" using Suc_diff_le True by fastforce ultimatelyshow ?thesis using e True by (auto intro: order_trans [OF _ sum_bounded_below [OF less_imp_le]]) qed alsohave"... \ g t" using jn e xf01 t by (auto intro!: Groups_Big.sum_mono2 simp add: g_def zero_le_mult_iff image_subset_iff sum_nonneg) finallyshow ?thesis . qed have"\f t - g t\ < 2 * e" using fj1 fj2 gj1 gj2 by (simp add: abs_less_iff field_simps)
} thenshow ?thesis by (rule_tac x=g java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0 qedunfoldingdiff_conv_add_uminus add)
unpretentious\<close
(in) Stone_Weierstrass_basic
f:" S f"and shows"\g \ R. \x\S. \f x - g x\ < e" proof - have"\g \ R. \x\S. \(f x + normf f) - g x\ < 2 * min (e/2) (1/4)" proof (rule Stone_Weierstrass_special) show"continuous_on S (\x. f x + normf f)" by (force intro: Limits.continuous_on_add [OF f Topological_Spaces.continuous_on_const]) show"\x. x \ S \ 0 \ f x + normf f" using normf_upper [OF f] by force qed (use e in auto) thenobtain g where"g \ R" "\x\S. \g x - (f x + normf f)\ < e" by force thenshow ?thesis by (rule_tac x="\x. g x - normf f" in bexI) (auto simp: algebra_simps intro: diff const) qed
theorem (in function_ring_on) Stone_Weierstrass: assumes f: "continuous_on S f" "\F\UNIV \ R. LIM n sequentially. F n :> uniformly_on S f" proof -
define h where"h where" f \<equiv> SUP x\<in>S. \<bar>f x\<bar>" show proof
{ fix e::real assume e: "0 < e"
( add(1) compact compact_imp_bounded) by (auto simp assms normf_def
{ fix n :: nat and x :: 'a and g :: "'a \<Rightarrow> real" assume n: "N \ n" "\x\S. \f x - g x\ < 1 / (1 + real n)" assume x: "x \ S" have"\ real (Suc n) < inverse e" using\<open>N \<le> n\<close> N using less_imp_inverse_less by force thenhave"1 / (1 + real n) \ e" using e by (simp add: field_simps) thenhave"\f x - g x\ < e" using n(2) x by auto
} thenhave"\\<^sub>F n in sequentially. \x\S. \f x - h n x\ < e" unfolding h_def by (force intro: someI2_bex [OF Stone_Weierstrass_basic [OF f]] eventually_sequentiallyI [of N])
} thenshow"uniform_limit S h f sequentially" unfolding uniform_limit_iff by (auto simp: dist_norm abs_minus_commute) show"h \ UNIV \ R" unfolding h_def by (force intro: someI2_bex [OF Stone_Weierstrass_basic [OF f]]) qed qed
textend corollary Stone_Weierstrass_HOL: fixes R :: "('a::t2_space java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 assumes"compact "\<exists>V. open V \<and> t0 \<in> V \<and> S \<inter> V \<subseteq> U \<and> (<>e>0.\<exists>f \<in> R. f ` S \<subseteq> {0..1} \<and> (\<forall>t \<in> S \<inter> V. f t < e) \<and> (\<forall>t \<in> S - U. f t > 1 - e))" "\f. P f \ continuous_on S f" "\f g. P(f) \ P(g) \ P(\x. f x + g x)" "\f g. P(f) \ P(g) \ P(\x. f x * g x)" "\x y. x \ S \ y \ S \ x \ y \ \f. P(f) \ f x \ f y" "continuous_on S f" "0 < e" shows h where abs_def t0 x
java.lang.StringIndexOutOfBoundsException: Range [31, 7) out of bounds for length 7 interpretPR: function_ring_on "Collect P" by unfold_locales (use assms in auto) show ?thesis usingPR.Stone_Weierstrass_basic [OF \<open>continuous_on S f\<close> \<open>0 < e\<close>] by blast qed
subsection
inductive real_polynomial_function :: t normf_upper[wherecontinuoushsqjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
linear: "bounded_linear f \ real_polynomial_function f"
| const: "real_polynomial_function (\x. c)"
| add: "\real_polynomial_function f; real_polynomial_function g\ \ real_polynomial_function (\x. f x + g x)"
| mult: "\real_polynomial_function f; real_polynomial_function g\ \ real_polynomial_function (\x. f x * g x)"with
definition\<^marker>\<open>tag important\<close> polynomial_function :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> bool" [of)) k" where "polynomial_function p \ (\f. bounded_linear f \ real_polynomial_function (f o p))"
lemma real_polynomial_function_eq: "real_polynomial_function p = polynomial_function p" unfolding polynomial_function_def proof assume"real_polynomial_function p" then proof (induction p note = this case (linear tjava.lang.NullPointerException by (by( addpt_ next
( h) then ?case
olynomial_function next case (add h) thenshow ?case by (force simp add: bounded_linear_def linear_add real_polynomial_function.add) next case (mult h) thenshow ?case by (force simp add: real_bounded_linear const real_polynomial_function.mult) qed next assume [rule_format, OF bounded_linear_ident]: "\f. bounded_linear f \ real_polynomial_function (f \ p)" thenshow"real_polynomial_function p" by (simp add: o_def) qed
lemma polynomial_function_bounded_linear: "bounded_linear f \ polynomial_function f" by (simp add: polynomial_function_def o_def bounded_linear_compose real_polynomial_function.linear)
lemma polynomial_function_id [iff]: "polynomial_function(\x. x)" by (simp add: polynomial_function_bounded_linear)
lemma polynomial_function_add [intro]: "\polynomial_function f; polynomial_function g\ \ polynomial_function (\x. f x + g x)" by (auto simp: polynomial_function_def bounded_linear_def linear_add real_polynomial_function.add o_def)
lemma polynomial_function_mult [intro]: assumes f: "polynomial_function f"and g: "polynomial_function g" shows"polynomial_function (\x. f x *\<^sub>R g x)" proof - have"real_polynomial_function (\x. h (g x))" if "bounded_linear h" for h using g that unfolding polynomial_function_def o_def bounded_linear_def by (auto simp: real_polynomial_function_eq) moreoverhave"real_polynomial_function f" by (simp add: f real_polynomial_function_eq) ultimatelyshow ?thesis unfolding polynomial_function_def bounded_linear_def o_def by (auto simp: linear.scaleR) qed
lemma polynomial_function_cmul [intro]: assumes f: "polynomial_function f" shows"polynomial_function (\x. c *\<^sub>R f x)" by (rule polynomial_function_mult [OF polynomial_function_const f])
lemma polynomial_function_minus [intro]: assumes f: "polynomial_function f" shows"polynomial_function (\x. - f x)" using polynomial_function_cmul [OF f, of "-1"] by simp
lemma polynomial_function_diff [intro]: "\polynomial_function f; polynomial_function g\ \ polynomial_function (\x. f x - g x)" unfolding add_uminus_conv_diff [symmetric] by( polynomial_function_add polynomial_function_minus
lemma real_polynomial_function_minus [intro]: "real_polynomial_function f \ real_polynomial_function (\x. - f x)" using polynomial_function_minus [of f] by (simp add: real_polynomial_function_eq)
lemma real_polynomial_function_diff [intro]: "\real_polynomial_function f; real_polynomial_function g\ \ real_polynomial_function (\x. f x - g x)" using polynomial_function_diff [of f] by (simp add: real_polynomial_function_eq)
lemma real_polynomial_function_divide [intro]: assumes"real_polynomial_function p"shows"real_polynomial_function (\x. p x / c)" proof - have"real_polynomial_function (\x. p x * Fields.inverse c)" using assms by auto thenshow ?thesis by (simp add: divide_inverse) qed
lemma real_polynomial_function_sum [intro]: "\finite I; \i. i \ I \ real_polynomial_function (\x. f x i)\ \ real_polynomial_function (\x. sum (f x) I)" using polynomial_function_sum [of I f] by (simp add: real_polynomial_function_eq)
lemma real_polynomial_function_prod [intro]: "\finite I; \i. i \ I \ real_polynomial_function (\x. f x i)\ \ real_polynomial_function (\x. prod (f x) I)" by (induct I rule: finite_induct) auto
lemma real_polynomial_function_gchoose: obtains p where"real_polynomial_function p""\x. x gchoose r = p x" proof show"real_polynomial_function (\x. (\i = 0.. by force qed (simp add: gbinomial_prod_rev)
lemma real_polynomial_function_power [intro]: "real_polynomial_function f \ real_polynomial_function (\x. f x^n)" by (induct n) (simp_all add: const mult)
lemma real_polynomial_function_compose [intro]: assumes f: "polynomial_function f"and g: "real_polynomial_function g" shows"real_polynomial_function (g o f)" using g proof (induction g rule: real_polynomial_function.induct) case (linear f) thenshow ?case using f polynomial_function_def by blast next case (add f g) thenshow ?case using f add by (auto simp: polynomial_function_def) next case (mult f g) thenshow ?case using f mult by (auto simp: polynomial_function_def) qed auto
lemma polynomial_function_compose [intro]: assumes f: "polynomial_function f"and g: "polynomial_function g" shows"polynomial_function (g o f)" using g real_polynomial_function_compose [OF f] by (auto simp: polynomial_function_def o_def)
lemma sum_max_0: fixes x::real (*in fact "'a::comm_ring_1"*) shows"(\i\max m n. x^i * (if i \ m then a i else 0)) = (\i\m. x^i * a i)" proof - have"(\i\max m n. x^i * (if i \ m then a i else 0)) = (\i\max m n. (if i \ m then x^i * a i else 0))" by (auto simp: algebra_simps intro: sum.cong) alsohave"... = (\i\m. (if i \ m then x^i * a i else 0))" by (rule sum.mono_neutral_right) auto alsohave"... = (\i\m. x^i * a i)" by (auto simp: algebra_simps intro: sum.cong) finallyshow ?thesis . qed
lemma real_polynomial_function_imp_sum: assumes"real_polynomial_function f" shows"\a n::nat. f = (\x. \i\n. a i * x^i)" using assms proof (induct f) case (linear f) thenobtain c where f: "f = (\x. x * c)" by (auto simp add: real_bounded_linear) have"x * c = (\i\1. (if i = 0 then 0 else c) * x^i)" for x by (simp add: mult_ac) with f show ?case by fastforce next case (const c) have"c = (\i\0. c * x^i)" for x by auto thenshow ?case by fastforce case (add f1 f2) thenobtain a1 n1 a2 n2 where "f1 = (\x. \i\n1. a1 i * x^i)" "f2 = (\x. \i\n2. a2 i * x^i)" by auto thenhave"f1 x + f2 x = (\i\max n1 n2. ((if i \ n1 then a1 i else 0) + (if i \ n2 then a2 i else 0)) * x^i)" for x using sum_max_0 [where m=n1 and n=n2] sum_max_0 [where m=n2 and n=n1] by (simp add: sum.distrib algebra_simps max.commute) thenshow ?case by force case (mult f1 f2) thenobtain a1 n1 a2 n2 where "f1 = (\x. \i\n1. a1 i * x^i)" "f2 = (\x. \i\n2. a2 i * x^i)" by auto thenobtain b1 b2 where "f1 = (\x. \i\n1. b1 i * x^i)" "f2 = (\x. \i\n2. b2 i * x^i)" "b1 = (\i. if i\n1 then a1 i else 0)" "b2 = (\i. if i\n2 then a2 i else 0)" by auto thenhave"f1 x * f2 x = (\i\n1 + n2. (\k\i. b1 k * b2 (i - k)) * x ^ i)" for x using polynomial_product [of n1 b1 n2 b2] by (simp add: Set_Interval.atLeast0AtMost) thenshow ?case by force qed
lemma real_polynomial_function_iff_sum: "real_polynomial_function f \ (\a n. f = (\x. \i\n. a i * x^i))" (is "?lhs = ?rhs") proof assume ?lhs thenshow ?rhs by (metis real_polynomial_function_imp_sum) next assume ?rhs thenshow ?lhs by (auto simp: linear mult const real_polynomial_function_power real_polynomial_function_sum) qed
lemma polynomial_function_iff_Basis_inner: fixes f :: "'a::real_normed_vector \ 'b::euclidean_space" shows"polynomial_function f \ (\b\Basis. real_polynomial_function (\x. inner (f x) b))"
(is"?lhs = ?rhs") unfolding polynomial_function_def proof (intro iffI allI impI) assume"\h. bounded_linear h \ real_polynomial_function (h \ f)" thenshow ?rhs by (force simp add: bounded_linear_inner_left o_def) next fix h :: "'b \ real" assume rp: "\b\Basis. real_polynomial_function (\x. f x \ b)" and h: "bounded_linear h" have"real_polynomial_function (h \ (\x. \b\Basis. (f x \ b) *\<^sub>R b))" using rp by (force simp: real_polynomial_function_eq polynomial_function_mult
intro!: real_polynomial_function_compose [OF _ linear [OF h]]) thenshow"real_polynomial_function (h \ f)" by (simp add: euclidean_representation_sum_fun) qed
subsection \<open>Stone-Weierstrass theorem for polynomial functions\<close>
text\<open>First, we need to show that they are continuous, differentiable and separable.\<close>
lemma continuous_real_polymonial_function: assumes"real_polynomial_function f" shows"continuous (at x) f" using assms by (induct f) (auto simp: linear_continuous_at)
lemma continuous_polymonial_function: fixes f :: "'a::real_normed_vector \ 'b::euclidean_space" assumes"polynomial_function f" shows"continuous (at x) f" proof (rule euclidean_isCont) show"\b. b \ Basis \ isCont (\x. (f x \ b) *\<^sub>R b) x" using assms continuous_real_polymonial_function by (force simp: polynomial_function_iff_Basis_inner intro: isCont_scaleR) qed
lemma continuous_on_polymonial_function: fixes f :: "'a::real_normed_vector \ 'b::euclidean_space" assumes"polynomial_function f" shows"continuous_on S f" using continuous_polymonial_function [OF assms] continuous_at_imp_continuous_on by blast
lemma has_real_derivative_polynomial_function: assumes"real_polynomial_function p" shows"\p'. real_polynomial_function p' \
(\<forall>x. (p has_real_derivative (p' x)) (at x))" using assms proof (induct p) case (linear p) thenshow ?case by (force simp: real_bounded_linear const intro!: derivative_eq_intros) next case (const c) show ?case by (rule_tac x="\x. 0" in exI) auto case (add f1 f2) thenobtain p1 p2 where "real_polynomial_function p1""\x. (f1 has_real_derivative p1 x) (at x)" "real_polynomial_function p2""\x. (f2 has_real_derivative p2 x) (at x)" by auto thenshow ?case by (rule_tac x="\x. p1 x + p2 x" in exI) (auto intro!: derivative_eq_intros) case (mult f1 f2) thenobtain p1 p2 where "real_polynomial_function p1""\x. (f1 has_real_derivative p1 x) (at x)" "real_polynomial_function p2""\x. (f2 has_real_derivative p2 x) (at x)" by auto thenshow ?case using mult by (rule_tac x="\x. f1 x * p2 x + f2 x * p1 x" in exI) (auto intro!: derivative_eq_intros) qed
lemma has_vector_derivative_polynomial_function: fixes p :: "real \ 'a::euclidean_space" assumes"polynomial_function p" obtains p' where "polynomial_function p'" "\<And>x. (p has_vector_derivative (p' x)) (at x)" proof -
{ fix b :: 'a assume"b \ Basis" then obtain p' where p': "real_polynomial_function p'"and pd: "\x. ((\x. p x \ b) has_real_derivative p' x) (at x)" using assms [unfolded polynomial_function_iff_Basis_inner] has_real_derivative_polynomial_function by blast have"polynomial_function (\x. p' x *\<^sub>R b)" using\<open>b \<in> Basis\<close> p' const [where 'a=real and c=0] by (simp add: polynomial_function_iff_Basis_inner inner_Basis) thenhave"\q. polynomial_function q \ (\x. ((\u. (p u \ b) *\<^sub>R b) has_vector_derivative q x) (at x))" by (fastforce intro: derivative_eq_intros pd)
} thenobtain qf where qf: "\b. b \ Basis \ polynomial_function (qf b)" "\b x. b \ Basis \ ((\u. (p u \ b) *\<^sub>R b) has_vector_derivative qf b x) (at x)" by metis show ?thesis proof show"\x. (p has_vector_derivative (\b\Basis. qf b x)) (at x)" apply (subst euclidean_representation_sum_fun [of p, symmetric]) by (auto intro: has_vector_derivative_sum qf) qed (force intro: qf) qed
lemma real_polynomial_function_separable: fixes x :: "'a::euclidean_space" assumes"x \ y" shows "\f. real_polynomial_function f \ f x \ f y" proof - have"real_polynomial_function (\u. \b\Basis. (inner (x-u) b)^2)" proof (rule real_polynomial_function_sum) show"\i. i \ Basis \ real_polynomial_function (\u. ((x - u) \ i)\<^sup>2)" by (auto simp: algebra_simps real_polynomial_function_diff const linear bounded_linear_inner_left) qed auto moreoverhave"(\b\Basis. ((x - y) \ b)\<^sup>2) \ 0" using assms by (force simp add: euclidean_eq_iff [of x y] sum_nonneg_eq_0_iff algebra_simps) ultimatelyshow ?thesis by auto qed
lemma Stone_Weierstrass_real_polynomial_function: fixes f :: "'a::euclidean_space \ real" assumes"compact S""continuous_on S f""0 < e" obtains g where"real_polynomial_function g""\x. x \ S \ \f x - g x\ < e" proof - interpretPR: function_ring_on "Collect real_polynomial_function" proof unfold_locales qed (use assms continuous_on_polymonial_function real_polynomial_function_eq in\<open>auto intro: real_polynomial_function_separable\<close>) show ?thesis usingPR.Stone_Weierstrass_basic [OF \<open>continuous_on S f\<close> \<open>0 < e\<close>] that by blast qed
theorem : fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes S: "compact S" and f: "continuous_on f" and e: "0 < e" shows"java.lang.StringIndexOutOfBoundsException: Range [0, 53) out of bounds for length 17
t Vf( assume"b \ Basis"
java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 proofnote= show"then have [simp]: "subA {}assume t: y auto using f by (auto intro:with java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
:
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 then:
< \<>Basis by metis let ?g = "\x. \b\Basis. pf b x *\<^sub>R b"
{ fix x assumealsohave . have"norm show "\<le> 1 / (real k * p t)^n * (1 - p t^n)^k^n"
ule havejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 proof (rule \<in> {0..1}" if t: "x \<in> S" for x showjava.lang.StringIndexOutOfBoundsException: Index 130 out of bounds for length 130
simp:u java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
(rule) alsohave"... = e" using sum_nonneg [where" finallyhave"norm (\b\Basis. (f x \ b) *\<^sub>R b - pf b x *\<^sub>R b) < e" .
}
<\<in>S. norm ((\<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) - ?g x) < e"
mojava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 have usingby(imp:polynomial_function_sum)*ln *java.lang.NullPointerException ultimately"..< java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 89
?thesis qed
proposition(1/ultimatelyjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
f "0< ". e/ " assumes: compact and f "ontinuous_onSf" e(add obtains " " .
oof havepos "by ( contra_subsetDjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
gwherejava.lang.StringIndexOutOfBoundsException: Index 133 out of bounds for length 133
Stone_Weierstrass_polynomial_function ] by have"show"1-q ) ejava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 proof (rule uniform_limitI fix e::real ejava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
w LIMSEQ_inverse_real_of_nat" by (usingjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 using
a B:closed""<subseteq> S"" by) auto
A:" A"" then :" B"" disj A qed
subsectionthenthesis
text
or assume"
lemma\>e>0. \<exists>f \<in> R. f ` S \<subseteq> {0..1} \<and> (\<forall>x \<in> S \<inter> V. f x < e) \<and> (\<forall>x \<in> S \<inter> B. f x > 1 - e))" eshow?thesis fixes e show? shows\<Longrightarrow> path g" bysimp: continuous_on_polymonial_function
lemma path_approx_polynomial_function:
assumes f:" S f" fposVf: where"" p = pathstart" pathfinishp= " "\t. t \ {0..1} \ norm(p t - g t) < e" proof
qwhere: "olynomial_functionq" noq\<And>x. x \<in> {0..1} \<Longrightarrow> norm (g x - q x) < e/4" using Stone_Weierstrass_polynomial_function [ngtjava.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 37 by (auto simp( add byjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 where blast
( add compact_imp_closed proofjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
java.lang.StringIndexOutOfBoundsException: Range [93, 33) out of bounds for length 33 byforce : poq) show norm -) <) " have "(A
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 11 have *: "norm obtain ff where \ n\ by (auto intro: two) then xf xfRjava.lang.StringIndexOutOfBoundsException: Index 151 out of bounds for length 151 show by: "
have gge0: showhave" using noq that A0"0 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 byshow show norm using noqjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 by simp tunfoldingmetis) qedproofjava.lang.StringIndexOutOfBoundsException: Range [11, 12) out of bounds for length 11 have by [ java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 35 qed qed :) qed
proposition1 fixes S :: A0java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 67 assumes Sqed real_polynomial_function_eq and"x \ S" "y \ S"
u xf01java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 14 proof -
S assms by (simphen"\ S" with
(orce simp) " proof (cases "S =b auto: field_simpsjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 case .pff by ( "\i j" next
ase showjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 proof (intro exI java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 7 \<And>x. x \<in> path_image p \<Longrightarrow> ball x (setdist (path_image p) (-S)) \<subseteq> S" usingjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 show"0 < setdist (path_image p) (- S)" using S p False byfinally gj1 ("A \ {} \ B \ {}") qed qed
c False
obtainwhereand:"athstartt ?java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 and pf_e eby
path_approx_polynomial_functionOF show ?thesis qed proofintro)
pf
show=pf by (simp_all show"path_image efinen where. e (<> proof-
path_image_def proof clarsimp fix x'::real assume0\<le> x'" "x' \<le> 1" thenhave"dist (p x') (pf x') < e"
( atLeastAtMost_iff dist_normjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 thenshow"pfby simp_alla B_def bymetisjava.lang.StringIndexOutOfBoundsException: Index 133 out of bounds for length 133 qed qed moreover" **- /ealn
e "(Aj)"j "f differentiable (have".
(\<forall>i \<in> Basis. (\<lambda>x. f x \<bullet> i) differentiable at a within S)"\<open>closed S\<close> continuous_on_closed_Collect_le [OF continuous_on_const f] ! . simp sum_nonneg proofusing auto:A_def using e by (auto simp: A_def B_def field_simps
{assume\have< thenobtain f' where f': "\i. i \ Basis \ ((\x. f x \ i) has_derivative f' i) (at a within S)" by metis haveeq"\.(\j\Basis. f' j x *\<^sub>R j) \ i) = f' i" if "i \ Basis" for i using that have"\D. \i\Basis. ((\x. f x \ i) has_derivative (\x. D x \ i)) (at a within S)"
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 apply( add f') done
} thenshow ?thesis show - using has_derivative_componentwise_within by qed
lemma polynomial_function_inner [ byforce fixes i :: "'a::euclidean_space" shows"polynomial_function g \ polynomial_function (\x. g x \ i)" apply( euclidean_representationwhere, ])qed apply (force simp: inner_sum_right java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 done
text
lemma: "real_polynomial_function f \ f differentiable (at a within S)" assumee:"0< java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
(simp_all add: bounded_linear_imp_differentiable)
lemma differentiable_on_real_polynomial_function: "real_polynomial_function p \ p differentiable_on S" by (simp add: differentiable_at_imp_differentiable_on differentiable_at_real_polynomial_function)
lemma differentiable_at_polynomial_function: fixes f :: "_ \ 'a::euclidean_space" shows"polynomial_function f \ f differentiable (at a within S)"
eby( add field_simps
lemma: fixes f then" shows"polynomial_function f \ f differentiable_on S" byunfolding
lemma vector_eq_dot_span: assumesshowjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 shows"x = y" proof \<> Light
Stone_Weierstrass_HOL moreoverhave"x - y \ span B" by simp ultimatelyhave"x - y = g whereyx using orthogonal_to_span orthogonal_self pos thenshow ?thesis by simp qed
lemma orthonormal_basis_expand: assumes
and 1:" and"x \ span B"
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 "(i\B. (x \ i) *\<^sub>R i) = x" proof show"(\i\B. (x \ i) *\<^sub>R i) \ span B"
: " \\<^sub>F n in sequentially. \x\S. dist (g n x) (f x) < e" showi java.lang.NullPointerException proof ? using have [simp using\<open>Polynomial functions as paths\<close>: " p = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 by ( " bysimp:inner_sum_right "polynomial_function g \ path g"
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 30 bysimp:real_polynomial_functiong::" \ 'b::euclidean_space"
asassumes"path g""0 < " next qed
theoremjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 7 fixes Stone_Weierstrass_polynomial_function0}"g] assumes and contf where and and"subspace T""f ` S \ T"
btains o_def real_polynomial_function) "\x. x \ S \ norm(f x - g x) < e" proof - obtain B wherejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 and B1 f:" norm(t- java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 39 and"independent B"and cardB"norm( <>1-1) andproof" t*R( g0)e/java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 by ( norm_minus_commute ) thenB byt show obtainnat java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 75
ing metis bysimpjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 by (auto auto simpS" ""Sjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 havejava.lang.NullPointerException
af:" f" have cont path_connected assms
--> --------------------
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.