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