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