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