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