src/HOL/Analysis/Uniform_Limit.thy
author paulson <lp15@cam.ac.uk>
Thu, 03 Apr 2025 21:08:36 +0100
changeset 82395 918c50e0447e
parent 82353 e3a0128f4905
permissions -rw-r--r--
Lemmas from Manuel Eberl's Q_Analogues
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
63627
6ddb43c6b711 rename HOL-Multivariate_Analysis to HOL-Analysis.
hoelzl
parents: 63594
diff changeset
     1
(*  Title:      HOL/Analysis/Uniform_Limit.thy
60812
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
77434
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
     9
imports Connected Summation_Tests Infinite_Sum
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    10
begin
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    11
68838
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
    12
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
    13
subsection \<open>Definition\<close>
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
    14
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69597
diff changeset
    15
definition\<^marker>\<open>tag important\<close> uniformly_on :: "'a set \<Rightarrow> ('a \<Rightarrow> 'b::metric_space) \<Rightarrow> ('a \<Rightarrow> 'b) filter"
69260
0a9688695a1b removed relics of ASCII syntax for indexed big operators
haftmann
parents: 68838
diff changeset
    16
  where "uniformly_on S l = (INF e\<in>{0 <..}. principal {f. \<forall>x\<in>S. dist (f x) (l x) < e})"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    17
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69597
diff changeset
    18
abbreviation\<^marker>\<open>tag important\<close>
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    19
  "uniform_limit S f l \<equiv> filterlim f (uniformly_on S l)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    20
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
    21
definition uniformly_convergent_on where
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
    22
  "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
    23
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
    24
definition uniformly_Cauchy_on where
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
    25
  "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)"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
    26
68838
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
    27
proposition uniform_limit_iff:
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    28
  "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
    29
  unfolding filterlim_iff uniformly_on_def
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    30
  by (subst eventually_INF_base)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    31
    (fastforce
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    32
      simp: eventually_principal uniformly_on_def
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    33
      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
    34
      elim: eventually_mono)+
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    35
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    36
lemma uniform_limitD:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    37
  "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
    38
  by (simp add: uniform_limit_iff)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    39
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    40
lemma uniform_limitI:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    41
  "(\<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
    42
  by (simp add: uniform_limit_iff)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    43
82353
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    44
lemma uniform_limit_on_subset:
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    45
  "uniform_limit J f g F \<Longrightarrow> I \<subseteq> J \<Longrightarrow> uniform_limit I f g F"
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    46
  by (auto intro!: uniform_limitI dest!: uniform_limitD intro: eventually_mono)
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    47
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    48
lemma uniformly_convergent_on_subset:
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    49
  assumes "uniformly_convergent_on A f" "B \<subseteq> A"
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    50
  shows   "uniformly_convergent_on B f"
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    51
  using assms by (meson uniform_limit_on_subset uniformly_convergent_on_def)
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    52
82351
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    53
lemma uniform_limit_singleton [simp]: "uniform_limit {x} f g F \<longleftrightarrow> ((\<lambda>n. f n x) \<longlongrightarrow> g x) F"
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    54
  by (simp add: uniform_limit_iff tendsto_iff)
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    55
82353
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    56
lemma uniformly_convergent_on_singleton:
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    57
  "uniformly_convergent_on {x} f \<longleftrightarrow> convergent (\<lambda>n. f n x)"
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    58
  by (auto simp: uniformly_convergent_on_def convergent_def)
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
    59
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    60
lemma uniform_limit_sequentially_iff:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    61
  "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
    62
  unfolding uniform_limit_iff eventually_sequentially ..
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    63
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    64
lemma uniform_limit_at_iff:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    65
  "uniform_limit S f l (at x) \<longleftrightarrow>
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    66
    (\<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))"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
    67
  unfolding uniform_limit_iff eventually_at by simp
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    68
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    69
lemma uniform_limit_at_le_iff:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    70
  "uniform_limit S f l (at x) \<longleftrightarrow>
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    71
    (\<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))"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
    72
  unfolding uniform_limit_iff eventually_at
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    73
  by (fastforce dest: spec[where x = "e / 2" for e])
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
    74
78698
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    75
lemma uniform_limit_compose:
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    76
  assumes ul: "uniform_limit X g l F"  
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    77
    and cont: "uniformly_continuous_on U f"
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    78
    and g: "\<forall>\<^sub>F n in F. g n ` X \<subseteq> U" and l: "l ` X \<subseteq> U"
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    79
  shows "uniform_limit X (\<lambda>a b. f (g a b)) (f \<circ> l) F"
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    80
proof (rule uniform_limitI)
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    81
  fix \<epsilon>::real
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    82
  assume "0 < \<epsilon>" 
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    83
  then obtain \<delta> where "\<delta> > 0" and \<delta>: "\<And>u v. \<lbrakk>u\<in>U; v\<in>U; dist u v < \<delta>\<rbrakk> \<Longrightarrow> dist (f u) (f v) < \<epsilon>"
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    84
    by (metis cont uniformly_continuous_on_def)
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    85
  show "\<forall>\<^sub>F n in F. \<forall>x\<in>X. dist (f (g n x)) ((f \<circ> l) x) < \<epsilon>"
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    86
    using uniform_limitD [OF ul \<open>\<delta>>0\<close>] g unfolding o_def
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    87
    by eventually_elim (use \<delta> l in blast)
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    88
qed
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
    89
82351
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    90
lemma uniform_limit_compose':
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    91
  assumes "uniform_limit A f g F" and "h \<in> B \<rightarrow> A"
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    92
  shows   "uniform_limit B (\<lambda>n x. f n (h x)) (\<lambda>x. g (h x)) F"
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    93
  unfolding uniform_limit_iff
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    94
proof (intro strip)
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    95
  fix e :: real
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    96
  assume e: "e > 0"
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    97
  with assms(1) have "\<forall>\<^sub>F n in F. \<forall>x\<in>A. dist (f n x) (g x) < e"
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    98
    by (auto simp: uniform_limit_iff)
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
    99
  thus "\<forall>\<^sub>F n in F. \<forall>x\<in>B. dist (f n (h x)) (g (h x)) < e"
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
   100
    by eventually_elim (use assms(2) in blast)
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
   101
qed
882b80bd10c8 More from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 82349
diff changeset
   102
62949
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   103
lemma metric_uniform_limit_imp_uniform_limit:
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   104
  assumes f: "uniform_limit S f a F"
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   105
  assumes le: "eventually (\<lambda>x. \<forall>y\<in>S. dist (g x y) (b y) \<le> dist (f x y) (a y)) F"
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   106
  shows "uniform_limit S g b F"
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   107
proof (rule uniform_limitI)
78698
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
   108
  fix e :: real 
1b9388e6eb75 A few new theorems
paulson <lp15@cam.ac.uk>
parents: 77434
diff changeset
   109
  assume "0 < e"
62949
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   110
  from uniform_limitD[OF f this] le
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   111
  show "\<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (g x y) (b y) < e"
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   112
    by eventually_elim force
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   113
qed
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   114
68838
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
   115
subsection \<open>Exchange limits\<close>
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   116
proposition swap_uniform_limit':
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   117
  assumes f: "\<forall>\<^sub>F n in F. (f n \<longlongrightarrow> g n) G"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
   118
  assumes g: "(g \<longlongrightarrow> l) F"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   119
  assumes uc: "uniform_limit S f h F"
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   120
  assumes ev: "\<forall>\<^sub>F x in G. x \<in> S"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   121
  assumes "\<not>trivial_limit F"
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   122
  shows "(h \<longlongrightarrow> l) G"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   123
proof (rule tendstoI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   124
  fix e :: real
63040
eb4ddd18d635 eliminated old 'def';
wenzelm
parents: 62949
diff changeset
   125
  define e' where "e' = e/3"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   126
  assume "0 < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   127
  then have "0 < e'" by (simp add: e'_def)
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   128
  from uniform_limitD[OF uc \<open>0 < e'\<close>]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   129
  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
   130
    by (simp add: dist_commute)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   131
  moreover
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   132
  from f
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   133
  have "\<forall>\<^sub>F n in F. \<forall>\<^sub>F x in G. dist (g n) (f n x) < e'"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   134
    by eventually_elim (auto dest!: tendstoD[OF _ \<open>0 < e'\<close>] simp: dist_commute)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   135
  moreover
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   136
  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
   137
    by (simp add: dist_commute)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   138
  ultimately
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   139
  have "\<forall>\<^sub>F _ in F. \<forall>\<^sub>F x in G. dist (h x) l < e"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   140
  proof eventually_elim
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   141
    case (elim n)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   142
    note fh = elim(1)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   143
    note gl = elim(3)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   144
    show ?case
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   145
      using elim(2) ev
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   146
    proof eventually_elim
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   147
      case (elim x)
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   148
      from fh[rule_format, OF \<open>x \<in> S\<close>] elim(1)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   149
      have "dist (h x) (g n) < e' + e'"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   150
        by (rule dist_triangle_lt[OF add_strict_mono])
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   151
      from dist_triangle_lt[OF add_strict_mono, OF this gl]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   152
      show ?case by (simp add: e'_def)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   153
    qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   154
  qed
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   155
  thus "\<forall>\<^sub>F x in G. dist (h x) l < e"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   156
    using eventually_happens by (metis \<open>\<not>trivial_limit F\<close>)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   157
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   158
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   159
corollary swap_uniform_limit:
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   160
  assumes "\<forall>\<^sub>F n in F. (f n \<longlongrightarrow> g n) (at x within S)"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   161
  assumes "(g \<longlongrightarrow> l) F" "uniform_limit S f h F" "\<not>trivial_limit F"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   162
  shows "(h \<longlongrightarrow> l) (at x within S)"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   163
  using swap_uniform_limit' eventually_at_topological assms
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   164
  by blast 
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
   165
68838
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
   166
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
   167
subsection \<open>Uniform limit theorem\<close>
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
   168
67371
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   169
lemma tendsto_uniform_limitI:
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   170
  assumes "uniform_limit S f l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   171
  assumes "x \<in> S"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
   172
  shows "((\<lambda>y. f y x) \<longlongrightarrow> l x) F"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   173
  using assms
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
   174
  by (auto intro!: tendstoI simp: eventually_mono dest!: uniform_limitD)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   175
68838
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
   176
theorem uniform_limit_theorem:
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   177
  assumes c: "\<forall>\<^sub>F n in F. continuous_on A (f n)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   178
  assumes ul: "uniform_limit A f l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   179
  assumes "\<not> trivial_limit F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   180
  shows "continuous_on A l"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   181
  unfolding continuous_on_def
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   182
proof safe
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   183
  fix x assume "x \<in> A"
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
   184
  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
   185
    using c ul
61810
3c5040d5694a sorted out eventually_mono
paulson <lp15@cam.ac.uk>
parents: 61808
diff changeset
   186
    by (auto simp: continuous_on_def eventually_mono tendsto_uniform_limitI)
61973
0c7e865fa7cb more symbols;
wenzelm
parents: 61969
diff changeset
   187
  then show "(l \<longlongrightarrow> l x) (at x within A)"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   188
    by (rule swap_uniform_limit) fact+
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   189
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   190
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   191
lemma uniformly_Cauchy_onI:
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   192
  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
   193
  shows   "uniformly_Cauchy_on X f"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   194
  using assms unfolding uniformly_Cauchy_on_def by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   195
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   196
lemma uniformly_Cauchy_onI':
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   197
  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
   198
  shows   "uniformly_Cauchy_on X f"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   199
proof (rule uniformly_Cauchy_onI)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   200
  fix e :: real assume e: "e > 0"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   201
  from assms[OF this] obtain M
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   202
    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
   203
  {
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   204
    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
   205
    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
   206
      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
   207
  }
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   208
  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
   209
qed
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   210
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   211
lemma uniformly_Cauchy_imp_Cauchy:
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   212
  "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
   213
  unfolding Cauchy_def uniformly_Cauchy_on_def by fast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   214
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   215
lemma uniform_limit_cong:
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   216
  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
   217
  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
   218
  assumes "\<And>x. x \<in> X \<Longrightarrow> h x = i x"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   219
  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
   220
proof -
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   221
  {
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   222
    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
   223
    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
   224
       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
   225
    {
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   226
      fix e ::real assume "e > 0"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   227
      with C have "eventually (\<lambda>y. \<forall>x\<in>X. dist (f y x) (h x) < e) F"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   228
        unfolding uniform_limit_iff by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   229
      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
   230
        by eventually_elim (insert B, simp_all)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   231
    }
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   232
    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
   233
  } note A = this
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   234
  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
   235
qed
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   236
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   237
lemma uniform_limit_cong':
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   238
  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
   239
  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
   240
  assumes "\<And>x. x \<in> X \<Longrightarrow> h x = i x"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   241
  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
   242
  using assms by (intro uniform_limit_cong always_eventually) blast+
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   243
67371
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   244
lemma uniformly_convergent_cong:
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   245
  assumes "eventually (\<lambda>x. \<forall>y\<in>A. f x y = g x y) sequentially" "A = B"
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   246
  shows "uniformly_convergent_on A f \<longleftrightarrow> uniformly_convergent_on B g"
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   247
  unfolding uniformly_convergent_on_def assms(2) [symmetric]
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   248
  by (intro iff_exI uniform_limit_cong eventually_mono [OF assms(1)]) auto
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   249
76722
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   250
lemma uniformly_convergent_on_compose:
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   251
  assumes "uniformly_convergent_on A f"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   252
  assumes "filterlim g sequentially sequentially"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   253
  shows   "uniformly_convergent_on A (\<lambda>n. f (g n))"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   254
proof -
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   255
  from assms(1) obtain f' where "uniform_limit A f f' sequentially"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   256
    by (auto simp: uniformly_convergent_on_def)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   257
  hence "uniform_limit A (\<lambda>n. f (g n)) f' sequentially"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   258
    by (rule filterlim_compose) fact
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   259
  thus ?thesis
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   260
    by (auto simp: uniformly_convergent_on_def)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   261
qed    
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   262
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   263
lemma uniformly_convergent_uniform_limit_iff:
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   264
  "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
   265
proof
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   266
  assume "uniformly_convergent_on X f"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   267
  then obtain l where l: "uniform_limit X f l sequentially"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   268
    unfolding uniformly_convergent_on_def by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   269
  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
   270
                      uniform_limit X f l sequentially"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   271
    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
   272
  also note l
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   273
  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
   274
qed (auto simp: uniformly_convergent_on_def)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   275
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   276
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
   277
  unfolding uniformly_convergent_on_def by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   278
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   279
lemma uniformly_convergent_on_empty [iff]: "uniformly_convergent_on {} f"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   280
  by (simp add: uniformly_convergent_on_def uniform_limit_sequentially_iff)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   281
67371
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   282
lemma uniformly_convergent_on_const [simp,intro]:
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   283
  "uniformly_convergent_on A (\<lambda>_. c)"
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   284
  by (auto simp: uniformly_convergent_on_def uniform_limit_iff intro!: exI[of _ c])
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   285
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   286
text\<open>Cauchy-type criteria for uniform convergence.\<close>
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   287
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   288
lemma Cauchy_uniformly_convergent:
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   289
  fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b :: complete_space"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   290
  assumes "uniformly_Cauchy_on X f"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   291
  shows   "uniformly_convergent_on X f"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   292
unfolding uniformly_convergent_uniform_limit_iff uniform_limit_iff
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   293
proof safe
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   294
  let ?f = "\<lambda>x. lim (\<lambda>n. f n x)"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   295
  fix e :: real assume e: "e > 0"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   296
  hence "e/2 > 0" by simp
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   297
  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
   298
    unfolding uniformly_Cauchy_on_def by fast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   299
  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
   300
    using eventually_ge_at_top[of N]
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   301
  proof eventually_elim
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   302
    fix n assume n: "n \<ge> N"
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   303
    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
   304
    proof
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   305
      fix x assume x: "x \<in> X"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   306
      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
   307
        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
   308
      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
   309
        by (intro tendstoD eventually_conj eventually_ge_at_top)
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   310
      then obtain m where m: "m \<ge> N" "dist (f m x) (?f x) < e/2"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   311
        unfolding eventually_at_top_linorder by blast
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   312
      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
   313
          by (rule dist_triangle)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   314
      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
   315
      finally show "dist (f n x) (?f x) < e" by simp
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   316
    qed
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   317
  qed
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   318
qed
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   319
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   320
lemma uniformly_convergent_Cauchy:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   321
  assumes "uniformly_convergent_on X f"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   322
  shows "uniformly_Cauchy_on X f"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   323
proof (rule uniformly_Cauchy_onI)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   324
  fix e::real assume "e > 0"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   325
  then have "0 < e / 2" by simp
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   326
  with assms[unfolded uniformly_convergent_on_def uniform_limit_sequentially_iff]
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   327
  obtain l N where l:"x \<in> X \<Longrightarrow> n \<ge> N \<Longrightarrow> dist (f n x) (l x) < e / 2" for n x
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   328
    by metis
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   329
  from l l have "x \<in> X \<Longrightarrow> n \<ge> N \<Longrightarrow> m \<ge> N \<Longrightarrow> dist (f n x) (f m x) < e" for n m x
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   330
    by (rule dist_triangle_half_l)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   331
  then show "\<exists>M. \<forall>x\<in>X. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e" by blast
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   332
qed
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   333
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   334
lemma uniformly_convergent_eq_Cauchy:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   335
  "uniformly_convergent_on X f = uniformly_Cauchy_on X f" for f::"nat \<Rightarrow> 'b \<Rightarrow> 'a::complete_space"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   336
  using Cauchy_uniformly_convergent uniformly_convergent_Cauchy by blast
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   337
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   338
lemma uniformly_convergent_eq_cauchy:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   339
  fixes s::"nat \<Rightarrow> 'b \<Rightarrow> 'a::complete_space"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   340
  shows
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   341
    "(\<exists>l. \<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist(s n x)(l x) < e) \<longleftrightarrow>
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   342
      (\<forall>e>0. \<exists>N. \<forall>m n x. N \<le> m \<and> N \<le> n \<and> P x  \<longrightarrow> dist (s m x) (s n x) < e)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   343
proof -
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   344
  have *: "(\<forall>n\<ge>N. \<forall>x. Q x \<longrightarrow> R n x) \<longleftrightarrow> (\<forall>n x. N \<le> n \<and> Q x \<longrightarrow> R n x)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   345
    "(\<forall>x. Q x \<longrightarrow> (\<forall>m\<ge>N. \<forall>n\<ge>N. S n m x)) \<longleftrightarrow> (\<forall>m n x. N \<le> m \<and> N \<le> n \<and> Q x \<longrightarrow> S n m x)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   346
    for N::nat and Q::"'b \<Rightarrow> bool" and R S
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   347
    by blast+
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   348
  show ?thesis
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   349
    using uniformly_convergent_eq_Cauchy[of "Collect P" s]
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   350
    unfolding uniformly_convergent_on_def uniformly_Cauchy_on_def uniform_limit_sequentially_iff
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   351
    by (simp add: *)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   352
qed
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   353
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   354
lemma uniformly_cauchy_imp_uniformly_convergent:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   355
  fixes s :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::complete_space"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   356
  assumes "\<forall>e>0.\<exists>N. \<forall>m (n::nat) x. N \<le> m \<and> N \<le> n \<and> P x --> dist(s m x)(s n x) < e"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   357
    and "\<forall>x. P x --> (\<forall>e>0. \<exists>N. \<forall>n. N \<le> n \<longrightarrow> dist(s n x)(l x) < e)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   358
  shows "\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist(s n x)(l x) < e"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   359
proof -
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   360
  obtain l' where l:"\<forall>e>0. \<exists>N. \<forall>n x. N \<le> n \<and> P x \<longrightarrow> dist (s n x) (l' x) < e"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   361
    using assms(1) unfolding uniformly_convergent_eq_cauchy[symmetric] by auto
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   362
  moreover
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   363
  {
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   364
    fix x
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   365
    assume "P x"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   366
    then have "l x = l' x"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   367
      using tendsto_unique[OF trivial_limit_sequentially, of "\<lambda>n. s n x" "l x" "l' x"]
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   368
      using l and assms(2) unfolding lim_sequentially by blast
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   369
  }
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   370
  ultimately show ?thesis by auto
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   371
qed
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   372
76722
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   373
lemma uniformly_convergent_on_sum_E:
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   374
  fixes \<epsilon>::real and f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_space,real_normed_vector}"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   375
  assumes uconv: "uniformly_convergent_on K (\<lambda>n z. \<Sum>k<n. f k z)" and "\<epsilon>>0"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   376
  obtains N where "\<And>m n z. \<lbrakk>N \<le> m; m \<le> n; z\<in>K\<rbrakk> \<Longrightarrow> norm(\<Sum>k=m..<n. f k z) < \<epsilon>"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   377
proof -
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   378
  obtain N where N: "\<And>m n z. \<lbrakk>N \<le> m; N \<le> n; z\<in>K\<rbrakk> \<Longrightarrow> dist (\<Sum>k<m. f k z) (\<Sum>k<n. f k z) < \<epsilon>"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   379
    using uconv \<open>\<epsilon>>0\<close> unfolding uniformly_Cauchy_on_def uniformly_convergent_eq_Cauchy by meson
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   380
  show thesis
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   381
  proof
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   382
    fix m n z
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   383
    assume "N \<le> m" "m \<le> n" "z \<in> K"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   384
    moreover have "(\<Sum>k = m..<n. f k z) = (\<Sum>k<n. f k z) - (\<Sum>k<m. f k z)"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   385
      by (metis atLeast0LessThan le0 sum_diff_nat_ivl \<open>m \<le> n\<close>)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   386
    ultimately show "norm(\<Sum>k = m..<n. f k z) < \<epsilon>"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   387
      using N  by (simp add: dist_norm)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   388
  qed
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   389
qed
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   390
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   391
lemma uniformly_convergent_on_sum_iff:
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   392
  fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_space,real_normed_vector}"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   393
  shows "uniformly_convergent_on K (\<lambda>n z. \<Sum>k<n. f k z) 
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   394
     \<longleftrightarrow> (\<forall>\<epsilon>>0. \<exists>N. \<forall>m n z. N\<le>m \<longrightarrow> m\<le>n \<longrightarrow> z\<in>K \<longrightarrow> norm (\<Sum>k=m..<n. f k z) < \<epsilon>)" (is "?lhs=?rhs")
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   395
proof
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   396
  assume R: ?rhs
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   397
  show ?lhs
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   398
    unfolding uniformly_Cauchy_on_def uniformly_convergent_eq_Cauchy
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   399
  proof (intro strip)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   400
    fix \<epsilon>::real
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   401
    assume "\<epsilon>>0"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   402
    then obtain N where "\<And>m n z. \<lbrakk>N \<le> m; m \<le> n; z\<in>K\<rbrakk> \<Longrightarrow> norm(\<Sum>k = m..<n. f k z) < \<epsilon>"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   403
      using R by blast
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   404
    then have "\<forall>x\<in>K. \<forall>m\<ge>N. \<forall>n\<ge>m. norm ((\<Sum>k<m. f k x) - (\<Sum>k<n. f k x)) < \<epsilon>"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   405
      by (metis atLeast0LessThan le0 sum_diff_nat_ivl norm_minus_commute)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   406
    then have "\<forall>x\<in>K. \<forall>m\<ge>N. \<forall>n\<ge>N. norm ((\<Sum>k<m. f k x) - (\<Sum>k<n. f k x)) < \<epsilon>"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   407
      by (metis linorder_le_cases norm_minus_commute)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   408
    then show "\<exists>M. \<forall>x\<in>K. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (\<Sum>k<m. f k x) (\<Sum>k<n. f k x) < \<epsilon>"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   409
      by (metis dist_norm)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   410
  qed
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   411
qed (metis uniformly_convergent_on_sum_E)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   412
76724
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   413
lemma uniform_limit_suminf:
82353
e3a0128f4905 Manuel's material on infinite products
paulson <lp15@cam.ac.uk>
parents: 82351
diff changeset
   414
  fixes f:: "nat \<Rightarrow> 'a :: topological_space \<Rightarrow> 'b::{metric_space, comm_monoid_add}"
76724
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   415
  assumes "uniformly_convergent_on X (\<lambda>n x. \<Sum>k<n. f k x)" 
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   416
  shows "uniform_limit X (\<lambda>n x. \<Sum>k<n. f k x) (\<lambda>x. \<Sum>k. f k x) sequentially"
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   417
proof -
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   418
  obtain S where S: "uniform_limit X (\<lambda>n x. \<Sum>k<n. f k x) S sequentially"
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   419
    using assms uniformly_convergent_on_def by blast
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   420
  then have "(\<Sum>k. f k x) = S x" if "x \<in> X" for x
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   421
    using that sums_iff sums_def by (blast intro: tendsto_uniform_limitI [OF S])
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   422
  with S show ?thesis
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   423
    by (simp cong: uniform_limit_cong')
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   424
qed
7ff71bdcf731 Additional new material about infinite products, etc.
paulson <lp15@cam.ac.uk>
parents: 76722
diff changeset
   425
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   426
text \<open>TODO: remove explicit formulations
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   427
  @{thm uniformly_convergent_eq_cauchy uniformly_cauchy_imp_uniformly_convergent}?!\<close>
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   428
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   429
lemma uniformly_convergent_imp_convergent:
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   430
  "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
   431
  unfolding uniformly_convergent_on_def convergent_def
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   432
  by (auto dest: tendsto_uniform_limitI)
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   433
76722
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   434
subsection \<open>Comparison Test\<close>
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   435
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   436
lemma uniformly_summable_comparison_test:
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   437
  fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b :: banach"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   438
  assumes "uniformly_convergent_on A (\<lambda>N x. \<Sum>n<N. g n x)"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   439
  assumes "\<And>n x. x \<in> A \<Longrightarrow> norm (f n x) \<le> g n x"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   440
  shows   "uniformly_convergent_on A (\<lambda>N x. \<Sum>n<N. f n x)"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   441
proof -
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   442
  have "uniformly_Cauchy_on A (\<lambda>N x. \<Sum>n<N. f n x)"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   443
  proof (rule uniformly_Cauchy_onI')
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   444
    fix e :: real assume e: "e > 0"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   445
    obtain M where M: "\<And>x m n. x \<in> A \<Longrightarrow> m \<ge> M \<Longrightarrow> n \<ge> M \<Longrightarrow> dist (\<Sum>k<m. g k x) (\<Sum>k<n. g k x) < e"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   446
      using assms(1) e unfolding uniformly_convergent_eq_Cauchy uniformly_Cauchy_on_def by metis
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   447
    show "\<exists>M. \<forall>x\<in>A. \<forall>m\<ge>M. \<forall>n>m. dist (\<Sum>k<m. f k x) (\<Sum>k<n. f k x) < e"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   448
    proof (rule exI[of _ M], safe)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   449
      fix x m n assume xmn: "x \<in> A" "m \<ge> M" "m < n"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   450
      have nonneg: "g k x \<ge> 0" for k
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   451
        by (rule order.trans[OF _ assms(2)]) (use xmn in auto)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   452
      have "dist (\<Sum>k<m. f k x) (\<Sum>k<n. f k x) = norm (\<Sum>k\<in>{..<n}-{..<m}. f k x)"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   453
        using xmn by (subst sum_diff) (auto simp: dist_norm norm_minus_commute)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   454
      also have "{..<n}-{..<m} = {m..<n}"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   455
        by auto
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   456
      also have "norm (\<Sum>k\<in>{m..<n}. f k x) \<le> (\<Sum>k\<in>{m..<n}. norm (f k x))"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   457
        using norm_sum by blast
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   458
      also have "\<dots> \<le> (\<Sum>k\<in>{m..<n}. g k x)"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   459
        by (intro sum_mono assms xmn)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   460
      also have "\<dots> = \<bar>\<Sum>k\<in>{m..<n}. g k x\<bar>"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   461
        by (subst abs_of_nonneg) (auto simp: nonneg intro!: sum_nonneg)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   462
      also have "{m..<n} = {..<n} - {..<m}"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   463
        by auto
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   464
      also have "\<bar>\<Sum>k\<in>\<dots>. g k x\<bar> = dist (\<Sum>k<m. g k x) (\<Sum>k<n. g k x)"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   465
        using xmn by (subst sum_diff) (auto simp: abs_minus_commute dist_norm)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   466
      also have "\<dots> < e"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   467
        by (rule M) (use xmn in auto)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   468
      finally show "dist (\<Sum>k<m. f k x) (\<Sum>k<n. f k x) < e" .
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   469
    qed
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   470
  qed
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   471
  thus ?thesis
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   472
    unfolding uniformly_convergent_eq_Cauchy .
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   473
qed
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   474
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   475
lemma uniform_limit_compose_uniformly_continuous_on:
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   476
  fixes f :: "'a :: metric_space \<Rightarrow> 'b :: metric_space"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   477
  assumes lim: "uniform_limit A g g' F"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   478
  assumes cont: "uniformly_continuous_on B f"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   479
  assumes ev: "eventually (\<lambda>x. \<forall>y\<in>A. g x y \<in> B) F" and "closed B"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   480
  shows   "uniform_limit A (\<lambda>x y. f (g x y)) (\<lambda>y. f (g' y)) F"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   481
proof (cases "F = bot")
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   482
  case [simp]: False
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   483
  show ?thesis
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   484
    unfolding uniform_limit_iff
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   485
  proof safe
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   486
    fix e :: real assume e: "e > 0"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   487
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   488
    have g'_in_B: "g' y \<in> B" if "y \<in> A" for y
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   489
    proof (rule Lim_in_closed_set)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   490
      show "eventually (\<lambda>x. g x y \<in> B) F"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   491
        using ev by eventually_elim (use that in auto)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   492
      show "((\<lambda>x. g x y) \<longlongrightarrow> g' y) F"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   493
        using lim that by (metis tendsto_uniform_limitI)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   494
    qed (use \<open>closed B\<close> in auto)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   495
  
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   496
    obtain d where d: "d > 0" "\<And>x y. x \<in> B \<Longrightarrow> y \<in> B \<Longrightarrow> dist x y < d \<Longrightarrow> dist (f x) (f y) < e"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   497
      using e cont unfolding uniformly_continuous_on_def by metis
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   498
    from lim have "eventually (\<lambda>x. \<forall>y\<in>A. dist (g x y) (g' y) < d) F"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   499
      unfolding uniform_limit_iff using \<open>d > 0\<close>  by meson
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   500
    thus "eventually (\<lambda>x. \<forall>y\<in>A. dist (f (g x y)) (f (g' y)) < e) F"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   501
      using assms(3)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   502
    proof eventually_elim
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   503
      case (elim x)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   504
      show "\<forall>y\<in>A. dist (f (g x y)) (f (g' y)) < e"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   505
      proof safe
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   506
        fix y assume y: "y \<in> A"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   507
        show "dist (f (g x y)) (f (g' y)) < e"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   508
        proof (rule d)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   509
          show "dist (g x y) (g' y) < d"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   510
            using elim y by blast
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   511
        qed (use y elim g'_in_B in auto)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   512
      qed
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   513
    qed
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   514
  qed
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   515
qed (auto simp: filterlim_def)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   516
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   517
lemma uniformly_convergent_on_compose_uniformly_continuous_on:
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   518
  fixes f :: "'a :: metric_space \<Rightarrow> 'b :: metric_space"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   519
  assumes lim: "uniformly_convergent_on A g"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   520
  assumes cont: "uniformly_continuous_on B f"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   521
  assumes ev: "eventually (\<lambda>x. \<forall>y\<in>A. g x y \<in> B) sequentially" and "closed B"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   522
  shows   "uniformly_convergent_on A (\<lambda>x y. f (g x y))"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   523
proof -
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   524
  from lim obtain g' where g': "uniform_limit A g g' sequentially"
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   525
    by (auto simp: uniformly_convergent_on_def)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   526
  thus ?thesis
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   527
    using uniform_limit_compose_uniformly_continuous_on[OF g' cont ev \<open>closed B\<close>]
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   528
    by (auto simp: uniformly_convergent_on_def)
b1d57dd345e1 First round of moving material from the number theory development
paulson <lp15@cam.ac.uk>
parents: 73932
diff changeset
   529
qed
68838
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
   530
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
   531
subsection \<open>Weierstrass M-Test\<close>
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
   532
69529
4ab9657b3257 capitalize proper names in lemma names
nipkow
parents: 69313
diff changeset
   533
proposition Weierstrass_m_test_ev:
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   534
fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   535
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
   536
assumes "summable M"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   537
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
   538
proof (rule uniform_limitI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   539
  fix e :: real
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   540
  assume "0 < e"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   541
  from suminf_exist_split[OF \<open>0 < e\<close> \<open>summable M\<close>]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   542
  have "\<forall>\<^sub>F k in sequentially. norm (\<Sum>i. M (i + k)) < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   543
    by (auto simp: eventually_sequentially)
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   544
  with eventually_all_ge_at_top[OF assms(1)]
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   545
    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
   546
  proof eventually_elim
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   547
    case (elim k)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   548
    show ?case
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   549
    proof safe
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   550
      fix x assume "x \<in> A"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   551
      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
   552
        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
   553
      hence summable_norm_f: "summable (\<lambda>n. norm (f n x))"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   554
        by(rule summable_norm_comparison_test[OF _ \<open>summable M\<close>])
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   555
      have summable_f: "summable (\<lambda>n. f n x)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   556
        using summable_norm_cancel[OF summable_norm_f] .
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   557
      have summable_norm_f_plus_k: "summable (\<lambda>i. norm (f (i + k) x))"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   558
        using summable_ignore_initial_segment[OF summable_norm_f]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   559
        by auto
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   560
      have summable_M_plus_k: "summable (\<lambda>i. M (i + k))"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   561
        using summable_ignore_initial_segment[OF \<open>summable M\<close>]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   562
        by auto
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   563
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   564
      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
   565
        using dist_norm dist_commute by (subst dist_commute)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   566
      also have "... = norm (\<Sum>i. f (i + k) x)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   567
        using suminf_minus_initial_segment[OF summable_f, where k=k] by simp
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   568
      also have "... \<le> (\<Sum>i. norm (f (i + k) x))"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   569
        using summable_norm[OF summable_norm_f_plus_k] .
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   570
      also have "... \<le> (\<Sum>i. M (i + k))"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   571
        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
   572
           (insert elim(1) \<open>x \<in> A\<close>, simp)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   573
      finally show "dist (\<Sum>i<k. f i x) (\<Sum>i. f i x) < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   574
        using elim by auto
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   575
    qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   576
  qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   577
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   578
62175
8ffc4d0e652d isabelle update_cartouches -c -t;
wenzelm
parents: 62131
diff changeset
   579
text\<open>Alternative version, formulated as in HOL Light\<close>
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69597
diff changeset
   580
corollary\<^marker>\<open>tag unimportant\<close> series_comparison_uniform:
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   581
  fixes f :: "_ \<Rightarrow> nat \<Rightarrow> _ :: banach"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   582
  assumes g: "summable g" and le: "\<And>n x. N \<le> n \<and> x \<in> A \<Longrightarrow> norm(f x n) \<le> g n"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63627
diff changeset
   583
    shows "\<exists>l. \<forall>e. 0 < e \<longrightarrow> (\<exists>N. \<forall>n x. N \<le> n \<and> x \<in> A \<longrightarrow> dist(sum (f x) {..<n}) (l x) < e)"
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   584
proof -
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   585
  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
   586
    using le eventually_sequentially by auto
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   587
  show ?thesis
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   588
    apply (rule_tac x="(\<lambda>x. \<Sum>i. f x i)" in exI)
69529
4ab9657b3257 capitalize proper names in lemma names
nipkow
parents: 69313
diff changeset
   589
    apply (metis (no_types, lifting) eventually_sequentially uniform_limitD [OF Weierstrass_m_test_ev [OF 1 g]])
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   590
    done
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   591
qed
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   592
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69597
diff changeset
   593
corollary\<^marker>\<open>tag unimportant\<close> Weierstrass_m_test:
62131
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   594
  fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   595
  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
   596
  assumes "summable M"
1baed43f453e nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
paulson
parents: 61973
diff changeset
   597
  shows "uniform_limit A (\<lambda>n x. \<Sum>i<n. f i x) (\<lambda>x. suminf (\<lambda>i. f i x)) sequentially"
69529
4ab9657b3257 capitalize proper names in lemma names
nipkow
parents: 69313
diff changeset
   598
  using assms by (intro Weierstrass_m_test_ev always_eventually) auto
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   599
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69597
diff changeset
   600
corollary\<^marker>\<open>tag unimportant\<close> Weierstrass_m_test'_ev:
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   601
  fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   602
  assumes "eventually (\<lambda>n. \<forall>x\<in>A. norm (f n x) \<le> M n) sequentially" "summable M"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   603
  shows   "uniformly_convergent_on A (\<lambda>n x. \<Sum>i<n. f i x)"
69529
4ab9657b3257 capitalize proper names in lemma names
nipkow
parents: 69313
diff changeset
   604
  unfolding uniformly_convergent_on_def by (rule exI, rule Weierstrass_m_test_ev[OF assms])
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   605
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69597
diff changeset
   606
corollary\<^marker>\<open>tag unimportant\<close> Weierstrass_m_test':
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   607
  fixes f :: "_ \<Rightarrow> _ \<Rightarrow> _ :: banach"
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   608
  assumes "\<And>n x. x \<in> A \<Longrightarrow> norm (f n x) \<le> M n" "summable M"
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   609
  shows   "uniformly_convergent_on A (\<lambda>n x. \<Sum>i<n. f i x)"
69529
4ab9657b3257 capitalize proper names in lemma names
nipkow
parents: 69313
diff changeset
   610
  unfolding uniformly_convergent_on_def by (rule exI, rule Weierstrass_m_test[OF assms])
61531
ab2e862263e7 Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents: 61222
diff changeset
   611
77434
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   612
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   613
lemma Weierstrass_m_test_general:
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   614
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c :: banach"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   615
  fixes M :: "'a \<Rightarrow> real"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   616
  assumes norm_le:  "\<And>x y. x \<in> X \<Longrightarrow> y \<in> Y \<Longrightarrow> norm (f x y) \<le> M x"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   617
  assumes summable: "M summable_on X"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   618
  shows "uniform_limit Y (\<lambda>X y. \<Sum>x\<in>X. f x y) (\<lambda>y. \<Sum>\<^sub>\<infinity>x\<in>X. f x y) (finite_subsets_at_top X)"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   619
proof (rule uniform_limitI)
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   620
  fix \<epsilon> :: real
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   621
  assume "\<epsilon> > 0"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   622
  define S where "S = (\<lambda>y. \<Sum>\<^sub>\<infinity>x\<in>X. f x y)"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   623
  have S: "((\<lambda>x. f x y) has_sum S y) X" if y: "y \<in> Y" for y
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   624
    unfolding S_def 
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   625
  proof (rule has_sum_infsum)
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   626
    have "(\<lambda>x. norm (f x y)) summable_on X"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   627
      by (rule abs_summable_on_comparison_test'[OF summable norm_le]) (use y in auto)
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   628
    thus "(\<lambda>x. f x y) summable_on X"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   629
      by (metis abs_summable_summable)
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   630
  qed
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   631
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   632
  define T where "T = (\<Sum>\<^sub>\<infinity>x\<in>X. M x)"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   633
  have T: "(M has_sum T) X"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   634
    unfolding T_def by (simp add: local.summable)
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   635
  have M_summable: "M summable_on X'" if "X' \<subseteq> X" for X'
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   636
    using local.summable summable_on_subset_banach that by blast
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   637
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   638
  have f_summable: "(\<lambda>x. f x y) summable_on X'" if "X' \<subseteq> X" "y \<in> Y" for X' y
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   639
    using S summable_on_def summable_on_subset_banach that by blast
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   640
  have "eventually (\<lambda>X'. dist (\<Sum>x\<in>X'. M x) T < \<epsilon>) (finite_subsets_at_top X)"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   641
    using T \<open>\<epsilon> > 0\<close> unfolding T_def has_sum_def tendsto_iff by blast
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   642
  moreover have "eventually (\<lambda>X'. finite X' \<and> X' \<subseteq> X) (finite_subsets_at_top X)"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   643
    by (simp add: eventually_finite_subsets_at_top_weakI)
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   644
  ultimately show "\<forall>\<^sub>F X' in finite_subsets_at_top X. \<forall>y\<in>Y. dist (\<Sum>x\<in>X'. f x y) (\<Sum>\<^sub>\<infinity>x\<in>X. f x y) < \<epsilon>"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   645
  proof eventually_elim
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   646
    case X': (elim X')
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   647
    show "\<forall>y\<in>Y. dist (\<Sum>x\<in>X'. f x y) (\<Sum>\<^sub>\<infinity>x\<in>X. f x y) < \<epsilon>"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   648
    proof
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   649
      fix y assume y: "y \<in> Y"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   650
      have 1: "((\<lambda>x. f x y) has_sum (S y - (\<Sum>x\<in>X'. f x y))) (X - X')"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   651
        using X' y by (intro has_sum_Diff S has_sum_finite[of X'] f_summable) auto
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   652
      have 2: "(M has_sum (T - (\<Sum>x\<in>X'. M x))) (X - X')"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   653
        using X' y by (intro has_sum_Diff T has_sum_finite[of X'] M_summable) auto
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   654
      have "dist (\<Sum>x\<in>X'. f x y) (\<Sum>\<^sub>\<infinity>x\<in>X. f x y) = norm (S y - (\<Sum>x\<in>X'. f x y))"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   655
        by (simp add: dist_norm norm_minus_commute S_def)
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   656
      also have "norm (S y - (\<Sum>x\<in>X'. f x y)) \<le> (\<Sum>\<^sub>\<infinity>x\<in>X-X'. M x)"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   657
        using 2 y by (intro norm_infsum_le[OF 1 _ norm_le]) (auto simp: infsumI)
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   658
      also have "\<dots> = T - (\<Sum>x\<in>X'. M x)"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   659
        using 2 by (auto simp: infsumI)
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   660
      also have "\<dots> < \<epsilon>"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   661
        using X' by (simp add: dist_norm)
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   662
      finally show "dist (\<Sum>x\<in>X'. f x y) (\<Sum>\<^sub>\<infinity>x\<in>X. f x y) < \<epsilon>" .
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   663
    qed
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   664
  qed
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   665
qed
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   666
82349
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   667
lemma Weierstrass_m_test_general':
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   668
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c :: banach"
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   669
  fixes M :: "'a \<Rightarrow> real"
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   670
  assumes norm_le:  "\<And>x y. x \<in> X \<Longrightarrow> y \<in> Y \<Longrightarrow> norm (f x y) \<le> M x"
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   671
  assumes has_sum: "\<And>y. y \<in> Y \<Longrightarrow> ((\<lambda>x. f x y) has_sum S y) X"
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   672
  assumes summable: "M summable_on X"
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   673
  shows "uniform_limit Y (\<lambda>X y. \<Sum>x\<in>X. f x y) S (finite_subsets_at_top X)"
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   674
proof -
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   675
  have "uniform_limit Y (\<lambda>X y. \<Sum>x\<in>X. f x y) (\<lambda>y. \<Sum>\<^sub>\<infinity>x\<in>X. f x y) (finite_subsets_at_top X)"
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   676
    using norm_le summable by (rule Weierstrass_m_test_general)
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   677
  also have "?this \<longleftrightarrow> ?thesis"
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   678
    by (intro uniform_limit_cong refl always_eventually allI ballI)
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   679
       (use has_sum in \<open>auto simp: has_sum_iff\<close>)
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   680
  finally show ?thesis .
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   681
qed
a854ca7ca7d9 More migration from Theta_Functions_Library
paulson <lp15@cam.ac.uk>
parents: 78698
diff changeset
   682
68838
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
   683
70136
f03a01a18c6e modernized tags: default scope excludes proof;
wenzelm
parents: 69597
diff changeset
   684
subsection\<^marker>\<open>tag unimportant\<close> \<open>Structural introduction rules\<close>
68838
5e013478bced tagged some theories
immler
parents: 67685
diff changeset
   685
77434
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   686
lemma uniform_limit_eq_rhs: "uniform_limit X f l F \<Longrightarrow> l = m \<Longrightarrow> uniform_limit X f m F"
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   687
  by simp
da41823d09a7 Imported a theorem about Infinite_Sum. Importing this theory a bit earlier is causing syntactic ambiguities with Infinite_Set_Sum however; no_notation needed
paulson <lp15@cam.ac.uk>
parents: 76724
diff changeset
   688
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   689
named_theorems uniform_limit_intros "introduction rules for uniform_limit"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   690
setup \<open>
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69529
diff changeset
   691
  Global_Theory.add_thms_dynamic (\<^binding>\<open>uniform_limit_eq_intros\<close>,
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   692
    fn context =>
69597
ff784d5a5bfb isabelle update -u control_cartouches;
wenzelm
parents: 69529
diff changeset
   693
      Named_Theorems.get (Context.proof_of context) \<^named_theorems>\<open>uniform_limit_intros\<close>
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   694
      |> map_filter (try (fn thm => @{thm uniform_limit_eq_rhs} OF [thm])))
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   695
\<close>
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   696
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   697
lemma (in bounded_linear) uniform_limit[uniform_limit_intros]:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   698
  assumes "uniform_limit X g l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   699
  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
   700
proof (rule uniform_limitI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   701
  fix e::real
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   702
  from pos_bounded obtain K
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   703
    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
   704
    by (auto simp: ac_simps dist_norm diff[symmetric])
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   705
  assume "0 < e" with \<open>K > 0\<close> have "e / K > 0" by simp
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   706
  from uniform_limitD[OF assms this]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   707
  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
   708
    by eventually_elim (metis le_less_trans mult.commute pos_less_divide_eq K)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   709
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   710
67371
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   711
lemma (in bounded_linear) uniformly_convergent_on:
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   712
  assumes "uniformly_convergent_on A g"
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   713
  shows   "uniformly_convergent_on A (\<lambda>x y. f (g x y))"
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   714
proof -
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   715
  from assms obtain l where "uniform_limit A g l sequentially"
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   716
    unfolding uniformly_convergent_on_def by blast
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   717
  hence "uniform_limit A (\<lambda>x y. f (g x y)) (\<lambda>x. f (l x)) sequentially"
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   718
    by (rule uniform_limit)
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   719
  thus ?thesis unfolding uniformly_convergent_on_def by blast
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   720
qed
2d9cf74943e1 moved in some material from Euler-MacLaurin
paulson <lp15@cam.ac.uk>
parents: 66827
diff changeset
   721
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   722
lemmas bounded_linear_uniform_limit_intros[uniform_limit_intros] =
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   723
  bounded_linear.uniform_limit[OF bounded_linear_Im]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   724
  bounded_linear.uniform_limit[OF bounded_linear_Re]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   725
  bounded_linear.uniform_limit[OF bounded_linear_cnj]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   726
  bounded_linear.uniform_limit[OF bounded_linear_fst]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   727
  bounded_linear.uniform_limit[OF bounded_linear_snd]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   728
  bounded_linear.uniform_limit[OF bounded_linear_zero]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   729
  bounded_linear.uniform_limit[OF bounded_linear_of_real]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   730
  bounded_linear.uniform_limit[OF bounded_linear_inner_left]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   731
  bounded_linear.uniform_limit[OF bounded_linear_inner_right]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   732
  bounded_linear.uniform_limit[OF bounded_linear_divide]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   733
  bounded_linear.uniform_limit[OF bounded_linear_scaleR_right]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   734
  bounded_linear.uniform_limit[OF bounded_linear_mult_left]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   735
  bounded_linear.uniform_limit[OF bounded_linear_mult_right]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   736
  bounded_linear.uniform_limit[OF bounded_linear_scaleR_left]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   737
67685
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67371
diff changeset
   738
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   739
lemmas uniform_limit_uminus[uniform_limit_intros] =
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   740
  bounded_linear.uniform_limit[OF bounded_linear_minus[OF bounded_linear_ident]]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   741
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   742
lemma uniform_limit_const[uniform_limit_intros]: "uniform_limit S (\<lambda>x. c) c f"
62949
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   743
  by (auto intro!: uniform_limitI)
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   744
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   745
lemma uniform_limit_add[uniform_limit_intros]:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   746
  fixes f g::"'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_vector"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   747
  assumes "uniform_limit X f l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   748
  assumes "uniform_limit X g m F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   749
  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
   750
proof (rule uniform_limitI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   751
  fix e::real
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   752
  assume "0 < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   753
  hence "0 < e / 2" by simp
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   754
  from
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   755
    uniform_limitD[OF assms(1) this]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   756
    uniform_limitD[OF assms(2) this]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   757
  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
   758
    by eventually_elim (simp add: dist_triangle_add_half)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   759
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   760
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   761
lemma uniform_limit_minus[uniform_limit_intros]:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   762
  fixes f g::"'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_vector"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   763
  assumes "uniform_limit X f l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   764
  assumes "uniform_limit X g m F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   765
  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
   766
  unfolding diff_conv_add_uminus
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   767
  by (rule uniform_limit_intros assms)+
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   768
62949
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   769
lemma uniform_limit_norm[uniform_limit_intros]:
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   770
  assumes "uniform_limit S g l f"
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   771
  shows "uniform_limit S (\<lambda>x y. norm (g x y)) (\<lambda>x. norm (l x)) f"
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   772
  using assms
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   773
  apply (rule metric_uniform_limit_imp_uniform_limit)
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   774
  apply (rule eventuallyI)
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   775
  by (metis dist_norm norm_triangle_ineq3 real_norm_def)
f36a54da47a4 added derivative of scaling in exponential function
immler
parents: 62393
diff changeset
   776
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   777
lemma (in bounded_bilinear) bounded_uniform_limit[uniform_limit_intros]:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   778
  assumes "uniform_limit X f l F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   779
  assumes "uniform_limit X g m F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   780
  assumes "bounded (m ` X)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   781
  assumes "bounded (l ` X)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   782
  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
   783
proof (rule uniform_limitI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   784
  fix e::real
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   785
  from pos_bounded obtain K where K:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   786
    "0 < K" "\<And>a b. norm (prod a b) \<le> norm a * norm b * K"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   787
    by auto
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   788
  hence "sqrt (K*4) > 0" by simp
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   789
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   790
  from assms obtain Km Kl
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   791
  where Km: "Km > 0" "\<And>x. x \<in> X \<Longrightarrow> norm (m x) \<le> Km"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   792
    and Kl: "Kl > 0" "\<And>x. x \<in> X \<Longrightarrow> norm (l x) \<le> Kl"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   793
    by (auto simp: bounded_pos)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   794
  hence "K * Km * 4 > 0" "K * Kl * 4 > 0"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   795
    using \<open>K > 0\<close>
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   796
    by simp_all
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   797
  assume "0 < e"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   798
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   799
  hence "sqrt e > 0" by simp
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   800
  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
   801
    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
   802
    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
   803
    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
   804
  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
   805
  proof eventually_elim
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   806
    case (elim n)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   807
    show ?case
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   808
    proof safe
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   809
      fix x assume "x \<in> X"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   810
      have "dist (prod (f n x) (g n x)) (prod (l x) (m x)) \<le>
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   811
        norm (prod (f n x - l x) (g n x - m x)) +
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   812
        norm (prod (f n x - l x) (m x)) +
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   813
        norm (prod (l x) (g n x - m x))"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   814
        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
   815
      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
   816
      also from elim(1)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   817
      have "norm (f n x - l x) \<le> sqrt e / sqrt (K * 4)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   818
        by simp
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   819
      also from elim(2)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   820
      have "norm (g n x - m x) \<le> sqrt e / sqrt (K * 4)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   821
        by simp
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   822
      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
   823
        using \<open>K > 0\<close> \<open>e > 0\<close> by auto
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   824
      also note K(2)[of "f n x - l x" "m x"]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   825
      also note K(2)[of "l x" "g n x - m x"]
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   826
      also from elim(3)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   827
      have "norm (f n x - l x) \<le> e / (K * Km * 4)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   828
        by simp
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   829
      also from elim(4)[THEN bspec, OF \<open>_ \<in> X\<close>, unfolded dist_norm]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   830
      have "norm (g n x - m x) \<le> e / (K * Kl * 4)"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   831
        by simp
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   832
      also note Kl(2)[OF \<open>_ \<in> X\<close>]
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   833
      also note Km(2)[OF \<open>_ \<in> X\<close>]
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   834
      also have "e / (K * Km * 4) * Km * K = e / 4"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   835
        using \<open>K > 0\<close> \<open>Km > 0\<close> by simp
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   836
      also have " Kl * (e / (K * Kl * 4)) * K = e / 4"
61222
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   837
        using \<open>K > 0\<close> \<open>Kl > 0\<close> by simp
05d28dc76e5c isabelle update_cartouches;
wenzelm
parents: 60812
diff changeset
   838
      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
   839
      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
   840
        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
   841
        by (simp add: algebra_simps mult_right_mono divide_right_mono)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   842
    qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   843
  qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   844
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   845
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   846
lemmas bounded_bilinear_bounded_uniform_limit_intros[uniform_limit_intros] =
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   847
  bounded_bilinear.bounded_uniform_limit[OF Inner_Product.bounded_bilinear_inner]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   848
  bounded_bilinear.bounded_uniform_limit[OF Real_Vector_Spaces.bounded_bilinear_mult]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   849
  bounded_bilinear.bounded_uniform_limit[OF Real_Vector_Spaces.bounded_bilinear_scaleR]
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   850
65036
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   851
lemma uniform_lim_mult:
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   852
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_algebra"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   853
  assumes f: "uniform_limit S f l F"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   854
      and g: "uniform_limit S g m F"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   855
      and l: "bounded (l ` S)"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   856
      and m: "bounded (m ` S)"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   857
    shows "uniform_limit S (\<lambda>a b. f a b * g a b) (\<lambda>a. l a * m a) F"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   858
  by (intro bounded_bilinear_bounded_uniform_limit_intros assms)
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   859
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   860
lemma uniform_lim_inverse:
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   861
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_field"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   862
  assumes f: "uniform_limit S f l F"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   863
      and b: "\<And>x. x \<in> S \<Longrightarrow> b \<le> norm(l x)"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   864
      and "b > 0"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   865
    shows "uniform_limit S (\<lambda>x y. inverse (f x y)) (inverse \<circ> l) F"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   866
proof (rule uniform_limitI)
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   867
  fix e::real
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   868
  assume "e > 0"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   869
  have lte: "dist (inverse (f x y)) ((inverse \<circ> l) y) < e"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   870
           if "b/2 \<le> norm (f x y)" "norm (f x y - l y) < e * b\<^sup>2 / 2" "y \<in> S"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   871
           for x y
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   872
  proof -
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   873
    have [simp]: "l y \<noteq> 0" "f x y \<noteq> 0"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   874
      using \<open>b > 0\<close> that b [OF \<open>y \<in> S\<close>] by fastforce+
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   875
    have "norm (l y - f x y) <  e * b\<^sup>2 / 2"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   876
      by (metis norm_minus_commute that(2))
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   877
    also have "... \<le> e * (norm (f x y) * norm (l y))"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   878
      using \<open>e > 0\<close> that b [OF \<open>y \<in> S\<close>] apply (simp add: power2_eq_square)
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   879
      by (metis \<open>b > 0\<close> less_eq_real_def mult.left_commute mult_mono')
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   880
    finally show ?thesis
70817
dd675800469d dedicated fact collections for algebraic simplification rules potentially splitting goals
haftmann
parents: 70136
diff changeset
   881
      by (auto simp: dist_norm field_split_simps norm_mult norm_divide)
65036
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   882
  qed
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   883
  have "\<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (f n x) (l x) < b/2"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   884
    using uniform_limitD [OF f, of "b/2"] by (simp add: \<open>b > 0\<close>)
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   885
  then have "\<forall>\<^sub>F x in F. \<forall>y\<in>S. b/2 \<le> norm (f x y)"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   886
    apply (rule eventually_mono)
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   887
    using b apply (simp only: dist_norm)
73932
fd21b4a93043 added opaque_combs and renamed hide_lams to opaque_lifting
desharna
parents: 70817
diff changeset
   888
    by (metis (no_types, opaque_lifting) diff_zero dist_commute dist_norm norm_triangle_half_l not_less)
65036
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   889
  then have "\<forall>\<^sub>F x in F. \<forall>y\<in>S. b/2 \<le> norm (f x y) \<and> norm (f x y - l y) < e * b\<^sup>2 / 2"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   890
    apply (simp only: ball_conj_distrib dist_norm [symmetric])
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   891
    apply (rule eventually_conj, assumption)
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   892
      apply (rule uniform_limitD [OF f, of "e * b ^ 2 / 2"])
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   893
    using \<open>b > 0\<close> \<open>e > 0\<close> by auto
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   894
  then show "\<forall>\<^sub>F x in F. \<forall>y\<in>S. dist (inverse (f x y)) ((inverse \<circ> l) y) < e"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   895
    using lte by (force intro: eventually_mono)
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   896
qed
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   897
65037
2cf841ff23be some new material, also recasting some theorems using “obtains”
paulson <lp15@cam.ac.uk>
parents: 65036
diff changeset
   898
lemma uniform_lim_divide:
65036
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   899
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'c::real_normed_field"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   900
  assumes f: "uniform_limit S f l F"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   901
      and g: "uniform_limit S g m F"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   902
      and l: "bounded (l ` S)"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   903
      and b: "\<And>x. x \<in> S \<Longrightarrow> b \<le> norm(m x)"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   904
      and "b > 0"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   905
    shows "uniform_limit S (\<lambda>a b. f a b / g a b) (\<lambda>a. l a / m a) F"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   906
proof -
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   907
  have m: "bounded ((inverse \<circ> m) ` S)"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   908
    using b \<open>b > 0\<close>
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   909
    apply (simp add: bounded_iff)
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   910
    by (metis le_imp_inverse_le norm_inverse)
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   911
  have "uniform_limit S (\<lambda>a b. f a b * inverse (g a b))
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   912
         (\<lambda>a. l a * (inverse \<circ> m) a) F"
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   913
    by (rule uniform_lim_mult [OF f uniform_lim_inverse [OF g b \<open>b > 0\<close>] l m])
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   914
  then show ?thesis
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   915
    by (simp add: field_class.field_divide_inverse)
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   916
qed
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   917
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   918
lemma uniform_limit_null_comparison:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   919
  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
   920
  assumes "uniform_limit S g (\<lambda>_. 0) F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   921
  shows "uniform_limit S f (\<lambda>_. 0) F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   922
  using assms(2)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   923
proof (rule metric_uniform_limit_imp_uniform_limit)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   924
  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
   925
    using assms(1) by (rule eventually_mono) (force simp add: dist_norm)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   926
qed
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   927
65036
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   928
lemma uniform_limit_on_Un:
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   929
  "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
   930
  by (auto intro!: uniform_limitI dest!: uniform_limitD elim: eventually_elim2)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   931
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   932
lemma uniform_limit_on_empty [iff]:
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   933
  "uniform_limit {} f g F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   934
  by (auto intro!: uniform_limitI)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   935
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   936
lemma uniform_limit_on_UNION:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   937
  assumes "finite S"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   938
  assumes "\<And>s. s \<in> S \<Longrightarrow> uniform_limit (h s) f g F"
69313
b021008c5397 removed legacy input syntax
haftmann
parents: 69260
diff changeset
   939
  shows "uniform_limit (\<Union>(h ` S)) f g F"
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   940
  using assms
65036
ab7e11730ad8 Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
paulson <lp15@cam.ac.uk>
parents: 64267
diff changeset
   941
  by induct (auto intro: uniform_limit_on_empty uniform_limit_on_Un)
60812
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   942
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   943
lemma uniform_limit_on_Union:
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   944
  assumes "finite I"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   945
  assumes "\<And>J. J \<in> I \<Longrightarrow> uniform_limit J f g F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   946
  shows "uniform_limit (Union I) f g F"
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   947
  by (metis SUP_identity_eq assms uniform_limit_on_UNION)
8fff64349793 added theory Uniform_Limit
immler
parents:
diff changeset
   948
65204
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   949
lemma uniform_limit_bounded:
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   950
  fixes f::"'i \<Rightarrow> 'a::topological_space \<Rightarrow> 'b::metric_space"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   951
  assumes l: "uniform_limit S f l F"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   952
  assumes bnd: "\<forall>\<^sub>F i in F. bounded (f i ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   953
  assumes "F \<noteq> bot"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   954
  shows "bounded (l ` S)"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   955
proof -
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   956
  from l have "\<forall>\<^sub>F n in F. \<forall>x\<in>S. dist (l x) (f n x) < 1"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   957
    by (auto simp: uniform_limit_iff dist_commute dest!: spec[where x=1])
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   958
  with bnd
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   959
  have "\<forall>\<^sub>F n in F. \<exists>M. \<forall>x\<in>S. dist undefined (l x) \<le> M + 1"
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   960
    by eventually_elim
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   961
      (auto intro!: order_trans[OF dist_triangle2 add_mono] intro: less_imp_le
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   962
        simp: bounded_any_center[where a=undefined])
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   963
  then show ?thesis using assms
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   964
    by (auto simp: bounded_any_center[where a=undefined] dest!: eventually_happens)
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   965
qed
d23eded35a33 modernized construction of type bcontfun; base explicit theorems on Uniform_Limit.thy; added some lemmas
immler
parents: 65037
diff changeset
   966
61552
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   967
lemma uniformly_convergent_add:
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   968
  "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
   969
      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
   970
  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
   971
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   972
lemma uniformly_convergent_minus:
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   973
  "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
   974
      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
   975
  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
   976
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   977
lemma uniformly_convergent_mult:
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 63040
diff changeset
   978
  "uniformly_convergent_on A f \<Longrightarrow>
61552
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   979
      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
   980
  unfolding uniformly_convergent_on_def
980dd46a03fb Added binomial identities to CONTRIBUTORS; small lemmas on of_int/pochhammer
eberlm
parents: 61531
diff changeset
   981
  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
   982
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   983
subsection\<open>Power series and uniform convergence\<close>
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   984
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   985
proposition powser_uniformly_convergent:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   986
  fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   987
  assumes "r < conv_radius a"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   988
  shows "uniformly_convergent_on (cball \<xi> r) (\<lambda>n x. \<Sum>i<n. a i * (x - \<xi>) ^ i)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   989
proof (cases "0 \<le> r")
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   990
  case True
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   991
  then have *: "summable (\<lambda>n. norm (a n) * r ^ n)"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   992
    using abs_summable_in_conv_radius [of "of_real r" a] assms
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   993
    by (simp add: norm_mult norm_power)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   994
  show ?thesis
69529
4ab9657b3257 capitalize proper names in lemma names
nipkow
parents: 69313
diff changeset
   995
    by (simp add: Weierstrass_m_test'_ev [OF _ *] norm_mult norm_power
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   996
              mult_left_mono power_mono dist_norm norm_minus_commute)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   997
next
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   998
  case False then show ?thesis by (simp add: not_le)
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
   999
qed
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1000
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1001
lemma powser_uniform_limit:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1002
  fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1003
  assumes "r < conv_radius a"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1004
  shows "uniform_limit (cball \<xi> r) (\<lambda>n x. \<Sum>i<n. a i * (x - \<xi>) ^ i) (\<lambda>x. suminf (\<lambda>i. a i * (x - \<xi>) ^ i)) sequentially"
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1005
  using powser_uniformly_convergent [OF assms]
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1006
  by (simp add: Uniform_Limit.uniformly_convergent_uniform_limit_iff Series.suminf_eq_lim)
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1007
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1008
lemma powser_continuous_suminf:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1009
  fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1010
  assumes "r < conv_radius a"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1011
  shows "continuous_on (cball \<xi> r) (\<lambda>x. suminf (\<lambda>i. a i * (x - \<xi>) ^ i))"
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1012
  apply (rule uniform_limit_theorem [OF _ powser_uniform_limit])
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1013
    apply (rule eventuallyI continuous_intros assms)+
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1014
  apply auto
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1015
  done
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1016
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1017
lemma powser_continuous_sums:
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1018
  fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1019
  assumes r: "r < conv_radius a"
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1020
    and sm: "\<And>x. x \<in> cball \<xi> r \<Longrightarrow> (\<lambda>n. a n * (x - \<xi>) ^ n) sums (f x)"
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1021
  shows "continuous_on (cball \<xi> r) f"
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1022
  apply (rule continuous_on_cong [THEN iffD1, OF refl _ powser_continuous_suminf [OF r]])
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1023
  using sm sums_unique by fastforce
62381
a6479cb85944 New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents: 62175
diff changeset
  1024
67685
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67371
diff changeset
  1025
lemmas uniform_limit_subset_union = uniform_limit_on_subset[OF uniform_limit_on_Union]
bdff8bf0a75b moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents: 67371
diff changeset
  1026
82395
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1027
subsection \<open>Tannery's Theorem\<close>
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1028
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1029
text \<open>
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1030
  Tannery's Theorem proves that, under certain boundedness conditions:
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1031
  \[ \lim_{x\to\bar x} \sum_{k=0}^\infty f(k,n) = \sum_{k=0}^\infty \lim_{x\to\bar x} f(k,n) \]
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1032
\<close>
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1033
lemma tannerys_theorem:
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1034
  fixes a :: "nat \<Rightarrow> _ \<Rightarrow> 'a :: {real_normed_algebra, banach}"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1035
  assumes limit: "\<And>k. ((\<lambda>n. a k n) \<longlongrightarrow> b k) F"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1036
  assumes bound: "eventually (\<lambda>(k,n). norm (a k n) \<le> M k) (at_top \<times>\<^sub>F F)"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1037
  assumes "summable M"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1038
  assumes [simp]: "F \<noteq> bot"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1039
  shows   "eventually (\<lambda>n. summable (\<lambda>k. norm (a k n))) F \<and>
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1040
           summable (\<lambda>n. norm (b n)) \<and>
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1041
           ((\<lambda>n. suminf (\<lambda>k. a k n)) \<longlongrightarrow> suminf b) F"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1042
proof (intro conjI allI)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1043
  show "eventually (\<lambda>n. summable (\<lambda>k. norm (a k n))) F"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1044
  proof -
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1045
    have "eventually (\<lambda>n. eventually (\<lambda>k. norm (a k n) \<le> M k) at_top) F"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1046
      using eventually_eventually_prod_filter2[OF bound] by simp
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1047
    thus ?thesis
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1048
    proof eventually_elim
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1049
      case (elim n)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1050
      show "summable (\<lambda>k. norm (a k n))"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1051
      proof (rule summable_comparison_test_ev)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1052
        show "eventually (\<lambda>k. norm (norm (a k n)) \<le> M k) at_top"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1053
          using elim by auto
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1054
      qed fact
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1055
    qed
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1056
  qed
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1057
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1058
  have bound': "eventually (\<lambda>k. norm (b k) \<le> M k) at_top"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1059
  proof -
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1060
    have "eventually (\<lambda>k. eventually (\<lambda>n. norm (a k n) \<le> M k) F) at_top"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1061
      using eventually_eventually_prod_filter1[OF bound] by simp
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1062
    thus ?thesis
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1063
    proof eventually_elim
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1064
      case (elim k)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1065
      show "norm (b k) \<le> M k"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1066
      proof (rule tendsto_upperbound)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1067
        show "((\<lambda>n. norm (a k n)) \<longlongrightarrow> norm (b k)) F"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1068
          by (intro tendsto_intros limit)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1069
      qed (use elim in auto)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1070
    qed
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1071
  qed
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1072
  show "summable (\<lambda>n. norm (b n))"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1073
    by (rule summable_comparison_test_ev[OF _ \<open>summable M\<close>]) (use bound' in auto)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1074
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1075
  from bound obtain Pf Pg where
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1076
    *: "eventually Pf at_top" "eventually Pg F" "\<And>k n. Pf k \<Longrightarrow> Pg n \<Longrightarrow> norm (a k n) \<le> M k"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1077
    unfolding eventually_prod_filter by auto
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1078
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1079
  show "((\<lambda>n. \<Sum>k. a k n) \<longlongrightarrow> (\<Sum>k. b k)) F"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1080
  proof (rule swap_uniform_limit')
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1081
    show "(\<lambda>K. (\<Sum>k<K. b k)) \<longlonglongrightarrow> (\<Sum>k. b k)"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1082
      using \<open>summable (\<lambda>n. norm (b n))\<close>
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1083
      by (intro summable_LIMSEQ) (auto dest: summable_norm_cancel)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1084
    show "\<forall>\<^sub>F K in sequentially. ((\<lambda>n. \<Sum>k<K. a k n) \<longlongrightarrow> (\<Sum>k<K. b k)) F"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1085
      by (intro tendsto_intros always_eventually allI limit)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1086
    show "\<forall>\<^sub>F x in F. x \<in> {n. Pg n}"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1087
      using *(2) by simp
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1088
    show "uniform_limit {n. Pg n} (\<lambda>K n. \<Sum>k<K. a k n) (\<lambda>n. \<Sum>k. a k n) sequentially"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1089
    proof (rule Weierstrass_m_test_ev)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1090
      show "\<forall>\<^sub>F k in at_top. \<forall>n\<in>{n. Pg n}. norm (a k n) \<le> M k"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1091
        using *(1) by eventually_elim (use *(3) in auto)
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1092
      show "summable M"
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1093
        by fact
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1094
    qed
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1095
  qed auto
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1096
qed
918c50e0447e Lemmas from Manuel Eberl's Q_Analogues
paulson <lp15@cam.ac.uk>
parents: 82353
diff changeset
  1097
62390
842917225d56 more canonical names
nipkow
parents: 62175
diff changeset
  1098
end
62393
a620a8756b7c resolved conflict
nipkow
parents: 62381 62390
diff changeset
  1099