author | nipkow |
Wed, 11 Jul 2018 09:43:48 +0200 | |
changeset 68752 | f221bc388ad0 |
parent 68527 | 2f4e2aab190a |
child 68838 | 5e013478bced |
permissions | -rw-r--r-- |
63627 | 1 |
(* Title: HOL/Analysis/Derivative.thy |
53781 | 2 |
Author: John Harrison |
68239 | 3 |
Author: Robert Himmelmann, TU Muenchen (translation from HOL Light); tidied by LCP |
36350 | 4 |
*) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
5 |
|
60420 | 6 |
section \<open>Multivariate calculus in Euclidean space\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
7 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
8 |
theory Derivative |
62207 | 9 |
imports Brouwer_Fixpoint Operator_Norm Uniform_Limit Bounded_Linear_Function |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
10 |
begin |
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
11 |
|
63938 | 12 |
declare bounded_linear_inner_left [intro] |
61915
e9812a95d108
theory for type of bounded linear functions; differentiation under the integral sign
immler
parents:
61907
diff
changeset
|
13 |
|
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
14 |
declare has_derivative_bounded_linear[dest] |
44137 | 15 |
|
60420 | 16 |
subsection \<open>Derivatives\<close> |
51642
400ec5ae7f8f
move FrechetDeriv from the Library to HOL/Deriv; base DERIV on FDERIV and both derivatives allow a restricted support set; FDERIV is now an abbreviation of has_derivative
hoelzl
parents:
51641
diff
changeset
|
17 |
|
400ec5ae7f8f
move FrechetDeriv from the Library to HOL/Deriv; base DERIV on FDERIV and both derivatives allow a restricted support set; FDERIV is now an abbreviation of has_derivative
hoelzl
parents:
51641
diff
changeset
|
18 |
lemma has_derivative_add_const: |
400ec5ae7f8f
move FrechetDeriv from the Library to HOL/Deriv; base DERIV on FDERIV and both derivatives allow a restricted support set; FDERIV is now an abbreviation of has_derivative
hoelzl
parents:
51641
diff
changeset
|
19 |
"(f has_derivative f') net \<Longrightarrow> ((\<lambda>x. f x + c) has_derivative f') net" |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
20 |
by (intro derivative_eq_intros) auto |
51642
400ec5ae7f8f
move FrechetDeriv from the Library to HOL/Deriv; base DERIV on FDERIV and both derivatives allow a restricted support set; FDERIV is now an abbreviation of has_derivative
hoelzl
parents:
51641
diff
changeset
|
21 |
|
53781 | 22 |
|
67968 | 23 |
subsection \<open>Derivative with composed bilinear function\<close> |
51642
400ec5ae7f8f
move FrechetDeriv from the Library to HOL/Deriv; base DERIV on FDERIV and both derivatives allow a restricted support set; FDERIV is now an abbreviation of has_derivative
hoelzl
parents:
51641
diff
changeset
|
24 |
|
60420 | 25 |
text \<open>More explicit epsilon-delta forms.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
26 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
27 |
lemma has_derivative_within': |
53781 | 28 |
"(f has_derivative f')(at x within s) \<longleftrightarrow> |
29 |
bounded_linear f' \<and> |
|
30 |
(\<forall>e>0. \<exists>d>0. \<forall>x'\<in>s. 0 < norm (x' - x) \<and> norm (x' - x) < d \<longrightarrow> |
|
31 |
norm (f x' - f x - f'(x' - x)) / norm (x' - x) < e)" |
|
36587 | 32 |
unfolding has_derivative_within Lim_within dist_norm |
53781 | 33 |
by (simp add: diff_diff_eq) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
34 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
35 |
lemma has_derivative_at': |
68239 | 36 |
"(f has_derivative f') (at x) |
37 |
\<longleftrightarrow> bounded_linear f' \<and> |
|
38 |
(\<forall>e>0. \<exists>d>0. \<forall>x'. 0 < norm (x' - x) \<and> norm (x' - x) < d \<longrightarrow> |
|
39 |
norm (f x' - f x - f'(x' - x)) / norm (x' - x) < e)" |
|
40 |
using has_derivative_within' [of f f' x UNIV] by simp |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
41 |
|
67979
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67968
diff
changeset
|
42 |
lemma has_derivative_at_withinI: |
53781 | 43 |
"(f has_derivative f') (at x) \<Longrightarrow> (f has_derivative f') (at x within s)" |
44 |
unfolding has_derivative_within' has_derivative_at' |
|
45 |
by blast |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
46 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
47 |
lemma has_derivative_within_open: |
68095
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
48 |
"a \<in> S \<Longrightarrow> open S \<Longrightarrow> |
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
49 |
(f has_derivative f') (at a within S) \<longleftrightarrow> (f has_derivative f') (at a)" |
37730 | 50 |
by (simp only: at_within_interior interior_open) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
51 |
|
43338 | 52 |
lemma has_derivative_right: |
53781 | 53 |
fixes f :: "real \<Rightarrow> real" |
54 |
and y :: "real" |
|
67399 | 55 |
shows "(f has_derivative (( * ) y)) (at x within ({x <..} \<inter> I)) \<longleftrightarrow> |
68239 | 56 |
((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within ({x <..} \<inter> I))" |
43338 | 57 |
proof - |
61973 | 58 |
have "((\<lambda>t. (f t - (f x + y * (t - x))) / \<bar>t - x\<bar>) \<longlongrightarrow> 0) (at x within ({x<..} \<inter> I)) \<longleftrightarrow> |
59 |
((\<lambda>t. (f t - f x) / (t - x) - y) \<longlongrightarrow> 0) (at x within ({x<..} \<inter> I))" |
|
44282
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44140
diff
changeset
|
60 |
by (intro Lim_cong_within) (auto simp add: diff_divide_distrib add_divide_distrib) |
61973 | 61 |
also have "\<dots> \<longleftrightarrow> ((\<lambda>t. (f t - f x) / (t - x)) \<longlongrightarrow> y) (at x within ({x<..} \<inter> I))" |
43338 | 62 |
by (simp add: Lim_null[symmetric]) |
61973 | 63 |
also have "\<dots> \<longleftrightarrow> ((\<lambda>t. (f x - f t) / (x - t)) \<longlongrightarrow> y) (at x within ({x<..} \<inter> I))" |
44140
2c10c35dd4be
remove several redundant and unused theorems about derivatives
huffman
parents:
44137
diff
changeset
|
64 |
by (intro Lim_cong_within) (simp_all add: field_simps) |
43338 | 65 |
finally show ?thesis |
44282
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44140
diff
changeset
|
66 |
by (simp add: bounded_linear_mult_right has_derivative_within) |
43338 | 67 |
qed |
68 |
||
60420 | 69 |
subsubsection \<open>Caratheodory characterization\<close> |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
70 |
|
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
71 |
lemma DERIV_caratheodory_within: |
68095
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
72 |
"(f has_field_derivative l) (at x within S) \<longleftrightarrow> |
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
73 |
(\<exists>g. (\<forall>z. f z - f x = g z * (z - x)) \<and> continuous (at x within S) g \<and> g x = l)" |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
74 |
(is "?lhs = ?rhs") |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
75 |
proof |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
76 |
assume ?lhs |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
77 |
show ?rhs |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
78 |
proof (intro exI conjI) |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
79 |
let ?g = "(%z. if z = x then l else (f z - f x) / (z-x))" |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
80 |
show "\<forall>z. f z - f x = ?g z * (z-x)" by simp |
68095
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
81 |
show "continuous (at x within S) ?g" using \<open>?lhs\<close> |
68239 | 82 |
by (auto simp add: continuous_within has_field_derivative_iff cong: Lim_cong_within) |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
83 |
show "?g x = l" by simp |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
84 |
qed |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
85 |
next |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
86 |
assume ?rhs |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
87 |
then obtain g where |
68095
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
88 |
"(\<forall>z. f z - f x = g z * (z-x))" and "continuous (at x within S) g" and "g x = l" by blast |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
89 |
thus ?lhs |
68239 | 90 |
by (auto simp add: continuous_within has_field_derivative_iff cong: Lim_cong_within) |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
91 |
qed |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
92 |
|
60420 | 93 |
subsection \<open>Differentiability\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
94 |
|
53781 | 95 |
definition |
96 |
differentiable_on :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'a set \<Rightarrow> bool" |
|
56182
528fae0816ea
update syntax of has_*derivative to infix 50; fixed proofs
hoelzl
parents:
56181
diff
changeset
|
97 |
(infix "differentiable'_on" 50) |
53781 | 98 |
where "f differentiable_on s \<longleftrightarrow> (\<forall>x\<in>s. f differentiable (at x within s))" |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
99 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
100 |
lemma differentiableI: "(f has_derivative f') net \<Longrightarrow> f differentiable net" |
53781 | 101 |
unfolding differentiable_def |
102 |
by auto |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
103 |
|
62533
bc25f3916a99
new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents:
62408
diff
changeset
|
104 |
lemma differentiable_onD: "\<lbrakk>f differentiable_on S; x \<in> S\<rbrakk> \<Longrightarrow> f differentiable (at x within S)" |
bc25f3916a99
new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents:
62408
diff
changeset
|
105 |
using differentiable_on_def by blast |
bc25f3916a99
new material to Blochj's theorem, as well as supporting lemmas
paulson <lp15@cam.ac.uk>
parents:
62408
diff
changeset
|
106 |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
107 |
lemma differentiable_at_withinI: "f differentiable (at x) \<Longrightarrow> f differentiable (at x within s)" |
53781 | 108 |
unfolding differentiable_def |
67979
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67968
diff
changeset
|
109 |
using has_derivative_at_withinI |
53781 | 110 |
by blast |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
111 |
|
61104
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
112 |
lemma differentiable_at_imp_differentiable_on: |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
113 |
"(\<And>x. x \<in> s \<Longrightarrow> f differentiable at x) \<Longrightarrow> f differentiable_on s" |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
114 |
by (metis differentiable_at_withinI differentiable_on_def) |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
115 |
|
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
116 |
corollary differentiable_iff_scaleR: |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
117 |
fixes f :: "real \<Rightarrow> 'a::real_normed_vector" |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
118 |
shows "f differentiable F \<longleftrightarrow> (\<exists>d. (f has_derivative (\<lambda>x. x *\<^sub>R d)) F)" |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
119 |
by (auto simp: differentiable_def dest: has_derivative_linear linear_imp_scaleR) |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
120 |
|
44123 | 121 |
lemma differentiable_on_eq_differentiable_at: |
53781 | 122 |
"open s \<Longrightarrow> f differentiable_on s \<longleftrightarrow> (\<forall>x\<in>s. f differentiable at x)" |
44123 | 123 |
unfolding differentiable_on_def |
51641
cd05e9fcc63d
remove the within-filter, replace "at" by "at _ within UNIV" (This allows to remove a couple of redundant lemmas)
hoelzl
parents:
51478
diff
changeset
|
124 |
by (metis at_within_interior interior_open) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
125 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
126 |
lemma differentiable_transform_within: |
62087
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
paulson
parents:
61975
diff
changeset
|
127 |
assumes "f differentiable (at x within s)" |
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
paulson
parents:
61975
diff
changeset
|
128 |
and "0 < d" |
53781 | 129 |
and "x \<in> s" |
62087
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
paulson
parents:
61975
diff
changeset
|
130 |
and "\<And>x'. \<lbrakk>x'\<in>s; dist x' x < d\<rbrakk> \<Longrightarrow> f x' = g x'" |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
131 |
shows "g differentiable (at x within s)" |
62087
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
paulson
parents:
61975
diff
changeset
|
132 |
using assms has_derivative_transform_within unfolding differentiable_def |
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
paulson
parents:
61975
diff
changeset
|
133 |
by blast |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
134 |
|
63469
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
135 |
lemma differentiable_on_ident [simp, derivative_intros]: "(\<lambda>x. x) differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
136 |
by (simp add: differentiable_at_imp_differentiable_on) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
137 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
138 |
lemma differentiable_on_id [simp, derivative_intros]: "id differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
139 |
by (simp add: id_def) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
140 |
|
63955 | 141 |
lemma differentiable_on_const [simp, derivative_intros]: "(\<lambda>z. c) differentiable_on S" |
142 |
by (simp add: differentiable_on_def) |
|
143 |
||
144 |
lemma differentiable_on_mult [simp, derivative_intros]: |
|
145 |
fixes f :: "'M::real_normed_vector \<Rightarrow> 'a::real_normed_algebra" |
|
146 |
shows "\<lbrakk>f differentiable_on S; g differentiable_on S\<rbrakk> \<Longrightarrow> (\<lambda>z. f z * g z) differentiable_on S" |
|
68239 | 147 |
unfolding differentiable_on_def differentiable_def |
63955 | 148 |
using differentiable_def differentiable_mult by blast |
149 |
||
63469
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
150 |
lemma differentiable_on_compose: |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
151 |
"\<lbrakk>g differentiable_on S; f differentiable_on (g ` S)\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x)) differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
152 |
by (simp add: differentiable_in_compose differentiable_on_def) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
153 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
154 |
lemma bounded_linear_imp_differentiable_on: "bounded_linear f \<Longrightarrow> f differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
155 |
by (simp add: differentiable_on_def bounded_linear_imp_differentiable) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
156 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
157 |
lemma linear_imp_differentiable_on: |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
158 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
159 |
shows "linear f \<Longrightarrow> f differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
160 |
by (simp add: differentiable_on_def linear_imp_differentiable) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
161 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
162 |
lemma differentiable_on_minus [simp, derivative_intros]: |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
163 |
"f differentiable_on S \<Longrightarrow> (\<lambda>z. -(f z)) differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
164 |
by (simp add: differentiable_on_def) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
165 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
166 |
lemma differentiable_on_add [simp, derivative_intros]: |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
167 |
"\<lbrakk>f differentiable_on S; g differentiable_on S\<rbrakk> \<Longrightarrow> (\<lambda>z. f z + g z) differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
168 |
by (simp add: differentiable_on_def) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
169 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
170 |
lemma differentiable_on_diff [simp, derivative_intros]: |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
171 |
"\<lbrakk>f differentiable_on S; g differentiable_on S\<rbrakk> \<Longrightarrow> (\<lambda>z. f z - g z) differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
172 |
by (simp add: differentiable_on_def) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
173 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
174 |
lemma differentiable_on_inverse [simp, derivative_intros]: |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
175 |
fixes f :: "'a :: real_normed_vector \<Rightarrow> 'b :: real_normed_field" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
176 |
shows "f differentiable_on S \<Longrightarrow> (\<And>x. x \<in> S \<Longrightarrow> f x \<noteq> 0) \<Longrightarrow> (\<lambda>x. inverse (f x)) differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
177 |
by (simp add: differentiable_on_def) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
178 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
179 |
lemma differentiable_on_scaleR [derivative_intros, simp]: |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
180 |
"\<lbrakk>f differentiable_on S; g differentiable_on S\<rbrakk> \<Longrightarrow> (\<lambda>x. f x *\<^sub>R g x) differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
181 |
unfolding differentiable_on_def |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
182 |
by (blast intro: differentiable_scaleR) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
183 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
184 |
lemma has_derivative_sqnorm_at [derivative_intros, simp]: |
68239 | 185 |
"((\<lambda>x. (norm x)\<^sup>2) has_derivative (\<lambda>x. 2 *\<^sub>R (a \<bullet> x))) (at a)" |
186 |
using bounded_bilinear.FDERIV [of "(\<bullet>)" id id a _ id id] |
|
187 |
by (auto simp: inner_commute dot_square_norm bounded_bilinear_inner) |
|
63469
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
188 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
189 |
lemma differentiable_sqnorm_at [derivative_intros, simp]: |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
190 |
fixes a :: "'a :: {real_normed_vector,real_inner}" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
191 |
shows "(\<lambda>x. (norm x)\<^sup>2) differentiable (at a)" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
192 |
by (force simp add: differentiable_def intro: has_derivative_sqnorm_at) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
193 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
194 |
lemma differentiable_on_sqnorm [derivative_intros, simp]: |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
195 |
fixes S :: "'a :: {real_normed_vector,real_inner} set" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
196 |
shows "(\<lambda>x. (norm x)\<^sup>2) differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
197 |
by (simp add: differentiable_at_imp_differentiable_on) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
198 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
199 |
lemma differentiable_norm_at [derivative_intros, simp]: |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
200 |
fixes a :: "'a :: {real_normed_vector,real_inner}" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
201 |
shows "a \<noteq> 0 \<Longrightarrow> norm differentiable (at a)" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
202 |
using differentiableI has_derivative_norm by blast |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
203 |
|
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
204 |
lemma differentiable_on_norm [derivative_intros, simp]: |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
205 |
fixes S :: "'a :: {real_normed_vector,real_inner} set" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
206 |
shows "0 \<notin> S \<Longrightarrow> norm differentiable_on S" |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
207 |
by (metis differentiable_at_imp_differentiable_on differentiable_norm_at) |
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
208 |
|
53781 | 209 |
|
60420 | 210 |
subsection \<open>Frechet derivative and Jacobian matrix\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
211 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
212 |
definition "frechet_derivative f net = (SOME f'. (f has_derivative f') net)" |
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
213 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
214 |
lemma frechet_derivative_works: |
53781 | 215 |
"f differentiable net \<longleftrightarrow> (f has_derivative (frechet_derivative f net)) net" |
216 |
unfolding frechet_derivative_def differentiable_def |
|
217 |
unfolding some_eq_ex[of "\<lambda> f' . (f has_derivative f') net"] .. |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
218 |
|
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
219 |
lemma linear_frechet_derivative: "f differentiable net \<Longrightarrow> linear (frechet_derivative f net)" |
44123 | 220 |
unfolding frechet_derivative_works has_derivative_def |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
221 |
by (auto intro: bounded_linear.linear) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
222 |
|
53781 | 223 |
|
60420 | 224 |
subsection \<open>Differentiability implies continuity\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
225 |
|
44123 | 226 |
lemma differentiable_imp_continuous_within: |
51642
400ec5ae7f8f
move FrechetDeriv from the Library to HOL/Deriv; base DERIV on FDERIV and both derivatives allow a restricted support set; FDERIV is now an abbreviation of has_derivative
hoelzl
parents:
51641
diff
changeset
|
227 |
"f differentiable (at x within s) \<Longrightarrow> continuous (at x within s) f" |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
228 |
by (auto simp: differentiable_def intro: has_derivative_continuous) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
229 |
|
44123 | 230 |
lemma differentiable_imp_continuous_on: |
231 |
"f differentiable_on s \<Longrightarrow> continuous_on s f" |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
232 |
unfolding differentiable_on_def continuous_on_eq_continuous_within |
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
233 |
using differentiable_imp_continuous_within by blast |
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
234 |
|
44123 | 235 |
lemma differentiable_on_subset: |
236 |
"f differentiable_on t \<Longrightarrow> s \<subseteq> t \<Longrightarrow> f differentiable_on s" |
|
53781 | 237 |
unfolding differentiable_on_def |
238 |
using differentiable_within_subset |
|
239 |
by blast |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
240 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
241 |
lemma differentiable_on_empty: "f differentiable_on {}" |
53781 | 242 |
unfolding differentiable_on_def |
243 |
by auto |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
244 |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
245 |
lemma has_derivative_continuous_on: |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
246 |
"(\<And>x. x \<in> s \<Longrightarrow> (f has_derivative f' x) (at x within s)) \<Longrightarrow> continuous_on s f" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
247 |
by (auto intro!: differentiable_imp_continuous_on differentiableI simp: differentiable_on_def) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
248 |
|
60420 | 249 |
text \<open>Results about neighborhoods filter.\<close> |
56151 | 250 |
|
251 |
lemma eventually_nhds_metric_le: |
|
252 |
"eventually P (nhds a) = (\<exists>d>0. \<forall>x. dist x a \<le> d \<longrightarrow> P x)" |
|
253 |
unfolding eventually_nhds_metric by (safe, rule_tac x="d / 2" in exI, auto) |
|
254 |
||
255 |
lemma le_nhds: "F \<le> nhds a \<longleftrightarrow> (\<forall>S. open S \<and> a \<in> S \<longrightarrow> eventually (\<lambda>x. x \<in> S) F)" |
|
61810 | 256 |
unfolding le_filter_def eventually_nhds by (fast elim: eventually_mono) |
56151 | 257 |
|
258 |
lemma le_nhds_metric: "F \<le> nhds a \<longleftrightarrow> (\<forall>e>0. eventually (\<lambda>x. dist x a < e) F)" |
|
61810 | 259 |
unfolding le_filter_def eventually_nhds_metric by (fast elim: eventually_mono) |
56151 | 260 |
|
261 |
lemma le_nhds_metric_le: "F \<le> nhds a \<longleftrightarrow> (\<forall>e>0. eventually (\<lambda>x. dist x a \<le> e) F)" |
|
61810 | 262 |
unfolding le_filter_def eventually_nhds_metric_le by (fast elim: eventually_mono) |
56151 | 263 |
|
60420 | 264 |
text \<open>Several results are easier using a "multiplied-out" variant. |
265 |
(I got this idea from Dieudonne's proof of the chain rule).\<close> |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
266 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
267 |
lemma has_derivative_within_alt: |
53781 | 268 |
"(f has_derivative f') (at x within s) \<longleftrightarrow> bounded_linear f' \<and> |
269 |
(\<forall>e>0. \<exists>d>0. \<forall>y\<in>s. norm(y - x) < d \<longrightarrow> norm (f y - f x - f' (y - x)) \<le> e * norm (y - x))" |
|
56151 | 270 |
unfolding has_derivative_within filterlim_def le_nhds_metric_le eventually_filtermap |
59815
cce82e360c2f
explicit commutative additive inverse operation;
haftmann
parents:
59558
diff
changeset
|
271 |
eventually_at dist_norm diff_diff_eq |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
272 |
by (force simp add: linear_0 bounded_linear.linear pos_divide_le_eq) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
273 |
|
56320 | 274 |
lemma has_derivative_within_alt2: |
275 |
"(f has_derivative f') (at x within s) \<longleftrightarrow> bounded_linear f' \<and> |
|
276 |
(\<forall>e>0. eventually (\<lambda>y. norm (f y - f x - f' (y - x)) \<le> e * norm (y - x)) (at x within s))" |
|
277 |
unfolding has_derivative_within filterlim_def le_nhds_metric_le eventually_filtermap |
|
59815
cce82e360c2f
explicit commutative additive inverse operation;
haftmann
parents:
59558
diff
changeset
|
278 |
eventually_at dist_norm diff_diff_eq |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
279 |
by (force simp add: linear_0 bounded_linear.linear pos_divide_le_eq) |
56320 | 280 |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
281 |
lemma has_derivative_at_alt: |
53781 | 282 |
"(f has_derivative f') (at x) \<longleftrightarrow> |
283 |
bounded_linear f' \<and> |
|
284 |
(\<forall>e>0. \<exists>d>0. \<forall>y. norm(y - x) < d \<longrightarrow> norm (f y - f x - f'(y - x)) \<le> e * norm (y - x))" |
|
285 |
using has_derivative_within_alt[where s=UNIV] |
|
286 |
by simp |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
287 |
|
53781 | 288 |
|
60420 | 289 |
subsection \<open>The chain rule\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
290 |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
291 |
lemma diff_chain_within[derivative_intros]: |
44123 | 292 |
assumes "(f has_derivative f') (at x within s)" |
53781 | 293 |
and "(g has_derivative g') (at (f x) within (f ` s))" |
294 |
shows "((g \<circ> f) has_derivative (g' \<circ> f'))(at x within s)" |
|
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
295 |
using has_derivative_in_compose[OF assms] |
53781 | 296 |
by (simp add: comp_def) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
297 |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
298 |
lemma diff_chain_at[derivative_intros]: |
53781 | 299 |
"(f has_derivative f') (at x) \<Longrightarrow> |
300 |
(g has_derivative g') (at (f x)) \<Longrightarrow> ((g \<circ> f) has_derivative (g' \<circ> f')) (at x)" |
|
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
301 |
using has_derivative_compose[of f f' x UNIV g g'] |
53781 | 302 |
by (simp add: comp_def) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
303 |
|
68095
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
304 |
lemma has_vector_derivative_within_open: |
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
305 |
"a \<in> S \<Longrightarrow> open S \<Longrightarrow> |
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
306 |
(f has_vector_derivative f') (at a within S) \<longleftrightarrow> (f has_vector_derivative f') (at a)" |
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
307 |
by (simp only: at_within_interior interior_open) |
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
308 |
|
64394 | 309 |
lemma field_vector_diff_chain_within: |
68095
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
310 |
assumes Df: "(f has_vector_derivative f') (at x within S)" |
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
311 |
and Dg: "(g has_field_derivative g') (at (f x) within f ` S)" |
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
312 |
shows "((g \<circ> f) has_vector_derivative (f' * g')) (at x within S)" |
64394 | 313 |
using diff_chain_within[OF Df[unfolded has_vector_derivative_def] |
314 |
Dg [unfolded has_field_derivative_def]] |
|
315 |
by (auto simp: o_def mult.commute has_vector_derivative_def) |
|
316 |
||
317 |
lemma vector_derivative_diff_chain_within: |
|
68095
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
318 |
assumes Df: "(f has_vector_derivative f') (at x within S)" |
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
319 |
and Dg: "(g has_derivative g') (at (f x) within f`S)" |
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
320 |
shows "((g \<circ> f) has_vector_derivative (g' f')) (at x within S)" |
64394 | 321 |
using diff_chain_within[OF Df[unfolded has_vector_derivative_def] Dg] |
322 |
linear.scaleR[OF has_derivative_linear[OF Dg]] |
|
323 |
unfolding has_vector_derivative_def o_def |
|
324 |
by (auto simp: o_def mult.commute has_vector_derivative_def) |
|
325 |
||
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
326 |
|
60420 | 327 |
subsection \<open>Composition rules stated just for differentiability\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
328 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
329 |
lemma differentiable_chain_at: |
53781 | 330 |
"f differentiable (at x) \<Longrightarrow> |
331 |
g differentiable (at (f x)) \<Longrightarrow> (g \<circ> f) differentiable (at x)" |
|
332 |
unfolding differentiable_def |
|
333 |
by (meson diff_chain_at) |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
334 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
335 |
lemma differentiable_chain_within: |
68095
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
336 |
"f differentiable (at x within S) \<Longrightarrow> |
4fa3e63ecc7e
starting to tidy up Interval_Integral.thy
paulson <lp15@cam.ac.uk>
parents:
68073
diff
changeset
|
337 |
g differentiable (at(f x) within (f ` S)) \<Longrightarrow> (g \<circ> f) differentiable (at x within S)" |
53781 | 338 |
unfolding differentiable_def |
339 |
by (meson diff_chain_within) |
|
340 |
||
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
341 |
|
60420 | 342 |
subsection \<open>Uniqueness of derivative\<close> |
37730 | 343 |
|
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
344 |
|
60420 | 345 |
text \<open> |
37730 | 346 |
The general result is a bit messy because we need approachability of the |
347 |
limit point from any direction. But OK for nontrivial intervals etc. |
|
60420 | 348 |
\<close> |
51363
d4d00c804645
changed has_derivative_intros into a named theorems collection
hoelzl
parents:
50939
diff
changeset
|
349 |
|
44123 | 350 |
lemma frechet_derivative_unique_within: |
351 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" |
|
68239 | 352 |
assumes 1: "(f has_derivative f') (at x within S)" |
353 |
and 2: "(f has_derivative f'') (at x within S)" |
|
354 |
and S: "\<And>i e. \<lbrakk>i\<in>Basis; e>0\<rbrakk> \<Longrightarrow> \<exists>d. 0 < \<bar>d\<bar> \<and> \<bar>d\<bar> < e \<and> (x + d *\<^sub>R i) \<in> S" |
|
44123 | 355 |
shows "f' = f''" |
53781 | 356 |
proof - |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
357 |
note as = assms(1,2)[unfolded has_derivative_def] |
44123 | 358 |
then interpret f': bounded_linear f' by auto |
359 |
from as interpret f'': bounded_linear f'' by auto |
|
68058 | 360 |
have "x islimpt S" unfolding islimpt_approachable |
68239 | 361 |
proof (intro allI impI) |
53781 | 362 |
fix e :: real |
363 |
assume "e > 0" |
|
68058 | 364 |
obtain d where "0 < \<bar>d\<bar>" and "\<bar>d\<bar> < e" and "x + d *\<^sub>R (SOME i. i \<in> Basis) \<in> S" |
60420 | 365 |
using assms(3) SOME_Basis \<open>e>0\<close> by blast |
68058 | 366 |
then show "\<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e" |
68239 | 367 |
by (rule_tac x="x + d *\<^sub>R (SOME i. i \<in> Basis)" in bexI) (auto simp: dist_norm SOME_Basis nonzero_Basis) qed |
68058 | 368 |
then have *: "netlimit (at x within S) = x" |
68239 | 369 |
by (simp add: Lim_ident_at trivial_limit_within) |
53781 | 370 |
show ?thesis |
68058 | 371 |
proof (rule linear_eq_stdbasis) |
372 |
show "linear f'" "linear f''" |
|
373 |
unfolding linear_conv_bounded_linear using as by auto |
|
374 |
next |
|
53781 | 375 |
fix i :: 'a |
376 |
assume i: "i \<in> Basis" |
|
63040 | 377 |
define e where "e = norm (f' i - f'' i)" |
68058 | 378 |
show "f' i = f'' i" |
379 |
proof (rule ccontr) |
|
380 |
assume "f' i \<noteq> f'' i" |
|
381 |
then have "e > 0" |
|
382 |
unfolding e_def by auto |
|
383 |
obtain d where d: |
|
384 |
"0 < d" |
|
385 |
"(\<And>y. y\<in>S \<longrightarrow> 0 < dist y x \<and> dist y x < d \<longrightarrow> |
|
386 |
dist ((f y - f x - f' (y - x)) /\<^sub>R norm (y - x) - |
|
387 |
(f y - f x - f'' (y - x)) /\<^sub>R norm (y - x)) (0 - 0) < e)" |
|
388 |
using tendsto_diff [OF as(1,2)[THEN conjunct2]] |
|
389 |
unfolding * Lim_within |
|
390 |
using \<open>e>0\<close> by blast |
|
391 |
obtain c where c: "0 < \<bar>c\<bar>" "\<bar>c\<bar> < d \<and> x + c *\<^sub>R i \<in> S" |
|
392 |
using assms(3) i d(1) by blast |
|
393 |
have *: "norm (- ((1 / \<bar>c\<bar>) *\<^sub>R f' (c *\<^sub>R i)) + (1 / \<bar>c\<bar>) *\<^sub>R f'' (c *\<^sub>R i)) = |
|
61945 | 394 |
norm ((1 / \<bar>c\<bar>) *\<^sub>R (- (f' (c *\<^sub>R i)) + f'' (c *\<^sub>R i)))" |
68058 | 395 |
unfolding scaleR_right_distrib by auto |
396 |
also have "\<dots> = norm ((1 / \<bar>c\<bar>) *\<^sub>R (c *\<^sub>R (- (f' i) + f'' i)))" |
|
397 |
unfolding f'.scaleR f''.scaleR |
|
398 |
unfolding scaleR_right_distrib scaleR_minus_right |
|
399 |
by auto |
|
400 |
also have "\<dots> = e" |
|
401 |
unfolding e_def |
|
402 |
using c(1) |
|
403 |
using norm_minus_cancel[of "f' i - f'' i"] |
|
404 |
by auto |
|
405 |
finally show False |
|
406 |
using c |
|
407 |
using d(2)[of "x + c *\<^sub>R i"] |
|
408 |
unfolding dist_norm |
|
409 |
unfolding f'.scaleR f''.scaleR f'.add f''.add f'.diff f''.diff |
|
410 |
scaleR_scaleR scaleR_right_diff_distrib scaleR_right_distrib |
|
411 |
using i |
|
412 |
by (auto simp: inverse_eq_divide) |
|
413 |
qed |
|
44123 | 414 |
qed |
415 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
416 |
|
44123 | 417 |
lemma frechet_derivative_unique_within_closed_interval: |
56188 | 418 |
fixes f::"'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" |
68239 | 419 |
assumes ab: "\<And>i. i\<in>Basis \<Longrightarrow> a\<bullet>i < b\<bullet>i" |
420 |
and x: "x \<in> cbox a b" |
|
56188 | 421 |
and "(f has_derivative f' ) (at x within cbox a b)" |
422 |
and "(f has_derivative f'') (at x within cbox a b)" |
|
44123 | 423 |
shows "f' = f''" |
68239 | 424 |
proof (rule frechet_derivative_unique_within) |
53781 | 425 |
fix e :: real |
426 |
fix i :: 'a |
|
427 |
assume "e > 0" and i: "i \<in> Basis" |
|
56188 | 428 |
then show "\<exists>d. 0 < \<bar>d\<bar> \<and> \<bar>d\<bar> < e \<and> x + d *\<^sub>R i \<in> cbox a b" |
53781 | 429 |
proof (cases "x\<bullet>i = a\<bullet>i") |
430 |
case True |
|
68239 | 431 |
with ab[of i] \<open>e>0\<close> x i show ?thesis |
432 |
by (rule_tac x="(min (b\<bullet>i - a\<bullet>i) e) / 2" in exI) |
|
433 |
(auto simp add: mem_box field_simps inner_simps inner_Basis) |
|
53781 | 434 |
next |
435 |
case False |
|
436 |
moreover have "a \<bullet> i < x \<bullet> i" |
|
68239 | 437 |
using False i mem_box(2) x by force |
44123 | 438 |
moreover { |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50418
diff
changeset
|
439 |
have "a \<bullet> i * 2 + min (x \<bullet> i - a \<bullet> i) e \<le> a\<bullet>i *2 + x\<bullet>i - a\<bullet>i" |
44123 | 440 |
by auto |
53781 | 441 |
also have "\<dots> = a\<bullet>i + x\<bullet>i" |
442 |
by auto |
|
443 |
also have "\<dots> \<le> 2 * (x\<bullet>i)" |
|
68239 | 444 |
using \<open>a \<bullet> i < x \<bullet> i\<close> by auto |
53781 | 445 |
finally have "a \<bullet> i * 2 + min (x \<bullet> i - a \<bullet> i) e \<le> x \<bullet> i * 2" |
446 |
by auto |
|
44123 | 447 |
} |
53781 | 448 |
moreover have "min (x \<bullet> i - a \<bullet> i) e \<ge> 0" |
68239 | 449 |
by (simp add: \<open>0 < e\<close> \<open>a \<bullet> i < x \<bullet> i\<close> less_eq_real_def) |
53781 | 450 |
then have "x \<bullet> i * 2 \<le> b \<bullet> i * 2 + min (x \<bullet> i - a \<bullet> i) e" |
68239 | 451 |
using i mem_box(2) x by force |
44123 | 452 |
ultimately show ?thesis |
68239 | 453 |
using ab[of i] \<open>e>0\<close> x i |
454 |
by (rule_tac x="- (min (x\<bullet>i - a\<bullet>i) e) / 2" in exI) |
|
455 |
(auto simp add: mem_box field_simps inner_simps inner_Basis) |
|
44123 | 456 |
qed |
68239 | 457 |
qed (use assms in auto) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
458 |
|
44123 | 459 |
lemma frechet_derivative_unique_within_open_interval: |
56188 | 460 |
fixes f::"'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" |
68239 | 461 |
assumes x: "x \<in> box a b" |
462 |
and f: "(f has_derivative f' ) (at x within box a b)" "(f has_derivative f'') (at x within box a b)" |
|
37650 | 463 |
shows "f' = f''" |
464 |
proof - |
|
68239 | 465 |
have "at x within box a b = at x" |
466 |
by (metis x at_within_interior interior_open open_box) |
|
467 |
with f show "f' = f''" |
|
468 |
by (simp add: has_derivative_unique) |
|
37650 | 469 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
470 |
|
37730 | 471 |
lemma frechet_derivative_at: |
53781 | 472 |
"(f has_derivative f') (at x) \<Longrightarrow> f' = frechet_derivative f (at x)" |
68239 | 473 |
using differentiable_def frechet_derivative_works has_derivative_unique by blast |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
474 |
|
56188 | 475 |
lemma frechet_derivative_within_cbox: |
476 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" |
|
68239 | 477 |
assumes "\<And>i. i\<in>Basis \<Longrightarrow> a\<bullet>i < b\<bullet>i" |
56188 | 478 |
and "x \<in> cbox a b" |
479 |
and "(f has_derivative f') (at x within cbox a b)" |
|
480 |
shows "frechet_derivative f (at x within cbox a b) = f'" |
|
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
481 |
using assms |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
482 |
by (metis Derivative.differentiableI frechet_derivative_unique_within_closed_interval frechet_derivative_works) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
483 |
|
53781 | 484 |
|
60420 | 485 |
subsection \<open>The traditional Rolle theorem in one dimension\<close> |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
486 |
|
60420 | 487 |
text \<open>Derivatives of local minima and maxima are zero.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
488 |
|
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
489 |
lemma has_derivative_local_min: |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
490 |
fixes f :: "'a::real_normed_vector \<Rightarrow> real" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
491 |
assumes deriv: "(f has_derivative f') (at x)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
492 |
assumes min: "eventually (\<lambda>y. f x \<le> f y) (at x)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
493 |
shows "f' = (\<lambda>h. 0)" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
494 |
proof |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
495 |
fix h :: 'a |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
496 |
interpret f': bounded_linear f' |
56182
528fae0816ea
update syntax of has_*derivative to infix 50; fixed proofs
hoelzl
parents:
56181
diff
changeset
|
497 |
using deriv by (rule has_derivative_bounded_linear) |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
498 |
show "f' h = 0" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
499 |
proof (cases "h = 0") |
68239 | 500 |
case False |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
501 |
from min obtain d where d1: "0 < d" and d2: "\<forall>y\<in>ball x d. f x \<le> f y" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
502 |
unfolding eventually_at by (force simp: dist_commute) |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
503 |
have "FDERIV (\<lambda>r. x + r *\<^sub>R h) 0 :> (\<lambda>r. r *\<^sub>R h)" |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
504 |
by (intro derivative_eq_intros) auto |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
505 |
then have "FDERIV (\<lambda>r. f (x + r *\<^sub>R h)) 0 :> (\<lambda>k. f' (k *\<^sub>R h))" |
56182
528fae0816ea
update syntax of has_*derivative to infix 50; fixed proofs
hoelzl
parents:
56181
diff
changeset
|
506 |
by (rule has_derivative_compose, simp add: deriv) |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
507 |
then have "DERIV (\<lambda>r. f (x + r *\<^sub>R h)) 0 :> f' h" |
56182
528fae0816ea
update syntax of has_*derivative to infix 50; fixed proofs
hoelzl
parents:
56181
diff
changeset
|
508 |
unfolding has_field_derivative_def by (simp add: f'.scaleR mult_commute_abs) |
60420 | 509 |
moreover have "0 < d / norm h" using d1 and \<open>h \<noteq> 0\<close> by simp |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
510 |
moreover have "\<forall>y. \<bar>0 - y\<bar> < d / norm h \<longrightarrow> f (x + 0 *\<^sub>R h) \<le> f (x + y *\<^sub>R h)" |
60420 | 511 |
using \<open>h \<noteq> 0\<close> by (auto simp add: d2 dist_norm pos_less_divide_eq) |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
512 |
ultimately show "f' h = 0" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
513 |
by (rule DERIV_local_min) |
68239 | 514 |
qed simp |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
515 |
qed |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
516 |
|
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
517 |
lemma has_derivative_local_max: |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
518 |
fixes f :: "'a::real_normed_vector \<Rightarrow> real" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
519 |
assumes "(f has_derivative f') (at x)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
520 |
assumes "eventually (\<lambda>y. f y \<le> f x) (at x)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
521 |
shows "f' = (\<lambda>h. 0)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
522 |
using has_derivative_local_min [of "\<lambda>x. - f x" "\<lambda>h. - f' h" "x"] |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
523 |
using assms unfolding fun_eq_iff by simp |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
524 |
|
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
525 |
lemma differential_zero_maxmin: |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
526 |
fixes f::"'a::real_normed_vector \<Rightarrow> real" |
68239 | 527 |
assumes "x \<in> S" |
528 |
and "open S" |
|
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
529 |
and deriv: "(f has_derivative f') (at x)" |
68239 | 530 |
and mono: "(\<forall>y\<in>S. f y \<le> f x) \<or> (\<forall>y\<in>S. f x \<le> f y)" |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
531 |
shows "f' = (\<lambda>v. 0)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
532 |
using mono |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
533 |
proof |
68239 | 534 |
assume "\<forall>y\<in>S. f y \<le> f x" |
535 |
with \<open>x \<in> S\<close> and \<open>open S\<close> have "eventually (\<lambda>y. f y \<le> f x) (at x)" |
|
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
536 |
unfolding eventually_at_topological by auto |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
537 |
with deriv show ?thesis |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
538 |
by (rule has_derivative_local_max) |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
539 |
next |
68239 | 540 |
assume "\<forall>y\<in>S. f x \<le> f y" |
541 |
with \<open>x \<in> S\<close> and \<open>open S\<close> have "eventually (\<lambda>y. f x \<le> f y) (at x)" |
|
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
542 |
unfolding eventually_at_topological by auto |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
543 |
with deriv show ?thesis |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
544 |
by (rule has_derivative_local_min) |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
545 |
qed |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
546 |
|
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
547 |
lemma differential_zero_maxmin_component: (* TODO: delete? *) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
548 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50418
diff
changeset
|
549 |
assumes k: "k \<in> Basis" |
53781 | 550 |
and ball: "0 < e" "(\<forall>y \<in> ball x e. (f y)\<bullet>k \<le> (f x)\<bullet>k) \<or> (\<forall>y\<in>ball x e. (f x)\<bullet>k \<le> (f y)\<bullet>k)" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
551 |
and diff: "f differentiable (at x)" |
50526
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50418
diff
changeset
|
552 |
shows "(\<Sum>j\<in>Basis. (frechet_derivative f (at x) j \<bullet> k) *\<^sub>R j) = (0::'a)" (is "?D k = 0") |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
553 |
proof - |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
554 |
let ?f' = "frechet_derivative f (at x)" |
60420 | 555 |
have "x \<in> ball x e" using \<open>0 < e\<close> by simp |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
556 |
moreover have "open (ball x e)" by simp |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
557 |
moreover have "((\<lambda>x. f x \<bullet> k) has_derivative (\<lambda>h. ?f' h \<bullet> k)) (at x)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
558 |
using bounded_linear_inner_left diff[unfolded frechet_derivative_works] |
56182
528fae0816ea
update syntax of has_*derivative to infix 50; fixed proofs
hoelzl
parents:
56181
diff
changeset
|
559 |
by (rule bounded_linear.has_derivative) |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
560 |
ultimately have "(\<lambda>h. frechet_derivative f (at x) h \<bullet> k) = (\<lambda>v. 0)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
561 |
using ball(2) by (rule differential_zero_maxmin) |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
562 |
then show ?thesis |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
563 |
unfolding fun_eq_iff by simp |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
564 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
565 |
|
68239 | 566 |
theorem Rolle: |
53781 | 567 |
fixes f :: "real \<Rightarrow> real" |
568 |
assumes "a < b" |
|
68239 | 569 |
and fab: "f a = f b" |
570 |
and contf: "continuous_on {a..b} f" |
|
571 |
and derf: "\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (f has_derivative f' x) (at x)" |
|
56188 | 572 |
shows "\<exists>x\<in>{a <..< b}. f' x = (\<lambda>v. 0)" |
53781 | 573 |
proof - |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54230
diff
changeset
|
574 |
have "\<exists>x\<in>box a b. (\<forall>y\<in>box a b. f x \<le> f y) \<or> (\<forall>y\<in>box a b. f y \<le> f x)" |
53781 | 575 |
proof - |
68239 | 576 |
have "(a + b) / 2 \<in> {a..b}" |
53781 | 577 |
using assms(1) by auto |
68239 | 578 |
then have *: "{a..b} \<noteq> {}" |
53781 | 579 |
by auto |
68239 | 580 |
obtain d where d: "d \<in>cbox a b" "\<forall>y\<in>cbox a b. f y \<le> f d" |
581 |
using continuous_attains_sup[OF compact_Icc * contf] by auto |
|
582 |
obtain c where c: "c \<in> cbox a b" "\<forall>y\<in>cbox a b. f c \<le> f y" |
|
583 |
using continuous_attains_inf[OF compact_Icc * contf] by auto |
|
44123 | 584 |
show ?thesis |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54230
diff
changeset
|
585 |
proof (cases "d \<in> box a b \<or> c \<in> box a b") |
53781 | 586 |
case True |
587 |
then show ?thesis |
|
56188 | 588 |
by (metis c(2) d(2) box_subset_cbox subset_iff) |
44123 | 589 |
next |
63040 | 590 |
define e where "e = (a + b) /2" |
53781 | 591 |
case False |
592 |
then have "f d = f c" |
|
68239 | 593 |
using d c fab by auto |
594 |
with c d have "\<And>x. x \<in> {a..b} \<Longrightarrow> f x = f d" |
|
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
595 |
by force |
53781 | 596 |
then show ?thesis |
68239 | 597 |
by (rule_tac x=e in bexI) (auto simp: e_def \<open>a < b\<close>) |
44123 | 598 |
qed |
599 |
qed |
|
56188 | 600 |
then obtain x where x: "x \<in> {a <..< b}" "(\<forall>y\<in>{a <..< b}. f x \<le> f y) \<or> (\<forall>y\<in>{a <..< b}. f y \<le> f x)" |
601 |
by auto |
|
53781 | 602 |
then have "f' x = (\<lambda>v. 0)" |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54230
diff
changeset
|
603 |
apply (rule_tac differential_zero_maxmin[of x "box a b" f "f' x"]) |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
604 |
using assms |
53781 | 605 |
apply auto |
606 |
done |
|
607 |
then show ?thesis |
|
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
608 |
by (metis x(1)) |
44123 | 609 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
610 |
|
53781 | 611 |
|
60420 | 612 |
subsection \<open>One-dimensional mean value theorem\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
613 |
|
53781 | 614 |
lemma mvt: |
615 |
fixes f :: "real \<Rightarrow> real" |
|
616 |
assumes "a < b" |
|
68239 | 617 |
and contf: "continuous_on {a..b} f" |
618 |
and derf: "\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (f has_derivative f' x) (at x)" |
|
53781 | 619 |
shows "\<exists>x\<in>{a<..<b}. f b - f a = (f' x) (b - a)" |
620 |
proof - |
|
56188 | 621 |
have "\<exists>x\<in>{a <..< b}. (\<lambda>xa. f' x xa - (f b - f a) / (b - a) * xa) = (\<lambda>v. 0)" |
68239 | 622 |
proof (intro Rolle[OF \<open>a < b\<close>, of "\<lambda>x. f x - (f b - f a) / (b - a) * x"] ballI) |
53781 | 623 |
fix x |
68239 | 624 |
assume x: "a < x" "x < b" |
53781 | 625 |
show "((\<lambda>x. f x - (f b - f a) / (b - a) * x) has_derivative |
626 |
(\<lambda>xa. f' x xa - (f b - f a) / (b - a) * xa)) (at x)" |
|
68239 | 627 |
by (intro derivative_intros derf[OF x]) |
628 |
qed (use assms in \<open>auto intro!: continuous_intros simp: field_simps\<close>) |
|
55665 | 629 |
then obtain x where |
56188 | 630 |
"x \<in> {a <..< b}" |
55665 | 631 |
"(\<lambda>xa. f' x xa - (f b - f a) / (b - a) * xa) = (\<lambda>v. 0)" .. |
53781 | 632 |
then show ?thesis |
61762
d50b993b4fb9
Removal of redundant lemmas (diff_less_iff, diff_le_iff) and of the abbreviation Exp. Addition of some new material.
paulson <lp15@cam.ac.uk>
parents:
61649
diff
changeset
|
633 |
by (metis (hide_lams) assms(1) diff_gt_0_iff_gt eq_iff_diff_eq_0 |
64240 | 634 |
zero_less_mult_iff nonzero_mult_div_cancel_right not_real_square_gt_zero |
56188 | 635 |
times_divide_eq_left) |
44123 | 636 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
637 |
|
44123 | 638 |
lemma mvt_simple: |
53781 | 639 |
fixes f :: "real \<Rightarrow> real" |
640 |
assumes "a < b" |
|
68241
39a311f50344
correcting the statements of the MVTs
paulson <lp15@cam.ac.uk>
parents:
68239
diff
changeset
|
641 |
and derf: "\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (f has_derivative f' x) (at x within {a..b})" |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
642 |
shows "\<exists>x\<in>{a<..<b}. f b - f a = f' x (b - a)" |
56264 | 643 |
proof (rule mvt) |
644 |
have "f differentiable_on {a..b}" |
|
68241
39a311f50344
correcting the statements of the MVTs
paulson <lp15@cam.ac.uk>
parents:
68239
diff
changeset
|
645 |
using derf unfolding differentiable_on_def differentiable_def by force |
56264 | 646 |
then show "continuous_on {a..b} f" |
647 |
by (rule differentiable_imp_continuous_on) |
|
68239 | 648 |
show "(f has_derivative f' x) (at x)" if "a < x" "x < b" for x |
68241
39a311f50344
correcting the statements of the MVTs
paulson <lp15@cam.ac.uk>
parents:
68239
diff
changeset
|
649 |
by (metis at_within_Icc_at derf leI order.asym that) |
68239 | 650 |
qed (rule assms) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
651 |
|
44123 | 652 |
lemma mvt_very_simple: |
53781 | 653 |
fixes f :: "real \<Rightarrow> real" |
654 |
assumes "a \<le> b" |
|
68241
39a311f50344
correcting the statements of the MVTs
paulson <lp15@cam.ac.uk>
parents:
68239
diff
changeset
|
655 |
and derf: "\<And>x. \<lbrakk>a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (f has_derivative f' x) (at x within {a..b})" |
68239 | 656 |
shows "\<exists>x\<in>{a..b}. f b - f a = f' x (b - a)" |
44123 | 657 |
proof (cases "a = b") |
53781 | 658 |
interpret bounded_linear "f' b" |
659 |
using assms(2) assms(1) by auto |
|
660 |
case True |
|
661 |
then show ?thesis |
|
68239 | 662 |
by force |
53781 | 663 |
next |
664 |
case False |
|
665 |
then show ?thesis |
|
68239 | 666 |
using mvt_simple[OF _ derf] |
667 |
by (metis \<open>a \<le> b\<close> atLeastAtMost_iff dual_order.order_iff_strict greaterThanLessThan_iff) |
|
44123 | 668 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
669 |
|
60420 | 670 |
text \<open>A nice generalization (see Havin's proof of 5.19 from Rudin's book).\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
671 |
|
44123 | 672 |
lemma mvt_general: |
56223
7696903b9e61
generalize theory of operator norms to work with class real_normed_vector
huffman
parents:
56217
diff
changeset
|
673 |
fixes f :: "real \<Rightarrow> 'a::real_inner" |
53781 | 674 |
assumes "a < b" |
68239 | 675 |
and contf: "continuous_on {a..b} f" |
676 |
and derf: "\<And>x. \<lbrakk>a < x; x < b\<rbrakk> \<Longrightarrow> (f has_derivative f' x) (at x)" |
|
53781 | 677 |
shows "\<exists>x\<in>{a<..<b}. norm (f b - f a) \<le> norm (f' x (b - a))" |
678 |
proof - |
|
56264 | 679 |
have "\<exists>x\<in>{a<..<b}. (f b - f a) \<bullet> f b - (f b - f a) \<bullet> f a = (f b - f a) \<bullet> f' x (b - a)" |
68239 | 680 |
apply (rule mvt [OF \<open>a < b\<close>]) |
681 |
apply (intro continuous_intros contf) |
|
682 |
using derf apply (blast intro: has_derivative_inner_right) |
|
53781 | 683 |
done |
68239 | 684 |
then obtain x where x: "x \<in> {a<..<b}" |
56264 | 685 |
"(f b - f a) \<bullet> f b - (f b - f a) \<bullet> f a = (f b - f a) \<bullet> f' x (b - a)" .. |
53781 | 686 |
show ?thesis |
687 |
proof (cases "f a = f b") |
|
36844 | 688 |
case False |
53077 | 689 |
have "norm (f b - f a) * norm (f b - f a) = (norm (f b - f a))\<^sup>2" |
44123 | 690 |
by (simp add: power2_eq_square) |
53781 | 691 |
also have "\<dots> = (f b - f a) \<bullet> (f b - f a)" |
692 |
unfolding power2_norm_eq_inner .. |
|
44123 | 693 |
also have "\<dots> = (f b - f a) \<bullet> f' x (b - a)" |
56264 | 694 |
using x(2) by (simp only: inner_diff_right) |
44123 | 695 |
also have "\<dots> \<le> norm (f b - f a) * norm (f' x (b - a))" |
696 |
by (rule norm_cauchy_schwarz) |
|
53781 | 697 |
finally show ?thesis |
698 |
using False x(1) |
|
56217
dc429a5b13c4
Some rationalisation of basic lemmas
paulson <lp15@cam.ac.uk>
parents:
56196
diff
changeset
|
699 |
by (auto simp add: mult_left_cancel) |
44123 | 700 |
next |
53781 | 701 |
case True |
702 |
then show ?thesis |
|
68239 | 703 |
using \<open>a < b\<close> by (rule_tac x="(a + b) /2" in bexI) auto |
44123 | 704 |
qed |
705 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
706 |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
707 |
|
60420 | 708 |
subsection \<open>More general bound theorems\<close> |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
709 |
|
68239 | 710 |
proposition differentiable_bound_general: |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
711 |
fixes f :: "real \<Rightarrow> 'a::real_normed_vector" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
712 |
assumes "a < b" |
68239 | 713 |
and f_cont: "continuous_on {a..b} f" |
714 |
and phi_cont: "continuous_on {a..b} \<phi>" |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
715 |
and f': "\<And>x. a < x \<Longrightarrow> x < b \<Longrightarrow> (f has_vector_derivative f' x) (at x)" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
716 |
and phi': "\<And>x. a < x \<Longrightarrow> x < b \<Longrightarrow> (\<phi> has_vector_derivative \<phi>' x) (at x)" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
717 |
and bnd: "\<And>x. a < x \<Longrightarrow> x < b \<Longrightarrow> norm (f' x) \<le> \<phi>' x" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
718 |
shows "norm (f b - f a) \<le> \<phi> b - \<phi> a" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
719 |
proof - |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
720 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
721 |
fix x assume x: "a < x" "x < b" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
722 |
have "0 \<le> norm (f' x)" by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
723 |
also have "\<dots> \<le> \<phi>' x" using x by (auto intro!: bnd) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
724 |
finally have "0 \<le> \<phi>' x" . |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
725 |
} note phi'_nonneg = this |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
726 |
note f_tendsto = assms(2)[simplified continuous_on_def, rule_format] |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
727 |
note phi_tendsto = assms(3)[simplified continuous_on_def, rule_format] |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
728 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
729 |
fix e::real assume "e > 0" |
63040 | 730 |
define e2 where "e2 = e / 2" |
731 |
with \<open>e > 0\<close> have "e2 > 0" by simp |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
732 |
let ?le = "\<lambda>x1. norm (f x1 - f a) \<le> \<phi> x1 - \<phi> a + e * (x1 - a) + e" |
63040 | 733 |
define A where "A = {x2. a \<le> x2 \<and> x2 \<le> b \<and> (\<forall>x1\<in>{a ..< x2}. ?le x1)}" |
68239 | 734 |
have A_subset: "A \<subseteq> {a..b}" by (auto simp: A_def) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
735 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
736 |
fix x2 |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
737 |
assume a: "a \<le> x2" "x2 \<le> b" and le: "\<forall>x1\<in>{a..<x2}. ?le x1" |
60420 | 738 |
have "?le x2" using \<open>e > 0\<close> |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
739 |
proof cases |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
740 |
assume "x2 \<noteq> a" with a have "a < x2" by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
741 |
have "at x2 within {a <..<x2}\<noteq> bot" |
60420 | 742 |
using \<open>a < x2\<close> |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
743 |
by (auto simp: trivial_limit_within islimpt_in_closure) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
744 |
moreover |
61973 | 745 |
have "((\<lambda>x1. (\<phi> x1 - \<phi> a) + e * (x1 - a) + e) \<longlongrightarrow> (\<phi> x2 - \<phi> a) + e * (x2 - a) + e) (at x2 within {a <..<x2})" |
746 |
"((\<lambda>x1. norm (f x1 - f a)) \<longlongrightarrow> norm (f x2 - f a)) (at x2 within {a <..<x2})" |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
747 |
using a |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
748 |
by (auto intro!: tendsto_eq_intros f_tendsto phi_tendsto |
68239 | 749 |
intro: tendsto_within_subset[where S="{a..b}"]) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
750 |
moreover |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
751 |
have "eventually (\<lambda>x. x > a) (at x2 within {a <..<x2})" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
752 |
by (auto simp: eventually_at_filter) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
753 |
hence "eventually ?le (at x2 within {a <..<x2})" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
754 |
unfolding eventually_at_filter |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
755 |
by eventually_elim (insert le, auto) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
756 |
ultimately |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
757 |
show ?thesis |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
758 |
by (rule tendsto_le) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
759 |
qed simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
760 |
} note le_cont = this |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
761 |
have "a \<in> A" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
762 |
using assms by (auto simp: A_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
763 |
hence [simp]: "A \<noteq> {}" by auto |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
764 |
have A_ivl: "\<And>x1 x2. x2 \<in> A \<Longrightarrow> x1 \<in> {a ..x2} \<Longrightarrow> x1 \<in> A" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
765 |
by (simp add: A_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
766 |
have [simp]: "bdd_above A" by (auto simp: A_def) |
63040 | 767 |
define y where "y = Sup A" |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
768 |
have "y \<le> b" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
769 |
unfolding y_def |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
770 |
by (simp add: cSup_le_iff) (simp add: A_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
771 |
have leI: "\<And>x x1. a \<le> x1 \<Longrightarrow> x \<in> A \<Longrightarrow> x1 < x \<Longrightarrow> ?le x1" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
772 |
by (auto simp: A_def intro!: le_cont) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
773 |
have y_all_le: "\<forall>x1\<in>{a..<y}. ?le x1" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
774 |
by (auto simp: y_def less_cSup_iff leI) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
775 |
have "a \<le> y" |
60420 | 776 |
by (metis \<open>a \<in> A\<close> \<open>bdd_above A\<close> cSup_upper y_def) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
777 |
have "y \<in> A" |
60420 | 778 |
using y_all_le \<open>a \<le> y\<close> \<open>y \<le> b\<close> |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
779 |
by (auto simp: A_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
780 |
hence "A = {a .. y}" |
68239 | 781 |
using A_subset by (auto simp: subset_iff y_def cSup_upper intro: A_ivl) |
60420 | 782 |
from le_cont[OF \<open>a \<le> y\<close> \<open>y \<le> b\<close> y_all_le] have le_y: "?le y" . |
68239 | 783 |
have "y = b" |
784 |
proof (cases "a = y") |
|
785 |
case True |
|
60420 | 786 |
with \<open>a < b\<close> have "y < b" by simp |
787 |
with \<open>a = y\<close> f_cont phi_cont \<open>e2 > 0\<close> |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
788 |
have 1: "\<forall>\<^sub>F x in at y within {y..b}. dist (f x) (f y) < e2" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
789 |
and 2: "\<forall>\<^sub>F x in at y within {y..b}. dist (\<phi> x) (\<phi> y) < e2" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
790 |
by (auto simp: continuous_on_def tendsto_iff) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
791 |
have 3: "eventually (\<lambda>x. y < x) (at y within {y..b})" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
792 |
by (auto simp: eventually_at_filter) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
793 |
have 4: "eventually (\<lambda>x::real. x < b) (at y within {y..b})" |
60420 | 794 |
using _ \<open>y < b\<close> |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
795 |
by (rule order_tendstoD) (auto intro!: tendsto_eq_intros) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
796 |
from 1 2 3 4 |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
797 |
have eventually_le: "eventually (\<lambda>x. ?le x) (at y within {y .. b})" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
798 |
proof eventually_elim |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
799 |
case (elim x1) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
800 |
have "norm (f x1 - f a) = norm (f x1 - f y)" |
60420 | 801 |
by (simp add: \<open>a = y\<close>) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
802 |
also have "norm (f x1 - f y) \<le> e2" |
60420 | 803 |
using elim \<open>a = y\<close> by (auto simp : dist_norm intro!: less_imp_le) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
804 |
also have "\<dots> \<le> e2 + (\<phi> x1 - \<phi> a + e2 + e * (x1 - a))" |
60420 | 805 |
using \<open>0 < e\<close> elim |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
806 |
by (intro add_increasing2[OF add_nonneg_nonneg order.refl]) |
60420 | 807 |
(auto simp: \<open>a = y\<close> dist_norm intro!: mult_nonneg_nonneg) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
808 |
also have "\<dots> = \<phi> x1 - \<phi> a + e * (x1 - a) + e" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
809 |
by (simp add: e2_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
810 |
finally show "?le x1" . |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
811 |
qed |
60420 | 812 |
from this[unfolded eventually_at_topological] \<open>?le y\<close> |
68239 | 813 |
obtain S where S: "open S" "y \<in> S" "\<And>x. x\<in>S \<Longrightarrow> x \<in> {y..b} \<Longrightarrow> ?le x" |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
814 |
by metis |
60420 | 815 |
from \<open>open S\<close> obtain d where d: "\<And>x. dist x y < d \<Longrightarrow> x \<in> S" "d > 0" |
62101 | 816 |
by (force simp: dist_commute open_dist ball_def dest!: bspec[OF _ \<open>y \<in> S\<close>]) |
63040 | 817 |
define d' where "d' = min b (y + (d/2))" |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
818 |
have "d' \<in> A" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
819 |
unfolding A_def |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
820 |
proof safe |
60420 | 821 |
show "a \<le> d'" using \<open>a = y\<close> \<open>0 < d\<close> \<open>y < b\<close> by (simp add: d'_def) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
822 |
show "d' \<le> b" by (simp add: d'_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
823 |
fix x1 |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
824 |
assume "x1 \<in> {a..<d'}" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
825 |
hence "x1 \<in> S" "x1 \<in> {y..b}" |
60420 | 826 |
by (auto simp: \<open>a = y\<close> d'_def dist_real_def intro!: d ) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
827 |
thus "?le x1" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
828 |
by (rule S) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
829 |
qed |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
830 |
hence "d' \<le> y" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
831 |
unfolding y_def |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
832 |
by (rule cSup_upper) simp |
68239 | 833 |
then show "y = b" using \<open>d > 0\<close> \<open>y < b\<close> |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
834 |
by (simp add: d'_def) |
68239 | 835 |
next |
836 |
case False |
|
837 |
with \<open>a \<le> y\<close> have "a < y" by simp |
|
838 |
show "y = b" |
|
839 |
proof (rule ccontr) |
|
840 |
assume "y \<noteq> b" |
|
841 |
hence "y < b" using \<open>y \<le> b\<close> by simp |
|
842 |
let ?F = "at y within {y..<b}" |
|
843 |
from f' phi' |
|
844 |
have "(f has_vector_derivative f' y) ?F" |
|
845 |
and "(\<phi> has_vector_derivative \<phi>' y) ?F" |
|
846 |
using \<open>a < y\<close> \<open>y < b\<close> |
|
847 |
by (auto simp add: at_within_open[of _ "{a<..<b}"] has_vector_derivative_def |
|
848 |
intro!: has_derivative_subset[where s="{a<..<b}" and t="{y..<b}"]) |
|
849 |
hence "\<forall>\<^sub>F x1 in ?F. norm (f x1 - f y - (x1 - y) *\<^sub>R f' y) \<le> e2 * \<bar>x1 - y\<bar>" |
|
850 |
"\<forall>\<^sub>F x1 in ?F. norm (\<phi> x1 - \<phi> y - (x1 - y) *\<^sub>R \<phi>' y) \<le> e2 * \<bar>x1 - y\<bar>" |
|
851 |
using \<open>e2 > 0\<close> |
|
852 |
by (auto simp: has_derivative_within_alt2 has_vector_derivative_def) |
|
853 |
moreover |
|
854 |
have "\<forall>\<^sub>F x1 in ?F. y \<le> x1" "\<forall>\<^sub>F x1 in ?F. x1 < b" |
|
855 |
by (auto simp: eventually_at_filter) |
|
856 |
ultimately |
|
857 |
have "\<forall>\<^sub>F x1 in ?F. norm (f x1 - f y) \<le> (\<phi> x1 - \<phi> y) + e * \<bar>x1 - y\<bar>" |
|
858 |
(is "\<forall>\<^sub>F x1 in ?F. ?le' x1") |
|
859 |
proof eventually_elim |
|
860 |
case (elim x1) |
|
861 |
from norm_triangle_ineq2[THEN order_trans, OF elim(1)] |
|
862 |
have "norm (f x1 - f y) \<le> norm (f' y) * \<bar>x1 - y\<bar> + e2 * \<bar>x1 - y\<bar>" |
|
863 |
by (simp add: ac_simps) |
|
864 |
also have "norm (f' y) \<le> \<phi>' y" using bnd \<open>a < y\<close> \<open>y < b\<close> by simp |
|
865 |
also have "\<phi>' y * \<bar>x1 - y\<bar> \<le> \<phi> x1 - \<phi> y + e2 * \<bar>x1 - y\<bar>" |
|
866 |
using elim by (simp add: ac_simps) |
|
867 |
finally |
|
868 |
have "norm (f x1 - f y) \<le> \<phi> x1 - \<phi> y + e2 * \<bar>x1 - y\<bar> + e2 * \<bar>x1 - y\<bar>" |
|
869 |
by (auto simp: mult_right_mono) |
|
870 |
thus ?case by (simp add: e2_def) |
|
871 |
qed |
|
872 |
moreover have "?le' y" by simp |
|
873 |
ultimately obtain S |
|
874 |
where S: "open S" "y \<in> S" "\<And>x. x\<in>S \<Longrightarrow> x \<in> {y..<b} \<Longrightarrow> ?le' x" |
|
875 |
unfolding eventually_at_topological |
|
876 |
by metis |
|
877 |
from \<open>open S\<close> obtain d where d: "\<And>x. dist x y < d \<Longrightarrow> x \<in> S" "d > 0" |
|
878 |
by (force simp: dist_commute open_dist ball_def dest!: bspec[OF _ \<open>y \<in> S\<close>]) |
|
879 |
define d' where "d' = min ((y + b)/2) (y + (d/2))" |
|
880 |
have "d' \<in> A" |
|
881 |
unfolding A_def |
|
882 |
proof safe |
|
883 |
show "a \<le> d'" using \<open>a < y\<close> \<open>0 < d\<close> \<open>y < b\<close> by (simp add: d'_def) |
|
884 |
show "d' \<le> b" using \<open>y < b\<close> by (simp add: d'_def min_def) |
|
885 |
fix x1 |
|
886 |
assume x1: "x1 \<in> {a..<d'}" |
|
887 |
show "?le x1" |
|
888 |
proof (cases "x1 < y") |
|
889 |
case True |
|
890 |
then show ?thesis |
|
891 |
using \<open>y \<in> A\<close> local.leI x1 by auto |
|
892 |
next |
|
893 |
case False |
|
894 |
hence x1': "x1 \<in> S" "x1 \<in> {y..<b}" using x1 |
|
895 |
by (auto simp: d'_def dist_real_def intro!: d) |
|
896 |
have "norm (f x1 - f a) \<le> norm (f x1 - f y) + norm (f y - f a)" |
|
897 |
by (rule order_trans[OF _ norm_triangle_ineq]) simp |
|
898 |
also note S(3)[OF x1'] |
|
899 |
also note le_y |
|
900 |
finally show "?le x1" |
|
901 |
using False by (auto simp: algebra_simps) |
|
902 |
qed |
|
903 |
qed |
|
904 |
hence "d' \<le> y" |
|
905 |
unfolding y_def by (rule cSup_upper) simp |
|
906 |
thus False using \<open>d > 0\<close> \<open>y < b\<close> |
|
907 |
by (simp add: d'_def min_def split: if_split_asm) |
|
908 |
qed |
|
909 |
qed |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
910 |
with le_y have "norm (f b - f a) \<le> \<phi> b - \<phi> a + e * (b - a + 1)" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
911 |
by (simp add: algebra_simps) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
912 |
} note * = this |
68239 | 913 |
show ?thesis |
914 |
proof (rule field_le_epsilon) |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
915 |
fix e::real assume "e > 0" |
68239 | 916 |
then show "norm (f b - f a) \<le> \<phi> b - \<phi> a + e" |
60420 | 917 |
using *[of "e / (b - a + 1)"] \<open>a < b\<close> by simp |
68239 | 918 |
qed |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
919 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
920 |
|
44123 | 921 |
lemma differentiable_bound: |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
922 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
68239 | 923 |
assumes "convex S" |
924 |
and derf: "\<And>x. x\<in>S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
|
925 |
and B: "\<And>x. x \<in> S \<Longrightarrow> onorm (f' x) \<le> B" |
|
926 |
and x: "x \<in> S" |
|
927 |
and y: "y \<in> S" |
|
53781 | 928 |
shows "norm (f x - f y) \<le> B * norm (x - y)" |
929 |
proof - |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
930 |
let ?p = "\<lambda>u. x + u *\<^sub>R (y - x)" |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
931 |
let ?\<phi> = "\<lambda>h. h * B * norm (x - y)" |
68239 | 932 |
have *: "x + u *\<^sub>R (y - x) \<in> S" if "u \<in> {0..1}" for u |
933 |
proof - |
|
934 |
have "u *\<^sub>R y = u *\<^sub>R (y - x) + u *\<^sub>R x" |
|
935 |
by (simp add: scale_right_diff_distrib) |
|
936 |
then show "x + u *\<^sub>R (y - x) \<in> S" |
|
937 |
using that \<open>convex S\<close> unfolding convex_alt by (metis (no_types) atLeastAtMost_iff linordered_field_class.sign_simps(2) pth_c(3) scaleR_collapse x y) |
|
938 |
qed |
|
939 |
have "\<And>z. z \<in> (\<lambda>u. x + u *\<^sub>R (y - x)) ` {0..1} \<Longrightarrow> |
|
940 |
(f has_derivative f' z) (at z within (\<lambda>u. x + u *\<^sub>R (y - x)) ` {0..1})" |
|
941 |
by (auto intro: * has_derivative_within_subset [OF derf]) |
|
942 |
then have "continuous_on (?p ` {0..1}) f" |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
943 |
unfolding continuous_on_eq_continuous_within |
68239 | 944 |
by (meson has_derivative_continuous) |
945 |
with * have 1: "continuous_on {0 .. 1} (f \<circ> ?p)" |
|
946 |
by (intro continuous_intros)+ |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
947 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
948 |
fix u::real assume u: "u \<in>{0 <..< 1}" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
949 |
let ?u = "?p u" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
950 |
interpret linear "(f' ?u)" |
68239 | 951 |
using u by (auto intro!: has_derivative_linear derf *) |
56188 | 952 |
have "(f \<circ> ?p has_derivative (f' ?u) \<circ> (\<lambda>u. 0 + u *\<^sub>R (y - x))) (at u within box 0 1)" |
68239 | 953 |
by (intro derivative_intros has_derivative_within_subset [OF derf]) (use u * in auto) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
954 |
hence "((f \<circ> ?p) has_vector_derivative f' ?u (y - x)) (at u)" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
955 |
by (simp add: has_derivative_within_open[OF u open_greaterThanLessThan] |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
956 |
scaleR has_vector_derivative_def o_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
957 |
} note 2 = this |
68239 | 958 |
have 3: "continuous_on {0..1} ?\<phi>" |
959 |
by (rule continuous_intros)+ |
|
960 |
have 4: "(?\<phi> has_vector_derivative B * norm (x - y)) (at u)" for u |
|
961 |
by (auto simp: has_vector_derivative_def intro!: derivative_eq_intros) |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
962 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
963 |
fix u::real assume u: "u \<in>{0 <..< 1}" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
964 |
let ?u = "?p u" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
965 |
interpret bounded_linear "(f' ?u)" |
68239 | 966 |
using u by (auto intro!: has_derivative_bounded_linear derf *) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
967 |
have "norm (f' ?u (y - x)) \<le> onorm (f' ?u) * norm (y - x)" |
67682
00c436488398
tuned proofs -- prefer explicit names for facts from 'interpret';
wenzelm
parents:
67399
diff
changeset
|
968 |
by (rule onorm) (rule bounded_linear) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
969 |
also have "onorm (f' ?u) \<le> B" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
970 |
using u by (auto intro!: assms(3)[rule_format] *) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
971 |
finally have "norm ((f' ?u) (y - x)) \<le> B * norm (x - y)" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
972 |
by (simp add: mult_right_mono norm_minus_commute) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
973 |
} note 5 = this |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
974 |
have "norm (f x - f y) = norm ((f \<circ> (\<lambda>u. x + u *\<^sub>R (y - x))) 1 - (f \<circ> (\<lambda>u. x + u *\<^sub>R (y - x))) 0)" |
53781 | 975 |
by (auto simp add: norm_minus_commute) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
976 |
also |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
977 |
from differentiable_bound_general[OF zero_less_one 1, OF 3 2 4 5] |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
978 |
have "norm ((f \<circ> ?p) 1 - (f \<circ> ?p) 0) \<le> B * norm (x - y)" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
979 |
by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
980 |
finally show ?thesis . |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
981 |
qed |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
982 |
|
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
983 |
lemma |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
984 |
differentiable_bound_segment: |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
985 |
fixes f::"'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
986 |
assumes "\<And>t. t \<in> {0..1} \<Longrightarrow> x0 + t *\<^sub>R a \<in> G" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
987 |
assumes f': "\<And>x. x \<in> G \<Longrightarrow> (f has_derivative f' x) (at x within G)" |
68239 | 988 |
assumes B: "\<And>x. x \<in> {0..1} \<Longrightarrow> onorm (f' (x0 + x *\<^sub>R a)) \<le> B" |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
989 |
shows "norm (f (x0 + a) - f x0) \<le> norm a * B" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
990 |
proof - |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
991 |
let ?G = "(\<lambda>x. x0 + x *\<^sub>R a) ` {0..1}" |
67399 | 992 |
have "?G = (+) x0 ` (\<lambda>x. x *\<^sub>R a) ` {0..1}" by auto |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
993 |
also have "convex \<dots>" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
994 |
by (intro convex_translation convex_scaled convex_real_interval) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
995 |
finally have "convex ?G" . |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
996 |
moreover have "?G \<subseteq> G" "x0 \<in> ?G" "x0 + a \<in> ?G" using assms by (auto intro: image_eqI[where x=1]) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
997 |
ultimately show ?thesis |
60420 | 998 |
using has_derivative_subset[OF f' \<open>?G \<subseteq> G\<close>] B |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
999 |
differentiable_bound[of "(\<lambda>x. x0 + x *\<^sub>R a) ` {0..1}" f f' B "x0 + a" x0] |
68239 | 1000 |
by (force simp: ac_simps) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1001 |
qed |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1002 |
|
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1003 |
lemma differentiable_bound_linearization: |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1004 |
fixes f::"'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
68239 | 1005 |
assumes S: "\<And>t. t \<in> {0..1} \<Longrightarrow> a + t *\<^sub>R (b - a) \<in> S" |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1006 |
assumes f'[derivative_intros]: "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x within S)" |
68239 | 1007 |
assumes B: "\<And>x. x \<in> S \<Longrightarrow> onorm (f' x - f' x0) \<le> B" |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1008 |
assumes "x0 \<in> S" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1009 |
shows "norm (f b - f a - f' x0 (b - a)) \<le> norm (b - a) * B" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1010 |
proof - |
63040 | 1011 |
define g where [abs_def]: "g x = f x - f' x0 x" for x |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1012 |
have g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative (\<lambda>i. f' x i - f' x0 i)) (at x within S)" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1013 |
unfolding g_def using assms |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1014 |
by (auto intro!: derivative_eq_intros |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1015 |
bounded_linear.has_derivative[OF has_derivative_bounded_linear, OF f']) |
68239 | 1016 |
from B have "\<forall>x\<in>{0..1}. onorm (\<lambda>i. f' (a + x *\<^sub>R (b - a)) i - f' x0 i) \<le> B" |
1017 |
using assms by (auto simp: fun_diff_def) |
|
1018 |
with differentiable_bound_segment[OF S g] \<open>x0 \<in> S\<close> |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1019 |
show ?thesis |
63469
b6900858dcb9
lots of new theorems about differentiable_on, retracts, ANRs, etc.
paulson <lp15@cam.ac.uk>
parents:
63170
diff
changeset
|
1020 |
by (simp add: g_def field_simps linear_diff[OF has_derivative_linear[OF f']]) |
44123 | 1021 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1022 |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1023 |
lemma vector_differentiable_bound_linearization: |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1024 |
fixes f::"real \<Rightarrow> 'b::real_normed_vector" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1025 |
assumes f': "\<And>x. x \<in> S \<Longrightarrow> (f has_vector_derivative f' x) (at x within S)" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1026 |
assumes "closed_segment a b \<subseteq> S" |
68239 | 1027 |
assumes B: "\<And>x. x \<in> S \<Longrightarrow> norm (f' x - f' x0) \<le> B" |
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1028 |
assumes "x0 \<in> S" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1029 |
shows "norm (f b - f a - (b - a) *\<^sub>R f' x0) \<le> norm (b - a) * B" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1030 |
using assms |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1031 |
by (intro differentiable_bound_linearization[of a b S f "\<lambda>x h. h *\<^sub>R f' x" x0 B]) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1032 |
(force simp: closed_segment_real_eq has_vector_derivative_def |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1033 |
scaleR_diff_right[symmetric] mult.commute[of B] |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1034 |
intro!: onorm_le mult_left_mono)+ |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1035 |
|
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1036 |
|
60420 | 1037 |
text \<open>In particular.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1038 |
|
44123 | 1039 |
lemma has_derivative_zero_constant: |
60179 | 1040 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
53781 | 1041 |
assumes "convex s" |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1042 |
and "\<And>x. x \<in> s \<Longrightarrow> (f has_derivative (\<lambda>h. 0)) (at x within s)" |
44123 | 1043 |
shows "\<exists>c. \<forall>x\<in>s. f x = c" |
56332 | 1044 |
proof - |
1045 |
{ fix x y assume "x \<in> s" "y \<in> s" |
|
1046 |
then have "norm (f x - f y) \<le> 0 * norm (x - y)" |
|
1047 |
using assms by (intro differentiable_bound[of s]) (auto simp: onorm_zero) |
|
1048 |
then have "f x = f y" |
|
1049 |
by simp } |
|
53781 | 1050 |
then show ?thesis |
56332 | 1051 |
by metis |
53781 | 1052 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1053 |
|
61524
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61520
diff
changeset
|
1054 |
lemma has_field_derivative_zero_constant: |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61520
diff
changeset
|
1055 |
assumes "convex s" "\<And>x. x \<in> s \<Longrightarrow> (f has_field_derivative 0) (at x within s)" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61520
diff
changeset
|
1056 |
shows "\<exists>c. \<forall>x\<in>s. f (x) = (c :: 'a :: real_normed_field)" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61520
diff
changeset
|
1057 |
proof (rule has_derivative_zero_constant) |
67399 | 1058 |
have A: "( * ) 0 = (\<lambda>_. 0 :: 'a)" by (intro ext) simp |
61524
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61520
diff
changeset
|
1059 |
fix x assume "x \<in> s" thus "(f has_derivative (\<lambda>h. 0)) (at x within s)" |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61520
diff
changeset
|
1060 |
using assms(2)[of x] by (simp add: has_field_derivative_def A) |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61520
diff
changeset
|
1061 |
qed fact |
f2e51e704a96
added many small lemmas about setsum/setprod/powr/...
eberlm
parents:
61520
diff
changeset
|
1062 |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1063 |
lemma |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1064 |
has_vector_derivative_zero_constant: |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1065 |
assumes "convex s" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1066 |
assumes "\<And>x. x \<in> s \<Longrightarrow> (f has_vector_derivative 0) (at x within s)" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1067 |
obtains c where "\<And>x. x \<in> s \<Longrightarrow> f x = c" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1068 |
using has_derivative_zero_constant[of s f] assms |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1069 |
by (auto simp: has_vector_derivative_def) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
1070 |
|
53781 | 1071 |
lemma has_derivative_zero_unique: |
60179 | 1072 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
53781 | 1073 |
assumes "convex s" |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1074 |
and "\<And>x. x \<in> s \<Longrightarrow> (f has_derivative (\<lambda>h. 0)) (at x within s)" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1075 |
and "x \<in> s" "y \<in> s" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1076 |
shows "f x = f y" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1077 |
using has_derivative_zero_constant[OF assms(1,2)] assms(3-) by force |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1078 |
|
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1079 |
lemma has_derivative_zero_unique_connected: |
60179 | 1080 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1081 |
assumes "open s" "connected s" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1082 |
assumes f: "\<And>x. x \<in> s \<Longrightarrow> (f has_derivative (\<lambda>x. 0)) (at x)" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1083 |
assumes "x \<in> s" "y \<in> s" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1084 |
shows "f x = f y" |
60420 | 1085 |
proof (rule connected_local_const[where f=f, OF \<open>connected s\<close> \<open>x\<in>s\<close> \<open>y\<in>s\<close>]) |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1086 |
show "\<forall>a\<in>s. eventually (\<lambda>b. f a = f b) (at a within s)" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1087 |
proof |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1088 |
fix a assume "a \<in> s" |
60420 | 1089 |
with \<open>open s\<close> obtain e where "0 < e" "ball a e \<subseteq> s" |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1090 |
by (rule openE) |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1091 |
then have "\<exists>c. \<forall>x\<in>ball a e. f x = c" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1092 |
by (intro has_derivative_zero_constant) |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1093 |
(auto simp: at_within_open[OF _ open_ball] f convex_ball) |
60420 | 1094 |
with \<open>0<e\<close> have "\<forall>x\<in>ball a e. f a = f x" |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1095 |
by auto |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1096 |
then show "eventually (\<lambda>b. f a = f b) (at a within s)" |
60420 | 1097 |
using \<open>0<e\<close> unfolding eventually_at_topological |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1098 |
by (intro exI[of _ "ball a e"]) auto |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1099 |
qed |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1100 |
qed |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1101 |
|
60420 | 1102 |
subsection \<open>Differentiability of inverse function (most basic form)\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1103 |
|
44123 | 1104 |
lemma has_derivative_inverse_basic: |
56226 | 1105 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
68055 | 1106 |
assumes derf: "(f has_derivative f') (at (g y))" |
1107 |
and ling': "bounded_linear g'" |
|
53781 | 1108 |
and "g' \<circ> f' = id" |
68055 | 1109 |
and contg: "continuous (at y) g" |
1110 |
and "open T" |
|
1111 |
and "y \<in> T" |
|
1112 |
and fg: "\<And>z. z \<in> T \<Longrightarrow> f (g z) = z" |
|
44123 | 1113 |
shows "(g has_derivative g') (at y)" |
53781 | 1114 |
proof - |
44123 | 1115 |
interpret f': bounded_linear f' |
1116 |
using assms unfolding has_derivative_def by auto |
|
53781 | 1117 |
interpret g': bounded_linear g' |
1118 |
using assms by auto |
|
55665 | 1119 |
obtain C where C: "0 < C" "\<And>x. norm (g' x) \<le> norm x * C" |
1120 |
using bounded_linear.pos_bounded[OF assms(2)] by blast |
|
53781 | 1121 |
have lem1: "\<forall>e>0. \<exists>d>0. \<forall>z. |
1122 |
norm (z - y) < d \<longrightarrow> norm (g z - g y - g'(z - y)) \<le> e * norm (g z - g y)" |
|
68055 | 1123 |
proof (intro allI impI) |
61165 | 1124 |
fix e :: real |
1125 |
assume "e > 0" |
|
1126 |
with C(1) have *: "e / C > 0" by auto |
|
68055 | 1127 |
obtain d0 where "0 < d0" and d0: |
1128 |
"\<And>u. norm (u - g y) < d0 \<Longrightarrow> norm (f u - f (g y) - f' (u - g y)) \<le> e / C * norm (u - g y)" |
|
1129 |
using derf * unfolding has_derivative_at_alt by blast |
|
1130 |
obtain d1 where "0 < d1" and d1: "\<And>x. \<lbrakk>0 < dist x y; dist x y < d1\<rbrakk> \<Longrightarrow> dist (g x) (g y) < d0" |
|
1131 |
using contg \<open>0 < d0\<close> unfolding continuous_at Lim_at by blast |
|
1132 |
obtain d2 where "0 < d2" and d2: "\<And>u. dist u y < d2 \<Longrightarrow> u \<in> T" |
|
1133 |
using \<open>open T\<close> \<open>y \<in> T\<close> unfolding open_dist by blast |
|
55665 | 1134 |
obtain d where d: "0 < d" "d < d1" "d < d2" |
68527
2f4e2aab190a
Generalising and renaming some basic results
paulson <lp15@cam.ac.uk>
parents:
68241
diff
changeset
|
1135 |
using field_lbound_gt_zero[OF \<open>0 < d1\<close> \<open>0 < d2\<close>] by blast |
68055 | 1136 |
show "\<exists>d>0. \<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)" |
1137 |
proof (intro exI allI impI conjI) |
|
53781 | 1138 |
fix z |
1139 |
assume as: "norm (z - y) < d" |
|
68055 | 1140 |
then have "z \<in> T" |
44123 | 1141 |
using d2 d unfolding dist_norm by auto |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1142 |
have "norm (g z - g y - g' (z - y)) \<le> norm (g' (f (g z) - y - f' (g z - g y)))" |
44123 | 1143 |
unfolding g'.diff f'.diff |
68055 | 1144 |
unfolding assms(3)[unfolded o_def id_def, THEN fun_cong] fg[OF \<open>z\<in>T\<close>] |
1145 |
by (simp add: norm_minus_commute) |
|
53781 | 1146 |
also have "\<dots> \<le> norm (f (g z) - y - f' (g z - g y)) * C" |
55665 | 1147 |
by (rule C(2)) |
44123 | 1148 |
also have "\<dots> \<le> (e / C) * norm (g z - g y) * C" |
68055 | 1149 |
proof - |
1150 |
have "norm (g z - g y) < d0" |
|
1151 |
by (metis as cancel_comm_monoid_add_class.diff_cancel d(2) \<open>0 < d0\<close> d1 diff_gt_0_iff_gt diff_strict_mono dist_norm dist_self zero_less_dist_iff) |
|
1152 |
then show ?thesis |
|
1153 |
by (metis C(1) \<open>y \<in> T\<close> d0 fg real_mult_le_cancel_iff1) |
|
1154 |
qed |
|
44123 | 1155 |
also have "\<dots> \<le> e * norm (g z - g y)" |
1156 |
using C by (auto simp add: field_simps) |
|
1157 |
finally show "norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)" |
|
1158 |
by simp |
|
68055 | 1159 |
qed (use d in auto) |
44123 | 1160 |
qed |
53781 | 1161 |
have *: "(0::real) < 1 / 2" |
1162 |
by auto |
|
68055 | 1163 |
obtain d where "0 < d" and d: |
1164 |
"\<And>z. norm (z - y) < d \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> 1/2 * norm (g z - g y)" |
|
55665 | 1165 |
using lem1 * by blast |
63040 | 1166 |
define B where "B = C * 2" |
53781 | 1167 |
have "B > 0" |
1168 |
unfolding B_def using C by auto |
|
61165 | 1169 |
have lem2: "norm (g z - g y) \<le> B * norm (z - y)" if z: "norm(z - y) < d" for z |
1170 |
proof - |
|
44123 | 1171 |
have "norm (g z - g y) \<le> norm(g' (z - y)) + norm ((g z - g y) - g'(z - y))" |
53781 | 1172 |
by (rule norm_triangle_sub) |
1173 |
also have "\<dots> \<le> norm (g' (z - y)) + 1 / 2 * norm (g z - g y)" |
|
68055 | 1174 |
by (rule add_left_mono) (use d z in auto) |
44123 | 1175 |
also have "\<dots> \<le> norm (z - y) * C + 1 / 2 * norm (g z - g y)" |
68055 | 1176 |
by (rule add_right_mono) (use C in auto) |
61165 | 1177 |
finally show "norm (g z - g y) \<le> B * norm (z - y)" |
53781 | 1178 |
unfolding B_def |
1179 |
by (auto simp add: field_simps) |
|
44123 | 1180 |
qed |
53781 | 1181 |
show ?thesis |
1182 |
unfolding has_derivative_at_alt |
|
68055 | 1183 |
proof (intro conjI assms allI impI) |
61165 | 1184 |
fix e :: real |
1185 |
assume "e > 0" |
|
1186 |
then have *: "e / B > 0" by (metis \<open>B > 0\<close> divide_pos_pos) |
|
68055 | 1187 |
obtain d' where "0 < d'" and d': |
1188 |
"\<And>z. norm (z - y) < d' \<Longrightarrow> norm (g z - g y - g' (z - y)) \<le> e / B * norm (g z - g y)" |
|
55665 | 1189 |
using lem1 * by blast |
1190 |
obtain k where k: "0 < k" "k < d" "k < d'" |
|
68527
2f4e2aab190a
Generalising and renaming some basic results
paulson <lp15@cam.ac.uk>
parents:
68241
diff
changeset
|
1191 |
using field_lbound_gt_zero[OF \<open>0 < d\<close> \<open>0 < d'\<close>] by blast |
61165 | 1192 |
show "\<exists>d>0. \<forall>ya. norm (ya - y) < d \<longrightarrow> norm (g ya - g y - g' (ya - y)) \<le> e * norm (ya - y)" |
68055 | 1193 |
proof (intro exI allI impI conjI) |
53781 | 1194 |
fix z |
1195 |
assume as: "norm (z - y) < k" |
|
1196 |
then have "norm (g z - g y - g' (z - y)) \<le> e / B * norm(g z - g y)" |
|
44123 | 1197 |
using d' k by auto |
53781 | 1198 |
also have "\<dots> \<le> e * norm (z - y)" |
60420 | 1199 |
unfolding times_divide_eq_left pos_divide_le_eq[OF \<open>B>0\<close>] |
68055 | 1200 |
using lem2[of z] k as \<open>e > 0\<close> |
44123 | 1201 |
by (auto simp add: field_simps) |
1202 |
finally show "norm (g z - g y - g' (z - y)) \<le> e * norm (z - y)" |
|
53781 | 1203 |
by simp |
68055 | 1204 |
qed (use k in auto) |
44123 | 1205 |
qed |
1206 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1207 |
|
60420 | 1208 |
text \<open>Simply rewrite that based on the domain point x.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1209 |
|
44123 | 1210 |
lemma has_derivative_inverse_basic_x: |
56226 | 1211 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
53781 | 1212 |
assumes "(f has_derivative f') (at x)" |
1213 |
and "bounded_linear g'" |
|
1214 |
and "g' \<circ> f' = id" |
|
1215 |
and "continuous (at (f x)) g" |
|
1216 |
and "g (f x) = x" |
|
68055 | 1217 |
and "open T" |
1218 |
and "f x \<in> T" |
|
1219 |
and "\<And>y. y \<in> T \<Longrightarrow> f (g y) = y" |
|
53781 | 1220 |
shows "(g has_derivative g') (at (f x))" |
68055 | 1221 |
by (rule has_derivative_inverse_basic) (use assms in auto) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1222 |
|
60420 | 1223 |
text \<open>This is the version in Dieudonne', assuming continuity of f and g.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1224 |
|
44123 | 1225 |
lemma has_derivative_inverse_dieudonne: |
56226 | 1226 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
68055 | 1227 |
assumes "open S" |
1228 |
and "open (f ` S)" |
|
1229 |
and "continuous_on S f" |
|
1230 |
and "continuous_on (f ` S) g" |
|
1231 |
and "\<And>x. x \<in> S \<Longrightarrow> g (f x) = x" |
|
1232 |
and "x \<in> S" |
|
53781 | 1233 |
and "(f has_derivative f') (at x)" |
1234 |
and "bounded_linear g'" |
|
1235 |
and "g' \<circ> f' = id" |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1236 |
shows "(g has_derivative g') (at (f x))" |
53781 | 1237 |
apply (rule has_derivative_inverse_basic_x[OF assms(7-9) _ _ assms(2)]) |
1238 |
using assms(3-6) |
|
1239 |
unfolding continuous_on_eq_continuous_at[OF assms(1)] continuous_on_eq_continuous_at[OF assms(2)] |
|
1240 |
apply auto |
|
1241 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1242 |
|
60420 | 1243 |
text \<open>Here's the simplest way of not assuming much about g.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1244 |
|
44123 | 1245 |
lemma has_derivative_inverse: |
56226 | 1246 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
68055 | 1247 |
assumes "compact S" |
1248 |
and "x \<in> S" |
|
1249 |
and fx: "f x \<in> interior (f ` S)" |
|
1250 |
and "continuous_on S f" |
|
68239 | 1251 |
and gf: "\<And>y. y \<in> S \<Longrightarrow> g (f y) = y" |
53781 | 1252 |
and "(f has_derivative f') (at x)" |
1253 |
and "bounded_linear g'" |
|
1254 |
and "g' \<circ> f' = id" |
|
44123 | 1255 |
shows "(g has_derivative g') (at (f x))" |
53781 | 1256 |
proof - |
68239 | 1257 |
have *: "\<And>y. y \<in> interior (f ` S) \<Longrightarrow> f (g y) = y" |
1258 |
by (metis gf image_iff interior_subset subsetCE) |
|
44123 | 1259 |
show ?thesis |
68055 | 1260 |
apply (rule has_derivative_inverse_basic_x[OF assms(6-8), where T = "interior (f ` S)"]) |
1261 |
apply (rule continuous_on_interior[OF _ fx]) |
|
1262 |
apply (rule continuous_on_inv) |
|
1263 |
apply (simp_all add: assms *) |
|
53781 | 1264 |
done |
44123 | 1265 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1266 |
|
53781 | 1267 |
|
60420 | 1268 |
subsection \<open>Proving surjectivity via Brouwer fixpoint theorem\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1269 |
|
44123 | 1270 |
lemma brouwer_surjective: |
56117
2dbf84ee3deb
remove ordered_euclidean_space constraint from brouwer/derivative lemmas;
huffman
parents:
55970
diff
changeset
|
1271 |
fixes f :: "'n::euclidean_space \<Rightarrow> 'n" |
68055 | 1272 |
assumes "compact T" |
1273 |
and "convex T" |
|
1274 |
and "T \<noteq> {}" |
|
1275 |
and "continuous_on T f" |
|
1276 |
and "\<And>x y. \<lbrakk>x\<in>S; y\<in>T\<rbrakk> \<Longrightarrow> x + (y - f y) \<in> T" |
|
1277 |
and "x \<in> S" |
|
1278 |
shows "\<exists>y\<in>T. f y = x" |
|
53781 | 1279 |
proof - |
1280 |
have *: "\<And>x y. f y = x \<longleftrightarrow> x + (y - f y) = y" |
|
1281 |
by (auto simp add: algebra_simps) |
|
44123 | 1282 |
show ?thesis |
1283 |
unfolding * |
|
53781 | 1284 |
apply (rule brouwer[OF assms(1-3), of "\<lambda>y. x + (y - f y)"]) |
68239 | 1285 |
apply (intro continuous_intros) |
1286 |
using assms |
|
53781 | 1287 |
apply auto |
1288 |
done |
|
44123 | 1289 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1290 |
|
44123 | 1291 |
lemma brouwer_surjective_cball: |
56117
2dbf84ee3deb
remove ordered_euclidean_space constraint from brouwer/derivative lemmas;
huffman
parents:
55970
diff
changeset
|
1292 |
fixes f :: "'n::euclidean_space \<Rightarrow> 'n" |
68055 | 1293 |
assumes "continuous_on (cball a e) f" |
1294 |
and "e > 0" |
|
1295 |
and "x \<in> S" |
|
1296 |
and "\<And>x y. \<lbrakk>x\<in>S; y\<in>cball a e\<rbrakk> \<Longrightarrow> x + (y - f y) \<in> cball a e" |
|
44123 | 1297 |
shows "\<exists>y\<in>cball a e. f y = x" |
53781 | 1298 |
apply (rule brouwer_surjective) |
1299 |
apply (rule compact_cball convex_cball)+ |
|
1300 |
unfolding cball_eq_empty |
|
1301 |
using assms |
|
1302 |
apply auto |
|
1303 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1304 |
|
60420 | 1305 |
text \<open>See Sussmann: "Multidifferential calculus", Theorem 2.1.1\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1306 |
|
44123 | 1307 |
lemma sussmann_open_mapping: |
56227 | 1308 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::euclidean_space" |
68055 | 1309 |
assumes "open S" |
68239 | 1310 |
and contf: "continuous_on S f" |
68055 | 1311 |
and "x \<in> S" |
68239 | 1312 |
and derf: "(f has_derivative f') (at x)" |
53781 | 1313 |
and "bounded_linear g'" "f' \<circ> g' = id" |
68055 | 1314 |
and "T \<subseteq> S" |
68239 | 1315 |
and x: "x \<in> interior T" |
68055 | 1316 |
shows "f x \<in> interior (f ` T)" |
53781 | 1317 |
proof - |
1318 |
interpret f': bounded_linear f' |
|
68239 | 1319 |
using assms unfolding has_derivative_def by auto |
53781 | 1320 |
interpret g': bounded_linear g' |
68239 | 1321 |
using assms by auto |
55665 | 1322 |
obtain B where B: "0 < B" "\<forall>x. norm (g' x) \<le> norm x * B" |
1323 |
using bounded_linear.pos_bounded[OF assms(5)] by blast |
|
56541 | 1324 |
hence *: "1 / (2 * B) > 0" by auto |
55665 | 1325 |
obtain e0 where e0: |
1326 |
"0 < e0" |
|
1327 |
"\<forall>y. norm (y - x) < e0 \<longrightarrow> norm (f y - f x - f' (y - x)) \<le> 1 / (2 * B) * norm (y - x)" |
|
68239 | 1328 |
using derf unfolding has_derivative_at_alt |
55665 | 1329 |
using * by blast |
68055 | 1330 |
obtain e1 where e1: "0 < e1" "cball x e1 \<subseteq> T" |
68239 | 1331 |
using mem_interior_cball x by blast |
56541 | 1332 |
have *: "0 < e0 / B" "0 < e1 / B" using e0 e1 B by auto |
55665 | 1333 |
obtain e where e: "0 < e" "e < e0 / B" "e < e1 / B" |
68527
2f4e2aab190a
Generalising and renaming some basic results
paulson <lp15@cam.ac.uk>
parents:
68241
diff
changeset
|
1334 |
using field_lbound_gt_zero[OF *] by blast |
68055 | 1335 |
have lem: "\<exists>y\<in>cball (f x) e. f (x + g' (y - f x)) = z" if "z\<in>cball (f x) (e / 2)" for z |
1336 |
proof (rule brouwer_surjective_cball) |
|
1337 |
have z: "z \<in> S" if as: "y \<in>cball (f x) e" "z = x + (g' y - g' (f x))" for y z |
|
44123 | 1338 |
proof- |
1339 |
have "dist x z = norm (g' (f x) - g' y)" |
|
1340 |
unfolding as(2) and dist_norm by auto |
|
1341 |
also have "\<dots> \<le> norm (f x - y) * B" |
|
68239 | 1342 |
by (metis B(2) g'.diff) |
44123 | 1343 |
also have "\<dots> \<le> e * B" |
68239 | 1344 |
by (metis B(1) dist_norm mem_cball real_mult_le_cancel_iff1 that(1)) |
53781 | 1345 |
also have "\<dots> \<le> e1" |
68239 | 1346 |
using B(1) e(3) pos_less_divide_eq by fastforce |
53781 | 1347 |
finally have "z \<in> cball x e1" |
1348 |
by force |
|
68055 | 1349 |
then show "z \<in> S" |
53781 | 1350 |
using e1 assms(7) by auto |
44123 | 1351 |
qed |
68055 | 1352 |
show "continuous_on (cball (f x) e) (\<lambda>y. f (x + g' (y - f x)))" |
1353 |
unfolding g'.diff |
|
68239 | 1354 |
proof (rule continuous_on_compose2 [OF _ _ order_refl, of _ _ f]) |
1355 |
show "continuous_on ((\<lambda>y. x + (g' y - g' (f x))) ` cball (f x) e) f" |
|
1356 |
by (rule continuous_on_subset[OF contf]) (use z in blast) |
|
1357 |
show "continuous_on (cball (f x) e) (\<lambda>y. x + (g' y - g' (f x)))" |
|
1358 |
by (intro continuous_intros linear_continuous_on[OF \<open>bounded_linear g'\<close>]) |
|
1359 |
qed |
|
44123 | 1360 |
next |
53781 | 1361 |
fix y z |
68239 | 1362 |
assume y: "y \<in> cball (f x) (e / 2)" and z: "z \<in> cball (f x) e" |
53781 | 1363 |
have "norm (g' (z - f x)) \<le> norm (z - f x) * B" |
1364 |
using B by auto |
|
1365 |
also have "\<dots> \<le> e * B" |
|
68239 | 1366 |
by (metis B(1) z dist_norm mem_cball norm_minus_commute real_mult_le_cancel_iff1) |
53781 | 1367 |
also have "\<dots> < e0" |
68239 | 1368 |
using B(1) e(2) pos_less_divide_eq by blast |
53781 | 1369 |
finally have *: "norm (x + g' (z - f x) - x) < e0" |
1370 |
by auto |
|
1371 |
have **: "f x + f' (x + g' (z - f x) - x) = z" |
|
1372 |
using assms(6)[unfolded o_def id_def,THEN cong] |
|
1373 |
by auto |
|
1374 |
have "norm (f x - (y + (z - f (x + g' (z - f x))))) \<le> |
|
68239 | 1375 |
norm (f (x + g' (z - f x)) - z) + norm (f x - y)" |
44123 | 1376 |
using norm_triangle_ineq[of "f (x + g'(z - f x)) - z" "f x - y"] |
1377 |
by (auto simp add: algebra_simps) |
|
1378 |
also have "\<dots> \<le> 1 / (B * 2) * norm (g' (z - f x)) + norm (f x - y)" |
|
55665 | 1379 |
using e0(2)[rule_format, OF *] |
63170 | 1380 |
by (simp only: algebra_simps **) auto |
44123 | 1381 |
also have "\<dots> \<le> 1 / (B * 2) * norm (g' (z - f x)) + e/2" |
68239 | 1382 |
using y by (auto simp: dist_norm) |
44123 | 1383 |
also have "\<dots> \<le> 1 / (B * 2) * B * norm (z - f x) + e/2" |
68239 | 1384 |
using * B by (auto simp add: field_simps) |
53781 | 1385 |
also have "\<dots> \<le> 1 / 2 * norm (z - f x) + e/2" |
1386 |
by auto |
|
1387 |
also have "\<dots> \<le> e/2 + e/2" |
|
68239 | 1388 |
using B(1) \<open>norm (z - f x) * B \<le> e * B\<close> by auto |
44123 | 1389 |
finally show "y + (z - f (x + g' (z - f x))) \<in> cball (f x) e" |
68239 | 1390 |
by (auto simp: dist_norm) |
68055 | 1391 |
qed (use e that in auto) |
53781 | 1392 |
show ?thesis |
1393 |
unfolding mem_interior |
|
68239 | 1394 |
proof (intro exI conjI subsetI) |
53781 | 1395 |
fix y |
1396 |
assume "y \<in> ball (f x) (e / 2)" |
|
1397 |
then have *: "y \<in> cball (f x) (e / 2)" |
|
1398 |
by auto |
|
55665 | 1399 |
obtain z where z: "z \<in> cball (f x) e" "f (x + g' (z - f x)) = y" |
1400 |
using lem * by blast |
|
53781 | 1401 |
then have "norm (g' (z - f x)) \<le> norm (z - f x) * B" |
1402 |
using B |
|
1403 |
by (auto simp add: field_simps) |
|
44123 | 1404 |
also have "\<dots> \<le> e * B" |
68239 | 1405 |
by (metis B(1) dist_norm mem_cball norm_minus_commute real_mult_le_cancel_iff1 z(1)) |
53781 | 1406 |
also have "\<dots> \<le> e1" |
1407 |
using e B unfolding less_divide_eq by auto |
|
68055 | 1408 |
finally have "x + g'(z - f x) \<in> T" |
68239 | 1409 |
by (metis add_diff_cancel diff_diff_add dist_norm e1(2) mem_cball norm_minus_commute subset_eq) |
68055 | 1410 |
then show "y \<in> f ` T" |
53781 | 1411 |
using z by auto |
68239 | 1412 |
qed (use e in auto) |
44123 | 1413 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1414 |
|
60420 | 1415 |
text \<open>Hence the following eccentric variant of the inverse function theorem. |
53799 | 1416 |
This has no continuity assumptions, but we do need the inverse function. |
61808 | 1417 |
We could put \<open>f' \<circ> g = I\<close> but this happens to fit with the minimal linear |
60420 | 1418 |
algebra theory I've set up so far.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1419 |
|
44123 | 1420 |
lemma has_derivative_inverse_strong: |
56117
2dbf84ee3deb
remove ordered_euclidean_space constraint from brouwer/derivative lemmas;
huffman
parents:
55970
diff
changeset
|
1421 |
fixes f :: "'n::euclidean_space \<Rightarrow> 'n" |
68239 | 1422 |
assumes "open S" |
1423 |
and "x \<in> S" |
|
1424 |
and contf: "continuous_on S f" |
|
1425 |
and gf: "\<And>x. x \<in> S \<Longrightarrow> g (f x) = x" |
|
1426 |
and derf: "(f has_derivative f') (at x)" |
|
1427 |
and id: "f' \<circ> g' = id" |
|
44123 | 1428 |
shows "(g has_derivative g') (at (f x))" |
53781 | 1429 |
proof - |
1430 |
have linf: "bounded_linear f'" |
|
68239 | 1431 |
using derf unfolding has_derivative_def by auto |
53781 | 1432 |
then have ling: "bounded_linear g'" |
1433 |
unfolding linear_conv_bounded_linear[symmetric] |
|
68239 | 1434 |
using id right_inverse_linear by blast |
53781 | 1435 |
moreover have "g' \<circ> f' = id" |
68239 | 1436 |
using id linf ling |
53781 | 1437 |
unfolding linear_conv_bounded_linear[symmetric] |
1438 |
using linear_inverse_left |
|
1439 |
by auto |
|
68239 | 1440 |
moreover have *: "\<And>T. \<lbrakk>T \<subseteq> S; x \<in> interior T\<rbrakk> \<Longrightarrow> f x \<in> interior (f ` T)" |
53781 | 1441 |
apply (rule sussmann_open_mapping) |
1442 |
apply (rule assms ling)+ |
|
1443 |
apply auto |
|
1444 |
done |
|
1445 |
have "continuous (at (f x)) g" |
|
1446 |
unfolding continuous_at Lim_at |
|
1447 |
proof (rule, rule) |
|
1448 |
fix e :: real |
|
1449 |
assume "e > 0" |
|
68239 | 1450 |
then have "f x \<in> interior (f ` (ball x e \<inter> S))" |
1451 |
using *[rule_format,of "ball x e \<inter> S"] \<open>x \<in> S\<close> |
|
53781 | 1452 |
by (auto simp add: interior_open[OF open_ball] interior_open[OF assms(1)]) |
68239 | 1453 |
then obtain d where d: "0 < d" "ball (f x) d \<subseteq> f ` (ball x e \<inter> S)" |
55665 | 1454 |
unfolding mem_interior by blast |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1455 |
show "\<exists>d>0. \<forall>y. 0 < dist y (f x) \<and> dist y (f x) < d \<longrightarrow> dist (g y) (g (f x)) < e" |
68239 | 1456 |
proof (intro exI allI impI conjI) |
61165 | 1457 |
fix y |
1458 |
assume "0 < dist y (f x) \<and> dist y (f x) < d" |
|
68239 | 1459 |
then have "g y \<in> g ` f ` (ball x e \<inter> S)" |
1460 |
by (metis d(2) dist_commute mem_ball rev_image_eqI subset_iff) |
|
53781 | 1461 |
then show "dist (g y) (g (f x)) < e" |
68239 | 1462 |
using gf[OF \<open>x \<in> S\<close>] |
1463 |
by (simp add: assms(4) dist_commute image_iff) |
|
1464 |
qed (use d in auto) |
|
44123 | 1465 |
qed |
68239 | 1466 |
moreover have "f x \<in> interior (f ` S)" |
53781 | 1467 |
apply (rule sussmann_open_mapping) |
1468 |
apply (rule assms ling)+ |
|
68239 | 1469 |
using interior_open[OF assms(1)] and \<open>x \<in> S\<close> |
53781 | 1470 |
apply auto |
1471 |
done |
|
68239 | 1472 |
moreover have "f (g y) = y" if "y \<in> interior (f ` S)" for y |
1473 |
by (metis gf imageE interiorE set_mp that) |
|
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
1474 |
ultimately show ?thesis using assms |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
1475 |
by (metis has_derivative_inverse_basic_x open_interior) |
44123 | 1476 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1477 |
|
60420 | 1478 |
text \<open>A rewrite based on the other domain.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1479 |
|
44123 | 1480 |
lemma has_derivative_inverse_strong_x: |
56117
2dbf84ee3deb
remove ordered_euclidean_space constraint from brouwer/derivative lemmas;
huffman
parents:
55970
diff
changeset
|
1481 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'a" |
68239 | 1482 |
assumes "open S" |
1483 |
and "g y \<in> S" |
|
1484 |
and "continuous_on S f" |
|
1485 |
and "\<And>x. x \<in> S \<Longrightarrow> g (f x) = x" |
|
53781 | 1486 |
and "(f has_derivative f') (at (g y))" |
1487 |
and "f' \<circ> g' = id" |
|
1488 |
and "f (g y) = y" |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1489 |
shows "(g has_derivative g') (at y)" |
53781 | 1490 |
using has_derivative_inverse_strong[OF assms(1-6)] |
1491 |
unfolding assms(7) |
|
1492 |
by simp |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1493 |
|
60420 | 1494 |
text \<open>On a region.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1495 |
|
44123 | 1496 |
lemma has_derivative_inverse_on: |
56117
2dbf84ee3deb
remove ordered_euclidean_space constraint from brouwer/derivative lemmas;
huffman
parents:
55970
diff
changeset
|
1497 |
fixes f :: "'n::euclidean_space \<Rightarrow> 'n" |
68239 | 1498 |
assumes "open S" |
1499 |
and derf: "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f'(x)) (at x)" |
|
1500 |
and "\<And>x. x \<in> S \<Longrightarrow> g (f x) = x" |
|
53781 | 1501 |
and "f' x \<circ> g' x = id" |
68239 | 1502 |
and "x \<in> S" |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1503 |
shows "(g has_derivative g'(x)) (at (f x))" |
68239 | 1504 |
proof (rule has_derivative_inverse_strong[where g'="g' x" and f=f]) |
1505 |
show "continuous_on S f" |
|
1506 |
unfolding continuous_on_eq_continuous_at[OF \<open>open S\<close>] |
|
1507 |
using derf has_derivative_continuous by blast |
|
1508 |
qed (use assms in auto) |
|
1509 |
||
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1510 |
|
60420 | 1511 |
text \<open>Invertible derivative continous at a point implies local |
44123 | 1512 |
injectivity. It's only for this we need continuity of the derivative, |
1513 |
except of course if we want the fact that the inverse derivative is |
|
1514 |
also continuous. So if we know for some other reason that the inverse |
|
60420 | 1515 |
function exists, it's OK.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1516 |
|
62381
a6479cb85944
New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents:
62207
diff
changeset
|
1517 |
proposition has_derivative_locally_injective: |
53781 | 1518 |
fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space" |
68239 | 1519 |
assumes "a \<in> S" |
1520 |
and "open S" |
|
68055 | 1521 |
and bling: "bounded_linear g'" |
62381
a6479cb85944
New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents:
62207
diff
changeset
|
1522 |
and "g' \<circ> f' a = id" |
68239 | 1523 |
and derf: "\<And>x. x \<in> S \<Longrightarrow> (f has_derivative f' x) (at x)" |
62381
a6479cb85944
New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents:
62207
diff
changeset
|
1524 |
and "\<And>e. e > 0 \<Longrightarrow> \<exists>d>0. \<forall>x. dist a x < d \<longrightarrow> onorm (\<lambda>v. f' x v - f' a v) < e" |
68239 | 1525 |
obtains r where "r > 0" "ball a r \<subseteq> S" "inj_on f (ball a r)" |
53781 | 1526 |
proof - |
1527 |
interpret bounded_linear g' |
|
1528 |
using assms by auto |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1529 |
note f'g' = assms(4)[unfolded id_def o_def,THEN cong] |
53781 | 1530 |
have "g' (f' a (\<Sum>Basis)) = (\<Sum>Basis)" "(\<Sum>Basis) \<noteq> (0::'n)" |
68055 | 1531 |
using f'g' by auto |
53781 | 1532 |
then have *: "0 < onorm g'" |
56223
7696903b9e61
generalize theory of operator norms to work with class real_normed_vector
huffman
parents:
56217
diff
changeset
|
1533 |
unfolding onorm_pos_lt[OF assms(3)] |
53781 | 1534 |
by fastforce |
63040 | 1535 |
define k where "k = 1 / onorm g' / 2" |
53781 | 1536 |
have *: "k > 0" |
1537 |
unfolding k_def using * by auto |
|
55665 | 1538 |
obtain d1 where d1: |
1539 |
"0 < d1" |
|
1540 |
"\<And>x. dist a x < d1 \<Longrightarrow> onorm (\<lambda>v. f' x v - f' a v) < k" |
|
1541 |
using assms(6) * by blast |
|
68239 | 1542 |
from \<open>open S\<close> obtain d2 where "d2 > 0" "ball a d2 \<subseteq> S" |
1543 |
using \<open>a\<in>S\<close> .. |
|
1544 |
obtain d2 where d2: "0 < d2" "ball a d2 \<subseteq> S" |
|
1545 |
using \<open>0 < d2\<close> \<open>ball a d2 \<subseteq> S\<close> by blast |
|
55665 | 1546 |
obtain d where d: "0 < d" "d < d1" "d < d2" |
68527
2f4e2aab190a
Generalising and renaming some basic results
paulson <lp15@cam.ac.uk>
parents:
68241
diff
changeset
|
1547 |
using field_lbound_gt_zero[OF d1(1) d2(1)] by blast |
44123 | 1548 |
show ?thesis |
1549 |
proof |
|
62381
a6479cb85944
New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents:
62207
diff
changeset
|
1550 |
show "0 < d" by (fact d) |
68239 | 1551 |
show "ball a d \<subseteq> S" |
1552 |
using \<open>d < d2\<close> \<open>ball a d2 \<subseteq> S\<close> by auto |
|
62381
a6479cb85944
New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents:
62207
diff
changeset
|
1553 |
show "inj_on f (ball a d)" |
a6479cb85944
New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents:
62207
diff
changeset
|
1554 |
unfolding inj_on_def |
44123 | 1555 |
proof (intro strip) |
53781 | 1556 |
fix x y |
1557 |
assume as: "x \<in> ball a d" "y \<in> ball a d" "f x = f y" |
|
63040 | 1558 |
define ph where [abs_def]: "ph w = w - g' (f w - f x)" for w |
44123 | 1559 |
have ph':"ph = g' \<circ> (\<lambda>w. f' a w - (f w - f x))" |
68239 | 1560 |
unfolding ph_def o_def by (simp add: diff f'g') |
53781 | 1561 |
have "norm (ph x - ph y) \<le> (1 / 2) * norm (x - y)" |
68239 | 1562 |
proof (rule differentiable_bound[OF convex_ball _ _ as(1-2)]) |
53781 | 1563 |
fix u |
1564 |
assume u: "u \<in> ball a d" |
|
68239 | 1565 |
then have "u \<in> S" |
53781 | 1566 |
using d d2 by auto |
1567 |
have *: "(\<lambda>v. v - g' (f' u v)) = g' \<circ> (\<lambda>w. f' a w - f' u w)" |
|
1568 |
unfolding o_def and diff |
|
1569 |
using f'g' by auto |
|
68055 | 1570 |
have blin: "bounded_linear (f' a)" |
68239 | 1571 |
using \<open>a \<in> S\<close> derf by blast |
41958 | 1572 |
show "(ph has_derivative (\<lambda>v. v - g' (f' u v))) (at u within ball a d)" |
68055 | 1573 |
unfolding ph' * comp_def |
68239 | 1574 |
by (rule \<open>u \<in> S\<close> derivative_eq_intros has_derivative_at_withinI [OF derf] bounded_linear.has_derivative [OF blin] bounded_linear.has_derivative [OF bling] |simp)+ |
53781 | 1575 |
have **: "bounded_linear (\<lambda>x. f' u x - f' a x)" "bounded_linear (\<lambda>x. f' a x - f' u x)" |
68239 | 1576 |
using \<open>u \<in> S\<close> blin bounded_linear_sub derf by auto |
1577 |
then have "onorm (\<lambda>v. v - g' (f' u v)) \<le> onorm g' * onorm (\<lambda>w. f' a w - f' u w)" |
|
1578 |
by (simp add: "*" bounded_linear_axioms onorm_compose) |
|
44123 | 1579 |
also have "\<dots> \<le> onorm g' * k" |
53781 | 1580 |
apply (rule mult_left_mono) |
55665 | 1581 |
using d1(2)[of u] |
68239 | 1582 |
using onorm_neg[where f="\<lambda>x. f' u x - f' a x"] d u onorm_pos_le[OF bling] apply (auto simp: algebra_simps) |
53781 | 1583 |
done |
1584 |
also have "\<dots> \<le> 1 / 2" |
|
1585 |
unfolding k_def by auto |
|
1586 |
finally show "onorm (\<lambda>v. v - g' (f' u v)) \<le> 1 / 2" . |
|
44123 | 1587 |
qed |
1588 |
moreover have "norm (ph y - ph x) = norm (y - x)" |
|
68239 | 1589 |
by (simp add: as(3) ph_def) |
53781 | 1590 |
ultimately show "x = y" |
1591 |
unfolding norm_minus_commute by auto |
|
44123 | 1592 |
qed |
62381
a6479cb85944
New and revised material for (multivariate) analysis
paulson <lp15@cam.ac.uk>
parents:
62207
diff
changeset
|
1593 |
qed |
44123 | 1594 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1595 |
|
53781 | 1596 |
|
60420 | 1597 |
subsection \<open>Uniformly convergent sequence of derivatives\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1598 |
|
44123 | 1599 |
lemma has_derivative_sequence_lipschitz_lemma: |
60179 | 1600 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
68239 | 1601 |
assumes "convex S" |
1602 |
and derf: "\<And>n x. x \<in> S \<Longrightarrow> ((f n) has_derivative (f' n x)) (at x within S)" |
|
1603 |
and nle: "\<And>n x h. \<lbrakk>n\<ge>N; x \<in> S\<rbrakk> \<Longrightarrow> norm (f' n x h - g' x h) \<le> e * norm h" |
|
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1604 |
and "0 \<le> e" |
68239 | 1605 |
shows "\<forall>m\<ge>N. \<forall>n\<ge>N. \<forall>x\<in>S. \<forall>y\<in>S. norm ((f m x - f n x) - (f m y - f n y)) \<le> 2 * e * norm (x - y)" |
1606 |
proof clarify |
|
53781 | 1607 |
fix m n x y |
68239 | 1608 |
assume as: "N \<le> m" "N \<le> n" "x \<in> S" "y \<in> S" |
53781 | 1609 |
show "norm ((f m x - f n x) - (f m y - f n y)) \<le> 2 * e * norm (x - y)" |
68239 | 1610 |
proof (rule differentiable_bound[where f'="\<lambda>x h. f' m x h - f' n x h", OF \<open>convex S\<close> _ _ as(3-4)]) |
53781 | 1611 |
fix x |
68239 | 1612 |
assume "x \<in> S" |
1613 |
show "((\<lambda>a. f m a - f n a) has_derivative (\<lambda>h. f' m x h - f' n x h)) (at x within S)" |
|
1614 |
by (rule derivative_intros derf \<open>x\<in>S\<close>)+ |
|
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1615 |
show "onorm (\<lambda>h. f' m x h - f' n x h) \<le> 2 * e" |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1616 |
proof (rule onorm_bound) |
53781 | 1617 |
fix h |
44123 | 1618 |
have "norm (f' m x h - f' n x h) \<le> norm (f' m x h - g' x h) + norm (f' n x h - g' x h)" |
1619 |
using norm_triangle_ineq[of "f' m x h - g' x h" "- f' n x h + g' x h"] |
|
68239 | 1620 |
by (auto simp add: algebra_simps norm_minus_commute) |
53781 | 1621 |
also have "\<dots> \<le> e * norm h + e * norm h" |
68239 | 1622 |
using nle[OF \<open>N \<le> m\<close> \<open>x \<in> S\<close>, of h] nle[OF \<open>N \<le> n\<close> \<open>x \<in> S\<close>, of h] |
53781 | 1623 |
by (auto simp add: field_simps) |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1624 |
finally show "norm (f' m x h - f' n x h) \<le> 2 * e * norm h" |
53781 | 1625 |
by auto |
60420 | 1626 |
qed (simp add: \<open>0 \<le> e\<close>) |
44123 | 1627 |
qed |
1628 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1629 |
|
68055 | 1630 |
lemma has_derivative_sequence_Lipschitz: |
60179 | 1631 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
68055 | 1632 |
assumes "convex S" |
1633 |
and "\<And>n x. x \<in> S \<Longrightarrow> ((f n) has_derivative (f' n x)) (at x within S)" |
|
68239 | 1634 |
and nle: "\<And>e. e > 0 \<Longrightarrow> \<forall>\<^sub>F n in sequentially. \<forall>x\<in>S. \<forall>h. norm (f' n x h - g' x h) \<le> e * norm h" |
68055 | 1635 |
and "e > 0" |
1636 |
shows "\<exists>N. \<forall>m\<ge>N. \<forall>n\<ge>N. \<forall>x\<in>S. \<forall>y\<in>S. |
|
53781 | 1637 |
norm ((f m x - f n x) - (f m y - f n y)) \<le> e * norm (x - y)" |
68055 | 1638 |
proof - |
68239 | 1639 |
have *: "2 * (e/2) = e" |
1640 |
using \<open>e > 0\<close> by auto |
|
1641 |
obtain N where "\<forall>n\<ge>N. \<forall>x\<in>S. \<forall>h. norm (f' n x h - g' x h) \<le> (e/2) * norm h" |
|
1642 |
using nle \<open>e > 0\<close> |
|
1643 |
unfolding eventually_sequentially |
|
1644 |
by (metis less_divide_eq_numeral1(1) mult_zero_left) |
|
68055 | 1645 |
then show "\<exists>N. \<forall>m\<ge>N. \<forall>n\<ge>N. \<forall>x\<in>S. \<forall>y\<in>S. norm (f m x - f n x - (f m y - f n y)) \<le> e * norm (x - y)" |
53781 | 1646 |
apply (rule_tac x=N in exI) |
68239 | 1647 |
apply (rule has_derivative_sequence_lipschitz_lemma[where e="e/2", unfolded *]) |
60420 | 1648 |
using assms \<open>e > 0\<close> |
53781 | 1649 |
apply auto |
1650 |
done |
|
44123 | 1651 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1652 |
|
44123 | 1653 |
lemma has_derivative_sequence: |
60179 | 1654 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_vector \<Rightarrow> 'b::banach" |
68055 | 1655 |
assumes "convex S" |
68239 | 1656 |
and derf: "\<And>n x. x \<in> S \<Longrightarrow> ((f n) has_derivative (f' n x)) (at x within S)" |
1657 |
and nle: "\<And>e. e > 0 \<Longrightarrow> \<forall>\<^sub>F n in sequentially. \<forall>x\<in>S. \<forall>h. norm (f' n x h - g' x h) \<le> e * norm h" |
|
68055 | 1658 |
and "x0 \<in> S" |
68239 | 1659 |
and lim: "((\<lambda>n. f n x0) \<longlongrightarrow> l) sequentially" |
1660 |
shows "\<exists>g. \<forall>x\<in>S. (\<lambda>n. f n x) \<longlonglongrightarrow> g x \<and> (g has_derivative g'(x)) (at x within S)" |
|
53781 | 1661 |
proof - |
68055 | 1662 |
have lem1: "\<And>e. e > 0 \<Longrightarrow> \<exists>N. \<forall>m\<ge>N. \<forall>n\<ge>N. \<forall>x\<in>S. \<forall>y\<in>S. |
53781 | 1663 |
norm ((f m x - f n x) - (f m y - f n y)) \<le> e * norm (x - y)" |
68055 | 1664 |
using assms(1,2,3) by (rule has_derivative_sequence_Lipschitz) |
1665 |
have "\<exists>g. \<forall>x\<in>S. ((\<lambda>n. f n x) \<longlongrightarrow> g x) sequentially" |
|
68239 | 1666 |
proof (intro ballI bchoice) |
53781 | 1667 |
fix x |
68055 | 1668 |
assume "x \<in> S" |
68239 | 1669 |
show "\<exists>y. (\<lambda>n. f n x) \<longlonglongrightarrow> y" |
1670 |
unfolding convergent_eq_Cauchy |
|
53781 | 1671 |
proof (cases "x = x0") |
1672 |
case True |
|
68239 | 1673 |
then show "Cauchy (\<lambda>n. f n x)" |
1674 |
using LIMSEQ_imp_Cauchy[OF lim] by auto |
|
44123 | 1675 |
next |
53781 | 1676 |
case False |
68239 | 1677 |
show "Cauchy (\<lambda>n. f n x)" |
53781 | 1678 |
unfolding Cauchy_def |
68055 | 1679 |
proof (intro allI impI) |
53781 | 1680 |
fix e :: real |
1681 |
assume "e > 0" |
|
56541 | 1682 |
hence *: "e / 2 > 0" "e / 2 / norm (x - x0) > 0" using False by auto |
55665 | 1683 |
obtain M where M: "\<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x0) (f n x0) < e / 2" |
68239 | 1684 |
using LIMSEQ_imp_Cauchy[OF lim] * unfolding Cauchy_def by blast |
55665 | 1685 |
obtain N where N: |
1686 |
"\<forall>m\<ge>N. \<forall>n\<ge>N. |
|
68239 | 1687 |
\<forall>u\<in>S. \<forall>y\<in>S. norm (f m u - f n u - (f m y - f n y)) \<le> |
1688 |
e / 2 / norm (x - x0) * norm (u - y)" |
|
55665 | 1689 |
using lem1 *(2) by blast |
44123 | 1690 |
show "\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e" |
68055 | 1691 |
proof (intro exI allI impI) |
53781 | 1692 |
fix m n |
1693 |
assume as: "max M N \<le>m" "max M N\<le>n" |
|
68239 | 1694 |
have "dist (f m x) (f n x) \<le> norm (f m x0 - f n x0) + norm (f m x - f n x - (f m x0 - f n x0))" |
53781 | 1695 |
unfolding dist_norm |
1696 |
by (rule norm_triangle_sub) |
|
44123 | 1697 |
also have "\<dots> \<le> norm (f m x0 - f n x0) + e / 2" |
68239 | 1698 |
using N \<open>x\<in>S\<close> \<open>x0\<in>S\<close> as False by fastforce |
44123 | 1699 |
also have "\<dots> < e / 2 + e / 2" |
68239 | 1700 |
by (rule add_strict_right_mono) (use as M in \<open>auto simp: dist_norm\<close>) |
53781 | 1701 |
finally show "dist (f m x) (f n x) < e" |
1702 |
by auto |
|
44123 | 1703 |
qed |
1704 |
qed |
|
1705 |
qed |
|
1706 |
qed |
|
68055 | 1707 |
then obtain g where g: "\<forall>x\<in>S. (\<lambda>n. f n x) \<longlonglongrightarrow> g x" .. |
68239 | 1708 |
have lem2: "\<exists>N. \<forall>n\<ge>N. \<forall>x\<in>S. \<forall>y\<in>S. norm ((f n x - f n y) - (g x - g y)) \<le> e * norm (x - y)" if "e > 0" for e |
1709 |
proof - |
|
55665 | 1710 |
obtain N where |
68055 | 1711 |
N: "\<forall>m\<ge>N. \<forall>n\<ge>N. \<forall>x\<in>S. \<forall>y\<in>S. norm (f m x - f n x - (f m y - f n y)) \<le> e * norm (x - y)" |
68239 | 1712 |
using lem1 \<open>e > 0\<close> by blast |
68055 | 1713 |
show "\<exists>N. \<forall>n\<ge>N. \<forall>x\<in>S. \<forall>y\<in>S. norm (f n x - f n y - (g x - g y)) \<le> e * norm (x - y)" |
68239 | 1714 |
proof (intro exI ballI allI impI) |
53781 | 1715 |
fix n x y |
68055 | 1716 |
assume as: "N \<le> n" "x \<in> S" "y \<in> S" |
61973 | 1717 |
have "((\<lambda>m. norm (f n x - f n y - (f m x - f m y))) \<longlongrightarrow> norm (f n x - f n y - (g x - g y))) sequentially" |
56320 | 1718 |
by (intro tendsto_intros g[rule_format] as) |
1719 |
moreover have "eventually (\<lambda>m. norm (f n x - f n y - (f m x - f m y)) \<le> e * norm (x - y)) sequentially" |
|
44123 | 1720 |
unfolding eventually_sequentially |
68055 | 1721 |
proof (intro exI allI impI) |
53781 | 1722 |
fix m |
1723 |
assume "N \<le> m" |
|
1724 |
then show "norm (f n x - f n y - (f m x - f m y)) \<le> e * norm (x - y)" |
|
68239 | 1725 |
using N as by (auto simp add: algebra_simps) |
44123 | 1726 |
qed |
56320 | 1727 |
ultimately show "norm (f n x - f n y - (g x - g y)) \<le> e * norm (x - y)" |
63952
354808e9f44b
new material connected with HOL Light measure theory, plus more rationalisation
paulson <lp15@cam.ac.uk>
parents:
63938
diff
changeset
|
1728 |
by (simp add: tendsto_upperbound) |
44123 | 1729 |
qed |
1730 |
qed |
|
68055 | 1731 |
have "\<forall>x\<in>S. ((\<lambda>n. f n x) \<longlongrightarrow> g x) sequentially \<and> (g has_derivative g' x) (at x within S)" |
56320 | 1732 |
unfolding has_derivative_within_alt2 |
68239 | 1733 |
proof (intro ballI conjI allI impI) |
53781 | 1734 |
fix x |
68055 | 1735 |
assume "x \<in> S" |
68239 | 1736 |
then show "(\<lambda>n. f n x) \<longlonglongrightarrow> g x" |
56320 | 1737 |
by (simp add: g) |
68239 | 1738 |
have tog': "(\<lambda>n. f' n x u) \<longlonglongrightarrow> g' x u" for u |
56320 | 1739 |
unfolding filterlim_def le_nhds_metric_le eventually_filtermap dist_norm |
1740 |
proof (intro allI impI) |
|
53781 | 1741 |
fix e :: real |
1742 |
assume "e > 0" |
|
56320 | 1743 |
show "eventually (\<lambda>n. norm (f' n x u - g' x u) \<le> e) sequentially" |
53781 | 1744 |
proof (cases "u = 0") |
1745 |
case True |
|
56320 | 1746 |
have "eventually (\<lambda>n. norm (f' n x u - g' x u) \<le> e * norm u) sequentially" |
68239 | 1747 |
using nle \<open>0 < e\<close> \<open>x \<in> S\<close> by (fast elim: eventually_mono) |
56320 | 1748 |
then show ?thesis |
68239 | 1749 |
using \<open>u = 0\<close> \<open>0 < e\<close> by (auto elim: eventually_mono) |
44123 | 1750 |
next |
53781 | 1751 |
case False |
60420 | 1752 |
with \<open>0 < e\<close> have "0 < e / norm u" by simp |
56320 | 1753 |
then have "eventually (\<lambda>n. norm (f' n x u - g' x u) \<le> e / norm u * norm u) sequentially" |
68239 | 1754 |
using nle \<open>x \<in> S\<close> by (fast elim: eventually_mono) |
56320 | 1755 |
then show ?thesis |
60420 | 1756 |
using \<open>u \<noteq> 0\<close> by simp |
44123 | 1757 |
qed |
1758 |
qed |
|
1759 |
show "bounded_linear (g' x)" |
|
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1760 |
proof |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1761 |
fix x' y z :: 'a |
53781 | 1762 |
fix c :: real |
68055 | 1763 |
note lin = assms(2)[rule_format,OF \<open>x\<in>S\<close>,THEN has_derivative_bounded_linear] |
44123 | 1764 |
show "g' x (c *\<^sub>R x') = c *\<^sub>R g' x x'" |
68239 | 1765 |
apply (rule tendsto_unique[OF trivial_limit_sequentially tog']) |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1766 |
unfolding lin[THEN bounded_linear.linear, THEN linear_cmul] |
68239 | 1767 |
apply (intro tendsto_intros tog') |
53781 | 1768 |
done |
44123 | 1769 |
show "g' x (y + z) = g' x y + g' x z" |
68239 | 1770 |
apply (rule tendsto_unique[OF trivial_limit_sequentially tog']) |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1771 |
unfolding lin[THEN bounded_linear.linear, THEN linear_add] |
53781 | 1772 |
apply (rule tendsto_add) |
68239 | 1773 |
apply (rule tog')+ |
53781 | 1774 |
done |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1775 |
obtain N where N: "\<forall>h. norm (f' N x h - g' x h) \<le> 1 * norm h" |
68239 | 1776 |
using nle \<open>x \<in> S\<close> unfolding eventually_sequentially by (fast intro: zero_less_one) |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1777 |
have "bounded_linear (f' N x)" |
68239 | 1778 |
using derf \<open>x \<in> S\<close> by fast |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1779 |
from bounded_linear.bounded [OF this] |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1780 |
obtain K where K: "\<forall>h. norm (f' N x h) \<le> norm h * K" .. |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1781 |
{ |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1782 |
fix h |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1783 |
have "norm (g' x h) = norm (f' N x h - (f' N x h - g' x h))" |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1784 |
by simp |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1785 |
also have "\<dots> \<le> norm (f' N x h) + norm (f' N x h - g' x h)" |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1786 |
by (rule norm_triangle_ineq4) |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1787 |
also have "\<dots> \<le> norm h * K + 1 * norm h" |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1788 |
using N K by (fast intro: add_mono) |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1789 |
finally have "norm (g' x h) \<le> norm h * (K + 1)" |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1790 |
by (simp add: ring_distribs) |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1791 |
} |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1792 |
then show "\<exists>K. \<forall>h. norm (g' x h) \<le> norm h * K" by fast |
44123 | 1793 |
qed |
68239 | 1794 |
show "eventually (\<lambda>y. norm (g y - g x - g' x (y - x)) \<le> e * norm (y - x)) (at x within S)" |
1795 |
if "e > 0" for e |
|
1796 |
proof - |
|
1797 |
have *: "e / 3 > 0" |
|
1798 |
using that by auto |
|
68055 | 1799 |
obtain N1 where N1: "\<forall>n\<ge>N1. \<forall>x\<in>S. \<forall>h. norm (f' n x h - g' x h) \<le> e / 3 * norm h" |
68239 | 1800 |
using nle * unfolding eventually_sequentially by blast |
55665 | 1801 |
obtain N2 where |
68239 | 1802 |
N2[rule_format]: "\<forall>n\<ge>N2. \<forall>x\<in>S. \<forall>y\<in>S. norm (f n x - f n y - (g x - g y)) \<le> e / 3 * norm (x - y)" |
55665 | 1803 |
using lem2 * by blast |
56320 | 1804 |
let ?N = "max N1 N2" |
68055 | 1805 |
have "eventually (\<lambda>y. norm (f ?N y - f ?N x - f' ?N x (y - x)) \<le> e / 3 * norm (y - x)) (at x within S)" |
68239 | 1806 |
using derf[unfolded has_derivative_within_alt2] and \<open>x \<in> S\<close> and * by fast |
68055 | 1807 |
moreover have "eventually (\<lambda>y. y \<in> S) (at x within S)" |
56320 | 1808 |
unfolding eventually_at by (fast intro: zero_less_one) |
68055 | 1809 |
ultimately show "\<forall>\<^sub>F y in at x within S. norm (g y - g x - g' x (y - x)) \<le> e * norm (y - x)" |
56320 | 1810 |
proof (rule eventually_elim2) |
53781 | 1811 |
fix y |
68055 | 1812 |
assume "y \<in> S" |
56320 | 1813 |
assume "norm (f ?N y - f ?N x - f' ?N x (y - x)) \<le> e / 3 * norm (y - x)" |
1814 |
moreover have "norm (g y - g x - (f ?N y - f ?N x)) \<le> e / 3 * norm (y - x)" |
|
68239 | 1815 |
using N2[OF _ \<open>y \<in> S\<close> \<open>x \<in> S\<close>] |
56320 | 1816 |
by (simp add: norm_minus_commute) |
1817 |
ultimately have "norm (g y - g x - f' ?N x (y - x)) \<le> 2 * e / 3 * norm (y - x)" |
|
44123 | 1818 |
using norm_triangle_le[of "g y - g x - (f ?N y - f ?N x)" "f ?N y - f ?N x - f' ?N x (y - x)" "2 * e / 3 * norm (y - x)"] |
53781 | 1819 |
by (auto simp add: algebra_simps) |
44123 | 1820 |
moreover |
1821 |
have " norm (f' ?N x (y - x) - g' x (y - x)) \<le> e / 3 * norm (y - x)" |
|
68055 | 1822 |
using N1 \<open>x \<in> S\<close> by auto |
41958 | 1823 |
ultimately show "norm (g y - g x - g' x (y - x)) \<le> e * norm (y - x)" |
44123 | 1824 |
using norm_triangle_le[of "g y - g x - f' (max N1 N2) x (y - x)" "f' (max N1 N2) x (y - x) - g' x (y - x)"] |
53781 | 1825 |
by (auto simp add: algebra_simps) |
44123 | 1826 |
qed |
1827 |
qed |
|
1828 |
qed |
|
56320 | 1829 |
then show ?thesis by fast |
44123 | 1830 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1831 |
|
60420 | 1832 |
text \<open>Can choose to line up antiderivatives if we want.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1833 |
|
44123 | 1834 |
lemma has_antiderivative_sequence: |
60179 | 1835 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_vector \<Rightarrow> 'b::banach" |
68055 | 1836 |
assumes "convex S" |
1837 |
and der: "\<And>n x. x \<in> S \<Longrightarrow> ((f n) has_derivative (f' n x)) (at x within S)" |
|
68239 | 1838 |
and no: "\<And>e. e > 0 \<Longrightarrow> \<forall>\<^sub>F n in sequentially. |
1839 |
\<forall>x\<in>S. \<forall>h. norm (f' n x h - g' x h) \<le> e * norm h" |
|
68055 | 1840 |
shows "\<exists>g. \<forall>x\<in>S. (g has_derivative g' x) (at x within S)" |
1841 |
proof (cases "S = {}") |
|
53781 | 1842 |
case False |
68055 | 1843 |
then obtain a where "a \<in> S" |
53781 | 1844 |
by auto |
68055 | 1845 |
have *: "\<And>P Q. \<exists>g. \<forall>x\<in>S. P g x \<and> Q g x \<Longrightarrow> \<exists>g. \<forall>x\<in>S. Q g x" |
53781 | 1846 |
by auto |
44123 | 1847 |
show ?thesis |
53781 | 1848 |
apply (rule *) |
68055 | 1849 |
apply (rule has_derivative_sequence [OF \<open>convex S\<close> _ no, of "\<lambda>n x. f n x + (f 0 a - f n a)"]) |
1850 |
apply (metis assms(2) has_derivative_add_const) |
|
1851 |
using \<open>a \<in> S\<close> |
|
68239 | 1852 |
apply auto |
53781 | 1853 |
done |
44123 | 1854 |
qed auto |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1855 |
|
44123 | 1856 |
lemma has_antiderivative_limit: |
60179 | 1857 |
fixes g' :: "'a::real_normed_vector \<Rightarrow> 'a \<Rightarrow> 'b::banach" |
68055 | 1858 |
assumes "convex S" |
1859 |
and "\<And>e. e>0 \<Longrightarrow> \<exists>f f'. \<forall>x\<in>S. |
|
1860 |
(f has_derivative (f' x)) (at x within S) \<and> (\<forall>h. norm (f' x h - g' x h) \<le> e * norm h)" |
|
1861 |
shows "\<exists>g. \<forall>x\<in>S. (g has_derivative g' x) (at x within S)" |
|
53781 | 1862 |
proof - |
68055 | 1863 |
have *: "\<forall>n. \<exists>f f'. \<forall>x\<in>S. |
1864 |
(f has_derivative (f' x)) (at x within S) \<and> |
|
53781 | 1865 |
(\<forall>h. norm(f' x h - g' x h) \<le> inverse (real (Suc n)) * norm h)" |
61649
268d88ec9087
Tweaks for "real": Removal of [iff] status for some lemmas, adding [simp] for others. Plus fixes.
paulson <lp15@cam.ac.uk>
parents:
61560
diff
changeset
|
1866 |
by (simp add: assms(2)) |
55665 | 1867 |
obtain f where |
68055 | 1868 |
*: "\<And>x. \<exists>f'. \<forall>xa\<in>S. (f x has_derivative f' xa) (at xa within S) \<and> |
1869 |
(\<forall>h. norm (f' xa h - g' xa h) \<le> inverse (real (Suc x)) * norm h)" |
|
1870 |
using * by metis |
|
55665 | 1871 |
obtain f' where |
68055 | 1872 |
f': "\<And>x. \<forall>z\<in>S. (f x has_derivative f' x z) (at z within S) \<and> |
1873 |
(\<forall>h. norm (f' x z h - g' z h) \<le> inverse (real (Suc x)) * norm h)" |
|
1874 |
using * by metis |
|
53781 | 1875 |
show ?thesis |
68055 | 1876 |
proof (rule has_antiderivative_sequence[OF \<open>convex S\<close>, of f f']) |
53781 | 1877 |
fix e :: real |
1878 |
assume "e > 0" |
|
55665 | 1879 |
obtain N where N: "inverse (real (Suc N)) < e" |
60420 | 1880 |
using reals_Archimedean[OF \<open>e>0\<close>] .. |
68239 | 1881 |
show "\<forall>\<^sub>F n in sequentially. \<forall>x\<in>S. \<forall>h. norm (f' n x h - g' x h) \<le> e * norm h" |
1882 |
unfolding eventually_sequentially |
|
68055 | 1883 |
proof (intro exI allI ballI impI) |
61165 | 1884 |
fix n x h |
68055 | 1885 |
assume n: "N \<le> n" and x: "x \<in> S" |
53781 | 1886 |
have *: "inverse (real (Suc n)) \<le> e" |
1887 |
apply (rule order_trans[OF _ N[THEN less_imp_le]]) |
|
68239 | 1888 |
using n apply (auto simp add: field_simps) |
53781 | 1889 |
done |
61165 | 1890 |
show "norm (f' n x h - g' x h) \<le> e * norm h" |
68055 | 1891 |
by (meson "*" mult_right_mono norm_ge_zero order.trans x f') |
44123 | 1892 |
qed |
68055 | 1893 |
qed (use f' in auto) |
44123 | 1894 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1895 |
|
53781 | 1896 |
|
60420 | 1897 |
subsection \<open>Differentiation of a series\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1898 |
|
44123 | 1899 |
lemma has_derivative_series: |
60179 | 1900 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_vector \<Rightarrow> 'b::banach" |
68055 | 1901 |
assumes "convex S" |
1902 |
and "\<And>n x. x \<in> S \<Longrightarrow> ((f n) has_derivative (f' n x)) (at x within S)" |
|
68239 | 1903 |
and "\<And>e. e>0 \<Longrightarrow> \<forall>\<^sub>F n in sequentially. \<forall>x\<in>S. \<forall>h. norm (sum (\<lambda>i. f' i x h) {..<n} - g' x h) \<le> e * norm h" |
68055 | 1904 |
and "x \<in> S" |
56183 | 1905 |
and "(\<lambda>n. f n x) sums l" |
68055 | 1906 |
shows "\<exists>g. \<forall>x\<in>S. (\<lambda>n. f n x) sums (g x) \<and> (g has_derivative g' x) (at x within S)" |
56183 | 1907 |
unfolding sums_def |
53781 | 1908 |
apply (rule has_derivative_sequence[OF assms(1) _ assms(3)]) |
64267 | 1909 |
apply (metis assms(2) has_derivative_sum) |
53781 | 1910 |
using assms(4-5) |
56183 | 1911 |
unfolding sums_def |
53781 | 1912 |
apply auto |
1913 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1914 |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1915 |
lemma has_field_derivative_series: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1916 |
fixes f :: "nat \<Rightarrow> ('a :: {real_normed_field,banach}) \<Rightarrow> 'a" |
68055 | 1917 |
assumes "convex S" |
1918 |
assumes "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x within S)" |
|
1919 |
assumes "uniform_limit S (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially" |
|
1920 |
assumes "x0 \<in> S" "summable (\<lambda>n. f n x0)" |
|
1921 |
shows "\<exists>g. \<forall>x\<in>S. (\<lambda>n. f n x) sums g x \<and> (g has_field_derivative g' x) (at x within S)" |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1922 |
unfolding has_field_derivative_def |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1923 |
proof (rule has_derivative_series) |
68239 | 1924 |
show "\<forall>\<^sub>F n in sequentially. |
1925 |
\<forall>x\<in>S. \<forall>h. norm ((\<Sum>i<n. f' i x * h) - g' x * h) \<le> e * norm h" if "e > 0" for e |
|
1926 |
unfolding eventually_sequentially |
|
68055 | 1927 |
proof - |
1928 |
from that assms(3) obtain N where N: "\<And>n x. n \<ge> N \<Longrightarrow> x \<in> S \<Longrightarrow> norm ((\<Sum>i<n. f' i x) - g' x) < e" |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1929 |
unfolding uniform_limit_iff eventually_at_top_linorder dist_norm by blast |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1930 |
{ |
68055 | 1931 |
fix n :: nat and x h :: 'a assume nx: "n \<ge> N" "x \<in> S" |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1932 |
have "norm ((\<Sum>i<n. f' i x * h) - g' x * h) = norm ((\<Sum>i<n. f' i x) - g' x) * norm h" |
64267 | 1933 |
by (simp add: norm_mult [symmetric] ring_distribs sum_distrib_right) |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1934 |
also from N[OF nx] have "norm ((\<Sum>i<n. f' i x) - g' x) \<le> e" by simp |
61649
268d88ec9087
Tweaks for "real": Removal of [iff] status for some lemmas, adding [simp] for others. Plus fixes.
paulson <lp15@cam.ac.uk>
parents:
61560
diff
changeset
|
1935 |
hence "norm ((\<Sum>i<n. f' i x) - g' x) * norm h \<le> e * norm h" |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1936 |
by (intro mult_right_mono) simp_all |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1937 |
finally have "norm ((\<Sum>i<n. f' i x * h) - g' x * h) \<le> e * norm h" . |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1938 |
} |
68055 | 1939 |
thus "\<exists>N. \<forall>n\<ge>N. \<forall>x\<in>S. \<forall>h. norm ((\<Sum>i<n. f' i x * h) - g' x * h) \<le> e * norm h" by blast |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1940 |
qed |
68055 | 1941 |
qed (use assms in \<open>auto simp: has_field_derivative_def\<close>) |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1942 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1943 |
lemma has_field_derivative_series': |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1944 |
fixes f :: "nat \<Rightarrow> ('a :: {real_normed_field,banach}) \<Rightarrow> 'a" |
68055 | 1945 |
assumes "convex S" |
1946 |
assumes "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x within S)" |
|
1947 |
assumes "uniformly_convergent_on S (\<lambda>n x. \<Sum>i<n. f' i x)" |
|
1948 |
assumes "x0 \<in> S" "summable (\<lambda>n. f n x0)" "x \<in> interior S" |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1949 |
shows "summable (\<lambda>n. f n x)" "((\<lambda>x. \<Sum>n. f n x) has_field_derivative (\<Sum>n. f' n x)) (at x)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1950 |
proof - |
68055 | 1951 |
from \<open>x \<in> interior S\<close> have "x \<in> S" using interior_subset by blast |
63040 | 1952 |
define g' where [abs_def]: "g' x = (\<Sum>i. f' i x)" for x |
68055 | 1953 |
from assms(3) have "uniform_limit S (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially" |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1954 |
by (simp add: uniformly_convergent_uniform_limit_iff suminf_eq_lim g'_def) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1955 |
from has_field_derivative_series[OF assms(1,2) this assms(4,5)] obtain g where g: |
68055 | 1956 |
"\<And>x. x \<in> S \<Longrightarrow> (\<lambda>n. f n x) sums g x" |
1957 |
"\<And>x. x \<in> S \<Longrightarrow> (g has_field_derivative g' x) (at x within S)" by blast |
|
1958 |
from g(1)[OF \<open>x \<in> S\<close>] show "summable (\<lambda>n. f n x)" by (simp add: sums_iff) |
|
1959 |
from g(2)[OF \<open>x \<in> S\<close>] \<open>x \<in> interior S\<close> have "(g has_field_derivative g' x) (at x)" |
|
1960 |
by (simp add: at_within_interior[of x S]) |
|
61649
268d88ec9087
Tweaks for "real": Removal of [iff] status for some lemmas, adding [simp] for others. Plus fixes.
paulson <lp15@cam.ac.uk>
parents:
61560
diff
changeset
|
1961 |
also have "(g has_field_derivative g' x) (at x) \<longleftrightarrow> |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1962 |
((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' x) (at x)" |
68055 | 1963 |
using eventually_nhds_in_nhd[OF \<open>x \<in> interior S\<close>] interior_subset[of S] g(1) |
61810 | 1964 |
by (intro DERIV_cong_ev) (auto elim!: eventually_mono simp: sums_iff) |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1965 |
finally show "((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' x) (at x)" . |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1966 |
qed |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1967 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1968 |
lemma differentiable_series: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1969 |
fixes f :: "nat \<Rightarrow> ('a :: {real_normed_field,banach}) \<Rightarrow> 'a" |
68055 | 1970 |
assumes "convex S" "open S" |
1971 |
assumes "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x)" |
|
1972 |
assumes "uniformly_convergent_on S (\<lambda>n x. \<Sum>i<n. f' i x)" |
|
1973 |
assumes "x0 \<in> S" "summable (\<lambda>n. f n x0)" and x: "x \<in> S" |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1974 |
shows "summable (\<lambda>n. f n x)" and "(\<lambda>x. \<Sum>n. f n x) differentiable (at x)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1975 |
proof - |
68055 | 1976 |
from assms(4) obtain g' where A: "uniform_limit S (\<lambda>n x. \<Sum>i<n. f' i x) g' sequentially" |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1977 |
unfolding uniformly_convergent_on_def by blast |
68055 | 1978 |
from x and \<open>open S\<close> have S: "at x within S = at x" by (rule at_within_open) |
1979 |
have "\<exists>g. \<forall>x\<in>S. (\<lambda>n. f n x) sums g x \<and> (g has_field_derivative g' x) (at x within S)" |
|
1980 |
by (intro has_field_derivative_series[of S f f' g' x0] assms A has_field_derivative_at_within) |
|
1981 |
then obtain g where g: "\<And>x. x \<in> S \<Longrightarrow> (\<lambda>n. f n x) sums g x" |
|
1982 |
"\<And>x. x \<in> S \<Longrightarrow> (g has_field_derivative g' x) (at x within S)" by blast |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1983 |
from g[OF x] show "summable (\<lambda>n. f n x)" by (auto simp: summable_def) |
67399 | 1984 |
from g(2)[OF x] have g': "(g has_derivative ( * ) (g' x)) (at x)" |
68055 | 1985 |
by (simp add: has_field_derivative_def S) |
67399 | 1986 |
have "((\<lambda>x. \<Sum>n. f n x) has_derivative ( * ) (g' x)) (at x)" |
68055 | 1987 |
by (rule has_derivative_transform_within_open[OF g' \<open>open S\<close> x]) |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1988 |
(insert g, auto simp: sums_iff) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1989 |
thus "(\<lambda>x. \<Sum>n. f n x) differentiable (at x)" unfolding differentiable_def |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1990 |
by (auto simp: summable_def differentiable_def has_field_derivative_def) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1991 |
qed |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1992 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1993 |
lemma differentiable_series': |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1994 |
fixes f :: "nat \<Rightarrow> ('a :: {real_normed_field,banach}) \<Rightarrow> 'a" |
68055 | 1995 |
assumes "convex S" "open S" |
1996 |
assumes "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x)" |
|
1997 |
assumes "uniformly_convergent_on S (\<lambda>n x. \<Sum>i<n. f' i x)" |
|
1998 |
assumes "x0 \<in> S" "summable (\<lambda>n. f n x0)" |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
1999 |
shows "(\<lambda>x. \<Sum>n. f n x) differentiable (at x0)" |
68055 | 2000 |
using differentiable_series[OF assms, of x0] \<open>x0 \<in> S\<close> by blast+ |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2001 |
|
61076 | 2002 |
text \<open>Considering derivative @{typ "real \<Rightarrow> 'b::real_normed_vector"} as a vector.\<close> |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2003 |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2004 |
definition "vector_derivative f net = (SOME f'. (f has_vector_derivative f') net)" |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2005 |
|
61245 | 2006 |
lemma vector_derivative_unique_within: |
68055 | 2007 |
assumes not_bot: "at x within S \<noteq> bot" |
2008 |
and f': "(f has_vector_derivative f') (at x within S)" |
|
2009 |
and f'': "(f has_vector_derivative f'') (at x within S)" |
|
37730 | 2010 |
shows "f' = f''" |
53781 | 2011 |
proof - |
37730 | 2012 |
have "(\<lambda>x. x *\<^sub>R f') = (\<lambda>x. x *\<^sub>R f'')" |
68239 | 2013 |
proof (rule frechet_derivative_unique_within, simp_all) |
2014 |
show "\<exists>d. d \<noteq> 0 \<and> \<bar>d\<bar> < e \<and> x + d \<in> S" if "0 < e" for e |
|
2015 |
proof - |
|
2016 |
from that |
|
68055 | 2017 |
obtain x' where "x' \<in> S" "x' \<noteq> x" "\<bar>x' - x\<bar> < e" |
68239 | 2018 |
using islimpt_approachable_real[of x S] not_bot |
61245 | 2019 |
by (auto simp add: trivial_limit_within) |
68239 | 2020 |
then show ?thesis |
2021 |
using eq_iff_diff_eq_0 by fastforce |
|
61245 | 2022 |
qed |
68239 | 2023 |
qed (use f' f'' in \<open>auto simp: has_vector_derivative_def\<close>) |
53781 | 2024 |
then show ?thesis |
61649
268d88ec9087
Tweaks for "real": Removal of [iff] status for some lemmas, adding [simp] for others. Plus fixes.
paulson <lp15@cam.ac.uk>
parents:
61560
diff
changeset
|
2025 |
unfolding fun_eq_iff by (metis scaleR_one) |
37730 | 2026 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2027 |
|
61245 | 2028 |
lemma vector_derivative_unique_at: |
2029 |
"(f has_vector_derivative f') (at x) \<Longrightarrow> (f has_vector_derivative f'') (at x) \<Longrightarrow> f' = f''" |
|
2030 |
by (rule vector_derivative_unique_within) auto |
|
2031 |
||
2032 |
lemma differentiableI_vector: "(f has_vector_derivative y) F \<Longrightarrow> f differentiable F" |
|
2033 |
by (auto simp: differentiable_def has_vector_derivative_def) |
|
2034 |
||
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2035 |
lemma vector_derivative_works: |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2036 |
"f differentiable net \<longleftrightarrow> (f has_vector_derivative (vector_derivative f net)) net" |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2037 |
(is "?l = ?r") |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2038 |
proof |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2039 |
assume ?l |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2040 |
obtain f' where f': "(f has_derivative f') net" |
60420 | 2041 |
using \<open>?l\<close> unfolding differentiable_def .. |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2042 |
then interpret bounded_linear f' |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2043 |
by auto |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2044 |
show ?r |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2045 |
unfolding vector_derivative_def has_vector_derivative_def |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2046 |
by (rule someI[of _ "f' 1"]) (simp add: scaleR[symmetric] f') |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2047 |
qed (auto simp: vector_derivative_def has_vector_derivative_def differentiable_def) |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2048 |
|
61245 | 2049 |
lemma vector_derivative_within: |
68055 | 2050 |
assumes not_bot: "at x within S \<noteq> bot" and y: "(f has_vector_derivative y) (at x within S)" |
2051 |
shows "vector_derivative f (at x within S) = y" |
|
61245 | 2052 |
using y |
2053 |
by (intro vector_derivative_unique_within[OF not_bot vector_derivative_works[THEN iffD1] y]) |
|
2054 |
(auto simp: differentiable_def has_vector_derivative_def) |
|
2055 |
||
61520
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2056 |
lemma frechet_derivative_eq_vector_derivative: |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2057 |
assumes "f differentiable (at x)" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2058 |
shows "(frechet_derivative f (at x)) = (\<lambda>r. r *\<^sub>R vector_derivative f (at x))" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2059 |
using assms |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2060 |
by (auto simp: differentiable_iff_scaleR vector_derivative_def has_vector_derivative_def |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2061 |
intro: someI frechet_derivative_at [symmetric]) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2062 |
|
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2063 |
lemma has_real_derivative: |
61649
268d88ec9087
Tweaks for "real": Removal of [iff] status for some lemmas, adding [simp] for others. Plus fixes.
paulson <lp15@cam.ac.uk>
parents:
61560
diff
changeset
|
2064 |
fixes f :: "real \<Rightarrow> real" |
61520
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2065 |
assumes "(f has_derivative f') F" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2066 |
obtains c where "(f has_real_derivative c) F" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2067 |
proof - |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2068 |
obtain c where "f' = (\<lambda>x. x * c)" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2069 |
by (metis assms has_derivative_bounded_linear real_bounded_linear) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2070 |
then show ?thesis |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2071 |
by (metis assms that has_field_derivative_def mult_commute_abs) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2072 |
qed |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2073 |
|
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2074 |
lemma has_real_derivative_iff: |
61649
268d88ec9087
Tweaks for "real": Removal of [iff] status for some lemmas, adding [simp] for others. Plus fixes.
paulson <lp15@cam.ac.uk>
parents:
61560
diff
changeset
|
2075 |
fixes f :: "real \<Rightarrow> real" |
61520
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2076 |
shows "(\<exists>c. (f has_real_derivative c) F) = (\<exists>D. (f has_derivative D) F)" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2077 |
by (metis has_field_derivative_def has_real_derivative) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2078 |
|
64008
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63955
diff
changeset
|
2079 |
lemma has_vector_derivative_cong_ev: |
68055 | 2080 |
assumes *: "eventually (\<lambda>x. x \<in> S \<longrightarrow> f x = g x) (nhds x)" "f x = g x" |
2081 |
shows "(f has_vector_derivative f') (at x within S) = (g has_vector_derivative f') (at x within S)" |
|
64008
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63955
diff
changeset
|
2082 |
unfolding has_vector_derivative_def has_derivative_def |
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63955
diff
changeset
|
2083 |
using * |
68055 | 2084 |
apply (cases "at x within S \<noteq> bot") |
64008
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63955
diff
changeset
|
2085 |
apply (intro refl conj_cong filterlim_cong) |
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63955
diff
changeset
|
2086 |
apply (auto simp: netlimit_within eventually_at_filter elim: eventually_mono) |
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63955
diff
changeset
|
2087 |
done |
17a20ca86d62
HOL-Probability: more about probability, prepare for Markov processes in the AFP
hoelzl
parents:
63955
diff
changeset
|
2088 |
|
61520
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2089 |
definition deriv :: "('a \<Rightarrow> 'a::real_normed_field) \<Rightarrow> 'a \<Rightarrow> 'a" where |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2090 |
"deriv f x \<equiv> SOME D. DERIV f x :> D" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2091 |
|
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2092 |
lemma DERIV_imp_deriv: "DERIV f x :> f' \<Longrightarrow> deriv f x = f'" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2093 |
unfolding deriv_def by (metis some_equality DERIV_unique) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2094 |
|
61907
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents:
61880
diff
changeset
|
2095 |
lemma DERIV_deriv_iff_has_field_derivative: |
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents:
61880
diff
changeset
|
2096 |
"DERIV f x :> deriv f x \<longleftrightarrow> (\<exists>f'. (f has_field_derivative f') (at x))" |
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
paulson <lp15@cam.ac.uk>
parents:
61880
diff
changeset
|
2097 |
by (auto simp: has_field_derivative_def DERIV_imp_deriv) |
63627 | 2098 |
|
61520
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2099 |
lemma DERIV_deriv_iff_real_differentiable: |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2100 |
fixes x :: real |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2101 |
shows "DERIV f x :> deriv f x \<longleftrightarrow> f differentiable at x" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2102 |
unfolding differentiable_def by (metis DERIV_imp_deriv has_real_derivative_iff) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2103 |
|
64969 | 2104 |
lemma deriv_cong_ev: |
2105 |
assumes "eventually (\<lambda>x. f x = g x) (nhds x)" "x = y" |
|
2106 |
shows "deriv f x = deriv g y" |
|
2107 |
proof - |
|
2108 |
have "(\<lambda>D. (f has_field_derivative D) (at x)) = (\<lambda>D. (g has_field_derivative D) (at y))" |
|
2109 |
by (intro ext DERIV_cong_ev refl assms) |
|
2110 |
thus ?thesis by (simp add: deriv_def assms) |
|
2111 |
qed |
|
2112 |
||
66394
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2113 |
lemma higher_deriv_cong_ev: |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2114 |
assumes "eventually (\<lambda>x. f x = g x) (nhds x)" "x = y" |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2115 |
shows "(deriv ^^ n) f x = (deriv ^^ n) g y" |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2116 |
proof - |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2117 |
from assms(1) have "eventually (\<lambda>x. (deriv ^^ n) f x = (deriv ^^ n) g x) (nhds x)" |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2118 |
proof (induction n arbitrary: f g) |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2119 |
case (Suc n) |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2120 |
from Suc.prems have "eventually (\<lambda>y. eventually (\<lambda>z. f z = g z) (nhds y)) (nhds x)" |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2121 |
by (simp add: eventually_eventually) |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2122 |
hence "eventually (\<lambda>x. deriv f x = deriv g x) (nhds x)" |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2123 |
by eventually_elim (rule deriv_cong_ev, simp_all) |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2124 |
thus ?case by (auto intro!: deriv_cong_ev Suc simp: funpow_Suc_right simp del: funpow.simps) |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2125 |
qed auto |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2126 |
from eventually_nhds_x_imp_x[OF this] assms(2) show ?thesis by simp |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2127 |
qed |
32084d7e6b59
Some facts about orders of zeros
eberlm <eberlm@in.tum.de>
parents:
64969
diff
changeset
|
2128 |
|
61520
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2129 |
lemma real_derivative_chain: |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2130 |
fixes x :: real |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2131 |
shows "f differentiable at x \<Longrightarrow> g differentiable at (f x) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2132 |
\<Longrightarrow> deriv (g o f) x = deriv g (f x) * deriv f x" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2133 |
by (metis DERIV_deriv_iff_real_differentiable DERIV_chain DERIV_imp_deriv) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2134 |
lemma field_derivative_eq_vector_derivative: |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2135 |
"(deriv f x) = vector_derivative f (at x)" |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2136 |
by (simp add: mult.commute deriv_def vector_derivative_def has_vector_derivative_def has_field_derivative_def) |
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
paulson <lp15@cam.ac.uk>
parents:
61518
diff
changeset
|
2137 |
|
61245 | 2138 |
lemma islimpt_closure_open: |
2139 |
fixes s :: "'a::perfect_space set" |
|
2140 |
assumes "open s" and t: "t = closure s" "x \<in> t" |
|
2141 |
shows "x islimpt t" |
|
2142 |
proof cases |
|
61649
268d88ec9087
Tweaks for "real": Removal of [iff] status for some lemmas, adding [simp] for others. Plus fixes.
paulson <lp15@cam.ac.uk>
parents:
61560
diff
changeset
|
2143 |
assume "x \<in> s" |
61245 | 2144 |
{ fix T assume "x \<in> T" "open T" |
2145 |
then have "open (s \<inter> T)" |
|
2146 |
using \<open>open s\<close> by auto |
|
2147 |
then have "s \<inter> T \<noteq> {x}" |
|
2148 |
using not_open_singleton[of x] by auto |
|
2149 |
with \<open>x \<in> T\<close> \<open>x \<in> s\<close> have "\<exists>y\<in>t. y \<in> T \<and> y \<noteq> x" |
|
2150 |
using closure_subset[of s] by (auto simp: t) } |
|
2151 |
then show ?thesis |
|
2152 |
by (auto intro!: islimptI) |
|
2153 |
next |
|
2154 |
assume "x \<notin> s" with t show ?thesis |
|
2155 |
unfolding t closure_def by (auto intro: islimpt_subset) |
|
2156 |
qed |
|
2157 |
||
44123 | 2158 |
lemma vector_derivative_unique_within_closed_interval: |
61245 | 2159 |
assumes ab: "a < b" "x \<in> cbox a b" |
2160 |
assumes D: "(f has_vector_derivative f') (at x within cbox a b)" "(f has_vector_derivative f'') (at x within cbox a b)" |
|
44123 | 2161 |
shows "f' = f''" |
61245 | 2162 |
using ab |
2163 |
by (intro vector_derivative_unique_within[OF _ D]) |
|
2164 |
(auto simp: trivial_limit_within intro!: islimpt_closure_open[where s="{a <..< b}"]) |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2165 |
|
37730 | 2166 |
lemma vector_derivative_at: |
53781 | 2167 |
"(f has_vector_derivative f') (at x) \<Longrightarrow> vector_derivative f (at x) = f'" |
61245 | 2168 |
by (intro vector_derivative_within at_neq_bot) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2169 |
|
61104
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2170 |
lemma has_vector_derivative_id_at [simp]: "vector_derivative (\<lambda>x. x) (at a) = 1" |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2171 |
by (simp add: vector_derivative_at) |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2172 |
|
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2173 |
lemma vector_derivative_minus_at [simp]: |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2174 |
"f differentiable at a |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2175 |
\<Longrightarrow> vector_derivative (\<lambda>x. - f x) (at a) = - vector_derivative f (at a)" |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2176 |
by (simp add: vector_derivative_at has_vector_derivative_minus vector_derivative_works [symmetric]) |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2177 |
|
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2178 |
lemma vector_derivative_add_at [simp]: |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2179 |
"\<lbrakk>f differentiable at a; g differentiable at a\<rbrakk> |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2180 |
\<Longrightarrow> vector_derivative (\<lambda>x. f x + g x) (at a) = vector_derivative f (at a) + vector_derivative g (at a)" |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2181 |
by (simp add: vector_derivative_at has_vector_derivative_add vector_derivative_works [symmetric]) |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2182 |
|
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2183 |
lemma vector_derivative_diff_at [simp]: |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2184 |
"\<lbrakk>f differentiable at a; g differentiable at a\<rbrakk> |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2185 |
\<Longrightarrow> vector_derivative (\<lambda>x. f x - g x) (at a) = vector_derivative f (at a) - vector_derivative g (at a)" |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2186 |
by (simp add: vector_derivative_at has_vector_derivative_diff vector_derivative_works [symmetric]) |
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
paulson
parents:
61076
diff
changeset
|
2187 |
|
61204 | 2188 |
lemma vector_derivative_mult_at [simp]: |
2189 |
fixes f g :: "real \<Rightarrow> 'a :: real_normed_algebra" |
|
2190 |
shows "\<lbrakk>f differentiable at a; g differentiable at a\<rbrakk> |
|
2191 |
\<Longrightarrow> vector_derivative (\<lambda>x. f x * g x) (at a) = f a * vector_derivative g (at a) + vector_derivative f (at a) * g a" |
|
2192 |
by (simp add: vector_derivative_at has_vector_derivative_mult vector_derivative_works [symmetric]) |
|
2193 |
||
2194 |
lemma vector_derivative_scaleR_at [simp]: |
|
2195 |
"\<lbrakk>f differentiable at a; g differentiable at a\<rbrakk> |
|
2196 |
\<Longrightarrow> vector_derivative (\<lambda>x. f x *\<^sub>R g x) (at a) = f a *\<^sub>R vector_derivative g (at a) + vector_derivative f (at a) *\<^sub>R g a" |
|
2197 |
apply (rule vector_derivative_at) |
|
2198 |
apply (rule has_vector_derivative_scaleR) |
|
2199 |
apply (auto simp: vector_derivative_works has_vector_derivative_def has_field_derivative_def mult_commute_abs) |
|
2200 |
done |
|
2201 |
||
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2202 |
lemma vector_derivative_within_cbox: |
61245 | 2203 |
assumes ab: "a < b" "x \<in> cbox a b" |
2204 |
assumes f: "(f has_vector_derivative f') (at x within cbox a b)" |
|
56188 | 2205 |
shows "vector_derivative f (at x within cbox a b) = f'" |
61245 | 2206 |
by (intro vector_derivative_unique_within_closed_interval[OF ab _ f] |
2207 |
vector_derivative_works[THEN iffD1] differentiableI_vector) |
|
2208 |
fact |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2209 |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2210 |
lemma vector_derivative_within_closed_interval: |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2211 |
fixes f::"real \<Rightarrow> 'a::euclidean_space" |
68239 | 2212 |
assumes "a < b" and "x \<in> {a..b}" |
2213 |
assumes "(f has_vector_derivative f') (at x within {a..b})" |
|
2214 |
shows "vector_derivative f (at x within {a..b}) = f'" |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2215 |
using assms vector_derivative_within_cbox |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2216 |
by fastforce |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2217 |
|
53781 | 2218 |
lemma has_vector_derivative_within_subset: |
68239 | 2219 |
"(f has_vector_derivative f') (at x within S) \<Longrightarrow> T \<subseteq> S \<Longrightarrow> (f has_vector_derivative f') (at x within T)" |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2220 |
by (auto simp: has_vector_derivative_def intro: has_derivative_within_subset) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2221 |
|
44123 | 2222 |
lemma has_vector_derivative_at_within: |
68239 | 2223 |
"(f has_vector_derivative f') (at x) \<Longrightarrow> (f has_vector_derivative f') (at x within S)" |
44123 | 2224 |
unfolding has_vector_derivative_def |
67979
53323937ee25
new material about vec, real^1, etc.
paulson <lp15@cam.ac.uk>
parents:
67968
diff
changeset
|
2225 |
by (rule has_derivative_at_withinI) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2226 |
|
61880
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents:
61824
diff
changeset
|
2227 |
lemma has_vector_derivative_weaken: |
68239 | 2228 |
fixes x D and f g S T |
2229 |
assumes f: "(f has_vector_derivative D) (at x within T)" |
|
2230 |
and "x \<in> S" "S \<subseteq> T" |
|
2231 |
and "\<And>x. x \<in> S \<Longrightarrow> f x = g x" |
|
2232 |
shows "(g has_vector_derivative D) (at x within S)" |
|
61880
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents:
61824
diff
changeset
|
2233 |
proof - |
68239 | 2234 |
have "(f has_vector_derivative D) (at x within S) \<longleftrightarrow> (g has_vector_derivative D) (at x within S)" |
61880
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents:
61824
diff
changeset
|
2235 |
unfolding has_vector_derivative_def has_derivative_iff_norm |
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents:
61824
diff
changeset
|
2236 |
using assms by (intro conj_cong Lim_cong_within refl) auto |
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents:
61824
diff
changeset
|
2237 |
then show ?thesis |
68239 | 2238 |
using has_vector_derivative_within_subset[OF f \<open>S \<subseteq> T\<close>] by simp |
61880
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents:
61824
diff
changeset
|
2239 |
qed |
ff4d33058566
moved some theorems from the CLT proof; reordered some theorems / notation
hoelzl
parents:
61824
diff
changeset
|
2240 |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2241 |
lemma has_vector_derivative_transform_within: |
68239 | 2242 |
assumes "(f has_vector_derivative f') (at x within S)" |
62087
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
paulson
parents:
61975
diff
changeset
|
2243 |
and "0 < d" |
68239 | 2244 |
and "x \<in> S" |
2245 |
and "\<And>x'. \<lbrakk>x'\<in>S; dist x' x < d\<rbrakk> \<Longrightarrow> f x' = g x'" |
|
2246 |
shows "(g has_vector_derivative f') (at x within S)" |
|
53781 | 2247 |
using assms |
2248 |
unfolding has_vector_derivative_def |
|
44123 | 2249 |
by (rule has_derivative_transform_within) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2250 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2251 |
lemma has_vector_derivative_transform_within_open: |
62087
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
paulson
parents:
61975
diff
changeset
|
2252 |
assumes "(f has_vector_derivative f') (at x)" |
68239 | 2253 |
and "open S" |
2254 |
and "x \<in> S" |
|
2255 |
and "\<And>y. y\<in>S \<Longrightarrow> f y = g y" |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2256 |
shows "(g has_vector_derivative f') (at x)" |
53781 | 2257 |
using assms |
2258 |
unfolding has_vector_derivative_def |
|
44123 | 2259 |
by (rule has_derivative_transform_within_open) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2260 |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2261 |
lemma has_vector_derivative_transform: |
68239 | 2262 |
assumes "x \<in> S" "\<And>x. x \<in> S \<Longrightarrow> g x = f x" |
2263 |
assumes f': "(f has_vector_derivative f') (at x within S)" |
|
2264 |
shows "(g has_vector_derivative f') (at x within S)" |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2265 |
using assms |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2266 |
unfolding has_vector_derivative_def |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2267 |
by (rule has_derivative_transform) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2268 |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2269 |
lemma vector_diff_chain_at: |
44123 | 2270 |
assumes "(f has_vector_derivative f') (at x)" |
53781 | 2271 |
and "(g has_vector_derivative g') (at (f x))" |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2272 |
shows "((g \<circ> f) has_vector_derivative (f' *\<^sub>R g')) (at x)" |
68239 | 2273 |
using assms has_vector_derivative_at_within has_vector_derivative_def vector_derivative_diff_chain_within by blast |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2274 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2275 |
lemma vector_diff_chain_within: |
44123 | 2276 |
assumes "(f has_vector_derivative f') (at x within s)" |
53781 | 2277 |
and "(g has_vector_derivative g') (at (f x) within f ` s)" |
2278 |
shows "((g \<circ> f) has_vector_derivative (f' *\<^sub>R g')) (at x within s)" |
|
68239 | 2279 |
using assms has_vector_derivative_def vector_derivative_diff_chain_within by blast |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2280 |
|
60762 | 2281 |
lemma vector_derivative_const_at [simp]: "vector_derivative (\<lambda>x. c) (at a) = 0" |
2282 |
by (simp add: vector_derivative_at) |
|
2283 |
||
60800
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
2284 |
lemma vector_derivative_at_within_ivl: |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
2285 |
"(f has_vector_derivative f') (at x) \<Longrightarrow> |
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
2286 |
a \<le> x \<Longrightarrow> x \<le> b \<Longrightarrow> a<b \<Longrightarrow> vector_derivative f (at x within {a..b}) = f'" |
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2287 |
using has_vector_derivative_at_within vector_derivative_within_cbox by fastforce |
60800
7d04351c795a
New material for Cauchy's integral theorem
paulson <lp15@cam.ac.uk>
parents:
60762
diff
changeset
|
2288 |
|
61204 | 2289 |
lemma vector_derivative_chain_at: |
2290 |
assumes "f differentiable at x" "(g differentiable at (f x))" |
|
2291 |
shows "vector_derivative (g \<circ> f) (at x) = |
|
2292 |
vector_derivative f (at x) *\<^sub>R vector_derivative g (at (f x))" |
|
2293 |
by (metis vector_diff_chain_at vector_derivative_at vector_derivative_works assms) |
|
2294 |
||
62408
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
paulson <lp15@cam.ac.uk>
parents:
62393
diff
changeset
|
2295 |
lemma field_vector_diff_chain_at: (*thanks to Wenda Li*) |
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
paulson <lp15@cam.ac.uk>
parents:
62393
diff
changeset
|
2296 |
assumes Df: "(f has_vector_derivative f') (at x)" |
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
paulson <lp15@cam.ac.uk>
parents:
62393
diff
changeset
|
2297 |
and Dg: "(g has_field_derivative g') (at (f x))" |
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
paulson <lp15@cam.ac.uk>
parents:
62393
diff
changeset
|
2298 |
shows "((g \<circ> f) has_vector_derivative (f' * g')) (at x)" |
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
paulson <lp15@cam.ac.uk>
parents:
62393
diff
changeset
|
2299 |
using diff_chain_at[OF Df[unfolded has_vector_derivative_def] |
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
paulson <lp15@cam.ac.uk>
parents:
62393
diff
changeset
|
2300 |
Dg [unfolded has_field_derivative_def]] |
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
paulson <lp15@cam.ac.uk>
parents:
62393
diff
changeset
|
2301 |
by (auto simp: o_def mult.commute has_vector_derivative_def) |
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
paulson <lp15@cam.ac.uk>
parents:
62393
diff
changeset
|
2302 |
|
64394 | 2303 |
lemma vector_derivative_chain_within: |
68239 | 2304 |
assumes "at x within S \<noteq> bot" "f differentiable (at x within S)" |
2305 |
"(g has_derivative g') (at (f x) within f ` S)" |
|
2306 |
shows "vector_derivative (g \<circ> f) (at x within S) = |
|
2307 |
g' (vector_derivative f (at x within S)) " |
|
2308 |
apply (rule vector_derivative_within [OF \<open>at x within S \<noteq> bot\<close>]) |
|
64394 | 2309 |
apply (rule vector_derivative_diff_chain_within) |
2310 |
using assms(2-3) vector_derivative_works |
|
2311 |
by auto |
|
2312 |
||
2313 |
subsection\<open>The notion of being field differentiable\<close> |
|
2314 |
||
2315 |
definition field_differentiable :: "['a \<Rightarrow> 'a::real_normed_field, 'a filter] \<Rightarrow> bool" |
|
2316 |
(infixr "(field'_differentiable)" 50) |
|
2317 |
where "f field_differentiable F \<equiv> \<exists>f'. (f has_field_derivative f') F" |
|
2318 |
||
2319 |
lemma field_differentiable_imp_differentiable: |
|
2320 |
"f field_differentiable F \<Longrightarrow> f differentiable F" |
|
2321 |
unfolding field_differentiable_def differentiable_def |
|
2322 |
using has_field_derivative_imp_has_derivative by auto |
|
2323 |
||
2324 |
lemma field_differentiable_derivI: |
|
2325 |
"f field_differentiable (at x) \<Longrightarrow> (f has_field_derivative deriv f x) (at x)" |
|
2326 |
by (simp add: field_differentiable_def DERIV_deriv_iff_has_field_derivative) |
|
2327 |
||
2328 |
lemma field_differentiable_imp_continuous_at: |
|
68239 | 2329 |
"f field_differentiable (at x within S) \<Longrightarrow> continuous (at x within S) f" |
64394 | 2330 |
by (metis DERIV_continuous field_differentiable_def) |
2331 |
||
2332 |
lemma field_differentiable_within_subset: |
|
68239 | 2333 |
"\<lbrakk>f field_differentiable (at x within S); T \<subseteq> S\<rbrakk> \<Longrightarrow> f field_differentiable (at x within T)" |
64394 | 2334 |
by (metis DERIV_subset field_differentiable_def) |
2335 |
||
2336 |
lemma field_differentiable_at_within: |
|
2337 |
"\<lbrakk>f field_differentiable (at x)\<rbrakk> |
|
68239 | 2338 |
\<Longrightarrow> f field_differentiable (at x within S)" |
64394 | 2339 |
unfolding field_differentiable_def |
2340 |
by (metis DERIV_subset top_greatest) |
|
2341 |
||
67399 | 2342 |
lemma field_differentiable_linear [simp,derivative_intros]: "(( * ) c) field_differentiable F" |
68239 | 2343 |
unfolding field_differentiable_def has_field_derivative_def mult_commute_abs |
2344 |
by (force intro: has_derivative_mult_right) |
|
64394 | 2345 |
|
2346 |
lemma field_differentiable_const [simp,derivative_intros]: "(\<lambda>z. c) field_differentiable F" |
|
2347 |
unfolding field_differentiable_def has_field_derivative_def |
|
2348 |
using DERIV_const has_field_derivative_imp_has_derivative by blast |
|
2349 |
||
2350 |
lemma field_differentiable_ident [simp,derivative_intros]: "(\<lambda>z. z) field_differentiable F" |
|
2351 |
unfolding field_differentiable_def has_field_derivative_def |
|
2352 |
using DERIV_ident has_field_derivative_def by blast |
|
2353 |
||
2354 |
lemma field_differentiable_id [simp,derivative_intros]: "id field_differentiable F" |
|
2355 |
unfolding id_def by (rule field_differentiable_ident) |
|
2356 |
||
2357 |
lemma field_differentiable_minus [derivative_intros]: |
|
2358 |
"f field_differentiable F \<Longrightarrow> (\<lambda>z. - (f z)) field_differentiable F" |
|
2359 |
unfolding field_differentiable_def |
|
2360 |
by (metis field_differentiable_minus) |
|
2361 |
||
2362 |
lemma field_differentiable_add [derivative_intros]: |
|
2363 |
assumes "f field_differentiable F" "g field_differentiable F" |
|
2364 |
shows "(\<lambda>z. f z + g z) field_differentiable F" |
|
2365 |
using assms unfolding field_differentiable_def |
|
2366 |
by (metis field_differentiable_add) |
|
2367 |
||
2368 |
lemma field_differentiable_add_const [simp,derivative_intros]: |
|
67399 | 2369 |
"(+) c field_differentiable F" |
64394 | 2370 |
by (simp add: field_differentiable_add) |
2371 |
||
2372 |
lemma field_differentiable_sum [derivative_intros]: |
|
2373 |
"(\<And>i. i \<in> I \<Longrightarrow> (f i) field_differentiable F) \<Longrightarrow> (\<lambda>z. \<Sum>i\<in>I. f i z) field_differentiable F" |
|
2374 |
by (induct I rule: infinite_finite_induct) |
|
2375 |
(auto intro: field_differentiable_add field_differentiable_const) |
|
2376 |
||
2377 |
lemma field_differentiable_diff [derivative_intros]: |
|
2378 |
assumes "f field_differentiable F" "g field_differentiable F" |
|
2379 |
shows "(\<lambda>z. f z - g z) field_differentiable F" |
|
2380 |
using assms unfolding field_differentiable_def |
|
2381 |
by (metis field_differentiable_diff) |
|
2382 |
||
2383 |
lemma field_differentiable_inverse [derivative_intros]: |
|
68239 | 2384 |
assumes "f field_differentiable (at a within S)" "f a \<noteq> 0" |
2385 |
shows "(\<lambda>z. inverse (f z)) field_differentiable (at a within S)" |
|
64394 | 2386 |
using assms unfolding field_differentiable_def |
2387 |
by (metis DERIV_inverse_fun) |
|
2388 |
||
2389 |
lemma field_differentiable_mult [derivative_intros]: |
|
68239 | 2390 |
assumes "f field_differentiable (at a within S)" |
2391 |
"g field_differentiable (at a within S)" |
|
2392 |
shows "(\<lambda>z. f z * g z) field_differentiable (at a within S)" |
|
64394 | 2393 |
using assms unfolding field_differentiable_def |
68239 | 2394 |
by (metis DERIV_mult [of f _ a S g]) |
64394 | 2395 |
|
2396 |
lemma field_differentiable_divide [derivative_intros]: |
|
68239 | 2397 |
assumes "f field_differentiable (at a within S)" |
2398 |
"g field_differentiable (at a within S)" |
|
64394 | 2399 |
"g a \<noteq> 0" |
68239 | 2400 |
shows "(\<lambda>z. f z / g z) field_differentiable (at a within S)" |
64394 | 2401 |
using assms unfolding field_differentiable_def |
68239 | 2402 |
by (metis DERIV_divide [of f _ a S g]) |
64394 | 2403 |
|
2404 |
lemma field_differentiable_power [derivative_intros]: |
|
68239 | 2405 |
assumes "f field_differentiable (at a within S)" |
2406 |
shows "(\<lambda>z. f z ^ n) field_differentiable (at a within S)" |
|
64394 | 2407 |
using assms unfolding field_differentiable_def |
2408 |
by (metis DERIV_power) |
|
2409 |
||
2410 |
lemma field_differentiable_transform_within: |
|
2411 |
"0 < d \<Longrightarrow> |
|
68239 | 2412 |
x \<in> S \<Longrightarrow> |
2413 |
(\<And>x'. x' \<in> S \<Longrightarrow> dist x' x < d \<Longrightarrow> f x' = g x') \<Longrightarrow> |
|
2414 |
f field_differentiable (at x within S) |
|
2415 |
\<Longrightarrow> g field_differentiable (at x within S)" |
|
64394 | 2416 |
unfolding field_differentiable_def has_field_derivative_def |
2417 |
by (blast intro: has_derivative_transform_within) |
|
2418 |
||
2419 |
lemma field_differentiable_compose_within: |
|
68239 | 2420 |
assumes "f field_differentiable (at a within S)" |
2421 |
"g field_differentiable (at (f a) within f`S)" |
|
2422 |
shows "(g o f) field_differentiable (at a within S)" |
|
64394 | 2423 |
using assms unfolding field_differentiable_def |
2424 |
by (metis DERIV_image_chain) |
|
2425 |
||
2426 |
lemma field_differentiable_compose: |
|
2427 |
"f field_differentiable at z \<Longrightarrow> g field_differentiable at (f z) |
|
2428 |
\<Longrightarrow> (g o f) field_differentiable at z" |
|
2429 |
by (metis field_differentiable_at_within field_differentiable_compose_within) |
|
2430 |
||
2431 |
lemma field_differentiable_within_open: |
|
68239 | 2432 |
"\<lbrakk>a \<in> S; open S\<rbrakk> \<Longrightarrow> f field_differentiable at a within S \<longleftrightarrow> |
64394 | 2433 |
f field_differentiable at a" |
2434 |
unfolding field_differentiable_def |
|
2435 |
by (metis at_within_open) |
|
2436 |
||
2437 |
lemma vector_derivative_chain_at_general: |
|
2438 |
assumes "f differentiable at x" "g field_differentiable at (f x)" |
|
2439 |
shows "vector_derivative (g \<circ> f) (at x) = vector_derivative f (at x) * deriv g (f x)" |
|
2440 |
apply (rule vector_derivative_at [OF field_vector_diff_chain_at]) |
|
2441 |
using assms vector_derivative_works by (auto simp: field_differentiable_derivI) |
|
62408
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
paulson <lp15@cam.ac.uk>
parents:
62393
diff
changeset
|
2442 |
|
62949
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2443 |
lemma exp_scaleR_has_vector_derivative_right: |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2444 |
"((\<lambda>t. exp (t *\<^sub>R A)) has_vector_derivative exp (t *\<^sub>R A) * A) (at t within T)" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2445 |
unfolding has_vector_derivative_def |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2446 |
proof (rule has_derivativeI) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2447 |
let ?F = "at t within (T \<inter> {t - 1 <..< t + 1})" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2448 |
have *: "at t within T = ?F" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2449 |
by (rule at_within_nhd[where S="{t - 1 <..< t + 1}"]) auto |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2450 |
let ?e = "\<lambda>i x. (inverse (1 + real i) * inverse (fact i) * (x - t) ^ i) *\<^sub>R (A * A ^ i)" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2451 |
have "\<forall>\<^sub>F n in sequentially. |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2452 |
\<forall>x\<in>T \<inter> {t - 1<..<t + 1}. norm (?e n x) \<le> norm (A ^ (n + 1) /\<^sub>R fact (n + 1))" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2453 |
by (auto simp: divide_simps power_abs intro!: mult_left_le_one_le power_le_one eventuallyI) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2454 |
then have "uniform_limit (T \<inter> {t - 1<..<t + 1}) (\<lambda>n x. \<Sum>i<n. ?e i x) (\<lambda>x. \<Sum>i. ?e i x) sequentially" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2455 |
by (rule weierstrass_m_test_ev) (intro summable_ignore_initial_segment summable_norm_exp) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2456 |
moreover |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2457 |
have "\<forall>\<^sub>F x in sequentially. x > 0" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2458 |
by (metis eventually_gt_at_top) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2459 |
then have |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2460 |
"\<forall>\<^sub>F n in sequentially. ((\<lambda>x. \<Sum>i<n. ?e i x) \<longlongrightarrow> A) ?F" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2461 |
by eventually_elim |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2462 |
(auto intro!: tendsto_eq_intros |
68072
493b818e8e10
added Johannes' generalizations Modules.thy and Vector_Spaces.thy; adapted HOL and HOL-Analysis accordingly
immler
parents:
67979
diff
changeset
|
2463 |
simp: power_0_left if_distrib if_distribR sum.delta |
62949
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2464 |
cong: if_cong) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2465 |
ultimately |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2466 |
have [tendsto_intros]: "((\<lambda>x. \<Sum>i. ?e i x) \<longlongrightarrow> A) ?F" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2467 |
by (auto intro!: swap_uniform_limit[where f="\<lambda>n x. \<Sum>i < n. ?e i x" and F = sequentially]) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2468 |
have [tendsto_intros]: "((\<lambda>x. if x = t then 0 else 1) \<longlongrightarrow> 1) ?F" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2469 |
by (rule Lim_eventually) (simp add: eventually_at_filter) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2470 |
have "((\<lambda>y. ((y - t) / abs (y - t)) *\<^sub>R ((\<Sum>n. ?e n y) - A)) \<longlongrightarrow> 0) (at t within T)" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2471 |
unfolding * |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2472 |
by (rule tendsto_norm_zero_cancel) (auto intro!: tendsto_eq_intros) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2473 |
|
68239 | 2474 |
moreover have "\<forall>\<^sub>F x in at t within T. x \<noteq> t" |
62949
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2475 |
by (simp add: eventually_at_filter) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2476 |
then have "\<forall>\<^sub>F x in at t within T. ((x - t) / \<bar>x - t\<bar>) *\<^sub>R ((\<Sum>n. ?e n x) - A) = |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2477 |
(exp ((x - t) *\<^sub>R A) - 1 - (x - t) *\<^sub>R A) /\<^sub>R norm (x - t)" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2478 |
proof eventually_elim |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2479 |
case (elim x) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2480 |
have "(exp ((x - t) *\<^sub>R A) - 1 - (x - t) *\<^sub>R A) /\<^sub>R norm (x - t) = |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2481 |
((\<Sum>n. (x - t) *\<^sub>R ?e n x) - (x - t) *\<^sub>R A) /\<^sub>R norm (x - t)" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2482 |
unfolding exp_first_term |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2483 |
by (simp add: ac_simps) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2484 |
also |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2485 |
have "summable (\<lambda>n. ?e n x)" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2486 |
proof - |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2487 |
from elim have "?e n x = (((x - t) *\<^sub>R A) ^ (n + 1)) /\<^sub>R fact (n + 1) /\<^sub>R (x - t)" for n |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2488 |
by simp |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2489 |
then show ?thesis |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2490 |
by (auto simp only: |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2491 |
intro!: summable_scaleR_right summable_ignore_initial_segment summable_exp_generic) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2492 |
qed |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2493 |
then have "(\<Sum>n. (x - t) *\<^sub>R ?e n x) = (x - t) *\<^sub>R (\<Sum>n. ?e n x)" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2494 |
by (rule suminf_scaleR_right[symmetric]) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2495 |
also have "(\<dots> - (x - t) *\<^sub>R A) /\<^sub>R norm (x - t) = (x - t) *\<^sub>R ((\<Sum>n. ?e n x) - A) /\<^sub>R norm (x - t)" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2496 |
by (simp add: algebra_simps) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2497 |
finally show ?case |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2498 |
by (simp add: divide_simps) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2499 |
qed |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2500 |
|
68239 | 2501 |
ultimately have "((\<lambda>y. (exp ((y - t) *\<^sub>R A) - 1 - (y - t) *\<^sub>R A) /\<^sub>R norm (y - t)) \<longlongrightarrow> 0) (at t within T)" |
62949
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2502 |
by (rule Lim_transform_eventually[rotated]) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2503 |
from tendsto_mult_right_zero[OF this, where c="exp (t *\<^sub>R A)"] |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2504 |
show "((\<lambda>y. (exp (y *\<^sub>R A) - exp (t *\<^sub>R A) - (y - t) *\<^sub>R (exp (t *\<^sub>R A) * A)) /\<^sub>R norm (y - t)) \<longlongrightarrow> 0) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2505 |
(at t within T)" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2506 |
by (rule Lim_transform_eventually[rotated]) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2507 |
(auto simp: algebra_simps divide_simps exp_add_commuting[symmetric]) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2508 |
qed (rule bounded_linear_scaleR_left) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2509 |
|
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2510 |
lemma exp_times_scaleR_commute: "exp (t *\<^sub>R A) * A = A * exp (t *\<^sub>R A)" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2511 |
using exp_times_arg_commute[symmetric, of "t *\<^sub>R A"] |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2512 |
by (auto simp: algebra_simps) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2513 |
|
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2514 |
lemma exp_scaleR_has_vector_derivative_left: "((\<lambda>t. exp (t *\<^sub>R A)) has_vector_derivative A * exp (t *\<^sub>R A)) (at t)" |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2515 |
using exp_scaleR_has_vector_derivative_right[of A t] |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2516 |
by (simp add: exp_times_scaleR_commute) |
f36a54da47a4
added derivative of scaling in exponential function
immler
parents:
62533
diff
changeset
|
2517 |
|
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2518 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2519 |
subsection \<open>Relation between convexity and derivative\<close> |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2520 |
|
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2521 |
(* TODO: Generalise to real vector spaces? *) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2522 |
lemma convex_on_imp_above_tangent: |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2523 |
assumes convex: "convex_on A f" and connected: "connected A" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2524 |
assumes c: "c \<in> interior A" and x : "x \<in> A" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2525 |
assumes deriv: "(f has_field_derivative f') (at c within A)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2526 |
shows "f x - f c \<ge> f' * (x - c)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2527 |
proof (cases x c rule: linorder_cases) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2528 |
assume xc: "x > c" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2529 |
let ?A' = "interior A \<inter> {c<..}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2530 |
from c have "c \<in> interior A \<inter> closure {c<..}" by auto |
63128 | 2531 |
also have "\<dots> \<subseteq> closure (interior A \<inter> {c<..})" by (intro open_Int_closure_subset) auto |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2532 |
finally have "at c within ?A' \<noteq> bot" by (subst at_within_eq_bot_iff) auto |
61973 | 2533 |
moreover from deriv have "((\<lambda>y. (f y - f c) / (y - c)) \<longlongrightarrow> f') (at c within ?A')" |
68239 | 2534 |
unfolding has_field_derivative_iff using interior_subset[of A] by (blast intro: tendsto_mono at_le) |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2535 |
moreover from eventually_at_right_real[OF xc] |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2536 |
have "eventually (\<lambda>y. (f y - f c) / (y - c) \<le> (f x - f c) / (x - c)) (at_right c)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2537 |
proof eventually_elim |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2538 |
fix y assume y: "y \<in> {c<..<x}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2539 |
with convex connected x c have "f y \<le> (f x - f c) / (x - c) * (y - c) + f c" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2540 |
using interior_subset[of A] |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2541 |
by (intro convex_onD_Icc' convex_on_subset[OF convex] connected_contains_Icc) auto |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2542 |
hence "f y - f c \<le> (f x - f c) / (x - c) * (y - c)" by simp |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2543 |
thus "(f y - f c) / (y - c) \<le> (f x - f c) / (x - c)" using y xc by (simp add: divide_simps) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2544 |
qed |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2545 |
hence "eventually (\<lambda>y. (f y - f c) / (y - c) \<le> (f x - f c) / (x - c)) (at c within ?A')" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2546 |
by (blast intro: filter_leD at_le) |
63952
354808e9f44b
new material connected with HOL Light measure theory, plus more rationalisation
paulson <lp15@cam.ac.uk>
parents:
63938
diff
changeset
|
2547 |
ultimately have "f' \<le> (f x - f c) / (x - c)" by (simp add: tendsto_upperbound) |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2548 |
thus ?thesis using xc by (simp add: field_simps) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2549 |
next |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2550 |
assume xc: "x < c" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2551 |
let ?A' = "interior A \<inter> {..<c}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2552 |
from c have "c \<in> interior A \<inter> closure {..<c}" by auto |
63128 | 2553 |
also have "\<dots> \<subseteq> closure (interior A \<inter> {..<c})" by (intro open_Int_closure_subset) auto |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2554 |
finally have "at c within ?A' \<noteq> bot" by (subst at_within_eq_bot_iff) auto |
61973 | 2555 |
moreover from deriv have "((\<lambda>y. (f y - f c) / (y - c)) \<longlongrightarrow> f') (at c within ?A')" |
68239 | 2556 |
unfolding has_field_derivative_iff using interior_subset[of A] by (blast intro: tendsto_mono at_le) |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2557 |
moreover from eventually_at_left_real[OF xc] |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2558 |
have "eventually (\<lambda>y. (f y - f c) / (y - c) \<ge> (f x - f c) / (x - c)) (at_left c)" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2559 |
proof eventually_elim |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2560 |
fix y assume y: "y \<in> {x<..<c}" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2561 |
with convex connected x c have "f y \<le> (f x - f c) / (c - x) * (c - y) + f c" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2562 |
using interior_subset[of A] |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2563 |
by (intro convex_onD_Icc'' convex_on_subset[OF convex] connected_contains_Icc) auto |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2564 |
hence "f y - f c \<le> (f x - f c) * ((c - y) / (c - x))" by simp |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2565 |
also have "(c - y) / (c - x) = (y - c) / (x - c)" using y xc by (simp add: field_simps) |
61649
268d88ec9087
Tweaks for "real": Removal of [iff] status for some lemmas, adding [simp] for others. Plus fixes.
paulson <lp15@cam.ac.uk>
parents:
61560
diff
changeset
|
2566 |
finally show "(f y - f c) / (y - c) \<ge> (f x - f c) / (x - c)" using y xc |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2567 |
by (simp add: divide_simps) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2568 |
qed |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2569 |
hence "eventually (\<lambda>y. (f y - f c) / (y - c) \<ge> (f x - f c) / (x - c)) (at c within ?A')" |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2570 |
by (blast intro: filter_leD at_le) |
63952
354808e9f44b
new material connected with HOL Light measure theory, plus more rationalisation
paulson <lp15@cam.ac.uk>
parents:
63938
diff
changeset
|
2571 |
ultimately have "f' \<ge> (f x - f c) / (x - c)" by (simp add: tendsto_lowerbound) |
61531
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2572 |
thus ?thesis using xc by (simp add: field_simps) |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2573 |
qed simp_all |
ab2e862263e7
Rounding function, uniform limits, cotangent, binomial identities
eberlm
parents:
61524
diff
changeset
|
2574 |
|
62207 | 2575 |
|
2576 |
subsection \<open>Partial derivatives\<close> |
|
2577 |
||
2578 |
lemma eventually_at_Pair_within_TimesI1: |
|
2579 |
fixes x::"'a::metric_space" |
|
2580 |
assumes "\<forall>\<^sub>F x' in at x within X. P x'" |
|
2581 |
assumes "P x" |
|
2582 |
shows "\<forall>\<^sub>F (x', y') in at (x, y) within X \<times> Y. P x'" |
|
2583 |
proof - |
|
2584 |
from assms[unfolded eventually_at_topological] |
|
2585 |
obtain S where S: "open S" "x \<in> S" "\<And>x'. x' \<in> X \<Longrightarrow> x' \<in> S \<Longrightarrow> P x'" |
|
2586 |
by metis |
|
2587 |
show "\<forall>\<^sub>F (x', y') in at (x, y) within X \<times> Y. P x'" |
|
2588 |
unfolding eventually_at_topological |
|
2589 |
by (auto intro!: exI[where x="S \<times> UNIV"] S open_Times) |
|
2590 |
qed |
|
2591 |
||
2592 |
lemma eventually_at_Pair_within_TimesI2: |
|
2593 |
fixes x::"'a::metric_space" |
|
68239 | 2594 |
assumes "\<forall>\<^sub>F y' in at y within Y. P y'" "P y" |
62207 | 2595 |
shows "\<forall>\<^sub>F (x', y') in at (x, y) within X \<times> Y. P y'" |
2596 |
proof - |
|
2597 |
from assms[unfolded eventually_at_topological] |
|
2598 |
obtain S where S: "open S" "y \<in> S" "\<And>y'. y' \<in> Y \<Longrightarrow> y' \<in> S \<Longrightarrow> P y'" |
|
2599 |
by metis |
|
2600 |
show "\<forall>\<^sub>F (x', y') in at (x, y) within X \<times> Y. P y'" |
|
2601 |
unfolding eventually_at_topological |
|
2602 |
by (auto intro!: exI[where x="UNIV \<times> S"] S open_Times) |
|
2603 |
qed |
|
2604 |
||
2605 |
lemma has_derivative_partialsI: |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2606 |
fixes f::"'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector \<Rightarrow> 'c::real_normed_vector" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2607 |
assumes fx: "((\<lambda>x. f x y) has_derivative fx) (at x within X)" |
62207 | 2608 |
assumes fy: "\<And>x y. x \<in> X \<Longrightarrow> y \<in> Y \<Longrightarrow> ((\<lambda>y. f x y) has_derivative blinfun_apply (fy x y)) (at y within Y)" |
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2609 |
assumes fy_cont[unfolded continuous_within]: "continuous (at (x, y) within X \<times> Y) (\<lambda>(x, y). fy x y)" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2610 |
assumes "y \<in> Y" "convex Y" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2611 |
shows "((\<lambda>(x, y). f x y) has_derivative (\<lambda>(tx, ty). fx tx + fy x y ty)) (at (x, y) within X \<times> Y)" |
62207 | 2612 |
proof (safe intro!: has_derivativeI tendstoI, goal_cases) |
2613 |
case (2 e') |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2614 |
interpret fx: bounded_linear "fx" using fx by (rule has_derivative_bounded_linear) |
63040 | 2615 |
define e where "e = e' / 9" |
62207 | 2616 |
have "e > 0" using \<open>e' > 0\<close> by (simp add: e_def) |
2617 |
||
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2618 |
from fy_cont[THEN tendstoD, OF \<open>e > 0\<close>] |
62207 | 2619 |
have "\<forall>\<^sub>F (x', y') in at (x, y) within X \<times> Y. dist (fy x' y') (fy x y) < e" |
2620 |
by (auto simp: split_beta') |
|
2621 |
from this[unfolded eventually_at] obtain d' where |
|
2622 |
"d' > 0" |
|
2623 |
"\<And>x' y'. x' \<in> X \<Longrightarrow> y' \<in> Y \<Longrightarrow> (x', y') \<noteq> (x, y) \<Longrightarrow> dist (x', y') (x, y) < d' \<Longrightarrow> |
|
2624 |
dist (fy x' y') (fy x y) < e" |
|
2625 |
by auto |
|
2626 |
then |
|
2627 |
have d': "x' \<in> X \<Longrightarrow> y' \<in> Y \<Longrightarrow> dist (x', y') (x, y) < d' \<Longrightarrow> dist (fy x' y') (fy x y) < e" |
|
2628 |
for x' y' |
|
2629 |
using \<open>0 < e\<close> |
|
2630 |
by (cases "(x', y') = (x, y)") auto |
|
63040 | 2631 |
define d where "d = d' / sqrt 2" |
62207 | 2632 |
have "d > 0" using \<open>0 < d'\<close> by (simp add: d_def) |
2633 |
have d: "x' \<in> X \<Longrightarrow> y' \<in> Y \<Longrightarrow> dist x' x < d \<Longrightarrow> dist y' y < d \<Longrightarrow> dist (fy x' y') (fy x y) < e" |
|
2634 |
for x' y' |
|
2635 |
by (auto simp: dist_prod_def d_def intro!: d' real_sqrt_sum_squares_less) |
|
2636 |
||
2637 |
let ?S = "ball y d \<inter> Y" |
|
2638 |
have "convex ?S" |
|
2639 |
by (auto intro!: convex_Int \<open>convex Y\<close>) |
|
2640 |
{ |
|
2641 |
fix x'::'a and y'::'b |
|
2642 |
assume x': "x' \<in> X" and y': "y' \<in> Y" |
|
2643 |
assume dx': "dist x' x < d" and dy': "dist y' y < d" |
|
2644 |
have "norm (fy x' y' - fy x' y) \<le> dist (fy x' y') (fy x y) + dist (fy x' y) (fy x y)" |
|
2645 |
by norm |
|
2646 |
also have "dist (fy x' y') (fy x y) < e" |
|
2647 |
by (rule d; fact) |
|
2648 |
also have "dist (fy x' y) (fy x y) < e" |
|
2649 |
by (auto intro!: d simp: dist_prod_def x' \<open>d > 0\<close> \<open>y \<in> Y\<close> dx') |
|
2650 |
finally |
|
2651 |
have "norm (fy x' y' - fy x' y) < e + e" |
|
2652 |
by arith |
|
2653 |
then have "onorm (blinfun_apply (fy x' y') - blinfun_apply (fy x' y)) < e + e" |
|
2654 |
by (auto simp: norm_blinfun.rep_eq blinfun.diff_left[abs_def] fun_diff_def) |
|
2655 |
} note onorm = this |
|
2656 |
||
2657 |
have ev_mem: "\<forall>\<^sub>F (x', y') in at (x, y) within X \<times> Y. (x', y') \<in> X \<times> Y" |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2658 |
using \<open>y \<in> Y\<close> |
62207 | 2659 |
by (auto simp: eventually_at intro!: zero_less_one) |
2660 |
moreover |
|
2661 |
have ev_dist: "\<forall>\<^sub>F xy in at (x, y) within X \<times> Y. dist xy (x, y) < d" if "d > 0" for d |
|
2662 |
using eventually_at_ball[OF that] |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2663 |
by (rule eventually_elim2) (auto simp: dist_commute mem_ball intro!: eventually_True) |
62207 | 2664 |
note ev_dist[OF \<open>0 < d\<close>] |
2665 |
ultimately |
|
2666 |
have "\<forall>\<^sub>F (x', y') in at (x, y) within X \<times> Y. |
|
2667 |
norm (f x' y' - f x' y - (fy x' y) (y' - y)) \<le> norm (y' - y) * (e + e)" |
|
2668 |
proof (eventually_elim, safe) |
|
2669 |
fix x' y' |
|
2670 |
assume "x' \<in> X" and y': "y' \<in> Y" |
|
2671 |
assume dist: "dist (x', y') (x, y) < d" |
|
2672 |
then have dx: "dist x' x < d" and dy: "dist y' y < d" |
|
2673 |
unfolding dist_prod_def fst_conv snd_conv atomize_conj |
|
2674 |
by (metis le_less_trans real_sqrt_sum_squares_ge1 real_sqrt_sum_squares_ge2) |
|
2675 |
{ |
|
2676 |
fix t::real |
|
2677 |
assume "t \<in> {0 .. 1}" |
|
2678 |
then have "y + t *\<^sub>R (y' - y) \<in> closed_segment y y'" |
|
2679 |
by (auto simp: closed_segment_def algebra_simps intro!: exI[where x=t]) |
|
2680 |
also |
|
2681 |
have "\<dots> \<subseteq> ball y d \<inter> Y" |
|
2682 |
using \<open>y \<in> Y\<close> \<open>0 < d\<close> dy y' |
|
2683 |
by (intro \<open>convex ?S\<close>[unfolded convex_contains_segment, rule_format, of y y']) |
|
68239 | 2684 |
(auto simp: dist_commute) |
62207 | 2685 |
finally have "y + t *\<^sub>R (y' - y) \<in> ?S" . |
2686 |
} note seg = this |
|
2687 |
||
68239 | 2688 |
have "\<And>x. x \<in> ball y d \<inter> Y \<Longrightarrow> onorm (blinfun_apply (fy x' x) - blinfun_apply (fy x' y)) \<le> e + e" |
2689 |
by (safe intro!: onorm less_imp_le \<open>x' \<in> X\<close> dx) (auto simp: dist_commute \<open>0 < d\<close> \<open>y \<in> Y\<close>) |
|
62207 | 2690 |
with seg has_derivative_within_subset[OF assms(2)[OF \<open>x' \<in> X\<close>]] |
2691 |
show "norm (f x' y' - f x' y - (fy x' y) (y' - y)) \<le> norm (y' - y) * (e + e)" |
|
2692 |
by (rule differentiable_bound_linearization[where S="?S"]) |
|
2693 |
(auto intro!: \<open>0 < d\<close> \<open>y \<in> Y\<close>) |
|
2694 |
qed |
|
2695 |
moreover |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2696 |
let ?le = "\<lambda>x'. norm (f x' y - f x y - (fx) (x' - x)) \<le> norm (x' - x) * e" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2697 |
from fx[unfolded has_derivative_within, THEN conjunct2, THEN tendstoD, OF \<open>0 < e\<close>] |
62207 | 2698 |
have "\<forall>\<^sub>F x' in at x within X. ?le x'" |
2699 |
by eventually_elim |
|
68239 | 2700 |
(auto simp: dist_norm divide_simps blinfun.bilinear_simps field_simps split: if_split_asm) |
62207 | 2701 |
then have "\<forall>\<^sub>F (x', y') in at (x, y) within X \<times> Y. ?le x'" |
2702 |
by (rule eventually_at_Pair_within_TimesI1) |
|
68239 | 2703 |
(simp add: blinfun.bilinear_simps) |
62207 | 2704 |
moreover have "\<forall>\<^sub>F (x', y') in at (x, y) within X \<times> Y. norm ((x', y') - (x, y)) \<noteq> 0" |
2705 |
unfolding norm_eq_zero right_minus_eq |
|
2706 |
by (auto simp: eventually_at intro!: zero_less_one) |
|
2707 |
moreover |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2708 |
from fy_cont[THEN tendstoD, OF \<open>0 < e\<close>] |
62207 | 2709 |
have "\<forall>\<^sub>F x' in at x within X. norm (fy x' y - fy x y) < e" |
2710 |
unfolding eventually_at |
|
2711 |
using \<open>y \<in> Y\<close> |
|
2712 |
by (auto simp: dist_prod_def dist_norm) |
|
2713 |
then have "\<forall>\<^sub>F (x', y') in at (x, y) within X \<times> Y. norm (fy x' y - fy x y) < e" |
|
2714 |
by (rule eventually_at_Pair_within_TimesI1) |
|
2715 |
(simp add: blinfun.bilinear_simps \<open>0 < e\<close>) |
|
2716 |
ultimately |
|
2717 |
have "\<forall>\<^sub>F (x', y') in at (x, y) within X \<times> Y. |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2718 |
norm ((f x' y' - f x y - (fx (x' - x) + fy x y (y' - y))) /\<^sub>R |
62207 | 2719 |
norm ((x', y') - (x, y))) |
2720 |
< e'" |
|
2721 |
apply eventually_elim |
|
2722 |
proof safe |
|
2723 |
fix x' y' |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2724 |
have "norm (f x' y' - f x y - (fx (x' - x) + fy x y (y' - y))) \<le> |
62207 | 2725 |
norm (f x' y' - f x' y - fy x' y (y' - y)) + |
2726 |
norm (fy x y (y' - y) - fy x' y (y' - y)) + |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2727 |
norm (f x' y - f x y - fx (x' - x))" |
62207 | 2728 |
by norm |
2729 |
also |
|
2730 |
assume nz: "norm ((x', y') - (x, y)) \<noteq> 0" |
|
2731 |
and nfy: "norm (fy x' y - fy x y) < e" |
|
2732 |
assume "norm (f x' y' - f x' y - blinfun_apply (fy x' y) (y' - y)) \<le> norm (y' - y) * (e + e)" |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2733 |
also assume "norm (f x' y - f x y - (fx) (x' - x)) \<le> norm (x' - x) * e" |
62207 | 2734 |
also |
2735 |
have "norm ((fy x y) (y' - y) - (fy x' y) (y' - y)) \<le> norm ((fy x y) - (fy x' y)) * norm (y' - y)" |
|
2736 |
by (auto simp: blinfun.bilinear_simps[symmetric] intro!: norm_blinfun) |
|
2737 |
also have "\<dots> \<le> (e + e) * norm (y' - y)" |
|
2738 |
using \<open>e > 0\<close> nfy |
|
2739 |
by (auto simp: norm_minus_commute intro!: mult_right_mono) |
|
2740 |
also have "norm (x' - x) * e \<le> norm (x' - x) * (e + e)" |
|
2741 |
using \<open>0 < e\<close> by simp |
|
2742 |
also have "norm (y' - y) * (e + e) + (e + e) * norm (y' - y) + norm (x' - x) * (e + e) \<le> |
|
2743 |
(norm (y' - y) + norm (x' - x)) * (4 * e)" |
|
2744 |
using \<open>e > 0\<close> |
|
2745 |
by (simp add: algebra_simps) |
|
2746 |
also have "\<dots> \<le> 2 * norm ((x', y') - (x, y)) * (4 * e)" |
|
2747 |
using \<open>0 < e\<close> real_sqrt_sum_squares_ge1[of "norm (x' - x)" "norm (y' - y)"] |
|
2748 |
real_sqrt_sum_squares_ge2[of "norm (y' - y)" "norm (x' - x)"] |
|
2749 |
by (auto intro!: mult_right_mono simp: norm_prod_def |
|
2750 |
simp del: real_sqrt_sum_squares_ge1 real_sqrt_sum_squares_ge2) |
|
2751 |
also have "\<dots> \<le> norm ((x', y') - (x, y)) * (8 * e)" |
|
2752 |
by simp |
|
2753 |
also have "\<dots> < norm ((x', y') - (x, y)) * e'" |
|
2754 |
using \<open>0 < e'\<close> nz |
|
2755 |
by (auto simp: e_def) |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2756 |
finally show "norm ((f x' y' - f x y - (fx (x' - x) + fy x y (y' - y))) /\<^sub>R norm ((x', y') - (x, y))) < e'" |
62207 | 2757 |
by (auto simp: divide_simps dist_norm mult.commute) |
2758 |
qed |
|
2759 |
then show ?case |
|
2760 |
by eventually_elim (auto simp: dist_norm field_simps) |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2761 |
next |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2762 |
from has_derivative_bounded_linear[OF fx] |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2763 |
obtain fxb where "fx = blinfun_apply fxb" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2764 |
by (metis bounded_linear_Blinfun_apply) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2765 |
then show "bounded_linear (\<lambda>(tx, ty). fx tx + blinfun_apply (fy x y) ty)" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2766 |
by (auto intro!: bounded_linear_intros simp: split_beta') |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2767 |
qed |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2768 |
|
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2769 |
|
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2770 |
subsection \<open>Differentiable case distinction\<close> |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2771 |
|
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2772 |
lemma has_derivative_within_If_eq: |
68239 | 2773 |
"((\<lambda>x. if P x then f x else g x) has_derivative f') (at x within S) = |
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2774 |
(bounded_linear f' \<and> |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2775 |
((\<lambda>y.(if P y then (f y - ((if P x then f x else g x) + f' (y - x)))/\<^sub>R norm (y - x) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2776 |
else (g y - ((if P x then f x else g x) + f' (y - x)))/\<^sub>R norm (y - x))) |
68239 | 2777 |
\<longlongrightarrow> 0) (at x within S))" |
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2778 |
(is "_ = (_ \<and> (?if \<longlongrightarrow> 0) _)") |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2779 |
proof - |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2780 |
have "(\<lambda>y. (1 / norm (y - x)) *\<^sub>R |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2781 |
((if P y then f y else g y) - |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2782 |
((if P x then f x else g x) + f' (y - x)))) = ?if" |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2783 |
by (auto simp: inverse_eq_divide) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2784 |
thus ?thesis by (auto simp: has_derivative_within) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2785 |
qed |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2786 |
|
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2787 |
lemma has_derivative_If_within_closures: |
68239 | 2788 |
assumes f': "x \<in> S \<union> (closure S \<inter> closure T) \<Longrightarrow> |
2789 |
(f has_derivative f' x) (at x within S \<union> (closure S \<inter> closure T))" |
|
2790 |
assumes g': "x \<in> T \<union> (closure S \<inter> closure T) \<Longrightarrow> |
|
2791 |
(g has_derivative g' x) (at x within T \<union> (closure S \<inter> closure T))" |
|
2792 |
assumes connect: "x \<in> closure S \<Longrightarrow> x \<in> closure T \<Longrightarrow> f x = g x" |
|
2793 |
assumes connect': "x \<in> closure S \<Longrightarrow> x \<in> closure T \<Longrightarrow> f' x = g' x" |
|
2794 |
assumes x_in: "x \<in> S \<union> T" |
|
2795 |
shows "((\<lambda>x. if x \<in> S then f x else g x) has_derivative |
|
2796 |
(if x \<in> S then f' x else g' x)) (at x within (S \<union> T))" |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2797 |
proof - |
68239 | 2798 |
from f' x_in interpret f': bounded_linear "if x \<in> S then f' x else (\<lambda>x. 0)" |
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2799 |
by (auto simp add: has_derivative_within) |
68239 | 2800 |
from g' interpret g': bounded_linear "if x \<in> T then g' x else (\<lambda>x. 0)" |
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2801 |
by (auto simp add: has_derivative_within) |
68239 | 2802 |
have bl: "bounded_linear (if x \<in> S then f' x else g' x)" |
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2803 |
using f'.scaleR f'.bounded f'.add g'.scaleR g'.bounded g'.add x_in |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2804 |
by (unfold_locales; force) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2805 |
show ?thesis |
68239 | 2806 |
using f' g' closure_subset[of T] closure_subset[of S] |
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2807 |
unfolding has_derivative_within_If_eq |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2808 |
by (intro conjI bl tendsto_If_within_closures x_in) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2809 |
(auto simp: has_derivative_within inverse_eq_divide connect connect' set_mp) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2810 |
qed |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2811 |
|
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2812 |
lemma has_vector_derivative_If_within_closures: |
68239 | 2813 |
assumes x_in: "x \<in> S \<union> T" |
2814 |
assumes "u = S \<union> T" |
|
2815 |
assumes f': "x \<in> S \<union> (closure S \<inter> closure T) \<Longrightarrow> |
|
2816 |
(f has_vector_derivative f' x) (at x within S \<union> (closure S \<inter> closure T))" |
|
2817 |
assumes g': "x \<in> T \<union> (closure S \<inter> closure T) \<Longrightarrow> |
|
2818 |
(g has_vector_derivative g' x) (at x within T \<union> (closure S \<inter> closure T))" |
|
2819 |
assumes connect: "x \<in> closure S \<Longrightarrow> x \<in> closure T \<Longrightarrow> f x = g x" |
|
2820 |
assumes connect': "x \<in> closure S \<Longrightarrow> x \<in> closure T \<Longrightarrow> f' x = g' x" |
|
2821 |
shows "((\<lambda>x. if x \<in> S then f x else g x) has_vector_derivative |
|
2822 |
(if x \<in> S then f' x else g' x)) (at x within u)" |
|
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2823 |
unfolding has_vector_derivative_def assms |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2824 |
using x_in |
68241
39a311f50344
correcting the statements of the MVTs
paulson <lp15@cam.ac.uk>
parents:
68239
diff
changeset
|
2825 |
apply (intro has_derivative_If_within_closures[where ?f' = "\<lambda>x a. a *\<^sub>R f' x" and ?g' = "\<lambda>x a. a *\<^sub>R g' x", |
67685
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2826 |
THEN has_derivative_eq_rhs]) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2827 |
subgoal by (rule f'[unfolded has_vector_derivative_def]; assumption) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2828 |
subgoal by (rule g'[unfolded has_vector_derivative_def]; assumption) |
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
immler
parents:
67682
diff
changeset
|
2829 |
by (auto simp: assms) |
62207 | 2830 |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2831 |
end |