src/HOL/Multivariate_Analysis/Uniform_Limit.thy
author wenzelm
Wed, 13 Jan 2016 23:07:06 +0100
changeset 62175 8ffc4d0e652d
parent 62131 1baed43f453e
child 62381 a6479cb85944
child 62390 842917225d56
permissions -rw-r--r--
isabelle update_cartouches -c -t;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
     1
(*  Title:      HOL/Multivariate_Analysis/Uniform_Limit.thy
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
     2
    Author:     Christoph Traut, TU München
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
     3
    Author:     Fabian Immler, TU München
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
     4
*)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
     5
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
     6
section \<open>Uniform Limit and Uniform Convergence\<close>
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
     7
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
     8
theory Uniform_Limit
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
     9
imports Topology_Euclidean_Space
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    10
begin
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    11
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    12
definition uniformly_on :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b::metric_space) \<Rightarrow> ('a \<Rightarrow> 'b) filter"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    13
  where "uniformly_on S l = (INF e:{0 <..}. principal {f. \<forall>x\<in>S. dist (f x) (l x) < e})"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    14
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    15
abbreviation
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    16
  "uniform_limit S f l \<equiv> filterlim f (uniformly_on S l)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    17
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
    18
definition uniformly_convergent_on where
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
    19
  "uniformly_convergent_on X f \<longleftrightarrow> (\<exists>l. uniform_limit X f l sequentially)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
    20
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
    21
definition uniformly_Cauchy_on where 
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
    22
  "uniformly_Cauchy_on X f \<longleftrightarrow> (\<forall>e>0. \<exists>M. \<forall>x\<in>X. \<forall>(m::nat)\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
    23
  
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    24
lemma uniform_limit_iff:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    25
  "uniform_limit S f l F \<longleftrightarrow> (\<forall>e>0. \<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (f n x) (l x) < e)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    26
  unfolding filterlim_iff uniformly_on_def
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    27
  by (subst eventually_INF_base)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    28
    (fastforce
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    29
      simp: eventually_principal uniformly_on_def
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    30
      intro: bexI[where x="min a b" for a b]
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
    31
      elim: eventually_mono)+
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    32
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    33
lemma uniform_limitD:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    34
  "uniform_limit S f l F \<Longrightarrow> e > 0 \<Longrightarrow> \<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (f n x) (l x) < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    35
  by (simp add: uniform_limit_iff)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    36
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    37
lemma uniform_limitI:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    38
  "(\<And>e. e > 0 \<Longrightarrow> \<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (f n x) (l x) < e) \<Longrightarrow> uniform_limit S f l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    39
  by (simp add: uniform_limit_iff)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    40
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    41
lemma uniform_limit_sequentially_iff:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    42
  "uniform_limit S f l sequentially \<longleftrightarrow> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. \<forall>x \<in> S. dist (f n x) (l x) < e)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    43
  unfolding uniform_limit_iff eventually_sequentially ..
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    44
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    45
lemma uniform_limit_at_iff:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    46
  "uniform_limit S f l (at x) \<longleftrightarrow>
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    47
    (\<forall>e>0. \<exists>d>0. \<forall>z. 0 < dist z x \<and> dist z x < d \<longrightarrow> (\<forall>x\<in>S. dist (f z x) (l x) < e))"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    48
  unfolding uniform_limit_iff eventually_at2 ..
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    49
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    50
lemma uniform_limit_at_le_iff:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    51
  "uniform_limit S f l (at x) \<longleftrightarrow>
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    52
    (\<forall>e>0. \<exists>d>0. \<forall>z. 0 < dist z x \<and> dist z x < d \<longrightarrow> (\<forall>x\<in>S. dist (f z x) (l x) \<le> e))"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    53
  unfolding uniform_limit_iff eventually_at2
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    54
  by (fastforce dest: spec[where x = "e / 2" for e])
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    55
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    56
lemma swap_uniform_limit:
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
    57
  assumes f: "\<forall>\<^sub>F n in F. (f n \<longlongrightarrow> g n) (at x within S)"
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
    58
  assumes g: "(g \<longlongrightarrow> l) F"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    59
  assumes uc: "uniform_limit S f h F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    60
  assumes "\<not>trivial_limit F"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
    61
  shows "(h \<longlongrightarrow> l) (at x within S)"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    62
proof (rule tendstoI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    63
  fix e :: real
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    64
  def e' \<equiv> "e/3"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    65
  assume "0 < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    66
  then have "0 < e'" by (simp add: e'_def)
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
    67
  from uniform_limitD[OF uc \<open>0 < e'\<close>]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    68
  have "\<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (h x) (f n x) < e'"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    69
    by (simp add: dist_commute)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    70
  moreover
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    71
  from f
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    72
  have "\<forall>\<^sub>F n in F. \<forall>\<^sub>F x in at x within S. dist (g n) (f n x) < e'"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
    73
    by eventually_elim (auto dest!: tendstoD[OF _ \<open>0 < e'\<close>] simp: dist_commute)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    74
  moreover
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
    75
  from tendstoD[OF g \<open>0 < e'\<close>] have "\<forall>\<^sub>F x in F. dist l (g x) < e'"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    76
    by (simp add: dist_commute)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    77
  ultimately
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    78
  have "\<forall>\<^sub>F _ in F. \<forall>\<^sub>F x in at x within S. dist (h x) l < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    79
  proof eventually_elim
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    80
    case (elim n)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    81
    note fh = elim(1)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    82
    note gl = elim(3)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    83
    have "\<forall>\<^sub>F x in at x within S. x \<in> S"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    84
      by (auto simp: eventually_at_filter)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    85
    with elim(2)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    86
    show ?case
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    87
    proof eventually_elim
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    88
      case (elim x)
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
    89
      from fh[rule_format, OF \<open>x \<in> S\<close>] elim(1)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    90
      have "dist (h x) (g n) < e' + e'"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    91
        by (rule dist_triangle_lt[OF add_strict_mono])
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    92
      from dist_triangle_lt[OF add_strict_mono, OF this gl]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    93
      show ?case by (simp add: e'_def)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    94
    qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    95
  qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    96
  thus "\<forall>\<^sub>F x in at x within S. dist (h x) l < e"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
    97
    using eventually_happens by (metis \<open>\<not>trivial_limit F\<close>)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    98
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    99
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   100
lemma
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   101
  tendsto_uniform_limitI:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   102
  assumes "uniform_limit S f l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   103
  assumes "x \<in> S"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
   104
  shows "((\<lambda>y. f y x) \<longlongrightarrow> l x) F"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   105
  using assms
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
   106
  by (auto intro!: tendstoI simp: eventually_mono dest!: uniform_limitD)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   107
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   108
lemma uniform_limit_theorem:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   109
  assumes c: "\<forall>\<^sub>F n in F. continuous_on A (f n)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   110
  assumes ul: "uniform_limit A f l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   111
  assumes "\<not> trivial_limit F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   112
  shows "continuous_on A l"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   113
  unfolding continuous_on_def
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   114
proof safe
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   115
  fix x assume "x \<in> A"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
   116
  then have "\<forall>\<^sub>F n in F. (f n \<longlongrightarrow> f n x) (at x within A)" "((\<lambda>n. f n x) \<longlongrightarrow> l x) F"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   117
    using c ul
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
   118
    by (auto simp: continuous_on_def eventually_mono tendsto_uniform_limitI)
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
   119
  then show "(l \<longlongrightarrow> l x) (at x within A)"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   120
    by (rule swap_uniform_limit) fact+
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   121
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   122
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   123
lemma uniformly_Cauchy_onI:
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   124
  assumes "\<And>e. e > 0 \<Longrightarrow> \<exists>M. \<forall>x\<in>X. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   125
  shows   "uniformly_Cauchy_on X f"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   126
  using assms unfolding uniformly_Cauchy_on_def by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   127
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   128
lemma uniformly_Cauchy_onI':
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   129
  assumes "\<And>e. e > 0 \<Longrightarrow> \<exists>M. \<forall>x\<in>X. \<forall>m\<ge>M. \<forall>n>m. dist (f m x) (f n x) < e"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   130
  shows   "uniformly_Cauchy_on X f"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   131
proof (rule uniformly_Cauchy_onI)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   132
  fix e :: real assume e: "e > 0"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   133
  from assms[OF this] obtain M 
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   134
    where M: "\<And>x m n. x \<in> X \<Longrightarrow> m \<ge> M \<Longrightarrow> n > m \<Longrightarrow> dist (f m x) (f n x) < e" by fast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   135
  {
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   136
    fix x m n assume x: "x \<in> X" and m: "m \<ge> M" and n: "n \<ge> M"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   137
    with M[OF this(1,2), of n] M[OF this(1,3), of m] e have "dist (f m x) (f n x) < e"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   138
      by (cases m n rule: linorder_cases) (simp_all add: dist_commute)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   139
  }
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   140
  thus "\<exists>M. \<forall>x\<in>X. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e" by fast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   141
qed
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   142
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   143
lemma uniformly_Cauchy_imp_Cauchy: 
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   144
  "uniformly_Cauchy_on X f \<Longrightarrow> x \<in> X \<Longrightarrow> Cauchy (\<lambda>n. f n x)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   145
  unfolding Cauchy_def uniformly_Cauchy_on_def by fast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   146
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   147
lemma uniform_limit_cong:
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   148
  fixes f g :: "'a \<Rightarrow> 'b \<Rightarrow> ('c :: metric_space)" and h i :: "'b \<Rightarrow> 'c"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   149
  assumes "eventually (\<lambda>y. \<forall>x\<in>X. f y x = g y x) F"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   150
  assumes "\<And>x. x \<in> X \<Longrightarrow> h x = i x"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   151
  shows   "uniform_limit X f h F \<longleftrightarrow> uniform_limit X g i F"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   152
proof -
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   153
  {
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   154
    fix f g :: "'a \<Rightarrow> 'b \<Rightarrow> 'c" and h i :: "'b \<Rightarrow> 'c"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   155
    assume C: "uniform_limit X f h F" and A: "eventually (\<lambda>y. \<forall>x\<in>X. f y x = g y x) F"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   156
       and B: "\<And>x. x \<in> X \<Longrightarrow> h x = i x"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   157
    {
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   158
      fix e ::real assume "e > 0"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   159
      with C have "eventually (\<lambda>y. \<forall>x\<in>X. dist (f y x) (h x) < e) F" 
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   160
        unfolding uniform_limit_iff by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   161
      with A have "eventually (\<lambda>y. \<forall>x\<in>X. dist (g y x) (i x) < e) F"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   162
        by eventually_elim (insert B, simp_all)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   163
    }
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   164
    hence "uniform_limit X g i F" unfolding uniform_limit_iff by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   165
  } note A = this
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   166
  show ?thesis by (rule iffI) (erule A; insert assms; simp add: eq_commute)+
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   167
qed
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   168
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   169
lemma uniform_limit_cong':
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   170
  fixes f g :: "'a \<Rightarrow> 'b \<Rightarrow> ('c :: metric_space)" and h i :: "'b \<Rightarrow> 'c"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   171
  assumes "\<And>y x. x \<in> X \<Longrightarrow> f y x = g y x"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   172
  assumes "\<And>x. x \<in> X \<Longrightarrow> h x = i x"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   173
  shows   "uniform_limit X f h F \<longleftrightarrow> uniform_limit X g i F"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   174
  using assms by (intro uniform_limit_cong always_eventually) blast+
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   175
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   176
lemma uniformly_convergent_uniform_limit_iff:
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   177
  "uniformly_convergent_on X f \<longleftrightarrow> uniform_limit X f (\<lambda>x. lim (\<lambda>n. f n x)) sequentially"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   178
proof
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   179
  assume "uniformly_convergent_on X f"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   180
  then obtain l where l: "uniform_limit X f l sequentially" 
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   181
    unfolding uniformly_convergent_on_def by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   182
  from l have "uniform_limit X f (\<lambda>x. lim (\<lambda>n. f n x)) sequentially \<longleftrightarrow>
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   183
                      uniform_limit X f l sequentially"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   184
    by (intro uniform_limit_cong' limI tendsto_uniform_limitI[of f X l]) simp_all
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   185
  also note l
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   186
  finally show "uniform_limit X f (\<lambda>x. lim (\<lambda>n. f n x)) sequentially" .
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   187
qed (auto simp: uniformly_convergent_on_def)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   188
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   189
lemma uniformly_convergentI: "uniform_limit X f l sequentially \<Longrightarrow> uniformly_convergent_on X f"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   190
  unfolding uniformly_convergent_on_def by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   191
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   192
lemma Cauchy_uniformly_convergent:
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   193
  fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b :: complete_space"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   194
  assumes "uniformly_Cauchy_on X f"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   195
  shows   "uniformly_convergent_on X f"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   196
unfolding uniformly_convergent_uniform_limit_iff uniform_limit_iff
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   197
proof safe
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   198
  let ?f = "\<lambda>x. lim (\<lambda>n. f n x)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   199
  fix e :: real assume e: "e > 0"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   200
  hence "e/2 > 0" by simp
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   201
  with assms obtain N where N: "\<And>x m n. x \<in> X \<Longrightarrow> m \<ge> N \<Longrightarrow> n \<ge> N \<Longrightarrow> dist (f m x) (f n x) < e/2"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   202
    unfolding uniformly_Cauchy_on_def by fast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   203
  show "eventually (\<lambda>n. \<forall>x\<in>X. dist (f n x) (?f x) < e) sequentially"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   204
    using eventually_ge_at_top[of N]
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   205
  proof eventually_elim
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   206
    fix n assume n: "n \<ge> N"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   207
    show "\<forall>x\<in>X. dist (f n x) (?f x) < e"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   208
    proof
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   209
      fix x assume x: "x \<in> X"
61969
e01015e49041 more symbols;
wenzelm
parents: 61810
diff changeset
   210
      with assms have "(\<lambda>n. f n x) \<longlonglongrightarrow> ?f x" 
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   211
        by (auto dest!: Cauchy_convergent uniformly_Cauchy_imp_Cauchy simp: convergent_LIMSEQ_iff)
61808
fc1556774cfe isabelle update_cartouches -c -t;
wenzelm
parents: 61806
diff changeset
   212
      with \<open>e/2 > 0\<close> have "eventually (\<lambda>m. m \<ge> N \<and> dist (f m x) (?f x) < e/2) sequentially"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   213
        by (intro tendstoD eventually_conj eventually_ge_at_top)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   214
      then obtain m where m: "m \<ge> N" "dist (f m x) (?f x) < e/2" 
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   215
        unfolding eventually_at_top_linorder by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   216
      have "dist (f n x) (?f x) \<le> dist (f n x) (f m x) + dist (f m x) (?f x)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   217
          by (rule dist_triangle)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   218
      also from x n have "... < e/2 + e/2" by (intro add_strict_mono N m)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   219
      finally show "dist (f n x) (?f x) < e" by simp
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   220
    qed
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   221
  qed
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   222
qed
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   223
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   224
lemma uniformly_convergent_imp_convergent:
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   225
  "uniformly_convergent_on X f \<Longrightarrow> x \<in> X \<Longrightarrow> convergent (\<lambda>n. f n x)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   226
  unfolding uniformly_convergent_on_def convergent_def
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   227
  by (auto dest: tendsto_uniform_limitI)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   228
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   229
lemma weierstrass_m_test_ev:
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   230
fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   231
assumes "eventually (\<lambda>n. \<forall>x\<in>A. norm (f n x) \<le> M n) sequentially"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   232
assumes "summable M"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   233
shows "uniform_limit A (\<lambda>n x. \<Sum>i<n. f i x) (\<lambda>x. suminf (\<lambda>i. f i x)) sequentially"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   234
proof (rule uniform_limitI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   235
  fix e :: real
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   236
  assume "0 < e"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   237
  from suminf_exist_split[OF \<open>0 < e\<close> \<open>summable M\<close>]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   238
  have "\<forall>\<^sub>F k in sequentially. norm (\<Sum>i. M (i + k)) < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   239
    by (auto simp: eventually_sequentially)
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   240
  with eventually_all_ge_at_top[OF assms(1)]
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   241
    show "\<forall>\<^sub>F n in sequentially. \<forall>x\<in>A. dist (\<Sum>i<n. f i x) (\<Sum>i. f i x) < e"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   242
  proof eventually_elim
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   243
    case (elim k)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   244
    show ?case
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   245
    proof safe
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   246
      fix x assume "x \<in> A"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   247
      have "\<exists>N. \<forall>n\<ge>N. norm (f n x) \<le> M n"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   248
        using assms(1) \<open>x \<in> A\<close> by (force simp: eventually_at_top_linorder)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   249
      hence summable_norm_f: "summable (\<lambda>n. norm (f n x))"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   250
        by(rule summable_norm_comparison_test[OF _ \<open>summable M\<close>])
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   251
      have summable_f: "summable (\<lambda>n. f n x)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   252
        using summable_norm_cancel[OF summable_norm_f] .
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   253
      have summable_norm_f_plus_k: "summable (\<lambda>i. norm (f (i + k) x))"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   254
        using summable_ignore_initial_segment[OF summable_norm_f]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   255
        by auto
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   256
      have summable_M_plus_k: "summable (\<lambda>i. M (i + k))"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   257
        using summable_ignore_initial_segment[OF \<open>summable M\<close>]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   258
        by auto
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   259
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   260
      have "dist (\<Sum>i<k. f i x) (\<Sum>i. f i x) = norm ((\<Sum>i. f i x) - (\<Sum>i<k. f i x))"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   261
        using dist_norm dist_commute by (subst dist_commute)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   262
      also have "... = norm (\<Sum>i. f (i + k) x)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   263
        using suminf_minus_initial_segment[OF summable_f, where k=k] by simp
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   264
      also have "... \<le> (\<Sum>i. norm (f (i + k) x))"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   265
        using summable_norm[OF summable_norm_f_plus_k] .
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   266
      also have "... \<le> (\<Sum>i. M (i + k))"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   267
        by (rule suminf_le[OF _ summable_norm_f_plus_k summable_M_plus_k])
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   268
           (insert elim(1) \<open>x \<in> A\<close>, simp)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   269
      finally show "dist (\<Sum>i<k. f i x) (\<Sum>i. f i x) < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   270
        using elim by auto
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   271
    qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   272
  qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   273
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   274
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 62131
diff changeset
   275
text\<open>Alternative version, formulated as in HOL Light\<close>
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   276
corollary series_comparison_uniform:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   277
  fixes f :: "_ \<Rightarrow> nat \<Rightarrow> _ :: banach"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   278
  assumes g: "summable g" and le: "\<And>n x. N \<le> n \<and> x \<in> A \<Longrightarrow> norm(f x n) \<le> g n"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   279
    shows "\<exists>l. \<forall>e. 0 < e \<longrightarrow> (\<exists>N. \<forall>n x. N \<le> n \<and> x \<in> A \<longrightarrow> dist(setsum (f x) {..<n}) (l x) < e)"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   280
proof -
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   281
  have 1: "\<forall>\<^sub>F n in sequentially. \<forall>x\<in>A. norm (f x n) \<le> g n"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   282
    using le eventually_sequentially by auto
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   283
  show ?thesis
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   284
    apply (rule_tac x="(\<lambda>x. \<Sum>i. f x i)" in exI)
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   285
    apply (metis (no_types, lifting) eventually_sequentially uniform_limitD [OF weierstrass_m_test_ev [OF 1 g]])
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   286
    done
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   287
qed
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   288
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   289
corollary weierstrass_m_test:
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   290
  fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   291
  assumes "\<And>n x. x \<in> A \<Longrightarrow> norm (f n x) \<le> M n"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   292
  assumes "summable M"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   293
  shows "uniform_limit A (\<lambda>n x. \<Sum>i<n. f i x) (\<lambda>x. suminf (\<lambda>i. f i x)) sequentially"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   294
  using assms by (intro weierstrass_m_test_ev always_eventually) auto
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   295
    
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   296
corollary weierstrass_m_test'_ev:
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   297
  fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   298
  assumes "eventually (\<lambda>n. \<forall>x\<in>A. norm (f n x) \<le> M n) sequentially" "summable M" 
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   299
  shows   "uniformly_convergent_on A (\<lambda>n x. \<Sum>i<n. f i x)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   300
  unfolding uniformly_convergent_on_def by (rule exI, rule weierstrass_m_test_ev[OF assms])
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   301
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   302
corollary weierstrass_m_test':
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   303
  fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   304
  assumes "\<And>n x. x \<in> A \<Longrightarrow> norm (f n x) \<le> M n" "summable M" 
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   305
  shows   "uniformly_convergent_on A (\<lambda>n x. \<Sum>i<n. f i x)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   306
  unfolding uniformly_convergent_on_def by (rule exI, rule weierstrass_m_test[OF assms])
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   307
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   308
lemma uniform_limit_eq_rhs: "uniform_limit X f l F \<Longrightarrow> l = m \<Longrightarrow> uniform_limit X f m F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   309
  by simp
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   310
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   311
named_theorems uniform_limit_intros "introduction rules for uniform_limit"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   312
setup \<open>
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   313
  Global_Theory.add_thms_dynamic (@{binding uniform_limit_eq_intros},
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   314
    fn context =>
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   315
      Named_Theorems.get (Context.proof_of context) @{named_theorems uniform_limit_intros}
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   316
      |> map_filter (try (fn thm => @{thm uniform_limit_eq_rhs} OF [thm])))
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   317
\<close>
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   318
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   319
lemma (in bounded_linear) uniform_limit[uniform_limit_intros]:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   320
  assumes "uniform_limit X g l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   321
  shows "uniform_limit X (\<lambda>a b. f (g a b)) (\<lambda>a. f (l a)) F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   322
proof (rule uniform_limitI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   323
  fix e::real
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   324
  from pos_bounded obtain K
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   325
    where K: "\<And>x y. dist (f x) (f y) \<le> K * dist x y" "K > 0"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   326
    by (auto simp: ac_simps dist_norm diff[symmetric])
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   327
  assume "0 < e" with \<open>K > 0\<close> have "e / K > 0" by simp
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   328
  from uniform_limitD[OF assms this]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   329
  show "\<forall>\<^sub>F n in F. \<forall>x\<in>X. dist (f (g n x)) (f (l x)) < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   330
    by eventually_elim (metis le_less_trans mult.commute pos_less_divide_eq K)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   331
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   332
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   333
lemmas bounded_linear_uniform_limit_intros[uniform_limit_intros] =
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   334
  bounded_linear.uniform_limit[OF bounded_linear_Im]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   335
  bounded_linear.uniform_limit[OF bounded_linear_Re]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   336
  bounded_linear.uniform_limit[OF bounded_linear_cnj]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   337
  bounded_linear.uniform_limit[OF bounded_linear_fst]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   338
  bounded_linear.uniform_limit[OF bounded_linear_snd]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   339
  bounded_linear.uniform_limit[OF bounded_linear_zero]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   340
  bounded_linear.uniform_limit[OF bounded_linear_of_real]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   341
  bounded_linear.uniform_limit[OF bounded_linear_inner_left]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   342
  bounded_linear.uniform_limit[OF bounded_linear_inner_right]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   343
  bounded_linear.uniform_limit[OF bounded_linear_divide]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   344
  bounded_linear.uniform_limit[OF bounded_linear_scaleR_right]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   345
  bounded_linear.uniform_limit[OF bounded_linear_mult_left]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   346
  bounded_linear.uniform_limit[OF bounded_linear_mult_right]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   347
  bounded_linear.uniform_limit[OF bounded_linear_scaleR_left]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   348
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   349
lemmas uniform_limit_uminus[uniform_limit_intros] =
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   350
  bounded_linear.uniform_limit[OF bounded_linear_minus[OF bounded_linear_ident]]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   351
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   352
lemma uniform_limit_add[uniform_limit_intros]:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   353
  fixes f g::"'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_vector"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   354
  assumes "uniform_limit X f l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   355
  assumes "uniform_limit X g m F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   356
  shows "uniform_limit X (\<lambda>a b. f a b + g a b) (\<lambda>a. l a + m a) F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   357
proof (rule uniform_limitI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   358
  fix e::real
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   359
  assume "0 < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   360
  hence "0 < e / 2" by simp
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   361
  from
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   362
    uniform_limitD[OF assms(1) this]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   363
    uniform_limitD[OF assms(2) this]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   364
  show "\<forall>\<^sub>F n in F. \<forall>x\<in>X. dist (f n x + g n x) (l x + m x) < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   365
    by eventually_elim (simp add: dist_triangle_add_half)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   366
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   367
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   368
lemma uniform_limit_minus[uniform_limit_intros]:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   369
  fixes f g::"'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_vector"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   370
  assumes "uniform_limit X f l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   371
  assumes "uniform_limit X g m F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   372
  shows "uniform_limit X (\<lambda>a b. f a b - g a b) (\<lambda>a. l a - m a) F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   373
  unfolding diff_conv_add_uminus
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   374
  by (rule uniform_limit_intros assms)+
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   375
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   376
lemma (in bounded_bilinear) bounded_uniform_limit[uniform_limit_intros]:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   377
  assumes "uniform_limit X f l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   378
  assumes "uniform_limit X g m F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   379
  assumes "bounded (m ` X)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   380
  assumes "bounded (l ` X)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   381
  shows "uniform_limit X (\<lambda>a b. prod (f a b) (g a b)) (\<lambda>a. prod (l a) (m a)) F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   382
proof (rule uniform_limitI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   383
  fix e::real
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   384
  from pos_bounded obtain K where K:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   385
    "0 < K" "\<And>a b. norm (prod a b) \<le> norm a * norm b * K"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   386
    by auto
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   387
  hence "sqrt (K*4) > 0" by simp
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   388
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   389
  from assms obtain Km Kl
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   390
  where Km: "Km > 0" "\<And>x. x \<in> X \<Longrightarrow> norm (m x) \<le> Km"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   391
    and Kl: "Kl > 0" "\<And>x. x \<in> X \<Longrightarrow> norm (l x) \<le> Kl"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   392
    by (auto simp: bounded_pos)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   393
  hence "K * Km * 4 > 0" "K * Kl * 4 > 0"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   394
    using \<open>K > 0\<close>
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   395
    by simp_all
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   396
  assume "0 < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   397
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   398
  hence "sqrt e > 0" by simp
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   399
  from uniform_limitD[OF assms(1) divide_pos_pos[OF this \<open>sqrt (K*4) > 0\<close>]]
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   400
    uniform_limitD[OF assms(2) divide_pos_pos[OF this \<open>sqrt (K*4) > 0\<close>]]
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   401
    uniform_limitD[OF assms(1) divide_pos_pos[OF \<open>e > 0\<close> \<open>K * Km * 4 > 0\<close>]]
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   402
    uniform_limitD[OF assms(2) divide_pos_pos[OF \<open>e > 0\<close> \<open>K * Kl * 4 > 0\<close>]]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   403
  show "\<forall>\<^sub>F n in F. \<forall>x\<in>X. dist (prod (f n x) (g n x)) (prod (l x) (m x)) < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   404
  proof eventually_elim
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   405
    case (elim n)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   406
    show ?case
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   407
    proof safe
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   408
      fix x assume "x \<in> X"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   409
      have "dist (prod (f n x) (g n x)) (prod (l x) (m x)) \<le>
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   410
        norm (prod (f n x - l x) (g n x - m x)) +
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   411
        norm (prod (f n x - l x) (m x)) +
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   412
        norm (prod (l x) (g n x - m x))"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   413
        by (auto simp: dist_norm prod_diff_prod intro: order_trans norm_triangle_ineq add_mono)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   414
      also note K(2)[of "f n x - l x" "g n x - m x"]
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   415
      also from elim(1)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   416
      have "norm (f n x - l x) \<le> sqrt e / sqrt (K * 4)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   417
        by simp
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   418
      also from elim(2)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   419
      have "norm (g n x - m x) \<le> sqrt e / sqrt (K * 4)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   420
        by simp
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   421
      also have "sqrt e / sqrt (K * 4) * (sqrt e / sqrt (K * 4)) * K = e / 4"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   422
        using \<open>K > 0\<close> \<open>e > 0\<close> by auto
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   423
      also note K(2)[of "f n x - l x" "m x"]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   424
      also note K(2)[of "l x" "g n x - m x"]
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   425
      also from elim(3)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   426
      have "norm (f n x - l x) \<le> e / (K * Km * 4)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   427
        by simp
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   428
      also from elim(4)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   429
      have "norm (g n x - m x) \<le> e / (K * Kl * 4)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   430
        by simp
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   431
      also note Kl(2)[OF \<open>_ \<in> X\<close>]
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   432
      also note Km(2)[OF \<open>_ \<in> X\<close>]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   433
      also have "e / (K * Km * 4) * Km * K = e / 4"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   434
        using \<open>K > 0\<close> \<open>Km > 0\<close> by simp
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   435
      also have " Kl * (e / (K * Kl * 4)) * K = e / 4"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   436
        using \<open>K > 0\<close> \<open>Kl > 0\<close> by simp
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   437
      also have "e / 4 + e / 4 + e / 4 < e" using \<open>e > 0\<close> by simp
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   438
      finally show "dist (prod (f n x) (g n x)) (prod (l x) (m x)) < e"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   439
        using \<open>K > 0\<close> \<open>Kl > 0\<close> \<open>Km > 0\<close> \<open>e > 0\<close>
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   440
        by (simp add: algebra_simps mult_right_mono divide_right_mono)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   441
    qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   442
  qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   443
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   444
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   445
lemmas bounded_bilinear_bounded_uniform_limit_intros[uniform_limit_intros] =
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   446
  bounded_bilinear.bounded_uniform_limit[OF Inner_Product.bounded_bilinear_inner]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   447
  bounded_bilinear.bounded_uniform_limit[OF Real_Vector_Spaces.bounded_bilinear_mult]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   448
  bounded_bilinear.bounded_uniform_limit[OF Real_Vector_Spaces.bounded_bilinear_scaleR]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   449
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   450
lemma metric_uniform_limit_imp_uniform_limit:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   451
  assumes f: "uniform_limit S f a F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   452
  assumes le: "eventually (\<lambda>x. \<forall>y\<in>S. dist (g x y) (b y) \<le> dist (f x y) (a y)) F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   453
  shows "uniform_limit S g b F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   454
proof (rule uniform_limitI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   455
  fix e :: real assume "0 < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   456
  from uniform_limitD[OF f this] le
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   457
  show "\<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (g x y) (b y) < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   458
    by eventually_elim force
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   459
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   460
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   461
lemma uniform_limit_null_comparison:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   462
  assumes "\<forall>\<^sub>F x in F. \<forall>a\<in>S. norm (f x a) \<le> g x a"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   463
  assumes "uniform_limit S g (\<lambda>_. 0) F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   464
  shows "uniform_limit S f (\<lambda>_. 0) F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   465
  using assms(2)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   466
proof (rule metric_uniform_limit_imp_uniform_limit)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   467
  show "\<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (f x y) 0 \<le> dist (g x y) 0"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
   468
    using assms(1) by (rule eventually_mono) (force simp add: dist_norm)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   469
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   470
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   471
lemma uniform_limit_on_union:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   472
  "uniform_limit I f g F \<Longrightarrow> uniform_limit J f g F \<Longrightarrow> uniform_limit (I \<union> J) f g F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   473
  by (auto intro!: uniform_limitI dest!: uniform_limitD elim: eventually_elim2)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   474
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   475
lemma uniform_limit_on_empty:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   476
  "uniform_limit {} f g F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   477
  by (auto intro!: uniform_limitI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   478
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   479
lemma uniform_limit_on_UNION:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   480
  assumes "finite S"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   481
  assumes "\<And>s. s \<in> S \<Longrightarrow> uniform_limit (h s) f g F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   482
  shows "uniform_limit (UNION S h) f g F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   483
  using assms
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   484
  by induct (auto intro: uniform_limit_on_empty uniform_limit_on_union)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   485
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   486
lemma uniform_limit_on_Union:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   487
  assumes "finite I"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   488
  assumes "\<And>J. J \<in> I \<Longrightarrow> uniform_limit J f g F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   489
  shows "uniform_limit (Union I) f g F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   490
  by (metis SUP_identity_eq assms uniform_limit_on_UNION)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   491
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   492
lemma uniform_limit_on_subset:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   493
  "uniform_limit J f g F \<Longrightarrow> I \<subseteq> J \<Longrightarrow> uniform_limit I f g F"
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
   494
  by (auto intro!: uniform_limitI dest!: uniform_limitD intro: eventually_mono)
61552
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   495
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   496
lemma uniformly_convergent_add:
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   497
  "uniformly_convergent_on A f \<Longrightarrow> uniformly_convergent_on A g\<Longrightarrow>
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   498
      uniformly_convergent_on A (\<lambda>k x. f k x + g k x :: 'a :: {real_normed_algebra})"
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   499
  unfolding uniformly_convergent_on_def by (blast dest: uniform_limit_add)
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   500
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   501
lemma uniformly_convergent_minus:
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   502
  "uniformly_convergent_on A f \<Longrightarrow> uniformly_convergent_on A g\<Longrightarrow>
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   503
      uniformly_convergent_on A (\<lambda>k x. f k x - g k x :: 'a :: {real_normed_algebra})"
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   504
  unfolding uniformly_convergent_on_def by (blast dest: uniform_limit_minus)
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   505
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   506
lemma uniformly_convergent_mult:
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   507
  "uniformly_convergent_on A f \<Longrightarrow> 
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   508
      uniformly_convergent_on A (\<lambda>k x. c * f k x :: 'a :: {real_normed_algebra})"
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   509
  unfolding uniformly_convergent_on_def
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   510
  by (blast dest: bounded_linear_uniform_limit_intros(13))
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   511
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   512
end