src/HOL/Multivariate_Analysis/Weierstrass.thy
changeset 61711 21d7910d6816
parent 61610 4f54d2759a0b
child 61762 d50b993b4fb9
equal deleted inserted replaced
61710:e77cb3792503 61711:21d7910d6816
     1 section \<open>Bernstein-Weierstrass and Stone-Weierstrass Theorems\<close>
     1 section \<open>The Bernstein-Weierstrass and Stone-Weierstrass Theorems\<close>
       
     2 
       
     3 text\<open>By L C Paulson (2015)\<close>
     2 
     4 
     3 theory Weierstrass
     5 theory Weierstrass
     4 imports Uniform_Limit Path_Connected
     6 imports Uniform_Limit Path_Connected
     5 begin
     7 begin
     6 
     8 
     7 (*Power.thy:*)
       
     8 declare power_divide [where b = "numeral w" for w, simp del]
       
     9 
       
    10 subsection \<open>Bernstein polynomials\<close>
     9 subsection \<open>Bernstein polynomials\<close>
    11 
    10 
    12 definition Bernstein :: "[nat,nat,real] \<Rightarrow> real" where
    11 definition Bernstein :: "[nat,nat,real] \<Rightarrow> real" where
    13   "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)"
    14 
    13 
    21 lemma sum_Bernstein [simp]: "(\<Sum> k = 0..n. Bernstein n k x) = 1"
    20 lemma sum_Bernstein [simp]: "(\<Sum> k = 0..n. Bernstein n k x) = 1"
    22   using binomial_ring [of x "1-x" n]
    21   using binomial_ring [of x "1-x" n]
    23   by (simp add: Bernstein_def)
    22   by (simp add: Bernstein_def)
    24 
    23 
    25 lemma binomial_deriv1:
    24 lemma binomial_deriv1:
    26     "(\<Sum>k=0..n. (of_nat k * of_nat (n choose k)) * a^(k-1) * b^(n-k)) =
    25     "(\<Sum>k=0..n. (of_nat k * of_nat (n choose k)) * a^(k-1) * b^(n-k)) = real_of_nat n * (a+b) ^ (n-1)"
    27      of_nat n * (a+b::real) ^ (n-1)"
       
    28   apply (rule DERIV_unique [where f = "\<lambda>a. (a+b)^n" and x=a])
    26   apply (rule DERIV_unique [where f = "\<lambda>a. (a+b)^n" and x=a])
    29   apply (subst binomial_ring)
    27   apply (subst binomial_ring)
    30   apply (rule derivative_eq_intros setsum.cong | simp)+
    28   apply (rule derivative_eq_intros setsum.cong | simp)+
    31   done
    29   done
    32 
    30 
   167 
   165 
   168 text\<open>Source:
   166 text\<open>Source:
   169 Bruno Brosowski and Frank Deutsch.
   167 Bruno Brosowski and Frank Deutsch.
   170 An Elementary Proof of the Stone-Weierstrass Theorem.
   168 An Elementary Proof of the Stone-Weierstrass Theorem.
   171 Proceedings of the American Mathematical Society
   169 Proceedings of the American Mathematical Society
   172 Volume 81, Number 1, January 1981.\<close>
   170 Volume 81, Number 1, January 1981.
       
   171 DOI: 10.2307/2043993  http://www.jstor.org/stable/2043993\<close>
   173 
   172 
   174 locale function_ring_on =
   173 locale function_ring_on =
   175   fixes R :: "('a::t2_space \<Rightarrow> real) set" and s :: "'a set"
   174   fixes R :: "('a::t2_space \<Rightarrow> real) set" and s :: "'a set"
   176   assumes compact: "compact s"
   175   assumes compact: "compact s"
   177   assumes continuous: "f \<in> R \<Longrightarrow> continuous_on s f"
   176   assumes continuous: "f \<in> R \<Longrightarrow> continuous_on s f"