author | immler |
Tue, 05 May 2015 18:45:10 +0200 | |
changeset 60178 | f620c70f9e9b |
parent 60177 | 2bfcb83531c6 |
child 60179 | d87c8c2d4938 |
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 |
|
58877 | 6 |
section {* Multivariate calculus in Euclidean space *} |
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 |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
9 |
imports Brouwer_Fixpoint Operator_Norm |
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 |
|
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
|
12 |
lemma netlimit_at_vector: (* TODO: move *) |
37730 | 13 |
fixes a :: "'a::real_normed_vector" |
14 |
shows "netlimit (at a) = a" |
|
15 |
proof (cases "\<exists>x. x \<noteq> a") |
|
16 |
case True then obtain x where x: "x \<noteq> a" .. |
|
17 |
have "\<not> trivial_limit (at a)" |
|
18 |
unfolding trivial_limit_def eventually_at dist_norm |
|
19 |
apply clarsimp |
|
20 |
apply (rule_tac x="a + scaleR (d / 2) (sgn (x - a))" in exI) |
|
21 |
apply (simp add: norm_sgn sgn_zero_iff x) |
|
22 |
done |
|
53781 | 23 |
then show ?thesis |
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
|
24 |
by (rule netlimit_within [of a UNIV]) |
37730 | 25 |
qed simp |
26 |
||
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
|
27 |
(* Because I do not want to type this all the time *) |
53781 | 28 |
lemmas linear_linear = linear_conv_bounded_linear[symmetric] |
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
|
29 |
|
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
30 |
declare has_derivative_bounded_linear[dest] |
44137 | 31 |
|
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
|
32 |
subsection {* Derivatives *} |
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
|
33 |
|
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
|
34 |
subsubsection {* Combining theorems. *} |
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
|
35 |
|
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
36 |
lemmas has_derivative_id = has_derivative_ident |
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
37 |
lemmas has_derivative_neg = has_derivative_minus |
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
38 |
lemmas has_derivative_sub = has_derivative_diff |
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
39 |
lemmas scaleR_right_has_derivative = has_derivative_scaleR_right |
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
40 |
lemmas scaleR_left_has_derivative = has_derivative_scaleR_left |
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
41 |
lemmas inner_right_has_derivative = has_derivative_inner_right |
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
42 |
lemmas inner_left_has_derivative = has_derivative_inner_left |
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
43 |
lemmas mult_right_has_derivative = has_derivative_mult_right |
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
44 |
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
|
45 |
|
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
|
46 |
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
|
47 |
"(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
|
48 |
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
|
49 |
|
53781 | 50 |
|
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
|
51 |
subsection {* Derivative with composed bilinear function. *} |
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 |
|
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
|
53 |
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
|
54 |
assumes "(f has_derivative f') (at x within s)" |
53781 | 55 |
and "(g has_derivative g') (at x within s)" |
56 |
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
|
57 |
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
|
58 |
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
|
59 |
|
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 |
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
|
61 |
assumes "(f has_derivative f') (at x)" |
53781 | 62 |
and "(g has_derivative g') (at x)" |
63 |
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
|
64 |
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
|
65 |
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
|
66 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
67 |
text {* These are the only cases we'll care about, probably. *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
68 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
69 |
lemma has_derivative_within: "(f has_derivative f') (at x within s) \<longleftrightarrow> |
53781 | 70 |
bounded_linear f' \<and> ((\<lambda>y. (1 / norm(y - x)) *\<^sub>R (f y - (f x + f' (y - x)))) ---> 0) (at x within s)" |
71 |
unfolding has_derivative_def Lim |
|
57865 | 72 |
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
|
73 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
74 |
lemma has_derivative_at: "(f has_derivative f') (at x) \<longleftrightarrow> |
53781 | 75 |
bounded_linear f' \<and> ((\<lambda>y. (1 / (norm(y - x))) *\<^sub>R (f y - (f x + f' (y - x)))) ---> 0) (at x)" |
76 |
using has_derivative_within [of f f' x UNIV] |
|
77 |
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
|
78 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
79 |
text {* More explicit epsilon-delta forms. *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
80 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
81 |
lemma has_derivative_within': |
53781 | 82 |
"(f has_derivative f')(at x within s) \<longleftrightarrow> |
83 |
bounded_linear f' \<and> |
|
84 |
(\<forall>e>0. \<exists>d>0. \<forall>x'\<in>s. 0 < norm (x' - x) \<and> norm (x' - x) < d \<longrightarrow> |
|
85 |
norm (f x' - f x - f'(x' - x)) / norm (x' - x) < e)" |
|
36587 | 86 |
unfolding has_derivative_within Lim_within dist_norm |
53781 | 87 |
unfolding diff_0_right |
88 |
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
|
89 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
90 |
lemma has_derivative_at': |
53781 | 91 |
"(f has_derivative f') (at x) \<longleftrightarrow> bounded_linear f' \<and> |
92 |
(\<forall>e>0. \<exists>d>0. \<forall>x'. 0 < norm (x' - x) \<and> norm (x' - x) < d \<longrightarrow> |
|
93 |
norm (f x' - f x - f'(x' - x)) / norm (x' - x) < e)" |
|
94 |
using has_derivative_within' [of f f' x UNIV] |
|
95 |
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
|
96 |
|
53781 | 97 |
lemma has_derivative_at_within: |
98 |
"(f has_derivative f') (at x) \<Longrightarrow> (f has_derivative f') (at x within s)" |
|
99 |
unfolding has_derivative_within' has_derivative_at' |
|
100 |
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
|
101 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
102 |
lemma has_derivative_within_open: |
53781 | 103 |
"a \<in> s \<Longrightarrow> open s \<Longrightarrow> |
104 |
(f has_derivative f') (at a within s) \<longleftrightarrow> (f has_derivative f') (at a)" |
|
37730 | 105 |
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
|
106 |
|
43338 | 107 |
lemma has_derivative_right: |
53781 | 108 |
fixes f :: "real \<Rightarrow> real" |
109 |
and y :: "real" |
|
43338 | 110 |
shows "(f has_derivative (op * y)) (at x within ({x <..} \<inter> I)) \<longleftrightarrow> |
111 |
((\<lambda>t. (f x - f t) / (x - t)) ---> y) (at x within ({x <..} \<inter> I))" |
|
112 |
proof - |
|
113 |
have "((\<lambda>t. (f t - (f x + y * (t - x))) / \<bar>t - x\<bar>) ---> 0) (at x within ({x<..} \<inter> I)) \<longleftrightarrow> |
|
114 |
((\<lambda>t. (f t - f x) / (t - x) - y) ---> 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
|
115 |
by (intro Lim_cong_within) (auto simp add: diff_divide_distrib add_divide_distrib) |
43338 | 116 |
also have "\<dots> \<longleftrightarrow> ((\<lambda>t. (f t - f x) / (t - x)) ---> y) (at x within ({x<..} \<inter> I))" |
117 |
by (simp add: Lim_null[symmetric]) |
|
118 |
also have "\<dots> \<longleftrightarrow> ((\<lambda>t. (f x - f t) / (x - t)) ---> y) (at x within ({x<..} \<inter> I))" |
|
44140
2c10c35dd4be
remove several redundant and unused theorems about derivatives
huffman
parents:
44137
diff
changeset
|
119 |
by (intro Lim_cong_within) (simp_all add: field_simps) |
43338 | 120 |
finally show ?thesis |
44282
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
huffman
parents:
44140
diff
changeset
|
121 |
by (simp add: bounded_linear_mult_right has_derivative_within) |
43338 | 122 |
qed |
123 |
||
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
124 |
subsubsection {*Caratheodory characterization*} |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
125 |
|
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
126 |
lemma DERIV_within_iff: |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
127 |
"(f has_field_derivative D) (at a within s) \<longleftrightarrow> ((\<lambda>z. (f z - f a) / (z - a)) ---> 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
|
128 |
proof - |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
129 |
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
|
130 |
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
|
131 |
show ?thesis |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
132 |
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
|
133 |
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
|
134 |
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
|
135 |
apply (simp add: nonzero_norm_divide [symmetric]) |
59815
cce82e360c2f
explicit commutative additive inverse operation;
haftmann
parents:
59558
diff
changeset
|
136 |
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
|
137 |
done |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
138 |
qed |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
139 |
|
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
140 |
lemma DERIV_caratheodory_within: |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
141 |
"(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
|
142 |
(\<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
|
143 |
(is "?lhs = ?rhs") |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
144 |
proof |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
145 |
assume ?lhs |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
146 |
show ?rhs |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
147 |
proof (intro exI conjI) |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
148 |
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
|
149 |
show "\<forall>z. f z - f x = ?g z * (z-x)" by simp |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
150 |
show "continuous (at x within s) ?g" using `?lhs` |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
151 |
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
|
152 |
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
|
153 |
qed |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
154 |
next |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
155 |
assume ?rhs |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
156 |
then obtain g where |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
157 |
"(\<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
|
158 |
thus ?lhs |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
159 |
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
|
160 |
qed |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
161 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
162 |
subsubsection {* Limit transformation for derivatives *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
163 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
164 |
lemma has_derivative_transform_within: |
53781 | 165 |
assumes "0 < d" |
166 |
and "x \<in> s" |
|
167 |
and "\<forall>x'\<in>s. dist x' x < d \<longrightarrow> f x' = g x'" |
|
168 |
and "(f has_derivative f') (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
|
169 |
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
|
170 |
using assms |
53781 | 171 |
unfolding has_derivative_within |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
172 |
apply clarify |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
173 |
apply (rule Lim_transform_within, auto) |
53781 | 174 |
done |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
175 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
176 |
lemma has_derivative_transform_at: |
53781 | 177 |
assumes "0 < d" |
178 |
and "\<forall>x'. dist x' x < d \<longrightarrow> f x' = g x'" |
|
179 |
and "(f has_derivative f') (at x)" |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
180 |
shows "(g has_derivative f') (at x)" |
53781 | 181 |
using has_derivative_transform_within [of d x UNIV f g f'] assms |
182 |
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
|
183 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
184 |
lemma has_derivative_transform_within_open: |
53781 | 185 |
assumes "open s" |
186 |
and "x \<in> s" |
|
187 |
and "\<forall>y\<in>s. f y = g y" |
|
188 |
and "(f has_derivative f') (at x)" |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
189 |
shows "(g has_derivative f') (at x)" |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
190 |
using assms |
53781 | 191 |
unfolding has_derivative_at |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
192 |
apply clarify |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
193 |
apply (rule Lim_transform_within_open[OF assms(1,2)], auto) |
53781 | 194 |
done |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
195 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
196 |
subsection {* Differentiability *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
197 |
|
53781 | 198 |
definition |
199 |
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
|
200 |
(infix "differentiable'_on" 50) |
53781 | 201 |
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
|
202 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
203 |
lemma differentiableI: "(f has_derivative f') net \<Longrightarrow> f differentiable net" |
53781 | 204 |
unfolding differentiable_def |
205 |
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
|
206 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
207 |
lemma differentiable_at_withinI: "f differentiable (at x) \<Longrightarrow> f differentiable (at x within s)" |
53781 | 208 |
unfolding differentiable_def |
209 |
using has_derivative_at_within |
|
210 |
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
|
211 |
|
44123 | 212 |
lemma differentiable_within_open: (* TODO: delete *) |
53781 | 213 |
assumes "a \<in> s" |
214 |
and "open s" |
|
215 |
shows "f differentiable (at a within s) \<longleftrightarrow> f differentiable (at a)" |
|
216 |
using assms |
|
217 |
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
|
218 |
|
44123 | 219 |
lemma differentiable_on_eq_differentiable_at: |
53781 | 220 |
"open s \<Longrightarrow> f differentiable_on s \<longleftrightarrow> (\<forall>x\<in>s. f differentiable at x)" |
44123 | 221 |
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
|
222 |
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
|
223 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
224 |
lemma differentiable_transform_within: |
53781 | 225 |
assumes "0 < d" |
226 |
and "x \<in> s" |
|
227 |
and "\<forall>x'\<in>s. dist x' x < d \<longrightarrow> f x' = g x'" |
|
44123 | 228 |
assumes "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
|
229 |
shows "g differentiable (at x within s)" |
53781 | 230 |
using assms(4) |
231 |
unfolding differentiable_def |
|
44123 | 232 |
by (auto intro!: has_derivative_transform_within[OF assms(1-3)]) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
233 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
234 |
lemma differentiable_transform_at: |
53781 | 235 |
assumes "0 < d" |
236 |
and "\<forall>x'. dist x' x < d \<longrightarrow> f x' = g x'" |
|
237 |
and "f differentiable at x" |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
238 |
shows "g differentiable at x" |
53781 | 239 |
using assms(3) |
240 |
unfolding differentiable_def |
|
241 |
using has_derivative_transform_at[OF assms(1-2)] |
|
242 |
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
|
243 |
|
53781 | 244 |
|
245 |
subsection {* Frechet derivative and Jacobian matrix *} |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
246 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
247 |
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
|
248 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
249 |
lemma frechet_derivative_works: |
53781 | 250 |
"f differentiable net \<longleftrightarrow> (f has_derivative (frechet_derivative f net)) net" |
251 |
unfolding frechet_derivative_def differentiable_def |
|
252 |
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
|
253 |
|
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
254 |
lemma linear_frechet_derivative: "f differentiable net \<Longrightarrow> linear (frechet_derivative f net)" |
44123 | 255 |
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
|
256 |
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
|
257 |
|
53781 | 258 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
259 |
subsection {* Differentiability implies continuity *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
260 |
|
44123 | 261 |
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
|
262 |
"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
|
263 |
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
|
264 |
|
44123 | 265 |
lemma differentiable_imp_continuous_on: |
266 |
"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
|
267 |
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
|
268 |
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
|
269 |
|
44123 | 270 |
lemma differentiable_on_subset: |
271 |
"f differentiable_on t \<Longrightarrow> s \<subseteq> t \<Longrightarrow> f differentiable_on s" |
|
53781 | 272 |
unfolding differentiable_on_def |
273 |
using differentiable_within_subset |
|
274 |
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
|
275 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
276 |
lemma differentiable_on_empty: "f differentiable_on {}" |
53781 | 277 |
unfolding differentiable_on_def |
278 |
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
|
279 |
|
56151 | 280 |
text {* Results about neighborhoods filter. *} |
281 |
||
282 |
lemma eventually_nhds_metric_le: |
|
283 |
"eventually P (nhds a) = (\<exists>d>0. \<forall>x. dist x a \<le> d \<longrightarrow> P x)" |
|
284 |
unfolding eventually_nhds_metric by (safe, rule_tac x="d / 2" in exI, auto) |
|
285 |
||
286 |
lemma le_nhds: "F \<le> nhds a \<longleftrightarrow> (\<forall>S. open S \<and> a \<in> S \<longrightarrow> eventually (\<lambda>x. x \<in> S) F)" |
|
287 |
unfolding le_filter_def eventually_nhds by (fast elim: eventually_elim1) |
|
288 |
||
289 |
lemma le_nhds_metric: "F \<le> nhds a \<longleftrightarrow> (\<forall>e>0. eventually (\<lambda>x. dist x a < e) F)" |
|
290 |
unfolding le_filter_def eventually_nhds_metric by (fast elim: eventually_elim1) |
|
291 |
||
292 |
lemma le_nhds_metric_le: "F \<le> nhds a \<longleftrightarrow> (\<forall>e>0. eventually (\<lambda>x. dist x a \<le> e) F)" |
|
293 |
unfolding le_filter_def eventually_nhds_metric_le by (fast elim: eventually_elim1) |
|
294 |
||
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
295 |
text {* Several results are easier using a "multiplied-out" variant. |
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
296 |
(I got this idea from Dieudonne's proof of the chain rule). *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
297 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
298 |
lemma has_derivative_within_alt: |
53781 | 299 |
"(f has_derivative f') (at x within s) \<longleftrightarrow> bounded_linear f' \<and> |
300 |
(\<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 | 301 |
unfolding has_derivative_within filterlim_def le_nhds_metric_le eventually_filtermap |
59815
cce82e360c2f
explicit commutative additive inverse operation;
haftmann
parents:
59558
diff
changeset
|
302 |
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
|
303 |
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
|
304 |
|
56320 | 305 |
lemma has_derivative_within_alt2: |
306 |
"(f has_derivative f') (at x within s) \<longleftrightarrow> bounded_linear f' \<and> |
|
307 |
(\<forall>e>0. eventually (\<lambda>y. norm (f y - f x - f' (y - x)) \<le> e * norm (y - x)) (at x within s))" |
|
308 |
unfolding has_derivative_within filterlim_def le_nhds_metric_le eventually_filtermap |
|
59815
cce82e360c2f
explicit commutative additive inverse operation;
haftmann
parents:
59558
diff
changeset
|
309 |
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
|
310 |
by (force simp add: linear_0 bounded_linear.linear pos_divide_le_eq) |
56320 | 311 |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
312 |
lemma has_derivative_at_alt: |
53781 | 313 |
"(f has_derivative f') (at x) \<longleftrightarrow> |
314 |
bounded_linear f' \<and> |
|
315 |
(\<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))" |
|
316 |
using has_derivative_within_alt[where s=UNIV] |
|
317 |
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
|
318 |
|
53781 | 319 |
|
320 |
subsection {* The chain rule *} |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
321 |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
322 |
lemma diff_chain_within[derivative_intros]: |
44123 | 323 |
assumes "(f has_derivative f') (at x within s)" |
53781 | 324 |
and "(g has_derivative g') (at (f x) within (f ` s))" |
325 |
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
|
326 |
using has_derivative_in_compose[OF assms] |
53781 | 327 |
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
|
328 |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
329 |
lemma diff_chain_at[derivative_intros]: |
53781 | 330 |
"(f has_derivative f') (at x) \<Longrightarrow> |
331 |
(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
|
332 |
using has_derivative_compose[of f f' x UNIV g g'] |
53781 | 333 |
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
|
334 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
335 |
|
53781 | 336 |
subsection {* Composition rules stated just for differentiability *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
337 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
338 |
lemma differentiable_chain_at: |
53781 | 339 |
"f differentiable (at x) \<Longrightarrow> |
340 |
g differentiable (at (f x)) \<Longrightarrow> (g \<circ> f) differentiable (at x)" |
|
341 |
unfolding differentiable_def |
|
342 |
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
|
343 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
344 |
lemma differentiable_chain_within: |
53781 | 345 |
"f differentiable (at x within s) \<Longrightarrow> |
346 |
g differentiable (at(f x) within (f ` s)) \<Longrightarrow> (g \<circ> f) differentiable (at x within s)" |
|
347 |
unfolding differentiable_def |
|
348 |
by (meson diff_chain_within) |
|
349 |
||
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
350 |
|
37730 | 351 |
subsection {* Uniqueness of derivative *} |
352 |
||
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
353 |
|
37730 | 354 |
text {* |
355 |
The general result is a bit messy because we need approachability of the |
|
356 |
limit point from any direction. But OK for nontrivial intervals etc. |
|
357 |
*} |
|
51363
d4d00c804645
changed has_derivative_intros into a named theorems collection
hoelzl
parents:
50939
diff
changeset
|
358 |
|
44123 | 359 |
lemma frechet_derivative_unique_within: |
360 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" |
|
361 |
assumes "(f has_derivative f') (at x within s)" |
|
53781 | 362 |
and "(f has_derivative f'') (at x within s)" |
363 |
and "\<forall>i\<in>Basis. \<forall>e>0. \<exists>d. 0 < abs d \<and> abs d < e \<and> (x + d *\<^sub>R i) \<in> s" |
|
44123 | 364 |
shows "f' = f''" |
53781 | 365 |
proof - |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
366 |
note as = assms(1,2)[unfolded has_derivative_def] |
44123 | 367 |
then interpret f': bounded_linear f' by auto |
368 |
from as interpret f'': bounded_linear f'' by auto |
|
369 |
have "x islimpt s" unfolding islimpt_approachable |
|
53781 | 370 |
proof (rule, rule) |
371 |
fix e :: real |
|
372 |
assume "e > 0" |
|
55665 | 373 |
obtain d where "0 < \<bar>d\<bar>" and "\<bar>d\<bar> < e" and "x + d *\<^sub>R (SOME i. i \<in> Basis) \<in> s" |
374 |
using assms(3) SOME_Basis `e>0` by blast |
|
53781 | 375 |
then show "\<exists>x'\<in>s. x' \<noteq> x \<and> dist x' x < e" |
376 |
apply (rule_tac x="x + d *\<^sub>R (SOME i. i \<in> Basis)" in bexI) |
|
377 |
unfolding dist_norm |
|
378 |
apply (auto simp: SOME_Basis nonzero_Basis) |
|
379 |
done |
|
44123 | 380 |
qed |
53781 | 381 |
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
|
382 |
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
|
383 |
by (metis trivial_limit_within) |
53781 | 384 |
show ?thesis |
385 |
apply (rule linear_eq_stdbasis) |
|
44123 | 386 |
unfolding linear_conv_bounded_linear |
53781 | 387 |
apply (rule as(1,2)[THEN conjunct1])+ |
388 |
proof (rule, rule ccontr) |
|
389 |
fix i :: 'a |
|
390 |
assume i: "i \<in> Basis" |
|
391 |
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
|
392 |
assume "f' i \<noteq> f'' i" |
53781 | 393 |
then have "e > 0" |
394 |
unfolding e_def by auto |
|
55665 | 395 |
obtain d where d: |
396 |
"0 < d" |
|
397 |
"(\<And>xa. xa\<in>s \<longrightarrow> 0 < dist xa x \<and> dist xa x < d \<longrightarrow> |
|
398 |
dist ((f xa - f x - f' (xa - x)) /\<^sub>R norm (xa - x) - |
|
399 |
(f xa - f x - f'' (xa - x)) /\<^sub>R norm (xa - x)) (0 - 0) < e)" |
|
400 |
using tendsto_diff [OF as(1,2)[THEN conjunct2]] |
|
401 |
unfolding * Lim_within |
|
402 |
using `e>0` by blast |
|
403 |
obtain c where c: "0 < \<bar>c\<bar>" "\<bar>c\<bar> < d \<and> x + c *\<^sub>R i \<in> s" |
|
404 |
using assms(3) i d(1) by blast |
|
53781 | 405 |
have *: "norm (- ((1 / \<bar>c\<bar>) *\<^sub>R f' (c *\<^sub>R i)) + (1 / \<bar>c\<bar>) *\<^sub>R f'' (c *\<^sub>R i)) = |
406 |
norm ((1 / abs c) *\<^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
|
407 |
unfolding scaleR_right_distrib by auto |
53781 | 408 |
also have "\<dots> = norm ((1 / abs c) *\<^sub>R (c *\<^sub>R (- (f' i) + f'' i)))" |
44123 | 409 |
unfolding f'.scaleR f''.scaleR |
53781 | 410 |
unfolding scaleR_right_distrib scaleR_minus_right |
411 |
by auto |
|
412 |
also have "\<dots> = e" |
|
413 |
unfolding e_def |
|
55665 | 414 |
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
|
415 |
using norm_minus_cancel[of "f' i - f'' i"] |
54230
b1d955791529
more simplification rules on unary and binary minus
haftmann
parents:
53799
diff
changeset
|
416 |
by auto |
53781 | 417 |
finally show False |
418 |
using c |
|
55665 | 419 |
using d(2)[of "x + c *\<^sub>R i"] |
44123 | 420 |
unfolding dist_norm |
421 |
unfolding f'.scaleR f''.scaleR f'.add f''.add f'.diff f''.diff |
|
422 |
scaleR_scaleR scaleR_right_diff_distrib scaleR_right_distrib |
|
53781 | 423 |
using i |
424 |
by (auto simp: inverse_eq_divide) |
|
44123 | 425 |
qed |
426 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
427 |
|
37730 | 428 |
lemma frechet_derivative_unique_at: |
53781 | 429 |
"(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
|
430 |
by (rule has_derivative_unique) |
41829 | 431 |
|
44123 | 432 |
lemma frechet_derivative_unique_within_closed_interval: |
56188 | 433 |
fixes f::"'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" |
53781 | 434 |
assumes "\<forall>i\<in>Basis. a\<bullet>i < b\<bullet>i" |
56188 | 435 |
and "x \<in> cbox a b" |
436 |
and "(f has_derivative f' ) (at x within cbox a b)" |
|
437 |
and "(f has_derivative f'') (at x within cbox a b)" |
|
44123 | 438 |
shows "f' = f''" |
439 |
apply(rule frechet_derivative_unique_within) |
|
440 |
apply(rule assms(3,4))+ |
|
53781 | 441 |
proof (rule, rule, rule) |
442 |
fix e :: real |
|
443 |
fix i :: 'a |
|
444 |
assume "e > 0" and i: "i \<in> Basis" |
|
56188 | 445 |
then show "\<exists>d. 0 < \<bar>d\<bar> \<and> \<bar>d\<bar> < e \<and> x + d *\<^sub>R i \<in> cbox a b" |
53781 | 446 |
proof (cases "x\<bullet>i = a\<bullet>i") |
447 |
case True |
|
448 |
then show ?thesis |
|
449 |
apply (rule_tac x="(min (b\<bullet>i - a\<bullet>i) e) / 2" in exI) |
|
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
|
450 |
using assms(1)[THEN bspec[where x=i]] and `e>0` and assms(2) |
56188 | 451 |
unfolding mem_box |
53781 | 452 |
using i |
453 |
apply (auto simp add: field_simps inner_simps inner_Basis) |
|
454 |
done |
|
455 |
next |
|
56188 | 456 |
note * = assms(2)[unfolded mem_box, THEN bspec, OF i] |
53781 | 457 |
case False |
458 |
moreover have "a \<bullet> i < x \<bullet> i" |
|
459 |
using False * by auto |
|
44123 | 460 |
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
|
461 |
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 | 462 |
by auto |
53781 | 463 |
also have "\<dots> = a\<bullet>i + x\<bullet>i" |
464 |
by auto |
|
465 |
also have "\<dots> \<le> 2 * (x\<bullet>i)" |
|
466 |
using * by auto |
|
467 |
finally have "a \<bullet> i * 2 + min (x \<bullet> i - a \<bullet> i) e \<le> x \<bullet> i * 2" |
|
468 |
by auto |
|
44123 | 469 |
} |
53781 | 470 |
moreover have "min (x \<bullet> i - a \<bullet> i) e \<ge> 0" |
471 |
using * and `e>0` by auto |
|
472 |
then have "x \<bullet> i * 2 \<le> b \<bullet> i * 2 + min (x \<bullet> i - a \<bullet> i) e" |
|
473 |
using * by auto |
|
44123 | 474 |
ultimately show ?thesis |
53781 | 475 |
apply (rule_tac x="- (min (x\<bullet>i - a\<bullet>i) e) / 2" in exI) |
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
|
476 |
using assms(1)[THEN bspec, OF i] and `e>0` and assms(2) |
56188 | 477 |
unfolding mem_box |
53781 | 478 |
using i |
479 |
apply (auto simp add: field_simps inner_simps inner_Basis) |
|
480 |
done |
|
44123 | 481 |
qed |
482 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
483 |
|
44123 | 484 |
lemma frechet_derivative_unique_within_open_interval: |
56188 | 485 |
fixes f::"'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54230
diff
changeset
|
486 |
assumes "x \<in> box a b" |
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54230
diff
changeset
|
487 |
and "(f has_derivative f' ) (at x within box a b)" |
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54230
diff
changeset
|
488 |
and "(f has_derivative f'') (at x within box a b)" |
37650 | 489 |
shows "f' = f''" |
490 |
proof - |
|
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54230
diff
changeset
|
491 |
from assms(1) have *: "at x within box a b = at x" |
56188 | 492 |
by (metis at_within_interior interior_open open_box) |
37650 | 493 |
from assms(2,3) [unfolded *] show "f' = f''" |
494 |
by (rule frechet_derivative_unique_at) |
|
495 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
496 |
|
37730 | 497 |
lemma frechet_derivative_at: |
53781 | 498 |
"(f has_derivative f') (at x) \<Longrightarrow> f' = frechet_derivative f (at x)" |
499 |
apply (rule frechet_derivative_unique_at[of f]) |
|
500 |
apply assumption |
|
501 |
unfolding frechet_derivative_works[symmetric] |
|
502 |
using differentiable_def |
|
503 |
apply auto |
|
504 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
505 |
|
56188 | 506 |
lemma frechet_derivative_within_cbox: |
507 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" |
|
53781 | 508 |
assumes "\<forall>i\<in>Basis. a\<bullet>i < b\<bullet>i" |
56188 | 509 |
and "x \<in> cbox a b" |
510 |
and "(f has_derivative f') (at x within cbox a b)" |
|
511 |
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
|
512 |
using assms |
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
513 |
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
|
514 |
|
53781 | 515 |
|
516 |
subsection {* The traditional Rolle theorem in one dimension *} |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
517 |
|
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
518 |
lemma linear_componentwise: |
56196
32b7eafc5a52
remove unnecessary finiteness assumptions from lemmas about setsum
huffman
parents:
56193
diff
changeset
|
519 |
fixes f:: "'a::euclidean_space \<Rightarrow> 'b::real_inner" |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
520 |
assumes lf: "linear f" |
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
|
521 |
shows "(f x) \<bullet> j = (\<Sum>i\<in>Basis. (x\<bullet>i) * (f i\<bullet>j))" (is "?lhs = ?rhs") |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
522 |
proof - |
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
|
523 |
have "?rhs = (\<Sum>i\<in>Basis. (x\<bullet>i) *\<^sub>R (f i))\<bullet>j" |
899c9c4e4a4c
Remove the indexed basis from the definition of euclidean spaces and only use the set of Basis vectors
hoelzl
parents:
50418
diff
changeset
|
524 |
by (simp add: inner_setsum_left) |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
525 |
then show ?thesis |
56196
32b7eafc5a52
remove unnecessary finiteness assumptions from lemmas about setsum
huffman
parents:
56193
diff
changeset
|
526 |
unfolding linear_setsum_mul[OF lf, symmetric] |
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
|
527 |
unfolding euclidean_representation .. |
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
528 |
qed |
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
529 |
|
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
530 |
text {* Derivatives of local minima and maxima are zero. *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
531 |
|
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
532 |
lemma has_derivative_local_min: |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
533 |
fixes f :: "'a::real_normed_vector \<Rightarrow> real" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
534 |
assumes deriv: "(f has_derivative f') (at x)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
535 |
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
|
536 |
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
|
537 |
proof |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
538 |
fix h :: 'a |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
539 |
interpret f': bounded_linear f' |
56182
528fae0816ea
update syntax of has_*derivative to infix 50; fixed proofs
hoelzl
parents:
56181
diff
changeset
|
540 |
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
|
541 |
show "f' h = 0" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
542 |
proof (cases "h = 0") |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
543 |
assume "h \<noteq> 0" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
544 |
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
|
545 |
unfolding eventually_at by (force simp: dist_commute) |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
546 |
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
|
547 |
by (intro derivative_eq_intros) auto |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
548 |
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
|
549 |
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
|
550 |
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
|
551 |
unfolding has_field_derivative_def by (simp add: f'.scaleR mult_commute_abs) |
56541 | 552 |
moreover have "0 < d / norm h" using d1 and `h \<noteq> 0` by simp |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
553 |
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)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
554 |
using `h \<noteq> 0` by (auto simp add: d2 dist_norm pos_less_divide_eq) |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
555 |
ultimately show "f' h = 0" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
556 |
by (rule DERIV_local_min) |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
557 |
qed (simp add: f'.zero) |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
558 |
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
|
559 |
|
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
560 |
lemma has_derivative_local_max: |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
561 |
fixes f :: "'a::real_normed_vector \<Rightarrow> real" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
562 |
assumes "(f has_derivative f') (at x)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
563 |
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
|
564 |
shows "f' = (\<lambda>h. 0)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
565 |
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
|
566 |
using assms unfolding fun_eq_iff by simp |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
567 |
|
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
568 |
lemma differential_zero_maxmin: |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
569 |
fixes f::"'a::real_normed_vector \<Rightarrow> real" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
570 |
assumes "x \<in> s" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
571 |
and "open s" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
572 |
and deriv: "(f has_derivative f') (at x)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
573 |
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
|
574 |
shows "f' = (\<lambda>v. 0)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
575 |
using mono |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
576 |
proof |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
577 |
assume "\<forall>y\<in>s. f y \<le> f x" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
578 |
with `x \<in> s` and `open s` have "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
|
579 |
unfolding eventually_at_topological by auto |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
580 |
with deriv show ?thesis |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
581 |
by (rule has_derivative_local_max) |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
582 |
next |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
583 |
assume "\<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
|
584 |
with `x \<in> s` and `open s` have "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
|
585 |
unfolding eventually_at_topological by auto |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
586 |
with deriv show ?thesis |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
587 |
by (rule has_derivative_local_min) |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
588 |
qed |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
589 |
|
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
590 |
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
|
591 |
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
|
592 |
assumes k: "k \<in> Basis" |
53781 | 593 |
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
|
594 |
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
|
595 |
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
|
596 |
proof - |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
597 |
let ?f' = "frechet_derivative f (at x)" |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
598 |
have "x \<in> ball x e" using `0 < e` by simp |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
599 |
moreover have "open (ball x e)" by simp |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
600 |
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
|
601 |
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
|
602 |
by (rule bounded_linear.has_derivative) |
56133
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
603 |
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
|
604 |
using ball(2) by (rule differential_zero_maxmin) |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
605 |
then show ?thesis |
304e37faf1ac
generalization of differential_zero_maxmin to class real_normed_vector
huffman
parents:
56117
diff
changeset
|
606 |
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
|
607 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
608 |
|
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
|
609 |
lemma rolle: |
53781 | 610 |
fixes f :: "real \<Rightarrow> real" |
611 |
assumes "a < b" |
|
612 |
and "f a = f b" |
|
56188 | 613 |
and "continuous_on {a .. b} f" |
614 |
and "\<forall>x\<in>{a <..< b}. (f has_derivative f' x) (at x)" |
|
615 |
shows "\<exists>x\<in>{a <..< b}. f' x = (\<lambda>v. 0)" |
|
53781 | 616 |
proof - |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54230
diff
changeset
|
617 |
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 | 618 |
proof - |
619 |
have "(a + b) / 2 \<in> {a .. b}" |
|
620 |
using assms(1) by auto |
|
56188 | 621 |
then have *: "{a .. b} \<noteq> {}" |
53781 | 622 |
by auto |
55665 | 623 |
obtain d where d: |
56188 | 624 |
"d \<in>cbox a b" |
625 |
"\<forall>y\<in>cbox a b. f y \<le> f d" |
|
626 |
using continuous_attains_sup[OF compact_Icc * assms(3)] by auto |
|
55665 | 627 |
obtain c where c: |
56188 | 628 |
"c \<in> cbox a b" |
629 |
"\<forall>y\<in>cbox a b. f c \<le> f y" |
|
630 |
using continuous_attains_inf[OF compact_Icc * assms(3)] by auto |
|
44123 | 631 |
show ?thesis |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54230
diff
changeset
|
632 |
proof (cases "d \<in> box a b \<or> c \<in> box a b") |
53781 | 633 |
case True |
634 |
then show ?thesis |
|
56188 | 635 |
by (metis c(2) d(2) box_subset_cbox subset_iff) |
44123 | 636 |
next |
637 |
def e \<equiv> "(a + b) /2" |
|
53781 | 638 |
case False |
639 |
then have "f d = f c" |
|
56188 | 640 |
using d c assms(2) by auto |
53781 | 641 |
then have "\<And>x. x \<in> {a..b} \<Longrightarrow> f x = f d" |
642 |
using c d |
|
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
643 |
by force |
53781 | 644 |
then show ?thesis |
645 |
apply (rule_tac x=e in bexI) |
|
646 |
unfolding e_def |
|
647 |
using assms(1) |
|
56188 | 648 |
apply auto |
53781 | 649 |
done |
44123 | 650 |
qed |
651 |
qed |
|
56188 | 652 |
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)" |
653 |
by auto |
|
53781 | 654 |
then have "f' x = (\<lambda>v. 0)" |
54775
2d3df8633dad
prefer box over greaterThanLessThan on euclidean_space
immler
parents:
54230
diff
changeset
|
655 |
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
|
656 |
using assms |
53781 | 657 |
apply auto |
658 |
done |
|
659 |
then show ?thesis |
|
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
660 |
by (metis x(1)) |
44123 | 661 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
662 |
|
53781 | 663 |
|
664 |
subsection {* One-dimensional mean value theorem *} |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
665 |
|
53781 | 666 |
lemma mvt: |
667 |
fixes f :: "real \<Rightarrow> real" |
|
668 |
assumes "a < b" |
|
669 |
and "continuous_on {a..b} f" |
|
44123 | 670 |
assumes "\<forall>x\<in>{a<..<b}. (f has_derivative (f' x)) (at x)" |
53781 | 671 |
shows "\<exists>x\<in>{a<..<b}. f b - f a = (f' x) (b - a)" |
672 |
proof - |
|
56188 | 673 |
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
|
674 |
proof (intro rolle[OF assms(1), of "\<lambda>x. f x - (f b - f a) / (b - a) * x"] ballI) |
53781 | 675 |
fix x |
56188 | 676 |
assume x: "x \<in> {a <..< b}" |
53781 | 677 |
show "((\<lambda>x. f x - (f b - f a) / (b - a) * x) has_derivative |
678 |
(\<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
|
679 |
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
|
680 |
qed (insert assms(1,2), auto intro!: continuous_intros simp: field_simps) |
55665 | 681 |
then obtain x where |
56188 | 682 |
"x \<in> {a <..< b}" |
55665 | 683 |
"(\<lambda>xa. f' x xa - (f b - f a) / (b - a) * xa) = (\<lambda>v. 0)" .. |
53781 | 684 |
then show ?thesis |
59558
5d9f0ace9af0
got rid of linordered_field_class.sign_simps(41) !
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
685 |
by (metis (hide_lams) assms(1) diff_less_iff(1) eq_iff_diff_eq_0 |
5d9f0ace9af0
got rid of linordered_field_class.sign_simps(41) !
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
686 |
zero_less_mult_iff nonzero_mult_divide_cancel_right not_real_square_gt_zero |
56188 | 687 |
times_divide_eq_left) |
44123 | 688 |
qed |
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_simple: |
53781 | 691 |
fixes f :: "real \<Rightarrow> real" |
692 |
assumes "a < b" |
|
693 |
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
|
694 |
shows "\<exists>x\<in>{a<..<b}. f b - f a = f' x (b - a)" |
56264 | 695 |
proof (rule mvt) |
696 |
have "f differentiable_on {a..b}" |
|
697 |
using assms(2) unfolding differentiable_on_def differentiable_def by fast |
|
698 |
then show "continuous_on {a..b} f" |
|
699 |
by (rule differentiable_imp_continuous_on) |
|
700 |
show "\<forall>x\<in>{a<..<b}. (f has_derivative f' x) (at x)" |
|
701 |
proof |
|
702 |
fix x |
|
703 |
assume x: "x \<in> {a <..< b}" |
|
704 |
show "(f has_derivative f' x) (at x)" |
|
705 |
unfolding at_within_open[OF x open_greaterThanLessThan,symmetric] |
|
706 |
apply (rule has_derivative_within_subset) |
|
707 |
apply (rule assms(2)[rule_format]) |
|
708 |
using x |
|
709 |
apply auto |
|
710 |
done |
|
711 |
qed |
|
712 |
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
|
713 |
|
44123 | 714 |
lemma mvt_very_simple: |
53781 | 715 |
fixes f :: "real \<Rightarrow> real" |
716 |
assumes "a \<le> b" |
|
56188 | 717 |
and "\<forall>x\<in>{a .. b}. (f has_derivative f' x) (at x within {a .. b})" |
718 |
shows "\<exists>x\<in>{a .. b}. f b - f a = f' x (b - a)" |
|
44123 | 719 |
proof (cases "a = b") |
53781 | 720 |
interpret bounded_linear "f' b" |
721 |
using assms(2) assms(1) by auto |
|
722 |
case True |
|
723 |
then show ?thesis |
|
724 |
apply (rule_tac x=a in bexI) |
|
725 |
using assms(2)[THEN bspec[where x=a]] |
|
726 |
unfolding has_derivative_def |
|
727 |
unfolding True |
|
728 |
using zero |
|
729 |
apply auto |
|
730 |
done |
|
731 |
next |
|
732 |
case False |
|
733 |
then show ?thesis |
|
734 |
using mvt_simple[OF _ assms(2)] |
|
735 |
using assms(1) |
|
736 |
by auto |
|
44123 | 737 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
738 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
739 |
text {* A nice generalization (see Havin's proof of 5.19 from Rudin's book). *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
740 |
|
44123 | 741 |
lemma mvt_general: |
56223
7696903b9e61
generalize theory of operator norms to work with class real_normed_vector
huffman
parents:
56217
diff
changeset
|
742 |
fixes f :: "real \<Rightarrow> 'a::real_inner" |
53781 | 743 |
assumes "a < b" |
56188 | 744 |
and "continuous_on {a .. b} f" |
53781 | 745 |
and "\<forall>x\<in>{a<..<b}. (f has_derivative f'(x)) (at x)" |
746 |
shows "\<exists>x\<in>{a<..<b}. norm (f b - f a) \<le> norm (f' x (b - a))" |
|
747 |
proof - |
|
56264 | 748 |
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 | 749 |
apply (rule mvt) |
750 |
apply (rule assms(1)) |
|
56371
fb9ae0727548
extend continuous_intros; remove continuous_on_intros and isCont_intros
hoelzl
parents:
56370
diff
changeset
|
751 |
apply (intro continuous_intros assms(2)) |
53781 | 752 |
using assms(3) |
56264 | 753 |
apply (fast intro: has_derivative_inner_right) |
53781 | 754 |
done |
55665 | 755 |
then obtain x where x: |
756 |
"x \<in> {a<..<b}" |
|
56264 | 757 |
"(f b - f a) \<bullet> f b - (f b - f a) \<bullet> f a = (f b - f a) \<bullet> f' x (b - a)" .. |
53781 | 758 |
show ?thesis |
759 |
proof (cases "f a = f b") |
|
36844 | 760 |
case False |
53077 | 761 |
have "norm (f b - f a) * norm (f b - f a) = (norm (f b - f a))\<^sup>2" |
44123 | 762 |
by (simp add: power2_eq_square) |
53781 | 763 |
also have "\<dots> = (f b - f a) \<bullet> (f b - f a)" |
764 |
unfolding power2_norm_eq_inner .. |
|
44123 | 765 |
also have "\<dots> = (f b - f a) \<bullet> f' x (b - a)" |
56264 | 766 |
using x(2) by (simp only: inner_diff_right) |
44123 | 767 |
also have "\<dots> \<le> norm (f b - f a) * norm (f' x (b - a))" |
768 |
by (rule norm_cauchy_schwarz) |
|
53781 | 769 |
finally show ?thesis |
770 |
using False x(1) |
|
56217
dc429a5b13c4
Some rationalisation of basic lemmas
paulson <lp15@cam.ac.uk>
parents:
56196
diff
changeset
|
771 |
by (auto simp add: mult_left_cancel) |
44123 | 772 |
next |
53781 | 773 |
case True |
774 |
then show ?thesis |
|
775 |
using assms(1) |
|
776 |
apply (rule_tac x="(a + b) /2" in bexI) |
|
777 |
apply auto |
|
778 |
done |
|
44123 | 779 |
qed |
780 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
781 |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
782 |
|
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
783 |
subsection {* More general bound theorems *} |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
784 |
|
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
785 |
lemma differentiable_bound_general: |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
786 |
fixes f :: "real \<Rightarrow> 'a::real_normed_vector" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
787 |
assumes "a < b" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
788 |
and f_cont: "continuous_on {a .. b} f" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
789 |
and phi_cont: "continuous_on {a .. b} \<phi>" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
790 |
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
|
791 |
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
|
792 |
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
|
793 |
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
|
794 |
proof - |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
795 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
796 |
fix x assume x: "a < x" "x < b" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
797 |
have "0 \<le> norm (f' x)" by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
798 |
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
|
799 |
finally have "0 \<le> \<phi>' x" . |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
800 |
} note phi'_nonneg = this |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
801 |
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
|
802 |
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
|
803 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
804 |
fix e::real assume "e > 0" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
805 |
def e2 \<equiv> "e / 2" with `e > 0` have "e2 > 0" by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
806 |
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
|
807 |
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
|
808 |
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
|
809 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
810 |
fix x2 |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
811 |
assume a: "a \<le> x2" "x2 \<le> b" and le: "\<forall>x1\<in>{a..<x2}. ?le x1" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
812 |
have "?le x2" using `e > 0` |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
813 |
proof cases |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
814 |
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
|
815 |
have "at x2 within {a <..<x2}\<noteq> bot" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
816 |
using `a < x2` |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
817 |
by (auto simp: trivial_limit_within islimpt_in_closure) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
818 |
moreover |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
819 |
have "((\<lambda>x1. (\<phi> x1 - \<phi> a) + e * (x1 - a) + e) ---> (\<phi> x2 - \<phi> a) + e * (x2 - a) + e) (at x2 within {a <..<x2})" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
820 |
"((\<lambda>x1. norm (f x1 - f a)) ---> norm (f x2 - f a)) (at x2 within {a <..<x2})" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
821 |
using a |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
822 |
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
|
823 |
intro: tendsto_within_subset[where S="{a .. b}"]) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
824 |
moreover |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
825 |
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
|
826 |
by (auto simp: eventually_at_filter) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
827 |
hence "eventually ?le (at x2 within {a <..<x2})" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
828 |
unfolding eventually_at_filter |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
829 |
by eventually_elim (insert le, auto) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
830 |
ultimately |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
831 |
show ?thesis |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
832 |
by (rule tendsto_le) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
833 |
qed simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
834 |
} note le_cont = this |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
835 |
have "a \<in> A" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
836 |
using assms by (auto simp: A_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
837 |
hence [simp]: "A \<noteq> {}" by auto |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
838 |
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
|
839 |
by (simp add: A_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
840 |
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
|
841 |
def y \<equiv> "Sup A" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
842 |
have "y \<le> b" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
843 |
unfolding y_def |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
844 |
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
|
845 |
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
|
846 |
by (auto simp: A_def intro!: le_cont) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
847 |
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
|
848 |
by (auto simp: y_def less_cSup_iff leI) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
849 |
have "a \<le> y" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
850 |
by (metis `a \<in> A` `bdd_above A` cSup_upper y_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
851 |
have "y \<in> A" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
852 |
using y_all_le `a \<le> y` `y \<le> b` |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
853 |
by (auto simp: A_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
854 |
hence "A = {a .. y}" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
855 |
using A_subset |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
856 |
by (auto simp: subset_iff y_def cSup_upper intro: A_ivl) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
857 |
from le_cont[OF `a \<le> y` `y \<le> b` y_all_le] have le_y: "?le y" . |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
858 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
859 |
assume "a \<noteq> y" with `a \<le> y` have "a < y" by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
860 |
have "y = b" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
861 |
proof (rule ccontr) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
862 |
assume "y \<noteq> b" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
863 |
hence "y < b" using `y \<le> b` by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
864 |
let ?F = "at y within {y..<b}" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
865 |
from f' phi' |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
866 |
have "(f has_vector_derivative f' y) ?F" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
867 |
and "(\<phi> has_vector_derivative \<phi>' y) ?F" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
868 |
using `a < y` `y < b` |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
869 |
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
|
870 |
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
|
871 |
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
|
872 |
"\<forall>\<^sub>F x1 in ?F. norm (\<phi> x1 - \<phi> y - (x1 - y) *\<^sub>R \<phi>' y) \<le> e2 * \<bar>x1 - y\<bar>" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
873 |
using `e2 > 0` |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
874 |
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
|
875 |
moreover |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
876 |
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
|
877 |
by (auto simp: eventually_at_filter) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
878 |
ultimately |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
879 |
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
|
880 |
(is "\<forall>\<^sub>F x1 in ?F. ?le' x1") |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
881 |
proof eventually_elim |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
882 |
case elim |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
883 |
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
|
884 |
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
|
885 |
by (simp add: ac_simps) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
886 |
also have "norm (f' y) \<le> \<phi>' y" using bnd `a < y` `y < b` by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
887 |
also |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
888 |
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
|
889 |
by (simp add: ac_simps) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
890 |
finally |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
891 |
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
|
892 |
by (auto simp: mult_right_mono) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
893 |
thus ?case by (simp add: e2_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
894 |
qed |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
895 |
moreover have "?le' y" by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
896 |
ultimately obtain S |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
897 |
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
|
898 |
unfolding eventually_at_topological |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
899 |
by metis |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
900 |
from `open S` obtain d where d: "\<And>x. dist x y < d \<Longrightarrow> x \<in> S" "d > 0" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
901 |
by (force simp: dist_commute open_real_def ball_def |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
902 |
dest!: bspec[OF _ `y \<in> S`]) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
903 |
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
|
904 |
have "d' \<in> A" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
905 |
unfolding A_def |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
906 |
proof safe |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
907 |
show "a \<le> d'" using `a < y` `0 < d` `y < b` by (simp add: d'_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
908 |
show "d' \<le> b" using `y < b` by (simp add: d'_def min_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
909 |
fix x1 |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
910 |
assume x1: "x1 \<in> {a..<d'}" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
911 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
912 |
assume "x1 < y" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
913 |
hence "?le x1" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
914 |
using `x1 \<in> {a..<d'}` y_all_le by auto |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
915 |
} moreover { |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
916 |
assume "x1 \<ge> y" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
917 |
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
|
918 |
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
|
919 |
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
|
920 |
by (rule order_trans[OF _ norm_triangle_ineq]) simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
921 |
also note S(3)[OF x1'] |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
922 |
also note le_y |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
923 |
finally have "?le x1" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
924 |
using `x1 \<ge> y` by (auto simp: algebra_simps) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
925 |
} ultimately show "?le x1" by arith |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
926 |
qed |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
927 |
hence "d' \<le> y" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
928 |
unfolding y_def |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
929 |
by (rule cSup_upper) simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
930 |
thus False using `d > 0` `y < b` |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
931 |
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
|
932 |
qed |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
933 |
} moreover { |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
934 |
assume "a = y" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
935 |
with `a < b` have "y < b" by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
936 |
with `a = y` f_cont phi_cont `e2 > 0` |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
937 |
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
|
938 |
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
|
939 |
by (auto simp: continuous_on_def tendsto_iff) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
940 |
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
|
941 |
by (auto simp: eventually_at_filter) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
942 |
have 4: "eventually (\<lambda>x::real. x < b) (at y within {y..b})" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
943 |
using _ `y < b` |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
944 |
by (rule order_tendstoD) (auto intro!: tendsto_eq_intros) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
945 |
from 1 2 3 4 |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
946 |
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
|
947 |
proof eventually_elim |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
948 |
case (elim x1) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
949 |
have "norm (f x1 - f a) = norm (f x1 - f y)" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
950 |
by (simp add: `a = y`) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
951 |
also have "norm (f x1 - f y) \<le> e2" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
952 |
using elim `a = y` by (auto simp : dist_norm intro!: less_imp_le) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
953 |
also have "\<dots> \<le> e2 + (\<phi> x1 - \<phi> a + e2 + e * (x1 - a))" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
954 |
using `0 < e` elim |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
955 |
by (intro add_increasing2[OF add_nonneg_nonneg order.refl]) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
956 |
(auto simp: `a = y` dist_norm intro!: mult_nonneg_nonneg) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
957 |
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
|
958 |
by (simp add: e2_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
959 |
finally show "?le x1" . |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
960 |
qed |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
961 |
from this[unfolded eventually_at_topological] `?le y` |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
962 |
obtain S |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
963 |
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
|
964 |
by metis |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
965 |
from `open S` obtain d where d: "\<And>x. dist x y < d \<Longrightarrow> x \<in> S" "d > 0" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
966 |
by (force simp: dist_commute open_real_def ball_def |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
967 |
dest!: bspec[OF _ `y \<in> S`]) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
968 |
def d' \<equiv> "min b (y + (d/2))" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
969 |
have "d' \<in> A" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
970 |
unfolding A_def |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
971 |
proof safe |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
972 |
show "a \<le> d'" using `a = y` `0 < d` `y < b` by (simp add: d'_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
973 |
show "d' \<le> b" by (simp add: d'_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
974 |
fix x1 |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
975 |
assume "x1 \<in> {a..<d'}" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
976 |
hence "x1 \<in> S" "x1 \<in> {y..b}" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
977 |
by (auto simp: `a = y` d'_def dist_real_def intro!: d ) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
978 |
thus "?le x1" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
979 |
by (rule S) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
980 |
qed |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
981 |
hence "d' \<le> y" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
982 |
unfolding y_def |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
983 |
by (rule cSup_upper) simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
984 |
hence "y = b" using `d > 0` `y < b` |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
985 |
by (simp add: d'_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
986 |
} ultimately have "y = b" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
987 |
by auto |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
988 |
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
|
989 |
by (simp add: algebra_simps) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
990 |
} note * = this |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
991 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
992 |
fix e::real assume "e > 0" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
993 |
hence "norm (f b - f a) \<le> \<phi> b - \<phi> a + e" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
994 |
using *[of "e / (b - a + 1)"] `a < b` by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
995 |
} thus ?thesis |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
996 |
by (rule field_le_epsilon) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
997 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
998 |
|
44123 | 999 |
lemma differentiable_bound: |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1000 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
53781 | 1001 |
assumes "convex s" |
1002 |
and "\<forall>x\<in>s. (f has_derivative f' x) (at x within s)" |
|
1003 |
and "\<forall>x\<in>s. onorm (f' x) \<le> B" |
|
1004 |
and x: "x \<in> s" |
|
1005 |
and y: "y \<in> s" |
|
1006 |
shows "norm (f x - f y) \<le> B * norm (x - y)" |
|
1007 |
proof - |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1008 |
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
|
1009 |
let ?\<phi> = "\<lambda>h. h * B * norm (x - y)" |
53781 | 1010 |
have *: "\<And>u. u\<in>{0..1} \<Longrightarrow> x + u *\<^sub>R (y - x) \<in> s" |
44123 | 1011 |
using assms(1)[unfolded convex_alt,rule_format,OF x y] |
1012 |
unfolding scaleR_left_diff_distrib scaleR_right_diff_distrib |
|
1013 |
by (auto simp add: algebra_simps) |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1014 |
have 0: "continuous_on (?p ` {0..1}) f" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1015 |
using * |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1016 |
unfolding continuous_on_eq_continuous_within |
53781 | 1017 |
apply - |
1018 |
apply rule |
|
1019 |
apply (rule differentiable_imp_continuous_within) |
|
1020 |
unfolding differentiable_def |
|
1021 |
apply (rule_tac x="f' xa" in exI) |
|
1022 |
apply (rule has_derivative_within_subset) |
|
1023 |
apply (rule assms(2)[rule_format]) |
|
1024 |
apply auto |
|
1025 |
done |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1026 |
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
|
1027 |
by (intro continuous_intros 0)+ |
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 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_linear assms(2)[rule_format] *) |
56188 | 1033 |
have "(f \<circ> ?p has_derivative (f' ?u) \<circ> (\<lambda>u. 0 + u *\<^sub>R (y - x))) (at u within box 0 1)" |
53781 | 1034 |
apply (rule diff_chain_within) |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
1035 |
apply (rule derivative_intros)+ |
53781 | 1036 |
apply (rule has_derivative_within_subset) |
1037 |
apply (rule assms(2)[rule_format]) |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1038 |
using u * |
53781 | 1039 |
apply auto |
1040 |
done |
|
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1041 |
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
|
1042 |
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
|
1043 |
scaleR has_vector_derivative_def o_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1044 |
} note 2 = this |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1045 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1046 |
have "continuous_on {0..1} ?\<phi>" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1047 |
by (rule continuous_intros)+ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1048 |
} note 3 = this |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1049 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1050 |
fix u::real assume u: "u \<in>{0 <..< 1}" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1051 |
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
|
1052 |
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
|
1053 |
} note 4 = this |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1054 |
{ |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1055 |
fix u::real assume u: "u \<in>{0 <..< 1}" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1056 |
let ?u = "?p u" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1057 |
interpret bounded_linear "(f' ?u)" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1058 |
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
|
1059 |
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
|
1060 |
by (rule onorm) fact |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1061 |
also have "onorm (f' ?u) \<le> B" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1062 |
using u by (auto intro!: assms(3)[rule_format] *) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1063 |
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
|
1064 |
by (simp add: mult_right_mono norm_minus_commute) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1065 |
} 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
|
1066 |
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 | 1067 |
by (auto simp add: norm_minus_commute) |
60178
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1068 |
also |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1069 |
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
|
1070 |
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
|
1071 |
by simp |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1072 |
finally show ?thesis . |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1073 |
qed |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1074 |
|
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1075 |
lemma |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1076 |
differentiable_bound_segment: |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1077 |
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
|
1078 |
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
|
1079 |
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
|
1080 |
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
|
1081 |
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
|
1082 |
proof - |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1083 |
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
|
1084 |
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
|
1085 |
also have "convex \<dots>" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1086 |
by (intro convex_translation convex_scaled convex_real_interval) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1087 |
finally have "convex ?G" . |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1088 |
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
|
1089 |
ultimately show ?thesis |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1090 |
using has_derivative_subset[OF f' `?G \<subseteq> G`] B |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1091 |
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
|
1092 |
by (auto simp: ac_simps) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1093 |
qed |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1094 |
|
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1095 |
lemma differentiable_bound_linearization: |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1096 |
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
|
1097 |
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
|
1098 |
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
|
1099 |
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
|
1100 |
assumes "x0 \<in> S" |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1101 |
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
|
1102 |
proof - |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1103 |
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
|
1104 |
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
|
1105 |
unfolding g_def using assms |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1106 |
by (auto intro!: derivative_eq_intros |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1107 |
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
|
1108 |
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
|
1109 |
using assms by (auto simp: fun_diff_def) |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1110 |
from differentiable_bound_segment[OF assms(1) g B] `x0 \<in> S` |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1111 |
show ?thesis |
f620c70f9e9b
generalized differentiable_bound; some further variations of differentiable_bound
immler
parents:
60177
diff
changeset
|
1112 |
by (simp add: g_def field_simps linear_sub[OF has_derivative_linear[OF f']]) |
44123 | 1113 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1114 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
1115 |
text {* In particular. *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1116 |
|
44123 | 1117 |
lemma has_derivative_zero_constant: |
56227 | 1118 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_inner" |
53781 | 1119 |
assumes "convex s" |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1120 |
and "\<And>x. x \<in> s \<Longrightarrow> (f has_derivative (\<lambda>h. 0)) (at x within s)" |
44123 | 1121 |
shows "\<exists>c. \<forall>x\<in>s. f x = c" |
56332 | 1122 |
proof - |
1123 |
{ fix x y assume "x \<in> s" "y \<in> s" |
|
1124 |
then have "norm (f x - f y) \<le> 0 * norm (x - y)" |
|
1125 |
using assms by (intro differentiable_bound[of s]) (auto simp: onorm_zero) |
|
1126 |
then have "f x = f y" |
|
1127 |
by simp } |
|
53781 | 1128 |
then show ?thesis |
56332 | 1129 |
by metis |
53781 | 1130 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1131 |
|
53781 | 1132 |
lemma has_derivative_zero_unique: |
56227 | 1133 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_inner" |
53781 | 1134 |
assumes "convex s" |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1135 |
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
|
1136 |
and "x \<in> s" "y \<in> s" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1137 |
shows "f x = f y" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1138 |
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
|
1139 |
|
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1140 |
lemma has_derivative_zero_unique_connected: |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1141 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_inner" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1142 |
assumes "open s" "connected s" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1143 |
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
|
1144 |
assumes "x \<in> s" "y \<in> s" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1145 |
shows "f x = f y" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1146 |
proof (rule connected_local_const[where f=f, OF `connected s` `x\<in>s` `y\<in>s`]) |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1147 |
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
|
1148 |
proof |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1149 |
fix a assume "a \<in> s" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1150 |
with `open s` obtain e where "0 < e" "ball a e \<subseteq> s" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1151 |
by (rule openE) |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1152 |
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
|
1153 |
by (intro has_derivative_zero_constant) |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1154 |
(auto simp: at_within_open[OF _ open_ball] f convex_ball) |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1155 |
with `0<e` have "\<forall>x\<in>ball a e. f a = f x" |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1156 |
by auto |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1157 |
then show "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
|
1158 |
using `0<e` unfolding eventually_at_topological |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1159 |
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
|
1160 |
qed |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1161 |
qed |
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1162 |
|
53781 | 1163 |
subsection {* Differentiability of inverse function (most basic form) *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1164 |
|
44123 | 1165 |
lemma has_derivative_inverse_basic: |
56226 | 1166 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
44123 | 1167 |
assumes "(f has_derivative f') (at (g y))" |
53781 | 1168 |
and "bounded_linear g'" |
1169 |
and "g' \<circ> f' = id" |
|
1170 |
and "continuous (at y) g" |
|
1171 |
and "open t" |
|
1172 |
and "y \<in> t" |
|
1173 |
and "\<forall>z\<in>t. f (g z) = z" |
|
44123 | 1174 |
shows "(g has_derivative g') (at y)" |
53781 | 1175 |
proof - |
44123 | 1176 |
interpret f': bounded_linear f' |
1177 |
using assms unfolding has_derivative_def by auto |
|
53781 | 1178 |
interpret g': bounded_linear g' |
1179 |
using assms by auto |
|
55665 | 1180 |
obtain C where C: "0 < C" "\<And>x. norm (g' x) \<le> norm x * C" |
1181 |
using bounded_linear.pos_bounded[OF assms(2)] by blast |
|
53781 | 1182 |
have lem1: "\<forall>e>0. \<exists>d>0. \<forall>z. |
1183 |
norm (z - y) < d \<longrightarrow> norm (g z - g y - g'(z - y)) \<le> e * norm (g z - g y)" |
|
1184 |
proof (rule, rule) |
|
44123 | 1185 |
case goal1 |
56541 | 1186 |
have *: "e / C > 0" using `e > 0` C(1) by auto |
55665 | 1187 |
obtain d0 where d0: |
1188 |
"0 < d0" |
|
1189 |
"\<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)" |
|
1190 |
using assms(1) |
|
1191 |
unfolding has_derivative_at_alt |
|
1192 |
using * by blast |
|
1193 |
obtain d1 where d1: |
|
1194 |
"0 < d1" |
|
1195 |
"\<forall>x. 0 < dist x y \<and> dist x y < d1 \<longrightarrow> dist (g x) (g y) < d0" |
|
1196 |
using assms(4) |
|
1197 |
unfolding continuous_at Lim_at |
|
1198 |
using d0(1) by blast |
|
1199 |
obtain d2 where d2: |
|
1200 |
"0 < d2" |
|
1201 |
"\<forall>ya. dist ya y < d2 \<longrightarrow> ya \<in> t" |
|
1202 |
using assms(5) |
|
1203 |
unfolding open_dist |
|
1204 |
using assms(6) by blast |
|
1205 |
obtain d where d: "0 < d" "d < d1" "d < d2" |
|
1206 |
using real_lbound_gt_zero[OF d1(1) d2(1)] by blast |
|
53781 | 1207 |
then show ?case |
1208 |
apply (rule_tac x=d in exI) |
|
1209 |
apply rule |
|
1210 |
defer |
|
1211 |
apply rule |
|
1212 |
apply rule |
|
1213 |
proof - |
|
1214 |
fix z |
|
1215 |
assume as: "norm (z - y) < d" |
|
1216 |
then have "z \<in> t" |
|
44123 | 1217 |
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
|
1218 |
have "norm (g z - g y - g' (z - y)) \<le> norm (g' (f (g z) - y - f' (g z - g y)))" |
44123 | 1219 |
unfolding g'.diff f'.diff |
53781 | 1220 |
unfolding assms(3)[unfolded o_def id_def, THEN fun_cong] |
44123 | 1221 |
unfolding assms(7)[rule_format,OF `z\<in>t`] |
53781 | 1222 |
apply (subst norm_minus_cancel[symmetric]) |
1223 |
apply auto |
|
1224 |
done |
|
1225 |
also have "\<dots> \<le> norm (f (g z) - y - f' (g z - g y)) * C" |
|
55665 | 1226 |
by (rule C(2)) |
44123 | 1227 |
also have "\<dots> \<le> (e / C) * norm (g z - g y) * C" |
53781 | 1228 |
apply (rule mult_right_mono) |
55665 | 1229 |
apply (rule d0(2)[rule_format,unfolded assms(7)[rule_format,OF `y\<in>t`]]) |
53781 | 1230 |
apply (cases "z = y") |
1231 |
defer |
|
55665 | 1232 |
apply (rule d1(2)[unfolded dist_norm,rule_format]) |
53781 | 1233 |
using as d C d0 |
1234 |
apply auto |
|
1235 |
done |
|
44123 | 1236 |
also have "\<dots> \<le> e * norm (g z - g y)" |
1237 |
using C by (auto simp add: field_simps) |
|
1238 |
finally show "norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)" |
|
1239 |
by simp |
|
1240 |
qed auto |
|
1241 |
qed |
|
53781 | 1242 |
have *: "(0::real) < 1 / 2" |
1243 |
by auto |
|
55665 | 1244 |
obtain d where d: |
1245 |
"0 < d" |
|
1246 |
"\<forall>z. norm (z - y) < d \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> 1 / 2 * norm (g z - g y)" |
|
1247 |
using lem1 * by blast |
|
1248 |
def B \<equiv> "C * 2" |
|
53781 | 1249 |
have "B > 0" |
1250 |
unfolding B_def using C by auto |
|
1251 |
have lem2: "\<forall>z. norm(z - y) < d \<longrightarrow> norm (g z - g y) \<le> B * norm (z - y)" |
|
1252 |
proof (rule, rule) |
|
1253 |
case goal1 |
|
44123 | 1254 |
have "norm (g z - g y) \<le> norm(g' (z - y)) + norm ((g z - g y) - g'(z - y))" |
53781 | 1255 |
by (rule norm_triangle_sub) |
1256 |
also have "\<dots> \<le> norm (g' (z - y)) + 1 / 2 * norm (g z - g y)" |
|
1257 |
apply (rule add_left_mono) |
|
1258 |
using d and goal1 |
|
1259 |
apply auto |
|
1260 |
done |
|
44123 | 1261 |
also have "\<dots> \<le> norm (z - y) * C + 1 / 2 * norm (g z - g y)" |
53781 | 1262 |
apply (rule add_right_mono) |
1263 |
using C |
|
1264 |
apply auto |
|
1265 |
done |
|
1266 |
finally show ?case |
|
1267 |
unfolding B_def |
|
1268 |
by (auto simp add: field_simps) |
|
44123 | 1269 |
qed |
53781 | 1270 |
show ?thesis |
1271 |
unfolding has_derivative_at_alt |
|
1272 |
apply rule |
|
1273 |
apply (rule assms) |
|
1274 |
apply rule |
|
1275 |
apply rule |
|
1276 |
proof - |
|
1277 |
case goal1 |
|
56541 | 1278 |
hence *: "e / B >0" by (metis `0 < B` divide_pos_pos) |
55665 | 1279 |
obtain d' where d': |
1280 |
"0 < d'" |
|
1281 |
"\<forall>z. norm (z - y) < d' \<longrightarrow> norm (g z - g y - g' (z - y)) \<le> e / B * norm (g z - g y)" |
|
1282 |
using lem1 * by blast |
|
1283 |
obtain k where k: "0 < k" "k < d" "k < d'" |
|
1284 |
using real_lbound_gt_zero[OF d(1) d'(1)] by blast |
|
44123 | 1285 |
show ?case |
53781 | 1286 |
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
|
1287 |
apply auto |
53781 | 1288 |
proof - |
1289 |
fix z |
|
1290 |
assume as: "norm (z - y) < k" |
|
1291 |
then have "norm (g z - g y - g' (z - y)) \<le> e / B * norm(g z - g y)" |
|
44123 | 1292 |
using d' k by auto |
53781 | 1293 |
also have "\<dots> \<le> e * norm (z - y)" |
44123 | 1294 |
unfolding times_divide_eq_left pos_divide_le_eq[OF `B>0`] |
53781 | 1295 |
using lem2[THEN spec[where x=z]] |
1296 |
using k as using `e > 0` |
|
44123 | 1297 |
by (auto simp add: field_simps) |
1298 |
finally show "norm (g z - g y - g' (z - y)) \<le> e * norm (z - y)" |
|
53781 | 1299 |
by simp |
1300 |
qed(insert k, auto) |
|
44123 | 1301 |
qed |
1302 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1303 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
1304 |
text {* Simply rewrite that based on the domain point x. *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1305 |
|
44123 | 1306 |
lemma has_derivative_inverse_basic_x: |
56226 | 1307 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
53781 | 1308 |
assumes "(f has_derivative f') (at x)" |
1309 |
and "bounded_linear g'" |
|
1310 |
and "g' \<circ> f' = id" |
|
1311 |
and "continuous (at (f x)) g" |
|
1312 |
and "g (f x) = x" |
|
1313 |
and "open t" |
|
1314 |
and "f x \<in> t" |
|
1315 |
and "\<forall>y\<in>t. f (g y) = y" |
|
1316 |
shows "(g has_derivative g') (at (f x))" |
|
1317 |
apply (rule has_derivative_inverse_basic) |
|
1318 |
using assms |
|
1319 |
apply auto |
|
1320 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1321 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
1322 |
text {* This is the version in Dieudonne', assuming continuity of f and g. *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1323 |
|
44123 | 1324 |
lemma has_derivative_inverse_dieudonne: |
56226 | 1325 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
53781 | 1326 |
assumes "open s" |
1327 |
and "open (f ` s)" |
|
1328 |
and "continuous_on s f" |
|
1329 |
and "continuous_on (f ` s) g" |
|
1330 |
and "\<forall>x\<in>s. g (f x) = x" |
|
1331 |
and "x \<in> s" |
|
1332 |
and "(f has_derivative f') (at x)" |
|
1333 |
and "bounded_linear g'" |
|
1334 |
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
|
1335 |
shows "(g has_derivative g') (at (f x))" |
53781 | 1336 |
apply (rule has_derivative_inverse_basic_x[OF assms(7-9) _ _ assms(2)]) |
1337 |
using assms(3-6) |
|
1338 |
unfolding continuous_on_eq_continuous_at[OF assms(1)] continuous_on_eq_continuous_at[OF assms(2)] |
|
1339 |
apply auto |
|
1340 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1341 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
1342 |
text {* Here's the simplest way of not assuming much about g. *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1343 |
|
44123 | 1344 |
lemma has_derivative_inverse: |
56226 | 1345 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" |
53781 | 1346 |
assumes "compact s" |
1347 |
and "x \<in> s" |
|
1348 |
and "f x \<in> interior (f ` s)" |
|
1349 |
and "continuous_on s f" |
|
1350 |
and "\<forall>y\<in>s. g (f y) = y" |
|
1351 |
and "(f has_derivative f') (at x)" |
|
1352 |
and "bounded_linear g'" |
|
1353 |
and "g' \<circ> f' = id" |
|
44123 | 1354 |
shows "(g has_derivative g') (at (f x))" |
53781 | 1355 |
proof - |
1356 |
{ |
|
1357 |
fix y |
|
1358 |
assume "y \<in> interior (f ` s)" |
|
1359 |
then obtain x where "x \<in> s" and *: "y = f x" |
|
1360 |
unfolding image_iff |
|
1361 |
using interior_subset |
|
1362 |
by auto |
|
1363 |
have "f (g y) = y" |
|
1364 |
unfolding * and assms(5)[rule_format,OF `x\<in>s`] .. |
|
44123 | 1365 |
} note * = this |
1366 |
show ?thesis |
|
53781 | 1367 |
apply (rule has_derivative_inverse_basic_x[OF assms(6-8)]) |
1368 |
apply (rule continuous_on_interior[OF _ assms(3)]) |
|
1369 |
apply (rule continuous_on_inv[OF assms(4,1)]) |
|
1370 |
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
|
1371 |
apply (metis *) |
53781 | 1372 |
done |
44123 | 1373 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1374 |
|
53781 | 1375 |
|
1376 |
subsection {* Proving surjectivity via Brouwer fixpoint theorem *} |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1377 |
|
44123 | 1378 |
lemma brouwer_surjective: |
56117
2dbf84ee3deb
remove ordered_euclidean_space constraint from brouwer/derivative lemmas;
huffman
parents:
55970
diff
changeset
|
1379 |
fixes f :: "'n::euclidean_space \<Rightarrow> 'n" |
53781 | 1380 |
assumes "compact t" |
1381 |
and "convex t" |
|
1382 |
and "t \<noteq> {}" |
|
1383 |
and "continuous_on t f" |
|
1384 |
and "\<forall>x\<in>s. \<forall>y\<in>t. x + (y - f y) \<in> t" |
|
1385 |
and "x \<in> s" |
|
44123 | 1386 |
shows "\<exists>y\<in>t. f y = x" |
53781 | 1387 |
proof - |
1388 |
have *: "\<And>x y. f y = x \<longleftrightarrow> x + (y - f y) = y" |
|
1389 |
by (auto simp add: algebra_simps) |
|
44123 | 1390 |
show ?thesis |
1391 |
unfolding * |
|
53781 | 1392 |
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
|
1393 |
apply (rule continuous_intros assms)+ |
53781 | 1394 |
using assms(4-6) |
1395 |
apply auto |
|
1396 |
done |
|
44123 | 1397 |
qed |
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 brouwer_surjective_cball: |
56117
2dbf84ee3deb
remove ordered_euclidean_space constraint from brouwer/derivative lemmas;
huffman
parents:
55970
diff
changeset
|
1400 |
fixes f :: "'n::euclidean_space \<Rightarrow> 'n" |
53781 | 1401 |
assumes "e > 0" |
1402 |
and "continuous_on (cball a e) f" |
|
1403 |
and "\<forall>x\<in>s. \<forall>y\<in>cball a e. x + (y - f y) \<in> cball a e" |
|
1404 |
and "x \<in> s" |
|
44123 | 1405 |
shows "\<exists>y\<in>cball a e. f y = x" |
53781 | 1406 |
apply (rule brouwer_surjective) |
1407 |
apply (rule compact_cball convex_cball)+ |
|
1408 |
unfolding cball_eq_empty |
|
1409 |
using assms |
|
1410 |
apply auto |
|
1411 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1412 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1413 |
text {* See Sussmann: "Multidifferential calculus", Theorem 2.1.1 *} |
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1414 |
|
44123 | 1415 |
lemma sussmann_open_mapping: |
56227 | 1416 |
fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::euclidean_space" |
53781 | 1417 |
assumes "open s" |
1418 |
and "continuous_on s f" |
|
1419 |
and "x \<in> s" |
|
1420 |
and "(f has_derivative f') (at x)" |
|
1421 |
and "bounded_linear g'" "f' \<circ> g' = id" |
|
1422 |
and "t \<subseteq> s" |
|
1423 |
and "x \<in> interior t" |
|
44123 | 1424 |
shows "f x \<in> interior (f ` t)" |
53781 | 1425 |
proof - |
1426 |
interpret f': bounded_linear f' |
|
1427 |
using assms |
|
1428 |
unfolding has_derivative_def |
|
1429 |
by auto |
|
1430 |
interpret g': bounded_linear g' |
|
1431 |
using assms |
|
1432 |
by auto |
|
55665 | 1433 |
obtain B where B: "0 < B" "\<forall>x. norm (g' x) \<le> norm x * B" |
1434 |
using bounded_linear.pos_bounded[OF assms(5)] by blast |
|
56541 | 1435 |
hence *: "1 / (2 * B) > 0" by auto |
55665 | 1436 |
obtain e0 where e0: |
1437 |
"0 < e0" |
|
1438 |
"\<forall>y. norm (y - x) < e0 \<longrightarrow> norm (f y - f x - f' (y - x)) \<le> 1 / (2 * B) * norm (y - x)" |
|
1439 |
using assms(4) |
|
1440 |
unfolding has_derivative_at_alt |
|
1441 |
using * by blast |
|
1442 |
obtain e1 where e1: "0 < e1" "cball x e1 \<subseteq> t" |
|
1443 |
using assms(8) |
|
1444 |
unfolding mem_interior_cball |
|
1445 |
by blast |
|
56541 | 1446 |
have *: "0 < e0 / B" "0 < e1 / B" using e0 e1 B by auto |
55665 | 1447 |
obtain e where e: "0 < e" "e < e0 / B" "e < e1 / B" |
1448 |
using real_lbound_gt_zero[OF *] by blast |
|
53781 | 1449 |
have "\<forall>z\<in>cball (f x) (e / 2). \<exists>y\<in>cball (f x) e. f (x + g' (y - f x)) = z" |
1450 |
apply rule |
|
1451 |
apply (rule brouwer_surjective_cball[where s="cball (f x) (e/2)"]) |
|
1452 |
prefer 3 |
|
1453 |
apply rule |
|
1454 |
apply rule |
|
44123 | 1455 |
proof- |
1456 |
show "continuous_on (cball (f x) e) (\<lambda>y. f (x + g' (y - f x)))" |
|
1457 |
unfolding g'.diff |
|
53781 | 1458 |
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
|
1459 |
apply (rule continuous_intros linear_continuous_on[OF assms(5)])+ |
53781 | 1460 |
apply (rule continuous_on_subset[OF assms(2)]) |
1461 |
apply rule |
|
1462 |
apply (unfold image_iff) |
|
1463 |
apply (erule bexE) |
|
44123 | 1464 |
proof- |
53781 | 1465 |
fix y z |
1466 |
assume as: "y \<in>cball (f x) e" "z = x + (g' y - g' (f x))" |
|
44123 | 1467 |
have "dist x z = norm (g' (f x) - g' y)" |
1468 |
unfolding as(2) and dist_norm by auto |
|
1469 |
also have "\<dots> \<le> norm (f x - y) * B" |
|
53781 | 1470 |
unfolding g'.diff[symmetric] |
1471 |
using B |
|
1472 |
by auto |
|
44123 | 1473 |
also have "\<dots> \<le> e * B" |
53781 | 1474 |
using as(1)[unfolded mem_cball dist_norm] |
1475 |
using B |
|
1476 |
by auto |
|
1477 |
also have "\<dots> \<le> e1" |
|
1478 |
using e |
|
1479 |
unfolding less_divide_eq |
|
1480 |
using B |
|
1481 |
by auto |
|
1482 |
finally have "z \<in> cball x e1" |
|
1483 |
unfolding mem_cball |
|
1484 |
by force |
|
1485 |
then show "z \<in> s" |
|
1486 |
using e1 assms(7) by auto |
|
44123 | 1487 |
qed |
1488 |
next |
|
53781 | 1489 |
fix y z |
1490 |
assume as: "y \<in> cball (f x) (e / 2)" "z \<in> cball (f x) e" |
|
1491 |
have "norm (g' (z - f x)) \<le> norm (z - f x) * B" |
|
1492 |
using B by auto |
|
1493 |
also have "\<dots> \<le> e * B" |
|
1494 |
apply (rule mult_right_mono) |
|
44123 | 1495 |
using as(2)[unfolded mem_cball dist_norm] and B |
53781 | 1496 |
unfolding norm_minus_commute |
1497 |
apply auto |
|
1498 |
done |
|
1499 |
also have "\<dots> < e0" |
|
1500 |
using e and B |
|
1501 |
unfolding less_divide_eq |
|
1502 |
by auto |
|
1503 |
finally have *: "norm (x + g' (z - f x) - x) < e0" |
|
1504 |
by auto |
|
1505 |
have **: "f x + f' (x + g' (z - f x) - x) = z" |
|
1506 |
using assms(6)[unfolded o_def id_def,THEN cong] |
|
1507 |
by auto |
|
1508 |
have "norm (f x - (y + (z - f (x + g' (z - f x))))) \<le> |
|
1509 |
norm (f (x + g' (z - f x)) - z) + norm (f x - y)" |
|
44123 | 1510 |
using norm_triangle_ineq[of "f (x + g'(z - f x)) - z" "f x - y"] |
1511 |
by (auto simp add: algebra_simps) |
|
1512 |
also have "\<dots> \<le> 1 / (B * 2) * norm (g' (z - f x)) + norm (f x - y)" |
|
55665 | 1513 |
using e0(2)[rule_format, OF *] |
53781 | 1514 |
unfolding algebra_simps ** |
1515 |
by auto |
|
44123 | 1516 |
also have "\<dots> \<le> 1 / (B * 2) * norm (g' (z - f x)) + e/2" |
53781 | 1517 |
using as(1)[unfolded mem_cball dist_norm] |
1518 |
by auto |
|
44123 | 1519 |
also have "\<dots> \<le> 1 / (B * 2) * B * norm (z - f x) + e/2" |
53781 | 1520 |
using * and B |
1521 |
by (auto simp add: field_simps) |
|
1522 |
also have "\<dots> \<le> 1 / 2 * norm (z - f x) + e/2" |
|
1523 |
by auto |
|
1524 |
also have "\<dots> \<le> e/2 + e/2" |
|
1525 |
apply (rule add_right_mono) |
|
44123 | 1526 |
using as(2)[unfolded mem_cball dist_norm] |
53781 | 1527 |
unfolding norm_minus_commute |
1528 |
apply auto |
|
1529 |
done |
|
44123 | 1530 |
finally show "y + (z - f (x + g' (z - f x))) \<in> cball (f x) e" |
53781 | 1531 |
unfolding mem_cball dist_norm |
1532 |
by auto |
|
1533 |
qed (insert e, auto) note lem = this |
|
1534 |
show ?thesis |
|
1535 |
unfolding mem_interior |
|
1536 |
apply (rule_tac x="e/2" in exI) |
|
1537 |
apply rule |
|
1538 |
apply (rule divide_pos_pos) |
|
1539 |
prefer 3 |
|
44123 | 1540 |
proof |
53781 | 1541 |
fix y |
1542 |
assume "y \<in> ball (f x) (e / 2)" |
|
1543 |
then have *: "y \<in> cball (f x) (e / 2)" |
|
1544 |
by auto |
|
55665 | 1545 |
obtain z where z: "z \<in> cball (f x) e" "f (x + g' (z - f x)) = y" |
1546 |
using lem * by blast |
|
53781 | 1547 |
then have "norm (g' (z - f x)) \<le> norm (z - f x) * B" |
1548 |
using B |
|
1549 |
by (auto simp add: field_simps) |
|
44123 | 1550 |
also have "\<dots> \<le> e * B" |
53781 | 1551 |
apply (rule mult_right_mono) |
1552 |
using z(1) |
|
1553 |
unfolding mem_cball dist_norm norm_minus_commute |
|
1554 |
using B |
|
1555 |
apply auto |
|
1556 |
done |
|
1557 |
also have "\<dots> \<le> e1" |
|
1558 |
using e B unfolding less_divide_eq by auto |
|
1559 |
finally have "x + g'(z - f x) \<in> t" |
|
1560 |
apply - |
|
55665 | 1561 |
apply (rule e1(2)[unfolded subset_eq,rule_format]) |
53781 | 1562 |
unfolding mem_cball dist_norm |
1563 |
apply auto |
|
1564 |
done |
|
1565 |
then show "y \<in> f ` t" |
|
1566 |
using z by auto |
|
1567 |
qed (insert e, auto) |
|
44123 | 1568 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1569 |
|
53799 | 1570 |
text {* Hence the following eccentric variant of the inverse function theorem. |
1571 |
This has no continuity assumptions, but we do need the inverse function. |
|
1572 |
We could put @{text "f' \<circ> g = I"} but this happens to fit with the minimal linear |
|
1573 |
algebra theory I've set up so far. *} |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1574 |
|
37489
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
hoelzl
parents:
36844
diff
changeset
|
1575 |
(* 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
|
1576 |
|
53781 | 1577 |
lemma right_inverse_linear: |
1578 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'a" |
|
1579 |
assumes lf: "linear f" |
|
1580 |
and gf: "f \<circ> g = id" |
|
1581 |
shows "linear g" |
|
1582 |
proof - |
|
1583 |
from gf have fi: "surj f" |
|
1584 |
by (auto simp add: surj_def o_def id_def) metis |
|
1585 |
from linear_surjective_isomorphism[OF lf fi] |
|
1586 |
obtain h:: "'a \<Rightarrow> 'a" where h: "linear h" "\<forall>x. h (f x) = x" "\<forall>x. f (h x) = x" |
|
1587 |
by blast |
|
1588 |
have "h = g" |
|
1589 |
apply (rule ext) |
|
1590 |
using gf h(2,3) |
|
1591 |
apply (simp add: o_def id_def fun_eq_iff) |
|
1592 |
apply metis |
|
1593 |
done |
|
1594 |
with h(1) show ?thesis by blast |
|
1595 |
qed |
|
1596 |
||
44123 | 1597 |
lemma has_derivative_inverse_strong: |
56117
2dbf84ee3deb
remove ordered_euclidean_space constraint from brouwer/derivative lemmas;
huffman
parents:
55970
diff
changeset
|
1598 |
fixes f :: "'n::euclidean_space \<Rightarrow> 'n" |
53781 | 1599 |
assumes "open s" |
1600 |
and "x \<in> s" |
|
1601 |
and "continuous_on s f" |
|
1602 |
and "\<forall>x\<in>s. g (f x) = x" |
|
1603 |
and "(f has_derivative f') (at x)" |
|
1604 |
and "f' \<circ> g' = id" |
|
44123 | 1605 |
shows "(g has_derivative g') (at (f x))" |
53781 | 1606 |
proof - |
1607 |
have linf: "bounded_linear f'" |
|
44123 | 1608 |
using assms(5) unfolding has_derivative_def by auto |
53781 | 1609 |
then have ling: "bounded_linear g'" |
1610 |
unfolding linear_conv_bounded_linear[symmetric] |
|
1611 |
apply - |
|
1612 |
apply (rule right_inverse_linear) |
|
1613 |
using assms(6) |
|
1614 |
apply auto |
|
1615 |
done |
|
1616 |
moreover have "g' \<circ> f' = id" |
|
1617 |
using assms(6) linf ling |
|
1618 |
unfolding linear_conv_bounded_linear[symmetric] |
|
1619 |
using linear_inverse_left |
|
1620 |
by auto |
|
1621 |
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
|
1622 |
apply clarify |
53781 | 1623 |
apply (rule sussmann_open_mapping) |
1624 |
apply (rule assms ling)+ |
|
1625 |
apply auto |
|
1626 |
done |
|
1627 |
have "continuous (at (f x)) g" |
|
1628 |
unfolding continuous_at Lim_at |
|
1629 |
proof (rule, rule) |
|
1630 |
fix e :: real |
|
1631 |
assume "e > 0" |
|
1632 |
then have "f x \<in> interior (f ` (ball x e \<inter> s))" |
|
1633 |
using *[rule_format,of "ball x e \<inter> s"] `x \<in> s` |
|
1634 |
by (auto simp add: interior_open[OF open_ball] interior_open[OF assms(1)]) |
|
55665 | 1635 |
then obtain d where d: "0 < d" "ball (f x) d \<subseteq> f ` (ball x e \<inter> s)" |
1636 |
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
|
1637 |
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 | 1638 |
apply (rule_tac x=d in exI) |
1639 |
apply rule |
|
55665 | 1640 |
apply (rule d(1)) |
53781 | 1641 |
apply rule |
1642 |
apply rule |
|
1643 |
proof - |
|
1644 |
case goal1 |
|
1645 |
then have "g y \<in> g ` f ` (ball x e \<inter> s)" |
|
55665 | 1646 |
using d(2)[unfolded subset_eq,THEN bspec[where x=y]] |
53781 | 1647 |
by (auto simp add: dist_commute) |
1648 |
then have "g y \<in> ball x e \<inter> s" |
|
1649 |
using assms(4) by auto |
|
1650 |
then show "dist (g y) (g (f x)) < e" |
|
1651 |
using assms(4)[rule_format,OF `x \<in> s`] |
|
44123 | 1652 |
by (auto simp add: dist_commute) |
1653 |
qed |
|
1654 |
qed |
|
1655 |
moreover have "f x \<in> interior (f ` s)" |
|
53781 | 1656 |
apply (rule sussmann_open_mapping) |
1657 |
apply (rule assms ling)+ |
|
1658 |
using interior_open[OF assms(1)] and `x \<in> s` |
|
1659 |
apply auto |
|
1660 |
done |
|
44123 | 1661 |
moreover have "\<And>y. y \<in> interior (f ` s) \<Longrightarrow> f (g y) = y" |
53781 | 1662 |
proof - |
1663 |
case goal1 |
|
1664 |
then have "y \<in> f ` s" |
|
1665 |
using interior_subset by auto |
|
55665 | 1666 |
then obtain z where "z \<in> s" "y = f z" unfolding image_iff .. |
53781 | 1667 |
then show ?case |
1668 |
using assms(4) by auto |
|
44123 | 1669 |
qed |
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
1670 |
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
|
1671 |
by (metis has_derivative_inverse_basic_x open_interior) |
44123 | 1672 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1673 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
1674 |
text {* A rewrite based on the other domain. *} |
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_strong_x: |
56117
2dbf84ee3deb
remove ordered_euclidean_space constraint from brouwer/derivative lemmas;
huffman
parents:
55970
diff
changeset
|
1677 |
fixes f :: "'a::euclidean_space \<Rightarrow> 'a" |
53781 | 1678 |
assumes "open s" |
1679 |
and "g y \<in> s" |
|
1680 |
and "continuous_on s f" |
|
1681 |
and "\<forall>x\<in>s. g (f x) = x" |
|
1682 |
and "(f has_derivative f') (at (g y))" |
|
1683 |
and "f' \<circ> g' = id" |
|
1684 |
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
|
1685 |
shows "(g has_derivative g') (at y)" |
53781 | 1686 |
using has_derivative_inverse_strong[OF assms(1-6)] |
1687 |
unfolding assms(7) |
|
1688 |
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
|
1689 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
1690 |
text {* On a region. *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1691 |
|
44123 | 1692 |
lemma has_derivative_inverse_on: |
56117
2dbf84ee3deb
remove ordered_euclidean_space constraint from brouwer/derivative lemmas;
huffman
parents:
55970
diff
changeset
|
1693 |
fixes f :: "'n::euclidean_space \<Rightarrow> 'n" |
53781 | 1694 |
assumes "open s" |
1695 |
and "\<forall>x\<in>s. (f has_derivative f'(x)) (at x)" |
|
1696 |
and "\<forall>x\<in>s. g (f x) = x" |
|
1697 |
and "f' x \<circ> g' x = id" |
|
1698 |
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
|
1699 |
shows "(g has_derivative g'(x)) (at (f x))" |
53781 | 1700 |
apply (rule has_derivative_inverse_strong[where g'="g' x" and f=f]) |
1701 |
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
|
1702 |
unfolding continuous_on_eq_continuous_at[OF assms(1)] |
53781 | 1703 |
apply rule |
1704 |
apply (rule differentiable_imp_continuous_within) |
|
1705 |
unfolding differentiable_def |
|
1706 |
using assms |
|
1707 |
apply auto |
|
1708 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1709 |
|
44123 | 1710 |
text {* Invertible derivative continous at a point implies local |
1711 |
injectivity. It's only for this we need continuity of the derivative, |
|
1712 |
except of course if we want the fact that the inverse derivative is |
|
1713 |
also continuous. So if we know for some other reason that the inverse |
|
1714 |
function exists, it's OK. *} |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1715 |
|
53781 | 1716 |
lemma bounded_linear_sub: "bounded_linear f \<Longrightarrow> bounded_linear g \<Longrightarrow> bounded_linear (\<lambda>x. f x - g x)" |
44123 | 1717 |
using bounded_linear_add[of f "\<lambda>x. - g x"] bounded_linear_minus[of g] |
1718 |
by (auto simp add: algebra_simps) |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1719 |
|
44123 | 1720 |
lemma has_derivative_locally_injective: |
53781 | 1721 |
fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space" |
1722 |
assumes "a \<in> s" |
|
1723 |
and "open s" |
|
1724 |
and "bounded_linear g'" |
|
1725 |
and "g' \<circ> f' a = id" |
|
1726 |
and "\<forall>x\<in>s. (f has_derivative f' x) (at x)" |
|
1727 |
and "\<forall>e>0. \<exists>d>0. \<forall>x. dist a x < d \<longrightarrow> onorm (\<lambda>v. f' x v - f' a v) < e" |
|
1728 |
obtains t where "a \<in> t" "open t" "\<forall>x\<in>t. \<forall>x'\<in>t. f x' = f x \<longrightarrow> x' = x" |
|
1729 |
proof - |
|
1730 |
interpret bounded_linear g' |
|
1731 |
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
|
1732 |
note f'g' = assms(4)[unfolded id_def o_def,THEN cong] |
53781 | 1733 |
have "g' (f' a (\<Sum>Basis)) = (\<Sum>Basis)" "(\<Sum>Basis) \<noteq> (0::'n)" |
1734 |
defer |
|
1735 |
apply (subst euclidean_eq_iff) |
|
1736 |
using f'g' |
|
1737 |
apply auto |
|
1738 |
done |
|
1739 |
then have *: "0 < onorm g'" |
|
56223
7696903b9e61
generalize theory of operator norms to work with class real_normed_vector
huffman
parents:
56217
diff
changeset
|
1740 |
unfolding onorm_pos_lt[OF assms(3)] |
53781 | 1741 |
by fastforce |
1742 |
def k \<equiv> "1 / onorm g' / 2" |
|
1743 |
have *: "k > 0" |
|
1744 |
unfolding k_def using * by auto |
|
55665 | 1745 |
obtain d1 where d1: |
1746 |
"0 < d1" |
|
1747 |
"\<And>x. dist a x < d1 \<Longrightarrow> onorm (\<lambda>v. f' x v - f' a v) < k" |
|
1748 |
using assms(6) * by blast |
|
53781 | 1749 |
from `open s` obtain d2 where "d2 > 0" "ball a d2 \<subseteq> s" |
1750 |
using `a\<in>s` .. |
|
1751 |
obtain d2 where "d2 > 0" "ball a d2 \<subseteq> s" |
|
1752 |
using assms(2,1) .. |
|
55665 | 1753 |
obtain d2 where d2: "0 < d2" "ball a d2 \<subseteq> s" |
1754 |
using assms(2) |
|
1755 |
unfolding open_contains_ball |
|
1756 |
using `a\<in>s` by blast |
|
1757 |
obtain d where d: "0 < d" "d < d1" "d < d2" |
|
1758 |
using real_lbound_gt_zero[OF d1(1) d2(1)] by blast |
|
44123 | 1759 |
show ?thesis |
1760 |
proof |
|
53781 | 1761 |
show "a \<in> ball a d" |
1762 |
using d by auto |
|
44123 | 1763 |
show "\<forall>x\<in>ball a d. \<forall>x'\<in>ball a d. f x' = f x \<longrightarrow> x' = x" |
1764 |
proof (intro strip) |
|
53781 | 1765 |
fix x y |
1766 |
assume as: "x \<in> ball a d" "y \<in> ball a d" "f x = f y" |
|
1767 |
def ph \<equiv> "\<lambda>w. w - g' (f w - f x)" |
|
44123 | 1768 |
have ph':"ph = g' \<circ> (\<lambda>w. f' a w - (f w - f x))" |
53781 | 1769 |
unfolding ph_def o_def |
1770 |
unfolding diff |
|
1771 |
using f'g' |
|
44123 | 1772 |
by (auto simp add: algebra_simps) |
53781 | 1773 |
have "norm (ph x - ph y) \<le> (1 / 2) * norm (x - y)" |
1774 |
apply (rule differentiable_bound[OF convex_ball _ _ as(1-2), where f'="\<lambda>x v. v - g'(f' x v)"]) |
|
1775 |
apply (rule_tac[!] ballI) |
|
1776 |
proof - |
|
1777 |
fix u |
|
1778 |
assume u: "u \<in> ball a d" |
|
1779 |
then have "u \<in> s" |
|
1780 |
using d d2 by auto |
|
1781 |
have *: "(\<lambda>v. v - g' (f' u v)) = g' \<circ> (\<lambda>w. f' a w - f' u w)" |
|
1782 |
unfolding o_def and diff |
|
1783 |
using f'g' by auto |
|
41958 | 1784 |
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
|
1785 |
unfolding ph' * |
53781 | 1786 |
apply (simp add: comp_def) |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
1787 |
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
|
1788 |
apply (rule derivative_intros) |
53781 | 1789 |
defer |
1790 |
apply (rule has_derivative_sub[where g'="\<lambda>x.0",unfolded diff_0_right]) |
|
1791 |
apply (rule has_derivative_at_within) |
|
1792 |
using assms(5) and `u \<in> s` `a \<in> s` |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
1793 |
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
|
1794 |
done |
53781 | 1795 |
have **: "bounded_linear (\<lambda>x. f' u x - f' a x)" "bounded_linear (\<lambda>x. f' a x - f' u x)" |
1796 |
apply (rule_tac[!] bounded_linear_sub) |
|
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
1797 |
apply (rule_tac[!] has_derivative_bounded_linear) |
53781 | 1798 |
using assms(5) `u \<in> s` `a \<in> s` |
1799 |
apply auto |
|
1800 |
done |
|
44123 | 1801 |
have "onorm (\<lambda>v. v - g' (f' u v)) \<le> onorm g' * onorm (\<lambda>w. f' a w - f' u w)" |
53781 | 1802 |
unfolding * |
1803 |
apply (rule onorm_compose) |
|
1804 |
apply (rule assms(3) **)+ |
|
1805 |
done |
|
44123 | 1806 |
also have "\<dots> \<le> onorm g' * k" |
53781 | 1807 |
apply (rule mult_left_mono) |
55665 | 1808 |
using d1(2)[of u] |
56223
7696903b9e61
generalize theory of operator norms to work with class real_normed_vector
huffman
parents:
56217
diff
changeset
|
1809 |
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
|
1810 |
using d and u and onorm_pos_le[OF assms(3)] |
53781 | 1811 |
apply (auto simp add: algebra_simps) |
1812 |
done |
|
1813 |
also have "\<dots> \<le> 1 / 2" |
|
1814 |
unfolding k_def by auto |
|
1815 |
finally show "onorm (\<lambda>v. v - g' (f' u v)) \<le> 1 / 2" . |
|
44123 | 1816 |
qed |
1817 |
moreover have "norm (ph y - ph x) = norm (y - x)" |
|
53781 | 1818 |
apply (rule arg_cong[where f=norm]) |
1819 |
unfolding ph_def |
|
1820 |
using diff |
|
1821 |
unfolding as |
|
1822 |
apply auto |
|
1823 |
done |
|
1824 |
ultimately show "x = y" |
|
1825 |
unfolding norm_minus_commute by auto |
|
44123 | 1826 |
qed |
1827 |
qed auto |
|
1828 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1829 |
|
53781 | 1830 |
|
1831 |
subsection {* Uniformly convergent sequence of derivatives *} |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1832 |
|
44123 | 1833 |
lemma has_derivative_sequence_lipschitz_lemma: |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1834 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_vector \<Rightarrow> 'b::real_inner" |
44123 | 1835 |
assumes "convex s" |
53781 | 1836 |
and "\<forall>n. \<forall>x\<in>s. ((f n) has_derivative (f' n x)) (at x within s)" |
1837 |
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
|
1838 |
and "0 \<le> e" |
53781 | 1839 |
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)" |
1840 |
proof rule+ |
|
1841 |
fix m n x y |
|
1842 |
assume as: "N \<le> m" "N \<le> n" "x \<in> s" "y \<in> s" |
|
1843 |
show "norm ((f m x - f n x) - (f m y - f n y)) \<le> 2 * e * norm (x - y)" |
|
1844 |
apply (rule differentiable_bound[where f'="\<lambda>x h. f' m x h - f' n x h", OF assms(1) _ _ as(3-4)]) |
|
1845 |
apply (rule_tac[!] ballI) |
|
1846 |
proof - |
|
1847 |
fix x |
|
1848 |
assume "x \<in> s" |
|
44123 | 1849 |
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)" |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
1850 |
by (rule derivative_intros assms(2)[rule_format] `x\<in>s`)+ |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1851 |
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
|
1852 |
proof (rule onorm_bound) |
53781 | 1853 |
fix h |
44123 | 1854 |
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)" |
1855 |
using norm_triangle_ineq[of "f' m x h - g' x h" "- f' n x h + g' x h"] |
|
53781 | 1856 |
unfolding norm_minus_commute |
1857 |
by (auto simp add: algebra_simps) |
|
1858 |
also have "\<dots> \<le> e * norm h + e * norm h" |
|
1859 |
using assms(3)[rule_format,OF `N \<le> m` `x \<in> s`, of h] |
|
1860 |
using assms(3)[rule_format,OF `N \<le> n` `x \<in> s`, of h] |
|
1861 |
by (auto simp add: field_simps) |
|
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1862 |
finally show "norm (f' m x h - f' n x h) \<le> 2 * e * norm h" |
53781 | 1863 |
by auto |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1864 |
qed (simp add: `0 \<le> e`) |
44123 | 1865 |
qed |
1866 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1867 |
|
44123 | 1868 |
lemma has_derivative_sequence_lipschitz: |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1869 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_vector \<Rightarrow> 'b::real_inner" |
44123 | 1870 |
assumes "convex s" |
53781 | 1871 |
and "\<forall>n. \<forall>x\<in>s. ((f n) has_derivative (f' n x)) (at x within s)" |
1872 |
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" |
|
1873 |
shows "\<forall>e>0. \<exists>N. \<forall>m\<ge>N. \<forall>n\<ge>N. \<forall>x\<in>s. \<forall>y\<in>s. |
|
1874 |
norm ((f m x - f n x) - (f m y - f n y)) \<le> e * norm (x - y)" |
|
1875 |
proof (rule, rule) |
|
1876 |
case goal1 have *: "2 * (1/2* e) = e" "1/2 * e >0" |
|
1877 |
using `e > 0` by auto |
|
55665 | 1878 |
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" |
1879 |
using assms(3) *(2) by blast |
|
53781 | 1880 |
then show ?case |
1881 |
apply (rule_tac x=N in exI) |
|
1882 |
apply (rule has_derivative_sequence_lipschitz_lemma[where e="1/2 *e", unfolded *]) |
|
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1883 |
using assms `e > 0` |
53781 | 1884 |
apply auto |
1885 |
done |
|
44123 | 1886 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
1887 |
|
44123 | 1888 |
lemma has_derivative_sequence: |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
1889 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_vector \<Rightarrow> 'b::{real_inner, complete_space}" |
44123 | 1890 |
assumes "convex s" |
53781 | 1891 |
and "\<forall>n. \<forall>x\<in>s. ((f n) has_derivative (f' n x)) (at x within s)" |
1892 |
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" |
|
1893 |
and "x0 \<in> s" |
|
1894 |
and "((\<lambda>n. f n x0) ---> l) sequentially" |
|
1895 |
shows "\<exists>g. \<forall>x\<in>s. ((\<lambda>n. f n x) ---> g x) sequentially \<and> (g has_derivative g'(x)) (at x within s)" |
|
1896 |
proof - |
|
1897 |
have lem1: "\<forall>e>0. \<exists>N. \<forall>m\<ge>N. \<forall>n\<ge>N. \<forall>x\<in>s. \<forall>y\<in>s. |
|
1898 |
norm ((f m x - f n x) - (f m y - f n y)) \<le> e * norm (x - y)" |
|
56320 | 1899 |
using assms(1,2,3) by (rule has_derivative_sequence_lipschitz) |
44123 | 1900 |
have "\<exists>g. \<forall>x\<in>s. ((\<lambda>n. f n x) ---> g x) sequentially" |
53781 | 1901 |
apply (rule bchoice) |
1902 |
unfolding convergent_eq_cauchy |
|
44123 | 1903 |
proof |
53781 | 1904 |
fix x |
1905 |
assume "x \<in> s" |
|
1906 |
show "Cauchy (\<lambda>n. f n x)" |
|
1907 |
proof (cases "x = x0") |
|
1908 |
case True |
|
1909 |
then show ?thesis |
|
1910 |
using LIMSEQ_imp_Cauchy[OF assms(5)] by auto |
|
44123 | 1911 |
next |
53781 | 1912 |
case False |
1913 |
show ?thesis |
|
1914 |
unfolding Cauchy_def |
|
1915 |
proof (rule, rule) |
|
1916 |
fix e :: real |
|
1917 |
assume "e > 0" |
|
56541 | 1918 |
hence *: "e / 2 > 0" "e / 2 / norm (x - x0) > 0" using False by auto |
55665 | 1919 |
obtain M where M: "\<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x0) (f n x0) < e / 2" |
1920 |
using LIMSEQ_imp_Cauchy[OF assms(5)] |
|
1921 |
unfolding Cauchy_def |
|
1922 |
using *(1) by blast |
|
1923 |
obtain N where N: |
|
1924 |
"\<forall>m\<ge>N. \<forall>n\<ge>N. |
|
1925 |
\<forall>xa\<in>s. \<forall>y\<in>s. norm (f m xa - f n xa - (f m y - f n y)) \<le> |
|
1926 |
e / 2 / norm (x - x0) * norm (xa - y)" |
|
1927 |
using lem1 *(2) by blast |
|
44123 | 1928 |
show "\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e" |
53781 | 1929 |
apply (rule_tac x="max M N" in exI) |
1930 |
proof rule+ |
|
1931 |
fix m n |
|
1932 |
assume as: "max M N \<le>m" "max M N\<le>n" |
|
1933 |
have "dist (f m x) (f n x) \<le> |
|
1934 |
norm (f m x0 - f n x0) + norm (f m x - f n x - (f m x0 - f n x0))" |
|
1935 |
unfolding dist_norm |
|
1936 |
by (rule norm_triangle_sub) |
|
44123 | 1937 |
also have "\<dots> \<le> norm (f m x0 - f n x0) + e / 2" |
1938 |
using N[rule_format,OF _ _ `x\<in>s` `x0\<in>s`, of m n] and as and False |
|
1939 |
by auto |
|
1940 |
also have "\<dots> < e / 2 + e / 2" |
|
53781 | 1941 |
apply (rule add_strict_right_mono) |
1942 |
using as and M[rule_format] |
|
1943 |
unfolding dist_norm |
|
1944 |
apply auto |
|
1945 |
done |
|
1946 |
finally show "dist (f m x) (f n x) < e" |
|
1947 |
by auto |
|
44123 | 1948 |
qed |
1949 |
qed |
|
1950 |
qed |
|
1951 |
qed |
|
55665 | 1952 |
then obtain g where g: "\<forall>x\<in>s. (\<lambda>n. f n x) ----> g x" .. |
53781 | 1953 |
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)" |
1954 |
proof (rule, rule) |
|
1955 |
fix e :: real |
|
1956 |
assume *: "e > 0" |
|
55665 | 1957 |
obtain N where |
1958 |
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)" |
|
1959 |
using lem1 * by blast |
|
44123 | 1960 |
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 | 1961 |
apply (rule_tac x=N in exI) |
1962 |
proof rule+ |
|
1963 |
fix n x y |
|
1964 |
assume as: "N \<le> n" "x \<in> s" "y \<in> s" |
|
56320 | 1965 |
have "((\<lambda>m. norm (f n x - f n y - (f m x - f m y))) ---> norm (f n x - f n y - (g x - g y))) sequentially" |
1966 |
by (intro tendsto_intros g[rule_format] as) |
|
1967 |
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 | 1968 |
unfolding eventually_sequentially |
53781 | 1969 |
apply (rule_tac x=N in exI) |
1970 |
apply rule |
|
1971 |
apply rule |
|
1972 |
proof - |
|
1973 |
fix m |
|
1974 |
assume "N \<le> m" |
|
1975 |
then show "norm (f n x - f n y - (f m x - f m y)) \<le> e * norm (x - y)" |
|
44123 | 1976 |
using N[rule_format, of n m x y] and as |
1977 |
by (auto simp add: algebra_simps) |
|
1978 |
qed |
|
56320 | 1979 |
ultimately show "norm (f n x - f n y - (g x - g y)) \<le> e * norm (x - y)" |
1980 |
by (rule tendsto_ge_const[OF trivial_limit_sequentially]) |
|
44123 | 1981 |
qed |
1982 |
qed |
|
56320 | 1983 |
have "\<forall>x\<in>s. ((\<lambda>n. f n x) ---> g x) sequentially \<and> (g has_derivative g' x) (at x within s)" |
1984 |
unfolding has_derivative_within_alt2 |
|
1985 |
proof (intro ballI conjI) |
|
53781 | 1986 |
fix x |
1987 |
assume "x \<in> s" |
|
56320 | 1988 |
then show "((\<lambda>n. f n x) ---> g x) sequentially" |
1989 |
by (simp add: g) |
|
53781 | 1990 |
have lem3: "\<forall>u. ((\<lambda>n. f' n x u) ---> g' x u) sequentially" |
56320 | 1991 |
unfolding filterlim_def le_nhds_metric_le eventually_filtermap dist_norm |
1992 |
proof (intro allI impI) |
|
53781 | 1993 |
fix u |
1994 |
fix e :: real |
|
1995 |
assume "e > 0" |
|
56320 | 1996 |
show "eventually (\<lambda>n. norm (f' n x u - g' x u) \<le> e) sequentially" |
53781 | 1997 |
proof (cases "u = 0") |
1998 |
case True |
|
56320 | 1999 |
have "eventually (\<lambda>n. norm (f' n x u - g' x u) \<le> e * norm u) sequentially" |
2000 |
using assms(3)[folded eventually_sequentially] and `0 < e` and `x \<in> s` |
|
2001 |
by (fast elim: eventually_elim1) |
|
2002 |
then show ?thesis |
|
2003 |
using `u = 0` and `0 < e` by (auto elim: eventually_elim1) |
|
44123 | 2004 |
next |
53781 | 2005 |
case False |
56541 | 2006 |
with `0 < e` have "0 < e / norm u" by simp |
56320 | 2007 |
then have "eventually (\<lambda>n. norm (f' n x u - g' x u) \<le> e / norm u * norm u) sequentially" |
2008 |
using assms(3)[folded eventually_sequentially] and `x \<in> s` |
|
2009 |
by (fast elim: eventually_elim1) |
|
2010 |
then show ?thesis |
|
2011 |
using `u \<noteq> 0` by simp |
|
44123 | 2012 |
qed |
2013 |
qed |
|
2014 |
show "bounded_linear (g' x)" |
|
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2015 |
proof |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2016 |
fix x' y z :: 'a |
53781 | 2017 |
fix c :: real |
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
2018 |
note lin = assms(2)[rule_format,OF `x\<in>s`,THEN has_derivative_bounded_linear] |
44123 | 2019 |
show "g' x (c *\<^sub>R x') = c *\<^sub>R g' x x'" |
53781 | 2020 |
apply (rule tendsto_unique[OF trivial_limit_sequentially]) |
2021 |
apply (rule lem3[rule_format]) |
|
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
2022 |
unfolding lin[THEN bounded_linear.linear, THEN linear_cmul] |
53781 | 2023 |
apply (intro tendsto_intros) |
2024 |
apply (rule lem3[rule_format]) |
|
2025 |
done |
|
44123 | 2026 |
show "g' x (y + z) = g' x y + g' x z" |
53781 | 2027 |
apply (rule tendsto_unique[OF trivial_limit_sequentially]) |
2028 |
apply (rule lem3[rule_format]) |
|
56369
2704ca85be98
moved generic theorems from Complex_Analysis_Basic; fixed some theorem names
hoelzl
parents:
56332
diff
changeset
|
2029 |
unfolding lin[THEN bounded_linear.linear, THEN linear_add] |
53781 | 2030 |
apply (rule tendsto_add) |
2031 |
apply (rule lem3[rule_format])+ |
|
2032 |
done |
|
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2033 |
obtain N where N: "\<forall>h. norm (f' N x h - g' x h) \<le> 1 * norm h" |
57865 | 2034 |
using assms(3) `x \<in> s` by (fast intro: zero_less_one) |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2035 |
have "bounded_linear (f' N x)" |
57865 | 2036 |
using assms(2) `x \<in> s` by fast |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2037 |
from bounded_linear.bounded [OF this] |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2038 |
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
|
2039 |
{ |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2040 |
fix h |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2041 |
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
|
2042 |
by simp |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2043 |
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
|
2044 |
by (rule norm_triangle_ineq4) |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2045 |
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
|
2046 |
using N K by (fast intro: add_mono) |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2047 |
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
|
2048 |
by (simp add: ring_distribs) |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2049 |
} |
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2050 |
then show "\<exists>K. \<forall>h. norm (g' x h) \<le> norm h * K" by fast |
44123 | 2051 |
qed |
56320 | 2052 |
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 | 2053 |
proof (rule, rule) |
2054 |
case goal1 |
|
2055 |
have *: "e / 3 > 0" |
|
2056 |
using goal1 by auto |
|
55665 | 2057 |
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" |
2058 |
using assms(3) * by blast |
|
2059 |
obtain N2 where |
|
2060 |
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)" |
|
2061 |
using lem2 * by blast |
|
56320 | 2062 |
let ?N = "max N1 N2" |
2063 |
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)" |
|
2064 |
using assms(2)[unfolded has_derivative_within_alt2] and `x \<in> s` and * by fast |
|
2065 |
moreover have "eventually (\<lambda>y. y \<in> s) (at x within s)" |
|
2066 |
unfolding eventually_at by (fast intro: zero_less_one) |
|
2067 |
ultimately show ?case |
|
2068 |
proof (rule eventually_elim2) |
|
53781 | 2069 |
fix y |
56320 | 2070 |
assume "y \<in> s" |
2071 |
assume "norm (f ?N y - f ?N x - f' ?N x (y - x)) \<le> e / 3 * norm (y - x)" |
|
2072 |
moreover have "norm (g y - g x - (f ?N y - f ?N x)) \<le> e / 3 * norm (y - x)" |
|
2073 |
using N2[rule_format, OF _ `y \<in> s` `x \<in> s`] |
|
2074 |
by (simp add: norm_minus_commute) |
|
2075 |
ultimately have "norm (g y - g x - f' ?N x (y - x)) \<le> 2 * e / 3 * norm (y - x)" |
|
44123 | 2076 |
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 | 2077 |
by (auto simp add: algebra_simps) |
44123 | 2078 |
moreover |
2079 |
have " norm (f' ?N x (y - x) - g' x (y - x)) \<le> e / 3 * norm (y - x)" |
|
53781 | 2080 |
using N1 `x \<in> s` by auto |
41958 | 2081 |
ultimately show "norm (g y - g x - g' x (y - x)) \<le> e * norm (y - x)" |
44123 | 2082 |
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 | 2083 |
by (auto simp add: algebra_simps) |
44123 | 2084 |
qed |
2085 |
qed |
|
2086 |
qed |
|
56320 | 2087 |
then show ?thesis by fast |
44123 | 2088 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2089 |
|
44124
4c2a61a897d8
Derivative.thy: more sensible subsection headings
huffman
parents:
44123
diff
changeset
|
2090 |
text {* Can choose to line up antiderivatives if we want. *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2091 |
|
44123 | 2092 |
lemma has_antiderivative_sequence: |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2093 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_vector \<Rightarrow> 'b::{real_inner, complete_space}" |
44123 | 2094 |
assumes "convex s" |
53781 | 2095 |
and "\<forall>n. \<forall>x\<in>s. ((f n) has_derivative (f' n x)) (at x within s)" |
2096 |
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" |
|
2097 |
shows "\<exists>g. \<forall>x\<in>s. (g has_derivative g' x) (at x within s)" |
|
2098 |
proof (cases "s = {}") |
|
2099 |
case False |
|
2100 |
then obtain a where "a \<in> s" |
|
2101 |
by auto |
|
2102 |
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" |
|
2103 |
by auto |
|
44123 | 2104 |
show ?thesis |
53781 | 2105 |
apply (rule *) |
2106 |
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
|
2107 |
apply (metis assms(2) has_derivative_add_const) |
53781 | 2108 |
apply (rule `a \<in> s`) |
2109 |
apply auto |
|
2110 |
done |
|
44123 | 2111 |
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
|
2112 |
|
44123 | 2113 |
lemma has_antiderivative_limit: |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2114 |
fixes g' :: "'a::real_normed_vector \<Rightarrow> 'a \<Rightarrow> 'b::{real_inner, complete_space}" |
44123 | 2115 |
assumes "convex s" |
53781 | 2116 |
and "\<forall>e>0. \<exists>f f'. \<forall>x\<in>s. |
2117 |
(f has_derivative (f' x)) (at x within s) \<and> (\<forall>h. norm (f' x h - g' x h) \<le> e * norm h)" |
|
2118 |
shows "\<exists>g. \<forall>x\<in>s. (g has_derivative g' x) (at x within s)" |
|
2119 |
proof - |
|
2120 |
have *: "\<forall>n. \<exists>f f'. \<forall>x\<in>s. |
|
2121 |
(f has_derivative (f' x)) (at x within s) \<and> |
|
2122 |
(\<forall>h. norm(f' x h - g' x h) \<le> inverse (real (Suc n)) * norm h)" |
|
55970
6d123f0ae358
Some new proofs. Tidying up, esp to remove "apply rule".
paulson <lp15@cam.ac.uk>
parents:
55665
diff
changeset
|
2123 |
by (metis assms(2) inverse_positive_iff_positive real_of_nat_Suc_gt_zero) |
55665 | 2124 |
obtain f where |
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
2125 |
*: "\<forall>x. \<exists>f'. \<forall>xa\<in>s. (f x has_derivative f' xa) (at xa within s) \<and> |
55665 | 2126 |
(\<forall>h. norm (f' xa h - g' xa h) \<le> inverse (real (Suc x)) * norm h)" |
2127 |
using *[THEN choice] .. |
|
2128 |
obtain f' where |
|
56181
2aa0b19e74f3
unify syntax for has_derivative and differentiable
hoelzl
parents:
56151
diff
changeset
|
2129 |
f: "\<forall>x. \<forall>xa\<in>s. (f x has_derivative f' x xa) (at xa within s) \<and> |
55665 | 2130 |
(\<forall>h. norm (f' x xa h - g' xa h) \<le> inverse (real (Suc x)) * norm h)" |
2131 |
using *[THEN choice] .. |
|
53781 | 2132 |
show ?thesis |
2133 |
apply (rule has_antiderivative_sequence[OF assms(1), of f f']) |
|
2134 |
defer |
|
2135 |
apply rule |
|
2136 |
apply rule |
|
2137 |
proof - |
|
2138 |
fix e :: real |
|
2139 |
assume "e > 0" |
|
55665 | 2140 |
obtain N where N: "inverse (real (Suc N)) < e" |
2141 |
using reals_Archimedean[OF `e>0`] .. |
|
44123 | 2142 |
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 | 2143 |
apply (rule_tac x=N in exI) |
2144 |
proof rule+ |
|
44123 | 2145 |
case goal1 |
53781 | 2146 |
have *: "inverse (real (Suc n)) \<le> e" |
2147 |
apply (rule order_trans[OF _ N[THEN less_imp_le]]) |
|
2148 |
using goal1(1) |
|
2149 |
apply (auto simp add: field_simps) |
|
2150 |
done |
|
44123 | 2151 |
show ?case |
53781 | 2152 |
using f[rule_format,THEN conjunct2,OF goal1(2), of n, THEN spec[where x=h]] |
2153 |
apply (rule order_trans) |
|
2154 |
using N * |
|
2155 |
apply (cases "h = 0") |
|
2156 |
apply auto |
|
2157 |
done |
|
44123 | 2158 |
qed |
53781 | 2159 |
qed (insert f, auto) |
44123 | 2160 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2161 |
|
53781 | 2162 |
|
2163 |
subsection {* Differentiation of a series *} |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2164 |
|
44123 | 2165 |
lemma has_derivative_series: |
56271
61b1e3d88e91
generalized theorems about derivatives of limits of sequences of funtions
huffman
parents:
56264
diff
changeset
|
2166 |
fixes f :: "nat \<Rightarrow> 'a::real_normed_vector \<Rightarrow> 'b::{real_inner, complete_space}" |
44123 | 2167 |
assumes "convex s" |
56183 | 2168 |
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
|
2169 |
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 | 2170 |
and "x \<in> s" |
56183 | 2171 |
and "(\<lambda>n. f n x) sums l" |
2172 |
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)" |
|
2173 |
unfolding sums_def |
|
53781 | 2174 |
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
|
2175 |
apply (metis assms(2) has_derivative_setsum) |
53781 | 2176 |
using assms(4-5) |
56183 | 2177 |
unfolding sums_def |
53781 | 2178 |
apply auto |
2179 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2180 |
|
53781 | 2181 |
text {* Considering derivative @{typ "real \<Rightarrow> 'b\<Colon>real_normed_vector"} as a vector. *} |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2182 |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2183 |
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
|
2184 |
|
37730 | 2185 |
lemma vector_derivative_unique_at: |
2186 |
assumes "(f has_vector_derivative f') (at x)" |
|
53781 | 2187 |
and "(f has_vector_derivative f'') (at x)" |
37730 | 2188 |
shows "f' = f''" |
53781 | 2189 |
proof - |
37730 | 2190 |
have "(\<lambda>x. x *\<^sub>R f') = (\<lambda>x. x *\<^sub>R f'')" |
2191 |
using assms [unfolded has_vector_derivative_def] |
|
2192 |
by (rule frechet_derivative_unique_at) |
|
53781 | 2193 |
then show ?thesis |
2194 |
unfolding fun_eq_iff by auto |
|
37730 | 2195 |
qed |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2196 |
|
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2197 |
lemma vector_derivative_works: |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2198 |
"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
|
2199 |
(is "?l = ?r") |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2200 |
proof |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2201 |
assume ?l |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2202 |
obtain f' where f': "(f has_derivative f') net" |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2203 |
using `?l` unfolding differentiable_def .. |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2204 |
then interpret bounded_linear f' |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2205 |
by auto |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2206 |
show ?r |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2207 |
unfolding vector_derivative_def has_vector_derivative_def |
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2208 |
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
|
2209 |
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
|
2210 |
|
44123 | 2211 |
lemma vector_derivative_unique_within_closed_interval: |
53781 | 2212 |
assumes "a < b" |
56188 | 2213 |
and "x \<in> cbox a b" |
2214 |
assumes "(f has_vector_derivative f') (at x within cbox a b)" |
|
2215 |
assumes "(f has_vector_derivative f'') (at x within cbox a b)" |
|
44123 | 2216 |
shows "f' = f''" |
53781 | 2217 |
proof - |
2218 |
have *: "(\<lambda>x. x *\<^sub>R f') = (\<lambda>x. x *\<^sub>R f'')" |
|
2219 |
apply (rule frechet_derivative_unique_within_closed_interval[of "a" "b"]) |
|
2220 |
using assms(3-)[unfolded has_vector_derivative_def] |
|
2221 |
using assms(1-2) |
|
2222 |
apply auto |
|
2223 |
done |
|
44123 | 2224 |
show ?thesis |
53781 | 2225 |
proof (rule ccontr) |
53374
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53077
diff
changeset
|
2226 |
assume **: "f' \<noteq> f''" |
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53077
diff
changeset
|
2227 |
with * have "(\<lambda>x. x *\<^sub>R f') 1 = (\<lambda>x. x *\<^sub>R f'') 1" |
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53077
diff
changeset
|
2228 |
by (auto simp: fun_eq_iff) |
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53077
diff
changeset
|
2229 |
with ** show False |
a14d2a854c02
tuned proofs -- clarified flow of facts wrt. calculation;
wenzelm
parents:
53077
diff
changeset
|
2230 |
unfolding o_def by auto |
44123 | 2231 |
qed |
2232 |
qed |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2233 |
|
37730 | 2234 |
lemma vector_derivative_at: |
53781 | 2235 |
"(f has_vector_derivative f') (at x) \<Longrightarrow> vector_derivative f (at x) = f'" |
2236 |
apply (rule vector_derivative_unique_at) |
|
2237 |
defer |
|
2238 |
apply assumption |
|
2239 |
unfolding vector_derivative_works[symmetric] differentiable_def |
|
2240 |
unfolding has_vector_derivative_def |
|
2241 |
apply auto |
|
2242 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2243 |
|
44123 | 2244 |
lemma vector_derivative_within_closed_interval: |
53781 | 2245 |
assumes "a < b" |
56188 | 2246 |
and "x \<in> cbox a b" |
2247 |
assumes "(f has_vector_derivative f') (at x within cbox a b)" |
|
2248 |
shows "vector_derivative f (at x within cbox a b) = f'" |
|
53781 | 2249 |
apply (rule vector_derivative_unique_within_closed_interval) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2250 |
using vector_derivative_works[unfolded differentiable_def] |
53781 | 2251 |
using assms |
2252 |
apply (auto simp add:has_vector_derivative_def) |
|
2253 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2254 |
|
53781 | 2255 |
lemma has_vector_derivative_within_subset: |
56381
0556204bc230
merged DERIV_intros, has_derivative_intros into derivative_intros
hoelzl
parents:
56371
diff
changeset
|
2256 |
"(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
|
2257 |
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
|
2258 |
|
44123 | 2259 |
lemma has_vector_derivative_at_within: |
2260 |
"(f has_vector_derivative f') (at x) \<Longrightarrow> (f has_vector_derivative f') (at x within s)" |
|
2261 |
unfolding has_vector_derivative_def |
|
45031 | 2262 |
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
|
2263 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2264 |
lemma has_vector_derivative_transform_within: |
53781 | 2265 |
assumes "0 < d" |
2266 |
and "x \<in> s" |
|
2267 |
and "\<forall>x'\<in>s. dist x' x < d \<longrightarrow> f x' = g x'" |
|
44123 | 2268 |
assumes "(f has_vector_derivative f') (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
|
2269 |
shows "(g has_vector_derivative f') (at x within s)" |
53781 | 2270 |
using assms |
2271 |
unfolding has_vector_derivative_def |
|
44123 | 2272 |
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
|
2273 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2274 |
lemma has_vector_derivative_transform_at: |
53781 | 2275 |
assumes "0 < d" |
2276 |
and "\<forall>x'. dist x' x < d \<longrightarrow> f x' = g x'" |
|
2277 |
and "(f has_vector_derivative f') (at x)" |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2278 |
shows "(g has_vector_derivative f') (at x)" |
53781 | 2279 |
using assms |
2280 |
unfolding has_vector_derivative_def |
|
44123 | 2281 |
by (rule has_derivative_transform_at) |
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2282 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2283 |
lemma has_vector_derivative_transform_within_open: |
53781 | 2284 |
assumes "open s" |
2285 |
and "x \<in> s" |
|
2286 |
and "\<forall>y\<in>s. f y = g y" |
|
2287 |
and "(f has_vector_derivative f') (at x)" |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2288 |
shows "(g has_vector_derivative f') (at x)" |
53781 | 2289 |
using assms |
2290 |
unfolding has_vector_derivative_def |
|
44123 | 2291 |
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
|
2292 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2293 |
lemma vector_diff_chain_at: |
44123 | 2294 |
assumes "(f has_vector_derivative f') (at x)" |
53781 | 2295 |
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
|
2296 |
shows "((g \<circ> f) has_vector_derivative (f' *\<^sub>R g')) (at x)" |
53781 | 2297 |
using assms(2) |
2298 |
unfolding has_vector_derivative_def |
|
2299 |
apply - |
|
2300 |
apply (drule diff_chain_at[OF assms(1)[unfolded has_vector_derivative_def]]) |
|
2301 |
apply (simp only: o_def real_scaleR_def scaleR_scaleR) |
|
2302 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2303 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2304 |
lemma vector_diff_chain_within: |
44123 | 2305 |
assumes "(f has_vector_derivative f') (at x within s)" |
53781 | 2306 |
and "(g has_vector_derivative g') (at (f x) within f ` s)" |
2307 |
shows "((g \<circ> f) has_vector_derivative (f' *\<^sub>R g')) (at x within s)" |
|
2308 |
using assms(2) |
|
2309 |
unfolding has_vector_derivative_def |
|
2310 |
apply - |
|
2311 |
apply (drule diff_chain_within[OF assms(1)[unfolded has_vector_derivative_def]]) |
|
2312 |
apply (simp only: o_def real_scaleR_def scaleR_scaleR) |
|
2313 |
done |
|
33741
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2314 |
|
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
hoelzl
parents:
diff
changeset
|
2315 |
end |