| author | huffman | 
| Wed, 24 Aug 2011 11:56:57 -0700 | |
| changeset 44514 | d02b01e5ab8f | 
| parent 44457 | d366fa5551ef | 
| child 44531 | 1d477a2b1572 | 
| permissions | -rw-r--r-- | 
| 36350 | 1 | (* Title: HOL/Multivariate_Analysis/Derivative.thy | 
| 2 | Author: John Harrison | |
| 3 | Translation from HOL Light: Robert Himmelmann, TU Muenchen | |
| 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 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 6 | header {* Multivariate calculus in Euclidean space. *}
 | 
| 
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: 
36844diff
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 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 12 | (* Because I do not want to type this all the time *) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 13 | lemmas linear_linear = linear_conv_bounded_linear[THEN sym] | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 14 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 15 | subsection {* Derivatives *}
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 16 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 17 | text {* The definition is slightly tricky since we make it work over
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 18 | nets of a particular form. This lets us prove theorems generally and use | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 19 | "at a" or "at a within s" for restriction to a set (1-sided on R etc.) *} | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 20 | |
| 44081 
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
 huffman parents: 
43338diff
changeset | 21 | definition has_derivative :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> ('a \<Rightarrow> 'b) \<Rightarrow> ('a filter \<Rightarrow> bool)"
 | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 22 | (infixl "(has'_derivative)" 12) where | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 23 | "(f has_derivative f') net \<equiv> bounded_linear f' \<and> ((\<lambda>y. (1 / (norm (y - netlimit net))) *\<^sub>R | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 24 | (f y - (f (netlimit net) + f'(y - netlimit net)))) ---> 0) net" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 25 | |
| 44137 | 26 | lemma derivative_linear[dest]: | 
| 27 | "(f has_derivative f') net \<Longrightarrow> bounded_linear f'" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 28 | unfolding has_derivative_def by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 29 | |
| 37730 | 30 | lemma netlimit_at_vector: | 
| 44137 | 31 | (* TODO: move *) | 
| 37730 | 32 | fixes a :: "'a::real_normed_vector" | 
| 33 | shows "netlimit (at a) = a" | |
| 34 | proof (cases "\<exists>x. x \<noteq> a") | |
| 35 | case True then obtain x where x: "x \<noteq> a" .. | |
| 36 | have "\<not> trivial_limit (at a)" | |
| 37 | unfolding trivial_limit_def eventually_at dist_norm | |
| 38 | apply clarsimp | |
| 39 | apply (rule_tac x="a + scaleR (d / 2) (sgn (x - a))" in exI) | |
| 40 | apply (simp add: norm_sgn sgn_zero_iff x) | |
| 41 | done | |
| 42 | thus ?thesis | |
| 43 | by (rule netlimit_within [of a UNIV, unfolded within_UNIV]) | |
| 44 | qed simp | |
| 45 | ||
| 46 | lemma FDERIV_conv_has_derivative: | |
| 44137 | 47 | shows "FDERIV f x :> f' = (f has_derivative f') (at x)" | 
| 48 | unfolding fderiv_def has_derivative_def netlimit_at_vector | |
| 49 | by (simp add: diff_diff_eq Lim_at_zero [where a=x] | |
| 50 | LIM_norm_zero_iff [where 'b='b, symmetric]) | |
| 51 | ||
| 52 | lemma DERIV_conv_has_derivative: | |
| 53 | "(DERIV f x :> f') = (f has_derivative op * f') (at x)" | |
| 54 | unfolding deriv_fderiv FDERIV_conv_has_derivative | |
| 55 | by (subst mult_commute, rule refl) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 56 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 57 | 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 | 58 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 59 | lemma has_derivative_within: "(f has_derivative f') (at x within s) \<longleftrightarrow> | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 60 | bounded_linear f' \<and> ((\<lambda>y. (1 / norm(y - x)) *\<^sub>R (f y - (f x + f' (y - x)))) ---> 0) (at x within s)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 61 | unfolding has_derivative_def and Lim by(auto simp add:netlimit_within) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 62 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 63 | lemma has_derivative_at: "(f has_derivative f') (at x) \<longleftrightarrow> | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 64 | bounded_linear f' \<and> ((\<lambda>y. (1 / (norm(y - x))) *\<^sub>R (f y - (f x + f' (y - x)))) ---> 0) (at x)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 65 | apply(subst within_UNIV[THEN sym]) unfolding has_derivative_within unfolding within_UNIV by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 66 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 67 | 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 | 68 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 69 | lemma has_derivative_within': | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 70 | "(f has_derivative f')(at x within s) \<longleftrightarrow> bounded_linear f' \<and> | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 71 | (\<forall>e>0. \<exists>d>0. \<forall>x'\<in>s. 0 < norm(x' - x) \<and> norm(x' - x) < d | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 72 | \<longrightarrow> norm(f x' - f x - f'(x' - x)) / norm(x' - x) < e)" | 
| 36587 | 73 | unfolding has_derivative_within Lim_within dist_norm | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 74 | unfolding diff_0_right 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 | 75 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 76 | lemma has_derivative_at': | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 77 | "(f has_derivative f') (at x) \<longleftrightarrow> bounded_linear f' \<and> | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 78 | (\<forall>e>0. \<exists>d>0. \<forall>x'. 0 < norm(x' - x) \<and> norm(x' - x) < d | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 79 | \<longrightarrow> norm(f x' - f x - f'(x' - x)) / norm(x' - x) < e)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 80 | apply(subst within_UNIV[THEN sym]) unfolding has_derivative_within' by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 81 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 82 | lemma has_derivative_at_within: "(f has_derivative f') (at x) \<Longrightarrow> (f has_derivative f') (at x within s)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 83 | unfolding has_derivative_within' has_derivative_at' by meson | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 84 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 85 | lemma has_derivative_within_open: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 86 | "a \<in> s \<Longrightarrow> open s \<Longrightarrow> ((f has_derivative f') (at a within s) \<longleftrightarrow> (f has_derivative f') (at a))" | 
| 37730 | 87 | 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 | 88 | |
| 43338 | 89 | lemma has_derivative_right: | 
| 90 | fixes f :: "real \<Rightarrow> real" and y :: "real" | |
| 91 |   shows "(f has_derivative (op * y)) (at x within ({x <..} \<inter> I)) \<longleftrightarrow>
 | |
| 92 |     ((\<lambda>t. (f x - f t) / (x - t)) ---> y) (at x within ({x <..} \<inter> I))"
 | |
| 93 | proof - | |
| 94 |   have "((\<lambda>t. (f t - (f x + y * (t - x))) / \<bar>t - x\<bar>) ---> 0) (at x within ({x<..} \<inter> I)) \<longleftrightarrow>
 | |
| 95 |     ((\<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: 
44140diff
changeset | 96 | by (intro Lim_cong_within) (auto simp add: diff_divide_distrib add_divide_distrib) | 
| 43338 | 97 |   also have "\<dots> \<longleftrightarrow> ((\<lambda>t. (f t - f x) / (t - x)) ---> y) (at x within ({x<..} \<inter> I))"
 | 
| 98 | by (simp add: Lim_null[symmetric]) | |
| 99 |   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: 
44137diff
changeset | 100 | by (intro Lim_cong_within) (simp_all add: field_simps) | 
| 43338 | 101 | finally show ?thesis | 
| 44282 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 102 | by (simp add: bounded_linear_mult_right has_derivative_within) | 
| 43338 | 103 | qed | 
| 104 | ||
| 37648 | 105 | lemma bounded_linear_imp_linear: "bounded_linear f \<Longrightarrow> linear f" (* TODO: move elsewhere *) | 
| 106 | proof - | |
| 107 | assume "bounded_linear f" | |
| 108 | then interpret f: bounded_linear f . | |
| 109 | show "linear f" | |
| 110 | by (simp add: f.add f.scaleR linear_def) | |
| 111 | qed | |
| 112 | ||
| 113 | lemma derivative_is_linear: | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 114 | "(f has_derivative f') net \<Longrightarrow> linear f'" | 
| 37648 | 115 | by (rule derivative_linear [THEN 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 | 116 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 117 | subsubsection {* Combining theorems. *}
 | 
| 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_id: "((\<lambda>x. x) has_derivative (\<lambda>h. h)) net" | 
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 120 | unfolding has_derivative_def | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 121 | by (simp add: bounded_linear_ident tendsto_const) | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 122 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 123 | lemma has_derivative_const: "((\<lambda>x. c) has_derivative (\<lambda>h. 0)) net" | 
| 44125 | 124 | unfolding has_derivative_def | 
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 125 | by (simp add: bounded_linear_zero tendsto_const) | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 126 | |
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 127 | lemma (in bounded_linear) has_derivative': "(f has_derivative f) net" | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 128 | unfolding has_derivative_def apply(rule,rule bounded_linear_axioms) | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 129 | unfolding diff by (simp add: tendsto_const) | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 130 | |
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 131 | lemma (in bounded_linear) bounded_linear: "bounded_linear f" .. | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 132 | |
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 133 | lemma (in bounded_linear) has_derivative: | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 134 | assumes "((\<lambda>x. g x) has_derivative (\<lambda>h. g' h)) net" | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 135 | shows "((\<lambda>x. f (g x)) has_derivative (\<lambda>h. f (g' h))) net" | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 136 | using assms unfolding has_derivative_def | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 137 | apply safe | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 138 | apply (erule bounded_linear_compose [OF local.bounded_linear]) | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 139 | apply (drule local.tendsto) | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 140 | apply (simp add: local.scaleR local.diff local.add local.zero) | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 141 | done | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 142 | |
| 44282 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 143 | lemmas scaleR_right_has_derivative = | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 144 | bounded_linear.has_derivative [OF bounded_linear_scaleR_right, standard] | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 145 | |
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 146 | lemmas scaleR_left_has_derivative = | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 147 | bounded_linear.has_derivative [OF bounded_linear_scaleR_left, standard] | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 148 | |
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 149 | lemmas inner_right_has_derivative = | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 150 | bounded_linear.has_derivative [OF bounded_linear_inner_right, standard] | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 151 | |
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 152 | lemmas inner_left_has_derivative = | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 153 | bounded_linear.has_derivative [OF bounded_linear_inner_left, standard] | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 154 | |
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 155 | lemmas mult_right_has_derivative = | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 156 | bounded_linear.has_derivative [OF bounded_linear_mult_right, standard] | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 157 | |
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 158 | lemmas mult_left_has_derivative = | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 159 | bounded_linear.has_derivative [OF bounded_linear_mult_left, standard] | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 160 | |
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 161 | lemmas euclidean_component_has_derivative = | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 162 | bounded_linear.has_derivative [OF bounded_linear_euclidean_component] | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 163 | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 164 | lemma has_derivative_neg: | 
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 165 | assumes "(f has_derivative f') net" | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 166 | shows "((\<lambda>x. -(f x)) has_derivative (\<lambda>h. -(f' h))) net" | 
| 44282 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 167 | using scaleR_right_has_derivative [where r="-1", OF 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 | 168 | |
| 44123 | 169 | lemma has_derivative_add: | 
| 170 | assumes "(f has_derivative f') net" and "(g has_derivative g') net" | |
| 171 | shows "((\<lambda>x. f(x) + g(x)) has_derivative (\<lambda>h. f'(h) + g'(h))) net" | |
| 172 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 173 | note as = assms[unfolded has_derivative_def] | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 174 | show ?thesis unfolding has_derivative_def apply(rule,rule bounded_linear_add) | 
| 44125 | 175 | using tendsto_add[OF as(1)[THEN conjunct2] as(2)[THEN conjunct2]] and as | 
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 176 | by (auto simp add: algebra_simps) | 
| 44123 | 177 | qed | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 178 | |
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 179 | lemma has_derivative_add_const: | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 180 | "(f has_derivative f') net \<Longrightarrow> ((\<lambda>x. f x + c) has_derivative f') net" | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 181 | by (drule has_derivative_add, rule has_derivative_const, auto) | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 182 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 183 | lemma has_derivative_sub: | 
| 44123 | 184 | assumes "(f has_derivative f') net" and "(g has_derivative g') net" | 
| 185 | shows "((\<lambda>x. f(x) - g(x)) has_derivative (\<lambda>h. f'(h) - g'(h))) net" | |
| 186 | unfolding diff_minus by (intro has_derivative_add has_derivative_neg assms) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 187 | |
| 44123 | 188 | lemma has_derivative_setsum: | 
| 189 | assumes "finite s" and "\<forall>a\<in>s. ((f a) has_derivative (f' a)) net" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 190 | shows "((\<lambda>x. setsum (\<lambda>a. f a x) s) has_derivative (\<lambda>h. setsum (\<lambda>a. f' a h) s)) net" | 
| 44123 | 191 | using assms by (induct, simp_all add: has_derivative_const has_derivative_add) | 
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 192 | text {* Somewhat different results for derivative of scalar multiplier. *}
 | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 193 | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 194 | (** move **) | 
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 195 | lemma linear_vmul_component: (* TODO: delete *) | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 196 | assumes lf: "linear f" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 197 | shows "linear (\<lambda>x. f x $$ k *\<^sub>R v)" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 198 | using lf | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 199 | by (auto simp add: linear_def algebra_simps) | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 200 | |
| 44123 | 201 | lemmas has_derivative_intros = | 
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 202 | has_derivative_id has_derivative_const | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 203 | has_derivative_add has_derivative_sub has_derivative_neg | 
| 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 204 | has_derivative_add_const | 
| 44282 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 205 | scaleR_left_has_derivative scaleR_right_has_derivative | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 206 | inner_left_has_derivative inner_right_has_derivative | 
| 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 207 | euclidean_component_has_derivative | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 208 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 209 | 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 | 210 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 211 | lemma has_derivative_transform_within: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 212 | assumes "0 < d" "x \<in> s" "\<forall>x'\<in>s. dist x' x < d \<longrightarrow> f x' = g x'" "(f has_derivative f') (at x within s)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 213 | shows "(g has_derivative f') (at x within s)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 214 | using assms(4) unfolding has_derivative_within apply- apply(erule conjE,rule,assumption) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 215 | apply(rule Lim_transform_within[OF assms(1)]) defer apply assumption | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 216 | apply(rule,rule) apply(drule assms(3)[rule_format]) using assms(3)[rule_format, OF assms(2)] by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 217 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 218 | lemma has_derivative_transform_at: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 219 | assumes "0 < d" "\<forall>x'. dist x' x < d \<longrightarrow> f x' = g x'" "(f has_derivative f') (at x)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 220 | shows "(g has_derivative f') (at x)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 221 | apply(subst within_UNIV[THEN sym]) apply(rule has_derivative_transform_within[OF assms(1)]) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 222 | using assms(2-3) unfolding within_UNIV by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 223 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 224 | lemma has_derivative_transform_within_open: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 225 | assumes "open s" "x \<in> s" "\<forall>y\<in>s. f y = g y" "(f has_derivative f') (at x)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 226 | shows "(g has_derivative f') (at x)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 227 | using assms(4) unfolding has_derivative_at apply- apply(erule conjE,rule,assumption) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 228 | apply(rule Lim_transform_within_open[OF assms(1,2)]) defer apply assumption | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 229 | apply(rule,rule) apply(drule assms(3)[rule_format]) using assms(3)[rule_format, OF assms(2)] by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 230 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 231 | 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 | 232 | |
| 36362 
06475a1547cb
fix lots of looping simp calls and other warnings
 huffman parents: 
36334diff
changeset | 233 | no_notation Deriv.differentiable (infixl "differentiable" 60) | 
| 
06475a1547cb
fix lots of looping simp calls and other warnings
 huffman parents: 
36334diff
changeset | 234 | |
| 44081 
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
 huffman parents: 
43338diff
changeset | 235 | definition differentiable :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'a filter \<Rightarrow> bool" (infixr "differentiable" 30) where
 | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 236 | "f differentiable net \<equiv> (\<exists>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 | 237 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 238 | definition differentiable_on :: "('a::real_normed_vector \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'a set \<Rightarrow> bool" (infixr "differentiable'_on" 30) where
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 239 | "f differentiable_on s \<equiv> (\<forall>x\<in>s. f differentiable (at x within s))" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 240 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 241 | lemma differentiableI: "(f has_derivative f') net \<Longrightarrow> f differentiable net" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 242 | unfolding differentiable_def by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 243 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 244 | lemma differentiable_at_withinI: "f differentiable (at x) \<Longrightarrow> f differentiable (at x within s)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 245 | unfolding differentiable_def using has_derivative_at_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 | 246 | |
| 44123 | 247 | lemma differentiable_within_open: (* TODO: delete *) | 
| 248 | assumes "a \<in> s" and "open s" | |
| 249 | shows "f differentiable (at a within s) \<longleftrightarrow> (f differentiable (at a))" | |
| 37730 | 250 | using assms 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 | 251 | |
| 44123 | 252 | lemma differentiable_on_eq_differentiable_at: | 
| 253 | "open s \<Longrightarrow> (f differentiable_on s \<longleftrightarrow> (\<forall>x\<in>s. f differentiable at x))" | |
| 254 | unfolding differentiable_on_def | |
| 255 | by (auto simp add: 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 | 256 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 257 | lemma differentiable_transform_within: | 
| 44123 | 258 | assumes "0 < d" and "x \<in> s" and "\<forall>x'\<in>s. dist x' x < d \<longrightarrow> f x' = g x'" | 
| 259 | 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 | 260 | shows "g differentiable (at x within s)" | 
| 44123 | 261 | using assms(4) unfolding differentiable_def | 
| 262 | 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 | 263 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 264 | lemma differentiable_transform_at: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 265 | assumes "0 < d" "\<forall>x'. dist x' x < d \<longrightarrow> f x' = g x'" "f differentiable at x" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 266 | shows "g differentiable at x" | 
| 44123 | 267 | using assms(3) unfolding differentiable_def | 
| 268 | using has_derivative_transform_at[OF assms(1-2)] 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 | 269 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 270 | subsection {* Frechet derivative and Jacobian matrix. *}
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 271 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 272 | 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 | 273 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 274 | lemma frechet_derivative_works: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 275 | "f differentiable net \<longleftrightarrow> (f has_derivative (frechet_derivative f net)) net" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 276 | unfolding frechet_derivative_def differentiable_def and some_eq_ex[of "\<lambda> 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 | 277 | |
| 37648 | 278 | lemma linear_frechet_derivative: | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 279 | shows "f differentiable net \<Longrightarrow> linear(frechet_derivative f net)" | 
| 44123 | 280 | unfolding frechet_derivative_works has_derivative_def | 
| 281 | 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 | 282 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 283 | 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 | 284 | |
| 44123 | 285 | lemma Lim_mul_norm_within: | 
| 286 | fixes f::"'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 287 | shows "(f ---> 0) (at a within s) \<Longrightarrow> ((\<lambda>x. norm(x - a) *\<^sub>R f(x)) ---> 0) (at a within s)" | 
| 44123 | 288 | unfolding Lim_within apply(rule,rule) | 
| 289 | apply(erule_tac x=e in allE,erule impE,assumption,erule exE,erule conjE) | |
| 290 | apply(rule_tac x="min d 1" in exI) apply rule defer | |
| 291 | apply(rule,erule_tac x=x in ballE) unfolding dist_norm diff_0_right | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 292 | by(auto intro!: mult_strict_mono[of _ "1::real", unfolded mult_1_left]) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 293 | |
| 44123 | 294 | lemma differentiable_imp_continuous_within: | 
| 295 | assumes "f differentiable (at x within s)" | |
| 296 | shows "continuous (at x within s) f" | |
| 297 | proof- | |
| 298 | from assms guess f' unfolding differentiable_def has_derivative_within .. | |
| 299 | note f'=this | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 300 | then interpret bounded_linear f' by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 301 | have *:"\<And>xa. x\<noteq>xa \<Longrightarrow> (f' \<circ> (\<lambda>y. y - x)) xa + norm (xa - x) *\<^sub>R ((1 / norm (xa - x)) *\<^sub>R (f xa - (f x + f' (xa - x)))) - ((f' \<circ> (\<lambda>y. y - x)) x + 0) = f xa - f x" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 302 | using zero by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 303 | have **:"continuous (at x within s) (f' \<circ> (\<lambda>y. y - x))" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 304 | apply(rule continuous_within_compose) apply(rule continuous_intros)+ | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 305 | by(rule linear_continuous_within[OF f'[THEN conjunct1]]) | 
| 44123 | 306 | show ?thesis unfolding continuous_within | 
| 307 | using f'[THEN conjunct2, THEN Lim_mul_norm_within] | |
| 44125 | 308 | apply- apply(drule tendsto_add) | 
| 44123 | 309 | apply(rule **[unfolded continuous_within]) | 
| 310 | unfolding Lim_within and dist_norm | |
| 311 | apply (rule, rule) | |
| 312 | apply (erule_tac x=e in allE) | |
| 313 | apply (erule impE | assumption)+ | |
| 314 | apply (erule exE, rule_tac x=d in exI) | |
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 315 | by (auto simp add: zero *) | 
| 44123 | 316 | qed | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 317 | |
| 44123 | 318 | lemma differentiable_imp_continuous_at: | 
| 319 | "f differentiable at x \<Longrightarrow> continuous (at x) f" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 320 | by(rule differentiable_imp_continuous_within[of _ x UNIV, unfolded within_UNIV]) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 321 | |
| 44123 | 322 | lemma differentiable_imp_continuous_on: | 
| 323 | "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 | 324 | 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 | 325 | 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 | 326 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 327 | lemma has_derivative_within_subset: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 328 | "(f has_derivative f') (at x within s) \<Longrightarrow> t \<subseteq> s \<Longrightarrow> (f has_derivative f') (at x within t)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 329 | unfolding has_derivative_within using Lim_within_subset by blast | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 330 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 331 | lemma differentiable_within_subset: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 332 | "f differentiable (at x within t) \<Longrightarrow> s \<subseteq> t \<Longrightarrow> f differentiable (at x within s)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 333 | unfolding differentiable_def using has_derivative_within_subset by blast | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 334 | |
| 44123 | 335 | lemma differentiable_on_subset: | 
| 336 | "f differentiable_on t \<Longrightarrow> s \<subseteq> t \<Longrightarrow> f differentiable_on s" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 337 | unfolding differentiable_on_def using differentiable_within_subset by blast | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 338 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 339 | lemma differentiable_on_empty: "f differentiable_on {}"
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 340 | unfolding differentiable_on_def by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 341 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 342 | text {* Several results are easier using a "multiplied-out" variant.
 | 
| 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 343 | (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 | 344 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 345 | lemma has_derivative_within_alt: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 346 | "(f has_derivative f') (at x within s) \<longleftrightarrow> bounded_linear f' \<and> | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 347 | (\<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))" (is "?lhs \<longleftrightarrow> ?rhs") | 
| 44123 | 348 | proof | 
| 349 | assume ?lhs thus ?rhs | |
| 350 | unfolding has_derivative_within apply-apply(erule conjE,rule,assumption) | |
| 351 | unfolding Lim_within | |
| 352 | apply(rule,erule_tac x=e in allE,rule,erule impE,assumption) | |
| 353 | apply(erule exE,rule_tac x=d in exI) | |
| 354 | apply(erule conjE,rule,assumption,rule,rule) | |
| 355 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 356 | fix x y e d assume as:"0 < e" "0 < d" "norm (y - x) < d" "\<forall>xa\<in>s. 0 < dist xa x \<and> dist xa x < d \<longrightarrow> | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 357 | dist ((1 / norm (xa - x)) *\<^sub>R (f xa - (f x + f' (xa - x)))) 0 < e" "y \<in> s" "bounded_linear f'" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 358 | then interpret bounded_linear f' by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 359 | show "norm (f y - f x - f' (y - x)) \<le> e * norm (y - x)" proof(cases "y=x") | 
| 44123 | 360 | case True thus ?thesis using `bounded_linear f'` by(auto simp add: zero) | 
| 361 | next | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 362 | case False hence "norm (f y - (f x + f' (y - x))) < e * norm (y - x)" using as(4)[rule_format, OF `y\<in>s`] | 
| 41958 | 363 | unfolding dist_norm diff_0_right using as(3) | 
| 364 | using pos_divide_less_eq[OF False[unfolded dist_nz], unfolded dist_norm] | |
| 365 | by (auto simp add: linear_0 linear_sub) | |
| 44123 | 366 | thus ?thesis by(auto simp add:algebra_simps) | 
| 367 | qed | |
| 368 | qed | |
| 369 | next | |
| 370 | assume ?rhs thus ?lhs unfolding has_derivative_within Lim_within | |
| 371 | apply-apply(erule conjE,rule,assumption) | |
| 372 | apply(rule,erule_tac x="e/2" in allE,rule,erule impE) defer | |
| 373 | apply(erule exE,rule_tac x=d in exI) | |
| 374 | apply(erule conjE,rule,assumption,rule,rule) | |
| 375 | unfolding dist_norm diff_0_right norm_scaleR | |
| 376 | apply(erule_tac x=xa in ballE,erule impE) | |
| 377 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 378 | fix e d y assume "bounded_linear f'" "0 < e" "0 < d" "y \<in> s" "0 < norm (y - x) \<and> norm (y - x) < d" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 379 | "norm (f y - f x - f' (y - x)) \<le> e / 2 * norm (y - x)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 380 | thus "\<bar>1 / norm (y - x)\<bar> * norm (f y - (f x + f' (y - x))) < e" | 
| 44123 | 381 | apply(rule_tac le_less_trans[of _ "e/2"]) | 
| 382 | by(auto intro!:mult_imp_div_pos_le simp add:algebra_simps) | |
| 383 | qed auto | |
| 384 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 385 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 386 | lemma has_derivative_at_alt: | 
| 35172 
579dd5570f96
Added integration to Multivariate-Analysis (upto FTC)
 himmelma parents: 
35028diff
changeset | 387 | "(f has_derivative f') (at x) \<longleftrightarrow> bounded_linear f' \<and> | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 388 | (\<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))" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 389 | using has_derivative_within_alt[where s=UNIV] unfolding within_UNIV by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 390 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 391 | subsection {* The chain rule. *}
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 392 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 393 | lemma diff_chain_within: | 
| 44123 | 394 | assumes "(f has_derivative f') (at x within s)" | 
| 395 | assumes "(g has_derivative g') (at (f x) within (f ` s))" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 396 | shows "((g o f) has_derivative (g' o f'))(at x within s)" | 
| 44123 | 397 | unfolding has_derivative_within_alt | 
| 398 | apply(rule,rule bounded_linear_compose[unfolded o_def[THEN sym]]) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 399 | apply(rule assms(2)[unfolded has_derivative_def,THEN conjE],assumption) | 
| 44123 | 400 | apply(rule assms(1)[unfolded has_derivative_def,THEN conjE],assumption) | 
| 401 | proof(rule,rule) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 402 | note assms = assms[unfolded has_derivative_within_alt] | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 403 | fix e::real assume "0<e" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 404 | guess B1 using bounded_linear.pos_bounded[OF assms(1)[THEN conjunct1, rule_format]] .. note B1 = this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 405 | guess B2 using bounded_linear.pos_bounded[OF assms(2)[THEN conjunct1, rule_format]] .. note B2 = this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 406 | have *:"e / 2 / B2 > 0" using `e>0` B2 apply-apply(rule divide_pos_pos) by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 407 | guess d1 using assms(1)[THEN conjunct2, rule_format, OF *] .. note d1 = this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 408 | have *:"e / 2 / (1 + B1) > 0" using `e>0` B1 apply-apply(rule divide_pos_pos) by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 409 | guess de using assms(2)[THEN conjunct2, rule_format, OF *] .. note de = this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 410 | guess d2 using assms(1)[THEN conjunct2, rule_format, OF zero_less_one] .. note d2 = this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 411 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 412 | def d0 \<equiv> "(min d1 d2)/2" have d0:"d0>0" "d0 < d1" "d0 < d2" unfolding d0_def using d1 d2 by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 413 | def d \<equiv> "(min d0 (de / (B1 + 1))) / 2" have "de * 2 / (B1 + 1) > de / (B1 + 1)" apply(rule divide_strict_right_mono) using B1 de by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 414 | hence d:"d>0" "d < d1" "d < d2" "d < (de / (B1 + 1))" unfolding d_def using d0 d1 d2 de B1 by(auto intro!: divide_pos_pos simp add:min_less_iff_disj not_less) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 415 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 416 | show "\<exists>d>0. \<forall>y\<in>s. norm (y - x) < d \<longrightarrow> norm ((g \<circ> f) y - (g \<circ> f) x - (g' \<circ> f') (y - x)) \<le> e * norm (y - x)" apply(rule_tac x=d in exI) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 417 | proof(rule,rule `d>0`,rule,rule) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 418 | fix y assume as:"y \<in> s" "norm (y - x) < d" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 419 | hence 1:"norm (f y - f x - f' (y - x)) \<le> min (norm (y - x)) (e / 2 / B2 * norm (y - x))" using d1 d2 d by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 420 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 421 | have "norm (f y - f x) \<le> norm (f y - f x - f' (y - x)) + norm (f' (y - x))" | 
| 44123 | 422 | using norm_triangle_sub[of "f y - f x" "f' (y - x)"] | 
| 423 | by(auto simp add:algebra_simps) | |
| 424 | also have "\<dots> \<le> norm (f y - f x - f' (y - x)) + B1 * norm (y - x)" | |
| 425 | apply(rule add_left_mono) using B1 by(auto simp add:algebra_simps) | |
| 426 | also have "\<dots> \<le> min (norm (y - x)) (e / 2 / B2 * norm (y - x)) + B1 * norm (y - x)" | |
| 427 | apply(rule add_right_mono) using d1 d2 d as 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 | 428 | also have "\<dots> \<le> norm (y - x) + B1 * norm (y - x)" by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 429 | also have "\<dots> = norm (y - x) * (1 + B1)" by(auto simp add:field_simps) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 430 | finally have 3:"norm (f y - f x) \<le> norm (y - x) * (1 + B1)" by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 431 | |
| 44123 | 432 | hence "norm (f y - f x) \<le> d * (1 + B1)" apply- | 
| 433 | apply(rule order_trans,assumption,rule mult_right_mono) | |
| 434 | using as B1 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 | 435 | also have "\<dots> < de" using d B1 by(auto simp add:field_simps) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 436 | finally have "norm (g (f y) - g (f x) - g' (f y - f x)) \<le> e / 2 / (1 + B1) * norm (f y - f x)" | 
| 44123 | 437 | apply-apply(rule de[THEN conjunct2,rule_format]) | 
| 438 | using `y\<in>s` using d as 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 | 439 | also have "\<dots> = (e / 2) * (1 / (1 + B1) * norm (f y - f x))" by auto | 
| 44123 | 440 | also have "\<dots> \<le> e / 2 * norm (y - x)" apply(rule mult_left_mono) | 
| 441 | using `e>0` and 3 using B1 and `e>0` by(auto simp add: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 | 442 | finally have 4:"norm (g (f y) - g (f x) - g' (f y - f x)) \<le> e / 2 * norm (y - x)" by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 443 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 444 | interpret g': bounded_linear g' using assms(2) by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 445 | interpret f': bounded_linear f' using assms(1) by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 446 | have "norm (- g' (f' (y - x)) + g' (f y - f x)) = norm (g' (f y - f x - f' (y - x)))" | 
| 36350 | 447 | by(auto simp add:algebra_simps f'.diff g'.diff g'.add) | 
| 44123 | 448 | also have "\<dots> \<le> B2 * norm (f y - f x - f' (y - x))" using B2 | 
| 449 | by (auto simp add: algebra_simps) | |
| 450 | also have "\<dots> \<le> B2 * (e / 2 / B2 * norm (y - x))" | |
| 451 | apply (rule mult_left_mono) using as d1 d2 d B2 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 | 452 | also have "\<dots> \<le> e / 2 * norm (y - x)" using B2 by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 453 | finally have 5:"norm (- g' (f' (y - x)) + g' (f y - f x)) \<le> e / 2 * norm (y - x)" by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 454 | |
| 44123 | 455 | have "norm (g (f y) - g (f x) - g' (f y - f x)) + norm (g (f y) - g (f x) - g' (f' (y - x)) - (g (f y) - g (f x) - g' (f y - f x))) \<le> e * norm (y - x)" | 
| 456 | using 5 4 by auto | |
| 457 | thus "norm ((g \<circ> f) y - (g \<circ> f) x - (g' \<circ> f') (y - x)) \<le> e * norm (y - x)" | |
| 458 | unfolding o_def apply- apply(rule order_trans, rule norm_triangle_sub) | |
| 459 | by assumption | |
| 460 | qed | |
| 461 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 462 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 463 | lemma diff_chain_at: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 464 | "(f has_derivative f') (at x) \<Longrightarrow> (g has_derivative g') (at (f x)) \<Longrightarrow> ((g o f) has_derivative (g' o f')) (at x)" | 
| 44123 | 465 | using diff_chain_within[of f f' x UNIV g g'] | 
| 466 | using has_derivative_within_subset[of g g' "f x" UNIV "range f"] | |
| 467 | unfolding within_UNIV 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 | 468 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 469 | subsection {* Composition rules stated just for differentiability. *}
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 470 | |
| 44123 | 471 | lemma differentiable_const [intro]: | 
| 472 | "(\<lambda>z. c) differentiable (net::'a::real_normed_vector filter)" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 473 | unfolding differentiable_def using has_derivative_const by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 474 | |
| 44123 | 475 | lemma differentiable_id [intro]: | 
| 476 | "(\<lambda>z. z) differentiable (net::'a::real_normed_vector filter)" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 477 | unfolding differentiable_def using has_derivative_id by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 478 | |
| 44123 | 479 | lemma differentiable_cmul [intro]: | 
| 480 | "f differentiable net \<Longrightarrow> | |
| 481 | (\<lambda>x. c *\<^sub>R f(x)) differentiable (net::'a::real_normed_vector filter)" | |
| 482 | unfolding differentiable_def | |
| 44282 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 483 | apply(erule exE, drule scaleR_right_has_derivative) 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 | 484 | |
| 44123 | 485 | lemma differentiable_neg [intro]: | 
| 486 | "f differentiable net \<Longrightarrow> | |
| 487 | (\<lambda>z. -(f z)) differentiable (net::'a::real_normed_vector filter)" | |
| 488 | unfolding differentiable_def | |
| 489 | apply(erule exE, drule has_derivative_neg) 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 | 490 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 491 | lemma differentiable_add: "f differentiable net \<Longrightarrow> g differentiable net | 
| 44081 
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
 huffman parents: 
43338diff
changeset | 492 | \<Longrightarrow> (\<lambda>z. f z + g z) differentiable (net::'a::real_normed_vector filter)" | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 493 | unfolding differentiable_def apply(erule exE)+ apply(rule_tac x="\<lambda>z. f' z + f'a z" in exI) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 494 | apply(rule has_derivative_add) by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 495 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 496 | lemma differentiable_sub: "f differentiable net \<Longrightarrow> g differentiable net | 
| 44081 
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
 huffman parents: 
43338diff
changeset | 497 | \<Longrightarrow> (\<lambda>z. f z - g z) differentiable (net::'a::real_normed_vector filter)" | 
| 44123 | 498 | unfolding differentiable_def apply(erule exE)+ | 
| 499 | apply(rule_tac x="\<lambda>z. f' z - f'a z" in exI) | |
| 500 | apply(rule has_derivative_sub) 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 | 501 | |
| 37648 | 502 | lemma differentiable_setsum: | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 503 | assumes "finite s" "\<forall>a\<in>s. (f a) differentiable net" | 
| 44123 | 504 | shows "(\<lambda>x. setsum (\<lambda>a. f a x) s) differentiable net" | 
| 505 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 506 | guess f' using bchoice[OF assms(2)[unfolded differentiable_def]] .. | 
| 44123 | 507 | thus ?thesis unfolding differentiable_def apply- | 
| 508 | apply(rule,rule has_derivative_setsum[where f'=f'],rule assms(1)) by auto | |
| 509 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 510 | |
| 37648 | 511 | lemma differentiable_setsum_numseg: | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 512 |   shows "\<forall>i. m \<le> i \<and> i \<le> n \<longrightarrow> (f i) differentiable net \<Longrightarrow> (\<lambda>x. setsum (\<lambda>a. f a x) {m::nat..n}) differentiable net"
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 513 | apply(rule differentiable_setsum) using finite_atLeastAtMost[of n m] by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 514 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 515 | lemma differentiable_chain_at: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 516 | "f differentiable (at x) \<Longrightarrow> g differentiable (at(f x)) \<Longrightarrow> (g o f) differentiable (at x)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 517 | unfolding differentiable_def by(meson diff_chain_at) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 518 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 519 | lemma differentiable_chain_within: | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 520 | "f differentiable (at x within s) \<Longrightarrow> g differentiable (at(f x) within (f ` s)) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 521 | \<Longrightarrow> (g o f) differentiable (at x within s)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 522 | unfolding differentiable_def by(meson diff_chain_within) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 523 | |
| 37730 | 524 | subsection {* Uniqueness of derivative *}
 | 
| 525 | ||
| 526 | text {*
 | |
| 527 | The general result is a bit messy because we need approachability of the | |
| 528 | limit point from any direction. But OK for nontrivial intervals etc. | |
| 529 | *} | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 530 | |
| 44123 | 531 | lemma frechet_derivative_unique_within: | 
| 532 | fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector" | |
| 533 | assumes "(f has_derivative f') (at x within s)" | |
| 534 | assumes "(f has_derivative f'') (at x within s)" | |
| 535 |   assumes "(\<forall>i<DIM('a). \<forall>e>0. \<exists>d. 0 < abs(d) \<and> abs(d) < e \<and> (x + d *\<^sub>R basis i) \<in> s)"
 | |
| 536 | shows "f' = f''" | |
| 537 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 538 | note as = assms(1,2)[unfolded has_derivative_def] | 
| 44123 | 539 | then interpret f': bounded_linear f' by auto | 
| 540 | from as interpret f'': bounded_linear f'' by auto | |
| 541 | have "x islimpt s" unfolding islimpt_approachable | |
| 542 | proof(rule,rule) | |
| 543 | fix e::real assume "0<e" guess d | |
| 544 | using assms(3)[rule_format,OF DIM_positive `e>0`] .. | |
| 545 | thus "\<exists>x'\<in>s. x' \<noteq> x \<and> dist x' x < e" | |
| 546 | apply(rule_tac x="x + d *\<^sub>R basis 0" in bexI) | |
| 547 | unfolding dist_norm by auto | |
| 548 | qed | |
| 549 | hence *:"netlimit (at x within s) = x" apply-apply(rule netlimit_within) | |
| 550 | unfolding trivial_limit_within by simp | |
| 551 | show ?thesis apply(rule linear_eq_stdbasis) | |
| 552 | unfolding linear_conv_bounded_linear | |
| 553 | apply(rule as(1,2)[THEN conjunct1])+ | |
| 554 | proof(rule,rule,rule ccontr) | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 555 |     fix i assume i:"i<DIM('a)" def e \<equiv> "norm (f' (basis i) - f'' (basis i))"
 | 
| 44123 | 556 | assume "f' (basis i) \<noteq> f'' (basis i)" | 
| 557 | hence "e>0" unfolding e_def by auto | |
| 44125 | 558 | guess d using tendsto_diff [OF as(1,2)[THEN conjunct2], unfolded * Lim_within,rule_format,OF `e>0`] .. note d=this | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 559 | guess c using assms(3)[rule_format,OF i d[THEN conjunct1]] .. note c=this | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 560 | have *:"norm (- ((1 / \<bar>c\<bar>) *\<^sub>R f' (c *\<^sub>R basis i)) + (1 / \<bar>c\<bar>) *\<^sub>R f'' (c *\<^sub>R basis i)) = norm ((1 / abs c) *\<^sub>R (- (f' (c *\<^sub>R basis i)) + f'' (c *\<^sub>R basis i)))" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 561 | unfolding scaleR_right_distrib by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 562 | also have "\<dots> = norm ((1 / abs c) *\<^sub>R (c *\<^sub>R (- (f' (basis i)) + f'' (basis i))))" | 
| 44123 | 563 | unfolding f'.scaleR f''.scaleR | 
| 564 | unfolding scaleR_right_distrib scaleR_minus_right by auto | |
| 565 | also have "\<dots> = e" unfolding e_def using c[THEN conjunct1] | |
| 566 | using norm_minus_cancel[of "f' (basis i) - f'' (basis i)"] | |
| 567 | by (auto simp add: add.commute ab_diff_minus) | |
| 568 | finally show False using c | |
| 569 | using d[THEN conjunct2,rule_format,of "x + c *\<^sub>R basis i"] | |
| 570 | unfolding dist_norm | |
| 571 | unfolding f'.scaleR f''.scaleR f'.add f''.add f'.diff f''.diff | |
| 572 | scaleR_scaleR scaleR_right_diff_distrib scaleR_right_distrib | |
| 573 | using i by auto | |
| 574 | qed | |
| 575 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 576 | |
| 37730 | 577 | lemma frechet_derivative_unique_at: | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 578 | shows "(f has_derivative f') (at x) \<Longrightarrow> (f has_derivative f'') (at x) \<Longrightarrow> f' = f''" | 
| 37730 | 579 | unfolding FDERIV_conv_has_derivative [symmetric] | 
| 580 | by (rule FDERIV_unique) | |
| 41829 | 581 | |
| 44123 | 582 | lemma continuous_isCont: "isCont f x = continuous (at x) f" | 
| 583 | unfolding isCont_def LIM_def | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 584 | unfolding continuous_at Lim_at unfolding dist_nz by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 585 | |
| 44123 | 586 | lemma frechet_derivative_unique_within_closed_interval: | 
| 587 | fixes f::"'a::ordered_euclidean_space \<Rightarrow> 'b::real_normed_vector" | |
| 588 |   assumes "\<forall>i<DIM('a). a$$i < b$$i" "x \<in> {a..b}" (is "x\<in>?I")
 | |
| 589 |   assumes "(f has_derivative f' ) (at x within {a..b})"
 | |
| 590 |   assumes "(f has_derivative f'') (at x within {a..b})"
 | |
| 591 | shows "f' = f''" | |
| 592 | apply(rule frechet_derivative_unique_within) | |
| 593 | apply(rule assms(3,4))+ | |
| 594 | proof(rule,rule,rule,rule) | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 595 |   fix e::real and i assume "e>0" and i:"i<DIM('a)"
 | 
| 44123 | 596 |   thus "\<exists>d. 0 < \<bar>d\<bar> \<and> \<bar>d\<bar> < e \<and> x + d *\<^sub>R basis i \<in> {a..b}"
 | 
| 597 | proof(cases "x$$i=a$$i") | |
| 598 | case True thus ?thesis | |
| 599 | apply(rule_tac x="(min (b$$i - a$$i) e) / 2" in exI) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 600 | using assms(1)[THEN spec[where x=i]] and `e>0` and assms(2) | 
| 44457 
d366fa5551ef
declare euclidean_simps [simp] at the point they are proved;
 huffman parents: 
44282diff
changeset | 601 | unfolding mem_interval euclidean_simps | 
| 44123 | 602 | using i by (auto simp add: field_simps) | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 603 | next note * = assms(2)[unfolded mem_interval,THEN spec[where x=i]] | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 604 | case False moreover have "a $$ i < x $$ i" using False * by auto | 
| 44123 | 605 |     moreover {
 | 
| 606 | have "a $$ i * 2 + min (x $$ i - a $$ i) e \<le> a$$i *2 + x$$i - a$$i" | |
| 607 | by auto | |
| 608 | also have "\<dots> = a$$i + x$$i" by auto | |
| 609 | also have "\<dots> \<le> 2 * x$$i" using * by auto | |
| 610 | finally have "a $$ i * 2 + min (x $$ i - a $$ i) e \<le> x $$ i * 2" by auto | |
| 611 | } | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 612 | moreover have "min (x $$ i - a $$ i) e \<ge> 0" using * and `e>0` by auto | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 613 | hence "x $$ i * 2 \<le> b $$ i * 2 + min (x $$ i - a $$ i) e" using * by auto | 
| 44123 | 614 | ultimately show ?thesis | 
| 615 | apply(rule_tac x="- (min (x$$i - a$$i) e) / 2" in exI) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 616 | using assms(1)[THEN spec[where x=i]] and `e>0` and assms(2) | 
| 44457 
d366fa5551ef
declare euclidean_simps [simp] at the point they are proved;
 huffman parents: 
44282diff
changeset | 617 | unfolding mem_interval euclidean_simps | 
| 44123 | 618 | using i by (auto simp add: field_simps) | 
| 619 | qed | |
| 620 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 621 | |
| 44123 | 622 | lemma frechet_derivative_unique_within_open_interval: | 
| 623 | fixes f::"'a::ordered_euclidean_space \<Rightarrow> 'b::real_normed_vector" | |
| 624 |   assumes "x \<in> {a<..<b}"
 | |
| 625 |   assumes "(f has_derivative f' ) (at x within {a<..<b})"
 | |
| 626 |   assumes "(f has_derivative f'') (at x within {a<..<b})"
 | |
| 37650 | 627 | shows "f' = f''" | 
| 628 | proof - | |
| 629 |   from assms(1) have *: "at x within {a<..<b} = at x"
 | |
| 630 | by (simp add: at_within_interior interior_open open_interval) | |
| 631 | from assms(2,3) [unfolded *] show "f' = f''" | |
| 632 | by (rule frechet_derivative_unique_at) | |
| 633 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 634 | |
| 37730 | 635 | lemma frechet_derivative_at: | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 636 | shows "(f has_derivative f') (at x) \<Longrightarrow> (f' = frechet_derivative f (at x))" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 637 | apply(rule frechet_derivative_unique_at[of f],assumption) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 638 | unfolding frechet_derivative_works[THEN sym] using differentiable_def by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 639 | |
| 44123 | 640 | lemma frechet_derivative_within_closed_interval: | 
| 641 | fixes f::"'a::ordered_euclidean_space \<Rightarrow> 'b::real_normed_vector" | |
| 642 |   assumes "\<forall>i<DIM('a). a$$i < b$$i" and "x \<in> {a..b}"
 | |
| 643 |   assumes "(f has_derivative f') (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 | 644 |   shows "frechet_derivative f (at x within {a.. b}) = f'"
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 645 | apply(rule frechet_derivative_unique_within_closed_interval[where f=f]) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 646 | apply(rule assms(1,2))+ unfolding frechet_derivative_works[THEN sym] | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 647 | unfolding differentiable_def using assms(3) by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 648 | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 649 | subsection {* The traditional Rolle theorem in one dimension. *}
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 650 | |
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 651 | lemma linear_componentwise: | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 652 | 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: 
36844diff
changeset | 653 | assumes lf: "linear f" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 654 |   shows "(f x) $$ j = (\<Sum>i<DIM('a). (x$$i) * (f (basis i)$$j))" (is "?lhs = ?rhs")
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 655 | proof - | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 656 |   have fA: "finite {..<DIM('a)}" by simp
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 657 |   have "?rhs = (\<Sum>i<DIM('a). x$$i *\<^sub>R f (basis i))$$j"
 | 
| 44457 
d366fa5551ef
declare euclidean_simps [simp] at the point they are proved;
 huffman parents: 
44282diff
changeset | 658 | by simp | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 659 | then show ?thesis | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 660 | unfolding linear_setsum_mul[OF lf fA, symmetric] | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 661 | unfolding euclidean_representation[symmetric] .. | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 662 | qed | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 663 | |
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 664 | text {* We do not introduce @{text jacobian}, which is defined on matrices, instead we use
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 665 | the unfolding of it. *} | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 666 | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 667 | lemma jacobian_works: | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 668 |   "(f::('a::euclidean_space) \<Rightarrow> ('b::euclidean_space)) differentiable net \<longleftrightarrow>
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 669 | (f has_derivative (\<lambda>h. \<chi>\<chi> i. | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 670 |       \<Sum>j<DIM('a). frechet_derivative f net (basis j) $$ i * h $$ j)) net"
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 671 | (is "?differentiable \<longleftrightarrow> (f has_derivative (\<lambda>h. \<chi>\<chi> i. ?SUM h i)) net") | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 672 | proof | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 673 | assume *: ?differentiable | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 674 |   { fix h i
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 675 | have "?SUM h i = frechet_derivative f net h $$ i" using * | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 676 | by (auto intro!: setsum_cong | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 677 | simp: linear_componentwise[of _ h i] linear_frechet_derivative) } | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 678 | thus "(f has_derivative (\<lambda>h. \<chi>\<chi> i. ?SUM h i)) net" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 679 | using * by (simp add: frechet_derivative_works) | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 680 | qed (auto intro!: differentiableI) | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 681 | |
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 682 | lemma differential_zero_maxmin_component: | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 683 | 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: 
36844diff
changeset | 684 |   assumes k: "k < DIM('b)"
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 685 | and ball: "0 < e" "((\<forall>y \<in> ball x e. (f y)$$k \<le> (f x)$$k) \<or> (\<forall>y\<in>ball x e. (f x)$$k \<le> (f y)$$k))" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 686 | and diff: "f differentiable (at x)" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 687 | shows "(\<chi>\<chi> j. frechet_derivative f (at x) (basis j) $$ k) = (0::'a)" (is "?D k = 0") | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 688 | proof (rule ccontr) | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 689 | assume "?D k \<noteq> 0" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 690 |   then obtain j where j: "?D k $$ j \<noteq> 0" "j < DIM('a)"
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 691 | unfolding euclidean_lambda_beta euclidean_eq[of _ "0::'a"] by auto | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 692 | hence *: "\<bar>?D k $$ j\<bar> / 2 > 0" by auto | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 693 | note as = diff[unfolded jacobian_works has_derivative_at_alt] | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 694 | guess e' using as[THEN conjunct2, rule_format, OF *] .. note e' = this | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 695 | guess d using real_lbound_gt_zero[OF ball(1) e'[THEN conjunct1]] .. note d = this | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 696 |   { fix c assume "abs c \<le> d"
 | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 697 | hence *:"norm (x + c *\<^sub>R basis j - x) < e'" using norm_basis[of j] d by auto | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 698 |     let ?v = "(\<chi>\<chi> i. \<Sum>l<DIM('a). ?D i $$ l * (c *\<^sub>R basis j :: 'a) $$ l)"
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 699 | have if_dist: "\<And> P a b c. a * (if P then b else c) = (if P then a * b else a * c)" by auto | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 700 | have "\<bar>(f (x + c *\<^sub>R basis j) - f x - ?v) $$ k\<bar> \<le> | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 701 | norm (f (x + c *\<^sub>R basis j) - f x - ?v)" by (rule component_le_norm) | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 702 | also have "\<dots> \<le> \<bar>?D k $$ j\<bar> / 2 * \<bar>c\<bar>" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 703 | using e'[THEN conjunct2, rule_format, OF *] and norm_basis[of j] by fastsimp | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 704 | finally have "\<bar>(f (x + c *\<^sub>R basis j) - f x - ?v) $$ k\<bar> \<le> \<bar>?D k $$ j\<bar> / 2 * \<bar>c\<bar>" by simp | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 705 | hence "\<bar>f (x + c *\<^sub>R basis j) $$ k - f x $$ k - c * ?D k $$ j\<bar> \<le> \<bar>?D k $$ j\<bar> / 2 * \<bar>c\<bar>" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 706 | unfolding euclidean_simps euclidean_lambda_beta using j k | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 707 | by (simp add: if_dist setsum_cases field_simps) } note * = this | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 708 | have "x + d *\<^sub>R basis j \<in> ball x e" "x - d *\<^sub>R basis j \<in> ball x e" | 
| 36587 | 709 | unfolding mem_ball dist_norm using norm_basis[of j] d by auto | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 710 | hence **:"((f (x - d *\<^sub>R basis j))$$k \<le> (f x)$$k \<and> (f (x + d *\<^sub>R basis j))$$k \<le> (f x)$$k) \<or> | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 711 | ((f (x - d *\<^sub>R basis j))$$k \<ge> (f x)$$k \<and> (f (x + d *\<^sub>R basis j))$$k \<ge> (f x)$$k)" using ball by auto | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 712 | have ***: "\<And>y y1 y2 d dx::real. | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 713 | (y1\<le>y\<and>y2\<le>y) \<or> (y\<le>y1\<and>y\<le>y2) \<Longrightarrow> d < abs dx \<Longrightarrow> abs(y1 - y - - dx) \<le> d \<Longrightarrow> (abs (y2 - y - dx) \<le> d) \<Longrightarrow> False" by arith | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 714 | show False apply(rule ***[OF **, where dx="d * ?D k $$ j" and d="\<bar>?D k $$ j\<bar> / 2 * \<bar>d\<bar>"]) | 
| 44123 | 715 | using *[of "-d"] and *[of d] and d[THEN conjunct1] and j | 
| 716 | unfolding mult_minus_left | |
| 44282 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 717 | unfolding abs_mult diff_minus_eq_add scaleR_minus_left | 
| 44123 | 718 | unfolding algebra_simps by (auto intro: mult_pos_pos) | 
| 34906 | 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 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 721 | text {* In particular if we have a mapping into @{typ "real"}. *}
 | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 722 | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 723 | lemma differential_zero_maxmin: | 
| 37650 | 724 | fixes f::"'a\<Colon>euclidean_space \<Rightarrow> real" | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 725 | assumes "x \<in> s" "open s" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 726 | and deriv: "(f has_derivative f') (at x)" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 727 | and mono: "(\<forall>y\<in>s. f y \<le> f x) \<or> (\<forall>y\<in>s. f x \<le> f y)" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 728 | shows "f' = (\<lambda>v. 0)" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 729 | proof - | 
| 44123 | 730 | obtain e where e:"e>0" "ball x e \<subseteq> s" | 
| 731 | using `open s`[unfolded open_contains_ball] and `x \<in> s` by auto | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 732 | with differential_zero_maxmin_component[where 'b=real, of 0 e x f, simplified] | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 733 | have "(\<chi>\<chi> j. frechet_derivative f (at x) (basis j)) = (0::'a)" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 734 | unfolding differentiable_def using mono deriv by auto | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 735 | with frechet_derivative_at[OF deriv, symmetric] | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 736 |   have "\<forall>i<DIM('a). f' (basis i) = 0"
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 737 | by (simp add: euclidean_eq[of _ "0::'a"]) | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 738 | with derivative_is_linear[OF deriv, THEN linear_componentwise, of _ 0] | 
| 39302 
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
 nipkow parents: 
39198diff
changeset | 739 | show ?thesis by (simp add: fun_eq_iff) | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 740 | qed | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 741 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 742 | lemma rolle: fixes f::"real\<Rightarrow>real" | 
| 44123 | 743 |   assumes "a < b" and "f a = f b" and "continuous_on {a..b} f"
 | 
| 744 |   assumes "\<forall>x\<in>{a<..<b}. (f has_derivative f'(x)) (at x)"
 | |
| 745 |   shows "\<exists>x\<in>{a<..<b}. f' x = (\<lambda>v. 0)"
 | |
| 746 | proof- | |
| 747 |   have "\<exists>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))"
 | |
| 748 | proof- | |
| 749 |     have "(a + b) / 2 \<in> {a .. b}" using assms(1) by auto
 | |
| 750 |     hence *:"{a .. b}\<noteq>{}" by auto
 | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 751 | guess d using continuous_attains_sup[OF compact_interval * assms(3)] .. note d=this | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 752 | guess c using continuous_attains_inf[OF compact_interval * assms(3)] .. note c=this | 
| 44123 | 753 | show ?thesis | 
| 754 |     proof(cases "d\<in>{a<..<b} \<or> c\<in>{a<..<b}")
 | |
| 755 | case True thus ?thesis | |
| 756 | apply(erule_tac disjE) apply(rule_tac x=d in bexI) | |
| 757 | apply(rule_tac[3] x=c in bexI) | |
| 758 | using d c by auto | |
| 759 | next | |
| 760 | def e \<equiv> "(a + b) /2" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 761 | case False hence "f d = f c" using d c assms(2) by auto | 
| 44123 | 762 |       hence "\<And>x. x\<in>{a..b} \<Longrightarrow> f x = f d"
 | 
| 763 | using c d apply- apply(erule_tac x=x in ballE)+ by auto | |
| 764 | thus ?thesis | |
| 765 | apply(rule_tac x=e in bexI) unfolding e_def using assms(1) by auto | |
| 766 | qed | |
| 767 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 768 | then guess x .. note x=this | 
| 44123 | 769 | hence "f' x = (\<lambda>v. 0)" | 
| 770 |     apply(rule_tac differential_zero_maxmin[of x "{a<..<b}" f "f' x"])
 | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 771 | defer apply(rule open_interval) | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 772 | apply(rule assms(4)[unfolded has_derivative_at[THEN sym],THEN bspec[where x=x]],assumption) | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 773 | unfolding o_def apply(erule disjE,rule disjI2) by auto | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 774 | thus ?thesis apply(rule_tac x=x in bexI) unfolding o_def apply rule | 
| 44123 | 775 | apply(drule_tac x=v in fun_cong) using x(1) by auto | 
| 776 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 777 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 778 | subsection {* One-dimensional mean value theorem. *}
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 779 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 780 | lemma mvt: fixes f::"real \<Rightarrow> real" | 
| 44123 | 781 |   assumes "a < b" and "continuous_on {a .. b} f"
 | 
| 782 |   assumes "\<forall>x\<in>{a<..<b}. (f has_derivative (f' x)) (at x)"
 | |
| 783 |   shows "\<exists>x\<in>{a<..<b}. (f b - f a = (f' x) (b - a))"
 | |
| 784 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 785 |   have "\<exists>x\<in>{a<..<b}. (\<lambda>xa. f' x xa - (f b - f a) / (b - a) * xa) = (\<lambda>v. 0)"
 | 
| 44123 | 786 | apply(rule rolle[OF assms(1), of "\<lambda>x. f x - (f b - f a) / (b - a) * x"]) | 
| 787 | defer | |
| 788 | apply(rule continuous_on_intros assms(2) continuous_on_cmul[where 'b=real, unfolded real_scaleR_def])+ | |
| 789 | proof | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 790 |     fix x assume x:"x \<in> {a<..<b}"
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 791 | show "((\<lambda>x. f x - (f b - f a) / (b - a) * x) has_derivative (\<lambda>xa. f' x xa - (f b - f a) / (b - a) * xa)) (at x)" | 
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 792 | by (intro has_derivative_intros assms(3)[rule_format,OF x] | 
| 44282 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 793 | mult_right_has_derivative) | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 794 | qed(insert assms(1), auto simp add:field_simps) | 
| 44123 | 795 | then guess x .. | 
| 796 | thus ?thesis apply(rule_tac x=x in bexI) | |
| 797 | apply(drule fun_cong[of _ _ "b - a"]) by auto | |
| 798 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 799 | |
| 44123 | 800 | lemma mvt_simple: | 
| 801 | fixes f::"real \<Rightarrow> real" | |
| 802 |   assumes "a<b" 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 | 803 |   shows "\<exists>x\<in>{a<..<b}. f b - f a = f' x (b - a)"
 | 
| 44123 | 804 | apply(rule mvt) | 
| 805 | apply(rule assms(1), rule differentiable_imp_continuous_on) | |
| 806 | unfolding differentiable_on_def differentiable_def defer | |
| 807 | proof | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 808 |   fix x assume x:"x \<in> {a<..<b}" show "(f has_derivative f' x) (at x)"
 | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 809 | unfolding has_derivative_within_open[OF x open_interval,THEN sym] | 
| 44123 | 810 | apply(rule has_derivative_within_subset) | 
| 811 | apply(rule assms(2)[rule_format]) | |
| 812 | using x by auto | |
| 813 | 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 | 814 | |
| 44123 | 815 | lemma mvt_very_simple: | 
| 816 | fixes f::"real \<Rightarrow> real" | |
| 817 |   assumes "a \<le> b" and "\<forall>x\<in>{a..b}. (f has_derivative f'(x)) (at x within {a..b})"
 | |
| 818 |   shows "\<exists>x\<in>{a..b}. f b - f a = f' x (b - a)"
 | |
| 819 | proof (cases "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 | 820 | interpret bounded_linear "f' b" using assms(2) assms(1) by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 821 | case True thus ?thesis apply(rule_tac x=a in bexI) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 822 | using assms(2)[THEN bspec[where x=a]] unfolding has_derivative_def | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 823 | unfolding True using zero by auto next | 
| 44123 | 824 | case False thus ?thesis using mvt_simple[OF _ assms(2)] using assms(1) by auto | 
| 825 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 826 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 827 | 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 | 828 | |
| 44123 | 829 | lemma mvt_general: | 
| 830 | fixes f::"real\<Rightarrow>'a::euclidean_space" | |
| 831 |   assumes "a<b" and "continuous_on {a..b} f"
 | |
| 832 |   assumes "\<forall>x\<in>{a<..<b}. (f has_derivative f'(x)) (at x)"
 | |
| 833 |   shows "\<exists>x\<in>{a<..<b}. norm(f b - f a) \<le> norm(f'(x) (b - a))"
 | |
| 834 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 835 |   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)"
 | 
| 44123 | 836 | apply(rule mvt) apply(rule assms(1)) | 
| 837 | apply(rule continuous_on_inner continuous_on_intros assms(2))+ | |
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 838 | unfolding o_def apply(rule,rule has_derivative_intros) | 
| 44123 | 839 | using assms(3) 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 | 840 | then guess x .. note x=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 841 | show ?thesis proof(cases "f a = f b") | 
| 36844 | 842 | case False | 
| 44123 | 843 | have "norm (f b - f a) * norm (f b - f a) = norm (f b - f a)^2" | 
| 844 | by (simp add: power2_eq_square) | |
| 35542 | 845 | also have "\<dots> = (f b - f a) \<bullet> (f b - f a)" unfolding power2_norm_eq_inner .. | 
| 44123 | 846 | also have "\<dots> = (f b - f a) \<bullet> f' x (b - a)" | 
| 847 | using x unfolding inner_simps by (auto simp add: inner_diff_left) | |
| 848 | also have "\<dots> \<le> norm (f b - f a) * norm (f' x (b - a))" | |
| 849 | by (rule norm_cauchy_schwarz) | |
| 850 | finally show ?thesis using False x(1) | |
| 851 | by (auto simp add: real_mult_left_cancel) | |
| 852 | next | |
| 853 | case True thus ?thesis using assms(1) | |
| 854 | apply (rule_tac x="(a + b) /2" in bexI) by auto | |
| 855 | qed | |
| 856 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 857 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 858 | 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 | 859 | |
| 44123 | 860 | lemma differentiable_bound: | 
| 861 | fixes f::"'a::euclidean_space \<Rightarrow> 'b::euclidean_space" | |
| 862 | assumes "convex s" and "\<forall>x\<in>s. (f has_derivative f'(x)) (at x within s)" | |
| 863 | assumes "\<forall>x\<in>s. onorm(f' x) \<le> B" and x:"x\<in>s" and y:"y\<in>s" | |
| 864 | shows "norm(f x - f y) \<le> B * norm(x - y)" | |
| 865 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 866 | let ?p = "\<lambda>u. x + u *\<^sub>R (y - x)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 867 |   have *:"\<And>u. u\<in>{0..1} \<Longrightarrow> x + u *\<^sub>R (y - x) \<in> s"
 | 
| 44123 | 868 | using assms(1)[unfolded convex_alt,rule_format,OF x y] | 
| 869 | unfolding scaleR_left_diff_distrib scaleR_right_diff_distrib | |
| 870 | by (auto simp add: algebra_simps) | |
| 871 |   hence 1:"continuous_on {0..1} (f \<circ> ?p)" apply-
 | |
| 872 | apply(rule continuous_on_intros continuous_on_vmul)+ | |
| 873 | unfolding continuous_on_eq_continuous_within | |
| 874 | apply(rule,rule differentiable_imp_continuous_within) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 875 | unfolding differentiable_def apply(rule_tac x="f' xa" in exI) | 
| 44123 | 876 | apply(rule has_derivative_within_subset) | 
| 877 | apply(rule assms(2)[rule_format]) by auto | |
| 878 |   have 2:"\<forall>u\<in>{0<..<1}. ((f \<circ> ?p) has_derivative f' (x + u *\<^sub>R (y - x)) \<circ> (\<lambda>u. 0 + u *\<^sub>R (y - x))) (at u)"
 | |
| 879 | proof rule | |
| 880 | 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 | 881 | let ?u = "x + u *\<^sub>R (y - x)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 882 |     have "(f \<circ> ?p has_derivative (f' ?u) \<circ> (\<lambda>u. 0 + u *\<^sub>R (y - x))) (at u within {0<..<1})" 
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 883 | apply(rule diff_chain_within) apply(rule has_derivative_intros)+ | 
| 44123 | 884 | apply(rule has_derivative_within_subset) | 
| 885 | apply(rule assms(2)[rule_format]) using goal1 * by auto | |
| 886 | thus ?case | |
| 887 | unfolding has_derivative_within_open[OF goal1 open_interval] by auto | |
| 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 | guess u using mvt_general[OF zero_less_one 1 2] .. note u = this | 
| 44123 | 890 | have **:"\<And>x y. x\<in>s \<Longrightarrow> norm (f' x y) \<le> B * norm y" | 
| 891 | proof- | |
| 892 | 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 | 893 | have "norm (f' x y) \<le> onorm (f' x) * norm y" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 894 | using onorm(1)[OF derivative_is_linear[OF assms(2)[rule_format,OF goal1]]] by assumption | 
| 44123 | 895 | also have "\<dots> \<le> B * norm y" | 
| 896 | apply(rule mult_right_mono) | |
| 897 | using assms(3)[rule_format,OF goal1] | |
| 898 | by(auto simp add:field_simps) | |
| 899 | finally show ?case by simp | |
| 900 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 901 | 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)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 902 | by(auto simp add:norm_minus_commute) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 903 | also have "\<dots> \<le> norm (f' (x + u *\<^sub>R (y - x)) (y - x))" using u by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 904 | also have "\<dots> \<le> B * norm(y - x)" apply(rule **) using * and u by auto | 
| 44123 | 905 | finally show ?thesis by(auto simp add:norm_minus_commute) | 
| 906 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 907 | |
| 44123 | 908 | lemma differentiable_bound_real: | 
| 909 | fixes f::"real \<Rightarrow> real" | |
| 910 | assumes "convex s" and "\<forall>x\<in>s. (f has_derivative f' x) (at x within s)" | |
| 911 | assumes "\<forall>x\<in>s. onorm(f' x) \<le> B" and x:"x\<in>s" and y:"y\<in>s" | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 912 | shows "norm(f x - f y) \<le> B * norm(x - y)" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 913 | using differentiable_bound[of s f f' B x y] | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 914 | unfolding Ball_def image_iff o_def using assms by auto | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 915 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 916 | 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 | 917 | |
| 44123 | 918 | lemma has_derivative_zero_constant: | 
| 919 | fixes f::"real\<Rightarrow>real" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 920 | assumes "convex s" "\<forall>x\<in>s. (f has_derivative (\<lambda>h. 0)) (at x within s)" | 
| 44123 | 921 | shows "\<exists>c. \<forall>x\<in>s. f x = c" | 
| 922 | proof(cases "s={}")
 | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 923 | case False then obtain x where "x\<in>s" by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 924 | have "\<And>y. y\<in>s \<Longrightarrow> f x = f y" proof- case goal1 | 
| 44123 | 925 | thus ?case | 
| 926 | using differentiable_bound_real[OF assms(1-2), of 0 x y] and `x\<in>s` | |
| 927 | unfolding onorm_const by auto qed | |
| 928 | thus ?thesis apply(rule_tac x="f x" in exI) by auto | |
| 929 | 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 | 930 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 931 | lemma has_derivative_zero_unique: fixes f::"real\<Rightarrow>real" | 
| 44123 | 932 | assumes "convex s" and "a \<in> s" and "f a = c" | 
| 933 | assumes "\<forall>x\<in>s. (f has_derivative (\<lambda>h. 0)) (at x within s)" and "x\<in>s" | |
| 934 | shows "f x = c" | |
| 935 | using has_derivative_zero_constant[OF assms(1,4)] using assms(2-3,5) 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 | 936 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 937 | subsection {* Differentiability of inverse function (most basic form). *}
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 938 | |
| 44123 | 939 | lemma has_derivative_inverse_basic: | 
| 940 | fixes f::"'b::euclidean_space \<Rightarrow> 'c::euclidean_space" | |
| 941 | assumes "(f has_derivative f') (at (g y))" | |
| 942 | assumes "bounded_linear g'" and "g' \<circ> f' = id" and "continuous (at y) g" | |
| 943 | assumes "open t" and "y \<in> t" and "\<forall>z\<in>t. f(g z) = z" | |
| 944 | shows "(g has_derivative g') (at y)" | |
| 945 | proof- | |
| 946 | interpret f': bounded_linear f' | |
| 947 | using assms unfolding has_derivative_def 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 | 948 | interpret g': bounded_linear g' using assms by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 949 | guess C using bounded_linear.pos_bounded[OF assms(2)] .. note C = this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 950 | (* have fgid:"\<And>x. g' (f' x) = x" using assms(3) unfolding o_def id_def apply()*) | 
| 44123 | 951 | have lem1:"\<forall>e>0. \<exists>d>0. \<forall>z. norm(z - y) < d \<longrightarrow> norm(g z - g y - g'(z - y)) \<le> e * norm(g z - g y)" | 
| 952 | proof(rule,rule) | |
| 953 | 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 | 954 | have *:"e / C > 0" apply(rule divide_pos_pos) using `e>0` C by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 955 | guess d0 using assms(1)[unfolded has_derivative_at_alt,THEN conjunct2,rule_format,OF *] .. note d0=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 956 | guess d1 using assms(4)[unfolded continuous_at Lim_at,rule_format,OF d0[THEN conjunct1]] .. note d1=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 957 | guess d2 using assms(5)[unfolded open_dist,rule_format,OF assms(6)] .. note d2=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 958 | guess d using real_lbound_gt_zero[OF d1[THEN conjunct1] d2[THEN conjunct1]] .. note d=this | 
| 44123 | 959 | thus ?case apply(rule_tac x=d in exI) apply rule defer | 
| 960 | proof(rule,rule) | |
| 961 | fix z assume as:"norm (z - y) < d" hence "z\<in>t" | |
| 962 | 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 | 963 | have "norm (g z - g y - g' (z - y)) \<le> norm (g' (f (g z) - y - f' (g z - g y)))" | 
| 44123 | 964 | unfolding g'.diff f'.diff | 
| 965 | unfolding assms(3)[unfolded o_def id_def, THEN fun_cong] | |
| 966 | unfolding assms(7)[rule_format,OF `z\<in>t`] | |
| 967 | apply(subst norm_minus_cancel[THEN sym]) by auto | |
| 968 | also have "\<dots> \<le> norm(f (g z) - y - f' (g z - g y)) * C" | |
| 969 | by (rule C [THEN conjunct2, rule_format]) | |
| 970 | also have "\<dots> \<le> (e / C) * norm (g z - g y) * C" | |
| 971 | apply(rule mult_right_mono) | |
| 972 | apply(rule d0[THEN conjunct2,rule_format,unfolded assms(7)[rule_format,OF `y\<in>t`]]) | |
| 973 | apply(cases "z=y") defer | |
| 974 | apply(rule d1[THEN conjunct2, unfolded dist_norm,rule_format]) | |
| 975 | using as d C d0 by auto | |
| 976 | also have "\<dots> \<le> e * norm (g z - g y)" | |
| 977 | using C by (auto simp add: field_simps) | |
| 978 | finally show "norm (g z - g y - g' (z - y)) \<le> e * norm (g z - g y)" | |
| 979 | by simp | |
| 980 | qed auto | |
| 981 | qed | |
| 982 | have *:"(0::real) < 1 / 2" by auto | |
| 983 | guess d using lem1[rule_format,OF *] .. note d=this | |
| 984 | def B\<equiv>"C*2" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 985 | have "B>0" unfolding B_def using C by auto | 
| 44123 | 986 | have lem2:"\<forall>z. norm(z - y) < d \<longrightarrow> norm(g z - g y) \<le> B * norm(z - y)" | 
| 987 | proof(rule,rule) case goal1 | |
| 988 | have "norm (g z - g y) \<le> norm(g' (z - y)) + norm ((g z - g y) - g'(z - y))" | |
| 989 | by(rule norm_triangle_sub) | |
| 990 | also have "\<dots> \<le> norm(g' (z - y)) + 1 / 2 * norm (g z - g y)" | |
| 991 | apply(rule add_left_mono) using d and goal1 by auto | |
| 992 | also have "\<dots> \<le> norm (z - y) * C + 1 / 2 * norm (g z - g y)" | |
| 993 | apply(rule add_right_mono) using C by auto | |
| 994 | finally show ?case unfolding B_def by(auto simp add:field_simps) | |
| 995 | qed | |
| 996 | show ?thesis unfolding has_derivative_at_alt | |
| 997 | proof(rule,rule assms,rule,rule) 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 | 998 | hence *:"e/B >0" apply-apply(rule divide_pos_pos) using `B>0` by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 999 | guess d' using lem1[rule_format,OF *] .. note d'=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1000 | guess k using real_lbound_gt_zero[OF d[THEN conjunct1] d'[THEN conjunct1]] .. note k=this | 
| 44123 | 1001 | show ?case | 
| 1002 | apply(rule_tac x=k in exI,rule) defer | |
| 1003 | proof(rule,rule) | |
| 1004 | fix z assume as:"norm(z - y) < k" | |
| 1005 | hence "norm (g z - g y - g' (z - y)) \<le> e / B * norm(g z - g y)" | |
| 1006 | using d' k by auto | |
| 1007 | also have "\<dots> \<le> e * norm(z - y)" | |
| 1008 | unfolding times_divide_eq_left pos_divide_le_eq[OF `B>0`] | |
| 1009 | using lem2[THEN spec[where x=z]] using k as using `e>0` | |
| 1010 | by (auto simp add: field_simps) | |
| 1011 | finally show "norm (g z - g y - g' (z - y)) \<le> e * norm (z - y)" | |
| 1012 | by simp qed(insert k, auto) | |
| 1013 | qed | |
| 1014 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1015 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 1016 | 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 | 1017 | |
| 44123 | 1018 | lemma has_derivative_inverse_basic_x: | 
| 1019 | fixes f::"'b::euclidean_space \<Rightarrow> 'c::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 | 1020 | assumes "(f has_derivative f') (at x)" "bounded_linear g'" "g' o f' = id" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1021 | "continuous (at (f x)) g" "g(f x) = x" "open t" "f x \<in> t" "\<forall>y\<in>t. f(g y) = y" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1022 | shows "(g has_derivative g') (at (f(x)))" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1023 | apply(rule has_derivative_inverse_basic) using assms by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1024 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 1025 | 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 | 1026 | |
| 44123 | 1027 | lemma has_derivative_inverse_dieudonne: | 
| 1028 | fixes f::"'a::euclidean_space \<Rightarrow> 'b::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 | 1029 | assumes "open s" "open (f ` s)" "continuous_on s f" "continuous_on (f ` s) g" "\<forall>x\<in>s. g(f x) = x" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1030 | (**) "x\<in>s" "(f has_derivative f') (at x)" "bounded_linear g'" "g' o f' = id" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1031 | shows "(g has_derivative g') (at (f x))" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1032 | apply(rule has_derivative_inverse_basic_x[OF assms(7-9) _ _ assms(2)]) | 
| 44123 | 1033 | using assms(3-6) unfolding continuous_on_eq_continuous_at[OF assms(1)] | 
| 1034 | continuous_on_eq_continuous_at[OF assms(2)] 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 | 1035 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 1036 | 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 | 1037 | |
| 44123 | 1038 | lemma has_derivative_inverse: | 
| 1039 | fixes f::"'a::euclidean_space \<Rightarrow> 'b::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 | 1040 | assumes "compact s" "x \<in> s" "f x \<in> interior(f ` s)" "continuous_on s f" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1041 | "\<forall>y\<in>s. g(f y) = y" "(f has_derivative f') (at x)" "bounded_linear g'" "g' \<circ> f' = id" | 
| 44123 | 1042 | shows "(g has_derivative g') (at (f x))" | 
| 1043 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1044 |   { fix y assume "y\<in>interior (f ` s)" 
 | 
| 44123 | 1045 | then obtain x where "x\<in>s" and *:"y = f x" | 
| 1046 | unfolding image_iff using interior_subset by auto | |
| 1047 | have "f (g y) = y" unfolding * and assms(5)[rule_format,OF `x\<in>s`] .. | |
| 1048 | } note * = this | |
| 1049 | show ?thesis | |
| 1050 | apply(rule has_derivative_inverse_basic_x[OF assms(6-8)]) | |
| 1051 | apply(rule continuous_on_interior[OF _ assms(3)]) | |
| 1052 | apply(rule continuous_on_inverse[OF assms(4,1)]) | |
| 1053 | apply(rule assms(2,5) assms(5)[rule_format] open_interior assms(3))+ | |
| 1054 | by(rule, rule *, assumption) | |
| 1055 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1056 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1057 | subsection {* Proving surjectivity via Brouwer fixpoint theorem. *}
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1058 | |
| 44123 | 1059 | lemma brouwer_surjective: | 
| 1060 | fixes f::"'n::ordered_euclidean_space \<Rightarrow> 'n" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1061 |   assumes "compact t" "convex t"  "t \<noteq> {}" "continuous_on t f"
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1062 | "\<forall>x\<in>s. \<forall>y\<in>t. x + (y - f y) \<in> t" "x\<in>s" | 
| 44123 | 1063 | shows "\<exists>y\<in>t. f y = x" | 
| 1064 | proof- | |
| 1065 | have *:"\<And>x y. f y = x \<longleftrightarrow> x + (y - f y) = y" | |
| 1066 | by(auto simp add:algebra_simps) | |
| 1067 | show ?thesis | |
| 1068 | unfolding * | |
| 1069 | apply(rule brouwer[OF assms(1-3), of "\<lambda>y. x + (y - f y)"]) | |
| 1070 | apply(rule continuous_on_intros assms)+ using assms(4-6) by auto | |
| 1071 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1072 | |
| 44123 | 1073 | lemma brouwer_surjective_cball: | 
| 1074 | fixes f::"'n::ordered_euclidean_space \<Rightarrow> 'n" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1075 | assumes "0 < e" "continuous_on (cball a e) f" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1076 | "\<forall>x\<in>s. \<forall>y\<in>cball a e. x + (y - f y) \<in> cball a e" "x\<in>s" | 
| 44123 | 1077 | shows "\<exists>y\<in>cball a e. f y = x" | 
| 1078 | apply(rule brouwer_surjective) | |
| 1079 | apply(rule compact_cball convex_cball)+ | |
| 1080 | unfolding cball_eq_empty 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 | 1081 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1082 | 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 | 1083 | |
| 44123 | 1084 | lemma sussmann_open_mapping: | 
| 1085 | fixes f::"'a::euclidean_space \<Rightarrow> 'b::ordered_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 | 1086 | assumes "open s" "continuous_on s f" "x \<in> s" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1087 | "(f has_derivative f') (at x)" "bounded_linear g'" "f' \<circ> g' = id" | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1088 | "t \<subseteq> s" "x \<in> interior t" | 
| 44123 | 1089 | shows "f x \<in> interior (f ` t)" | 
| 1090 | proof- | |
| 1091 | interpret f':bounded_linear f' | |
| 1092 | using assms unfolding has_derivative_def 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 | 1093 | interpret g':bounded_linear g' using assms by auto | 
| 44123 | 1094 | guess B using bounded_linear.pos_bounded[OF assms(5)] .. note B=this | 
| 1095 | hence *:"1/(2*B)>0" by (auto intro!: divide_pos_pos) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1096 | guess e0 using assms(4)[unfolded has_derivative_at_alt,THEN conjunct2,rule_format,OF *] .. note e0=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1097 | guess e1 using assms(8)[unfolded mem_interior_cball] .. note e1=this | 
| 44123 | 1098 | have *:"0<e0/B" "0<e1/B" | 
| 1099 | apply(rule_tac[!] divide_pos_pos) using e0 e1 B 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 | 1100 | guess e using real_lbound_gt_zero[OF *] .. note e=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1101 | have "\<forall>z\<in>cball (f x) (e/2). \<exists>y\<in>cball (f x) e. f (x + g' (y - f x)) = z" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1102 | apply(rule,rule brouwer_surjective_cball[where s="cball (f x) (e/2)"]) | 
| 44123 | 1103 | prefer 3 apply(rule,rule) | 
| 1104 | proof- | |
| 1105 | show "continuous_on (cball (f x) e) (\<lambda>y. f (x + g' (y - f x)))" | |
| 1106 | unfolding g'.diff | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1107 | apply(rule continuous_on_compose[of _ _ f, unfolded o_def]) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1108 | apply(rule continuous_on_intros linear_continuous_on[OF assms(5)])+ | 
| 44123 | 1109 | apply(rule continuous_on_subset[OF assms(2)]) | 
| 1110 | apply(rule,unfold image_iff,erule bexE) | |
| 1111 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1112 | fix y z assume as:"y \<in>cball (f x) e" "z = x + (g' y - g' (f x))" | 
| 44123 | 1113 | have "dist x z = norm (g' (f x) - g' y)" | 
| 1114 | unfolding as(2) and dist_norm by auto | |
| 1115 | also have "\<dots> \<le> norm (f x - y) * B" | |
| 1116 | unfolding g'.diff[THEN sym] using B by auto | |
| 1117 | also have "\<dots> \<le> e * B" | |
| 1118 | using as(1)[unfolded mem_cball dist_norm] using B 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 | 1119 | also have "\<dots> \<le> e1" using e unfolding less_divide_eq using B by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1120 | finally have "z\<in>cball x e1" unfolding mem_cball by force | 
| 44123 | 1121 | thus "z \<in> s" using e1 assms(7) by auto | 
| 1122 | qed | |
| 1123 | next | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1124 | fix y z assume as:"y \<in> cball (f x) (e / 2)" "z \<in> cball (f x) e" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1125 | have "norm (g' (z - f x)) \<le> norm (z - f x) * B" using B by auto | 
| 44123 | 1126 | also have "\<dots> \<le> e * B" apply(rule mult_right_mono) | 
| 1127 | using as(2)[unfolded mem_cball dist_norm] and B | |
| 1128 | unfolding norm_minus_commute 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 | 1129 | also have "\<dots> < e0" using e and B unfolding less_divide_eq by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1130 | finally have *:"norm (x + g' (z - f x) - x) < e0" by auto | 
| 44123 | 1131 | have **:"f x + f' (x + g' (z - f x) - x) = z" | 
| 1132 | using assms(6)[unfolded o_def id_def,THEN cong] 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 | 1133 | have "norm (f x - (y + (z - f (x + g' (z - f x))))) \<le> norm (f (x + g' (z - f x)) - z) + norm (f x - y)" | 
| 44123 | 1134 | using norm_triangle_ineq[of "f (x + g'(z - f x)) - z" "f x - y"] | 
| 1135 | by (auto simp add: algebra_simps) | |
| 1136 | also have "\<dots> \<le> 1 / (B * 2) * norm (g' (z - f x)) + norm (f x - y)" | |
| 1137 | using e0[THEN conjunct2,rule_format,OF *] | |
| 1138 | unfolding algebra_simps ** by auto | |
| 1139 | also have "\<dots> \<le> 1 / (B * 2) * norm (g' (z - f x)) + e/2" | |
| 1140 | using as(1)[unfolded mem_cball dist_norm] by auto | |
| 1141 | also have "\<dots> \<le> 1 / (B * 2) * B * norm (z - f x) + e/2" | |
| 1142 | using * and B by (auto simp add: 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 | 1143 | also have "\<dots> \<le> 1 / 2 * norm (z - f x) + e/2" by auto | 
| 44123 | 1144 | also have "\<dots> \<le> e/2 + e/2" apply(rule add_right_mono) | 
| 1145 | using as(2)[unfolded mem_cball dist_norm] | |
| 1146 | unfolding norm_minus_commute by auto | |
| 1147 | finally show "y + (z - f (x + g' (z - f x))) \<in> cball (f x) e" | |
| 1148 | unfolding mem_cball 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 | 1149 | qed(insert e, auto) note lem = this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1150 | show ?thesis unfolding mem_interior apply(rule_tac x="e/2" in exI) | 
| 44123 | 1151 | apply(rule,rule divide_pos_pos) prefer 3 | 
| 1152 | proof | |
| 1153 | fix y assume "y \<in> ball (f x) (e/2)" | |
| 1154 | hence *:"y\<in>cball (f x) (e/2)" 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 | 1155 | guess z using lem[rule_format,OF *] .. note z=this | 
| 44123 | 1156 | hence "norm (g' (z - f x)) \<le> norm (z - f x) * B" | 
| 1157 | using B by (auto simp add: field_simps) | |
| 1158 | also have "\<dots> \<le> e * B" | |
| 1159 | apply (rule mult_right_mono) using z(1) | |
| 1160 | unfolding mem_cball dist_norm norm_minus_commute using B 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 | 1161 | also have "\<dots> \<le> e1" using e B unfolding less_divide_eq by auto | 
| 44123 | 1162 | finally have "x + g'(z - f x) \<in> t" apply- | 
| 1163 | apply(rule e1[THEN conjunct2,unfolded subset_eq,rule_format]) | |
| 36587 | 1164 | unfolding mem_cball dist_norm by auto | 
| 44123 | 1165 | thus "y \<in> f ` t" using z by auto | 
| 1166 | qed(insert e, auto) | |
| 1167 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1168 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1169 | text {* Hence the following eccentric variant of the inverse function theorem.    *)
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1170 | (* This has no continuity assumptions, but we do need the inverse function. *) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1171 | (* We could put f' o g = I but this happens to fit with the minimal linear *) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1172 | (* algebra theory I've set up so far. *} | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1173 | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1174 | (* 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: 
36844diff
changeset | 1175 | |
| 44123 | 1176 | lemma right_inverse_linear: | 
| 1177 | fixes f::"'a::euclidean_space => 'a" | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1178 | assumes lf: "linear f" and gf: "f o g = id" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1179 | shows "linear g" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1180 | proof- | 
| 40702 | 1181 | from gf have fi: "surj f" by (auto simp add: surj_def o_def id_def) metis | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1182 | from linear_surjective_isomorphism[OF lf fi] | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1183 | obtain h:: "'a => 'a" where | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1184 | h: "linear h" "\<forall>x. h (f x) = x" "\<forall>x. f (h x) = x" by blast | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1185 | have "h = g" apply (rule ext) using gf h(2,3) | 
| 40702 | 1186 | by (simp add: o_def id_def fun_eq_iff) metis | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1187 | with h(1) show ?thesis by blast | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1188 | qed | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1189 | |
| 44123 | 1190 | lemma has_derivative_inverse_strong: | 
| 1191 | fixes f::"'n::ordered_euclidean_space \<Rightarrow> 'n" | |
| 1192 | assumes "open s" and "x \<in> s" and "continuous_on s f" | |
| 1193 | assumes "\<forall>x\<in>s. g(f x) = x" "(f has_derivative f') (at x)" and "f' o g' = id" | |
| 1194 | shows "(g has_derivative g') (at (f x))" | |
| 1195 | proof- | |
| 1196 | have linf:"bounded_linear f'" | |
| 1197 | using assms(5) unfolding has_derivative_def by auto | |
| 1198 | hence ling:"bounded_linear g'" | |
| 1199 | unfolding linear_conv_bounded_linear[THEN sym] | |
| 1200 | apply- apply(rule right_inverse_linear) using assms(6) by auto | |
| 1201 | moreover have "g' \<circ> f' = id" using assms(6) linf ling | |
| 1202 | unfolding linear_conv_bounded_linear[THEN sym] | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1203 | using linear_inverse_left by auto | 
| 44123 | 1204 | moreover have *:"\<forall>t\<subseteq>s. x\<in>interior t \<longrightarrow> f x \<in> interior (f ` t)" | 
| 1205 | apply(rule,rule,rule,rule sussmann_open_mapping ) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1206 | apply(rule assms ling)+ by auto | 
| 44123 | 1207 | have "continuous (at (f x)) g" unfolding continuous_at Lim_at | 
| 1208 | proof(rule,rule) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1209 | fix e::real assume "e>0" | 
| 44123 | 1210 | hence "f x \<in> interior (f ` (ball x e \<inter> s))" | 
| 1211 | using *[rule_format,of "ball x e \<inter> s"] `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 | 1212 | by(auto simp add: interior_open[OF open_ball] interior_open[OF assms(1)]) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1213 | then guess d unfolding mem_interior .. note d=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1214 | 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" | 
| 44123 | 1215 | apply(rule_tac x=d in exI) | 
| 1216 | apply(rule,rule d[THEN conjunct1]) | |
| 1217 | proof(rule,rule) case goal1 | |
| 1218 | hence "g y \<in> g ` f ` (ball x e \<inter> s)" | |
| 1219 | using d[THEN conjunct2,unfolded subset_eq,THEN bspec[where x=y]] | |
| 41958 | 1220 | by(auto simp add:dist_commute) | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1221 | hence "g y \<in> ball x e \<inter> s" using assms(4) by auto | 
| 44123 | 1222 | thus "dist (g y) (g (f x)) < e" | 
| 1223 | using assms(4)[rule_format,OF `x\<in>s`] | |
| 1224 | by (auto simp add: dist_commute) | |
| 1225 | qed | |
| 1226 | qed | |
| 1227 | moreover have "f x \<in> interior (f ` s)" | |
| 1228 | apply(rule sussmann_open_mapping) | |
| 1229 | apply(rule assms ling)+ | |
| 1230 | using interior_open[OF assms(1)] and `x\<in>s` by auto | |
| 1231 | moreover have "\<And>y. y \<in> interior (f ` s) \<Longrightarrow> f (g y) = y" | |
| 1232 | proof- case goal1 | |
| 1233 | hence "y\<in>f ` s" using interior_subset by auto | |
| 1234 | then guess z unfolding image_iff .. | |
| 1235 | thus ?case using assms(4) by auto | |
| 1236 | qed | |
| 1237 | ultimately show ?thesis | |
| 1238 | apply- apply(rule has_derivative_inverse_basic_x[OF assms(5)]) | |
| 1239 | using assms by auto | |
| 1240 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1241 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 1242 | 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 | 1243 | |
| 44123 | 1244 | lemma has_derivative_inverse_strong_x: | 
| 1245 | fixes f::"'a::ordered_euclidean_space \<Rightarrow> 'a" | |
| 1246 | assumes "open s" and "g y \<in> s" and "continuous_on s f" | |
| 1247 | assumes "\<forall>x\<in>s. g(f x) = x" "(f has_derivative f') (at (g y))" | |
| 1248 | assumes "f' o g' = id" 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 | 1249 | shows "(g has_derivative g') (at y)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1250 | using has_derivative_inverse_strong[OF assms(1-6)] unfolding assms(7) by simp | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1251 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 1252 | 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 | 1253 | |
| 44123 | 1254 | lemma has_derivative_inverse_on: | 
| 1255 | fixes f::"'n::ordered_euclidean_space \<Rightarrow> 'n" | |
| 1256 | assumes "open s" and "\<forall>x\<in>s. (f has_derivative f'(x)) (at x)" | |
| 1257 | assumes "\<forall>x\<in>s. g(f x) = x" and "f'(x) o g'(x) = id" 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 | 1258 | shows "(g has_derivative g'(x)) (at (f x))" | 
| 44123 | 1259 | apply(rule has_derivative_inverse_strong[where g'="g' x" and f=f]) | 
| 1260 | 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 | 1261 | unfolding continuous_on_eq_continuous_at[OF assms(1)] | 
| 44123 | 1262 | apply(rule,rule differentiable_imp_continuous_at) | 
| 1263 | unfolding differentiable_def 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 | 1264 | |
| 44123 | 1265 | text {* Invertible derivative continous at a point implies local
 | 
| 1266 | injectivity. It's only for this we need continuity of the derivative, | |
| 1267 | except of course if we want the fact that the inverse derivative is | |
| 1268 | also continuous. So if we know for some other reason that the inverse | |
| 1269 | 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 | 1270 | |
| 44123 | 1271 | lemma bounded_linear_sub: | 
| 1272 | "bounded_linear f \<Longrightarrow> bounded_linear g ==> bounded_linear (\<lambda>x. f x - g x)" | |
| 1273 | using bounded_linear_add[of f "\<lambda>x. - g x"] bounded_linear_minus[of g] | |
| 1274 | 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 | 1275 | |
| 44123 | 1276 | lemma has_derivative_locally_injective: | 
| 1277 | fixes f::"'n::euclidean_space \<Rightarrow> 'm::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 | 1278 | assumes "a \<in> s" "open s" "bounded_linear g'" "g' o f'(a) = id" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1279 | "\<forall>x\<in>s. (f has_derivative f'(x)) (at x)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1280 | "\<forall>e>0. \<exists>d>0. \<forall>x. dist a x < d \<longrightarrow> onorm(\<lambda>v. f' x v - f' a v) < e" | 
| 44123 | 1281 | obtains t where "a \<in> t" "open t" "\<forall>x\<in>t. \<forall>x'\<in>t. (f x' = f x) \<longrightarrow> (x' = x)" | 
| 1282 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1283 | interpret bounded_linear g' using assms by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1284 | note f'g' = assms(4)[unfolded id_def o_def,THEN cong] | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1285 | have "g' (f' a (\<chi>\<chi> i.1)) = (\<chi>\<chi> i.1)" "(\<chi>\<chi> i.1) \<noteq> (0::'n)" defer | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1286 | apply(subst euclidean_eq) using f'g' by auto | 
| 44123 | 1287 | hence *:"0 < onorm g'" | 
| 1288 | unfolding onorm_pos_lt[OF assms(3)[unfolded linear_linear]] by fastsimp | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1289 | def k \<equiv> "1 / onorm g' / 2" have *:"k>0" unfolding k_def using * by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1290 | guess d1 using assms(6)[rule_format,OF *] .. note d1=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1291 | from `open s` obtain d2 where "d2>0" "ball a d2 \<subseteq> s" using `a\<in>s` .. | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1292 | obtain d2 where "d2>0" "ball a d2 \<subseteq> s" using assms(2,1) .. | 
| 44123 | 1293 | guess d2 using assms(2)[unfolded open_contains_ball,rule_format,OF `a\<in>s`] .. | 
| 1294 | note d2=this | |
| 1295 | guess d using real_lbound_gt_zero[OF d1[THEN conjunct1] d2[THEN conjunct1]] .. | |
| 1296 | note d = this | |
| 1297 | show ?thesis | |
| 1298 | proof | |
| 1299 | show "a\<in>ball a d" using d by auto | |
| 1300 | show "\<forall>x\<in>ball a d. \<forall>x'\<in>ball a d. f x' = f x \<longrightarrow> x' = x" | |
| 1301 | proof (intro strip) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1302 | fix x y assume as:"x\<in>ball a d" "y\<in>ball a d" "f x = f y" | 
| 44123 | 1303 | def ph \<equiv> "\<lambda>w. w - g'(f w - f x)" | 
| 1304 | have ph':"ph = g' \<circ> (\<lambda>w. f' a w - (f w - f x))" | |
| 1305 | unfolding ph_def o_def unfolding diff using f'g' | |
| 1306 | 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 | 1307 | have "norm (ph x - ph y) \<le> (1/2) * norm (x - y)" | 
| 41958 | 1308 | apply(rule differentiable_bound[OF convex_ball _ _ as(1-2), where f'="\<lambda>x v. v - g'(f' x v)"]) | 
| 44123 | 1309 | apply(rule_tac[!] ballI) | 
| 1310 | proof- | |
| 1311 | fix u assume u:"u \<in> ball a d" | |
| 1312 | hence "u\<in>s" using d d2 by auto | |
| 1313 | have *:"(\<lambda>v. v - g' (f' u v)) = g' \<circ> (\<lambda>w. f' a w - f' u w)" | |
| 1314 | unfolding o_def and diff using f'g' by auto | |
| 41958 | 1315 | show "(ph has_derivative (\<lambda>v. v - g' (f' u v))) (at u within ball a d)" | 
| 44123 | 1316 | unfolding ph' * apply(rule diff_chain_within) defer | 
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 1317 | apply(rule bounded_linear.has_derivative'[OF assms(3)]) | 
| 44123 | 1318 | apply(rule has_derivative_intros) defer | 
| 1319 | apply(rule has_derivative_sub[where g'="\<lambda>x.0",unfolded diff_0_right]) | |
| 1320 | apply(rule has_derivative_at_within) | |
| 1321 | using assms(5) and `u\<in>s` `a\<in>s` | |
| 44140 
2c10c35dd4be
remove several redundant and unused theorems about derivatives
 huffman parents: 
44137diff
changeset | 1322 | by(auto intro!: has_derivative_intros bounded_linear.has_derivative' derivative_linear) | 
| 44123 | 1323 | have **:"bounded_linear (\<lambda>x. f' u x - f' a x)" | 
| 1324 | "bounded_linear (\<lambda>x. f' a x - f' u x)" | |
| 1325 | apply(rule_tac[!] bounded_linear_sub) | |
| 1326 | apply(rule_tac[!] derivative_linear) | |
| 1327 | using assms(5) `u\<in>s` `a\<in>s` by auto | |
| 1328 | have "onorm (\<lambda>v. v - g' (f' u v)) \<le> onorm g' * onorm (\<lambda>w. f' a w - f' u w)" | |
| 1329 | unfolding * apply(rule onorm_compose) | |
| 1330 | unfolding linear_conv_bounded_linear by(rule assms(3) **)+ | |
| 1331 | also have "\<dots> \<le> onorm g' * k" | |
| 1332 | apply(rule mult_left_mono) | |
| 1333 | using d1[THEN conjunct2,rule_format,of u] | |
| 1334 | using onorm_neg[OF **(1)[unfolded linear_linear]] | |
| 1335 | using d and u and onorm_pos_le[OF assms(3)[unfolded linear_linear]] | |
| 1336 | by (auto simp add: algebra_simps) | |
| 41958 | 1337 | also have "\<dots> \<le> 1/2" unfolding k_def by auto | 
| 44123 | 1338 | finally show "onorm (\<lambda>v. v - g' (f' u v)) \<le> 1 / 2" by assumption | 
| 1339 | qed | |
| 1340 | moreover have "norm (ph y - ph x) = norm (y - x)" | |
| 1341 | apply(rule arg_cong[where f=norm]) | |
| 41958 | 1342 | unfolding ph_def using diff unfolding as by auto | 
| 44123 | 1343 | ultimately show "x = y" unfolding norm_minus_commute by auto | 
| 1344 | qed | |
| 1345 | qed auto | |
| 1346 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1347 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1348 | subsection {* Uniformly convergent sequence of derivatives. *}
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1349 | |
| 44123 | 1350 | lemma has_derivative_sequence_lipschitz_lemma: | 
| 1351 | fixes f::"nat \<Rightarrow> 'm::euclidean_space \<Rightarrow> 'n::euclidean_space" | |
| 1352 | assumes "convex s" | |
| 1353 | assumes "\<forall>n. \<forall>x\<in>s. ((f n) has_derivative (f' n x)) (at x within s)" | |
| 1354 | assumes "\<forall>n\<ge>N. \<forall>x\<in>s. \<forall>h. norm(f' n x h - g' x h) \<le> e * norm(h)" | |
| 1355 | 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)" | |
| 1356 | proof (default)+ | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1357 | fix m n x y assume as:"N\<le>m" "N\<le>n" "x\<in>s" "y\<in>s" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1358 | show "norm((f m x - f n x) - (f m y - f n y)) \<le> 2 * e * norm(x - y)" | 
| 44123 | 1359 | apply(rule differentiable_bound[where f'="\<lambda>x h. f' m x h - f' n x h", OF assms(1) _ _ as(3-4)]) | 
| 1360 | apply(rule_tac[!] ballI) | |
| 1361 | proof- | |
| 1362 | fix x assume "x\<in>s" | |
| 1363 | 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)" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1364 | by(rule has_derivative_intros assms(2)[rule_format] `x\<in>s`)+ | 
| 44123 | 1365 |     { fix h
 | 
| 1366 | 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)" | |
| 1367 | using norm_triangle_ineq[of "f' m x h - g' x h" "- f' n x h + g' x h"] | |
| 1368 | unfolding norm_minus_commute by (auto simp add: algebra_simps) | |
| 1369 | also have "\<dots> \<le> e * norm h+ e * norm h" | |
| 1370 | using assms(3)[rule_format,OF `N\<le>m` `x\<in>s`, of h] | |
| 1371 | using assms(3)[rule_format,OF `N\<le>n` `x\<in>s`, of h] | |
| 41958 | 1372 | by(auto simp add: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 | 1373 | finally have "norm (f' m x h - f' n x h) \<le> 2 * e * norm h" by auto } | 
| 44123 | 1374 | thus "onorm (\<lambda>h. f' m x h - f' n x h) \<le> 2 * e" | 
| 1375 | apply-apply(rule onorm(2)) apply(rule linear_compose_sub) | |
| 1376 | unfolding linear_conv_bounded_linear | |
| 1377 | using assms(2)[rule_format,OF `x\<in>s`, THEN derivative_linear] | |
| 1378 | by auto | |
| 1379 | qed | |
| 1380 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1381 | |
| 44123 | 1382 | lemma has_derivative_sequence_lipschitz: | 
| 1383 | fixes f::"nat \<Rightarrow> 'm::euclidean_space \<Rightarrow> 'n::euclidean_space" | |
| 1384 | assumes "convex s" | |
| 1385 | assumes "\<forall>n. \<forall>x\<in>s. ((f n) has_derivative (f' n x)) (at x within s)" | |
| 1386 | assumes "\<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)" | |
| 1387 | assumes "0 < e" | |
| 1388 | shows "\<forall>e>0. \<exists>N. \<forall>m\<ge>N. \<forall>n\<ge>N. \<forall>x\<in>s. \<forall>y\<in>s. norm((f m x - f n x) - (f m y - f n y)) \<le> e * norm(x - y)" | |
| 1389 | proof(rule,rule) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1390 | case goal1 have *:"2 * (1/2* e) = e" "1/2 * e >0" using `e>0` by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1391 | guess N using assms(3)[rule_format,OF *(2)] .. | 
| 44123 | 1392 | thus ?case | 
| 1393 | apply(rule_tac x=N in exI) | |
| 1394 | apply(rule has_derivative_sequence_lipschitz_lemma[where e="1/2 *e", unfolded *]) | |
| 1395 | using assms by auto | |
| 1396 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1397 | |
| 44123 | 1398 | lemma has_derivative_sequence: | 
| 1399 | fixes f::"nat\<Rightarrow> 'm::euclidean_space \<Rightarrow> 'n::euclidean_space" | |
| 1400 | assumes "convex s" | |
| 1401 | assumes "\<forall>n. \<forall>x\<in>s. ((f n) has_derivative (f' n x)) (at x within s)" | |
| 1402 | assumes "\<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)" | |
| 1403 | assumes "x0 \<in> s" and "((\<lambda>n. f n x0) ---> l) sequentially" | |
| 1404 | shows "\<exists>g. \<forall>x\<in>s. ((\<lambda>n. f n x) ---> g x) sequentially \<and> | |
| 1405 | (g has_derivative g'(x)) (at x within s)" | |
| 1406 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1407 | have lem1:"\<forall>e>0. \<exists>N. \<forall>m\<ge>N. \<forall>n\<ge>N. \<forall>x\<in>s. \<forall>y\<in>s. norm((f m x - f n x) - (f m y - f n y)) \<le> e * norm(x - y)" | 
| 44123 | 1408 | apply(rule has_derivative_sequence_lipschitz[where e="42::nat"]) | 
| 1409 | apply(rule assms)+ by auto | |
| 1410 | have "\<exists>g. \<forall>x\<in>s. ((\<lambda>n. f n x) ---> g x) sequentially" | |
| 1411 | apply(rule bchoice) unfolding convergent_eq_cauchy | |
| 1412 | proof | |
| 1413 | fix x assume "x\<in>s" show "Cauchy (\<lambda>n. f n x)" | |
| 1414 | proof(cases "x=x0") | |
| 1415 | case True thus ?thesis using convergent_imp_cauchy[OF assms(5)] by auto | |
| 1416 | next | |
| 1417 | case False show ?thesis unfolding Cauchy_def | |
| 1418 | proof(rule,rule) | |
| 1419 | fix e::real assume "e>0" | |
| 1420 | hence *:"e/2>0" "e/2/norm(x-x0)>0" | |
| 1421 | using False by (auto intro!: divide_pos_pos) | |
| 41958 | 1422 | guess M using convergent_imp_cauchy[OF assms(5), unfolded Cauchy_def, rule_format,OF *(1)] .. note M=this | 
| 1423 | guess N using lem1[rule_format,OF *(2)] .. note N = this | |
| 44123 | 1424 | show "\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (f m x) (f n x) < e" | 
| 1425 | apply(rule_tac x="max M N" in exI) | |
| 1426 | proof(default+) | |
| 41958 | 1427 | fix m n assume as:"max M N \<le>m" "max M N\<le>n" | 
| 1428 | have "dist (f m x) (f n x) \<le> norm (f m x0 - f n x0) + norm (f m x - f n x - (f m x0 - f n x0))" | |
| 1429 | unfolding dist_norm by(rule norm_triangle_sub) | |
| 44123 | 1430 | also have "\<dots> \<le> norm (f m x0 - f n x0) + e / 2" | 
| 1431 | using N[rule_format,OF _ _ `x\<in>s` `x0\<in>s`, of m n] and as and False | |
| 1432 | by auto | |
| 1433 | also have "\<dots> < e / 2 + e / 2" | |
| 1434 | apply(rule add_strict_right_mono) | |
| 1435 | using as and M[rule_format] unfolding dist_norm by auto | |
| 1436 | finally show "dist (f m x) (f n x) < e" by auto | |
| 1437 | qed | |
| 1438 | qed | |
| 1439 | qed | |
| 1440 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1441 | then guess g .. note g = this | 
| 44123 | 1442 | 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)" | 
| 1443 | proof(rule,rule) | |
| 1444 | fix e::real assume *:"e>0" | |
| 1445 | guess N using lem1[rule_format,OF *] .. note N=this | |
| 1446 | 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)" | |
| 1447 | apply(rule_tac x=N in exI) | |
| 1448 | proof(default+) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1449 | fix n x y assume as:"N \<le> n" "x \<in> s" "y \<in> s" | 
| 44123 | 1450 | have "eventually (\<lambda>xa. norm (f n x - f n y - (f xa x - f xa y)) \<le> e * norm (x - y)) sequentially" | 
| 1451 | unfolding eventually_sequentially | |
| 1452 | apply(rule_tac x=N in exI) | |
| 1453 | proof(rule,rule) | |
| 1454 | fix m assume "N\<le>m" | |
| 1455 | thus "norm (f n x - f n y - (f m x - f m y)) \<le> e * norm (x - y)" | |
| 1456 | using N[rule_format, of n m x y] and as | |
| 1457 | by (auto simp add: algebra_simps) | |
| 1458 | qed | |
| 1459 | thus "norm (f n x - f n y - (g x - g y)) \<le> e * norm (x - y)" | |
| 1460 | apply- | |
| 41958 | 1461 | 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)"]) | 
| 44125 | 1462 | apply(rule tendsto_intros g[rule_format] as)+ by assumption | 
| 44123 | 1463 | qed | 
| 1464 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1465 | show ?thesis unfolding has_derivative_within_alt apply(rule_tac x=g in exI) | 
| 44123 | 1466 | apply(rule,rule,rule g[rule_format],assumption) | 
| 1467 | proof fix x assume "x\<in>s" | |
| 1468 | have lem3:"\<forall>u. ((\<lambda>n. f' n x u) ---> g' x u) sequentially" | |
| 1469 | unfolding Lim_sequentially | |
| 1470 | proof(rule,rule,rule) | |
| 1471 | fix u and e::real assume "e>0" | |
| 1472 | show "\<exists>N. \<forall>n\<ge>N. dist (f' n x u) (g' x u) < e" | |
| 1473 | proof(cases "u=0") | |
| 41958 | 1474 | case True guess N using assms(3)[rule_format,OF `e>0`] .. note N=this | 
| 1475 | show ?thesis apply(rule_tac x=N in exI) unfolding True | |
| 44123 | 1476 | using N[rule_format,OF _ `x\<in>s`,of _ 0] and `e>0` by auto | 
| 1477 | next | |
| 1478 | case False hence *:"e / 2 / norm u > 0" | |
| 1479 | using `e>0` by (auto intro!: divide_pos_pos) | |
| 41958 | 1480 | guess N using assms(3)[rule_format,OF *] .. note N=this | 
| 44123 | 1481 | show ?thesis apply(rule_tac x=N in exI) | 
| 1482 | proof(rule,rule) case goal1 | |
| 1483 | show ?case unfolding dist_norm | |
| 1484 | using N[rule_format,OF goal1 `x\<in>s`, of u] False `e>0` | |
| 1485 | by (auto simp add:field_simps) | |
| 1486 | qed | |
| 1487 | qed | |
| 1488 | qed | |
| 1489 | show "bounded_linear (g' x)" | |
| 1490 | unfolding linear_linear linear_def | |
| 1491 | apply(rule,rule,rule) defer | |
| 1492 | proof(rule,rule) | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1493 | fix x' y z::"'m" and 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 | 1494 | note lin = assms(2)[rule_format,OF `x\<in>s`,THEN derivative_linear] | 
| 44123 | 1495 | show "g' x (c *\<^sub>R x') = c *\<^sub>R g' x x'" | 
| 1496 | apply(rule tendsto_unique[OF trivial_limit_sequentially]) | |
| 41958 | 1497 | apply(rule lem3[rule_format]) | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1498 | unfolding lin[unfolded bounded_linear_def bounded_linear_axioms_def,THEN conjunct2,THEN conjunct1,rule_format] | 
| 44125 | 1499 | apply (intro tendsto_intros) by(rule lem3[rule_format]) | 
| 44123 | 1500 | show "g' x (y + z) = g' x y + g' x z" | 
| 1501 | apply(rule tendsto_unique[OF trivial_limit_sequentially]) | |
| 1502 | apply(rule lem3[rule_format]) | |
| 1503 | unfolding lin[unfolded bounded_linear_def additive_def,THEN conjunct1,rule_format] | |
| 44125 | 1504 | apply(rule tendsto_add) by(rule lem3[rule_format])+ | 
| 44123 | 1505 | qed | 
| 1506 | 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)" | |
| 1507 | proof(rule,rule) case goal1 | |
| 1508 | have *:"e/3>0" using goal1 by auto | |
| 1509 | guess N1 using assms(3)[rule_format,OF *] .. note N1=this | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1510 | guess N2 using lem2[rule_format,OF *] .. note N2=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1511 | guess d1 using assms(2)[unfolded has_derivative_within_alt, rule_format,OF `x\<in>s`, of "max N1 N2",THEN conjunct2,rule_format,OF *] .. note d1=this | 
| 44123 | 1512 | show ?case apply(rule_tac x=d1 in exI) apply(rule,rule d1[THEN conjunct1]) | 
| 1513 | proof(rule,rule) | |
| 1514 | fix y assume as:"y \<in> s" "norm (y - x) < d1" | |
| 1515 | let ?N ="max N1 N2" | |
| 1516 | have "norm (g y - g x - (f ?N y - f ?N x)) \<le> e /3 * norm (y - x)" | |
| 1517 | apply(subst norm_minus_cancel[THEN sym]) | |
| 1518 | using N2[rule_format, OF _ `y\<in>s` `x\<in>s`, of ?N] by auto | |
| 1519 | moreover | |
| 1520 | have "norm (f ?N y - f ?N x - f' ?N x (y - x)) \<le> e / 3 * norm (y - x)" | |
| 1521 | using d1 and as by auto | |
| 1522 | ultimately | |
| 41958 | 1523 | have "norm (g y - g x - f' ?N x (y - x)) \<le> 2 * e / 3 * norm (y - x)" | 
| 44123 | 1524 | 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)"] | 
| 1525 | by (auto simp add:algebra_simps) | |
| 1526 | moreover | |
| 1527 | have " norm (f' ?N x (y - x) - g' x (y - x)) \<le> e / 3 * norm (y - x)" | |
| 1528 | using N1 `x\<in>s` by auto | |
| 41958 | 1529 | ultimately show "norm (g y - g x - g' x (y - x)) \<le> e * norm (y - x)" | 
| 44123 | 1530 | 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)"] | 
| 1531 | by(auto simp add:algebra_simps) | |
| 1532 | qed | |
| 1533 | qed | |
| 1534 | qed | |
| 1535 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1536 | |
| 44124 
4c2a61a897d8
Derivative.thy: more sensible subsection headings
 huffman parents: 
44123diff
changeset | 1537 | 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 | 1538 | |
| 44123 | 1539 | lemma has_antiderivative_sequence: | 
| 1540 | fixes f::"nat\<Rightarrow> 'm::euclidean_space \<Rightarrow> 'n::euclidean_space" | |
| 1541 | assumes "convex s" | |
| 1542 | assumes "\<forall>n. \<forall>x\<in>s. ((f n) has_derivative (f' n x)) (at x within s)" | |
| 1543 | assumes "\<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" | |
| 1544 | shows "\<exists>g. \<forall>x\<in>s. (g has_derivative g'(x)) (at x within s)" | |
| 1545 | proof(cases "s={}")
 | |
| 1546 | case False then obtain a where "a\<in>s" by auto | |
| 1547 | 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" by auto | |
| 1548 | show ?thesis | |
| 1549 | apply(rule *) | |
| 1550 | apply(rule has_derivative_sequence[OF assms(1) _ assms(3), of "\<lambda>n x. f n x + (f 0 a - f n a)"]) | |
| 1551 | apply(rule,rule) | |
| 1552 | apply(rule has_derivative_add_const, rule assms(2)[rule_format], assumption) | |
| 44457 
d366fa5551ef
declare euclidean_simps [simp] at the point they are proved;
 huffman parents: 
44282diff
changeset | 1553 | apply(rule `a\<in>s`) by auto | 
| 44123 | 1554 | 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 | 1555 | |
| 44123 | 1556 | lemma has_antiderivative_limit: | 
| 1557 | fixes g'::"'m::euclidean_space \<Rightarrow> 'm \<Rightarrow> 'n::euclidean_space" | |
| 1558 | assumes "convex s" | |
| 1559 | assumes "\<forall>e>0. \<exists>f f'. \<forall>x\<in>s. (f has_derivative (f' x)) (at x within s) \<and> (\<forall>h. norm(f' x h - g' x h) \<le> e * norm(h))" | |
| 1560 | shows "\<exists>g. \<forall>x\<in>s. (g has_derivative g'(x)) (at x within s)" | |
| 1561 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1562 | have *:"\<forall>n. \<exists>f f'. \<forall>x\<in>s. (f has_derivative (f' x)) (at x within s) \<and> (\<forall>h. norm(f' x h - g' x h) \<le> inverse (real (Suc n)) * norm(h))" | 
| 44123 | 1563 | apply(rule) using assms(2) | 
| 1564 | apply(erule_tac x="inverse (real (Suc n))" in allE) by auto | |
| 1565 | guess f using *[THEN choice] .. note * = this | |
| 1566 | guess f' using *[THEN choice] .. note f=this | |
| 1567 | show ?thesis apply(rule has_antiderivative_sequence[OF assms(1), of f f']) defer | |
| 1568 | proof(rule,rule) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1569 | fix e::real assume "0<e" guess N using reals_Archimedean[OF `e>0`] .. note N=this | 
| 44123 | 1570 | 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" | 
| 1571 | apply(rule_tac x=N in exI) | |
| 1572 | proof(default+) | |
| 1573 | 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 | 1574 | have *:"inverse (real (Suc n)) \<le> e" apply(rule order_trans[OF _ N[THEN less_imp_le]]) | 
| 41958 | 1575 | using goal1(1) by(auto simp add:field_simps) | 
| 44123 | 1576 | show ?case | 
| 1577 | using f[rule_format,THEN conjunct2,OF goal1(2), of n, THEN spec[where x=h]] | |
| 1578 | apply(rule order_trans) using N * apply(cases "h=0") by auto | |
| 1579 | qed | |
| 1580 | qed(insert f,auto) | |
| 1581 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1582 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1583 | subsection {* Differentiation of a series. *}
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1584 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1585 | definition sums_seq :: "(nat \<Rightarrow> 'a::real_normed_vector) \<Rightarrow> 'a \<Rightarrow> (nat set) \<Rightarrow> bool" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1586 | (infixl "sums'_seq" 12) where "(f sums_seq l) s \<equiv> ((\<lambda>n. setsum f (s \<inter> {0..n})) ---> l) sequentially"
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1587 | |
| 44123 | 1588 | lemma has_derivative_series: | 
| 1589 | fixes f::"nat \<Rightarrow> 'm::euclidean_space \<Rightarrow> 'n::euclidean_space" | |
| 1590 | assumes "convex s" | |
| 1591 | assumes "\<forall>n. \<forall>x\<in>s. ((f n) has_derivative (f' n x)) (at x within s)" | |
| 1592 |   assumes "\<forall>e>0. \<exists>N. \<forall>n\<ge>N. \<forall>x\<in>s. \<forall>h. norm(setsum (\<lambda>i. f' i x h) (k \<inter> {0..n}) - g' x h) \<le> e * norm(h)"
 | |
| 1593 | assumes "x\<in>s" and "((\<lambda>n. f n x) sums_seq l) k" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1594 | shows "\<exists>g. \<forall>x\<in>s. ((\<lambda>n. f n x) sums_seq (g x)) k \<and> (g has_derivative g'(x)) (at x within s)" | 
| 44123 | 1595 | unfolding sums_seq_def | 
| 1596 | apply(rule has_derivative_sequence[OF assms(1) _ assms(3)]) | |
| 1597 | apply(rule,rule) | |
| 1598 | apply(rule has_derivative_setsum) defer | |
| 1599 | apply(rule,rule assms(2)[rule_format],assumption) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1600 | using assms(4-5) unfolding sums_seq_def by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1601 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1602 | subsection {* Derivative with composed bilinear function. *}
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1603 | |
| 37650 | 1604 | lemma has_derivative_bilinear_within: | 
| 44123 | 1605 | assumes "(f has_derivative f') (at x within s)" | 
| 1606 | assumes "(g has_derivative g') (at x within s)" | |
| 1607 | assumes "bounded_bilinear h" | |
| 1608 | 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)" | |
| 1609 | proof- | |
| 1610 | have "(g ---> g x) (at x within s)" | |
| 1611 | apply(rule differentiable_imp_continuous_within[unfolded continuous_within]) | |
| 1612 | using assms(2) unfolding differentiable_def by auto | |
| 1613 | moreover | |
| 1614 | interpret f':bounded_linear f' | |
| 1615 | using assms unfolding has_derivative_def by auto | |
| 1616 | interpret g':bounded_linear g' | |
| 1617 | using assms unfolding has_derivative_def by auto | |
| 1618 | interpret h:bounded_bilinear h | |
| 1619 | using assms by auto | |
| 1620 | have "((\<lambda>y. f' (y - x)) ---> 0) (at x within s)" | |
| 1621 | unfolding f'.zero[THEN sym] | |
| 44125 | 1622 | using bounded_linear.tendsto [of f' "\<lambda>y. y - x" 0 "at x within s"] | 
| 1623 | using tendsto_diff [OF Lim_within_id tendsto_const, of x x s] | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1624 | unfolding id_def using assms(1) unfolding has_derivative_def by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1625 | hence "((\<lambda>y. f x + f' (y - x)) ---> f x) (at x within s)" | 
| 44125 | 1626 | using tendsto_add[OF tendsto_const, of "\<lambda>y. f' (y - x)" 0 "at x within s" "f x"] | 
| 44123 | 1627 | by auto | 
| 1628 | ultimately | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1629 | have *:"((\<lambda>x'. h (f x + f' (x' - x)) ((1/(norm (x' - x))) *\<^sub>R (g x' - (g x + g' (x' - x)))) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1630 | + h ((1/ (norm (x' - x))) *\<^sub>R (f x' - (f x + f' (x' - x)))) (g x')) ---> h (f x) 0 + h 0 (g x)) (at x within s)" | 
| 44125 | 1631 | apply-apply(rule tendsto_add) apply(rule_tac[!] Lim_bilinear[OF _ _ assms(3)]) | 
| 44123 | 1632 | using assms(1-2) unfolding has_derivative_within 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 | 1633 | guess B using bounded_bilinear.pos_bounded[OF assms(3)] .. note B=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1634 | guess C using f'.pos_bounded .. note C=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1635 | guess D using g'.pos_bounded .. note D=this | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1636 | have bcd:"B * C * D > 0" using B C D by (auto intro!: mult_pos_pos) | 
| 44123 | 1637 | have **:"((\<lambda>y. (1/(norm(y - x))) *\<^sub>R (h (f'(y - x)) (g'(y - x)))) ---> 0) (at x within s)" | 
| 1638 | unfolding Lim_within | |
| 1639 | proof(rule,rule) 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 | 1640 | hence "e/(B*C*D)>0" using B C D by(auto intro!:divide_pos_pos mult_pos_pos) | 
| 44123 | 1641 | thus ?case apply(rule_tac x="e/(B*C*D)" in exI,rule) | 
| 1642 | proof(rule,rule,erule conjE) | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1643 | fix y assume as:"y \<in> s" "0 < dist y x" "dist y x < e / (B * C * D)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1644 | have "norm (h (f' (y - x)) (g' (y - x))) \<le> norm (f' (y - x)) * norm (g' (y - x)) * B" using B by auto | 
| 44123 | 1645 | also have "\<dots> \<le> (norm (y - x) * C) * (D * norm (y - x)) * B" | 
| 1646 | apply(rule mult_right_mono) | |
| 1647 | apply(rule mult_mono) using B C D | |
| 1648 | by (auto simp add: field_simps intro!:mult_nonneg_nonneg) | |
| 1649 | also have "\<dots> = (B * C * D * norm (y - x)) * norm (y - x)" | |
| 1650 | by (auto simp add: field_simps) | |
| 1651 | also have "\<dots> < e * norm (y - x)" | |
| 1652 | apply(rule mult_strict_right_mono) | |
| 1653 | using as(3)[unfolded dist_norm] and as(2) | |
| 1654 | unfolding pos_less_divide_eq[OF bcd] by (auto simp add: 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 | 1655 | finally show "dist ((1 / norm (y - x)) *\<^sub>R h (f' (y - x)) (g' (y - x))) 0 < e" | 
| 44123 | 1656 | unfolding dist_norm apply-apply(cases "y = x") | 
| 1657 | by(auto simp add: field_simps) | |
| 1658 | qed | |
| 1659 | qed | |
| 37650 | 1660 | have "bounded_linear (\<lambda>d. h (f x) (g' d) + h (f' d) (g x))" | 
| 1661 | apply (rule bounded_linear_add) | |
| 1662 | apply (rule bounded_linear_compose [OF h.bounded_linear_right `bounded_linear g'`]) | |
| 1663 | apply (rule bounded_linear_compose [OF h.bounded_linear_left `bounded_linear f'`]) | |
| 1664 | done | |
| 44125 | 1665 | thus ?thesis using tendsto_add[OF * **] unfolding has_derivative_within | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1666 | unfolding g'.add f'.scaleR f'.add g'.scaleR f'.diff g'.diff | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1667 | h.add_right h.add_left scaleR_right_distrib h.scaleR_left h.scaleR_right h.diff_right h.diff_left | 
| 44123 | 1668 | scaleR_right_diff_distrib h.zero_right h.zero_left | 
| 1669 | by(auto simp add:field_simps) | |
| 1670 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1671 | |
| 37650 | 1672 | lemma has_derivative_bilinear_at: | 
| 44123 | 1673 | assumes "(f has_derivative f') (at x)" | 
| 1674 | assumes "(g has_derivative g') (at x)" | |
| 1675 | 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 | 1676 | shows "((\<lambda>x. h (f x) (g x)) has_derivative (\<lambda>d. h (f x) (g' d) + h (f' d) (g x))) (at x)" | 
| 44123 | 1677 | using has_derivative_bilinear_within[of f f' x UNIV g g' h] | 
| 1678 | unfolding within_UNIV 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 | 1679 | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1680 | subsection {* 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 | 1681 | |
| 44081 
730f7cced3a6
rename type 'a net to 'a filter, following standard mathematical terminology
 huffman parents: 
43338diff
changeset | 1682 | definition has_vector_derivative :: "(real \<Rightarrow> 'b::real_normed_vector) \<Rightarrow> 'b \<Rightarrow> (real filter \<Rightarrow> bool)" | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1683 | (infixl "has'_vector'_derivative" 12) where | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1684 | "(f has_vector_derivative f') net \<equiv> (f has_derivative (\<lambda>x. x *\<^sub>R f')) net" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1685 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1686 | definition "vector_derivative f net \<equiv> (SOME f'. (f has_vector_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 | 1687 | |
| 44123 | 1688 | lemma vector_derivative_works: | 
| 1689 | fixes f::"real \<Rightarrow> 'a::real_normed_vector" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1690 | shows "f differentiable net \<longleftrightarrow> (f has_vector_derivative (vector_derivative f net)) net" (is "?l = ?r") | 
| 44123 | 1691 | proof | 
| 1692 | assume ?l guess f' using `?l`[unfolded differentiable_def] .. note f' = this | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1693 | then interpret bounded_linear f' by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1694 | thus ?r unfolding vector_derivative_def has_vector_derivative_def | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1695 | apply-apply(rule someI_ex,rule_tac x="f' 1" in exI) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1696 | using f' unfolding scaleR[THEN sym] by auto | 
| 44123 | 1697 | next | 
| 1698 | assume ?r thus ?l | |
| 1699 | unfolding vector_derivative_def has_vector_derivative_def differentiable_def | |
| 1700 | by auto | |
| 1701 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1702 | |
| 37730 | 1703 | lemma vector_derivative_unique_at: | 
| 1704 | assumes "(f has_vector_derivative f') (at x)" | |
| 1705 | assumes "(f has_vector_derivative f'') (at x)" | |
| 1706 | shows "f' = f''" | |
| 1707 | proof- | |
| 1708 | have "(\<lambda>x. x *\<^sub>R f') = (\<lambda>x. x *\<^sub>R f'')" | |
| 1709 | using assms [unfolded has_vector_derivative_def] | |
| 1710 | by (rule frechet_derivative_unique_at) | |
| 39302 
d7728f65b353
renamed lemmas: ext_iff -> fun_eq_iff, set_ext_iff -> set_eq_iff, set_ext -> set_eqI
 nipkow parents: 
39198diff
changeset | 1711 | thus ?thesis unfolding fun_eq_iff by auto | 
| 37730 | 1712 | qed | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1713 | |
| 44123 | 1714 | lemma vector_derivative_unique_within_closed_interval: | 
| 1715 | fixes f::"real \<Rightarrow> 'n::ordered_euclidean_space" | |
| 1716 |   assumes "a < b" and "x \<in> {a..b}"
 | |
| 1717 |   assumes "(f has_vector_derivative f') (at x within {a..b})"
 | |
| 1718 |   assumes "(f has_vector_derivative f'') (at x within {a..b})"
 | |
| 1719 | shows "f' = f''" | |
| 1720 | proof- | |
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1721 | have *:"(\<lambda>x. x *\<^sub>R f') = (\<lambda>x. x *\<^sub>R f'')" | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1722 | apply(rule frechet_derivative_unique_within_closed_interval[of "a" "b"]) | 
| 44123 | 1723 | using assms(3-)[unfolded has_vector_derivative_def] using assms(1-2) | 
| 1724 | by auto | |
| 1725 | show ?thesis | |
| 1726 | proof(rule ccontr) | |
| 1727 | assume "f' \<noteq> f''" | |
| 1728 | moreover | |
| 1729 | hence "(\<lambda>x. x *\<^sub>R f') 1 = (\<lambda>x. x *\<^sub>R f'') 1" | |
| 1730 | using * by (auto simp: fun_eq_iff) | |
| 1731 | ultimately show False unfolding o_def by auto | |
| 1732 | qed | |
| 1733 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1734 | |
| 37730 | 1735 | lemma vector_derivative_at: | 
| 1736 | shows "(f has_vector_derivative f') (at x) \<Longrightarrow> vector_derivative f (at x) = f'" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1737 | apply(rule vector_derivative_unique_at) defer apply assumption | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1738 | unfolding vector_derivative_works[THEN sym] differentiable_def | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1739 | unfolding has_vector_derivative_def by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1740 | |
| 44123 | 1741 | lemma vector_derivative_within_closed_interval: | 
| 1742 | fixes f::"real \<Rightarrow> 'a::ordered_euclidean_space" | |
| 1743 |   assumes "a < b" and "x \<in> {a..b}"
 | |
| 1744 |   assumes "(f has_vector_derivative f') (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 | 1745 |   shows "vector_derivative f (at x within {a..b}) = f'"
 | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1746 | apply(rule vector_derivative_unique_within_closed_interval) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1747 | using vector_derivative_works[unfolded differentiable_def] | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1748 | using assms by(auto simp add:has_vector_derivative_def) | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1749 | |
| 34981 | 1750 | lemma has_vector_derivative_within_subset: | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1751 | "(f has_vector_derivative f') (at x within s) \<Longrightarrow> t \<subseteq> s \<Longrightarrow> (f has_vector_derivative f') (at x within t)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1752 | unfolding has_vector_derivative_def apply(rule has_derivative_within_subset) by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1753 | |
| 34981 | 1754 | lemma has_vector_derivative_const: | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1755 | "((\<lambda>x. c) has_vector_derivative 0) net" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1756 | unfolding has_vector_derivative_def using has_derivative_const by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1757 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1758 | lemma has_vector_derivative_id: "((\<lambda>x::real. x) has_vector_derivative 1) net" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1759 | unfolding has_vector_derivative_def using has_derivative_id by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1760 | |
| 44123 | 1761 | lemma has_vector_derivative_cmul: | 
| 1762 | "(f has_vector_derivative f') net \<Longrightarrow> ((\<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: 
44137diff
changeset | 1763 | unfolding has_vector_derivative_def | 
| 44282 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 1764 | apply (drule scaleR_right_has_derivative) | 
| 44123 | 1765 | 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 | 1766 | |
| 44123 | 1767 | lemma has_vector_derivative_cmul_eq: | 
| 1768 | 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 | 1769 | shows "(((\<lambda>x. c *\<^sub>R f x) has_vector_derivative (c *\<^sub>R f')) net \<longleftrightarrow> (f has_vector_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 | 1770 | apply rule apply(drule has_vector_derivative_cmul[where c="1/c"]) defer | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1771 | apply(rule has_vector_derivative_cmul) using assms by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1772 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1773 | lemma has_vector_derivative_neg: | 
| 44123 | 1774 | "(f has_vector_derivative f') net \<Longrightarrow> ((\<lambda>x. -(f x)) 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 | 1775 | unfolding has_vector_derivative_def apply(drule has_derivative_neg) by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1776 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1777 | lemma has_vector_derivative_add: | 
| 44123 | 1778 | assumes "(f has_vector_derivative f') net" | 
| 1779 | assumes "(g has_vector_derivative 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 | 1780 | shows "((\<lambda>x. f(x) + g(x)) has_vector_derivative (f' + g')) net" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1781 | using has_derivative_add[OF assms[unfolded has_vector_derivative_def]] | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1782 | unfolding has_vector_derivative_def unfolding scaleR_right_distrib by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1783 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1784 | lemma has_vector_derivative_sub: | 
| 44123 | 1785 | assumes "(f has_vector_derivative f') net" | 
| 1786 | assumes "(g has_vector_derivative 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 | 1787 | shows "((\<lambda>x. f(x) - g(x)) has_vector_derivative (f' - g')) net" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1788 | using has_derivative_sub[OF assms[unfolded has_vector_derivative_def]] | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1789 | unfolding has_vector_derivative_def scaleR_right_diff_distrib by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1790 | |
| 37650 | 1791 | lemma has_vector_derivative_bilinear_within: | 
| 44123 | 1792 | assumes "(f has_vector_derivative f') (at x within s)" | 
| 1793 | assumes "(g has_vector_derivative g') (at x within s)" | |
| 1794 | assumes "bounded_bilinear h" | |
| 1795 | shows "((\<lambda>x. h (f x) (g x)) has_vector_derivative (h (f x) g' + h f' (g x))) (at x within s)" | |
| 1796 | proof- | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1797 | interpret bounded_bilinear h using assms by auto | 
| 37489 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1798 | show ?thesis using has_derivative_bilinear_within[OF assms(1-2)[unfolded has_vector_derivative_def], of h] | 
| 
44e42d392c6e
Introduce a type class for euclidean spaces, port most lemmas from real^'n to this type class.
 hoelzl parents: 
36844diff
changeset | 1799 | unfolding o_def has_vector_derivative_def | 
| 44123 | 1800 | using assms(3) unfolding scaleR_right scaleR_left scaleR_right_distrib | 
| 1801 | by auto | |
| 1802 | qed | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1803 | |
| 37650 | 1804 | lemma has_vector_derivative_bilinear_at: | 
| 44123 | 1805 | assumes "(f has_vector_derivative f') (at x)" | 
| 1806 | assumes "(g has_vector_derivative g') (at x)" | |
| 1807 | 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 | 1808 | shows "((\<lambda>x. h (f x) (g x)) has_vector_derivative (h (f x) g' + h f' (g x))) (at x)" | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1809 | apply(rule has_vector_derivative_bilinear_within[where s=UNIV, unfolded within_UNIV]) using assms by auto | 
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1810 | |
| 44123 | 1811 | lemma has_vector_derivative_at_within: | 
| 1812 | "(f has_vector_derivative f') (at x) \<Longrightarrow> (f has_vector_derivative f') (at x within s)" | |
| 1813 | unfolding has_vector_derivative_def | |
| 1814 | by (rule has_derivative_at_within) auto | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1815 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1816 | lemma has_vector_derivative_transform_within: | 
| 44123 | 1817 | assumes "0 < d" and "x \<in> s" and "\<forall>x'\<in>s. dist x' x < d \<longrightarrow> f x' = g x'" | 
| 1818 | 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 | 1819 | shows "(g has_vector_derivative f') (at x within s)" | 
| 44123 | 1820 | using assms unfolding has_vector_derivative_def | 
| 1821 | 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 | 1822 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1823 | lemma has_vector_derivative_transform_at: | 
| 44123 | 1824 | assumes "0 < d" and "\<forall>x'. dist x' x < d \<longrightarrow> f x' = g x'" | 
| 1825 | assumes "(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 | 1826 | shows "(g has_vector_derivative f') (at x)" | 
| 44123 | 1827 | using assms unfolding has_vector_derivative_def | 
| 1828 | 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 | 1829 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1830 | lemma has_vector_derivative_transform_within_open: | 
| 44123 | 1831 | assumes "open s" and "x \<in> s" and "\<forall>y\<in>s. f y = g y" | 
| 1832 | assumes "(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 | 1833 | shows "(g has_vector_derivative f') (at x)" | 
| 44123 | 1834 | using assms unfolding has_vector_derivative_def | 
| 1835 | 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 | 1836 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1837 | lemma vector_diff_chain_at: | 
| 44123 | 1838 | assumes "(f has_vector_derivative f') (at x)" | 
| 1839 | assumes "(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 | 1840 | shows "((g \<circ> f) has_vector_derivative (f' *\<^sub>R g')) (at x)" | 
| 44123 | 1841 | using assms(2) unfolding has_vector_derivative_def apply- | 
| 1842 | apply(drule diff_chain_at[OF assms(1)[unfolded has_vector_derivative_def]]) | |
| 44282 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 1843 | unfolding o_def real_scaleR_def scaleR_scaleR . | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1844 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1845 | lemma vector_diff_chain_within: | 
| 44123 | 1846 | assumes "(f has_vector_derivative f') (at x within s)" | 
| 1847 | assumes "(g has_vector_derivative g') (at (f x) within f ` s)" | |
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1848 | shows "((g o f) has_vector_derivative (f' *\<^sub>R g')) (at x within s)" | 
| 44123 | 1849 | using assms(2) unfolding has_vector_derivative_def apply- | 
| 1850 | apply(drule diff_chain_within[OF assms(1)[unfolded has_vector_derivative_def]]) | |
| 44282 
f0de18b62d63
remove bounded_(bi)linear locale interpretations, to avoid duplicating so many lemmas
 huffman parents: 
44140diff
changeset | 1851 | unfolding o_def real_scaleR_def scaleR_scaleR . | 
| 33741 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1852 | |
| 
4c414d0835ab
Added derivation and Brouwer's fixpoint theorem in Multivariate Analysis (translated by Robert Himmelmann from HOL-light)
 hoelzl parents: diff
changeset | 1853 | end |