| author | wenzelm | 
| Wed, 26 Dec 2018 20:57:23 +0100 | |
| changeset 69506 | 7d59af98af29 | 
| parent 69423 | 3922aa1df44e | 
| child 69508 | 2a4c8a2a3f8e | 
| permissions | -rw-r--r-- | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1 | section \<open>Complex path integrals and Cauchy's integral theorem\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2 | |
| 61711 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3 | text\<open>By John Harrison et al. Ported from HOL Light by L C Paulson (2015)\<close> | 
| 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 4 | |
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 5 | theory Cauchy_Integral_Theorem | 
| 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 6 | imports Complex_Transcendental Weierstrass_Theorems Ordered_Euclidean_Space | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 7 | begin | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 8 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 9 | subsection%unimportant \<open>Homeomorphisms of arc images\<close> | 
| 62620 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 10 | |
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 11 | lemma homeomorphism_arc: | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 12 | fixes g :: "real \<Rightarrow> 'a::t2_space" | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 13 | assumes "arc g" | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 14 |   obtains h where "homeomorphism {0..1} (path_image g) g h"
 | 
| 68339 | 15 | using assms by (force simp: arc_def homeomorphism_compact path_def path_image_def) | 
| 62620 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 16 | |
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 17 | lemma homeomorphic_arc_image_interval: | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 18 | fixes g :: "real \<Rightarrow> 'a::t2_space" and a::real | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 19 | assumes "arc g" "a < b" | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 20 |   shows "(path_image g) homeomorphic {a..b}"
 | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 21 | proof - | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 22 |   have "(path_image g) homeomorphic {0..1::real}"
 | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 23 | by (meson assms(1) homeomorphic_def homeomorphic_sym homeomorphism_arc) | 
| 68339 | 24 |   also have "\<dots> homeomorphic {a..b}"
 | 
| 62620 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 25 | using assms by (force intro: homeomorphic_closed_intervals_real) | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 26 | finally show ?thesis . | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 27 | qed | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 28 | |
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 29 | lemma homeomorphic_arc_images: | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 30 | fixes g :: "real \<Rightarrow> 'a::t2_space" and h :: "real \<Rightarrow> 'b::t2_space" | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 31 | assumes "arc g" "arc h" | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 32 | shows "(path_image g) homeomorphic (path_image h)" | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 33 | proof - | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 34 |   have "(path_image g) homeomorphic {0..1::real}"
 | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 35 | by (meson assms homeomorphic_def homeomorphic_sym homeomorphism_arc) | 
| 68339 | 36 | also have "\<dots> homeomorphic (path_image h)" | 
| 62620 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 37 | by (meson assms homeomorphic_def homeomorphism_arc) | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 38 | finally show ?thesis . | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 39 | qed | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 40 | |
| 65037 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 41 | lemma path_connected_arc_complement: | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 42 | fixes \<gamma> :: "real \<Rightarrow> 'a::euclidean_space" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 43 |   assumes "arc \<gamma>" "2 \<le> DIM('a)"
 | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 44 | shows "path_connected(- path_image \<gamma>)" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 45 | proof - | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 46 |   have "path_image \<gamma> homeomorphic {0..1::real}"
 | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 47 | by (simp add: assms homeomorphic_arc_image_interval) | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 48 | then | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 49 | show ?thesis | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 50 | apply (rule path_connected_complement_homeomorphic_convex_compact) | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 51 | apply (auto simp: assms) | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 52 | done | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 53 | qed | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 54 | |
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 55 | lemma connected_arc_complement: | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 56 | fixes \<gamma> :: "real \<Rightarrow> 'a::euclidean_space" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 57 |   assumes "arc \<gamma>" "2 \<le> DIM('a)"
 | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 58 | shows "connected(- path_image \<gamma>)" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 59 | by (simp add: assms path_connected_arc_complement path_connected_imp_connected) | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 60 | |
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 61 | lemma inside_arc_empty: | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 62 | fixes \<gamma> :: "real \<Rightarrow> 'a::euclidean_space" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 63 | assumes "arc \<gamma>" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 64 |     shows "inside(path_image \<gamma>) = {}"
 | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 65 | proof (cases "DIM('a) = 1")
 | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 66 | case True | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 67 | then show ?thesis | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 68 | using assms connected_arc_image connected_convex_1_gen inside_convex by blast | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 69 | next | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 70 | case False | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 71 | show ?thesis | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 72 | proof (rule inside_bounded_complement_connected_empty) | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 73 | show "connected (- path_image \<gamma>)" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 74 | apply (rule connected_arc_complement [OF assms]) | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 75 | using False | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 76 | by (metis DIM_ge_Suc0 One_nat_def Suc_1 not_less_eq_eq order_class.order.antisym) | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 77 | show "bounded (path_image \<gamma>)" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 78 | by (simp add: assms bounded_arc_image) | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 79 | qed | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 80 | qed | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 81 | |
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 82 | lemma inside_simple_curve_imp_closed: | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 83 | fixes \<gamma> :: "real \<Rightarrow> 'a::euclidean_space" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 84 | shows "\<lbrakk>simple_path \<gamma>; x \<in> inside(path_image \<gamma>)\<rbrakk> \<Longrightarrow> pathfinish \<gamma> = pathstart \<gamma>" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 85 | using arc_simple_path inside_arc_empty by blast | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 86 | |
| 68493 | 87 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 88 | subsection%unimportant \<open>Piecewise differentiable functions\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 89 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 90 | definition piecewise_differentiable_on | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 91 | (infixr "piecewise'_differentiable'_on" 50) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 92 | where "f piecewise_differentiable_on i \<equiv> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 93 | continuous_on i f \<and> | 
| 68284 | 94 | (\<exists>S. finite S \<and> (\<forall>x \<in> i - S. f differentiable (at x within i)))" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 95 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 96 | lemma piecewise_differentiable_on_imp_continuous_on: | 
| 68284 | 97 | "f piecewise_differentiable_on S \<Longrightarrow> continuous_on S f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 98 | by (simp add: piecewise_differentiable_on_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 99 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 100 | lemma piecewise_differentiable_on_subset: | 
| 68284 | 101 | "f piecewise_differentiable_on S \<Longrightarrow> T \<le> S \<Longrightarrow> f piecewise_differentiable_on T" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 102 | using continuous_on_subset | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 103 | unfolding piecewise_differentiable_on_def | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 104 | apply safe | 
| 68339 | 105 | apply (blast elim: continuous_on_subset) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 106 | by (meson Diff_iff differentiable_within_subset subsetCE) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 107 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 108 | lemma differentiable_on_imp_piecewise_differentiable: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 109 |   fixes a:: "'a::{linorder_topology,real_normed_vector}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 110 |   shows "f differentiable_on {a..b} \<Longrightarrow> f piecewise_differentiable_on {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 111 | apply (simp add: piecewise_differentiable_on_def differentiable_imp_continuous_on) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 112 |   apply (rule_tac x="{a,b}" in exI, simp add: differentiable_on_def)
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 113 | done | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 114 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 115 | lemma differentiable_imp_piecewise_differentiable: | 
| 68284 | 116 | "(\<And>x. x \<in> S \<Longrightarrow> f differentiable (at x within S)) | 
| 117 | \<Longrightarrow> f piecewise_differentiable_on S" | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 118 | by (auto simp: piecewise_differentiable_on_def differentiable_imp_continuous_on differentiable_on_def | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 119 | intro: differentiable_within_subset) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 120 | |
| 68284 | 121 | lemma piecewise_differentiable_const [iff]: "(\<lambda>x. z) piecewise_differentiable_on S" | 
| 61204 | 122 | by (simp add: differentiable_imp_piecewise_differentiable) | 
| 123 | ||
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 124 | lemma piecewise_differentiable_compose: | 
| 68284 | 125 | "\<lbrakk>f piecewise_differentiable_on S; g piecewise_differentiable_on (f ` S); | 
| 126 |       \<And>x. finite (S \<inter> f-`{x})\<rbrakk>
 | |
| 68339 | 127 | \<Longrightarrow> (g \<circ> f) piecewise_differentiable_on S" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 128 | apply (simp add: piecewise_differentiable_on_def, safe) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 129 | apply (blast intro: continuous_on_compose2) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 130 | apply (rename_tac A B) | 
| 68284 | 131 |   apply (rule_tac x="A \<union> (\<Union>x\<in>B. S \<inter> f-`{x})" in exI)
 | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 132 | apply (blast intro!: differentiable_chain_within) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 133 | done | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 134 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 135 | lemma piecewise_differentiable_affine: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 136 | fixes m::real | 
| 68284 | 137 | assumes "f piecewise_differentiable_on ((\<lambda>x. m *\<^sub>R x + c) ` S)" | 
| 68339 | 138 | shows "(f \<circ> (\<lambda>x. m *\<^sub>R x + c)) piecewise_differentiable_on S" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 139 | proof (cases "m = 0") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 140 | case True | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 141 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 142 | unfolding o_def | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 143 | by (force intro: differentiable_imp_piecewise_differentiable differentiable_const) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 144 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 145 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 146 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 147 | apply (rule piecewise_differentiable_compose [OF differentiable_imp_piecewise_differentiable]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 148 | apply (rule assms derivative_intros | simp add: False vimage_def real_vector_affinity_eq)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 149 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 150 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 151 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 152 | lemma piecewise_differentiable_cases: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 153 | fixes c::real | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 154 |   assumes "f piecewise_differentiable_on {a..c}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 155 |           "g piecewise_differentiable_on {c..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 156 | "a \<le> c" "c \<le> b" "f c = g c" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 157 |   shows "(\<lambda>x. if x \<le> c then f x else g x) piecewise_differentiable_on {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 158 | proof - | 
| 68284 | 159 | obtain S T where st: "finite S" "finite T" | 
| 160 |                and fd: "\<And>x. x \<in> {a..c} - S \<Longrightarrow> f differentiable at x within {a..c}"
 | |
| 161 |                and gd: "\<And>x. x \<in> {c..b} - T \<Longrightarrow> g differentiable at x within {c..b}"
 | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 162 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 163 | by (auto simp: piecewise_differentiable_on_def) | 
| 68284 | 164 |   have finabc: "finite ({a,b,c} \<union> (S \<union> T))"
 | 
| 165 | by (metis \<open>finite S\<close> \<open>finite T\<close> finite_Un finite_insert finite.emptyI) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 166 |   have "continuous_on {a..c} f" "continuous_on {c..b} g"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 167 | using assms piecewise_differentiable_on_def by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 168 |   then have "continuous_on {a..b} (\<lambda>x. if x \<le> c then f x else g x)"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 169 | using continuous_on_cases [OF closed_real_atLeastAtMost [of a c], | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 170 | OF closed_real_atLeastAtMost [of c b], | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 171 | of f g "\<lambda>x. x\<le>c"] assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 172 | by (force simp: ivl_disj_un_two_touch) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 173 | moreover | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 174 |   { fix x
 | 
| 68284 | 175 |     assume x: "x \<in> {a..b} - ({a,b,c} \<union> (S \<union> T))"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 176 |     have "(\<lambda>x. if x \<le> c then f x else g x) differentiable at x within {a..b}" (is "?diff_fg")
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 177 | proof (cases x c rule: le_cases) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 178 | case le show ?diff_fg | 
| 68284 | 179 | proof (rule differentiable_transform_within [where d = "dist x c"]) | 
| 180 | have "f differentiable at x" | |
| 181 |           using x le fd [of x] at_within_interior [of x "{a..c}"] by simp
 | |
| 182 |         then show "f differentiable at x within {a..b}"
 | |
| 183 | by (simp add: differentiable_at_withinI) | |
| 63955 | 184 | qed (use x le st dist_real_def in auto) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 185 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 186 | case ge show ?diff_fg | 
| 68284 | 187 | proof (rule differentiable_transform_within [where d = "dist x c"]) | 
| 188 | have "g differentiable at x" | |
| 189 |           using x ge gd [of x] at_within_interior [of x "{c..b}"] by simp
 | |
| 190 |         then show "g differentiable at x within {a..b}"
 | |
| 191 | by (simp add: differentiable_at_withinI) | |
| 63955 | 192 | qed (use x ge st dist_real_def in auto) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 193 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 194 | } | 
| 68284 | 195 | then have "\<exists>S. finite S \<and> | 
| 196 |                  (\<forall>x\<in>{a..b} - S. (\<lambda>x. if x \<le> c then f x else g x) differentiable at x within {a..b})"
 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 197 | by (meson finabc) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 198 | ultimately show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 199 | by (simp add: piecewise_differentiable_on_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 200 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 201 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 202 | lemma piecewise_differentiable_neg: | 
| 68284 | 203 | "f piecewise_differentiable_on S \<Longrightarrow> (\<lambda>x. -(f x)) piecewise_differentiable_on S" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 204 | by (auto simp: piecewise_differentiable_on_def continuous_on_minus) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 205 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 206 | lemma piecewise_differentiable_add: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 207 | assumes "f piecewise_differentiable_on i" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 208 | "g piecewise_differentiable_on i" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 209 | shows "(\<lambda>x. f x + g x) piecewise_differentiable_on i" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 210 | proof - | 
| 68284 | 211 | obtain S T where st: "finite S" "finite T" | 
| 212 | "\<forall>x\<in>i - S. f differentiable at x within i" | |
| 213 | "\<forall>x\<in>i - T. g differentiable at x within i" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 214 | using assms by (auto simp: piecewise_differentiable_on_def) | 
| 68284 | 215 | then have "finite (S \<union> T) \<and> (\<forall>x\<in>i - (S \<union> T). (\<lambda>x. f x + g x) differentiable at x within i)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 216 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 217 | moreover have "continuous_on i f" "continuous_on i g" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 218 | using assms piecewise_differentiable_on_def by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 219 | ultimately show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 220 | by (auto simp: piecewise_differentiable_on_def continuous_on_add) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 221 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 222 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 223 | lemma piecewise_differentiable_diff: | 
| 68284 | 224 | "\<lbrakk>f piecewise_differentiable_on S; g piecewise_differentiable_on S\<rbrakk> | 
| 225 | \<Longrightarrow> (\<lambda>x. f x - g x) piecewise_differentiable_on S" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 226 | unfolding diff_conv_add_uminus | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 227 | by (metis piecewise_differentiable_add piecewise_differentiable_neg) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 228 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 229 | lemma continuous_on_joinpaths_D1: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 230 |     "continuous_on {0..1} (g1 +++ g2) \<Longrightarrow> continuous_on {0..1} g1"
 | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 231 | apply (rule continuous_on_eq [of _ "(g1 +++ g2) \<circ> ((*)(inverse 2))"]) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 232 | apply (rule continuous_intros | simp)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 233 | apply (auto elim!: continuous_on_subset simp: joinpaths_def) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 234 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 235 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 236 | lemma continuous_on_joinpaths_D2: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 237 |     "\<lbrakk>continuous_on {0..1} (g1 +++ g2); pathfinish g1 = pathstart g2\<rbrakk> \<Longrightarrow> continuous_on {0..1} g2"
 | 
| 68339 | 238 | apply (rule continuous_on_eq [of _ "(g1 +++ g2) \<circ> (\<lambda>x. inverse 2*x + 1/2)"]) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 239 | apply (rule continuous_intros | simp)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 240 | apply (auto elim!: continuous_on_subset simp add: joinpaths_def pathfinish_def pathstart_def Ball_def) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 241 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 242 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 243 | lemma piecewise_differentiable_D1: | 
| 68284 | 244 |   assumes "(g1 +++ g2) piecewise_differentiable_on {0..1}"
 | 
| 245 |   shows "g1 piecewise_differentiable_on {0..1}"
 | |
| 246 | proof - | |
| 247 |   obtain S where cont: "continuous_on {0..1} g1" and "finite S"
 | |
| 248 |     and S: "\<And>x. x \<in> {0..1} - S \<Longrightarrow> g1 +++ g2 differentiable at x within {0..1}"
 | |
| 249 | using assms unfolding piecewise_differentiable_on_def | |
| 250 | by (blast dest!: continuous_on_joinpaths_D1) | |
| 251 | show ?thesis | |
| 252 | unfolding piecewise_differentiable_on_def | |
| 253 | proof (intro exI conjI ballI cont) | |
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 254 | show "finite (insert 1 (((*)2) ` S))" | 
| 68284 | 255 | by (simp add: \<open>finite S\<close>) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 256 |     show "g1 differentiable at x within {0..1}" if "x \<in> {0..1} - insert 1 ((*) 2 ` S)" for x
 | 
| 68284 | 257 | proof (rule_tac d="dist (x/2) (1/2)" in differentiable_transform_within) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 258 |       have "g1 +++ g2 differentiable at (x / 2) within {0..1/2}"
 | 
| 68284 | 259 | by (rule differentiable_subset [OF S [of "x/2"]] | use that in force)+ | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 260 |       then show "g1 +++ g2 \<circ> (*) (inverse 2) differentiable at x within {0..1}"
 | 
| 68284 | 261 | by (auto intro: differentiable_chain_within) | 
| 262 | qed (use that in \<open>auto simp: joinpaths_def\<close>) | |
| 263 | qed | |
| 264 | qed | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 265 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 266 | lemma piecewise_differentiable_D2: | 
| 68284 | 267 |   assumes "(g1 +++ g2) piecewise_differentiable_on {0..1}" and eq: "pathfinish g1 = pathstart g2"
 | 
| 268 |   shows "g2 piecewise_differentiable_on {0..1}"
 | |
| 269 | proof - | |
| 270 | have [simp]: "g1 1 = g2 0" | |
| 271 | using eq by (simp add: pathfinish_def pathstart_def) | |
| 272 |   obtain S where cont: "continuous_on {0..1} g2" and "finite S"
 | |
| 273 |     and S: "\<And>x. x \<in> {0..1} - S \<Longrightarrow> g1 +++ g2 differentiable at x within {0..1}"
 | |
| 274 | using assms unfolding piecewise_differentiable_on_def | |
| 275 | by (blast dest!: continuous_on_joinpaths_D2) | |
| 276 | show ?thesis | |
| 277 | unfolding piecewise_differentiable_on_def | |
| 278 | proof (intro exI conjI ballI cont) | |
| 279 | show "finite (insert 0 ((\<lambda>x. 2*x-1)`S))" | |
| 280 | by (simp add: \<open>finite S\<close>) | |
| 281 |     show "g2 differentiable at x within {0..1}" if "x \<in> {0..1} - insert 0 ((\<lambda>x. 2*x-1)`S)" for x
 | |
| 282 | proof (rule_tac d="dist ((x+1)/2) (1/2)" in differentiable_transform_within) | |
| 283 | have x2: "(x + 1) / 2 \<notin> S" | |
| 284 | using that | |
| 285 | apply (clarsimp simp: image_iff) | |
| 68527 
2f4e2aab190a
Generalising and renaming some basic results
 paulson <lp15@cam.ac.uk> parents: 
68493diff
changeset | 286 | by (metis add.commute add_diff_cancel_left' mult_2 field_sum_of_halves) | 
| 68284 | 287 |       have "g1 +++ g2 \<circ> (\<lambda>x. (x+1) / 2) differentiable at x within {0..1}"
 | 
| 288 | by (rule differentiable_chain_within differentiable_subset [OF S [of "(x+1)/2"]] | use x2 that in force)+ | |
| 289 |       then show "g1 +++ g2 \<circ> (\<lambda>x. (x+1) / 2) differentiable at x within {0..1}"
 | |
| 290 | by (auto intro: differentiable_chain_within) | |
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 291 |       show "(g1 +++ g2 \<circ> (\<lambda>x. (x + 1) / 2)) x' = g2 x'" if "x' \<in> {0..1}" "dist x' x < dist ((x + 1) / 2) (1/2)" for x'
 | 
| 68284 | 292 | proof - | 
| 293 | have [simp]: "(2*x'+2)/2 = x'+1" | |
| 294 | by (simp add: divide_simps) | |
| 295 | show ?thesis | |
| 296 | using that by (auto simp: joinpaths_def) | |
| 297 | qed | |
| 298 | qed (use that in \<open>auto simp: joinpaths_def\<close>) | |
| 299 | qed | |
| 300 | qed | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 301 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 302 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 303 | subsection\<open>The concept of continuously differentiable\<close> | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 304 | |
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 305 | text \<open> | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 306 | John Harrison writes as follows: | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 307 | |
| 62456 | 308 | ``The usual assumption in complex analysis texts is that a path \<open>\<gamma>\<close> should be piecewise | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 309 | continuously differentiable, which ensures that the path integral exists at least for any continuous | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 310 | f, since all piecewise continuous functions are integrable. However, our notion of validity is | 
| 68341 | 311 | weaker, just piecewise differentiability\ldots{} [namely] continuity plus differentiability except on a
 | 
| 312 | finite set\ldots{} [Our] underlying theory of integration is the Kurzweil-Henstock theory. In contrast to
 | |
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 313 | the Riemann or Lebesgue theory (but in common with a simple notion based on antiderivatives), this | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 314 | can integrate all derivatives.'' | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 315 | |
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 316 | "Formalizing basic complex analysis." From Insight to Proof: Festschrift in Honour of Andrzej Trybulec. | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 317 | Studies in Logic, Grammar and Rhetoric 10.23 (2007): 151-165. | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 318 | |
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 319 | And indeed he does not assume that his derivatives are continuous, but the penalty is unreasonably | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 320 | difficult proofs concerning winding numbers. We need a self-contained and straightforward theorem | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 321 | asserting that all derivatives can be integrated before we can adopt Harrison's choice.\<close> | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 322 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 323 | definition%important C1_differentiable_on :: "(real \<Rightarrow> 'a::real_normed_vector) \<Rightarrow> real set \<Rightarrow> bool" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 324 | (infix "C1'_differentiable'_on" 50) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 325 | where | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 326 | "f C1_differentiable_on S \<longleftrightarrow> | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 327 | (\<exists>D. (\<forall>x \<in> S. (f has_vector_derivative (D x)) (at x)) \<and> continuous_on S D)" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 328 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 329 | lemma C1_differentiable_on_eq: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 330 | "f C1_differentiable_on S \<longleftrightarrow> | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 331 | (\<forall>x \<in> S. f differentiable at x) \<and> continuous_on S (\<lambda>x. vector_derivative f (at x))" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 332 | (is "?lhs = ?rhs") | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 333 | proof | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 334 | assume ?lhs | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 335 | then show ?rhs | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 336 | unfolding C1_differentiable_on_def | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 337 | by (metis (no_types, lifting) continuous_on_eq differentiableI_vector vector_derivative_at) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 338 | next | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 339 | assume ?rhs | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 340 | then show ?lhs | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 341 | using C1_differentiable_on_def vector_derivative_works by fastforce | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 342 | qed | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 343 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 344 | lemma C1_differentiable_on_subset: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 345 | "f C1_differentiable_on T \<Longrightarrow> S \<subseteq> T \<Longrightarrow> f C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 346 | unfolding C1_differentiable_on_def continuous_on_eq_continuous_within | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 347 | by (blast intro: continuous_within_subset) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 348 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 349 | lemma C1_differentiable_compose: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 350 |   assumes fg: "f C1_differentiable_on S" "g C1_differentiable_on (f ` S)" and fin: "\<And>x. finite (S \<inter> f-`{x})"
 | 
| 68339 | 351 | shows "(g \<circ> f) C1_differentiable_on S" | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 352 | proof - | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 353 | have "\<And>x. x \<in> S \<Longrightarrow> g \<circ> f differentiable at x" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 354 | by (meson C1_differentiable_on_eq assms differentiable_chain_at imageI) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 355 | moreover have "continuous_on S (\<lambda>x. vector_derivative (g \<circ> f) (at x))" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 356 | proof (rule continuous_on_eq [of _ "\<lambda>x. vector_derivative f (at x) *\<^sub>R vector_derivative g (at (f x))"]) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 357 | show "continuous_on S (\<lambda>x. vector_derivative f (at x) *\<^sub>R vector_derivative g (at (f x)))" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 358 | using fg | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 359 | apply (clarsimp simp add: C1_differentiable_on_eq) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 360 | apply (rule Limits.continuous_on_scaleR, assumption) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 361 | by (metis (mono_tags, lifting) continuous_at_imp_continuous_on continuous_on_compose continuous_on_cong differentiable_imp_continuous_within o_def) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 362 | show "\<And>x. x \<in> S \<Longrightarrow> vector_derivative f (at x) *\<^sub>R vector_derivative g (at (f x)) = vector_derivative (g \<circ> f) (at x)" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 363 | by (metis (mono_tags, hide_lams) C1_differentiable_on_eq fg imageI vector_derivative_chain_at) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 364 | qed | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 365 | ultimately show ?thesis | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 366 | by (simp add: C1_differentiable_on_eq) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 367 | qed | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 368 | |
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 369 | lemma C1_diff_imp_diff: "f C1_differentiable_on S \<Longrightarrow> f differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 370 | by (simp add: C1_differentiable_on_eq differentiable_at_imp_differentiable_on) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 371 | |
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 372 | lemma C1_differentiable_on_ident [simp, derivative_intros]: "(\<lambda>x. x) C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 373 | by (auto simp: C1_differentiable_on_eq continuous_on_const) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 374 | |
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 375 | lemma C1_differentiable_on_const [simp, derivative_intros]: "(\<lambda>z. a) C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 376 | by (auto simp: C1_differentiable_on_eq continuous_on_const) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 377 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 378 | lemma C1_differentiable_on_add [simp, derivative_intros]: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 379 | "f C1_differentiable_on S \<Longrightarrow> g C1_differentiable_on S \<Longrightarrow> (\<lambda>x. f x + g x) C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 380 | unfolding C1_differentiable_on_eq by (auto intro: continuous_intros) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 381 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 382 | lemma C1_differentiable_on_minus [simp, derivative_intros]: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 383 | "f C1_differentiable_on S \<Longrightarrow> (\<lambda>x. - f x) C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 384 | unfolding C1_differentiable_on_eq by (auto intro: continuous_intros) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 385 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 386 | lemma C1_differentiable_on_diff [simp, derivative_intros]: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 387 | "f C1_differentiable_on S \<Longrightarrow> g C1_differentiable_on S \<Longrightarrow> (\<lambda>x. f x - g x) C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 388 | unfolding C1_differentiable_on_eq by (auto intro: continuous_intros) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 389 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 390 | lemma C1_differentiable_on_mult [simp, derivative_intros]: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 391 | fixes f g :: "real \<Rightarrow> 'a :: real_normed_algebra" | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 392 | shows "f C1_differentiable_on S \<Longrightarrow> g C1_differentiable_on S \<Longrightarrow> (\<lambda>x. f x * g x) C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 393 | unfolding C1_differentiable_on_eq | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 394 | by (auto simp: continuous_on_add continuous_on_mult continuous_at_imp_continuous_on differentiable_imp_continuous_within) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 395 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 396 | lemma C1_differentiable_on_scaleR [simp, derivative_intros]: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 397 | "f C1_differentiable_on S \<Longrightarrow> g C1_differentiable_on S \<Longrightarrow> (\<lambda>x. f x *\<^sub>R g x) C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 398 | unfolding C1_differentiable_on_eq | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 399 | by (rule continuous_intros | simp add: continuous_at_imp_continuous_on differentiable_imp_continuous_within)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 400 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 401 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 402 | definition%important piecewise_C1_differentiable_on | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 403 | (infixr "piecewise'_C1'_differentiable'_on" 50) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 404 | where "f piecewise_C1_differentiable_on i \<equiv> | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 405 | continuous_on i f \<and> | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 406 | (\<exists>S. finite S \<and> (f C1_differentiable_on (i - S)))" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 407 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 408 | lemma C1_differentiable_imp_piecewise: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 409 | "f C1_differentiable_on S \<Longrightarrow> f piecewise_C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 410 | by (auto simp: piecewise_C1_differentiable_on_def C1_differentiable_on_eq continuous_at_imp_continuous_on differentiable_imp_continuous_within) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 411 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 412 | lemma piecewise_C1_imp_differentiable: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 413 | "f piecewise_C1_differentiable_on i \<Longrightarrow> f piecewise_differentiable_on i" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 414 | by (auto simp: piecewise_C1_differentiable_on_def piecewise_differentiable_on_def | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 415 | C1_differentiable_on_def differentiable_def has_vector_derivative_def | 
| 67979 
53323937ee25
new material about vec, real^1, etc.
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 416 | intro: has_derivative_at_withinI) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 417 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 418 | lemma piecewise_C1_differentiable_compose: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 419 |   assumes fg: "f piecewise_C1_differentiable_on S" "g piecewise_C1_differentiable_on (f ` S)" and fin: "\<And>x. finite (S \<inter> f-`{x})"
 | 
| 68339 | 420 | shows "(g \<circ> f) piecewise_C1_differentiable_on S" | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 421 | proof - | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 422 | have "continuous_on S (\<lambda>x. g (f x))" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 423 | by (metis continuous_on_compose2 fg order_refl piecewise_C1_differentiable_on_def) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 424 | moreover have "\<exists>T. finite T \<and> g \<circ> f C1_differentiable_on S - T" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 425 | proof - | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 426 | obtain F where "finite F" and F: "f C1_differentiable_on S - F" and f: "f piecewise_C1_differentiable_on S" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 427 | using fg by (auto simp: piecewise_C1_differentiable_on_def) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 428 | obtain G where "finite G" and G: "g C1_differentiable_on f ` S - G" and g: "g piecewise_C1_differentiable_on f ` S" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 429 | using fg by (auto simp: piecewise_C1_differentiable_on_def) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 430 | show ?thesis | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 431 | proof (intro exI conjI) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 432 |       show "finite (F \<union> (\<Union>x\<in>G. S \<inter> f-`{x}))"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 433 | using fin by (auto simp only: Int_Union \<open>finite F\<close> \<open>finite G\<close> finite_UN finite_imageI) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 434 |       show "g \<circ> f C1_differentiable_on S - (F \<union> (\<Union>x\<in>G. S \<inter> f -` {x}))"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 435 | apply (rule C1_differentiable_compose) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 436 | apply (blast intro: C1_differentiable_on_subset [OF F]) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 437 | apply (blast intro: C1_differentiable_on_subset [OF G]) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 438 | by (simp add: C1_differentiable_on_subset G Diff_Int_distrib2 fin) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 439 | qed | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 440 | qed | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 441 | ultimately show ?thesis | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 442 | by (simp add: piecewise_C1_differentiable_on_def) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 443 | qed | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 444 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 445 | lemma piecewise_C1_differentiable_on_subset: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 446 | "f piecewise_C1_differentiable_on S \<Longrightarrow> T \<le> S \<Longrightarrow> f piecewise_C1_differentiable_on T" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 447 | by (auto simp: piecewise_C1_differentiable_on_def elim!: continuous_on_subset C1_differentiable_on_subset) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 448 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 449 | lemma C1_differentiable_imp_continuous_on: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 450 | "f C1_differentiable_on S \<Longrightarrow> continuous_on S f" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 451 | unfolding C1_differentiable_on_eq continuous_on_eq_continuous_within | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 452 | using differentiable_at_withinI differentiable_imp_continuous_within by blast | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 453 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 454 | lemma C1_differentiable_on_empty [iff]: "f C1_differentiable_on {}"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 455 | unfolding C1_differentiable_on_def | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 456 | by auto | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 457 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 458 | lemma piecewise_C1_differentiable_affine: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 459 | fixes m::real | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 460 | assumes "f piecewise_C1_differentiable_on ((\<lambda>x. m * x + c) ` S)" | 
| 68339 | 461 | shows "(f \<circ> (\<lambda>x. m *\<^sub>R x + c)) piecewise_C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 462 | proof (cases "m = 0") | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 463 | case True | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 464 | then show ?thesis | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 465 | unfolding o_def by (auto simp: piecewise_C1_differentiable_on_def continuous_on_const) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 466 | next | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 467 | case False | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 468 |   have *: "\<And>x. finite (S \<inter> {y. m * y + c = x})"
 | 
| 68493 | 469 | using False not_finite_existsD by fastforce | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 470 | show ?thesis | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 471 | apply (rule piecewise_C1_differentiable_compose [OF C1_differentiable_imp_piecewise]) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 472 | apply (rule * assms derivative_intros | simp add: False vimage_def)+ | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 473 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 474 | qed | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 475 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 476 | lemma piecewise_C1_differentiable_cases: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 477 | fixes c::real | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 478 |   assumes "f piecewise_C1_differentiable_on {a..c}"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 479 |           "g piecewise_C1_differentiable_on {c..b}"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 480 | "a \<le> c" "c \<le> b" "f c = g c" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 481 |   shows "(\<lambda>x. if x \<le> c then f x else g x) piecewise_C1_differentiable_on {a..b}"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 482 | proof - | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 483 |   obtain S T where st: "f C1_differentiable_on ({a..c} - S)"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 484 |                        "g C1_differentiable_on ({c..b} - T)"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 485 | "finite S" "finite T" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 486 | using assms | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 487 | by (force simp: piecewise_C1_differentiable_on_def) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 488 |   then have f_diff: "f differentiable_on {a..<c} - S"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 489 |         and g_diff: "g differentiable_on {c<..b} - T"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 490 | by (simp_all add: C1_differentiable_on_eq differentiable_at_withinI differentiable_on_def) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 491 |   have "continuous_on {a..c} f" "continuous_on {c..b} g"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 492 | using assms piecewise_C1_differentiable_on_def by auto | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 493 |   then have cab: "continuous_on {a..b} (\<lambda>x. if x \<le> c then f x else g x)"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 494 | using continuous_on_cases [OF closed_real_atLeastAtMost [of a c], | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 495 | OF closed_real_atLeastAtMost [of c b], | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 496 | of f g "\<lambda>x. x\<le>c"] assms | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 497 | by (force simp: ivl_disj_un_two_touch) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 498 |   { fix x
 | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 499 |     assume x: "x \<in> {a..b} - insert c (S \<union> T)"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 500 | have "(\<lambda>x. if x \<le> c then f x else g x) differentiable at x" (is "?diff_fg") | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 501 | proof (cases x c rule: le_cases) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 502 | case le show ?diff_fg | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 503 | apply (rule differentiable_transform_within [where f=f and d = "dist x c"]) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 504 | using x dist_real_def le st by (auto simp: C1_differentiable_on_eq) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 505 | next | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 506 | case ge show ?diff_fg | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 507 | apply (rule differentiable_transform_within [where f=g and d = "dist x c"]) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 508 | using dist_nz x dist_real_def ge st x by (auto simp: C1_differentiable_on_eq) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 509 | qed | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 510 | } | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 511 |   then have "(\<forall>x \<in> {a..b} - insert c (S \<union> T). (\<lambda>x. if x \<le> c then f x else g x) differentiable at x)"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 512 | by auto | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 513 | moreover | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 514 |   { assume fcon: "continuous_on ({a<..<c} - S) (\<lambda>x. vector_derivative f (at x))"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 515 |        and gcon: "continuous_on ({c<..<b} - T) (\<lambda>x. vector_derivative g (at x))"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 516 |     have "open ({a<..<c} - S)"  "open ({c<..<b} - T)"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 517 | using st by (simp_all add: open_Diff finite_imp_closed) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 518 |     moreover have "continuous_on ({a<..<c} - S) (\<lambda>x. vector_derivative (\<lambda>x. if x \<le> c then f x else g x) (at x))"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 519 | proof - | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 520 | have "((\<lambda>x. if x \<le> c then f x else g x) has_vector_derivative vector_derivative f (at x)) (at x)" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 521 | if "a < x" "x < c" "x \<notin> S" for x | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 522 | proof - | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 523 | have f: "f differentiable at x" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 524 | by (meson C1_differentiable_on_eq Diff_iff atLeastAtMost_iff less_eq_real_def st(1) that) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 525 | show ?thesis | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 526 | using that | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 527 | apply (rule_tac f=f and d="dist x c" in has_vector_derivative_transform_within) | 
| 68339 | 528 | apply (auto simp: dist_norm vector_derivative_works [symmetric] f) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 529 | done | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 530 | qed | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 531 | then show ?thesis | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 532 | by (metis (no_types, lifting) continuous_on_eq [OF fcon] DiffE greaterThanLessThan_iff vector_derivative_at) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 533 | qed | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 534 |     moreover have "continuous_on ({c<..<b} - T) (\<lambda>x. vector_derivative (\<lambda>x. if x \<le> c then f x else g x) (at x))"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 535 | proof - | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 536 | have "((\<lambda>x. if x \<le> c then f x else g x) has_vector_derivative vector_derivative g (at x)) (at x)" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 537 | if "c < x" "x < b" "x \<notin> T" for x | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 538 | proof - | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 539 | have g: "g differentiable at x" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 540 | by (metis C1_differentiable_on_eq DiffD1 DiffI atLeastAtMost_diff_ends greaterThanLessThan_iff st(2) that) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 541 | show ?thesis | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 542 | using that | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 543 | apply (rule_tac f=g and d="dist x c" in has_vector_derivative_transform_within) | 
| 68339 | 544 | apply (auto simp: dist_norm vector_derivative_works [symmetric] g) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 545 | done | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 546 | qed | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 547 | then show ?thesis | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 548 | by (metis (no_types, lifting) continuous_on_eq [OF gcon] DiffE greaterThanLessThan_iff vector_derivative_at) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 549 | qed | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 550 |     ultimately have "continuous_on ({a<..<b} - insert c (S \<union> T))
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 551 | (\<lambda>x. vector_derivative (\<lambda>x. if x \<le> c then f x else g x) (at x))" | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 552 | by (rule continuous_on_subset [OF continuous_on_open_Un], auto) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 553 | } note * = this | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 554 |   have "continuous_on ({a<..<b} - insert c (S \<union> T)) (\<lambda>x. vector_derivative (\<lambda>x. if x \<le> c then f x else g x) (at x))"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 555 | using st | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 556 | by (auto simp: C1_differentiable_on_eq elim!: continuous_on_subset intro: *) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 557 |   ultimately have "\<exists>S. finite S \<and> ((\<lambda>x. if x \<le> c then f x else g x) C1_differentiable_on {a..b} - S)"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 558 |     apply (rule_tac x="{a,b,c} \<union> S \<union> T" in exI)
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 559 | using st by (auto simp: C1_differentiable_on_eq elim!: continuous_on_subset) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 560 | with cab show ?thesis | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 561 | by (simp add: piecewise_C1_differentiable_on_def) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 562 | qed | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 563 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 564 | lemma piecewise_C1_differentiable_neg: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 565 | "f piecewise_C1_differentiable_on S \<Longrightarrow> (\<lambda>x. -(f x)) piecewise_C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 566 | unfolding piecewise_C1_differentiable_on_def | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 567 | by (auto intro!: continuous_on_minus C1_differentiable_on_minus) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 568 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 569 | lemma piecewise_C1_differentiable_add: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 570 | assumes "f piecewise_C1_differentiable_on i" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 571 | "g piecewise_C1_differentiable_on i" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 572 | shows "(\<lambda>x. f x + g x) piecewise_C1_differentiable_on i" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 573 | proof - | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 574 | obtain S t where st: "finite S" "finite t" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 575 | "f C1_differentiable_on (i-S)" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 576 | "g C1_differentiable_on (i-t)" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 577 | using assms by (auto simp: piecewise_C1_differentiable_on_def) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 578 | then have "finite (S \<union> t) \<and> (\<lambda>x. f x + g x) C1_differentiable_on i - (S \<union> t)" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 579 | by (auto intro: C1_differentiable_on_add elim!: C1_differentiable_on_subset) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 580 | moreover have "continuous_on i f" "continuous_on i g" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 581 | using assms piecewise_C1_differentiable_on_def by auto | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 582 | ultimately show ?thesis | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 583 | by (auto simp: piecewise_C1_differentiable_on_def continuous_on_add) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 584 | qed | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 585 | |
| 61204 | 586 | lemma piecewise_C1_differentiable_diff: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 587 | "\<lbrakk>f piecewise_C1_differentiable_on S; g piecewise_C1_differentiable_on S\<rbrakk> | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 588 | \<Longrightarrow> (\<lambda>x. f x - g x) piecewise_C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 589 | unfolding diff_conv_add_uminus | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 590 | by (metis piecewise_C1_differentiable_add piecewise_C1_differentiable_neg) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 591 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 592 | lemma piecewise_C1_differentiable_D1: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 593 | fixes g1 :: "real \<Rightarrow> 'a::real_normed_field" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 594 |   assumes "(g1 +++ g2) piecewise_C1_differentiable_on {0..1}"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 595 |     shows "g1 piecewise_C1_differentiable_on {0..1}"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 596 | proof - | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 597 | obtain S where "finite S" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 598 |              and co12: "continuous_on ({0..1} - S) (\<lambda>x. vector_derivative (g1 +++ g2) (at x))"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 599 |              and g12D: "\<forall>x\<in>{0..1} - S. g1 +++ g2 differentiable at x"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 600 | using assms by (auto simp: piecewise_C1_differentiable_on_def C1_differentiable_on_eq) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 601 |   have g1D: "g1 differentiable at x" if "x \<in> {0..1} - insert 1 ((*) 2 ` S)" for x
 | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 602 | proof (rule differentiable_transform_within) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 603 | show "g1 +++ g2 \<circ> (*) (inverse 2) differentiable at x" | 
| 68493 | 604 | using that g12D | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 605 | apply (simp only: joinpaths_def) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 606 | by (rule differentiable_chain_at derivative_intros | force)+ | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 607 | show "\<And>x'. \<lbrakk>dist x' x < dist (x/2) (1/2)\<rbrakk> | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 608 | \<Longrightarrow> (g1 +++ g2 \<circ> (*) (inverse 2)) x' = g1 x'" | 
| 68339 | 609 | using that by (auto simp: dist_real_def joinpaths_def) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 610 | qed (use that in \<open>auto simp: dist_real_def\<close>) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 611 | have [simp]: "vector_derivative (g1 \<circ> (*) 2) (at (x/2)) = 2 *\<^sub>R vector_derivative g1 (at x)" | 
| 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 612 |                if "x \<in> {0..1} - insert 1 ((*) 2 ` S)" for x
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 613 | apply (subst vector_derivative_chain_at) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 614 | using that | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 615 | apply (rule derivative_eq_intros g1D | simp)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 616 | done | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 617 |   have "continuous_on ({0..1/2} - insert (1/2) S) (\<lambda>x. vector_derivative (g1 +++ g2) (at x))"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 618 | using co12 by (rule continuous_on_subset) force | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 619 |   then have coDhalf: "continuous_on ({0..1/2} - insert (1/2) S) (\<lambda>x. vector_derivative (g1 \<circ> (*)2) (at x))"
 | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 620 | proof (rule continuous_on_eq [OF _ vector_derivative_at]) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 621 | show "(g1 +++ g2 has_vector_derivative vector_derivative (g1 \<circ> (*) 2) (at x)) (at x)" | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 622 |       if "x \<in> {0..1/2} - insert (1/2) S" for x
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 623 | proof (rule has_vector_derivative_transform_within) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 624 | show "(g1 \<circ> (*) 2 has_vector_derivative vector_derivative (g1 \<circ> (*) 2) (at x)) (at x)" | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 625 | using that | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 626 | by (force intro: g1D differentiable_chain_at simp: vector_derivative_works [symmetric]) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 627 | show "\<And>x'. \<lbrakk>dist x' x < dist x (1/2)\<rbrakk> \<Longrightarrow> (g1 \<circ> (*) 2) x' = (g1 +++ g2) x'" | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 628 | using that by (auto simp: dist_norm joinpaths_def) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 629 | qed (use that in \<open>auto simp: dist_norm\<close>) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 630 | qed | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 631 |   have "continuous_on ({0..1} - insert 1 ((*) 2 ` S))
 | 
| 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 632 | ((\<lambda>x. 1/2 * vector_derivative (g1 \<circ> (*)2) (at x)) \<circ> (*)(1/2))" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 633 | apply (rule continuous_intros)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 634 | using coDhalf | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 635 | apply (simp add: scaleR_conv_of_real image_set_diff image_image) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 636 | done | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 637 |   then have con_g1: "continuous_on ({0..1} - insert 1 ((*) 2 ` S)) (\<lambda>x. vector_derivative g1 (at x))"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 638 | by (rule continuous_on_eq) (simp add: scaleR_conv_of_real) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 639 |   have "continuous_on {0..1} g1"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 640 | using continuous_on_joinpaths_D1 assms piecewise_C1_differentiable_on_def by blast | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 641 | with \<open>finite S\<close> show ?thesis | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 642 | apply (clarsimp simp add: piecewise_C1_differentiable_on_def C1_differentiable_on_eq) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 643 | apply (rule_tac x="insert 1 (((*)2)`S)" in exI) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 644 | apply (simp add: g1D con_g1) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 645 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 646 | qed | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 647 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 648 | lemma piecewise_C1_differentiable_D2: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 649 | fixes g2 :: "real \<Rightarrow> 'a::real_normed_field" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 650 |   assumes "(g1 +++ g2) piecewise_C1_differentiable_on {0..1}" "pathfinish g1 = pathstart g2"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 651 |     shows "g2 piecewise_C1_differentiable_on {0..1}"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 652 | proof - | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 653 | obtain S where "finite S" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 654 |              and co12: "continuous_on ({0..1} - S) (\<lambda>x. vector_derivative (g1 +++ g2) (at x))"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 655 |              and g12D: "\<forall>x\<in>{0..1} - S. g1 +++ g2 differentiable at x"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 656 | using assms by (auto simp: piecewise_C1_differentiable_on_def C1_differentiable_on_eq) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 657 |   have g2D: "g2 differentiable at x" if "x \<in> {0..1} - insert 0 ((\<lambda>x. 2*x-1) ` S)" for x
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 658 | proof (rule differentiable_transform_within) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 659 | show "g1 +++ g2 \<circ> (\<lambda>x. (x + 1) / 2) differentiable at x" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 660 | using g12D that | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 661 | apply (simp only: joinpaths_def) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 662 | apply (drule_tac x= "(x+1) / 2" in bspec, force simp: divide_simps) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 663 | apply (rule differentiable_chain_at derivative_intros | force)+ | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 664 | done | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 665 | show "\<And>x'. dist x' x < dist ((x + 1) / 2) (1/2) \<Longrightarrow> (g1 +++ g2 \<circ> (\<lambda>x. (x + 1) / 2)) x' = g2 x'" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 666 | using that by (auto simp: dist_real_def joinpaths_def field_simps) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 667 | qed (use that in \<open>auto simp: dist_norm\<close>) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 668 | have [simp]: "vector_derivative (g2 \<circ> (\<lambda>x. 2*x-1)) (at ((x+1)/2)) = 2 *\<^sub>R vector_derivative g2 (at x)" | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 669 |                if "x \<in> {0..1} - insert 0 ((\<lambda>x. 2*x-1) ` S)" for x
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 670 | using that by (auto simp: vector_derivative_chain_at divide_simps g2D) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 671 |   have "continuous_on ({1/2..1} - insert (1/2) S) (\<lambda>x. vector_derivative (g1 +++ g2) (at x))"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 672 | using co12 by (rule continuous_on_subset) force | 
| 68339 | 673 |   then have coDhalf: "continuous_on ({1/2..1} - insert (1/2) S) (\<lambda>x. vector_derivative (g2 \<circ> (\<lambda>x. 2*x-1)) (at x))"
 | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 674 | proof (rule continuous_on_eq [OF _ vector_derivative_at]) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 675 | show "(g1 +++ g2 has_vector_derivative vector_derivative (g2 \<circ> (\<lambda>x. 2 * x - 1)) (at x)) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 676 | (at x)" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 677 |       if "x \<in> {1 / 2..1} - insert (1 / 2) S" for x
 | 
| 68339 | 678 | proof (rule_tac f="g2 \<circ> (\<lambda>x. 2*x-1)" and d="dist (3/4) ((x+1)/2)" in has_vector_derivative_transform_within) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 679 | show "(g2 \<circ> (\<lambda>x. 2 * x - 1) has_vector_derivative vector_derivative (g2 \<circ> (\<lambda>x. 2 * x - 1)) (at x)) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 680 | (at x)" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 681 | using that by (force intro: g2D differentiable_chain_at simp: vector_derivative_works [symmetric]) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 682 | show "\<And>x'. \<lbrakk>dist x' x < dist (3 / 4) ((x + 1) / 2)\<rbrakk> \<Longrightarrow> (g2 \<circ> (\<lambda>x. 2 * x - 1)) x' = (g1 +++ g2) x'" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 683 | using that by (auto simp: dist_norm joinpaths_def add_divide_distrib) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 684 | qed (use that in \<open>auto simp: dist_norm\<close>) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 685 | qed | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 686 |   have [simp]: "((\<lambda>x. (x+1) / 2) ` ({0..1} - insert 0 ((\<lambda>x. 2 * x - 1) ` S))) = ({1/2..1} - insert (1/2) S)"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 687 | apply (simp add: image_set_diff inj_on_def image_image) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 688 | apply (auto simp: image_affinity_atLeastAtMost_div add_divide_distrib) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 689 | done | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 690 |   have "continuous_on ({0..1} - insert 0 ((\<lambda>x. 2*x-1) ` S))
 | 
| 68339 | 691 | ((\<lambda>x. 1/2 * vector_derivative (g2 \<circ> (\<lambda>x. 2*x-1)) (at x)) \<circ> (\<lambda>x. (x+1)/2))" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 692 | by (rule continuous_intros | simp add: coDhalf)+ | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 693 |   then have con_g2: "continuous_on ({0..1} - insert 0 ((\<lambda>x. 2*x-1) ` S)) (\<lambda>x. vector_derivative g2 (at x))"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 694 | by (rule continuous_on_eq) (simp add: scaleR_conv_of_real) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 695 |   have "continuous_on {0..1} g2"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 696 | using continuous_on_joinpaths_D2 assms piecewise_C1_differentiable_on_def by blast | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 697 | with \<open>finite S\<close> show ?thesis | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 698 | apply (clarsimp simp add: piecewise_C1_differentiable_on_def C1_differentiable_on_eq) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 699 | apply (rule_tac x="insert 0 ((\<lambda>x. 2 * x - 1) ` S)" in exI) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 700 | apply (simp add: g2D con_g2) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 701 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 702 | qed | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 703 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 704 | subsection \<open>Valid paths, and their start and finish\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 705 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 706 | definition%important valid_path :: "(real \<Rightarrow> 'a :: real_normed_vector) \<Rightarrow> bool" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 707 |   where "valid_path f \<equiv> f piecewise_C1_differentiable_on {0..1::real}"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 708 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 709 | definition closed_path :: "(real \<Rightarrow> 'a :: real_normed_vector) \<Rightarrow> bool" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 710 | where "closed_path g \<equiv> g 0 = g 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 711 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 712 | text\<open>In particular, all results for paths apply\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 713 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 714 | lemma valid_path_imp_path: "valid_path g \<Longrightarrow> path g" | 
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 715 | by (simp add: path_def piecewise_C1_differentiable_on_def valid_path_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 716 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 717 | lemma connected_valid_path_image: "valid_path g \<Longrightarrow> connected(path_image g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 718 | by (metis connected_path_image valid_path_imp_path) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 719 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 720 | lemma compact_valid_path_image: "valid_path g \<Longrightarrow> compact(path_image g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 721 | by (metis compact_path_image valid_path_imp_path) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 722 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 723 | lemma bounded_valid_path_image: "valid_path g \<Longrightarrow> bounded(path_image g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 724 | by (metis bounded_path_image valid_path_imp_path) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 725 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 726 | lemma closed_valid_path_image: "valid_path g \<Longrightarrow> closed(path_image g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 727 | by (metis closed_path_image valid_path_imp_path) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 728 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 729 | lemma valid_path_compose: | 
| 62623 
dbc62f86a1a9
rationalisation of theorem names esp about "real Archimedian" etc.
 paulson <lp15@cam.ac.uk> parents: 
62620diff
changeset | 730 | assumes "valid_path g" | 
| 64394 | 731 | and der: "\<And>x. x \<in> path_image g \<Longrightarrow> f field_differentiable (at x)" | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 732 | and con: "continuous_on (path_image g) (deriv f)" | 
| 68339 | 733 | shows "valid_path (f \<circ> g)" | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 734 | proof - | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 735 |   obtain S where "finite S" and g_diff: "g C1_differentiable_on {0..1} - S"
 | 
| 62837 | 736 | using \<open>valid_path g\<close> unfolding valid_path_def piecewise_C1_differentiable_on_def by auto | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 737 |   have "f \<circ> g differentiable at t" when "t\<in>{0..1} - S" for t
 | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 738 | proof (rule differentiable_chain_at) | 
| 62837 | 739 | show "g differentiable at t" using \<open>valid_path g\<close> | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 740 |         by (meson C1_differentiable_on_eq \<open>g C1_differentiable_on {0..1} - S\<close> that)
 | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 741 | next | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 742 | have "g t\<in>path_image g" using that DiffD1 image_eqI path_image_def by metis | 
| 68493 | 743 | then show "f differentiable at (g t)" | 
| 64394 | 744 | using der[THEN field_differentiable_imp_differentiable] by auto | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 745 | qed | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 746 |   moreover have "continuous_on ({0..1} - S) (\<lambda>x. vector_derivative (f \<circ> g) (at x))"
 | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 747 | proof (rule continuous_on_eq [where f = "\<lambda>x. vector_derivative g (at x) * deriv f (g x)"], | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 748 | rule continuous_intros) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 749 |       show "continuous_on ({0..1} - S) (\<lambda>x. vector_derivative g (at x))"
 | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 750 | using g_diff C1_differentiable_on_eq by auto | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 751 | next | 
| 62623 
dbc62f86a1a9
rationalisation of theorem names esp about "real Archimedian" etc.
 paulson <lp15@cam.ac.uk> parents: 
62620diff
changeset | 752 |       have "continuous_on {0..1} (\<lambda>x. deriv f (g x))"
 | 
| 
dbc62f86a1a9
rationalisation of theorem names esp about "real Archimedian" etc.
 paulson <lp15@cam.ac.uk> parents: 
62620diff
changeset | 753 | using continuous_on_compose[OF _ con[unfolded path_image_def],unfolded comp_def] | 
| 62837 | 754 | \<open>valid_path g\<close> piecewise_C1_differentiable_on_def valid_path_def | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 755 | by blast | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 756 |       then show "continuous_on ({0..1} - S) (\<lambda>x. deriv f (g x))"
 | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 757 | using continuous_on_subset by blast | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 758 | next | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 759 | show "vector_derivative g (at t) * deriv f (g t) = vector_derivative (f \<circ> g) (at t)" | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 760 |           when "t \<in> {0..1} - S" for t
 | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 761 | proof (rule vector_derivative_chain_at_general[symmetric]) | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 762 | show "g differentiable at t" by (meson C1_differentiable_on_eq g_diff that) | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 763 | next | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 764 | have "g t\<in>path_image g" using that DiffD1 image_eqI path_image_def by metis | 
| 64394 | 765 | then show "f field_differentiable at (g t)" using der by auto | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 766 | qed | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 767 | qed | 
| 68339 | 768 |   ultimately have "f \<circ> g C1_differentiable_on {0..1} - S"
 | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 769 | using C1_differentiable_on_eq by blast | 
| 68493 | 770 | moreover have "path (f \<circ> g)" | 
| 64394 | 771 | apply (rule path_continuous_image[OF valid_path_imp_path[OF \<open>valid_path g\<close>]]) | 
| 772 | using der | |
| 773 | by (simp add: continuous_at_imp_continuous_on field_differentiable_imp_continuous_at) | |
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 774 | ultimately show ?thesis unfolding valid_path_def piecewise_C1_differentiable_on_def path_def | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 775 | using \<open>finite S\<close> by auto | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 776 | qed | 
| 68532 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 777 | |
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 778 | lemma valid_path_uminus_comp[simp]: | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 779 | fixes g::"real \<Rightarrow> 'a ::real_normed_field" | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 780 | shows "valid_path (uminus \<circ> g) \<longleftrightarrow> valid_path g" | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 781 | proof | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 782 | show "valid_path g \<Longrightarrow> valid_path (uminus \<circ> g)" for g::"real \<Rightarrow> 'a" | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 783 | by (auto intro!: valid_path_compose derivative_intros simp add: deriv_linear[of "-1",simplified]) | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 784 | then show "valid_path g" when "valid_path (uminus \<circ> g)" | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 785 | by (metis fun.map_comp group_add_class.minus_comp_minus id_comp that) | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 786 | qed | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 787 | |
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 788 | lemma valid_path_offset[simp]: | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 789 | shows "valid_path (\<lambda>t. g t - z) \<longleftrightarrow> valid_path g" | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 790 | proof | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 791 | show *: "valid_path (g::real\<Rightarrow>'a) \<Longrightarrow> valid_path (\<lambda>t. g t - z)" for g z | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 792 | unfolding valid_path_def | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 793 | by (fastforce intro:derivative_intros C1_differentiable_imp_piecewise piecewise_C1_differentiable_diff) | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 794 | show "valid_path (\<lambda>t. g t - z) \<Longrightarrow> valid_path g" | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 795 | using *[of "\<lambda>t. g t - z" "-z",simplified] . | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 796 | qed | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 797 | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 798 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 799 | subsection\<open>Contour Integrals along a path\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 800 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 801 | text\<open>This definition is for complex numbers only, and does not generalise to line integrals in a vector field\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 802 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 803 | text\<open>piecewise differentiable function on [0,1]\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 804 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 805 | definition%important has_contour_integral :: "(complex \<Rightarrow> complex) \<Rightarrow> complex \<Rightarrow> (real \<Rightarrow> complex) \<Rightarrow> bool" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 806 | (infixr "has'_contour'_integral" 50) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 807 | where "(f has_contour_integral i) g \<equiv> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 808 |            ((\<lambda>x. f(g x) * vector_derivative g (at x within {0..1}))
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 809 |             has_integral i) {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 810 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 811 | definition%important contour_integrable_on | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 812 | (infixr "contour'_integrable'_on" 50) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 813 | where "f contour_integrable_on g \<equiv> \<exists>i. (f has_contour_integral i) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 814 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 815 | definition%important contour_integral | 
| 67613 | 816 | where "contour_integral g f \<equiv> SOME i. (f has_contour_integral i) g \<or> \<not> f contour_integrable_on g \<and> i=0" | 
| 817 | ||
| 818 | lemma not_integrable_contour_integral: "\<not> f contour_integrable_on g \<Longrightarrow> contour_integral g f = 0" | |
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 819 | unfolding contour_integrable_on_def contour_integral_def by blast | 
| 62463 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 820 | |
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 821 | lemma contour_integral_unique: "(f has_contour_integral i) g \<Longrightarrow> contour_integral g f = i" | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 822 | apply (simp add: contour_integral_def has_contour_integral_def contour_integrable_on_def) | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 823 | using has_integral_unique by blast | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 824 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 825 | lemma has_contour_integral_eqpath: | 
| 62397 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 826 | "\<lbrakk>(f has_contour_integral y) p; f contour_integrable_on \<gamma>; | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 827 | contour_integral p f = contour_integral \<gamma> f\<rbrakk> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 828 | \<Longrightarrow> (f has_contour_integral y) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 829 | using contour_integrable_on_def contour_integral_unique by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 830 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 831 | lemma has_contour_integral_integral: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 832 | "f contour_integrable_on i \<Longrightarrow> (f has_contour_integral (contour_integral i f)) i" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 833 | by (metis contour_integral_unique contour_integrable_on_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 834 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 835 | lemma has_contour_integral_unique: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 836 | "(f has_contour_integral i) g \<Longrightarrow> (f has_contour_integral j) g \<Longrightarrow> i = j" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 837 | using has_integral_unique | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 838 | by (auto simp: has_contour_integral_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 839 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 840 | lemma has_contour_integral_integrable: "(f has_contour_integral i) g \<Longrightarrow> f contour_integrable_on g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 841 | using contour_integrable_on_def by blast | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 842 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 843 | text\<open>Show that we can forget about the localized derivative.\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 844 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 845 | lemma has_integral_localized_vector_derivative: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 846 |     "((\<lambda>x. f (g x) * vector_derivative g (at x within {a..b})) has_integral i) {a..b} \<longleftrightarrow>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 847 |      ((\<lambda>x. f (g x) * vector_derivative g (at x)) has_integral i) {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 848 | proof - | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 849 |   have *: "{a..b} - {a,b} = interior {a..b}"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 850 | by (simp add: atLeastAtMost_diff_ends) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 851 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 852 |     apply (rule has_integral_spike_eq [of "{a,b}"])
 | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 853 |     apply (auto simp: at_within_interior [of _ "{a..b}"])
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 854 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 855 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 856 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 857 | lemma integrable_on_localized_vector_derivative: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 858 |     "(\<lambda>x. f (g x) * vector_derivative g (at x within {a..b})) integrable_on {a..b} \<longleftrightarrow>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 859 |      (\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 860 | by (simp add: integrable_on_def has_integral_localized_vector_derivative) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 861 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 862 | lemma has_contour_integral: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 863 | "(f has_contour_integral i) g \<longleftrightarrow> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 864 |       ((\<lambda>x. f (g x) * vector_derivative g (at x)) has_integral i) {0..1}"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 865 | by (simp add: has_integral_localized_vector_derivative has_contour_integral_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 866 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 867 | lemma contour_integrable_on: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 868 | "f contour_integrable_on g \<longleftrightarrow> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 869 |       (\<lambda>t. f(g t) * vector_derivative g (at t)) integrable_on {0..1}"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 870 | by (simp add: has_contour_integral integrable_on_def contour_integrable_on_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 871 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 872 | subsection%unimportant \<open>Reversing a path\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 873 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 874 | lemma valid_path_imp_reverse: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 875 | assumes "valid_path g" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 876 | shows "valid_path(reversepath g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 877 | proof - | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 878 |   obtain S where "finite S" and S: "g C1_differentiable_on ({0..1} - S)"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 879 | using assms by (auto simp: valid_path_def piecewise_C1_differentiable_on_def) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 880 | then have "finite ((-) 1 ` S)" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 881 | by auto | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 882 |   moreover have "(reversepath g C1_differentiable_on ({0..1} - (-) 1 ` S))"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 883 | unfolding reversepath_def | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 884 | apply (rule C1_differentiable_compose [of "\<lambda>x::real. 1-x" _ g, unfolded o_def]) | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 885 | using S | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 886 | by (force simp: finite_vimageI inj_on_def C1_differentiable_on_eq continuous_on_const elim!: continuous_on_subset)+ | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 887 | ultimately show ?thesis using assms | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 888 | by (auto simp: valid_path_def piecewise_C1_differentiable_on_def path_def [symmetric]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 889 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 890 | |
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 891 | lemma valid_path_reversepath [simp]: "valid_path(reversepath g) \<longleftrightarrow> valid_path g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 892 | using valid_path_imp_reverse by force | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 893 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 894 | lemma has_contour_integral_reversepath: | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 895 | assumes "valid_path g" and f: "(f has_contour_integral i) g" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 896 | shows "(f has_contour_integral (-i)) (reversepath g)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 897 | proof - | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 898 |   { fix S x
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 899 |     assume xs: "g C1_differentiable_on ({0..1} - S)" "x \<notin> (-) 1 ` S" "0 \<le> x" "x \<le> 1"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 900 |     have "vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) =
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 901 |             - vector_derivative g (at (1 - x) within {0..1})"
 | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 902 | proof - | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 903 | obtain f' where f': "(g has_vector_derivative f') (at (1 - x))" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 904 | using xs | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 905 | by (force simp: has_vector_derivative_def C1_differentiable_on_def) | 
| 68339 | 906 | have "(g \<circ> (\<lambda>x. 1 - x) has_vector_derivative -1 *\<^sub>R f') (at x)" | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 907 | by (intro vector_diff_chain_within has_vector_derivative_at_within [OF f'] derivative_eq_intros | simp)+ | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 908 | then have mf': "((\<lambda>x. g (1 - x)) has_vector_derivative -f') (at x)" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 909 | by (simp add: o_def) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 910 | show ?thesis | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 911 | using xs | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 912 | by (auto simp: vector_derivative_at_within_ivl [OF mf'] vector_derivative_at_within_ivl [OF f']) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 913 | qed | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 914 | } note * = this | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 915 |   obtain S where S: "continuous_on {0..1} g" "finite S" "g C1_differentiable_on {0..1} - S"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 916 | using assms by (auto simp: valid_path_def piecewise_C1_differentiable_on_def) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 917 |   have "((\<lambda>x. - (f (g (1 - x)) * vector_derivative g (at (1 - x) within {0..1}))) has_integral -i)
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 918 |        {0..1}"
 | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 919 | using has_integral_affinity01 [where m= "-1" and c=1, OF f [unfolded has_contour_integral_def]] | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 920 | by (simp add: has_integral_neg) | 
| 68493 | 921 | then show ?thesis | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 922 | using S | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 923 | apply (clarsimp simp: reversepath_def has_contour_integral_def) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 924 | apply (rule_tac S = "(\<lambda>x. 1 - x) ` S" in has_integral_spike_finite) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 925 | apply (auto simp: *) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 926 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 927 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 928 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 929 | lemma contour_integrable_reversepath: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 930 | "valid_path g \<Longrightarrow> f contour_integrable_on g \<Longrightarrow> f contour_integrable_on (reversepath g)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 931 | using has_contour_integral_reversepath contour_integrable_on_def by blast | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 932 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 933 | lemma contour_integrable_reversepath_eq: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 934 | "valid_path g \<Longrightarrow> (f contour_integrable_on (reversepath g) \<longleftrightarrow> f contour_integrable_on g)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 935 | using contour_integrable_reversepath valid_path_reversepath by fastforce | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 936 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 937 | lemma contour_integral_reversepath: | 
| 62463 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 938 | assumes "valid_path g" | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 939 | shows "contour_integral (reversepath g) f = - (contour_integral g f)" | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 940 | proof (cases "f contour_integrable_on g") | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 941 | case True then show ?thesis | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 942 | by (simp add: assms contour_integral_unique has_contour_integral_integral has_contour_integral_reversepath) | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 943 | next | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 944 | case False then have "~ f contour_integrable_on (reversepath g)" | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 945 | by (simp add: assms contour_integrable_reversepath_eq) | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 946 | with False show ?thesis by (simp add: not_integrable_contour_integral) | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 947 | qed | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 948 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 949 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 950 | subsection%unimportant \<open>Joining two paths together\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 951 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 952 | lemma valid_path_join: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 953 | assumes "valid_path g1" "valid_path g2" "pathfinish g1 = pathstart g2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 954 | shows "valid_path(g1 +++ g2)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 955 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 956 | have "g1 1 = g2 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 957 | using assms by (auto simp: pathfinish_def pathstart_def) | 
| 68339 | 958 |   moreover have "(g1 \<circ> (\<lambda>x. 2*x)) piecewise_C1_differentiable_on {0..1/2}"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 959 | apply (rule piecewise_C1_differentiable_compose) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 960 | using assms | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 961 | apply (auto simp: valid_path_def piecewise_C1_differentiable_on_def continuous_on_joinpaths) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 962 | apply (force intro: finite_vimageI [where h = "(*)2"] inj_onI) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 963 | done | 
| 68339 | 964 |   moreover have "(g2 \<circ> (\<lambda>x. 2*x-1)) piecewise_C1_differentiable_on {1/2..1}"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 965 | apply (rule piecewise_C1_differentiable_compose) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 966 | using assms unfolding valid_path_def piecewise_C1_differentiable_on_def | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 967 | by (auto intro!: continuous_intros finite_vimageI [where h = "(\<lambda>x. 2*x - 1)"] inj_onI | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 968 | simp: image_affinity_atLeastAtMost_diff continuous_on_joinpaths) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 969 | ultimately show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 970 | apply (simp only: valid_path_def continuous_on_joinpaths joinpaths_def) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 971 | apply (rule piecewise_C1_differentiable_cases) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 972 | apply (auto simp: o_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 973 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 974 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 975 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 976 | lemma valid_path_join_D1: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 977 | fixes g1 :: "real \<Rightarrow> 'a::real_normed_field" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 978 | shows "valid_path (g1 +++ g2) \<Longrightarrow> valid_path g1" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 979 | unfolding valid_path_def | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 980 | by (rule piecewise_C1_differentiable_D1) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 981 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 982 | lemma valid_path_join_D2: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 983 | fixes g2 :: "real \<Rightarrow> 'a::real_normed_field" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 984 | shows "\<lbrakk>valid_path (g1 +++ g2); pathfinish g1 = pathstart g2\<rbrakk> \<Longrightarrow> valid_path g2" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 985 | unfolding valid_path_def | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 986 | by (rule piecewise_C1_differentiable_D2) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 987 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 988 | lemma valid_path_join_eq [simp]: | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 989 | fixes g2 :: "real \<Rightarrow> 'a::real_normed_field" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 990 | shows "pathfinish g1 = pathstart g2 \<Longrightarrow> (valid_path(g1 +++ g2) \<longleftrightarrow> valid_path g1 \<and> valid_path g2)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 991 | using valid_path_join_D1 valid_path_join_D2 valid_path_join by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 992 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 993 | lemma has_contour_integral_join: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 994 | assumes "(f has_contour_integral i1) g1" "(f has_contour_integral i2) g2" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 995 | "valid_path g1" "valid_path g2" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 996 | shows "(f has_contour_integral (i1 + i2)) (g1 +++ g2)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 997 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 998 | obtain s1 s2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 999 |     where s1: "finite s1" "\<forall>x\<in>{0..1} - s1. g1 differentiable at x"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1000 |       and s2: "finite s2" "\<forall>x\<in>{0..1} - s2. g2 differentiable at x"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1001 | using assms | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1002 | by (auto simp: valid_path_def piecewise_C1_differentiable_on_def C1_differentiable_on_eq) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1003 |   have 1: "((\<lambda>x. f (g1 x) * vector_derivative g1 (at x)) has_integral i1) {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1004 |    and 2: "((\<lambda>x. f (g2 x) * vector_derivative g2 (at x)) has_integral i2) {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1005 | using assms | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1006 | by (auto simp: has_contour_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1007 |   have i1: "((\<lambda>x. (2*f (g1 (2*x))) * vector_derivative g1 (at (2*x))) has_integral i1) {0..1/2}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1008 |    and i2: "((\<lambda>x. (2*f (g2 (2*x - 1))) * vector_derivative g2 (at (2*x - 1))) has_integral i2) {1/2..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1009 | using has_integral_affinity01 [OF 1, where m= 2 and c=0, THEN has_integral_cmul [where c=2]] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1010 | has_integral_affinity01 [OF 2, where m= 2 and c="-1", THEN has_integral_cmul [where c=2]] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1011 | by (simp_all only: image_affinity_atLeastAtMost_div_diff, simp_all add: scaleR_conv_of_real mult_ac) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1012 | have g1: "\<lbrakk>0 \<le> z; z*2 < 1; z*2 \<notin> s1\<rbrakk> \<Longrightarrow> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1013 | vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at z) = | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1014 | 2 *\<^sub>R vector_derivative g1 (at (z*2))" for z | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1015 | apply (rule vector_derivative_at [OF has_vector_derivative_transform_within [where f = "(\<lambda>x. g1(2*x))" and d = "\<bar>z - 1/2\<bar>"]]) | 
| 62390 | 1016 | apply (simp_all add: dist_real_def abs_if split: if_split_asm) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1017 | apply (rule vector_diff_chain_at [of "\<lambda>x. 2*x" 2 _ g1, simplified o_def]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1018 | apply (simp add: has_vector_derivative_def has_derivative_def bounded_linear_mult_left) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1019 | using s1 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1020 | apply (auto simp: algebra_simps vector_derivative_works) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1021 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1022 | have g2: "\<lbrakk>1 < z*2; z \<le> 1; z*2 - 1 \<notin> s2\<rbrakk> \<Longrightarrow> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1023 | vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at z) = | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1024 | 2 *\<^sub>R vector_derivative g2 (at (z*2 - 1))" for z | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1025 | apply (rule vector_derivative_at [OF has_vector_derivative_transform_within [where f = "(\<lambda>x. g2 (2*x - 1))" and d = "\<bar>z - 1/2\<bar>"]]) | 
| 62390 | 1026 | apply (simp_all add: dist_real_def abs_if split: if_split_asm) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1027 | apply (rule vector_diff_chain_at [of "\<lambda>x. 2*x - 1" 2 _ g2, simplified o_def]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1028 | apply (simp add: has_vector_derivative_def has_derivative_def bounded_linear_mult_left) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1029 | using s2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1030 | apply (auto simp: algebra_simps vector_derivative_works) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1031 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1032 |   have "((\<lambda>x. f ((g1 +++ g2) x) * vector_derivative (g1 +++ g2) (at x)) has_integral i1) {0..1/2}"
 | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 1033 | apply (rule has_integral_spike_finite [OF _ _ i1, of "insert (1/2) ((*)2 -` s1)"]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1034 | using s1 | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 1035 | apply (force intro: finite_vimageI [where h = "(*)2"] inj_onI) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1036 | apply (clarsimp simp add: joinpaths_def scaleR_conv_of_real mult_ac g1) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1037 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1038 |   moreover have "((\<lambda>x. f ((g1 +++ g2) x) * vector_derivative (g1 +++ g2) (at x)) has_integral i2) {1/2..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1039 | apply (rule has_integral_spike_finite [OF _ _ i2, of "insert (1/2) ((\<lambda>x. 2*x-1) -` s2)"]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1040 | using s2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1041 | apply (force intro: finite_vimageI [where h = "\<lambda>x. 2*x-1"] inj_onI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1042 | apply (clarsimp simp add: joinpaths_def scaleR_conv_of_real mult_ac g2) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1043 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1044 | ultimately | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1045 | show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1046 | apply (simp add: has_contour_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1047 | apply (rule has_integral_combine [where c = "1/2"], auto) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1048 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1049 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1050 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1051 | lemma contour_integrable_joinI: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1052 | assumes "f contour_integrable_on g1" "f contour_integrable_on g2" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1053 | "valid_path g1" "valid_path g2" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1054 | shows "f contour_integrable_on (g1 +++ g2)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1055 | using assms | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1056 | by (meson has_contour_integral_join contour_integrable_on_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1057 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1058 | lemma contour_integrable_joinD1: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1059 | assumes "f contour_integrable_on (g1 +++ g2)" "valid_path g1" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1060 | shows "f contour_integrable_on g1" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1061 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1062 | obtain s1 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1063 |     where s1: "finite s1" "\<forall>x\<in>{0..1} - s1. g1 differentiable at x"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1064 | using assms by (auto simp: valid_path_def piecewise_C1_differentiable_on_def C1_differentiable_on_eq) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1065 |   have "(\<lambda>x. f ((g1 +++ g2) (x/2)) * vector_derivative (g1 +++ g2) (at (x/2))) integrable_on {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1066 | using assms | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1067 | apply (auto simp: contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1068 | apply (drule integrable_on_subcbox [where a=0 and b="1/2"]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1069 | apply (auto intro: integrable_affinity [of _ 0 "1/2::real" "1/2" 0, simplified]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1070 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1071 |   then have *: "(\<lambda>x. (f ((g1 +++ g2) (x/2))/2) * vector_derivative (g1 +++ g2) (at (x/2))) integrable_on {0..1}"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1072 | by (auto dest: integrable_cmul [where c="1/2"] simp: scaleR_conv_of_real) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1073 | have g1: "\<lbrakk>0 < z; z < 1; z \<notin> s1\<rbrakk> \<Longrightarrow> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1074 | vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at (z/2)) = | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1075 | 2 *\<^sub>R vector_derivative g1 (at z)" for z | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1076 | apply (rule vector_derivative_at [OF has_vector_derivative_transform_within [where f = "(\<lambda>x. g1(2*x))" and d = "\<bar>(z-1)/2\<bar>"]]) | 
| 62390 | 1077 | apply (simp_all add: field_simps dist_real_def abs_if split: if_split_asm) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1078 | apply (rule vector_diff_chain_at [of "\<lambda>x. x*2" 2 _ g1, simplified o_def]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1079 | using s1 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1080 | apply (auto simp: vector_derivative_works has_vector_derivative_def has_derivative_def bounded_linear_mult_left) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1081 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1082 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1083 | using s1 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1084 | apply (auto simp: contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1085 |     apply (rule integrable_spike_finite [of "{0,1} \<union> s1", OF _ _ *])
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1086 | apply (auto simp: joinpaths_def scaleR_conv_of_real g1) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1087 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1088 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1089 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1090 | lemma contour_integrable_joinD2: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1091 | assumes "f contour_integrable_on (g1 +++ g2)" "valid_path g2" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1092 | shows "f contour_integrable_on g2" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1093 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1094 | obtain s2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1095 |     where s2: "finite s2" "\<forall>x\<in>{0..1} - s2. g2 differentiable at x"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1096 | using assms by (auto simp: valid_path_def piecewise_C1_differentiable_on_def C1_differentiable_on_eq) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1097 |   have "(\<lambda>x. f ((g1 +++ g2) (x/2 + 1/2)) * vector_derivative (g1 +++ g2) (at (x/2 + 1/2))) integrable_on {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1098 | using assms | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1099 | apply (auto simp: contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1100 | apply (drule integrable_on_subcbox [where a="1/2" and b=1], auto) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1101 | apply (drule integrable_affinity [of _ "1/2::real" 1 "1/2" "1/2", simplified]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1102 | apply (simp add: image_affinity_atLeastAtMost_diff) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1103 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1104 | then have *: "(\<lambda>x. (f ((g1 +++ g2) (x/2 + 1/2))/2) * vector_derivative (g1 +++ g2) (at (x/2 + 1/2))) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1105 |                 integrable_on {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1106 | by (auto dest: integrable_cmul [where c="1/2"] simp: scaleR_conv_of_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1107 | have g2: "\<lbrakk>0 < z; z < 1; z \<notin> s2\<rbrakk> \<Longrightarrow> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1108 | vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at (z/2+1/2)) = | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1109 | 2 *\<^sub>R vector_derivative g2 (at z)" for z | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1110 | apply (rule vector_derivative_at [OF has_vector_derivative_transform_within [where f = "(\<lambda>x. g2(2*x-1))" and d = "\<bar>z/2\<bar>"]]) | 
| 62390 | 1111 | apply (simp_all add: field_simps dist_real_def abs_if split: if_split_asm) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1112 | apply (rule vector_diff_chain_at [of "\<lambda>x. x*2-1" 2 _ g2, simplified o_def]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1113 | using s2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1114 | apply (auto simp: has_vector_derivative_def has_derivative_def bounded_linear_mult_left | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1115 | vector_derivative_works add_divide_distrib) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1116 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1117 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1118 | using s2 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1119 | apply (auto simp: contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1120 |     apply (rule integrable_spike_finite [of "{0,1} \<union> s2", OF _ _ *])
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1121 | apply (auto simp: joinpaths_def scaleR_conv_of_real g2) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1122 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1123 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1124 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1125 | lemma contour_integrable_join [simp]: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1126 | shows | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1127 | "\<lbrakk>valid_path g1; valid_path g2\<rbrakk> | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1128 | \<Longrightarrow> f contour_integrable_on (g1 +++ g2) \<longleftrightarrow> f contour_integrable_on g1 \<and> f contour_integrable_on g2" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1129 | using contour_integrable_joinD1 contour_integrable_joinD2 contour_integrable_joinI by blast | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1130 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1131 | lemma contour_integral_join [simp]: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1132 | shows | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1133 | "\<lbrakk>f contour_integrable_on g1; f contour_integrable_on g2; valid_path g1; valid_path g2\<rbrakk> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1134 | \<Longrightarrow> contour_integral (g1 +++ g2) f = contour_integral g1 f + contour_integral g2 f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1135 | by (simp add: has_contour_integral_integral has_contour_integral_join contour_integral_unique) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1136 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1137 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 1138 | subsection%unimportant \<open>Shifting the starting point of a (closed) path\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1139 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1140 | lemma shiftpath_alt_def: "shiftpath a f = (\<lambda>x. if x \<le> 1-a then f (a + x) else f (a + x - 1))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1141 | by (auto simp: shiftpath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1142 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1143 | lemma valid_path_shiftpath [intro]: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1144 |   assumes "valid_path g" "pathfinish g = pathstart g" "a \<in> {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1145 | shows "valid_path(shiftpath a g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1146 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1147 | apply (auto simp: valid_path_def shiftpath_alt_def) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1148 | apply (rule piecewise_C1_differentiable_cases) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1149 | apply (auto simp: algebra_simps) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1150 | apply (rule piecewise_C1_differentiable_affine [of g 1 a, simplified o_def scaleR_one]) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1151 | apply (auto simp: pathfinish_def pathstart_def elim: piecewise_C1_differentiable_on_subset) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1152 | apply (rule piecewise_C1_differentiable_affine [of g 1 "a-1", simplified o_def scaleR_one algebra_simps]) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1153 | apply (auto simp: pathfinish_def pathstart_def elim: piecewise_C1_differentiable_on_subset) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1154 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1155 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1156 | lemma has_contour_integral_shiftpath: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1157 | assumes f: "(f has_contour_integral i) g" "valid_path g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1158 |       and a: "a \<in> {0..1}"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1159 | shows "(f has_contour_integral i) (shiftpath a g)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1160 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1161 | obtain s | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1162 |     where s: "finite s" and g: "\<forall>x\<in>{0..1} - s. g differentiable at x"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1163 | using assms by (auto simp: valid_path_def piecewise_C1_differentiable_on_def C1_differentiable_on_eq) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1164 |   have *: "((\<lambda>x. f (g x) * vector_derivative g (at x)) has_integral i) {0..1}"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1165 | using assms by (auto simp: has_contour_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1166 |   then have i: "i = integral {a..1} (\<lambda>x. f (g x) * vector_derivative g (at x)) +
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1167 |                     integral {0..a} (\<lambda>x. f (g x) * vector_derivative g (at x))"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1168 | apply (rule has_integral_unique) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1169 | apply (subst add.commute) | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 1170 | apply (subst integral_combine) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1171 | using assms * integral_unique by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1172 |   { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1173 | have "0 \<le> x \<Longrightarrow> x + a < 1 \<Longrightarrow> x \<notin> (\<lambda>x. x - a) ` s \<Longrightarrow> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1174 | vector_derivative (shiftpath a g) (at x) = vector_derivative g (at (x + a))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1175 | unfolding shiftpath_def | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1176 | apply (rule vector_derivative_at [OF has_vector_derivative_transform_within [where f = "(\<lambda>x. g(a+x))" and d = "dist(1-a) x"]]) | 
| 62390 | 1177 | apply (auto simp: field_simps dist_real_def abs_if split: if_split_asm) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1178 | apply (rule vector_diff_chain_at [of "\<lambda>x. x+a" 1 _ g, simplified o_def scaleR_one]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1179 | apply (intro derivative_eq_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1180 | using g | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1181 | apply (drule_tac x="x+a" in bspec) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1182 | using a apply (auto simp: has_vector_derivative_def vector_derivative_works image_def add.commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1183 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1184 | } note vd1 = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1185 |   { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1186 | have "1 < x + a \<Longrightarrow> x \<le> 1 \<Longrightarrow> x \<notin> (\<lambda>x. x - a + 1) ` s \<Longrightarrow> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1187 | vector_derivative (shiftpath a g) (at x) = vector_derivative g (at (x + a - 1))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1188 | unfolding shiftpath_def | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1189 | apply (rule vector_derivative_at [OF has_vector_derivative_transform_within [where f = "(\<lambda>x. g(a+x-1))" and d = "dist (1-a) x"]]) | 
| 62390 | 1190 | apply (auto simp: field_simps dist_real_def abs_if split: if_split_asm) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1191 | apply (rule vector_diff_chain_at [of "\<lambda>x. x+a-1" 1 _ g, simplified o_def scaleR_one]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1192 | apply (intro derivative_eq_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1193 | using g | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1194 | apply (drule_tac x="x+a-1" in bspec) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1195 | using a apply (auto simp: has_vector_derivative_def vector_derivative_works image_def add.commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1196 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1197 | } note vd2 = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1198 |   have va1: "(\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on ({a..1})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1199 | using * a by (fastforce intro: integrable_subinterval_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1200 |   have v0a: "(\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on ({0..a})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1201 | apply (rule integrable_subinterval_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1202 | using * a by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1203 | have "((\<lambda>x. f (shiftpath a g x) * vector_derivative (shiftpath a g) (at x)) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1204 |         has_integral  integral {a..1} (\<lambda>x. f (g x) * vector_derivative g (at x)))  {0..1 - a}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1205 | apply (rule has_integral_spike_finite | 
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 1206 |              [where S = "{1-a} \<union> (\<lambda>x. x-a) ` s" and f = "\<lambda>x. f(g(a+x)) * vector_derivative g (at(a+x))"])
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1207 | using s apply blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1208 | using a apply (auto simp: algebra_simps vd1) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1209 | apply (force simp: shiftpath_def add.commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1210 | using has_integral_affinity [where m=1 and c=a, simplified, OF integrable_integral [OF va1]] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1211 | apply (simp add: image_affinity_atLeastAtMost_diff [where m=1 and c=a, simplified] add.commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1212 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1213 | moreover | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1214 | have "((\<lambda>x. f (shiftpath a g x) * vector_derivative (shiftpath a g) (at x)) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1215 |         has_integral  integral {0..a} (\<lambda>x. f (g x) * vector_derivative g (at x)))  {1 - a..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1216 | apply (rule has_integral_spike_finite | 
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 1217 |              [where S = "{1-a} \<union> (\<lambda>x. x-a+1) ` s" and f = "\<lambda>x. f(g(a+x-1)) * vector_derivative g (at(a+x-1))"])
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1218 | using s apply blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1219 | using a apply (auto simp: algebra_simps vd2) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1220 | apply (force simp: shiftpath_def add.commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1221 | using has_integral_affinity [where m=1 and c="a-1", simplified, OF integrable_integral [OF v0a]] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1222 | apply (simp add: image_affinity_atLeastAtMost [where m=1 and c="1-a", simplified]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1223 | apply (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1224 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1225 | ultimately show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1226 | using a | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1227 | by (auto simp: i has_contour_integral intro: has_integral_combine [where c = "1-a"]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1228 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1229 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1230 | lemma has_contour_integral_shiftpath_D: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1231 | assumes "(f has_contour_integral i) (shiftpath a g)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1232 |           "valid_path g" "pathfinish g = pathstart g" "a \<in> {0..1}"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1233 | shows "(f has_contour_integral i) g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1234 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1235 | obtain s | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1236 |     where s: "finite s" and g: "\<forall>x\<in>{0..1} - s. g differentiable at x"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1237 | using assms by (auto simp: valid_path_def piecewise_C1_differentiable_on_def C1_differentiable_on_eq) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1238 |   { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1239 | assume x: "0 < x" "x < 1" "x \<notin> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1240 | then have gx: "g differentiable at x" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1241 | using g by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1242 |     have "vector_derivative g (at x within {0..1}) =
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1243 |           vector_derivative (shiftpath (1 - a) (shiftpath a g)) (at x within {0..1})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1244 | apply (rule vector_derivative_at_within_ivl | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1245 | [OF has_vector_derivative_transform_within_open | 
| 68239 | 1246 |                       [where f = "(shiftpath (1 - a) (shiftpath a g))" and S = "{0<..<1}-s"]])
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1247 | using s g assms x | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1248 | apply (auto simp: finite_imp_closed open_Diff shiftpath_shiftpath | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1249 |                         at_within_interior [of _ "{0..1}"] vector_derivative_works [symmetric])
 | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1250 | apply (rule differentiable_transform_within [OF gx, of "min x (1-x)"]) | 
| 62390 | 1251 | apply (auto simp: dist_real_def shiftpath_shiftpath abs_if split: if_split_asm) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1252 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1253 | } note vd = this | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1254 | have fi: "(f has_contour_integral i) (shiftpath (1 - a) (shiftpath a g))" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1255 | using assms by (auto intro!: has_contour_integral_shiftpath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1256 | show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1257 | apply (simp add: has_contour_integral_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1258 |     apply (rule has_integral_spike_finite [of "{0,1} \<union> s", OF _ _  fi [unfolded has_contour_integral_def]])
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1259 | using s assms vd | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1260 | apply (auto simp: Path_Connected.shiftpath_shiftpath) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1261 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1262 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1263 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1264 | lemma has_contour_integral_shiftpath_eq: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1265 |   assumes "valid_path g" "pathfinish g = pathstart g" "a \<in> {0..1}"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1266 | shows "(f has_contour_integral i) (shiftpath a g) \<longleftrightarrow> (f has_contour_integral i) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1267 | using assms has_contour_integral_shiftpath has_contour_integral_shiftpath_D by blast | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1268 | |
| 62463 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1269 | lemma contour_integrable_on_shiftpath_eq: | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1270 |   assumes "valid_path g" "pathfinish g = pathstart g" "a \<in> {0..1}"
 | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1271 | shows "f contour_integrable_on (shiftpath a g) \<longleftrightarrow> f contour_integrable_on g" | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1272 | using assms contour_integrable_on_def has_contour_integral_shiftpath_eq by auto | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1273 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1274 | lemma contour_integral_shiftpath: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1275 |   assumes "valid_path g" "pathfinish g = pathstart g" "a \<in> {0..1}"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1276 | shows "contour_integral (shiftpath a g) f = contour_integral g f" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 1277 | using assms | 
| 62463 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1278 | by (simp add: contour_integral_def contour_integrable_on_def has_contour_integral_shiftpath_eq) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1279 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1280 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 1281 | subsection%unimportant \<open>More about straight-line paths\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1282 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1283 | lemma has_vector_derivative_linepath_within: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1284 | "(linepath a b has_vector_derivative (b - a)) (at x within s)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1285 | apply (simp add: linepath_def has_vector_derivative_def algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1286 | apply (rule derivative_eq_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1287 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1288 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1289 | lemma vector_derivative_linepath_within: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1290 |     "x \<in> {0..1} \<Longrightarrow> vector_derivative (linepath a b) (at x within {0..1}) = b - a"
 | 
| 67685 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 immler parents: 
67613diff
changeset | 1291 | apply (rule vector_derivative_within_cbox [of 0 "1::real", simplified]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1292 | apply (auto simp: has_vector_derivative_linepath_within) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1293 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1294 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1295 | lemma vector_derivative_linepath_at [simp]: "vector_derivative (linepath a b) (at x) = b - a" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1296 | by (simp add: has_vector_derivative_linepath_within vector_derivative_at) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1297 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1298 | lemma valid_path_linepath [iff]: "valid_path (linepath a b)" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1299 | apply (simp add: valid_path_def piecewise_C1_differentiable_on_def C1_differentiable_on_eq continuous_on_linepath) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1300 |   apply (rule_tac x="{}" in exI)
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1301 | apply (simp add: differentiable_on_def differentiable_def) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1302 | using has_vector_derivative_def has_vector_derivative_linepath_within | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1303 | apply (fastforce simp add: continuous_on_eq_continuous_within) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1304 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1305 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1306 | lemma has_contour_integral_linepath: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1307 | shows "(f has_contour_integral i) (linepath a b) \<longleftrightarrow> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1308 |          ((\<lambda>x. f(linepath a b x) * (b - a)) has_integral i) {0..1}"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1309 | by (simp add: has_contour_integral vector_derivative_linepath_at) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1310 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1311 | lemma linepath_in_path: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1312 |   shows "x \<in> {0..1} \<Longrightarrow> linepath a b x \<in> closed_segment a b"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1313 | by (auto simp: segment linepath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1314 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1315 | lemma linepath_image_01: "linepath a b ` {0..1} = closed_segment a b"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1316 | by (auto simp: segment linepath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1317 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1318 | lemma linepath_in_convex_hull: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1319 | fixes x::real | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1320 | assumes a: "a \<in> convex hull s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1321 | and b: "b \<in> convex hull s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1322 | and x: "0\<le>x" "x\<le>1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1323 | shows "linepath a b x \<in> convex hull s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1324 | apply (rule closed_segment_subset_convex_hull [OF a b, THEN subsetD]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1325 | using x | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1326 | apply (auto simp: linepath_image_01 [symmetric]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1327 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1328 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1329 | lemma Re_linepath: "Re(linepath (of_real a) (of_real b) x) = (1 - x)*a + x*b" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1330 | by (simp add: linepath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1331 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1332 | lemma Im_linepath: "Im(linepath (of_real a) (of_real b) x) = 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1333 | by (simp add: linepath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1334 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1335 | lemma has_contour_integral_trivial [iff]: "(f has_contour_integral 0) (linepath a a)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1336 | by (simp add: has_contour_integral_linepath) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1337 | |
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1338 | lemma has_contour_integral_trivial_iff [simp]: "(f has_contour_integral i) (linepath a a) \<longleftrightarrow> i=0" | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1339 | using has_contour_integral_unique by blast | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1340 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1341 | lemma contour_integral_trivial [simp]: "contour_integral (linepath a a) f = 0" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1342 | using has_contour_integral_trivial contour_integral_unique by blast | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1343 | |
| 68721 | 1344 | lemma differentiable_linepath [intro]: "linepath a b differentiable at x within A" | 
| 1345 | by (auto simp: linepath_def) | |
| 1346 | ||
| 1347 | lemma bounded_linear_linepath: | |
| 1348 | assumes "bounded_linear f" | |
| 1349 | shows "f (linepath a b x) = linepath (f a) (f b) x" | |
| 1350 | proof - | |
| 1351 | interpret f: bounded_linear f by fact | |
| 1352 | show ?thesis by (simp add: linepath_def f.add f.scale) | |
| 1353 | qed | |
| 1354 | ||
| 1355 | lemma bounded_linear_linepath': | |
| 1356 | assumes "bounded_linear f" | |
| 1357 | shows "f \<circ> linepath a b = linepath (f a) (f b)" | |
| 1358 | using bounded_linear_linepath[OF assms] by (simp add: fun_eq_iff) | |
| 1359 | ||
| 1360 | lemma cnj_linepath: "cnj (linepath a b x) = linepath (cnj a) (cnj b) x" | |
| 1361 | by (simp add: linepath_def) | |
| 1362 | ||
| 1363 | lemma cnj_linepath': "cnj \<circ> linepath a b = linepath (cnj a) (cnj b)" | |
| 1364 | by (simp add: linepath_def fun_eq_iff) | |
| 1365 | ||
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1366 | subsection\<open>Relation to subpath construction\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1367 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1368 | lemma valid_path_subpath: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1369 | fixes g :: "real \<Rightarrow> 'a :: real_normed_vector" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1370 |   assumes "valid_path g" "u \<in> {0..1}" "v \<in> {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1371 | shows "valid_path(subpath u v g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1372 | proof (cases "v=u") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1373 | case True | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1374 | then show ?thesis | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1375 | unfolding valid_path_def subpath_def | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1376 | by (force intro: C1_differentiable_on_const C1_differentiable_imp_piecewise) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1377 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1378 | case False | 
| 68339 | 1379 |   have "(g \<circ> (\<lambda>x. ((v-u) * x + u))) piecewise_C1_differentiable_on {0..1}"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1380 | apply (rule piecewise_C1_differentiable_compose) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1381 | apply (simp add: C1_differentiable_imp_piecewise) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1382 | apply (simp add: image_affinity_atLeastAtMost) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1383 | using assms False | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1384 | apply (auto simp: algebra_simps valid_path_def piecewise_C1_differentiable_on_subset) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1385 | apply (subst Int_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1386 | apply (auto simp: inj_on_def algebra_simps crossproduct_eq finite_vimage_IntI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1387 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1388 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1389 | by (auto simp: o_def valid_path_def subpath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1390 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1391 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1392 | lemma has_contour_integral_subpath_refl [iff]: "(f has_contour_integral 0) (subpath u u g)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1393 | by (simp add: has_contour_integral subpath_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1394 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1395 | lemma contour_integrable_subpath_refl [iff]: "f contour_integrable_on (subpath u u g)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1396 | using has_contour_integral_subpath_refl contour_integrable_on_def by blast | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1397 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1398 | lemma contour_integral_subpath_refl [simp]: "contour_integral (subpath u u g) f = 0" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1399 | by (simp add: has_contour_integral_subpath_refl contour_integral_unique) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1400 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1401 | lemma has_contour_integral_subpath: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1402 | assumes f: "f contour_integrable_on g" and g: "valid_path g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1403 |       and uv: "u \<in> {0..1}" "v \<in> {0..1}" "u \<le> v"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1404 |     shows "(f has_contour_integral  integral {u..v} (\<lambda>x. f(g x) * vector_derivative g (at x)))
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1405 | (subpath u v g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1406 | proof (cases "v=u") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1407 | case True | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1408 | then show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1409 | using f by (simp add: contour_integrable_on_def subpath_def has_contour_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1410 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1411 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1412 |   obtain s where s: "\<And>x. x \<in> {0..1} - s \<Longrightarrow> g differentiable at x" and fs: "finite s"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1413 | using g unfolding piecewise_C1_differentiable_on_def C1_differentiable_on_eq valid_path_def by blast | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1414 | have *: "((\<lambda>x. f (g ((v - u) * x + u)) * vector_derivative g (at ((v - u) * x + u))) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1415 |             has_integral (1 / (v - u)) * integral {u..v} (\<lambda>t. f (g t) * vector_derivative g (at t)))
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1416 |            {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1417 | using f uv | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1418 | apply (simp add: contour_integrable_on subpath_def has_contour_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1419 | apply (drule integrable_on_subcbox [where a=u and b=v, simplified]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1420 | apply (simp_all add: has_integral_integral) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1421 | apply (drule has_integral_affinity [where m="v-u" and c=u, simplified]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1422 | apply (simp_all add: False image_affinity_atLeastAtMost_div_diff scaleR_conv_of_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1423 | apply (simp add: divide_simps False) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1424 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1425 |   { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1426 |     have "x \<in> {0..1} \<Longrightarrow>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1427 | x \<notin> (\<lambda>t. (v-u) *\<^sub>R t + u) -` s \<Longrightarrow> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1428 | vector_derivative (\<lambda>x. g ((v-u) * x + u)) (at x) = (v-u) *\<^sub>R vector_derivative g (at ((v-u) * x + u))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1429 | apply (rule vector_derivative_at [OF vector_diff_chain_at [simplified o_def]]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1430 | apply (intro derivative_eq_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1431 | apply (cut_tac s [of "(v - u) * x + u"]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1432 | using uv mult_left_le [of x "v-u"] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1433 | apply (auto simp: vector_derivative_works) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1434 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1435 | } note vd = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1436 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1437 | apply (cut_tac has_integral_cmul [OF *, where c = "v-u"]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1438 | using fs assms | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1439 | apply (simp add: False subpath_def has_contour_integral) | 
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 1440 | apply (rule_tac S = "(\<lambda>t. ((v-u) *\<^sub>R t + u)) -` s" in has_integral_spike_finite) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1441 | apply (auto simp: inj_on_def False finite_vimageI vd scaleR_conv_of_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1442 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1443 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1444 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1445 | lemma contour_integrable_subpath: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1446 |   assumes "f contour_integrable_on g" "valid_path g" "u \<in> {0..1}" "v \<in> {0..1}"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1447 | shows "f contour_integrable_on (subpath u v g)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1448 | apply (cases u v rule: linorder_class.le_cases) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1449 | apply (metis contour_integrable_on_def has_contour_integral_subpath [OF assms]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1450 | apply (subst reversepath_subpath [symmetric]) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1451 | apply (rule contour_integrable_reversepath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1452 | using assms apply (blast intro: valid_path_subpath) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1453 | apply (simp add: contour_integrable_on_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1454 | using assms apply (blast intro: has_contour_integral_subpath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1455 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1456 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1457 | lemma has_integral_contour_integral_subpath: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1458 |   assumes "f contour_integrable_on g" "valid_path g" "u \<in> {0..1}" "v \<in> {0..1}" "u \<le> v"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1459 | shows "(((\<lambda>x. f(g x) * vector_derivative g (at x))) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1460 |             has_integral  contour_integral (subpath u v g) f) {u..v}"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1461 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1462 | apply (auto simp: has_integral_integrable_integral) | 
| 66507 
678774070c9b
renamed s to S to work with previous change
 paulson <lp15@cam.ac.uk> parents: 
66294diff
changeset | 1463 |   apply (rule integrable_on_subcbox [where a=u and b=v and S = "{0..1}", simplified])
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1464 | apply (auto simp: contour_integral_unique [OF has_contour_integral_subpath] contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1465 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1466 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1467 | lemma contour_integral_subcontour_integral: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1468 |   assumes "f contour_integrable_on g" "valid_path g" "u \<in> {0..1}" "v \<in> {0..1}" "u \<le> v"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1469 | shows "contour_integral (subpath u v g) f = | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1470 |            integral {u..v} (\<lambda>x. f(g x) * vector_derivative g (at x))"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1471 | using assms has_contour_integral_subpath contour_integral_unique by blast | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1472 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1473 | lemma contour_integral_subpath_combine_less: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1474 |   assumes "f contour_integrable_on g" "valid_path g" "u \<in> {0..1}" "v \<in> {0..1}" "w \<in> {0..1}"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1475 | "u<v" "v<w" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1476 | shows "contour_integral (subpath u v g) f + contour_integral (subpath v w g) f = | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1477 | contour_integral (subpath u w g) f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1478 | using assms apply (auto simp: contour_integral_subcontour_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1479 | apply (rule integral_combine, auto) | 
| 66507 
678774070c9b
renamed s to S to work with previous change
 paulson <lp15@cam.ac.uk> parents: 
66294diff
changeset | 1480 |   apply (rule integrable_on_subcbox [where a=u and b=w and S = "{0..1}", simplified])
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1481 | apply (auto simp: contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1482 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1483 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1484 | lemma contour_integral_subpath_combine: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1485 |   assumes "f contour_integrable_on g" "valid_path g" "u \<in> {0..1}" "v \<in> {0..1}" "w \<in> {0..1}"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1486 | shows "contour_integral (subpath u v g) f + contour_integral (subpath v w g) f = | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1487 | contour_integral (subpath u w g) f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1488 | proof (cases "u\<noteq>v \<and> v\<noteq>w \<and> u\<noteq>w") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1489 | case True | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1490 | have *: "subpath v u g = reversepath(subpath u v g) \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1491 | subpath w u g = reversepath(subpath u w g) \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1492 | subpath w v g = reversepath(subpath v w g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1493 | by (auto simp: reversepath_subpath) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1494 | have "u < v \<and> v < w \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1495 | u < w \<and> w < v \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1496 | v < u \<and> u < w \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1497 | v < w \<and> w < u \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1498 | w < u \<and> u < v \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1499 | w < v \<and> v < u" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1500 | using True assms by linarith | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1501 | with assms show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1502 | using contour_integral_subpath_combine_less [of f g u v w] | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1503 | contour_integral_subpath_combine_less [of f g u w v] | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1504 | contour_integral_subpath_combine_less [of f g v u w] | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1505 | contour_integral_subpath_combine_less [of f g v w u] | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1506 | contour_integral_subpath_combine_less [of f g w u v] | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1507 | contour_integral_subpath_combine_less [of f g w v u] | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1508 | apply simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1509 | apply (elim disjE) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1510 | apply (auto simp: * contour_integral_reversepath contour_integrable_subpath | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1511 | valid_path_reversepath valid_path_subpath algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1512 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1513 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1514 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1515 | then show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1516 | apply (auto simp: contour_integral_subpath_refl) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1517 | using assms | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1518 | by (metis eq_neg_iff_add_eq_0 contour_integrable_subpath contour_integral_reversepath reversepath_subpath valid_path_subpath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1519 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1520 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1521 | lemma contour_integral_integral: | 
| 62463 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1522 |      "contour_integral g f = integral {0..1} (\<lambda>x. f (g x) * vector_derivative g (at x))"
 | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1523 | by (simp add: contour_integral_def integral_def has_contour_integral contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1524 | |
| 68721 | 1525 | lemma contour_integral_cong: | 
| 1526 | assumes "g = g'" "\<And>x. x \<in> path_image g \<Longrightarrow> f x = f' x" | |
| 1527 | shows "contour_integral g f = contour_integral g' f'" | |
| 1528 | unfolding contour_integral_integral using assms | |
| 1529 | by (intro integral_cong) (auto simp: path_image_def) | |
| 1530 | ||
| 1531 | ||
| 1532 | text \<open>Contour integral along a segment on the real axis\<close> | |
| 1533 | ||
| 1534 | lemma has_contour_integral_linepath_Reals_iff: | |
| 1535 | fixes a b :: complex and f :: "complex \<Rightarrow> complex" | |
| 1536 | assumes "a \<in> Reals" "b \<in> Reals" "Re a < Re b" | |
| 1537 | shows "(f has_contour_integral I) (linepath a b) \<longleftrightarrow> | |
| 1538 |              ((\<lambda>x. f (of_real x)) has_integral I) {Re a..Re b}"
 | |
| 1539 | proof - | |
| 1540 | from assms have [simp]: "of_real (Re a) = a" "of_real (Re b) = b" | |
| 1541 | by (simp_all add: complex_eq_iff) | |
| 1542 | from assms have "a \<noteq> b" by auto | |
| 1543 | have "((\<lambda>x. f (of_real x)) has_integral I) (cbox (Re a) (Re b)) \<longleftrightarrow> | |
| 1544 |           ((\<lambda>x. f (a + b * of_real x - a * of_real x)) has_integral I /\<^sub>R (Re b - Re a)) {0..1}"
 | |
| 1545 | by (subst has_integral_affinity_iff [of "Re b - Re a" _ "Re a", symmetric]) | |
| 1546 | (insert assms, simp_all add: field_simps scaleR_conv_of_real) | |
| 1547 | also have "(\<lambda>x. f (a + b * of_real x - a * of_real x)) = | |
| 1548 | (\<lambda>x. (f (a + b * of_real x - a * of_real x) * (b - a)) /\<^sub>R (Re b - Re a))" | |
| 1549 | using \<open>a \<noteq> b\<close> by (auto simp: field_simps fun_eq_iff scaleR_conv_of_real) | |
| 1550 |   also have "(\<dots> has_integral I /\<^sub>R (Re b - Re a)) {0..1} \<longleftrightarrow> 
 | |
| 1551 |                ((\<lambda>x. f (linepath a b x) * (b - a)) has_integral I) {0..1}" using assms
 | |
| 1552 | by (subst has_integral_cmul_iff) (auto simp: linepath_def scaleR_conv_of_real algebra_simps) | |
| 1553 | also have "\<dots> \<longleftrightarrow> (f has_contour_integral I) (linepath a b)" unfolding has_contour_integral_def | |
| 1554 | by (intro has_integral_cong) (simp add: vector_derivative_linepath_within) | |
| 1555 | finally show ?thesis by simp | |
| 1556 | qed | |
| 1557 | ||
| 1558 | lemma contour_integrable_linepath_Reals_iff: | |
| 1559 | fixes a b :: complex and f :: "complex \<Rightarrow> complex" | |
| 1560 | assumes "a \<in> Reals" "b \<in> Reals" "Re a < Re b" | |
| 1561 | shows "(f contour_integrable_on linepath a b) \<longleftrightarrow> | |
| 1562 |              (\<lambda>x. f (of_real x)) integrable_on {Re a..Re b}"
 | |
| 1563 | using has_contour_integral_linepath_Reals_iff[OF assms, of f] | |
| 1564 | by (auto simp: contour_integrable_on_def integrable_on_def) | |
| 1565 | ||
| 1566 | lemma contour_integral_linepath_Reals_eq: | |
| 1567 | fixes a b :: complex and f :: "complex \<Rightarrow> complex" | |
| 1568 | assumes "a \<in> Reals" "b \<in> Reals" "Re a < Re b" | |
| 1569 |   shows   "contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (of_real x))"
 | |
| 1570 | proof (cases "f contour_integrable_on linepath a b") | |
| 1571 | case True | |
| 1572 | thus ?thesis using has_contour_integral_linepath_Reals_iff[OF assms, of f] | |
| 1573 | using has_contour_integral_integral has_contour_integral_unique by blast | |
| 1574 | next | |
| 1575 | case False | |
| 1576 | thus ?thesis using contour_integrable_linepath_Reals_iff[OF assms, of f] | |
| 1577 | by (simp add: not_integrable_contour_integral not_integrable_integral) | |
| 1578 | qed | |
| 1579 | ||
| 1580 | ||
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1581 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1582 | text\<open>Cauchy's theorem where there's a primitive\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1583 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1584 | lemma contour_integral_primitive_lemma: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1585 | fixes f :: "complex \<Rightarrow> complex" and g :: "real \<Rightarrow> complex" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1586 | assumes "a \<le> b" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1587 | and "\<And>x. x \<in> s \<Longrightarrow> (f has_field_derivative f' x) (at x within s)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1588 |       and "g piecewise_differentiable_on {a..b}"  "\<And>x. x \<in> {a..b} \<Longrightarrow> g x \<in> s"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1589 |     shows "((\<lambda>x. f'(g x) * vector_derivative g (at x within {a..b}))
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1590 |              has_integral (f(g b) - f(g a))) {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1591 | proof - | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1592 |   obtain k where k: "finite k" "\<forall>x\<in>{a..b} - k. g differentiable (at x within {a..b})" and cg: "continuous_on {a..b} g"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1593 | using assms by (auto simp: piecewise_differentiable_on_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1594 |   have cfg: "continuous_on {a..b} (\<lambda>x. f (g x))"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1595 | apply (rule continuous_on_compose [OF cg, unfolded o_def]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1596 | using assms | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 1597 | apply (metis field_differentiable_def field_differentiable_imp_continuous_at continuous_on_eq_continuous_within continuous_on_subset image_subset_iff) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1598 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1599 |   { fix x::real
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1600 | assume a: "a < x" and b: "x < b" and xk: "x \<notin> k" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1601 |     then have "g differentiable at x within {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1602 | using k by (simp add: differentiable_at_withinI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1603 |     then have "(g has_vector_derivative vector_derivative g (at x within {a..b})) (at x within {a..b})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1604 | by (simp add: vector_derivative_works has_field_derivative_def scaleR_conv_of_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1605 |     then have gdiff: "(g has_derivative (\<lambda>u. u * vector_derivative g (at x within {a..b}))) (at x within {a..b})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1606 | by (simp add: has_vector_derivative_def scaleR_conv_of_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1607 |     have "(f has_field_derivative (f' (g x))) (at (g x) within g ` {a..b})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1608 | using assms by (metis a atLeastAtMost_iff b DERIV_subset image_subset_iff less_eq_real_def) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 1609 |     then have fdiff: "(f has_derivative (*) (f' (g x))) (at (g x) within g ` {a..b})"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1610 | by (simp add: has_field_derivative_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1611 |     have "((\<lambda>x. f (g x)) has_vector_derivative f' (g x) * vector_derivative g (at x within {a..b})) (at x within {a..b})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1612 | using diff_chain_within [OF gdiff fdiff] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1613 | by (simp add: has_vector_derivative_def scaleR_conv_of_real o_def mult_ac) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1614 | } note * = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1615 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1616 | apply (rule fundamental_theorem_of_calculus_interior_strong) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1617 | using k assms cfg * | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66708diff
changeset | 1618 | apply (auto simp: at_within_Icc_at) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1619 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1620 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1621 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1622 | lemma contour_integral_primitive: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1623 | assumes "\<And>x. x \<in> s \<Longrightarrow> (f has_field_derivative f' x) (at x within s)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1624 | and "valid_path g" "path_image g \<subseteq> s" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1625 | shows "(f' has_contour_integral (f(pathfinish g) - f(pathstart g))) g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1626 | using assms | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1627 | apply (simp add: valid_path_def path_image_def pathfinish_def pathstart_def has_contour_integral_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1628 | apply (auto intro!: piecewise_C1_imp_differentiable contour_integral_primitive_lemma [of 0 1 s]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1629 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1630 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1631 | corollary Cauchy_theorem_primitive: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1632 | assumes "\<And>x. x \<in> s \<Longrightarrow> (f has_field_derivative f' x) (at x within s)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1633 | and "valid_path g" "path_image g \<subseteq> s" "pathfinish g = pathstart g" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1634 | shows "(f' has_contour_integral 0) g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1635 | using assms | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1636 | by (metis diff_self contour_integral_primitive) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1637 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1638 | text\<open>Existence of path integral for continuous function\<close> | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1639 | lemma contour_integrable_continuous_linepath: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1640 | assumes "continuous_on (closed_segment a b) f" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1641 | shows "f contour_integrable_on (linepath a b)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1642 | proof - | 
| 68339 | 1643 |   have "continuous_on {0..1} ((\<lambda>x. f x * (b - a)) \<circ> linepath a b)"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1644 | apply (rule continuous_on_compose [OF continuous_on_linepath], simp add: linepath_image_01) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1645 | apply (rule continuous_intros | simp add: assms)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1646 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1647 | then show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1648 | apply (simp add: contour_integrable_on_def has_contour_integral_def integrable_on_def [symmetric]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1649 | apply (rule integrable_continuous [of 0 "1::real", simplified]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1650 | apply (rule continuous_on_eq [where f = "\<lambda>x. f(linepath a b x)*(b - a)"]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1651 | apply (auto simp: vector_derivative_linepath_within) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1652 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1653 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1654 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1655 | lemma has_field_der_id: "((\<lambda>x. x\<^sup>2 / 2) has_field_derivative x) (at x)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1656 | by (rule has_derivative_imp_has_field_derivative) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1657 | (rule derivative_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1658 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1659 | lemma contour_integral_id [simp]: "contour_integral (linepath a b) (\<lambda>y. y) = (b^2 - a^2)/2" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1660 | apply (rule contour_integral_unique) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1661 | using contour_integral_primitive [of UNIV "\<lambda>x. x^2/2" "\<lambda>x. x" "linepath a b"] | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1662 | apply (auto simp: field_simps has_field_der_id) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1663 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1664 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1665 | lemma contour_integrable_on_const [iff]: "(\<lambda>x. c) contour_integrable_on (linepath a b)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1666 | by (simp add: continuous_on_const contour_integrable_continuous_linepath) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1667 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1668 | lemma contour_integrable_on_id [iff]: "(\<lambda>x. x) contour_integrable_on (linepath a b)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1669 | by (simp add: continuous_on_id contour_integrable_continuous_linepath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1670 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 1671 | subsection%unimportant \<open>Arithmetical combining theorems\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1672 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1673 | lemma has_contour_integral_neg: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1674 | "(f has_contour_integral i) g \<Longrightarrow> ((\<lambda>x. -(f x)) has_contour_integral (-i)) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1675 | by (simp add: has_integral_neg has_contour_integral_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1676 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1677 | lemma has_contour_integral_add: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1678 | "\<lbrakk>(f1 has_contour_integral i1) g; (f2 has_contour_integral i2) g\<rbrakk> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1679 | \<Longrightarrow> ((\<lambda>x. f1 x + f2 x) has_contour_integral (i1 + i2)) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1680 | by (simp add: has_integral_add has_contour_integral_def algebra_simps) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1681 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1682 | lemma has_contour_integral_diff: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1683 | "\<lbrakk>(f1 has_contour_integral i1) g; (f2 has_contour_integral i2) g\<rbrakk> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1684 | \<Longrightarrow> ((\<lambda>x. f1 x - f2 x) has_contour_integral (i1 - i2)) g" | 
| 66112 
0e640e04fc56
New theorems; stronger theorems; tidier theorems. Also some renaming
 paulson <lp15@cam.ac.uk> parents: 
65587diff
changeset | 1685 | by (simp add: has_integral_diff has_contour_integral_def algebra_simps) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1686 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1687 | lemma has_contour_integral_lmul: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1688 | "(f has_contour_integral i) g \<Longrightarrow> ((\<lambda>x. c * (f x)) has_contour_integral (c*i)) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1689 | apply (simp add: has_contour_integral_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1690 | apply (drule has_integral_mult_right) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1691 | apply (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1692 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1693 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1694 | lemma has_contour_integral_rmul: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1695 | "(f has_contour_integral i) g \<Longrightarrow> ((\<lambda>x. (f x) * c) has_contour_integral (i*c)) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1696 | apply (drule has_contour_integral_lmul) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1697 | apply (simp add: mult.commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1698 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1699 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1700 | lemma has_contour_integral_div: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1701 | "(f has_contour_integral i) g \<Longrightarrow> ((\<lambda>x. f x/c) has_contour_integral (i/c)) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1702 | by (simp add: field_class.field_divide_inverse) (metis has_contour_integral_rmul) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1703 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1704 | lemma has_contour_integral_eq: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1705 | "\<lbrakk>(f has_contour_integral y) p; \<And>x. x \<in> path_image p \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> (g has_contour_integral y) p" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1706 | apply (simp add: path_image_def has_contour_integral_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1707 | by (metis (no_types, lifting) image_eqI has_integral_eq) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1708 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1709 | lemma has_contour_integral_bound_linepath: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1710 | assumes "(f has_contour_integral i) (linepath a b)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1711 | "0 \<le> B" "\<And>x. x \<in> closed_segment a b \<Longrightarrow> norm(f x) \<le> B" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1712 | shows "norm i \<le> B * norm(b - a)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1713 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1714 |   { fix x::real
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1715 | assume x: "0 \<le> x" "x \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1716 | have "norm (f (linepath a b x)) * | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1717 |         norm (vector_derivative (linepath a b) (at x within {0..1})) \<le> B * norm (b - a)"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1718 | by (auto intro: mult_mono simp: assms linepath_in_path of_real_linepath vector_derivative_linepath_within x) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1719 | } note * = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1720 | have "norm i \<le> (B * norm (b - a)) * content (cbox 0 (1::real))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1721 | apply (rule has_integral_bound | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1722 |        [of _ "\<lambda>x. f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})"])
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1723 | using assms * unfolding has_contour_integral_def | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1724 | apply (auto simp: norm_mult) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1725 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1726 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1727 | by (auto simp: content_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1728 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1729 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1730 | (*UNUSED | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1731 | lemma has_contour_integral_bound_linepath_strong: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1732 | fixes a :: real and f :: "complex \<Rightarrow> real" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1733 | assumes "(f has_contour_integral i) (linepath a b)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1734 | "finite k" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1735 | "0 \<le> B" "\<And>x::real. x \<in> closed_segment a b - k \<Longrightarrow> norm(f x) \<le> B" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1736 | shows "norm i \<le> B*norm(b - a)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1737 | *) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1738 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1739 | lemma has_contour_integral_const_linepath: "((\<lambda>x. c) has_contour_integral c*(b - a))(linepath a b)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1740 | unfolding has_contour_integral_linepath | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1741 | by (metis content_real diff_0_right has_integral_const_real lambda_one of_real_1 scaleR_conv_of_real zero_le_one) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1742 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1743 | lemma has_contour_integral_0: "((\<lambda>x. 0) has_contour_integral 0) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1744 | by (simp add: has_contour_integral_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1745 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1746 | lemma has_contour_integral_is_0: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1747 | "(\<And>z. z \<in> path_image g \<Longrightarrow> f z = 0) \<Longrightarrow> (f has_contour_integral 0) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1748 | by (rule has_contour_integral_eq [OF has_contour_integral_0]) auto | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1749 | |
| 64267 | 1750 | lemma has_contour_integral_sum: | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1751 | "\<lbrakk>finite s; \<And>a. a \<in> s \<Longrightarrow> (f a has_contour_integral i a) p\<rbrakk> | 
| 64267 | 1752 | \<Longrightarrow> ((\<lambda>x. sum (\<lambda>a. f a x) s) has_contour_integral sum i s) p" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1753 | by (induction s rule: finite_induct) (auto simp: has_contour_integral_0 has_contour_integral_add) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1754 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 1755 | subsection%unimportant \<open>Operations on path integrals\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1756 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1757 | lemma contour_integral_const_linepath [simp]: "contour_integral (linepath a b) (\<lambda>x. c) = c*(b - a)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1758 | by (rule contour_integral_unique [OF has_contour_integral_const_linepath]) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1759 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1760 | lemma contour_integral_neg: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1761 | "f contour_integrable_on g \<Longrightarrow> contour_integral g (\<lambda>x. -(f x)) = -(contour_integral g f)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1762 | by (simp add: contour_integral_unique has_contour_integral_integral has_contour_integral_neg) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1763 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1764 | lemma contour_integral_add: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1765 | "f1 contour_integrable_on g \<Longrightarrow> f2 contour_integrable_on g \<Longrightarrow> contour_integral g (\<lambda>x. f1 x + f2 x) = | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1766 | contour_integral g f1 + contour_integral g f2" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1767 | by (simp add: contour_integral_unique has_contour_integral_integral has_contour_integral_add) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1768 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1769 | lemma contour_integral_diff: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1770 | "f1 contour_integrable_on g \<Longrightarrow> f2 contour_integrable_on g \<Longrightarrow> contour_integral g (\<lambda>x. f1 x - f2 x) = | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1771 | contour_integral g f1 - contour_integral g f2" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1772 | by (simp add: contour_integral_unique has_contour_integral_integral has_contour_integral_diff) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1773 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1774 | lemma contour_integral_lmul: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1775 | shows "f contour_integrable_on g | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1776 | \<Longrightarrow> contour_integral g (\<lambda>x. c * f x) = c*contour_integral g f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1777 | by (simp add: contour_integral_unique has_contour_integral_integral has_contour_integral_lmul) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1778 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1779 | lemma contour_integral_rmul: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1780 | shows "f contour_integrable_on g | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1781 | \<Longrightarrow> contour_integral g (\<lambda>x. f x * c) = contour_integral g f * c" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1782 | by (simp add: contour_integral_unique has_contour_integral_integral has_contour_integral_rmul) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1783 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1784 | lemma contour_integral_div: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1785 | shows "f contour_integrable_on g | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1786 | \<Longrightarrow> contour_integral g (\<lambda>x. f x / c) = contour_integral g f / c" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1787 | by (simp add: contour_integral_unique has_contour_integral_integral has_contour_integral_div) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1788 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1789 | lemma contour_integral_eq: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1790 | "(\<And>x. x \<in> path_image p \<Longrightarrow> f x = g x) \<Longrightarrow> contour_integral p f = contour_integral p g" | 
| 62463 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1791 | apply (simp add: contour_integral_def) | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1792 | using has_contour_integral_eq | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1793 | by (metis contour_integral_unique has_contour_integral_integrable has_contour_integral_integral) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1794 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1795 | lemma contour_integral_eq_0: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1796 | "(\<And>z. z \<in> path_image g \<Longrightarrow> f z = 0) \<Longrightarrow> contour_integral g f = 0" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1797 | by (simp add: has_contour_integral_is_0 contour_integral_unique) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1798 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1799 | lemma contour_integral_bound_linepath: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1800 | shows | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1801 | "\<lbrakk>f contour_integrable_on (linepath a b); | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1802 | 0 \<le> B; \<And>x. x \<in> closed_segment a b \<Longrightarrow> norm(f x) \<le> B\<rbrakk> | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1803 | \<Longrightarrow> norm(contour_integral (linepath a b) f) \<le> B*norm(b - a)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1804 | apply (rule has_contour_integral_bound_linepath [of f]) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1805 | apply (auto simp: has_contour_integral_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1806 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1807 | |
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 1808 | lemma contour_integral_0 [simp]: "contour_integral g (\<lambda>x. 0) = 0" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1809 | by (simp add: contour_integral_unique has_contour_integral_0) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1810 | |
| 64267 | 1811 | lemma contour_integral_sum: | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1812 | "\<lbrakk>finite s; \<And>a. a \<in> s \<Longrightarrow> (f a) contour_integrable_on p\<rbrakk> | 
| 64267 | 1813 | \<Longrightarrow> contour_integral p (\<lambda>x. sum (\<lambda>a. f a x) s) = sum (\<lambda>a. contour_integral p (f a)) s" | 
| 1814 | by (auto simp: contour_integral_unique has_contour_integral_sum has_contour_integral_integral) | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1815 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1816 | lemma contour_integrable_eq: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1817 | "\<lbrakk>f contour_integrable_on p; \<And>x. x \<in> path_image p \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> g contour_integrable_on p" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1818 | unfolding contour_integrable_on_def | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1819 | by (metis has_contour_integral_eq) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1820 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1821 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 1822 | subsection%unimportant \<open>Arithmetic theorems for path integrability\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1823 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1824 | lemma contour_integrable_neg: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1825 | "f contour_integrable_on g \<Longrightarrow> (\<lambda>x. -(f x)) contour_integrable_on g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1826 | using has_contour_integral_neg contour_integrable_on_def by blast | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1827 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1828 | lemma contour_integrable_add: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1829 | "\<lbrakk>f1 contour_integrable_on g; f2 contour_integrable_on g\<rbrakk> \<Longrightarrow> (\<lambda>x. f1 x + f2 x) contour_integrable_on g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1830 | using has_contour_integral_add contour_integrable_on_def | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1831 | by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1832 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1833 | lemma contour_integrable_diff: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1834 | "\<lbrakk>f1 contour_integrable_on g; f2 contour_integrable_on g\<rbrakk> \<Longrightarrow> (\<lambda>x. f1 x - f2 x) contour_integrable_on g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1835 | using has_contour_integral_diff contour_integrable_on_def | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1836 | by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1837 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1838 | lemma contour_integrable_lmul: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1839 | "f contour_integrable_on g \<Longrightarrow> (\<lambda>x. c * f x) contour_integrable_on g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1840 | using has_contour_integral_lmul contour_integrable_on_def | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1841 | by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1842 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1843 | lemma contour_integrable_rmul: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1844 | "f contour_integrable_on g \<Longrightarrow> (\<lambda>x. f x * c) contour_integrable_on g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1845 | using has_contour_integral_rmul contour_integrable_on_def | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1846 | by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1847 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1848 | lemma contour_integrable_div: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1849 | "f contour_integrable_on g \<Longrightarrow> (\<lambda>x. f x / c) contour_integrable_on g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1850 | using has_contour_integral_div contour_integrable_on_def | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1851 | by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1852 | |
| 64267 | 1853 | lemma contour_integrable_sum: | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1854 | "\<lbrakk>finite s; \<And>a. a \<in> s \<Longrightarrow> (f a) contour_integrable_on p\<rbrakk> | 
| 64267 | 1855 | \<Longrightarrow> (\<lambda>x. sum (\<lambda>a. f a x) s) contour_integrable_on p" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1856 | unfolding contour_integrable_on_def | 
| 64267 | 1857 | by (metis has_contour_integral_sum) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1858 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1859 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 1860 | subsection%unimportant \<open>Reversing a path integral\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1861 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1862 | lemma has_contour_integral_reverse_linepath: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1863 | "(f has_contour_integral i) (linepath a b) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1864 | \<Longrightarrow> (f has_contour_integral (-i)) (linepath b a)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1865 | using has_contour_integral_reversepath valid_path_linepath by fastforce | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1866 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1867 | lemma contour_integral_reverse_linepath: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1868 | "continuous_on (closed_segment a b) f | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1869 | \<Longrightarrow> contour_integral (linepath a b) f = - (contour_integral(linepath b a) f)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1870 | apply (rule contour_integral_unique) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1871 | apply (rule has_contour_integral_reverse_linepath) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1872 | by (simp add: closed_segment_commute contour_integrable_continuous_linepath has_contour_integral_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1873 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1874 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1875 | (* Splitting a path integral in a flat way.*) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1876 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1877 | lemma has_contour_integral_split: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1878 | assumes f: "(f has_contour_integral i) (linepath a c)" "(f has_contour_integral j) (linepath c b)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1879 | and k: "0 \<le> k" "k \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1880 | and c: "c - a = k *\<^sub>R (b - a)" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1881 | shows "(f has_contour_integral (i + j)) (linepath a b)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1882 | proof (cases "k = 0 \<or> k = 1") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1883 | case True | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1884 | then show ?thesis | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1885 | using assms by auto | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1886 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1887 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1888 | then have k: "0 < k" "k < 1" "complex_of_real k \<noteq> 1" | 
| 65578 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 1889 | using assms by auto | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1890 | have c': "c = k *\<^sub>R (b - a) + a" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1891 | by (metis diff_add_cancel c) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1892 | have bc: "(b - c) = (1 - k) *\<^sub>R (b - a)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1893 | by (simp add: algebra_simps c') | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1894 |   { assume *: "((\<lambda>x. f ((1 - x) *\<^sub>R a + x *\<^sub>R c) * (c - a)) has_integral i) {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1895 | have **: "\<And>x. ((k - x) / k) *\<^sub>R a + (x / k) *\<^sub>R c = (1 - x) *\<^sub>R a + x *\<^sub>R b" | 
| 68302 | 1896 | using False apply (simp add: c' algebra_simps) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1897 | apply (simp add: real_vector.scale_left_distrib [symmetric] divide_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1898 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1899 |     have "((\<lambda>x. f ((1 - x) *\<^sub>R a + x *\<^sub>R b) * (b - a)) has_integral i) {0..k}"
 | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1900 | using k has_integral_affinity01 [OF *, of "inverse k" "0"] | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1901 | apply (simp add: divide_simps mult.commute [of _ "k"] image_affinity_atLeastAtMost ** c) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1902 | apply (auto dest: has_integral_cmul [where c = "inverse k"]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1903 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1904 | } note fi = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1905 |   { assume *: "((\<lambda>x. f ((1 - x) *\<^sub>R c + x *\<^sub>R b) * (b - c)) has_integral j) {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1906 | have **: "\<And>x. (((1 - x) / (1 - k)) *\<^sub>R c + ((x - k) / (1 - k)) *\<^sub>R b) = ((1 - x) *\<^sub>R a + x *\<^sub>R b)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1907 | using k | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1908 | apply (simp add: c' field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1909 | apply (simp add: scaleR_conv_of_real divide_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1910 | apply (simp add: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1911 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1912 |     have "((\<lambda>x. f ((1 - x) *\<^sub>R a + x *\<^sub>R b) * (b - a)) has_integral j) {k..1}"
 | 
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1913 | using k has_integral_affinity01 [OF *, of "inverse(1 - k)" "-(k/(1 - k))"] | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1914 | apply (simp add: divide_simps mult.commute [of _ "1-k"] image_affinity_atLeastAtMost ** bc) | 
| 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1915 | apply (auto dest: has_integral_cmul [where k = "(1 - k) *\<^sub>R j" and c = "inverse (1 - k)"]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1916 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1917 | } note fj = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1918 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1919 | using f k | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1920 | apply (simp add: has_contour_integral_linepath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1921 | apply (simp add: linepath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1922 | apply (rule has_integral_combine [OF _ _ fi fj], simp_all) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1923 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1924 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1925 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1926 | lemma continuous_on_closed_segment_transform: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1927 | assumes f: "continuous_on (closed_segment a b) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1928 | and k: "0 \<le> k" "k \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1929 | and c: "c - a = k *\<^sub>R (b - a)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1930 | shows "continuous_on (closed_segment a c) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1931 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1932 | have c': "c = (1 - k) *\<^sub>R a + k *\<^sub>R b" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1933 | using c by (simp add: algebra_simps) | 
| 68302 | 1934 | have "closed_segment a c \<subseteq> closed_segment a b" | 
| 1935 | by (metis c' ends_in_segment(1) in_segment(1) k subset_closed_segment) | |
| 1936 | then show "continuous_on (closed_segment a c) f" | |
| 1937 | by (rule continuous_on_subset [OF f]) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1938 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1939 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1940 | lemma contour_integral_split: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1941 | assumes f: "continuous_on (closed_segment a b) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1942 | and k: "0 \<le> k" "k \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1943 | and c: "c - a = k *\<^sub>R (b - a)" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1944 | shows "contour_integral(linepath a b) f = contour_integral(linepath a c) f + contour_integral(linepath c b) f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1945 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1946 | have c': "c = (1 - k) *\<^sub>R a + k *\<^sub>R b" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1947 | using c by (simp add: algebra_simps) | 
| 68302 | 1948 | have "closed_segment a c \<subseteq> closed_segment a b" | 
| 1949 | by (metis c' ends_in_segment(1) in_segment(1) k subset_closed_segment) | |
| 1950 | moreover have "closed_segment c b \<subseteq> closed_segment a b" | |
| 1951 | by (metis c' ends_in_segment(2) in_segment(1) k subset_closed_segment) | |
| 1952 | ultimately | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1953 | have *: "continuous_on (closed_segment a c) f" "continuous_on (closed_segment c b) f" | 
| 68302 | 1954 | by (auto intro: continuous_on_subset [OF f]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1955 | show ?thesis | 
| 68302 | 1956 | by (rule contour_integral_unique) (meson "*" c contour_integrable_continuous_linepath has_contour_integral_integral has_contour_integral_split k) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1957 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1958 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1959 | lemma contour_integral_split_linepath: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1960 | assumes f: "continuous_on (closed_segment a b) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1961 | and c: "c \<in> closed_segment a b" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1962 | shows "contour_integral(linepath a b) f = contour_integral(linepath a c) f + contour_integral(linepath c b) f" | 
| 68302 | 1963 | using c by (auto simp: closed_segment_def algebra_simps intro!: contour_integral_split [OF f]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1964 | |
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 1965 | text\<open>The special case of midpoints used in the main quadrisection\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1966 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1967 | lemma has_contour_integral_midpoint: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1968 | assumes "(f has_contour_integral i) (linepath a (midpoint a b))" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1969 | "(f has_contour_integral j) (linepath (midpoint a b) b)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1970 | shows "(f has_contour_integral (i + j)) (linepath a b)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1971 | apply (rule has_contour_integral_split [where c = "midpoint a b" and k = "1/2"]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1972 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1973 | apply (auto simp: midpoint_def algebra_simps scaleR_conv_of_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1974 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1975 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1976 | lemma contour_integral_midpoint: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1977 | "continuous_on (closed_segment a b) f | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1978 | \<Longrightarrow> contour_integral (linepath a b) f = | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1979 | contour_integral (linepath a (midpoint a b)) f + contour_integral (linepath (midpoint a b) b) f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1980 | apply (rule contour_integral_split [where c = "midpoint a b" and k = "1/2"]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1981 | apply (auto simp: midpoint_def algebra_simps scaleR_conv_of_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1982 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1983 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1984 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1985 | text\<open>A couple of special case lemmas that are useful below\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1986 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1987 | lemma triangle_linear_has_chain_integral: | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1988 | "((\<lambda>x. m*x + d) has_contour_integral 0) (linepath a b +++ linepath b c +++ linepath c a)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1989 | apply (rule Cauchy_theorem_primitive [of UNIV "\<lambda>x. m/2 * x^2 + d*x"]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1990 | apply (auto intro!: derivative_eq_intros) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1991 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1992 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1993 | lemma has_chain_integral_chain_integral3: | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1994 | "(f has_contour_integral i) (linepath a b +++ linepath b c +++ linepath c d) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1995 | \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c d) f = i" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1996 | apply (subst contour_integral_unique [symmetric], assumption) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1997 | apply (drule has_contour_integral_integrable) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1998 | apply (simp add: valid_path_join) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1999 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2000 | |
| 62397 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 2001 | lemma has_chain_integral_chain_integral4: | 
| 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 2002 | "(f has_contour_integral i) (linepath a b +++ linepath b c +++ linepath c d +++ linepath d e) | 
| 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 2003 | \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c d) f + contour_integral (linepath d e) f = i" | 
| 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 2004 | apply (subst contour_integral_unique [symmetric], assumption) | 
| 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 2005 | apply (drule has_contour_integral_integrable) | 
| 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 2006 | apply (simp add: valid_path_join) | 
| 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 2007 | done | 
| 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 2008 | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2009 | subsection\<open>Reversing the order in a double path integral\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2010 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2011 | text\<open>The condition is stronger than needed but it's often true in typical situations\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2012 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2013 | lemma fst_im_cbox [simp]: "cbox c d \<noteq> {} \<Longrightarrow> (fst ` cbox (a,c) (b,d)) = cbox a b"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2014 | by (auto simp: cbox_Pair_eq) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2015 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2016 | lemma snd_im_cbox [simp]: "cbox a b \<noteq> {} \<Longrightarrow> (snd ` cbox (a,c) (b,d)) = cbox c d"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2017 | by (auto simp: cbox_Pair_eq) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2018 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2019 | proposition contour_integral_swap: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2020 | assumes fcon: "continuous_on (path_image g \<times> path_image h) (\<lambda>(y1,y2). f y1 y2)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2021 | and vp: "valid_path g" "valid_path h" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2022 |       and gvcon: "continuous_on {0..1} (\<lambda>t. vector_derivative g (at t))"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2023 |       and hvcon: "continuous_on {0..1} (\<lambda>t. vector_derivative h (at t))"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2024 | shows "contour_integral g (\<lambda>w. contour_integral h (f w)) = | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2025 | contour_integral h (\<lambda>z. contour_integral g (\<lambda>w. f w z))" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2026 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2027 |   have gcon: "continuous_on {0..1} g" and hcon: "continuous_on {0..1} h"
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 2028 | using assms by (auto simp: valid_path_def piecewise_C1_differentiable_on_def) | 
| 68339 | 2029 | have fgh1: "\<And>x. (\<lambda>t. f (g x) (h t)) = (\<lambda>(y1,y2). f y1 y2) \<circ> (\<lambda>t. (g x, h t))" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2030 | by (rule ext) simp | 
| 68339 | 2031 | have fgh2: "\<And>x. (\<lambda>t. f (g t) (h x)) = (\<lambda>(y1,y2). f y1 y2) \<circ> (\<lambda>t. (g t, h x))" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2032 | by (rule ext) simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2033 |   have fcon_im1: "\<And>x. 0 \<le> x \<Longrightarrow> x \<le> 1 \<Longrightarrow> continuous_on ((\<lambda>t. (g x, h t)) ` {0..1}) (\<lambda>(x, y). f x y)"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2034 | by (rule continuous_on_subset [OF fcon]) (auto simp: path_image_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2035 |   have fcon_im2: "\<And>x. 0 \<le> x \<Longrightarrow> x \<le> 1 \<Longrightarrow> continuous_on ((\<lambda>t. (g t, h x)) ` {0..1}) (\<lambda>(x, y). f x y)"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2036 | by (rule continuous_on_subset [OF fcon]) (auto simp: path_image_def) | 
| 68302 | 2037 |   have "\<And>y. y \<in> {0..1} \<Longrightarrow> continuous_on {0..1} (\<lambda>x. f (g x) (h y))"
 | 
| 2038 | by (subst fgh2) (rule fcon_im2 gcon continuous_intros | simp)+ | |
| 2039 |   then have vdg: "\<And>y. y \<in> {0..1} \<Longrightarrow> (\<lambda>x. f (g x) (h y) * vector_derivative g (at x)) integrable_on {0..1}"
 | |
| 2040 | using continuous_on_mult gvcon integrable_continuous_real by blast | |
| 68339 | 2041 | have "(\<lambda>z. vector_derivative g (at (fst z))) = (\<lambda>x. vector_derivative g (at x)) \<circ> fst" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2042 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2043 | then have gvcon': "continuous_on (cbox (0, 0) (1, 1::real)) (\<lambda>x. vector_derivative g (at (fst x)))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2044 | apply (rule ssubst) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2045 | apply (rule continuous_intros | simp add: gvcon)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2046 | done | 
| 68339 | 2047 | have "(\<lambda>z. vector_derivative h (at (snd z))) = (\<lambda>x. vector_derivative h (at x)) \<circ> snd" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2048 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2049 | then have hvcon': "continuous_on (cbox (0, 0) (1::real, 1)) (\<lambda>x. vector_derivative h (at (snd x)))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2050 | apply (rule ssubst) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2051 | apply (rule continuous_intros | simp add: hvcon)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2052 | done | 
| 68339 | 2053 | have "(\<lambda>x. f (g (fst x)) (h (snd x))) = (\<lambda>(y1,y2). f y1 y2) \<circ> (\<lambda>w. ((g \<circ> fst) w, (h \<circ> snd) w))" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2054 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2055 | then have fgh: "continuous_on (cbox (0, 0) (1, 1)) (\<lambda>x. f (g (fst x)) (h (snd x)))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2056 | apply (rule ssubst) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2057 | apply (rule gcon hcon continuous_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2058 | apply (auto simp: path_image_def intro: continuous_on_subset [OF fcon]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2059 | done | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2060 |   have "integral {0..1} (\<lambda>x. contour_integral h (f (g x)) * vector_derivative g (at x)) =
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2061 |         integral {0..1} (\<lambda>x. contour_integral h (\<lambda>y. f (g x) y * vector_derivative g (at x)))"
 | 
| 68302 | 2062 | proof (rule integral_cong [OF contour_integral_rmul [symmetric]]) | 
| 2063 |     show "\<And>x. x \<in> {0..1} \<Longrightarrow> f (g x) contour_integrable_on h"
 | |
| 2064 | unfolding contour_integrable_on | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2065 | apply (rule integrable_continuous_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2066 | apply (rule continuous_on_mult [OF _ hvcon]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2067 | apply (subst fgh1) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2068 | apply (rule fcon_im1 hcon continuous_intros | simp)+ | 
| 68302 | 2069 | done | 
| 2070 | qed | |
| 68339 | 2071 |   also have "\<dots> = integral {0..1}
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2072 | (\<lambda>y. contour_integral g (\<lambda>x. f x (h y) * vector_derivative h (at y)))" | 
| 68302 | 2073 | unfolding contour_integral_integral | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2074 | apply (subst integral_swap_continuous [where 'a = real and 'b = real, of 0 0 1 1, simplified]) | 
| 62463 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 2075 | apply (rule fgh gvcon' hvcon' continuous_intros | simp add: split_def)+ | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 2076 | unfolding integral_mult_left [symmetric] | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 2077 | apply (simp only: mult_ac) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2078 | done | 
| 68339 | 2079 | also have "\<dots> = contour_integral h (\<lambda>z. contour_integral g (\<lambda>w. f w z))" | 
| 68302 | 2080 | unfolding contour_integral_integral | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2081 | apply (rule integral_cong) | 
| 62463 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 2082 | unfolding integral_mult_left [symmetric] | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2083 | apply (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2084 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2085 | finally show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2086 | by (simp add: contour_integral_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2087 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2088 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2089 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2090 | subsection%unimportant \<open>The key quadrisection step\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2091 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2092 | lemma norm_sum_half: | 
| 68302 | 2093 | assumes "norm(a + b) \<ge> e" | 
| 2094 | shows "norm a \<ge> e/2 \<or> norm b \<ge> e/2" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2095 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2096 | have "e \<le> norm (- a - b)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2097 | by (simp add: add.commute assms norm_minus_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2098 | thus ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2099 | using norm_triangle_ineq4 order_trans by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2100 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2101 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2102 | lemma norm_sum_lemma: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2103 | assumes "e \<le> norm (a + b + c + d)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2104 | shows "e / 4 \<le> norm a \<or> e / 4 \<le> norm b \<or> e / 4 \<le> norm c \<or> e / 4 \<le> norm d" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2105 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2106 | have "e \<le> norm ((a + b) + (c + d))" using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2107 | by (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2108 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2109 | by (auto dest!: norm_sum_half) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2110 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2111 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2112 | lemma Cauchy_theorem_quadrisection: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2113 |   assumes f: "continuous_on (convex hull {a,b,c}) f"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2114 | and dist: "dist a b \<le> K" "dist b c \<le> K" "dist c a \<le> K" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2115 | and e: "e * K^2 \<le> | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2116 | norm (contour_integral(linepath a b) f + contour_integral(linepath b c) f + contour_integral(linepath c a) f)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2117 | shows "\<exists>a' b' c'. | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2118 |            a' \<in> convex hull {a,b,c} \<and> b' \<in> convex hull {a,b,c} \<and> c' \<in> convex hull {a,b,c} \<and>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2119 | dist a' b' \<le> K/2 \<and> dist b' c' \<le> K/2 \<and> dist c' a' \<le> K/2 \<and> | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2120 | e * (K/2)^2 \<le> norm(contour_integral(linepath a' b') f + contour_integral(linepath b' c') f + contour_integral(linepath c' a') f)" | 
| 68302 | 2121 | (is "\<exists>x y z. ?\<Phi> x y z") | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2122 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2123 | note divide_le_eq_numeral1 [simp del] | 
| 63040 | 2124 | define a' where "a' = midpoint b c" | 
| 2125 | define b' where "b' = midpoint c a" | |
| 2126 | define c' where "c' = midpoint a b" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2127 | have fabc: "continuous_on (closed_segment a b) f" "continuous_on (closed_segment b c) f" "continuous_on (closed_segment c a) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2128 | using f continuous_on_subset segments_subset_convex_hull by metis+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2129 | have fcont': "continuous_on (closed_segment c' b') f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2130 | "continuous_on (closed_segment a' c') f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2131 | "continuous_on (closed_segment b' a') f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2132 | unfolding a'_def b'_def c'_def | 
| 68302 | 2133 | by (rule continuous_on_subset [OF f], | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2134 | metis midpoints_in_convex_hull convex_hull_subset hull_subset insert_subset segment_convex_hull)+ | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2135 | let ?pathint = "\<lambda>x y. contour_integral(linepath x y) f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2136 | have *: "?pathint a b + ?pathint b c + ?pathint c a = | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2137 | (?pathint a c' + ?pathint c' b' + ?pathint b' a) + | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2138 | (?pathint a' c' + ?pathint c' b + ?pathint b a') + | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2139 | (?pathint a' c + ?pathint c b' + ?pathint b' a') + | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2140 | (?pathint a' b' + ?pathint b' c' + ?pathint c' a')" | 
| 68302 | 2141 | by (simp add: fcont' contour_integral_reverse_linepath) (simp add: a'_def b'_def c'_def contour_integral_midpoint fabc) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2142 | have [simp]: "\<And>x y. cmod (x * 2 - y * 2) = cmod (x - y) * 2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2143 | by (metis left_diff_distrib mult.commute norm_mult_numeral1) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2144 | have [simp]: "\<And>x y. cmod (x - y) = cmod (y - x)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2145 | by (simp add: norm_minus_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2146 | consider "e * K\<^sup>2 / 4 \<le> cmod (?pathint a c' + ?pathint c' b' + ?pathint b' a)" | | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2147 | "e * K\<^sup>2 / 4 \<le> cmod (?pathint a' c' + ?pathint c' b + ?pathint b a')" | | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2148 | "e * K\<^sup>2 / 4 \<le> cmod (?pathint a' c + ?pathint c b' + ?pathint b' a')" | | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2149 | "e * K\<^sup>2 / 4 \<le> cmod (?pathint a' b' + ?pathint b' c' + ?pathint c' a')" | 
| 68302 | 2150 | using assms unfolding * by (blast intro: that dest!: norm_sum_lemma) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2151 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2152 | proof cases | 
| 68302 | 2153 | case 1 then have "?\<Phi> a c' b'" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2154 | using assms | 
| 68302 | 2155 | apply (clarsimp simp: c'_def b'_def midpoints_in_convex_hull hull_subset [THEN subsetD]) | 
| 2156 | apply (auto simp: midpoint_def dist_norm scaleR_conv_of_real divide_simps) | |
| 2157 | done | |
| 2158 | then show ?thesis by blast | |
| 2159 | next | |
| 2160 | case 2 then have "?\<Phi> a' c' b" | |
| 2161 | using assms | |
| 2162 | apply (clarsimp simp: a'_def c'_def midpoints_in_convex_hull hull_subset [THEN subsetD]) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2163 | apply (auto simp: midpoint_def dist_norm scaleR_conv_of_real divide_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2164 | done | 
| 68302 | 2165 | then show ?thesis by blast | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2166 | next | 
| 68302 | 2167 | case 3 then have "?\<Phi> a' c b'" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2168 | using assms | 
| 68302 | 2169 | apply (clarsimp simp: a'_def b'_def midpoints_in_convex_hull hull_subset [THEN subsetD]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2170 | apply (auto simp: midpoint_def dist_norm scaleR_conv_of_real divide_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2171 | done | 
| 68302 | 2172 | then show ?thesis by blast | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2173 | next | 
| 68302 | 2174 | case 4 then have "?\<Phi> a' b' c'" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2175 | using assms | 
| 68302 | 2176 | apply (clarsimp simp: a'_def c'_def b'_def midpoints_in_convex_hull hull_subset [THEN subsetD]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2177 | apply (auto simp: midpoint_def dist_norm scaleR_conv_of_real divide_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2178 | done | 
| 68302 | 2179 | then show ?thesis by blast | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2180 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2181 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2182 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2183 | subsection%unimportant \<open>Cauchy's theorem for triangles\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2184 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2185 | lemma triangle_points_closer: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2186 | fixes a::complex | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2187 |   shows "\<lbrakk>x \<in> convex hull {a,b,c};  y \<in> convex hull {a,b,c}\<rbrakk>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2188 | \<Longrightarrow> norm(x - y) \<le> norm(a - b) \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2189 | norm(x - y) \<le> norm(b - c) \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2190 | norm(x - y) \<le> norm(c - a)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2191 |   using simplex_extremal_le [of "{a,b,c}"]
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2192 | by (auto simp: norm_minus_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2193 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2194 | lemma holomorphic_point_small_triangle: | 
| 68302 | 2195 | assumes x: "x \<in> S" | 
| 2196 | and f: "continuous_on S f" | |
| 2197 | and cd: "f field_differentiable (at x within S)" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2198 | and e: "0 < e" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2199 | shows "\<exists>k>0. \<forall>a b c. dist a b \<le> k \<and> dist b c \<le> k \<and> dist c a \<le> k \<and> | 
| 68302 | 2200 |               x \<in> convex hull {a,b,c} \<and> convex hull {a,b,c} \<subseteq> S
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2201 | \<longrightarrow> norm(contour_integral(linepath a b) f + contour_integral(linepath b c) f + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2202 | contour_integral(linepath c a) f) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2203 | \<le> e*(dist a b + dist b c + dist c a)^2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2204 | (is "\<exists>k>0. \<forall>a b c. _ \<longrightarrow> ?normle a b c") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2205 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2206 | have le_of_3: "\<And>a x y z. \<lbrakk>0 \<le> x*y; 0 \<le> x*z; 0 \<le> y*z; a \<le> (e*(x + y + z))*x + (e*(x + y + z))*y + (e*(x + y + z))*z\<rbrakk> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2207 | \<Longrightarrow> a \<le> e*(x + y + z)^2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2208 | by (simp add: algebra_simps power2_eq_square) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2209 | have disj_le: "\<lbrakk>x \<le> a \<or> x \<le> b \<or> x \<le> c; 0 \<le> a; 0 \<le> b; 0 \<le> c\<rbrakk> \<Longrightarrow> x \<le> a + b + c" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2210 | for x::real and a b c | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2211 | by linarith | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2212 | have fabc: "f contour_integrable_on linepath a b" "f contour_integrable_on linepath b c" "f contour_integrable_on linepath c a" | 
| 68302 | 2213 |               if "convex hull {a, b, c} \<subseteq> S" for a b c
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2214 | using segments_subset_convex_hull that | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2215 | by (metis continuous_on_subset f contour_integrable_continuous_linepath)+ | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2216 | note path_bound = has_contour_integral_bound_linepath [simplified norm_minus_commute, OF has_contour_integral_integral] | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2217 |   { fix f' a b c d
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2218 | assume d: "0 < d" | 
| 68302 | 2219 | and f': "\<And>y. \<lbrakk>cmod (y - x) \<le> d; y \<in> S\<rbrakk> \<Longrightarrow> cmod (f y - f x - f' * (y - x)) \<le> e * cmod (y - x)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2220 | and le: "cmod (a - b) \<le> d" "cmod (b - c) \<le> d" "cmod (c - a) \<le> d" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2221 |        and xc: "x \<in> convex hull {a, b, c}"
 | 
| 68302 | 2222 |        and S: "convex hull {a, b, c} \<subseteq> S"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2223 | have pa: "contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2224 | contour_integral (linepath a b) (\<lambda>y. f y - f x - f'*(y - x)) + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2225 | contour_integral (linepath b c) (\<lambda>y. f y - f x - f'*(y - x)) + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2226 | contour_integral (linepath c a) (\<lambda>y. f y - f x - f'*(y - x))" | 
| 68302 | 2227 | apply (simp add: contour_integral_diff contour_integral_lmul contour_integrable_lmul contour_integrable_diff fabc [OF S]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2228 | apply (simp add: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2229 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2230 |     { fix y
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2231 |       assume yc: "y \<in> convex hull {a,b,c}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2232 | have "cmod (f y - f x - f' * (y - x)) \<le> e*norm(y - x)" | 
| 68302 | 2233 | proof (rule f') | 
| 2234 | show "cmod (y - x) \<le> d" | |
| 2235 | by (metis triangle_points_closer [OF xc yc] le norm_minus_commute order_trans) | |
| 2236 | qed (use S yc in blast) | |
| 68339 | 2237 | also have "\<dots> \<le> e * (cmod (a - b) + cmod (b - c) + cmod (c - a))" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2238 | by (simp add: yc e xc disj_le [OF triangle_points_closer]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2239 | finally have "cmod (f y - f x - f' * (y - x)) \<le> e * (cmod (a - b) + cmod (b - c) + cmod (c - a))" . | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2240 | } note cm_le = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2241 | have "?normle a b c" | 
| 68302 | 2242 | unfolding dist_norm pa | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2243 | apply (rule le_of_3) | 
| 68302 | 2244 | using f' xc S e | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2245 | apply simp_all | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2246 | apply (intro norm_triangle_le add_mono path_bound) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2247 | apply (simp_all add: contour_integral_diff contour_integral_lmul contour_integrable_lmul contour_integrable_diff fabc) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2248 | apply (blast intro: cm_le elim: dest: segments_subset_convex_hull [THEN subsetD])+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2249 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2250 | } note * = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2251 | show ?thesis | 
| 68493 | 2252 | using cd e | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 2253 | apply (simp add: field_differentiable_def has_field_derivative_def has_derivative_within_alt approachable_lt_le2 Ball_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2254 | apply (clarify dest!: spec mp) | 
| 68302 | 2255 | using * unfolding dist_norm | 
| 68339 | 2256 | apply blast | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2257 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2258 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2259 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2260 | |
| 68310 | 2261 | text\<open>Hence the most basic theorem for a triangle.\<close> | 
| 2262 | ||
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2263 | locale Chain = | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2264 | fixes x0 At Follows | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2265 | assumes At0: "At x0 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2266 | and AtSuc: "\<And>x n. At x n \<Longrightarrow> \<exists>x'. At x' (Suc n) \<and> Follows x' x" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2267 | begin | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2268 | primrec f where | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2269 | "f 0 = x0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2270 | | "f (Suc n) = (SOME x. At x (Suc n) \<and> Follows x (f n))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2271 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2272 | lemma At: "At (f n) n" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2273 | proof (induct n) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2274 | case 0 show ?case | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2275 | by (simp add: At0) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2276 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2277 | case (Suc n) show ?case | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2278 | by (metis (no_types, lifting) AtSuc [OF Suc] f.simps(2) someI_ex) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2279 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2280 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2281 | lemma Follows: "Follows (f(Suc n)) (f n)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2282 | by (metis (no_types, lifting) AtSuc [OF At [of n]] f.simps(2) someI_ex) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2283 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2284 | declare f.simps(2) [simp del] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2285 | end | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2286 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2287 | lemma Chain3: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2288 | assumes At0: "At x0 y0 z0 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2289 | and AtSuc: "\<And>x y z n. At x y z n \<Longrightarrow> \<exists>x' y' z'. At x' y' z' (Suc n) \<and> Follows x' y' z' x y z" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2290 | obtains f g h where | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2291 | "f 0 = x0" "g 0 = y0" "h 0 = z0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2292 | "\<And>n. At (f n) (g n) (h n) n" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2293 | "\<And>n. Follows (f(Suc n)) (g(Suc n)) (h(Suc n)) (f n) (g n) (h n)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2294 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2295 | interpret three: Chain "(x0,y0,z0)" "\<lambda>(x,y,z). At x y z" "\<lambda>(x',y',z'). \<lambda>(x,y,z). Follows x' y' z' x y z" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2296 | apply unfold_locales | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2297 | using At0 AtSuc by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2298 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2299 | apply (rule that [of "\<lambda>n. fst (three.f n)" "\<lambda>n. fst (snd (three.f n))" "\<lambda>n. snd (snd (three.f n))"]) | 
| 68302 | 2300 | using three.At three.Follows | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2301 | apply simp_all | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2302 | apply (simp_all add: split_beta') | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2303 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2304 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2305 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2306 | proposition%unimportant Cauchy_theorem_triangle: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2307 |   assumes "f holomorphic_on (convex hull {a,b,c})"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2308 | shows "(f has_contour_integral 0) (linepath a b +++ linepath b c +++ linepath c a)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2309 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2310 |   have contf: "continuous_on (convex hull {a,b,c}) f"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2311 | by (metis assms holomorphic_on_imp_continuous_on) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2312 | let ?pathint = "\<lambda>x y. contour_integral(linepath x y) f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2313 |   { fix y::complex
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2314 | assume fy: "(f has_contour_integral y) (linepath a b +++ linepath b c +++ linepath c a)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2315 | and ynz: "y \<noteq> 0" | 
| 63040 | 2316 | define K where "K = 1 + max (dist a b) (max (dist b c) (dist c a))" | 
| 2317 | define e where "e = norm y / K^2" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2318 | have K1: "K \<ge> 1" by (simp add: K_def max.coboundedI1) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2319 | then have K: "K > 0" by linarith | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2320 | have [iff]: "dist a b \<le> K" "dist b c \<le> K" "dist c a \<le> K" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2321 | by (simp_all add: K_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2322 | have e: "e > 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2323 | unfolding e_def using ynz K1 by simp | 
| 63040 | 2324 | define At where "At x y z n \<longleftrightarrow> | 
| 2325 |         convex hull {x,y,z} \<subseteq> convex hull {a,b,c} \<and>
 | |
| 2326 | dist x y \<le> K/2^n \<and> dist y z \<le> K/2^n \<and> dist z x \<le> K/2^n \<and> | |
| 2327 | norm(?pathint x y + ?pathint y z + ?pathint z x) \<ge> e*(K/2^n)^2" | |
| 2328 | for x y z n | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2329 | have At0: "At a b c 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2330 | using fy | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2331 | by (simp add: At_def e_def has_chain_integral_chain_integral3) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2332 |     { fix x y z n
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2333 | assume At: "At x y z n" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2334 |       then have contf': "continuous_on (convex hull {x,y,z}) f"
 | 
| 63938 | 2335 | using contf At_def continuous_on_subset by metis | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2336 |       have "\<exists>x' y' z'. At x' y' z' (Suc n) \<and> convex hull {x',y',z'} \<subseteq> convex hull {x,y,z}"
 | 
| 68302 | 2337 | using At Cauchy_theorem_quadrisection [OF contf', of "K/2^n" e] | 
| 2338 | apply (simp add: At_def algebra_simps) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2339 | apply (meson convex_hull_subset empty_subsetI insert_subset subsetCE) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2340 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2341 | } note AtSuc = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2342 | obtain fa fb fc | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2343 | where f0 [simp]: "fa 0 = a" "fb 0 = b" "fc 0 = c" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2344 |         and cosb: "\<And>n. convex hull {fa n, fb n, fc n} \<subseteq> convex hull {a,b,c}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2345 | and dist: "\<And>n. dist (fa n) (fb n) \<le> K/2^n" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2346 | "\<And>n. dist (fb n) (fc n) \<le> K/2^n" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2347 | "\<And>n. dist (fc n) (fa n) \<le> K/2^n" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2348 | and no: "\<And>n. norm(?pathint (fa n) (fb n) + | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2349 | ?pathint (fb n) (fc n) + | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2350 | ?pathint (fc n) (fa n)) \<ge> e * (K/2^n)^2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2351 |         and conv_le: "\<And>n. convex hull {fa(Suc n), fb(Suc n), fc(Suc n)} \<subseteq> convex hull {fa n, fb n, fc n}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2352 | apply (rule Chain3 [of At, OF At0 AtSuc]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2353 | apply (auto simp: At_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2354 | done | 
| 68302 | 2355 |     obtain x where x: "\<And>n. x \<in> convex hull {fa n, fb n, fc n}"
 | 
| 2356 | proof (rule bounded_closed_nest) | |
| 2357 |       show "\<And>n. closed (convex hull {fa n, fb n, fc n})"
 | |
| 2358 | by (simp add: compact_imp_closed finite_imp_compact_convex_hull) | |
| 2359 |       show "\<And>m n. m \<le> n \<Longrightarrow> convex hull {fa n, fb n, fc n} \<subseteq> convex hull {fa m, fb m, fc m}"
 | |
| 2360 | by (erule transitive_stepwise_le) (auto simp: conv_le) | |
| 2361 | qed (fastforce intro: finite_imp_bounded_convex_hull)+ | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2362 |     then have xin: "x \<in> convex hull {a,b,c}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2363 | using assms f0 by blast | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 2364 |     then have fx: "f field_differentiable at x within (convex hull {a,b,c})"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2365 | using assms holomorphic_on_def by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2366 |     { fix k n
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2367 | assume k: "0 < k" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2368 | and le: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2369 | "\<And>x' y' z'. | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2370 | \<lbrakk>dist x' y' \<le> k; dist y' z' \<le> k; dist z' x' \<le> k; | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2371 |                 x \<in> convex hull {x',y',z'};
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2372 |                 convex hull {x',y',z'} \<subseteq> convex hull {a,b,c}\<rbrakk>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2373 | \<Longrightarrow> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2374 | cmod (?pathint x' y' + ?pathint y' z' + ?pathint z' x') * 10 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2375 | \<le> e * (dist x' y' + dist y' z' + dist z' x')\<^sup>2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2376 | and Kk: "K / k < 2 ^ n" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2377 | have "K / 2 ^ n < k" using Kk k | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2378 | by (auto simp: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2379 | then have DD: "dist (fa n) (fb n) \<le> k" "dist (fb n) (fc n) \<le> k" "dist (fc n) (fa n) \<le> k" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2380 | using dist [of n] k | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2381 | by linarith+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2382 | have dle: "(dist (fa n) (fb n) + dist (fb n) (fc n) + dist (fc n) (fa n))\<^sup>2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2383 | \<le> (3 * K / 2 ^ n)\<^sup>2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2384 | using dist [of n] e K | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2385 | by (simp add: abs_le_square_iff [symmetric]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2386 | have less10: "\<And>x y::real. 0 < x \<Longrightarrow> y \<le> 9*x \<Longrightarrow> y < x*10" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2387 | by linarith | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2388 | have "e * (dist (fa n) (fb n) + dist (fb n) (fc n) + dist (fc n) (fa n))\<^sup>2 \<le> e * (3 * K / 2 ^ n)\<^sup>2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2389 | using ynz dle e mult_le_cancel_left_pos by blast | 
| 68339 | 2390 | also have "\<dots> < | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2391 | cmod (?pathint (fa n) (fb n) + ?pathint (fb n) (fc n) + ?pathint (fc n) (fa n)) * 10" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2392 | using no [of n] e K | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2393 | apply (simp add: e_def field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2394 | apply (simp only: zero_less_norm_iff [symmetric]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2395 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2396 | finally have False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2397 | using le [OF DD x cosb] by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2398 | } then | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2399 | have ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2400 | using holomorphic_point_small_triangle [OF xin contf fx, of "e/10"] e | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2401 | apply clarsimp | 
| 68339 | 2402 | apply (rule_tac y1="K/k" in exE [OF real_arch_pow[of 2]], force+) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2403 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2404 | } | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2405 | moreover have "f contour_integrable_on (linepath a b +++ linepath b c +++ linepath c a)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2406 | by simp (meson contf continuous_on_subset contour_integrable_continuous_linepath segments_subset_convex_hull(1) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2407 | segments_subset_convex_hull(3) segments_subset_convex_hull(5)) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2408 | ultimately show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2409 | using has_contour_integral_integral by fastforce | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2410 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2411 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2412 | subsection%unimportant \<open>Version needing function holomorphic in interior only\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2413 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2414 | lemma Cauchy_theorem_flat_lemma: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2415 |   assumes f: "continuous_on (convex hull {a,b,c}) f"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2416 | and c: "c - a = k *\<^sub>R (b - a)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2417 | and k: "0 \<le> k" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2418 | shows "contour_integral (linepath a b) f + contour_integral (linepath b c) f + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2419 | contour_integral (linepath c a) f = 0" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2420 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2421 | have fabc: "continuous_on (closed_segment a b) f" "continuous_on (closed_segment b c) f" "continuous_on (closed_segment c a) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2422 | using f continuous_on_subset segments_subset_convex_hull by metis+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2423 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2424 | proof (cases "k \<le> 1") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2425 | case True show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2426 | by (simp add: contour_integral_split [OF fabc(1) k True c] contour_integral_reverse_linepath fabc) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2427 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2428 | case False then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2429 | using fabc c | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2430 | apply (subst contour_integral_split [of a c f "1/k" b, symmetric]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2431 | apply (metis closed_segment_commute fabc(3)) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2432 | apply (auto simp: k contour_integral_reverse_linepath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2433 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2434 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2435 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2436 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2437 | lemma Cauchy_theorem_flat: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2438 |   assumes f: "continuous_on (convex hull {a,b,c}) f"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2439 | and c: "c - a = k *\<^sub>R (b - a)" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2440 | shows "contour_integral (linepath a b) f + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2441 | contour_integral (linepath b c) f + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2442 | contour_integral (linepath c a) f = 0" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2443 | proof (cases "0 \<le> k") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2444 | case True with assms show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2445 | by (blast intro: Cauchy_theorem_flat_lemma) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2446 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2447 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2448 | have "continuous_on (closed_segment a b) f" "continuous_on (closed_segment b c) f" "continuous_on (closed_segment c a) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2449 | using f continuous_on_subset segments_subset_convex_hull by metis+ | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2450 | moreover have "contour_integral (linepath b a) f + contour_integral (linepath a c) f + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2451 | contour_integral (linepath c b) f = 0" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2452 | apply (rule Cauchy_theorem_flat_lemma [of b a c f "1-k"]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2453 | using False c | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2454 | apply (auto simp: f insert_commute scaleR_conv_of_real algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2455 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2456 | ultimately show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2457 | apply (auto simp: contour_integral_reverse_linepath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2458 | using add_eq_0_iff by force | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2459 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2460 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2461 | lemma Cauchy_theorem_triangle_interior: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2462 |   assumes contf: "continuous_on (convex hull {a,b,c}) f"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2463 |       and holf:  "f holomorphic_on interior (convex hull {a,b,c})"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2464 | shows "(f has_contour_integral 0) (linepath a b +++ linepath b c +++ linepath c a)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2465 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2466 | have fabc: "continuous_on (closed_segment a b) f" "continuous_on (closed_segment b c) f" "continuous_on (closed_segment c a) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2467 | using contf continuous_on_subset segments_subset_convex_hull by metis+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2468 |   have "bounded (f ` (convex hull {a,b,c}))"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2469 | by (simp add: compact_continuous_image compact_convex_hull compact_imp_bounded contf) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2470 |   then obtain B where "0 < B" and Bnf: "\<And>x. x \<in> convex hull {a,b,c} \<Longrightarrow> norm (f x) \<le> B"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2471 | by (auto simp: dest!: bounded_pos [THEN iffD1]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2472 |   have "bounded (convex hull {a,b,c})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2473 | by (simp add: bounded_convex_hull) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2474 |   then obtain C where C: "0 < C" and Cno: "\<And>y. y \<in> convex hull {a,b,c} \<Longrightarrow> norm y < C"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2475 | using bounded_pos_less by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2476 | then have diff_2C: "norm(x - y) \<le> 2*C" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2477 |            if x: "x \<in> convex hull {a, b, c}" and y: "y \<in> convex hull {a, b, c}" for x y
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2478 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2479 | have "cmod x \<le> C" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2480 | using x by (meson Cno not_le not_less_iff_gr_or_eq) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2481 | hence "cmod (x - y) \<le> C + C" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2482 | using y by (meson Cno add_mono_thms_linordered_field(4) less_eq_real_def norm_triangle_ineq4 order_trans) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2483 | thus "cmod (x - y) \<le> 2 * C" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2484 | by (metis mult_2) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2485 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2486 |   have contf': "continuous_on (convex hull {b,a,c}) f"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2487 | using contf by (simp add: insert_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2488 |   { fix y::complex
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2489 | assume fy: "(f has_contour_integral y) (linepath a b +++ linepath b c +++ linepath c a)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2490 | and ynz: "y \<noteq> 0" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2491 | have pi_eq_y: "contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = y" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2492 | by (rule has_chain_integral_chain_integral3 [OF fy]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2493 | have ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2494 | proof (cases "c=a \<or> a=b \<or> b=c") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2495 | case True then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2496 | using Cauchy_theorem_flat [OF contf, of 0] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2497 | using has_chain_integral_chain_integral3 [OF fy] ynz | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2498 | by (force simp: fabc contour_integral_reverse_linepath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2499 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2500 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2501 |       then have car3: "card {a, b, c} = Suc (DIM(complex))"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2502 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2503 |       { assume "interior(convex hull {a,b,c}) = {}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2504 |         then have "collinear{a,b,c}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2505 | using interior_convex_hull_eq_empty [OF car3] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2506 | by (simp add: collinear_3_eq_affine_dependent) | 
| 68302 | 2507 | with False obtain d where "c \<noteq> a" "a \<noteq> b" "b \<noteq> c" "c - b = d *\<^sub>R (a - b)" | 
| 68339 | 2508 | by (auto simp: collinear_3 collinear_lemma) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2509 | then have "False" | 
| 68302 | 2510 | using False Cauchy_theorem_flat [OF contf'] pi_eq_y ynz | 
| 2511 | by (simp add: fabc add_eq_0_iff contour_integral_reverse_linepath) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2512 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2513 |       then obtain d where d: "d \<in> interior (convex hull {a, b, c})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2514 | by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2515 |       { fix d1
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2516 | assume d1_pos: "0 < d1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2517 |            and d1: "\<And>x x'. \<lbrakk>x\<in>convex hull {a, b, c}; x'\<in>convex hull {a, b, c}; cmod (x' - x) < d1\<rbrakk>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2518 | \<Longrightarrow> cmod (f x' - f x) < cmod y / (24 * C)" | 
| 63040 | 2519 | define e where "e = min 1 (min (d1/(4*C)) ((norm y / 24 / C) / B))" | 
| 2520 | define shrink where "shrink x = x - e *\<^sub>R (x - d)" for x | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2521 | let ?pathint = "\<lambda>x y. contour_integral(linepath x y) f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2522 | have e: "0 < e" "e \<le> 1" "e \<le> d1 / (4 * C)" "e \<le> cmod y / 24 / C / B" | 
| 61222 | 2523 | using d1_pos \<open>C>0\<close> \<open>B>0\<close> ynz by (simp_all add: e_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2524 | then have eCB: "24 * e * C * B \<le> cmod y" | 
| 61222 | 2525 | using \<open>C>0\<close> \<open>B>0\<close> by (simp add: field_simps) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2526 | have e_le_d1: "e * (4 * C) \<le> d1" | 
| 61222 | 2527 | using e \<open>C>0\<close> by (simp add: field_simps) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2528 |         have "shrink a \<in> interior(convex hull {a,b,c})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2529 |              "shrink b \<in> interior(convex hull {a,b,c})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2530 |              "shrink c \<in> interior(convex hull {a,b,c})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2531 | using d e by (auto simp: hull_inc mem_interior_convex_shrink shrink_def) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2532 | then have fhp0: "(f has_contour_integral 0) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2533 | (linepath (shrink a) (shrink b) +++ linepath (shrink b) (shrink c) +++ linepath (shrink c) (shrink a))" | 
| 68310 | 2534 | by (simp add: Cauchy_theorem_triangle holomorphic_on_subset [OF holf] hull_minimal) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2535 | then have f_0_shrink: "?pathint (shrink a) (shrink b) + ?pathint (shrink b) (shrink c) + ?pathint (shrink c) (shrink a) = 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2536 | by (simp add: has_chain_integral_chain_integral3) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2537 | have fpi_abc: "f contour_integrable_on linepath (shrink a) (shrink b)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2538 | "f contour_integrable_on linepath (shrink b) (shrink c)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2539 | "f contour_integrable_on linepath (shrink c) (shrink a)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2540 | using fhp0 by (auto simp: valid_path_join dest: has_contour_integral_integrable) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2541 | have cmod_shr: "\<And>x y. cmod (shrink y - shrink x - (y - x)) = e * cmod (x - y)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2542 | using e by (simp add: shrink_def real_vector.scale_right_diff_distrib [symmetric]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2543 | have sh_eq: "\<And>a b d::complex. (b - e *\<^sub>R (b - d)) - (a - e *\<^sub>R (a - d)) - (b - a) = e *\<^sub>R (a - b)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2544 | by (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2545 | have "cmod y / (24 * C) \<le> cmod y / cmod (b - a) / 12" | 
| 61222 | 2546 | using False \<open>C>0\<close> diff_2C [of b a] ynz | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2547 | by (auto simp: divide_simps hull_inc) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2548 |         have less_C: "\<lbrakk>u \<in> convex hull {a, b, c}; 0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> x * cmod u < C" for x u
 | 
| 61222 | 2549 | apply (cases "x=0", simp add: \<open>0<C\<close>) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2550 | using Cno [of u] mult_left_le_one_le [of "cmod u" x] le_less_trans norm_ge_zero by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2551 |         { fix u v
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2552 |           assume uv: "u \<in> convex hull {a, b, c}" "v \<in> convex hull {a, b, c}" "u\<noteq>v"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2553 | and fpi_uv: "f contour_integrable_on linepath (shrink u) (shrink v)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2554 |           have shr_uv: "shrink u \<in> interior(convex hull {a,b,c})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2555 |                        "shrink v \<in> interior(convex hull {a,b,c})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2556 | using d e uv | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2557 | by (auto simp: hull_inc mem_interior_convex_shrink shrink_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2558 | have cmod_fuv: "\<And>x. 0\<le>x \<Longrightarrow> x\<le>1 \<Longrightarrow> cmod (f (linepath (shrink u) (shrink v) x)) \<le> B" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2559 | using shr_uv by (blast intro: Bnf linepath_in_convex_hull interior_subset [THEN subsetD]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2560 | have By_uv: "B * (12 * (e * cmod (u - v))) \<le> cmod y" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2561 | apply (rule order_trans [OF _ eCB]) | 
| 61222 | 2562 | using e \<open>B>0\<close> diff_2C [of u v] uv | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2563 | by (auto simp: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2564 |           { fix x::real   assume x: "0\<le>x" "x\<le>1"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2565 | have cmod_less_4C: "cmod ((1 - x) *\<^sub>R u - (1 - x) *\<^sub>R d) + cmod (x *\<^sub>R v - x *\<^sub>R d) < (C+C) + (C+C)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2566 | apply (rule add_strict_mono; rule norm_triangle_half_l [of _ 0]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2567 | using uv x d interior_subset | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2568 | apply (auto simp: hull_inc intro!: less_C) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2569 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2570 | have ll: "linepath (shrink u) (shrink v) x - linepath u v x = -e * ((1 - x) *\<^sub>R (u - d) + x *\<^sub>R (v - d))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2571 | by (simp add: linepath_def shrink_def algebra_simps scaleR_conv_of_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2572 | have cmod_less_dt: "cmod (linepath (shrink u) (shrink v) x - linepath u v x) < d1" | 
| 68310 | 2573 | apply (simp only: ll norm_mult scaleR_diff_right) | 
| 2574 | using \<open>e>0\<close> cmod_less_4C apply (force intro: norm_triangle_lt less_le_trans [OF _ e_le_d1]) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2575 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2576 | have "cmod (f (linepath (shrink u) (shrink v) x) - f (linepath u v x)) < cmod y / (24 * C)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2577 | using x uv shr_uv cmod_less_dt | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2578 | by (auto simp: hull_inc intro: d1 interior_subset [THEN subsetD] linepath_in_convex_hull) | 
| 68339 | 2579 | also have "\<dots> \<le> cmod y / cmod (v - u) / 12" | 
| 61222 | 2580 | using False uv \<open>C>0\<close> diff_2C [of v u] ynz | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2581 | by (auto simp: divide_simps hull_inc) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2582 | finally have "cmod (f (linepath (shrink u) (shrink v) x) - f (linepath u v x)) \<le> cmod y / cmod (v - u) / 12" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2583 | by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2584 | then have cmod_12_le: "cmod (v - u) * cmod (f (linepath (shrink u) (shrink v) x) - f (linepath u v x)) * 12 \<le> cmod y" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2585 | using uv False by (auto simp: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2586 | have "cmod (f (linepath (shrink u) (shrink v) x)) * cmod (shrink v - shrink u - (v - u)) + | 
| 68302 | 2587 | cmod (v - u) * cmod (f (linepath (shrink u) (shrink v) x) - f (linepath u v x)) | 
| 2588 | \<le> B * (cmod y / 24 / C / B * 2 * C) + 2 * C * (cmod y / 24 / C)" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2589 | apply (rule add_mono [OF mult_mono]) | 
| 68302 | 2590 | using By_uv e \<open>0 < B\<close> \<open>0 < C\<close> x apply (simp_all add: cmod_fuv cmod_shr cmod_12_le) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2591 | apply (simp add: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2592 | done | 
| 68339 | 2593 | also have "\<dots> \<le> cmod y / 6" | 
| 2594 | by simp | |
| 68302 | 2595 | finally have "cmod (f (linepath (shrink u) (shrink v) x)) * cmod (shrink v - shrink u - (v - u)) + | 
| 2596 | cmod (v - u) * cmod (f (linepath (shrink u) (shrink v) x) - f (linepath u v x)) | |
| 2597 | \<le> cmod y / 6" . | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2598 | } note cmod_diff_le = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2599 | have f_uv: "continuous_on (closed_segment u v) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2600 | by (blast intro: uv continuous_on_subset [OF contf closed_segment_subset_convex_hull]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2601 | have **: "\<And>f' x' f x::complex. f'*x' - f*x = f'*(x' - x) + x*(f' - f)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2602 | by (simp add: algebra_simps) | 
| 68493 | 2603 | have "norm (?pathint (shrink u) (shrink v) - ?pathint u v) | 
| 68310 | 2604 | \<le> (B*(norm y /24/C/B)*2*C + (2*C)*(norm y/24/C)) * content (cbox 0 (1::real))" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2605 | apply (rule has_integral_bound | 
| 68310 | 2606 | [of _ "\<lambda>x. f(linepath (shrink u) (shrink v) x) * (shrink v - shrink u) - f(linepath u v x)*(v - u)" | 
| 2607 | _ 0 1]) | |
| 61222 | 2608 | using ynz \<open>0 < B\<close> \<open>0 < C\<close> | 
| 68310 | 2609 | apply (simp_all del: le_divide_eq_numeral1) | 
| 66112 
0e640e04fc56
New theorems; stronger theorems; tidier theorems. Also some renaming
 paulson <lp15@cam.ac.uk> parents: 
65587diff
changeset | 2610 | apply (simp add: has_integral_diff has_contour_integral_linepath [symmetric] has_contour_integral_integral | 
| 68310 | 2611 | fpi_uv f_uv contour_integrable_continuous_linepath) | 
| 68339 | 2612 | apply (auto simp: ** norm_triangle_le norm_mult cmod_diff_le simp del: le_divide_eq_numeral1) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2613 | done | 
| 68339 | 2614 | also have "\<dots> \<le> norm y / 6" | 
| 68310 | 2615 | by simp | 
| 2616 | finally have "norm (?pathint (shrink u) (shrink v) - ?pathint u v) \<le> norm y / 6" . | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2617 | } note * = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2618 | have "norm (?pathint (shrink a) (shrink b) - ?pathint a b) \<le> norm y / 6" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2619 | using False fpi_abc by (rule_tac *) (auto simp: hull_inc) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2620 | moreover | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2621 | have "norm (?pathint (shrink b) (shrink c) - ?pathint b c) \<le> norm y / 6" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2622 | using False fpi_abc by (rule_tac *) (auto simp: hull_inc) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2623 | moreover | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2624 | have "norm (?pathint (shrink c) (shrink a) - ?pathint c a) \<le> norm y / 6" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2625 | using False fpi_abc by (rule_tac *) (auto simp: hull_inc) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2626 | ultimately | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2627 | have "norm((?pathint (shrink a) (shrink b) - ?pathint a b) + | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2628 | (?pathint (shrink b) (shrink c) - ?pathint b c) + (?pathint (shrink c) (shrink a) - ?pathint c a)) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2629 | \<le> norm y / 6 + norm y / 6 + norm y / 6" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2630 | by (metis norm_triangle_le add_mono) | 
| 68339 | 2631 | also have "\<dots> = norm y / 2" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2632 | by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2633 | finally have "norm((?pathint (shrink a) (shrink b) + ?pathint (shrink b) (shrink c) + ?pathint (shrink c) (shrink a)) - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2634 | (?pathint a b + ?pathint b c + ?pathint c a)) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2635 | \<le> norm y / 2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2636 | by (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2637 | then | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2638 | have "norm(?pathint a b + ?pathint b c + ?pathint c a) \<le> norm y / 2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2639 | by (simp add: f_0_shrink) (metis (mono_tags) add.commute minus_add_distrib norm_minus_cancel uminus_add_conv_diff) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2640 | then have "False" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2641 | using pi_eq_y ynz by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2642 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2643 |         moreover have "uniformly_continuous_on (convex hull {a,b,c}) f"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2644 | by (simp add: contf compact_convex_hull compact_uniformly_continuous) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2645 | ultimately have "False" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2646 | unfolding uniformly_continuous_on_def | 
| 61222 | 2647 | by (force simp: ynz \<open>0 < C\<close> dist_norm) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2648 | then show ?thesis .. | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2649 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2650 | } | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2651 | moreover have "f contour_integrable_on (linepath a b +++ linepath b c +++ linepath c a)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2652 | using fabc contour_integrable_continuous_linepath by auto | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2653 | ultimately show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2654 | using has_contour_integral_integral by fastforce | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2655 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2656 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2657 | subsection%unimportant \<open>Version allowing finite number of exceptional points\<close> | 
| 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2658 | |
| 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2659 | proposition%unimportant Cauchy_theorem_triangle_cofinite: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2660 |   assumes "continuous_on (convex hull {a,b,c}) f"
 | 
| 68310 | 2661 | and "finite S" | 
| 2662 |       and "(\<And>x. x \<in> interior(convex hull {a,b,c}) - S \<Longrightarrow> f field_differentiable (at x))"
 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2663 | shows "(f has_contour_integral 0) (linepath a b +++ linepath b c +++ linepath c a)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2664 | using assms | 
| 68310 | 2665 | proof (induction "card S" arbitrary: a b c S rule: less_induct) | 
| 2666 | case (less S a b c) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2667 | show ?case | 
| 68310 | 2668 |   proof (cases "S={}")
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2669 | case True with less show ?thesis | 
| 68310 | 2670 | by (fastforce simp: holomorphic_on_def field_differentiable_at_within Cauchy_theorem_triangle_interior) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2671 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2672 | case False | 
| 68310 | 2673 | then obtain d S' where d: "S = insert d S'" "d \<notin> S'" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2674 | by (meson Set.set_insert all_not_in_conv) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2675 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2676 |     proof (cases "d \<in> convex hull {a,b,c}")
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2677 | case False | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2678 | show "(f has_contour_integral 0) (linepath a b +++ linepath b c +++ linepath c a)" | 
| 68310 | 2679 | proof (rule less.hyps) | 
| 2680 |         show "\<And>x. x \<in> interior (convex hull {a, b, c}) - S' \<Longrightarrow> f field_differentiable at x"
 | |
| 2681 | using False d interior_subset by (auto intro!: less.prems) | |
| 2682 | qed (use d less.prems in auto) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2683 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2684 | case True | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2685 |       have *: "convex hull {a, b, d} \<subseteq> convex hull {a, b, c}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2686 | by (meson True hull_subset insert_subset convex_hull_subset) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2687 | have abd: "(f has_contour_integral 0) (linepath a b +++ linepath b d +++ linepath d a)" | 
| 68310 | 2688 | proof (rule less.hyps) | 
| 2689 |         show "\<And>x. x \<in> interior (convex hull {a, b, d}) - S' \<Longrightarrow> f field_differentiable at x"
 | |
| 2690 | using d not_in_interior_convex_hull_3 | |
| 2691 | by (clarsimp intro!: less.prems) (metis * insert_absorb insert_subset interior_mono) | |
| 2692 | qed (use d continuous_on_subset [OF _ *] less.prems in auto) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2693 |       have *: "convex hull {b, c, d} \<subseteq> convex hull {a, b, c}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2694 | by (meson True hull_subset insert_subset convex_hull_subset) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2695 | have bcd: "(f has_contour_integral 0) (linepath b c +++ linepath c d +++ linepath d b)" | 
| 68310 | 2696 | proof (rule less.hyps) | 
| 2697 |         show "\<And>x. x \<in> interior (convex hull {b, c, d}) - S' \<Longrightarrow> f field_differentiable at x"
 | |
| 2698 | using d not_in_interior_convex_hull_3 | |
| 2699 | by (clarsimp intro!: less.prems) (metis * insert_absorb insert_subset interior_mono) | |
| 2700 | qed (use d continuous_on_subset [OF _ *] less.prems in auto) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2701 |       have *: "convex hull {c, a, d} \<subseteq> convex hull {a, b, c}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2702 | by (meson True hull_subset insert_subset convex_hull_subset) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2703 | have cad: "(f has_contour_integral 0) (linepath c a +++ linepath a d +++ linepath d c)" | 
| 68310 | 2704 | proof (rule less.hyps) | 
| 2705 |         show "\<And>x. x \<in> interior (convex hull {c, a, d}) - S' \<Longrightarrow> f field_differentiable at x"
 | |
| 2706 | using d not_in_interior_convex_hull_3 | |
| 2707 | by (clarsimp intro!: less.prems) (metis * insert_absorb insert_subset interior_mono) | |
| 2708 | qed (use d continuous_on_subset [OF _ *] less.prems in auto) | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2709 | have "f contour_integrable_on linepath a b" | 
| 68310 | 2710 | using less.prems abd contour_integrable_joinD1 contour_integrable_on_def by blast | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2711 | moreover have "f contour_integrable_on linepath b c" | 
| 68310 | 2712 | using less.prems bcd contour_integrable_joinD1 contour_integrable_on_def by blast | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2713 | moreover have "f contour_integrable_on linepath c a" | 
| 68310 | 2714 | using less.prems cad contour_integrable_joinD1 contour_integrable_on_def by blast | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2715 | ultimately have fpi: "f contour_integrable_on (linepath a b +++ linepath b c +++ linepath c a)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2716 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2717 |       { fix y::complex
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2718 | assume fy: "(f has_contour_integral y) (linepath a b +++ linepath b c +++ linepath c a)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2719 | and ynz: "y \<noteq> 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2720 | have cont_ad: "continuous_on (closed_segment a d) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2721 | by (meson "*" continuous_on_subset less.prems(1) segments_subset_convex_hull(3)) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2722 | have cont_bd: "continuous_on (closed_segment b d) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2723 | by (meson True closed_segment_subset_convex_hull continuous_on_subset hull_subset insert_subset less.prems(1)) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2724 | have cont_cd: "continuous_on (closed_segment c d) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2725 | by (meson "*" continuous_on_subset less.prems(1) segments_subset_convex_hull(2)) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2726 | have "contour_integral (linepath a b) f = - (contour_integral (linepath b d) f + (contour_integral (linepath d a) f))" | 
| 68310 | 2727 | "contour_integral (linepath b c) f = - (contour_integral (linepath c d) f + (contour_integral (linepath d b) f))" | 
| 2728 | "contour_integral (linepath c a) f = - (contour_integral (linepath a d) f + contour_integral (linepath d c) f)" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2729 | using has_chain_integral_chain_integral3 [OF abd] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2730 | has_chain_integral_chain_integral3 [OF bcd] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2731 | has_chain_integral_chain_integral3 [OF cad] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2732 | by (simp_all add: algebra_simps add_eq_0_iff) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2733 | then have ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2734 | using cont_ad cont_bd cont_cd fy has_chain_integral_chain_integral3 contour_integral_reverse_linepath by fastforce | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2735 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2736 | then show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2737 | using fpi contour_integrable_on_def by blast | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2738 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2739 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2740 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2741 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2742 | subsection%unimportant \<open>Cauchy's theorem for an open starlike set\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2743 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2744 | lemma starlike_convex_subset: | 
| 68310 | 2745 | assumes S: "a \<in> S" "closed_segment b c \<subseteq> S" and subs: "\<And>x. x \<in> S \<Longrightarrow> closed_segment a x \<subseteq> S" | 
| 2746 |     shows "convex hull {a,b,c} \<subseteq> S"
 | |
| 2747 | using S | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2748 |       apply (clarsimp simp add: convex_hull_insert [of "{b,c}" a] segment_convex_hull)
 | 
| 61518 
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
 paulson parents: 
61426diff
changeset | 2749 | apply (meson subs convexD convex_closed_segment ends_in_segment(1) ends_in_segment(2) subsetCE) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2750 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2751 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2752 | lemma triangle_contour_integrals_starlike_primitive: | 
| 68310 | 2753 | assumes contf: "continuous_on S f" | 
| 2754 | and S: "a \<in> S" "open S" | |
| 2755 | and x: "x \<in> S" | |
| 2756 | and subs: "\<And>y. y \<in> S \<Longrightarrow> closed_segment a y \<subseteq> S" | |
| 2757 | and zer: "\<And>b c. closed_segment b c \<subseteq> S | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2758 | \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2759 | contour_integral (linepath c a) f = 0" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2760 | shows "((\<lambda>x. contour_integral(linepath a x) f) has_field_derivative f x) (at x)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2761 | proof - | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2762 | let ?pathint = "\<lambda>x y. contour_integral(linepath x y) f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2763 |   { fix e y
 | 
| 68310 | 2764 | assume e: "0 < e" and bxe: "ball x e \<subseteq> S" and close: "cmod (y - x) < e" | 
| 2765 | have y: "y \<in> S" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2766 | using bxe close by (force simp: dist_norm norm_minus_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2767 | have cont_ayf: "continuous_on (closed_segment a y) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2768 | using contf continuous_on_subset subs y by blast | 
| 68310 | 2769 | have xys: "closed_segment x y \<subseteq> S" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2770 | apply (rule order_trans [OF _ bxe]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2771 | using close | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2772 | by (auto simp: dist_norm ball_def norm_minus_commute dest: segment_bound) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2773 | have "?pathint a y - ?pathint a x = ?pathint x y" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2774 | using zer [OF xys] contour_integral_reverse_linepath [OF cont_ayf] add_eq_0_iff by force | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2775 | } note [simp] = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2776 |   { fix e::real
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2777 | assume e: "0 < e" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2778 | have cont_atx: "continuous (at x) f" | 
| 68310 | 2779 | using x S contf continuous_on_eq_continuous_at by blast | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2780 | then obtain d1 where d1: "d1>0" and d1_less: "\<And>y. cmod (y - x) < d1 \<Longrightarrow> cmod (f y - f x) < e/2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2781 | unfolding continuous_at Lim_at dist_norm using e | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2782 | by (drule_tac x="e/2" in spec) force | 
| 68310 | 2783 | obtain d2 where d2: "d2>0" "ball x d2 \<subseteq> S" using \<open>open S\<close> x | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2784 | by (auto simp: open_contains_ball) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2785 | have dpos: "min d1 d2 > 0" using d1 d2 by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2786 |     { fix y
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2787 | assume yx: "y \<noteq> x" and close: "cmod (y - x) < min d1 d2" | 
| 68310 | 2788 | have y: "y \<in> S" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2789 | using d2 close by (force simp: dist_norm norm_minus_commute) | 
| 68310 | 2790 | have "closed_segment x y \<subseteq> S" | 
| 2791 | using close d2 by (auto simp: dist_norm norm_minus_commute dest!: segment_bound(1)) | |
| 2792 | then have fxy: "f contour_integrable_on linepath x y" | |
| 2793 | by (metis contour_integrable_continuous_linepath continuous_on_subset [OF contf]) | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2794 | then obtain i where i: "(f has_contour_integral i) (linepath x y)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2795 | by (auto simp: contour_integrable_on_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2796 | then have "((\<lambda>w. f w - f x) has_contour_integral (i - f x * (y - x))) (linepath x y)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2797 | by (rule has_contour_integral_diff [OF _ has_contour_integral_const_linepath]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2798 | then have "cmod (i - f x * (y - x)) \<le> e / 2 * cmod (y - x)" | 
| 68310 | 2799 | proof (rule has_contour_integral_bound_linepath) | 
| 2800 | show "\<And>u. u \<in> closed_segment x y \<Longrightarrow> cmod (f u - f x) \<le> e / 2" | |
| 2801 | by (meson close d1_less le_less_trans less_imp_le min.strict_boundedE segment_bound1) | |
| 2802 | qed (use e in simp) | |
| 68339 | 2803 | also have "\<dots> < e * cmod (y - x)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2804 | by (simp add: e yx) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2805 | finally have "cmod (?pathint x y - f x * (y-x)) / cmod (y-x) < e" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2806 | using i yx by (simp add: contour_integral_unique divide_less_eq) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2807 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2808 | then have "\<exists>d>0. \<forall>y. y \<noteq> x \<and> cmod (y-x) < d \<longrightarrow> cmod (?pathint x y - f x * (y-x)) / cmod (y-x) < e" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2809 | using dpos by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2810 | } | 
| 61976 | 2811 | then have *: "(\<lambda>y. (?pathint x y - f x * (y - x)) /\<^sub>R cmod (y - x)) \<midarrow>x\<rightarrow> 0" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2812 | by (simp add: Lim_at dist_norm inverse_eq_divide) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2813 | show ?thesis | 
| 67685 
bdff8bf0a75b
moved theorems from AFP/Affine_Arithmetic and AFP/Ordinary_Differential_Equations
 immler parents: 
67613diff
changeset | 2814 | apply (simp add: has_field_derivative_def has_derivative_at2 bounded_linear_mult_right) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2815 | apply (rule Lim_transform [OF * Lim_eventually]) | 
| 68310 | 2816 | using \<open>open S\<close> x apply (force simp: dist_norm open_contains_ball inverse_eq_divide [symmetric] eventually_at) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2817 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2818 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2819 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2820 | (** Existence of a primitive.*) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2821 | lemma holomorphic_starlike_primitive: | 
| 62533 
bc25f3916a99
new material to Blochj's theorem, as well as supporting lemmas
 paulson <lp15@cam.ac.uk> parents: 
62464diff
changeset | 2822 | fixes f :: "complex \<Rightarrow> complex" | 
| 68310 | 2823 | assumes contf: "continuous_on S f" | 
| 2824 | and S: "starlike S" and os: "open S" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2825 | and k: "finite k" | 
| 68310 | 2826 | and fcd: "\<And>x. x \<in> S - k \<Longrightarrow> f field_differentiable at x" | 
| 2827 | shows "\<exists>g. \<forall>x \<in> S. (g has_field_derivative f x) (at x)" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2828 | proof - | 
| 68310 | 2829 | obtain a where a: "a\<in>S" and a_cs: "\<And>x. x\<in>S \<Longrightarrow> closed_segment a x \<subseteq> S" | 
| 2830 | using S by (auto simp: starlike_def) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2831 |   { fix x b c
 | 
| 68310 | 2832 | assume "x \<in> S" "closed_segment b c \<subseteq> S" | 
| 2833 |     then have abcs: "convex hull {a, b, c} \<subseteq> S"
 | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2834 | by (simp add: a a_cs starlike_convex_subset) | 
| 68310 | 2835 |     then have "continuous_on (convex hull {a, b, c}) f"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2836 | by (simp add: continuous_on_subset [OF contf]) | 
| 68310 | 2837 | then have "(f has_contour_integral 0) (linepath a b +++ linepath b c +++ linepath c a)" | 
| 2838 | using abcs interior_subset by (force intro: fcd Cauchy_theorem_triangle_cofinite [OF _ k]) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2839 | } note 0 = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2840 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2841 | apply (intro exI ballI) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2842 | apply (rule triangle_contour_integrals_starlike_primitive [OF contf a os], assumption) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2843 | apply (metis a_cs) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2844 | apply (metis has_chain_integral_chain_integral3 0) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2845 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2846 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2847 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2848 | lemma Cauchy_theorem_starlike: | 
| 68310 | 2849 | "\<lbrakk>open S; starlike S; finite k; continuous_on S f; | 
| 2850 | \<And>x. x \<in> S - k \<Longrightarrow> f field_differentiable at x; | |
| 2851 | valid_path g; path_image g \<subseteq> S; pathfinish g = pathstart g\<rbrakk> | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2852 | \<Longrightarrow> (f has_contour_integral 0) g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2853 | by (metis holomorphic_starlike_primitive Cauchy_theorem_primitive at_within_open) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2854 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2855 | lemma Cauchy_theorem_starlike_simple: | 
| 68310 | 2856 | "\<lbrakk>open S; starlike S; f holomorphic_on S; valid_path g; path_image g \<subseteq> S; pathfinish g = pathstart g\<rbrakk> | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2857 | \<Longrightarrow> (f has_contour_integral 0) g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2858 | apply (rule Cauchy_theorem_starlike [OF _ _ finite.emptyI]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2859 | apply (simp_all add: holomorphic_on_imp_continuous_on) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2860 | apply (metis at_within_open holomorphic_on_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2861 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2862 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2863 | subsection\<open>Cauchy's theorem for a convex set\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2864 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2865 | text\<open>For a convex set we can avoid assuming openness and boundary analyticity\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2866 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2867 | lemma triangle_contour_integrals_convex_primitive: | 
| 68310 | 2868 | assumes contf: "continuous_on S f" | 
| 2869 | and S: "a \<in> S" "convex S" | |
| 2870 | and x: "x \<in> S" | |
| 2871 | and zer: "\<And>b c. \<lbrakk>b \<in> S; c \<in> S\<rbrakk> | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2872 | \<Longrightarrow> contour_integral (linepath a b) f + contour_integral (linepath b c) f + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2873 | contour_integral (linepath c a) f = 0" | 
| 68310 | 2874 | shows "((\<lambda>x. contour_integral(linepath a x) f) has_field_derivative f x) (at x within S)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2875 | proof - | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2876 | let ?pathint = "\<lambda>x y. contour_integral(linepath x y) f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2877 |   { fix y
 | 
| 68310 | 2878 | assume y: "y \<in> S" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2879 | have cont_ayf: "continuous_on (closed_segment a y) f" | 
| 68310 | 2880 | using S y by (meson contf continuous_on_subset convex_contains_segment) | 
| 2881 | have xys: "closed_segment x y \<subseteq> S" (*?*) | |
| 2882 | using convex_contains_segment S x y by auto | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2883 | have "?pathint a y - ?pathint a x = ?pathint x y" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2884 | using zer [OF x y] contour_integral_reverse_linepath [OF cont_ayf] add_eq_0_iff by force | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2885 | } note [simp] = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2886 |   { fix e::real
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2887 | assume e: "0 < e" | 
| 68310 | 2888 | have cont_atx: "continuous (at x within S) f" | 
| 2889 | using x S contf by (simp add: continuous_on_eq_continuous_within) | |
| 2890 | then obtain d1 where d1: "d1>0" and d1_less: "\<And>y. \<lbrakk>y \<in> S; cmod (y - x) < d1\<rbrakk> \<Longrightarrow> cmod (f y - f x) < e/2" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2891 | unfolding continuous_within Lim_within dist_norm using e | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2892 | by (drule_tac x="e/2" in spec) force | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2893 |     { fix y
 | 
| 68310 | 2894 | assume yx: "y \<noteq> x" and close: "cmod (y - x) < d1" and y: "y \<in> S" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2895 | have fxy: "f contour_integrable_on linepath x y" | 
| 68310 | 2896 | using convex_contains_segment S x y | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2897 | by (blast intro!: contour_integrable_continuous_linepath continuous_on_subset [OF contf]) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2898 | then obtain i where i: "(f has_contour_integral i) (linepath x y)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2899 | by (auto simp: contour_integrable_on_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2900 | then have "((\<lambda>w. f w - f x) has_contour_integral (i - f x * (y - x))) (linepath x y)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2901 | by (rule has_contour_integral_diff [OF _ has_contour_integral_const_linepath]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2902 | then have "cmod (i - f x * (y - x)) \<le> e / 2 * cmod (y - x)" | 
| 68310 | 2903 | proof (rule has_contour_integral_bound_linepath) | 
| 2904 | show "\<And>u. u \<in> closed_segment x y \<Longrightarrow> cmod (f u - f x) \<le> e / 2" | |
| 2905 | by (meson assms(3) close convex_contains_segment d1_less le_less_trans less_imp_le segment_bound1 subset_iff x y) | |
| 2906 | qed (use e in simp) | |
| 68339 | 2907 | also have "\<dots> < e * cmod (y - x)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2908 | by (simp add: e yx) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2909 | finally have "cmod (?pathint x y - f x * (y-x)) / cmod (y-x) < e" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2910 | using i yx by (simp add: contour_integral_unique divide_less_eq) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2911 | } | 
| 68310 | 2912 | then have "\<exists>d>0. \<forall>y\<in>S. y \<noteq> x \<and> cmod (y-x) < d \<longrightarrow> cmod (?pathint x y - f x * (y-x)) / cmod (y-x) < e" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2913 | using d1 by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2914 | } | 
| 68310 | 2915 | then have *: "((\<lambda>y. (contour_integral (linepath x y) f - f x * (y - x)) /\<^sub>R cmod (y - x)) \<longlongrightarrow> 0) (at x within S)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2916 | by (simp add: Lim_within dist_norm inverse_eq_divide) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2917 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2918 | apply (simp add: has_field_derivative_def has_derivative_within bounded_linear_mult_right) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2919 | apply (rule Lim_transform [OF * Lim_eventually]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2920 | using linordered_field_no_ub | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2921 | apply (force simp: inverse_eq_divide [symmetric] eventually_at) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2922 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2923 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2924 | |
| 61848 | 2925 | lemma contour_integral_convex_primitive: | 
| 68493 | 2926 | assumes "convex S" "continuous_on S f" | 
| 68310 | 2927 | "\<And>a b c. \<lbrakk>a \<in> S; b \<in> S; c \<in> S\<rbrakk> \<Longrightarrow> (f has_contour_integral 0) (linepath a b +++ linepath b c +++ linepath c a)" | 
| 2928 | obtains g where "\<And>x. x \<in> S \<Longrightarrow> (g has_field_derivative f x) (at x within S)" | |
| 2929 | proof (cases "S={}")
 | |
| 2930 | case False | |
| 2931 | with assms that show ?thesis | |
| 2932 | by (blast intro: triangle_contour_integrals_convex_primitive has_chain_integral_chain_integral3) | |
| 2933 | qed auto | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2934 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2935 | lemma holomorphic_convex_primitive: | 
| 62533 
bc25f3916a99
new material to Blochj's theorem, as well as supporting lemmas
 paulson <lp15@cam.ac.uk> parents: 
62464diff
changeset | 2936 | fixes f :: "complex \<Rightarrow> complex" | 
| 68493 | 2937 | assumes "convex S" "finite K" and contf: "continuous_on S f" | 
| 68310 | 2938 | and fd: "\<And>x. x \<in> interior S - K \<Longrightarrow> f field_differentiable at x" | 
| 2939 | obtains g where "\<And>x. x \<in> S \<Longrightarrow> (g has_field_derivative f x) (at x within S)" | |
| 2940 | proof (rule contour_integral_convex_primitive [OF \<open>convex S\<close> contf Cauchy_theorem_triangle_cofinite]) | |
| 2941 |   have *: "convex hull {a, b, c} \<subseteq> S" if "a \<in> S" "b \<in> S" "c \<in> S" for a b c
 | |
| 2942 | by (simp add: \<open>convex S\<close> hull_minimal that) | |
| 2943 |   show "continuous_on (convex hull {a, b, c}) f" if "a \<in> S" "b \<in> S" "c \<in> S" for a b c
 | |
| 2944 | by (meson "*" contf continuous_on_subset that) | |
| 2945 |   show "f field_differentiable at x" if "a \<in> S" "b \<in> S" "c \<in> S" "x \<in> interior (convex hull {a, b, c}) - K" for a b c x
 | |
| 2946 | by (metis "*" DiffD1 DiffD2 DiffI fd interior_mono subsetCE that) | |
| 2947 | qed (use assms in \<open>force+\<close>) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2948 | |
| 67107 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 2949 | lemma holomorphic_convex_primitive': | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 2950 | fixes f :: "complex \<Rightarrow> complex" | 
| 68310 | 2951 | assumes "convex S" and "open S" and "f holomorphic_on S" | 
| 2952 | obtains g where "\<And>x. x \<in> S \<Longrightarrow> (g has_field_derivative f x) (at x within S)" | |
| 67107 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 2953 | proof (rule holomorphic_convex_primitive) | 
| 68310 | 2954 |   fix x assume "x \<in> interior S - {}"
 | 
| 67107 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 2955 | with assms show "f field_differentiable at x" | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 2956 | by (auto intro!: holomorphic_on_imp_differentiable_at simp: interior_open) | 
| 68310 | 2957 | qed (use assms in \<open>auto intro: holomorphic_on_imp_continuous_on\<close>) | 
| 2958 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2959 | corollary%unimportant Cauchy_theorem_convex: | 
| 68310 | 2960 | "\<lbrakk>continuous_on S f; convex S; finite K; | 
| 2961 | \<And>x. x \<in> interior S - K \<Longrightarrow> f field_differentiable at x; | |
| 68493 | 2962 | valid_path g; path_image g \<subseteq> S; pathfinish g = pathstart g\<rbrakk> | 
| 68310 | 2963 | \<Longrightarrow> (f has_contour_integral 0) g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2964 | by (metis holomorphic_convex_primitive Cauchy_theorem_primitive) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2965 | |
| 68310 | 2966 | corollary Cauchy_theorem_convex_simple: | 
| 2967 | "\<lbrakk>f holomorphic_on S; convex S; | |
| 2968 | valid_path g; path_image g \<subseteq> S; | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2969 | pathfinish g = pathstart g\<rbrakk> \<Longrightarrow> (f has_contour_integral 0) g" | 
| 68310 | 2970 |   apply (rule Cauchy_theorem_convex [where K = "{}"])
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2971 | apply (simp_all add: holomorphic_on_imp_continuous_on) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2972 | using at_within_interior holomorphic_on_def interior_subset by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2973 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2974 | text\<open>In particular for a disc\<close> | 
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2975 | corollary%unimportant Cauchy_theorem_disc: | 
| 68310 | 2976 | "\<lbrakk>finite K; continuous_on (cball a e) f; | 
| 2977 | \<And>x. x \<in> ball a e - K \<Longrightarrow> f field_differentiable at x; | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2978 | valid_path g; path_image g \<subseteq> cball a e; | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2979 | pathfinish g = pathstart g\<rbrakk> \<Longrightarrow> (f has_contour_integral 0) g" | 
| 68310 | 2980 | by (auto intro: Cauchy_theorem_convex) | 
| 2981 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2982 | corollary%unimportant Cauchy_theorem_disc_simple: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2983 | "\<lbrakk>f holomorphic_on (ball a e); valid_path g; path_image g \<subseteq> ball a e; | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2984 | pathfinish g = pathstart g\<rbrakk> \<Longrightarrow> (f has_contour_integral 0) g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2985 | by (simp add: Cauchy_theorem_convex_simple) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2986 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 2987 | subsection%unimportant \<open>Generalize integrability to local primitives\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2988 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2989 | lemma contour_integral_local_primitive_lemma: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2990 | fixes f :: "complex\<Rightarrow>complex" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2991 | shows | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2992 |     "\<lbrakk>g piecewise_differentiable_on {a..b};
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2993 | \<And>x. x \<in> s \<Longrightarrow> (f has_field_derivative f' x) (at x within s); | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2994 |       \<And>x. x \<in> {a..b} \<Longrightarrow> g x \<in> s\<rbrakk>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2995 |      \<Longrightarrow> (\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b}))
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2996 |             integrable_on {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2997 |   apply (cases "cbox a b = {}", force)
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2998 | apply (simp add: integrable_on_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2999 | apply (rule exI) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3000 | apply (rule contour_integral_primitive_lemma, assumption+) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3001 | using atLeastAtMost_iff by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3002 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3003 | lemma contour_integral_local_primitive_any: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3004 | fixes f :: "complex \<Rightarrow> complex" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3005 |   assumes gpd: "g piecewise_differentiable_on {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3006 | and dh: "\<And>x. x \<in> s | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3007 | \<Longrightarrow> \<exists>d h. 0 < d \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3008 | (\<forall>y. norm(y - x) < d \<longrightarrow> (h has_field_derivative f y) (at y within s))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3009 |       and gs: "\<And>x. x \<in> {a..b} \<Longrightarrow> g x \<in> s"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3010 |   shows "(\<lambda>x. f(g x) * vector_derivative g (at x)) integrable_on {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3011 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3012 |   { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3013 | assume x: "a \<le> x" "x \<le> b" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3014 | obtain d h where d: "0 < d" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3015 | and h: "(\<And>y. norm(y - g x) < d \<Longrightarrow> (h has_field_derivative f y) (at y within s))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3016 | using x gs dh by (metis atLeastAtMost_iff) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3017 |     have "continuous_on {a..b} g" using gpd piecewise_differentiable_on_def by blast
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3018 |     then obtain e where e: "e>0" and lessd: "\<And>x'. x' \<in> {a..b} \<Longrightarrow> \<bar>x' - x\<bar> < e \<Longrightarrow> cmod (g x' - g x) < d"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3019 | using x d | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3020 | apply (auto simp: dist_norm continuous_on_iff) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3021 | apply (drule_tac x=x in bspec) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3022 | using x apply simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3023 | apply (drule_tac x=d in spec, auto) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3024 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3025 |     have "\<exists>d>0. \<forall>u v. u \<le> x \<and> x \<le> v \<and> {u..v} \<subseteq> ball x d \<and> (u \<le> v \<longrightarrow> a \<le> u \<and> v \<le> b) \<longrightarrow>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3026 |                           (\<lambda>x. f (g x) * vector_derivative g (at x)) integrable_on {u..v}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3027 | apply (rule_tac x=e in exI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3028 | using e | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3029 | apply (simp add: integrable_on_localized_vector_derivative [symmetric], clarify) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3030 |       apply (rule_tac f = h and s = "g ` {u..v}" in contour_integral_local_primitive_lemma)
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3031 | apply (meson atLeastatMost_subset_iff gpd piecewise_differentiable_on_subset) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3032 | apply (force simp: ball_def dist_norm intro: lessd gs DERIV_subset [OF h], force) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3033 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3034 | } then | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3035 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3036 | by (force simp: intro!: integrable_on_little_subintervals [of a b, simplified]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3037 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3038 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3039 | lemma contour_integral_local_primitive: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3040 | fixes f :: "complex \<Rightarrow> complex" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3041 | assumes g: "valid_path g" "path_image g \<subseteq> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3042 | and dh: "\<And>x. x \<in> s | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3043 | \<Longrightarrow> \<exists>d h. 0 < d \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3044 | (\<forall>y. norm(y - x) < d \<longrightarrow> (h has_field_derivative f y) (at y within s))" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3045 | shows "f contour_integrable_on g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3046 | using g | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3047 | apply (simp add: valid_path_def path_image_def contour_integrable_on_def has_contour_integral_def | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3048 | has_integral_localized_vector_derivative integrable_on_def [symmetric]) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3049 | using contour_integral_local_primitive_any [OF _ dh] | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3050 | by (meson image_subset_iff piecewise_C1_imp_differentiable) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3051 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3052 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3053 | text\<open>In particular if a function is holomorphic\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3054 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3055 | lemma contour_integrable_holomorphic: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3056 | assumes contf: "continuous_on s f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3057 | and os: "open s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3058 | and k: "finite k" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3059 | and g: "valid_path g" "path_image g \<subseteq> s" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 3060 | and fcd: "\<And>x. x \<in> s - k \<Longrightarrow> f field_differentiable at x" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3061 | shows "f contour_integrable_on g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3062 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3063 |   { fix z
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3064 | assume z: "z \<in> s" | 
| 68310 | 3065 | obtain d where "d>0" and d: "ball z d \<subseteq> s" using \<open>open s\<close> z | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3066 | by (auto simp: open_contains_ball) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3067 | then have contfb: "continuous_on (ball z d) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3068 | using contf continuous_on_subset by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3069 | obtain h where "\<forall>y\<in>ball z d. (h has_field_derivative f y) (at y within ball z d)" | 
| 68310 | 3070 | by (metis holomorphic_convex_primitive [OF convex_ball k contfb fcd] d interior_subset Diff_iff set_mp) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3071 | then have "\<forall>y\<in>ball z d. (h has_field_derivative f y) (at y within s)" | 
| 68310 | 3072 | by (metis open_ball at_within_open d os subsetCE) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3073 | then have "\<exists>h. (\<forall>y. cmod (y - z) < d \<longrightarrow> (h has_field_derivative f y) (at y within s))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3074 | by (force simp: dist_norm norm_minus_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3075 | then have "\<exists>d h. 0 < d \<and> (\<forall>y. cmod (y - z) < d \<longrightarrow> (h has_field_derivative f y) (at y within s))" | 
| 68310 | 3076 | using \<open>0 < d\<close> by blast | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3077 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3078 | then show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3079 | by (rule contour_integral_local_primitive [OF g]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3080 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3081 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3082 | lemma contour_integrable_holomorphic_simple: | 
| 68310 | 3083 | assumes fh: "f holomorphic_on S" | 
| 3084 | and os: "open S" | |
| 3085 | and g: "valid_path g" "path_image g \<subseteq> S" | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3086 | shows "f contour_integrable_on g" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 3087 | apply (rule contour_integrable_holomorphic [OF _ os Finite_Set.finite.emptyI g]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 3088 | apply (simp add: fh holomorphic_on_imp_continuous_on) | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 3089 | using fh by (simp add: field_differentiable_def holomorphic_on_open os) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3090 | |
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3091 | lemma continuous_on_inversediff: | 
| 68310 | 3092 | fixes z:: "'a::real_normed_field" shows "z \<notin> S \<Longrightarrow> continuous_on S (\<lambda>w. 1 / (w - z))" | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3093 | by (rule continuous_intros | force)+ | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3094 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 3095 | lemma contour_integrable_inversediff: | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3096 | "\<lbrakk>valid_path g; z \<notin> path_image g\<rbrakk> \<Longrightarrow> (\<lambda>w. 1 / (w-z)) contour_integrable_on g" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 3097 | apply (rule contour_integrable_holomorphic_simple [of _ "UNIV-{z}"])
 | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3098 | apply (auto simp: holomorphic_on_open open_delete intro!: derivative_eq_intros) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3099 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3100 | |
| 61222 | 3101 | text\<open>Key fact that path integral is the same for a "nearby" path. This is the | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3102 | main lemma for the homotopy form of Cauchy's theorem and is also useful | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3103 | if we want "without loss of generality" to assume some nice properties of a | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3104 | path (e.g. smoothness). It can also be used to define the integrals of | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3105 | analytic functions over arbitrary continuous paths. This is just done for | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3106 | winding numbers now. | 
| 61222 | 3107 | \<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3108 | |
| 61711 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3109 | text\<open>A technical definition to avoid duplication of similar proofs, | 
| 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3110 | for paths joined at the ends versus looping paths\<close> | 
| 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3111 | definition linked_paths :: "bool \<Rightarrow> (real \<Rightarrow> 'a) \<Rightarrow> (real \<Rightarrow> 'a::topological_space) \<Rightarrow> bool" | 
| 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3112 | where "linked_paths atends g h == | 
| 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3113 | (if atends then pathstart h = pathstart g \<and> pathfinish h = pathfinish g | 
| 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3114 | else pathfinish g = pathstart g \<and> pathfinish h = pathstart h)" | 
| 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3115 | |
| 61222 | 3116 | text\<open>This formulation covers two cases: @{term g} and @{term h} share their
 | 
| 3117 |       start and end points; @{term g} and @{term h} both loop upon themselves.\<close>
 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3118 | lemma contour_integral_nearby: | 
| 68310 | 3119 | assumes os: "open S" and p: "path p" "path_image p \<subseteq> S" | 
| 3120 | shows "\<exists>d. 0 < d \<and> | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3121 | (\<forall>g h. valid_path g \<and> valid_path h \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3122 |                   (\<forall>t \<in> {0..1}. norm(g t - p t) < d \<and> norm(h t - p t) < d) \<and>
 | 
| 61711 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3123 | linked_paths atends g h | 
| 68310 | 3124 | \<longrightarrow> path_image g \<subseteq> S \<and> path_image h \<subseteq> S \<and> | 
| 3125 | (\<forall>f. f holomorphic_on S \<longrightarrow> contour_integral h f = contour_integral g f))" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3126 | proof - | 
| 68310 | 3127 | have "\<forall>z. \<exists>e. z \<in> path_image p \<longrightarrow> 0 < e \<and> ball z e \<subseteq> S" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3128 | using open_contains_ball os p(2) by blast | 
| 68310 | 3129 | then obtain ee where ee: "\<And>z. z \<in> path_image p \<Longrightarrow> 0 < ee z \<and> ball z (ee z) \<subseteq> S" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3130 | by metis | 
| 63040 | 3131 | define cover where "cover = (\<lambda>z. ball z (ee z/3)) ` (path_image p)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3132 | have "compact (path_image p)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3133 | by (metis p(1) compact_path_image) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3134 | moreover have "path_image p \<subseteq> (\<Union>c\<in>path_image p. ball c (ee c / 3))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3135 | using ee by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3136 | ultimately have "\<exists>D \<subseteq> cover. finite D \<and> path_image p \<subseteq> \<Union>D" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3137 | by (simp add: compact_eq_heine_borel cover_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3138 | then obtain D where D: "D \<subseteq> cover" "finite D" "path_image p \<subseteq> \<Union>D" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3139 | by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3140 |   then obtain k where k: "k \<subseteq> {0..1}" "finite k" and D_eq: "D = ((\<lambda>z. ball z (ee z / 3)) \<circ> p) ` k"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3141 | apply (simp add: cover_def path_image_def image_comp) | 
| 61222 | 3142 | apply (blast dest!: finite_subset_image [OF \<open>finite D\<close>]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3143 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3144 |   then have kne: "k \<noteq> {}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3145 | using D by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3146 | have pi: "\<And>i. i \<in> k \<Longrightarrow> p i \<in> path_image p" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3147 | using k by (auto simp: path_image_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3148 | then have eepi: "\<And>i. i \<in> k \<Longrightarrow> 0 < ee((p i))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3149 | by (metis ee) | 
| 68339 | 3150 | define e where "e = Min((ee \<circ> p) ` k)" | 
| 3151 | have fin_eep: "finite ((ee \<circ> p) ` k)" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3152 | using k by blast | 
| 68310 | 3153 | have "0 < e" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3154 | using ee k by (simp add: kne e_def Min_gr_iff [OF fin_eep] eepi) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3155 |   have "uniformly_continuous_on {0..1} p"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3156 | using p by (simp add: path_def compact_uniformly_continuous) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3157 | then obtain d::real where d: "d>0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3158 |           and de: "\<And>x x'. \<bar>x' - x\<bar> < d \<Longrightarrow> x\<in>{0..1} \<Longrightarrow> x'\<in>{0..1} \<Longrightarrow> cmod (p x' - p x) < e/3"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3159 | unfolding uniformly_continuous_on_def dist_norm real_norm_def | 
| 68310 | 3160 | by (metis divide_pos_pos \<open>0 < e\<close> zero_less_numeral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3161 | then obtain N::nat where N: "N>0" "inverse N < d" | 
| 62623 
dbc62f86a1a9
rationalisation of theorem names esp about "real Archimedian" etc.
 paulson <lp15@cam.ac.uk> parents: 
62620diff
changeset | 3162 | using real_arch_inverse [of d] by auto | 
| 68310 | 3163 | show ?thesis | 
| 3164 | proof (intro exI conjI allI; clarify?) | |
| 3165 | show "e/3 > 0" | |
| 3166 | using \<open>0 < e\<close> by simp | |
| 3167 | fix g h | |
| 3168 |     assume g: "valid_path g" and ghp: "\<forall>t\<in>{0..1}. cmod (g t - p t) < e / 3 \<and>  cmod (h t - p t) < e / 3"
 | |
| 3169 | and h: "valid_path h" | |
| 61711 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3170 | and joins: "linked_paths atends g h" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3171 |     { fix t::real
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3172 | assume t: "0 \<le> t" "t \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3173 | then obtain u where u: "u \<in> k" and ptu: "p t \<in> ball(p u) (ee(p u) / 3)" | 
| 61222 | 3174 | using \<open>path_image p \<subseteq> \<Union>D\<close> D_eq by (force simp: path_image_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3175 | then have ele: "e \<le> ee (p u)" using fin_eep | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3176 | by (simp add: e_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3177 | have "cmod (g t - p t) < e / 3" "cmod (h t - p t) < e / 3" | 
| 68310 | 3178 | using ghp t by auto | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3179 | with ele have "cmod (g t - p t) < ee (p u) / 3" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3180 | "cmod (h t - p t) < ee (p u) / 3" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3181 | by linarith+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3182 | then have "g t \<in> ball(p u) (ee(p u))" "h t \<in> ball(p u) (ee(p u))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3183 | using norm_diff_triangle_ineq [of "g t" "p t" "p t" "p u"] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3184 | norm_diff_triangle_ineq [of "h t" "p t" "p t" "p u"] ptu eepi u | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3185 | by (force simp: dist_norm ball_def norm_minus_commute)+ | 
| 68310 | 3186 | then have "g t \<in> S" "h t \<in> S" using ee u k | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3187 | by (auto simp: path_image_def ball_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3188 | } | 
| 68310 | 3189 | then have ghs: "path_image g \<subseteq> S" "path_image h \<subseteq> S" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3190 | by (auto simp: path_image_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3191 | moreover | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3192 |     { fix f
 | 
| 68310 | 3193 | assume fhols: "f holomorphic_on S" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3194 | then have fpa: "f contour_integrable_on g" "f contour_integrable_on h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3195 | using g ghs h holomorphic_on_imp_continuous_on os contour_integrable_holomorphic_simple | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3196 | by blast+ | 
| 68310 | 3197 | have contf: "continuous_on S f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3198 | by (simp add: fhols holomorphic_on_imp_continuous_on) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3199 |       { fix z
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3200 | assume z: "z \<in> path_image p" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3201 | have "f holomorphic_on ball z (ee z)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3202 | using fhols ee z holomorphic_on_subset by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3203 | then have "\<exists>ff. (\<forall>w \<in> ball z (ee z). (ff has_field_derivative f w) (at w))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3204 |           using holomorphic_convex_primitive [of "ball z (ee z)" "{}" f, simplified]
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3205 | by (metis open_ball at_within_open holomorphic_on_def holomorphic_on_imp_continuous_on mem_ball) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3206 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3207 | then obtain ff where ff: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3208 | "\<And>z w. \<lbrakk>z \<in> path_image p; w \<in> ball z (ee z)\<rbrakk> \<Longrightarrow> (ff z has_field_derivative f w) (at w)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3209 | by metis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3210 |       { fix n
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3211 | assume n: "n \<le> N" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3212 | then have "contour_integral(subpath 0 (n/N) h) f - contour_integral(subpath 0 (n/N) g) f = | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3213 | contour_integral(linepath (g(n/N)) (h(n/N))) f - contour_integral(linepath (g 0) (h 0)) f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3214 | proof (induct n) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3215 | case 0 show ?case by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3216 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3217 | case (Suc n) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3218 | obtain t where t: "t \<in> k" and "p (n/N) \<in> ball(p t) (ee(p t) / 3)" | 
| 61222 | 3219 | using \<open>path_image p \<subseteq> \<Union>D\<close> [THEN subsetD, where c="p (n/N)"] D_eq N Suc.prems | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3220 | by (force simp: path_image_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3221 | then have ptu: "cmod (p t - p (n/N)) < ee (p t) / 3" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3222 | by (simp add: dist_norm) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3223 | have e3le: "e/3 \<le> ee (p t) / 3" using fin_eep t | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3224 | by (simp add: e_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3225 |           { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3226 | assume x: "n/N \<le> x" "x \<le> (1 + n)/N" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3227 | then have nN01: "0 \<le> n/N" "(1 + n)/N \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3228 | using Suc.prems by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3229 | then have x01: "0 \<le> x" "x \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3230 | using x by linarith+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3231 | have "cmod (p t - p x) < ee (p t) / 3 + e/3" | 
| 68310 | 3232 | proof (rule norm_diff_triangle_less [OF ptu de]) | 
| 3233 | show "\<bar>real n / real N - x\<bar> < d" | |
| 3234 | using x N by (auto simp: field_simps) | |
| 3235 | qed (use x01 Suc.prems in auto) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3236 | then have ptx: "cmod (p t - p x) < 2*ee (p t)/3" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3237 | using e3le eepi [OF t] by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3238 | have "cmod (p t - g x) < 2*ee (p t)/3 + e/3 " | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3239 | apply (rule norm_diff_triangle_less [OF ptx]) | 
| 68310 | 3240 | using ghp x01 by (simp add: norm_minus_commute) | 
| 68339 | 3241 | also have "\<dots> \<le> ee (p t)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3242 | using e3le eepi [OF t] by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3243 | finally have gg: "cmod (p t - g x) < ee (p t)" . | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3244 | have "cmod (p t - h x) < 2*ee (p t)/3 + e/3 " | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3245 | apply (rule norm_diff_triangle_less [OF ptx]) | 
| 68310 | 3246 | using ghp x01 by (simp add: norm_minus_commute) | 
| 68339 | 3247 | also have "\<dots> \<le> ee (p t)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3248 | using e3le eepi [OF t] by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3249 | finally have "cmod (p t - g x) < ee (p t)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3250 | "cmod (p t - h x) < ee (p t)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3251 | using gg by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3252 | } note ptgh_ee = this | 
| 68310 | 3253 | have "closed_segment (g (real n / real N)) (h (real n / real N)) = path_image (linepath (h (n/N)) (g (n/N)))" | 
| 3254 | by (simp add: closed_segment_commute) | |
| 3255 | also have pi_hgn: "\<dots> \<subseteq> ball (p t) (ee (p t))" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3256 | using ptgh_ee [of "n/N"] Suc.prems | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61520diff
changeset | 3257 | by (auto simp: field_simps dist_norm dest: segment_furthest_le [where y="p t"]) | 
| 68310 | 3258 | finally have gh_ns: "closed_segment (g (n/N)) (h (n/N)) \<subseteq> S" | 
| 3259 | using ee pi t by blast | |
| 3260 | have pi_ghn': "path_image (linepath (g ((1 + n) / N)) (h ((1 + n) / N))) \<subseteq> ball (p t) (ee (p t))" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3261 | using ptgh_ee [of "(1+n)/N"] Suc.prems | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61520diff
changeset | 3262 | by (auto simp: field_simps dist_norm dest: segment_furthest_le [where y="p t"]) | 
| 68310 | 3263 | then have gh_n's: "closed_segment (g ((1 + n) / N)) (h ((1 + n) / N)) \<subseteq> S" | 
| 61222 | 3264 | using \<open>N>0\<close> Suc.prems ee pi t | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3265 | by (auto simp: Path_Connected.path_image_join field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3266 | have pi_subset_ball: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3267 | "path_image (subpath (n/N) ((1+n) / N) g +++ linepath (g ((1+n) / N)) (h ((1+n) / N)) +++ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3268 | subpath ((1+n) / N) (n/N) h +++ linepath (h (n/N)) (g (n/N))) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3269 | \<subseteq> ball (p t) (ee (p t))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3270 | apply (intro subset_path_image_join pi_hgn pi_ghn') | 
| 61222 | 3271 | using \<open>N>0\<close> Suc.prems | 
| 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: 
61738diff
changeset | 3272 | apply (auto simp: path_image_subpath dist_norm field_simps closed_segment_eq_real_ivl ptgh_ee) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3273 | done | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3274 | have pi0: "(f has_contour_integral 0) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3275 | (subpath (n/ N) ((Suc n)/N) g +++ linepath(g ((Suc n) / N)) (h((Suc n) / N)) +++ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3276 | subpath ((Suc n) / N) (n/N) h +++ linepath(h (n/N)) (g (n/N)))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3277 | apply (rule Cauchy_theorem_primitive [of "ball(p t) (ee(p t))" "ff (p t)" "f"]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3278 | apply (metis ff open_ball at_within_open pi t) | 
| 68310 | 3279 | using Suc.prems pi_subset_ball apply (simp_all add: valid_path_join valid_path_subpath g h) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3280 | done | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3281 | have fpa1: "f contour_integrable_on subpath (real n / real N) (real (Suc n) / real N) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3282 | using Suc.prems by (simp add: contour_integrable_subpath g fpa) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3283 | have fpa2: "f contour_integrable_on linepath (g (real (Suc n) / real N)) (h (real (Suc n) / real N))" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3284 | using gh_n's | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3285 | by (auto intro!: contour_integrable_continuous_linepath continuous_on_subset [OF contf]) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3286 | have fpa3: "f contour_integrable_on linepath (h (real n / real N)) (g (real n / real N))" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3287 | using gh_ns | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3288 | by (auto simp: closed_segment_commute intro!: contour_integrable_continuous_linepath continuous_on_subset [OF contf]) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3289 | have eq0: "contour_integral (subpath (n/N) ((Suc n) / real N) g) f + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3290 | contour_integral (linepath (g ((Suc n) / N)) (h ((Suc n) / N))) f + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3291 | contour_integral (subpath ((Suc n) / N) (n/N) h) f + | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3292 | contour_integral (linepath (h (n/N)) (g (n/N))) f = 0" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3293 | using contour_integral_unique [OF pi0] Suc.prems | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3294 | by (simp add: g h fpa valid_path_subpath contour_integrable_subpath | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61520diff
changeset | 3295 | fpa1 fpa2 fpa3 algebra_simps del: of_nat_Suc) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3296 | have *: "\<And>hn he hn' gn gd gn' hgn ghn gh0 ghn'. | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3297 | \<lbrakk>hn - gn = ghn - gh0; | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3298 | gd + ghn' + he + hgn = (0::complex); | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3299 | hn - he = hn'; gn + gd = gn'; hgn = -ghn\<rbrakk> \<Longrightarrow> hn' - gn' = ghn' - gh0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3300 | by (auto simp: algebra_simps) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3301 | have "contour_integral (subpath 0 (n/N) h) f - contour_integral (subpath ((Suc n) / N) (n/N) h) f = | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3302 | contour_integral (subpath 0 (n/N) h) f + contour_integral (subpath (n/N) ((Suc n) / N) h) f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3303 | unfolding reversepath_subpath [symmetric, of "((Suc n) / N)"] | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3304 | using Suc.prems by (simp add: h fpa contour_integral_reversepath valid_path_subpath contour_integrable_subpath) | 
| 68339 | 3305 | also have "\<dots> = contour_integral (subpath 0 ((Suc n) / N) h) f" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3306 | using Suc.prems by (simp add: contour_integral_subpath_combine h fpa) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3307 | finally have pi0_eq: | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3308 | "contour_integral (subpath 0 (n/N) h) f - contour_integral (subpath ((Suc n) / N) (n/N) h) f = | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3309 | contour_integral (subpath 0 ((Suc n) / N) h) f" . | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3310 | show ?case | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3311 | apply (rule * [OF Suc.hyps eq0 pi0_eq]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3312 | using Suc.prems | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3313 | apply (simp_all add: g h fpa contour_integral_subpath_combine | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3314 | contour_integral_reversepath [symmetric] contour_integrable_continuous_linepath | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3315 | continuous_on_subset [OF contf gh_ns]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3316 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3317 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3318 | } note ind = this | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3319 | have "contour_integral h f = contour_integral g f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3320 | using ind [OF order_refl] N joins | 
| 62390 | 3321 | by (simp add: linked_paths_def pathstart_def pathfinish_def split: if_split_asm) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3322 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3323 | ultimately | 
| 68310 | 3324 | show "path_image g \<subseteq> S \<and> path_image h \<subseteq> S \<and> (\<forall>f. f holomorphic_on S \<longrightarrow> contour_integral h f = contour_integral g f)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3325 | by metis | 
| 68310 | 3326 | qed | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3327 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3328 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3329 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3330 | lemma | 
| 68310 | 3331 | assumes "open S" "path p" "path_image p \<subseteq> S" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3332 | shows contour_integral_nearby_ends: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3333 | "\<exists>d. 0 < d \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3334 | (\<forall>g h. valid_path g \<and> valid_path h \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3335 |                     (\<forall>t \<in> {0..1}. norm(g t - p t) < d \<and> norm(h t - p t) < d) \<and>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3336 | pathstart h = pathstart g \<and> pathfinish h = pathfinish g | 
| 68310 | 3337 | \<longrightarrow> path_image g \<subseteq> S \<and> | 
| 3338 | path_image h \<subseteq> S \<and> | |
| 3339 | (\<forall>f. f holomorphic_on S | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3340 | \<longrightarrow> contour_integral h f = contour_integral g f))" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3341 | and contour_integral_nearby_loops: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3342 | "\<exists>d. 0 < d \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3343 | (\<forall>g h. valid_path g \<and> valid_path h \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3344 |                     (\<forall>t \<in> {0..1}. norm(g t - p t) < d \<and> norm(h t - p t) < d) \<and>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3345 | pathfinish g = pathstart g \<and> pathfinish h = pathstart h | 
| 68310 | 3346 | \<longrightarrow> path_image g \<subseteq> S \<and> | 
| 3347 | path_image h \<subseteq> S \<and> | |
| 3348 | (\<forall>f. f holomorphic_on S | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3349 | \<longrightarrow> contour_integral h f = contour_integral g f))" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3350 | using contour_integral_nearby [OF assms, where atends=True] | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3351 | using contour_integral_nearby [OF assms, where atends=False] | 
| 61711 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3352 | unfolding linked_paths_def by simp_all | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3353 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3354 | lemma C1_differentiable_polynomial_function: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3355 | fixes p :: "real \<Rightarrow> 'a::euclidean_space" | 
| 68310 | 3356 | shows "polynomial_function p \<Longrightarrow> p C1_differentiable_on S" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3357 | by (metis continuous_on_polymonial_function C1_differentiable_on_def has_vector_derivative_polynomial_function) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3358 | |
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3359 | lemma valid_path_polynomial_function: | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3360 | fixes p :: "real \<Rightarrow> 'a::euclidean_space" | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3361 | shows "polynomial_function p \<Longrightarrow> valid_path p" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3362 | by (force simp: valid_path_def piecewise_C1_differentiable_on_def continuous_on_polymonial_function C1_differentiable_polynomial_function) | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3363 | |
| 61518 
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
 paulson parents: 
61426diff
changeset | 3364 | lemma valid_path_subpath_trivial [simp]: | 
| 
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
 paulson parents: 
61426diff
changeset | 3365 | fixes g :: "real \<Rightarrow> 'a::euclidean_space" | 
| 
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
 paulson parents: 
61426diff
changeset | 3366 | shows "z \<noteq> g x \<Longrightarrow> valid_path (subpath x x g)" | 
| 
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
 paulson parents: 
61426diff
changeset | 3367 | by (simp add: subpath_def valid_path_polynomial_function) | 
| 
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
 paulson parents: 
61426diff
changeset | 3368 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3369 | lemma contour_integral_bound_exists: | 
| 68310 | 3370 | assumes S: "open S" | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3371 | and g: "valid_path g" | 
| 68310 | 3372 | and pag: "path_image g \<subseteq> S" | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3373 | shows "\<exists>L. 0 < L \<and> | 
| 68310 | 3374 | (\<forall>f B. f holomorphic_on S \<and> (\<forall>z \<in> S. norm(f z) \<le> B) | 
| 3375 | \<longrightarrow> norm(contour_integral g f) \<le> L*B)" | |
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3376 | proof - | 
| 68310 | 3377 | have "path g" using g | 
| 3378 | by (simp add: valid_path_imp_path) | |
| 3379 | then obtain d::real and p | |
| 3380 | where d: "0 < d" | |
| 3381 | and p: "polynomial_function p" "path_image p \<subseteq> S" | |
| 3382 | and pi: "\<And>f. f holomorphic_on S \<Longrightarrow> contour_integral g f = contour_integral p f" | |
| 3383 | using contour_integral_nearby_ends [OF S \<open>path g\<close> pag] | |
| 3384 | apply clarify | |
| 3385 | apply (drule_tac x=g in spec) | |
| 3386 | apply (simp only: assms) | |
| 3387 | apply (force simp: valid_path_polynomial_function dest: path_approx_polynomial_function) | |
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3388 | done | 
| 68310 | 3389 | then obtain p' where p': "polynomial_function p'" | 
| 3390 | "\<And>x. (p has_vector_derivative (p' x)) (at x)" | |
| 68339 | 3391 | by (blast intro: has_vector_derivative_polynomial_function that) | 
| 68310 | 3392 |   then have "bounded(p' ` {0..1})"
 | 
| 3393 | using continuous_on_polymonial_function | |
| 3394 | by (force simp: intro!: compact_imp_bounded compact_continuous_image) | |
| 3395 | then obtain L where L: "L>0" and nop': "\<And>x. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> norm (p' x) \<le> L" | |
| 3396 | by (force simp: bounded_pos) | |
| 3397 |   { fix f B
 | |
| 3398 | assume f: "f holomorphic_on S" and B: "\<And>z. z\<in>S \<Longrightarrow> cmod (f z) \<le> B" | |
| 3399 | then have "f contour_integrable_on p \<and> valid_path p" | |
| 3400 | using p S | |
| 3401 | by (blast intro: valid_path_polynomial_function contour_integrable_holomorphic_simple holomorphic_on_imp_continuous_on) | |
| 3402 | moreover have "cmod (vector_derivative p (at x)) * cmod (f (p x)) \<le> L * B" if "0 \<le> x" "x \<le> 1" for x | |
| 3403 | proof (rule mult_mono) | |
| 3404 | show "cmod (vector_derivative p (at x)) \<le> L" | |
| 3405 | by (metis nop' p'(2) that vector_derivative_at) | |
| 3406 | show "cmod (f (p x)) \<le> B" | |
| 3407 | by (metis B atLeastAtMost_iff imageI p(2) path_defs(4) subset_eq that) | |
| 3408 | qed (use \<open>L>0\<close> in auto) | |
| 3409 | ultimately have "cmod (contour_integral g f) \<le> L * B" | |
| 3410 | apply (simp only: pi [OF f]) | |
| 3411 | apply (simp only: contour_integral_integral) | |
| 3412 | apply (rule order_trans [OF integral_norm_bound_integral]) | |
| 3413 | apply (auto simp: mult.commute integral_norm_bound_integral contour_integrable_on [symmetric] norm_mult) | |
| 3414 | done | |
| 3415 | } then | |
| 3416 | show ?thesis | |
| 3417 | by (force simp: L contour_integral_integral) | |
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3418 | qed | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3419 | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3420 | text\<open>We can treat even non-rectifiable paths as having a "length" for bounds on analytic functions in open sets.\<close> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3421 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 3422 | subsection \<open>Winding Numbers\<close> | 
| 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 3423 | |
| 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 3424 | definition%important winding_number_prop :: "[real \<Rightarrow> complex, complex, real, real \<Rightarrow> complex, complex] \<Rightarrow> bool" where | 
| 68326 | 3425 | "winding_number_prop \<gamma> z e p n \<equiv> | 
| 3426 | valid_path p \<and> z \<notin> path_image p \<and> | |
| 3427 | pathstart p = pathstart \<gamma> \<and> | |
| 3428 | pathfinish p = pathfinish \<gamma> \<and> | |
| 3429 |       (\<forall>t \<in> {0..1}. norm(\<gamma> t - p t) < e) \<and>
 | |
| 3430 | contour_integral p (\<lambda>w. 1/(w - z)) = 2 * pi * \<i> * n" | |
| 3431 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 3432 | definition%important winding_number:: "[real \<Rightarrow> complex, complex] \<Rightarrow> complex" where | 
| 68326 | 3433 | "winding_number \<gamma> z \<equiv> SOME n. \<forall>e > 0. \<exists>p. winding_number_prop \<gamma> z e p n" | 
| 3434 | ||
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3435 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3436 | lemma winding_number: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3437 | assumes "path \<gamma>" "z \<notin> path_image \<gamma>" "0 < e" | 
| 68326 | 3438 | shows "\<exists>p. winding_number_prop \<gamma> z e p (winding_number \<gamma> z)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3439 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3440 |   have "path_image \<gamma> \<subseteq> UNIV - {z}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3441 | using assms by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3442 | then obtain d | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3443 | where d: "d>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3444 | and pi_eq: "\<And>h1 h2. valid_path h1 \<and> valid_path h2 \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3445 |                     (\<forall>t\<in>{0..1}. cmod (h1 t - \<gamma> t) < d \<and> cmod (h2 t - \<gamma> t) < d) \<and>
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3446 | pathstart h2 = pathstart h1 \<and> pathfinish h2 = pathfinish h1 \<longrightarrow> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3447 |                       path_image h1 \<subseteq> UNIV - {z} \<and> path_image h2 \<subseteq> UNIV - {z} \<and>
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3448 |                       (\<forall>f. f holomorphic_on UNIV - {z} \<longrightarrow> contour_integral h2 f = contour_integral h1 f)"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3449 |     using contour_integral_nearby_ends [of "UNIV - {z}" \<gamma>] assms by (auto simp: open_delete)
 | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3450 | then obtain h where h: "polynomial_function h \<and> pathstart h = pathstart \<gamma> \<and> pathfinish h = pathfinish \<gamma> \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3451 |                           (\<forall>t \<in> {0..1}. norm(h t - \<gamma> t) < d/2)"
 | 
| 61808 | 3452 | using path_approx_polynomial_function [OF \<open>path \<gamma>\<close>, of "d/2"] d by auto | 
| 63589 | 3453 | define nn where "nn = 1/(2* pi*\<i>) * contour_integral h (\<lambda>w. 1/(w - z))" | 
| 68326 | 3454 | have "\<exists>n. \<forall>e > 0. \<exists>p. winding_number_prop \<gamma> z e p n" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3455 | proof (rule_tac x=nn in exI, clarify) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3456 | fix e::real | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3457 | assume e: "e>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3458 | obtain p where p: "polynomial_function p \<and> | 
| 68359 | 3459 |             pathstart p = pathstart \<gamma> \<and> pathfinish p = pathfinish \<gamma> \<and> (\<forall>t\<in>{0..1}. cmod (p t - \<gamma> t) < min e (d/2))"
 | 
| 61808 | 3460 | using path_approx_polynomial_function [OF \<open>path \<gamma>\<close>, of "min e (d/2)"] d \<open>0<e\<close> by auto | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3461 |       have "(\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3462 | by (auto simp: intro!: holomorphic_intros) | 
| 68326 | 3463 | then show "\<exists>p. winding_number_prop \<gamma> z e p nn" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3464 | apply (rule_tac x=p in exI) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3465 | using pi_eq [of h p] h p d | 
| 68326 | 3466 | apply (auto simp: valid_path_polynomial_function norm_minus_commute nn_def winding_number_prop_def) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3467 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3468 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3469 | then show ?thesis | 
| 68326 | 3470 | unfolding winding_number_def by (rule someI2_ex) (blast intro: \<open>0<e\<close>) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3471 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3472 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3473 | lemma winding_number_unique: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3474 | assumes \<gamma>: "path \<gamma>" "z \<notin> path_image \<gamma>" | 
| 68326 | 3475 | and pi: "\<And>e. e>0 \<Longrightarrow> \<exists>p. winding_number_prop \<gamma> z e p n" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3476 | shows "winding_number \<gamma> z = n" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3477 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3478 |   have "path_image \<gamma> \<subseteq> UNIV - {z}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3479 | using assms by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3480 | then obtain e | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3481 | where e: "e>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3482 | and pi_eq: "\<And>h1 h2 f. \<lbrakk>valid_path h1; valid_path h2; | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3483 |                     (\<forall>t\<in>{0..1}. cmod (h1 t - \<gamma> t) < e \<and> cmod (h2 t - \<gamma> t) < e);
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3484 |                     pathstart h2 = pathstart h1; pathfinish h2 = pathfinish h1; f holomorphic_on UNIV - {z}\<rbrakk> \<Longrightarrow>
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3485 | contour_integral h2 f = contour_integral h1 f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3486 |     using contour_integral_nearby_ends [of "UNIV - {z}" \<gamma>] assms  by (auto simp: open_delete)
 | 
| 68326 | 3487 | obtain p where p: "winding_number_prop \<gamma> z e p n" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3488 | using pi [OF e] by blast | 
| 68326 | 3489 | obtain q where q: "winding_number_prop \<gamma> z e q (winding_number \<gamma> z)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3490 | using winding_number [OF \<gamma> e] by blast | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3491 | have "2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))" | 
| 68326 | 3492 | using p by (auto simp: winding_number_prop_def) | 
| 68339 | 3493 | also have "\<dots> = contour_integral q (\<lambda>w. 1 / (w - z))" | 
| 68310 | 3494 | proof (rule pi_eq) | 
| 3495 |     show "(\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}"
 | |
| 3496 | by (auto intro!: holomorphic_intros) | |
| 68326 | 3497 | qed (use p q in \<open>auto simp: winding_number_prop_def norm_minus_commute\<close>) | 
| 68339 | 3498 | also have "\<dots> = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z" | 
| 68326 | 3499 | using q by (auto simp: winding_number_prop_def) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3500 | finally have "2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z" . | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3501 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3502 | by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3503 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3504 | |
| 68326 | 3505 | (*NB not winding_number_prop here due to the loop in p*) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3506 | lemma winding_number_unique_loop: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3507 | assumes \<gamma>: "path \<gamma>" "z \<notin> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3508 | and loop: "pathfinish \<gamma> = pathstart \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3509 | and pi: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3510 | "\<And>e. e>0 \<Longrightarrow> \<exists>p. valid_path p \<and> z \<notin> path_image p \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3511 | pathfinish p = pathstart p \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3512 |                            (\<forall>t \<in> {0..1}. norm (\<gamma> t - p t) < e) \<and>
 | 
| 63589 | 3513 | contour_integral p (\<lambda>w. 1/(w - z)) = 2 * pi * \<i> * n" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3514 | shows "winding_number \<gamma> z = n" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3515 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3516 |   have "path_image \<gamma> \<subseteq> UNIV - {z}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3517 | using assms by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3518 | then obtain e | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3519 | where e: "e>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3520 | and pi_eq: "\<And>h1 h2 f. \<lbrakk>valid_path h1; valid_path h2; | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3521 |                     (\<forall>t\<in>{0..1}. cmod (h1 t - \<gamma> t) < e \<and> cmod (h2 t - \<gamma> t) < e);
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3522 |                     pathfinish h1 = pathstart h1; pathfinish h2 = pathstart h2; f holomorphic_on UNIV - {z}\<rbrakk> \<Longrightarrow>
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3523 | contour_integral h2 f = contour_integral h1 f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3524 |     using contour_integral_nearby_loops [of "UNIV - {z}" \<gamma>] assms  by (auto simp: open_delete)
 | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3525 | obtain p where p: | 
| 68326 | 3526 | "valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and> | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3527 |       (\<forall>t \<in> {0..1}. norm (\<gamma> t - p t) < e) \<and>
 | 
| 63589 | 3528 | contour_integral p (\<lambda>w. 1/(w - z)) = 2 * pi * \<i> * n" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3529 | using pi [OF e] by blast | 
| 68326 | 3530 | obtain q where q: "winding_number_prop \<gamma> z e q (winding_number \<gamma> z)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3531 | using winding_number [OF \<gamma> e] by blast | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3532 | have "2 * complex_of_real pi * \<i> * n = contour_integral p (\<lambda>w. 1 / (w - z))" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3533 | using p by auto | 
| 68339 | 3534 | also have "\<dots> = contour_integral q (\<lambda>w. 1 / (w - z))" | 
| 68310 | 3535 | proof (rule pi_eq) | 
| 3536 |     show "(\<lambda>w. 1 / (w - z)) holomorphic_on UNIV - {z}"
 | |
| 3537 | by (auto intro!: holomorphic_intros) | |
| 68326 | 3538 | qed (use p q loop in \<open>auto simp: winding_number_prop_def norm_minus_commute\<close>) | 
| 68339 | 3539 | also have "\<dots> = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z" | 
| 68326 | 3540 | using q by (auto simp: winding_number_prop_def) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3541 | finally have "2 * complex_of_real pi * \<i> * n = 2 * complex_of_real pi * \<i> * winding_number \<gamma> z" . | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3542 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3543 | by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3544 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3545 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 3546 | proposition winding_number_valid_path: | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3547 | assumes "valid_path \<gamma>" "z \<notin> path_image \<gamma>" | 
| 68326 | 3548 | shows "winding_number \<gamma> z = 1/(2*pi*\<i>) * contour_integral \<gamma> (\<lambda>w. 1/(w - z))" | 
| 3549 | by (rule winding_number_unique) | |
| 3550 | (use assms in \<open>auto simp: valid_path_imp_path winding_number_prop_def\<close>) | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3551 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 3552 | proposition has_contour_integral_winding_number: | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3553 | assumes \<gamma>: "valid_path \<gamma>" "z \<notin> path_image \<gamma>" | 
| 63589 | 3554 | shows "((\<lambda>w. 1/(w - z)) has_contour_integral (2*pi*\<i>*winding_number \<gamma> z)) \<gamma>" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3555 | by (simp add: winding_number_valid_path has_contour_integral_integral contour_integrable_inversediff assms) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3556 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3557 | lemma winding_number_trivial [simp]: "z \<noteq> a \<Longrightarrow> winding_number(linepath a a) z = 0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3558 | by (simp add: winding_number_valid_path) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3559 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3560 | lemma winding_number_subpath_trivial [simp]: "z \<noteq> g x \<Longrightarrow> winding_number (subpath x x g) z = 0" | 
| 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: 
61738diff
changeset | 3561 | by (simp add: path_image_subpath winding_number_valid_path) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3562 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3563 | lemma winding_number_join: | 
| 68326 | 3564 | assumes \<gamma>1: "path \<gamma>1" "z \<notin> path_image \<gamma>1" | 
| 3565 | and \<gamma>2: "path \<gamma>2" "z \<notin> path_image \<gamma>2" | |
| 3566 | and "pathfinish \<gamma>1 = pathstart \<gamma>2" | |
| 3567 | shows "winding_number(\<gamma>1 +++ \<gamma>2) z = winding_number \<gamma>1 z + winding_number \<gamma>2 z" | |
| 3568 | proof (rule winding_number_unique) | |
| 3569 | show "\<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e p | |
| 3570 | (winding_number \<gamma>1 z + winding_number \<gamma>2 z)" if "e > 0" for e | |
| 3571 | proof - | |
| 3572 | obtain p1 where "winding_number_prop \<gamma>1 z e p1 (winding_number \<gamma>1 z)" | |
| 3573 | using \<open>0 < e\<close> \<gamma>1 winding_number by blast | |
| 3574 | moreover | |
| 3575 | obtain p2 where "winding_number_prop \<gamma>2 z e p2 (winding_number \<gamma>2 z)" | |
| 3576 | using \<open>0 < e\<close> \<gamma>2 winding_number by blast | |
| 3577 | ultimately | |
| 3578 | have "winding_number_prop (\<gamma>1+++\<gamma>2) z e (p1+++p2) (winding_number \<gamma>1 z + winding_number \<gamma>2 z)" | |
| 3579 | using assms | |
| 3580 | apply (simp add: winding_number_prop_def not_in_path_image_join contour_integrable_inversediff algebra_simps) | |
| 3581 | apply (auto simp: joinpaths_def) | |
| 3582 | done | |
| 3583 | then show ?thesis | |
| 3584 | by blast | |
| 3585 | qed | |
| 3586 | qed (use assms in \<open>auto simp: not_in_path_image_join\<close>) | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3587 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3588 | lemma winding_number_reversepath: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3589 | assumes "path \<gamma>" "z \<notin> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3590 | shows "winding_number(reversepath \<gamma>) z = - (winding_number \<gamma> z)" | 
| 68326 | 3591 | proof (rule winding_number_unique) | 
| 3592 | show "\<exists>p. winding_number_prop (reversepath \<gamma>) z e p (- winding_number \<gamma> z)" if "e > 0" for e | |
| 3593 | proof - | |
| 3594 | obtain p where "winding_number_prop \<gamma> z e p (winding_number \<gamma> z)" | |
| 3595 | using \<open>0 < e\<close> assms winding_number by blast | |
| 3596 | then have "winding_number_prop (reversepath \<gamma>) z e (reversepath p) (- winding_number \<gamma> z)" | |
| 3597 | using assms | |
| 3598 | apply (simp add: winding_number_prop_def contour_integral_reversepath contour_integrable_inversediff valid_path_imp_reverse) | |
| 3599 | apply (auto simp: reversepath_def) | |
| 3600 | done | |
| 3601 | then show ?thesis | |
| 3602 | by blast | |
| 3603 | qed | |
| 3604 | qed (use assms in auto) | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3605 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3606 | lemma winding_number_shiftpath: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3607 | assumes \<gamma>: "path \<gamma>" "z \<notin> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3608 |       and "pathfinish \<gamma> = pathstart \<gamma>" "a \<in> {0..1}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3609 | shows "winding_number(shiftpath a \<gamma>) z = winding_number \<gamma> z" | 
| 68326 | 3610 | proof (rule winding_number_unique_loop) | 
| 3611 | show "\<exists>p. valid_path p \<and> z \<notin> path_image p \<and> pathfinish p = pathstart p \<and> | |
| 3612 |             (\<forall>t\<in>{0..1}. cmod (shiftpath a \<gamma> t - p t) < e) \<and>
 | |
| 3613 | contour_integral p (\<lambda>w. 1 / (w - z)) = | |
| 3614 | complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z" | |
| 3615 | if "e > 0" for e | |
| 3616 | proof - | |
| 3617 | obtain p where "winding_number_prop \<gamma> z e p (winding_number \<gamma> z)" | |
| 3618 | using \<open>0 < e\<close> assms winding_number by blast | |
| 3619 | then show ?thesis | |
| 3620 | apply (rule_tac x="shiftpath a p" in exI) | |
| 3621 | using assms that | |
| 3622 | apply (auto simp: winding_number_prop_def path_image_shiftpath pathfinish_shiftpath pathstart_shiftpath contour_integral_shiftpath) | |
| 3623 | apply (simp add: shiftpath_def) | |
| 3624 | done | |
| 3625 | qed | |
| 3626 | qed (use assms in \<open>auto simp: path_shiftpath path_image_shiftpath pathfinish_shiftpath pathstart_shiftpath\<close>) | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3627 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3628 | lemma winding_number_split_linepath: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3629 | assumes "c \<in> closed_segment a b" "z \<notin> closed_segment a b" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3630 | shows "winding_number(linepath a b) z = winding_number(linepath a c) z + winding_number(linepath c b) z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3631 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3632 | have "z \<notin> closed_segment a c" "z \<notin> closed_segment c b" | 
| 68310 | 3633 | using assms by (meson convex_contains_segment convex_segment ends_in_segment subsetCE)+ | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3634 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3635 | using assms | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3636 | by (simp add: winding_number_valid_path contour_integral_split_linepath [symmetric] continuous_on_inversediff field_simps) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3637 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3638 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3639 | lemma winding_number_cong: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3640 | "(\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> p t = q t) \<Longrightarrow> winding_number p z = winding_number q z" | 
| 68326 | 3641 | by (simp add: winding_number_def winding_number_prop_def pathstart_def pathfinish_def) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3642 | |
| 68532 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3643 | lemma winding_number_constI: | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3644 | assumes "c\<noteq>z" "\<And>t. \<lbrakk>0\<le>t; t\<le>1\<rbrakk> \<Longrightarrow> g t = c" | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3645 | shows "winding_number g z = 0" | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3646 | proof - | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3647 | have "winding_number g z = winding_number (linepath c c) z" | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3648 | apply (rule winding_number_cong) | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3649 | using assms unfolding linepath_def by auto | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3650 | moreover have "winding_number (linepath c c) z =0" | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3651 | apply (rule winding_number_trivial) | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3652 | using assms by auto | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3653 | ultimately show ?thesis by auto | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3654 | qed | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 3655 | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3656 | lemma winding_number_offset: "winding_number p z = winding_number (\<lambda>w. p w - z) 0" | 
| 68339 | 3657 | unfolding winding_number_def | 
| 3658 | proof (intro ext arg_cong [where f = Eps] arg_cong [where f = All] imp_cong refl, safe) | |
| 3659 | fix n e g | |
| 3660 | assume "0 < e" and g: "winding_number_prop p z e g n" | |
| 3661 | then show "\<exists>r. winding_number_prop (\<lambda>w. p w - z) 0 e r n" | |
| 3662 | by (rule_tac x="\<lambda>t. g t - z" in exI) | |
| 68493 | 3663 | (force simp: winding_number_prop_def contour_integral_integral valid_path_def path_defs | 
| 68339 | 3664 | vector_derivative_def has_vector_derivative_diff_const piecewise_C1_differentiable_diff C1_differentiable_imp_piecewise) | 
| 3665 | next | |
| 3666 | fix n e g | |
| 3667 | assume "0 < e" and g: "winding_number_prop (\<lambda>w. p w - z) 0 e g n" | |
| 3668 | then show "\<exists>r. winding_number_prop p z e r n" | |
| 3669 | apply (rule_tac x="\<lambda>t. g t + z" in exI) | |
| 68493 | 3670 | apply (simp add: winding_number_prop_def contour_integral_integral valid_path_def path_defs | 
| 68339 | 3671 | piecewise_C1_differentiable_add vector_derivative_def has_vector_derivative_add_const C1_differentiable_imp_piecewise) | 
| 3672 | apply (force simp: algebra_simps) | |
| 3673 | done | |
| 3674 | qed | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3675 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 3676 | subsubsection%unimportant \<open>Some lemmas about negating a path\<close> | 
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3677 | |
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3678 | lemma valid_path_negatepath: "valid_path \<gamma> \<Longrightarrow> valid_path (uminus \<circ> \<gamma>)" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3679 | unfolding o_def using piecewise_C1_differentiable_neg valid_path_def by blast | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3680 | |
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3681 | lemma has_contour_integral_negatepath: | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3682 | assumes \<gamma>: "valid_path \<gamma>" and cint: "((\<lambda>z. f (- z)) has_contour_integral - i) \<gamma>" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3683 | shows "(f has_contour_integral i) (uminus \<circ> \<gamma>)" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3684 | proof - | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3685 |   obtain S where cont: "continuous_on {0..1} \<gamma>" and "finite S" and diff: "\<gamma> C1_differentiable_on {0..1} - S"
 | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3686 | using \<gamma> by (auto simp: valid_path_def piecewise_C1_differentiable_on_def) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3687 |   have "((\<lambda>x. - (f (- \<gamma> x) * vector_derivative \<gamma> (at x within {0..1}))) has_integral i) {0..1}"
 | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3688 | using cint by (auto simp: has_contour_integral_def dest: has_integral_neg) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3689 | then | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3690 |   have "((\<lambda>x. f (- \<gamma> x) * vector_derivative (uminus \<circ> \<gamma>) (at x within {0..1})) has_integral i) {0..1}"
 | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3691 | proof (rule rev_iffD1 [OF _ has_integral_spike_eq]) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3692 | show "negligible S" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3693 | by (simp add: \<open>finite S\<close> negligible_finite) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3694 |     show "f (- \<gamma> x) * vector_derivative (uminus \<circ> \<gamma>) (at x within {0..1}) =
 | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3695 |          - (f (- \<gamma> x) * vector_derivative \<gamma> (at x within {0..1}))"
 | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3696 |       if "x \<in> {0..1} - S" for x
 | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3697 | proof - | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3698 | have "vector_derivative (uminus \<circ> \<gamma>) (at x within cbox 0 1) = - vector_derivative \<gamma> (at x within cbox 0 1)" | 
| 68310 | 3699 | proof (rule vector_derivative_within_cbox) | 
| 3700 | show "(uminus \<circ> \<gamma> has_vector_derivative - vector_derivative \<gamma> (at x within cbox 0 1)) (at x within cbox 0 1)" | |
| 3701 | using that unfolding o_def | |
| 3702 | by (metis C1_differentiable_on_eq UNIV_I diff differentiable_subset has_vector_derivative_minus subsetI that vector_derivative_works) | |
| 3703 | qed (use that in auto) | |
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3704 | then show ?thesis | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3705 | by simp | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3706 | qed | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3707 | qed | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3708 | then show ?thesis by (simp add: has_contour_integral_def) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3709 | qed | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3710 | |
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3711 | lemma winding_number_negatepath: | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3712 | assumes \<gamma>: "valid_path \<gamma>" and 0: "0 \<notin> path_image \<gamma>" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3713 | shows "winding_number(uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3714 | proof - | 
| 67399 | 3715 | have "(/) 1 contour_integrable_on \<gamma>" | 
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3716 | using "0" \<gamma> contour_integrable_inversediff by fastforce | 
| 67399 | 3717 | then have "((\<lambda>z. 1/z) has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>" | 
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3718 | by (rule has_contour_integral_integral) | 
| 67399 | 3719 | then have "((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>" | 
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3720 | using has_contour_integral_neg by auto | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3721 | then show ?thesis | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3722 | using assms | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3723 | apply (simp add: winding_number_valid_path valid_path_negatepath image_def path_defs) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3724 | apply (simp add: contour_integral_unique has_contour_integral_negatepath) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3725 | done | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3726 | qed | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3727 | |
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3728 | lemma contour_integrable_negatepath: | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3729 | assumes \<gamma>: "valid_path \<gamma>" and pi: "(\<lambda>z. f (- z)) contour_integrable_on \<gamma>" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3730 | shows "f contour_integrable_on (uminus \<circ> \<gamma>)" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3731 | by (metis \<gamma> add.inverse_inverse contour_integrable_on_def has_contour_integral_negatepath pi) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3732 | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3733 | (* A combined theorem deducing several things piecewise.*) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3734 | lemma winding_number_join_pos_combined: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3735 | "\<lbrakk>valid_path \<gamma>1; z \<notin> path_image \<gamma>1; 0 < Re(winding_number \<gamma>1 z); | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3736 | valid_path \<gamma>2; z \<notin> path_image \<gamma>2; 0 < Re(winding_number \<gamma>2 z); pathfinish \<gamma>1 = pathstart \<gamma>2\<rbrakk> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3737 | \<Longrightarrow> valid_path(\<gamma>1 +++ \<gamma>2) \<and> z \<notin> path_image(\<gamma>1 +++ \<gamma>2) \<and> 0 < Re(winding_number(\<gamma>1 +++ \<gamma>2) z)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3738 | by (simp add: valid_path_join path_image_join winding_number_join valid_path_imp_path) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3739 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3740 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 3741 | subsubsection%unimportant \<open>Useful sufficient conditions for the winding number to be positive\<close> | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3742 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3743 | lemma Re_winding_number: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3744 | "\<lbrakk>valid_path \<gamma>; z \<notin> path_image \<gamma>\<rbrakk> | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3745 | \<Longrightarrow> Re(winding_number \<gamma> z) = Im(contour_integral \<gamma> (\<lambda>w. 1/(w - z))) / (2*pi)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3746 | by (simp add: winding_number_valid_path field_simps Re_divide power2_eq_square) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3747 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3748 | lemma winding_number_pos_le: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3749 | assumes \<gamma>: "valid_path \<gamma>" "z \<notin> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3750 | and ge: "\<And>x. \<lbrakk>0 < x; x < 1\<rbrakk> \<Longrightarrow> 0 \<le> Im (vector_derivative \<gamma> (at x) * cnj(\<gamma> x - z))" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3751 | shows "0 \<le> Re(winding_number \<gamma> z)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3752 | proof - | 
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3753 | have ge0: "0 \<le> Im (vector_derivative \<gamma> (at x) / (\<gamma> x - z))" if x: "0 < x" "x < 1" for x | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3754 | using ge by (simp add: Complex.Im_divide algebra_simps x) | 
| 68310 | 3755 | let ?vd = "\<lambda>x. 1 / (\<gamma> x - z) * vector_derivative \<gamma> (at x)" | 
| 3756 | let ?int = "\<lambda>z. contour_integral \<gamma> (\<lambda>w. 1 / (w - z))" | |
| 3757 | have hi: "(?vd has_integral ?int z) (cbox 0 1)" | |
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3758 | unfolding box_real | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3759 | apply (subst has_contour_integral [symmetric]) | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3760 | using \<gamma> by (simp add: contour_integrable_inversediff has_contour_integral_integral) | 
| 68310 | 3761 | have "0 \<le> Im (?int z)" | 
| 3762 | proof (rule has_integral_component_nonneg [of \<i>, simplified]) | |
| 3763 | show "\<And>x. x \<in> cbox 0 1 \<Longrightarrow> 0 \<le> Im (if 0 < x \<and> x < 1 then ?vd x else 0)" | |
| 3764 | by (force simp: ge0) | |
| 3765 | show "((\<lambda>x. if 0 < x \<and> x < 1 then ?vd x else 0) has_integral ?int z) (cbox 0 1)" | |
| 3766 | by (rule has_integral_spike_interior [OF hi]) simp | |
| 68493 | 3767 | qed | 
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3768 | then show ?thesis | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3769 | by (simp add: Re_winding_number [OF \<gamma>] field_simps) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3770 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3771 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3772 | lemma winding_number_pos_lt_lemma: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3773 | assumes \<gamma>: "valid_path \<gamma>" "z \<notin> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3774 | and e: "0 < e" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3775 | and ge: "\<And>x. \<lbrakk>0 < x; x < 1\<rbrakk> \<Longrightarrow> e \<le> Im (vector_derivative \<gamma> (at x) / (\<gamma> x - z))" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3776 | shows "0 < Re(winding_number \<gamma> z)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3777 | proof - | 
| 68310 | 3778 | let ?vd = "\<lambda>x. 1 / (\<gamma> x - z) * vector_derivative \<gamma> (at x)" | 
| 3779 | let ?int = "\<lambda>z. contour_integral \<gamma> (\<lambda>w. 1 / (w - z))" | |
| 3780 | have hi: "(?vd has_integral ?int z) (cbox 0 1)" | |
| 68493 | 3781 | unfolding box_real | 
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3782 | apply (subst has_contour_integral [symmetric]) | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3783 | using \<gamma> by (simp add: contour_integrable_inversediff has_contour_integral_integral) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3784 | have "e \<le> Im (contour_integral \<gamma> (\<lambda>w. 1 / (w - z)))" | 
| 68310 | 3785 |   proof (rule has_integral_component_le [of \<i> "\<lambda>x. \<i>*e" "\<i>*e" "{0..1}", simplified])
 | 
| 3786 |     show "((\<lambda>x. if 0 < x \<and> x < 1 then ?vd x else \<i> * complex_of_real e) has_integral ?int z) {0..1}"
 | |
| 3787 | by (rule has_integral_spike_interior [OF hi, simplified box_real]) (use e in simp) | |
| 3788 | show "\<And>x. 0 \<le> x \<and> x \<le> 1 \<Longrightarrow> | |
| 3789 | e \<le> Im (if 0 < x \<and> x < 1 then ?vd x else \<i> * complex_of_real e)" | |
| 3790 | by (simp add: ge) | |
| 3791 | qed (use has_integral_const_real [of _ 0 1] in auto) | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3792 | with e show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3793 | by (simp add: Re_winding_number [OF \<gamma>] field_simps) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3794 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3795 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3796 | lemma winding_number_pos_lt: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3797 | assumes \<gamma>: "valid_path \<gamma>" "z \<notin> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3798 | and e: "0 < e" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3799 | and ge: "\<And>x. \<lbrakk>0 < x; x < 1\<rbrakk> \<Longrightarrow> e \<le> Im (vector_derivative \<gamma> (at x) * cnj(\<gamma> x - z))" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3800 | shows "0 < Re (winding_number \<gamma> z)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3801 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3802 | have bm: "bounded ((\<lambda>w. w - z) ` (path_image \<gamma>))" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3803 | using bounded_translation [of _ "-z"] \<gamma> by (simp add: bounded_valid_path_image) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3804 | then obtain B where B: "B > 0" and Bno: "\<And>x. x \<in> (\<lambda>w. w - z) ` (path_image \<gamma>) \<Longrightarrow> norm x \<le> B" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3805 | using bounded_pos [THEN iffD1, OF bm] by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3806 |   { fix x::real  assume x: "0 < x" "x < 1"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3807 | then have B2: "cmod (\<gamma> x - z)^2 \<le> B^2" using Bno [of "\<gamma> x - z"] | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3808 | by (simp add: path_image_def power2_eq_square mult_mono') | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3809 | with x have "\<gamma> x \<noteq> z" using \<gamma> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3810 | using path_image_def by fastforce | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3811 | then have "e / B\<^sup>2 \<le> Im (vector_derivative \<gamma> (at x) * cnj (\<gamma> x - z)) / (cmod (\<gamma> x - z))\<^sup>2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3812 | using B ge [OF x] B2 e | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3813 | apply (rule_tac y="e / (cmod (\<gamma> x - z))\<^sup>2" in order_trans) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3814 | apply (auto simp: divide_left_mono divide_right_mono) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3815 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3816 | then have "e / B\<^sup>2 \<le> Im (vector_derivative \<gamma> (at x) / (\<gamma> x - z))" | 
| 68339 | 3817 | by (simp add: complex_div_cnj [of _ "\<gamma> x - z" for x] del: complex_cnj_diff times_complex.sel) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3818 | } note * = this | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3819 | show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3820 | using e B by (simp add: * winding_number_pos_lt_lemma [OF \<gamma>, of "e/B^2"]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3821 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3822 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3823 | subsection\<open>The winding number is an integer\<close> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3824 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3825 | text\<open>Proof from the book Complex Analysis by Lars V. Ahlfors, Chapter 4, section 2.1, | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3826 | Also on page 134 of Serge Lang's book with the name title, etc.\<close> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3827 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3828 | lemma exp_fg: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3829 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3830 | assumes g: "(g has_vector_derivative g') (at x within s)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3831 | and f: "(f has_vector_derivative (g' / (g x - z))) (at x within s)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3832 | and z: "g x \<noteq> z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3833 | shows "((\<lambda>x. exp(-f x) * (g x - z)) has_vector_derivative 0) (at x within s)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3834 | proof - | 
| 68339 | 3835 | have *: "(exp \<circ> (\<lambda>x. (- f x)) has_vector_derivative - (g' / (g x - z)) * exp (- f x)) (at x within s)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3836 | using assms unfolding has_vector_derivative_def scaleR_conv_of_real | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3837 | by (auto intro!: derivative_eq_intros) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3838 | show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3839 | apply (rule has_vector_derivative_eq_rhs) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3840 | using z | 
| 68339 | 3841 | apply (auto intro!: derivative_eq_intros * [unfolded o_def] g) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3842 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3843 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3844 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3845 | lemma winding_number_exp_integral: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3846 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3847 |   assumes \<gamma>: "\<gamma> piecewise_C1_differentiable_on {a..b}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3848 | and ab: "a \<le> b" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3849 |       and z: "z \<notin> \<gamma> ` {a..b}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3850 |     shows "(\<lambda>x. vector_derivative \<gamma> (at x) / (\<gamma> x - z)) integrable_on {a..b}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3851 | (is "?thesis1") | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3852 |           "exp (- (integral {a..b} (\<lambda>x. vector_derivative \<gamma> (at x) / (\<gamma> x - z)))) * (\<gamma> b - z) = \<gamma> a - z"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3853 | (is "?thesis2") | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3854 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3855 | let ?D\<gamma> = "\<lambda>x. vector_derivative \<gamma> (at x)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3856 | have [simp]: "\<And>x. a \<le> x \<Longrightarrow> x \<le> b \<Longrightarrow> \<gamma> x \<noteq> z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3857 | using z by force | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3858 |   have cong: "continuous_on {a..b} \<gamma>"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3859 | using \<gamma> by (simp add: piecewise_C1_differentiable_on_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3860 |   obtain k where fink: "finite k" and g_C1_diff: "\<gamma> C1_differentiable_on ({a..b} - k)"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3861 | using \<gamma> by (force simp: piecewise_C1_differentiable_on_def) | 
| 68339 | 3862 |   have \<circ>: "open ({a<..<b} - k)"
 | 
| 61808 | 3863 | using \<open>finite k\<close> by (simp add: finite_imp_closed open_Diff) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3864 |   moreover have "{a<..<b} - k \<subseteq> {a..b} - k"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3865 | by force | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3866 |   ultimately have g_diff_at: "\<And>x. \<lbrakk>x \<notin> k; x \<in> {a<..<b}\<rbrakk> \<Longrightarrow> \<gamma> differentiable at x"
 | 
| 63955 | 3867 | by (metis Diff_iff differentiable_on_subset C1_diff_imp_diff [OF g_C1_diff] differentiable_on_def at_within_open) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3868 |   { fix w
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3869 | assume "w \<noteq> z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3870 | have "continuous_on (ball w (cmod (w - z))) (\<lambda>w. 1 / (w - z))" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3871 | by (auto simp: dist_norm intro!: continuous_intros) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3872 | moreover have "\<And>x. cmod (w - x) < cmod (w - z) \<Longrightarrow> \<exists>f'. ((\<lambda>w. 1 / (w - z)) has_field_derivative f') (at x)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3873 | by (auto simp: intro!: derivative_eq_intros) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3874 | ultimately have "\<exists>h. \<forall>y. norm(y - w) < norm(w - z) \<longrightarrow> (h has_field_derivative 1/(y - z)) (at y)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3875 |       using holomorphic_convex_primitive [of "ball w (norm(w - z))" "{}" "\<lambda>w. 1/(w - z)"]
 | 
| 68339 | 3876 | by (force simp: field_differentiable_def Ball_def dist_norm at_within_open_NO_MATCH norm_minus_commute) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3877 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3878 | then obtain h where h: "\<And>w y. w \<noteq> z \<Longrightarrow> norm(y - w) < norm(w - z) \<Longrightarrow> (h w has_field_derivative 1/(y - z)) (at y)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3879 | by meson | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3880 |   have exy: "\<exists>y. ((\<lambda>x. inverse (\<gamma> x - z) * ?D\<gamma> x) has_integral y) {a..b}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3881 | unfolding integrable_on_def [symmetric] | 
| 66708 | 3882 | proof (rule contour_integral_local_primitive_any [OF piecewise_C1_imp_differentiable [OF \<gamma>]]) | 
| 3883 | show "\<exists>d h. 0 < d \<and> | |
| 68493 | 3884 |                (\<forall>y. cmod (y - w) < d \<longrightarrow> (h has_field_derivative inverse (y - z))(at y within - {z}))"
 | 
| 66708 | 3885 |           if "w \<in> - {z}" for w
 | 
| 3886 | apply (rule_tac x="norm(w - z)" in exI) | |
| 3887 | using that inverse_eq_divide has_field_derivative_at_within h | |
| 3888 | by (metis Compl_insert DiffD2 insertCI right_minus_eq zero_less_norm_iff) | |
| 3889 | qed simp | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3890 |   have vg_int: "(\<lambda>x. ?D\<gamma> x / (\<gamma> x - z)) integrable_on {a..b}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3891 | unfolding box_real [symmetric] divide_inverse_commute | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3892 | by (auto intro!: exy integrable_subinterval simp add: integrable_on_def ab) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3893 | with ab show ?thesis1 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3894 | by (simp add: divide_inverse_commute integral_def integrable_on_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3895 |   { fix t
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3896 |     assume t: "t \<in> {a..b}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3897 | have cball: "continuous_on (ball (\<gamma> t) (dist (\<gamma> t) z)) (\<lambda>x. inverse (x - z))" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3898 | using z by (auto intro!: continuous_intros simp: dist_norm) | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 3899 | have icd: "\<And>x. cmod (\<gamma> t - x) < cmod (\<gamma> t - z) \<Longrightarrow> (\<lambda>w. inverse (w - z)) field_differentiable at x" | 
| 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 3900 | unfolding field_differentiable_def by (force simp: intro!: derivative_eq_intros) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3901 | obtain h where h: "\<And>x. cmod (\<gamma> t - x) < cmod (\<gamma> t - z) \<Longrightarrow> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3902 |                        (h has_field_derivative inverse (x - z)) (at x within {y. cmod (\<gamma> t - y) < cmod (\<gamma> t - z)})"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3903 | using holomorphic_convex_primitive [where f = "\<lambda>w. inverse(w - z)", OF convex_ball finite.emptyI cball icd] | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3904 | by simp (auto simp: ball_def dist_norm that) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3905 |     { fix x D
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3906 | assume x: "x \<notin> k" "a < x" "x < b" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3907 |       then have "x \<in> interior ({a..b} - k)"
 | 
| 68339 | 3908 | using open_subset_interior [OF \<circ>] by fastforce | 
| 66708 | 3909 | then have con: "isCont ?D\<gamma> x" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3910 | using g_C1_diff x by (auto simp: C1_differentiable_on_eq intro: continuous_on_interior) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3911 |       then have con_vd: "continuous (at x within {a..b}) (\<lambda>x. ?D\<gamma> x)"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3912 | by (rule continuous_at_imp_continuous_within) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3913 | have gdx: "\<gamma> differentiable at x" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3914 | using x by (simp add: g_diff_at) | 
| 66708 | 3915 | have "\<And>d. \<lbrakk>x \<notin> k; a < x; x < b; | 
| 3916 | (\<gamma> has_vector_derivative d) (at x); a \<le> t; t \<le> b\<rbrakk> | |
| 3917 |          \<Longrightarrow> ((\<lambda>x. integral {a..x}
 | |
| 3918 | (\<lambda>x. ?D\<gamma> x / | |
| 3919 | (\<gamma> x - z))) has_vector_derivative | |
| 3920 | d / (\<gamma> x - z)) | |
| 3921 |               (at x within {a..b})"
 | |
| 3922 | apply (rule has_vector_derivative_eq_rhs) | |
| 3923 |          apply (rule integral_has_vector_derivative_continuous_at [where S = "{}", simplified])
 | |
| 3924 | apply (rule con_vd continuous_intros cong vg_int | simp add: continuous_at_imp_continuous_within has_vector_derivative_continuous vector_derivative_at)+ | |
| 3925 | done | |
| 3926 |       then have "((\<lambda>c. exp (- integral {a..c} (\<lambda>x. ?D\<gamma> x / (\<gamma> x - z))) * (\<gamma> c - z)) has_derivative (\<lambda>h. 0))
 | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3927 |           (at x within {a..b})"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3928 | using x gdx t | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3929 | apply (clarsimp simp add: differentiable_iff_scaleR) | 
| 67979 
53323937ee25
new material about vec, real^1, etc.
 paulson <lp15@cam.ac.uk> parents: 
67968diff
changeset | 3930 | apply (rule exp_fg [unfolded has_vector_derivative_def, simplified], blast intro: has_derivative_at_withinI) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3931 | apply (simp_all add: has_vector_derivative_def [symmetric]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3932 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3933 | } note * = this | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3934 |     have "exp (- (integral {a..t} (\<lambda>x. ?D\<gamma> x / (\<gamma> x - z)))) * (\<gamma> t - z) =\<gamma> a - z"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3935 |       apply (rule has_derivative_zero_unique_strong_interval [of "{a,b} \<union> k" a b])
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3936 | using t | 
| 66192 
e5b84854baa4
A few renamings and several tidied-up proofs
 paulson <lp15@cam.ac.uk> parents: 
66164diff
changeset | 3937 | apply (auto intro!: * continuous_intros fink cong indefinite_integral_continuous_1 [OF vg_int] simp add: ab)+ | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3938 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3939 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3940 | with ab show ?thesis2 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3941 | by (simp add: divide_inverse_commute integral_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3942 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3943 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 3944 | lemma winding_number_exp_2pi: | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3945 | "\<lbrakk>path p; z \<notin> path_image p\<rbrakk> | 
| 63589 | 3946 | \<Longrightarrow> pathfinish p - z = exp (2 * pi * \<i> * winding_number p z) * (pathstart p - z)" | 
| 68326 | 3947 | using winding_number [of p z 1] unfolding valid_path_def path_image_def pathstart_def pathfinish_def winding_number_prop_def | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3948 | by (force dest: winding_number_exp_integral(2) [of _ 0 1 z] simp: field_simps contour_integral_integral exp_minus) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3949 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3950 | lemma integer_winding_number_eq: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3951 | assumes \<gamma>: "path \<gamma>" and z: "z \<notin> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3952 | shows "winding_number \<gamma> z \<in> \<int> \<longleftrightarrow> pathfinish \<gamma> = pathstart \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3953 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3954 | obtain p where p: "valid_path p" "z \<notin> path_image p" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3955 | "pathstart p = pathstart \<gamma>" "pathfinish p = pathfinish \<gamma>" | 
| 68339 | 3956 | and eq: "contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z" | 
| 68326 | 3957 | using winding_number [OF assms, of 1] unfolding winding_number_prop_def by auto | 
| 68339 | 3958 | then have wneq: "winding_number \<gamma> z = winding_number p z" | 
| 3959 | using eq winding_number_valid_path by force | |
| 3960 | have iff: "(winding_number \<gamma> z \<in> \<int>) \<longleftrightarrow> (exp (contour_integral p (\<lambda>w. 1 / (w - z))) = 1)" | |
| 3961 | using eq by (simp add: exp_eq_1 complex_is_Int_iff) | |
| 3962 | have "exp (contour_integral p (\<lambda>w. 1 / (w - z))) = (\<gamma> 1 - z) / (\<gamma> 0 - z)" | |
| 3963 | using p winding_number_exp_integral(2) [of p 0 1 z] | |
| 3964 | apply (simp add: valid_path_def path_defs contour_integral_integral exp_minus divide_simps) | |
| 3965 | by (metis path_image_def pathstart_def pathstart_in_path_image) | |
| 3966 | then have "winding_number p z \<in> \<int> \<longleftrightarrow> pathfinish p = pathstart p" | |
| 3967 | using p wneq iff by (auto simp: path_defs) | |
| 3968 | then show ?thesis using p eq | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3969 | by (auto simp: winding_number_valid_path) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3970 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3971 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3972 | theorem integer_winding_number: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3973 | "\<lbrakk>path \<gamma>; pathfinish \<gamma> = pathstart \<gamma>; z \<notin> path_image \<gamma>\<rbrakk> \<Longrightarrow> winding_number \<gamma> z \<in> \<int>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3974 | by (metis integer_winding_number_eq) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3975 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3976 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3977 | text\<open>If the winding number's magnitude is at least one, then the path must contain points in every direction.*) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3978 | We can thus bound the winding number of a path that doesn't intersect a given ray. \<close> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3979 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3980 | lemma winding_number_pos_meets: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3981 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3982 | assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" and 1: "Re (winding_number \<gamma> z) \<ge> 1" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3983 | and w: "w \<noteq> z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3984 | shows "\<exists>a::real. 0 < a \<and> z + a*(w - z) \<in> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3985 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3986 | have [simp]: "\<And>x. 0 \<le> x \<Longrightarrow> x \<le> 1 \<Longrightarrow> \<gamma> x \<noteq> z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3987 | using z by (auto simp: path_image_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3988 |   have [simp]: "z \<notin> \<gamma> ` {0..1}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3989 | using path_image_def z by auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3990 |   have gpd: "\<gamma> piecewise_C1_differentiable_on {0..1}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3991 | using \<gamma> valid_path_def by blast | 
| 63040 | 3992 | define r where "r = (w - z) / (\<gamma> 0 - z)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3993 | have [simp]: "r \<noteq> 0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3994 | using w z by (auto simp: r_def) | 
| 68339 | 3995 |   have cont: "continuous_on {0..1}
 | 
| 3996 |      (\<lambda>x. Im (integral {0..x} (\<lambda>x. vector_derivative \<gamma> (at x) / (\<gamma> x - z))))"
 | |
| 3997 | by (intro continuous_intros indefinite_integral_continuous_1 winding_number_exp_integral [OF gpd]; simp) | |
| 68493 | 3998 | have "Arg2pi r \<le> 2*pi" | 
| 3999 | by (simp add: Arg2pi less_eq_real_def) | |
| 68339 | 4000 |   also have "\<dots> \<le> Im (integral {0..1} (\<lambda>x. vector_derivative \<gamma> (at x) / (\<gamma> x - z)))"
 | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4001 | using 1 | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 4002 | apply (simp add: winding_number_valid_path [OF \<gamma> z] contour_integral_integral) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4003 | apply (simp add: Complex.Re_divide field_simps power2_eq_square) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4004 | done | 
| 68493 | 4005 |   finally have "Arg2pi r \<le> Im (integral {0..1} (\<lambda>x. vector_derivative \<gamma> (at x) / (\<gamma> x - z)))" .
 | 
| 4006 |   then have "\<exists>t. t \<in> {0..1} \<and> Im(integral {0..t} (\<lambda>x. vector_derivative \<gamma> (at x)/(\<gamma> x - z))) = Arg2pi r"
 | |
| 4007 | by (simp add: Arg2pi_ge_0 cont IVT') | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4008 |   then obtain t where t:     "t \<in> {0..1}"
 | 
| 68493 | 4009 |                   and eqArg: "Im (integral {0..t} (\<lambda>x. vector_derivative \<gamma> (at x)/(\<gamma> x - z))) = Arg2pi r"
 | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4010 | by blast | 
| 63040 | 4011 |   define i where "i = integral {0..t} (\<lambda>x. vector_derivative \<gamma> (at x) / (\<gamma> x - z))"
 | 
| 68493 | 4012 | have iArg: "Arg2pi r = Im i" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4013 | using eqArg by (simp add: i_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4014 |   have gpdt: "\<gamma> piecewise_C1_differentiable_on {0..t}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4015 | by (metis atLeastAtMost_iff atLeastatMost_subset_iff order_refl piecewise_C1_differentiable_on_subset gpd t) | 
| 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: 
61738diff
changeset | 4016 | have "exp (- i) * (\<gamma> t - z) = \<gamma> 0 - z" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4017 | unfolding i_def | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4018 | apply (rule winding_number_exp_integral [OF gpdt]) | 
| 68339 | 4019 | using t z unfolding path_image_def by force+ | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4020 | then have *: "\<gamma> t - z = exp i * (\<gamma> 0 - z)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4021 | by (simp add: exp_minus field_simps) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4022 | then have "(w - z) = r * (\<gamma> 0 - z)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4023 | by (simp add: r_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4024 | then have "z + complex_of_real (exp (Re i)) * (w - z) / complex_of_real (cmod r) = \<gamma> t" | 
| 68339 | 4025 | apply simp | 
| 68493 | 4026 | apply (subst Complex_Transcendental.Arg2pi_eq [of r]) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4027 | apply (simp add: iArg) | 
| 68339 | 4028 | using * apply (simp add: exp_eq_polar field_simps) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4029 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4030 | with t show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4031 | by (rule_tac x="exp(Re i) / norm r" in exI) (auto simp: path_image_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4032 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4033 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4034 | lemma winding_number_big_meets: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4035 | fixes z::complex | 
| 61945 | 4036 | assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" and "\<bar>Re (winding_number \<gamma> z)\<bar> \<ge> 1" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4037 | and w: "w \<noteq> z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4038 | shows "\<exists>a::real. 0 < a \<and> z + a*(w - z) \<in> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4039 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4040 |   { assume "Re (winding_number \<gamma> z) \<le> - 1"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4041 | then have "Re (winding_number (reversepath \<gamma>) z) \<ge> 1" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4042 | by (simp add: \<gamma> valid_path_imp_path winding_number_reversepath z) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4043 | moreover have "valid_path (reversepath \<gamma>)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4044 | using \<gamma> valid_path_imp_reverse by auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4045 | moreover have "z \<notin> path_image (reversepath \<gamma>)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4046 | by (simp add: z) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4047 | ultimately have "\<exists>a::real. 0 < a \<and> z + a*(w - z) \<in> path_image (reversepath \<gamma>)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4048 | using winding_number_pos_meets w by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4049 | then have ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4050 | by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4051 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4052 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4053 | using assms | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 4054 | by (simp add: abs_if winding_number_pos_meets split: if_split_asm) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4055 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4056 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4057 | lemma winding_number_less_1: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4058 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4059 | shows | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4060 | "\<lbrakk>valid_path \<gamma>; z \<notin> path_image \<gamma>; w \<noteq> z; | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4061 | \<And>a::real. 0 < a \<Longrightarrow> z + a*(w - z) \<notin> path_image \<gamma>\<rbrakk> | 
| 65578 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 4062 | \<Longrightarrow> Re(winding_number \<gamma> z) < 1" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4063 | by (auto simp: not_less dest: winding_number_big_meets) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4064 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4065 | text\<open>One way of proving that WN=1 for a loop.\<close> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4066 | lemma winding_number_eq_1: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4067 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4068 | assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" and loop: "pathfinish \<gamma> = pathstart \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4069 | and 0: "0 < Re(winding_number \<gamma> z)" and 2: "Re(winding_number \<gamma> z) < 2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4070 | shows "winding_number \<gamma> z = 1" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4071 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4072 | have "winding_number \<gamma> z \<in> Ints" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4073 | by (simp add: \<gamma> integer_winding_number loop valid_path_imp_path z) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4074 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4075 | using 0 2 by (auto simp: Ints_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4076 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4077 | |
| 67968 | 4078 | subsection\<open>Continuity of winding number and invariance on connected sets\<close> | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4079 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4080 | lemma continuous_at_winding_number: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4081 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4082 | assumes \<gamma>: "path \<gamma>" and z: "z \<notin> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4083 | shows "continuous (at z) (winding_number \<gamma>)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4084 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4085 | obtain e where "e>0" and cbg: "cball z e \<subseteq> - path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4086 | using open_contains_cball [of "- path_image \<gamma>"] z | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4087 | by (force simp: closed_def [symmetric] closed_path_image [OF \<gamma>]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4088 | then have ppag: "path_image \<gamma> \<subseteq> - cball z (e/2)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4089 | by (force simp: cball_def dist_norm) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4090 | have oc: "open (- cball z (e / 2))" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4091 | by (simp add: closed_def [symmetric]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4092 | obtain d where "d>0" and pi_eq: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4093 | "\<And>h1 h2. \<lbrakk>valid_path h1; valid_path h2; | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4094 |               (\<forall>t\<in>{0..1}. cmod (h1 t - \<gamma> t) < d \<and> cmod (h2 t - \<gamma> t) < d);
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4095 | pathstart h2 = pathstart h1; pathfinish h2 = pathfinish h1\<rbrakk> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4096 | \<Longrightarrow> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4097 | path_image h1 \<subseteq> - cball z (e / 2) \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4098 | path_image h2 \<subseteq> - cball z (e / 2) \<and> | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4099 | (\<forall>f. f holomorphic_on - cball z (e / 2) \<longrightarrow> contour_integral h2 f = contour_integral h1 f)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4100 | using contour_integral_nearby_ends [OF oc \<gamma> ppag] by metis | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4101 | obtain p where p: "valid_path p" "z \<notin> path_image p" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4102 | "pathstart p = pathstart \<gamma> \<and> pathfinish p = pathfinish \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4103 |               and pg: "\<And>t. t\<in>{0..1} \<Longrightarrow> cmod (\<gamma> t - p t) < min d e / 2"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4104 | and pi: "contour_integral p (\<lambda>x. 1 / (x - z)) = complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z" | 
| 68326 | 4105 | using winding_number [OF \<gamma> z, of "min d e / 2"] \<open>d>0\<close> \<open>e>0\<close> by (auto simp: winding_number_prop_def) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4106 |   { fix w
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4107 | assume d2: "cmod (w - z) < d/2" and e2: "cmod (w - z) < e/2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4108 | then have wnotp: "w \<notin> path_image p" | 
| 61808 | 4109 | using cbg \<open>d>0\<close> \<open>e>0\<close> | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4110 | apply (simp add: path_image_def cball_def dist_norm, clarify) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4111 | apply (frule pg) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4112 | apply (drule_tac c="\<gamma> x" in subsetD) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4113 | apply (auto simp: less_eq_real_def norm_minus_commute norm_triangle_half_l) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4114 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4115 | have wnotg: "w \<notin> path_image \<gamma>" | 
| 61808 | 4116 | using cbg e2 \<open>e>0\<close> by (force simp: dist_norm norm_minus_commute) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4117 |     { fix k::real
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4118 | assume k: "k>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4119 | then obtain q where q: "valid_path q" "w \<notin> path_image q" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4120 | "pathstart q = pathstart \<gamma> \<and> pathfinish q = pathfinish \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4121 |                     and qg: "\<And>t. t \<in> {0..1} \<Longrightarrow> cmod (\<gamma> t - q t) < min k (min d e) / 2"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4122 | and qi: "contour_integral q (\<lambda>u. 1 / (u - w)) = complex_of_real (2 * pi) * \<i> * winding_number \<gamma> w" | 
| 61808 | 4123 | using winding_number [OF \<gamma> wnotg, of "min k (min d e) / 2"] \<open>d>0\<close> \<open>e>0\<close> k | 
| 68326 | 4124 | by (force simp: min_divide_distrib_right winding_number_prop_def) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4125 | have "contour_integral p (\<lambda>u. 1 / (u - w)) = contour_integral q (\<lambda>u. 1 / (u - w))" | 
| 61808 | 4126 | apply (rule pi_eq [OF \<open>valid_path q\<close> \<open>valid_path p\<close>, THEN conjunct2, THEN conjunct2, rule_format]) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4127 | apply (frule pg) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4128 | apply (frule qg) | 
| 61808 | 4129 | using p q \<open>d>0\<close> e2 | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4130 | apply (auto simp: dist_norm norm_minus_commute intro!: holomorphic_intros) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4131 | done | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4132 | then have "contour_integral p (\<lambda>x. 1 / (x - w)) = complex_of_real (2 * pi) * \<i> * winding_number \<gamma> w" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4133 | by (simp add: pi qi) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4134 | } note pip = this | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4135 | have "path p" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4136 | using p by (simp add: valid_path_imp_path) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4137 | then have "winding_number p w = winding_number \<gamma> w" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4138 | apply (rule winding_number_unique [OF _ wnotp]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4139 | apply (rule_tac x=p in exI) | 
| 68326 | 4140 | apply (simp add: p wnotp min_divide_distrib_right pip winding_number_prop_def) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4141 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4142 | } note wnwn = this | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4143 | obtain pe where "pe>0" and cbp: "cball z (3 / 4 * pe) \<subseteq> - path_image p" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4144 | using p open_contains_cball [of "- path_image p"] | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4145 | by (force simp: closed_def [symmetric] closed_path_image [OF valid_path_imp_path]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4146 | obtain L | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4147 | where "L>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4148 | and L: "\<And>f B. \<lbrakk>f holomorphic_on - cball z (3 / 4 * pe); | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4149 | \<forall>z \<in> - cball z (3 / 4 * pe). cmod (f z) \<le> B\<rbrakk> \<Longrightarrow> | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4150 | cmod (contour_integral p f) \<le> L * B" | 
| 61808 | 4151 | using contour_integral_bound_exists [of "- cball z (3/4*pe)" p] cbp \<open>valid_path p\<close> by force | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4152 |   { fix e::real and w::complex
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4153 | assume e: "0 < e" and w: "cmod (w - z) < pe/4" "cmod (w - z) < e * pe\<^sup>2 / (8 * L)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4154 | then have [simp]: "w \<notin> path_image p" | 
| 61808 | 4155 | using cbp p(2) \<open>0 < pe\<close> | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4156 | by (force simp: dist_norm norm_minus_commute path_image_def cball_def) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4157 | have [simp]: "contour_integral p (\<lambda>x. 1/(x - w)) - contour_integral p (\<lambda>x. 1/(x - z)) = | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4158 | contour_integral p (\<lambda>x. 1/(x - w) - 1/(x - z))" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4159 | by (simp add: p contour_integrable_inversediff contour_integral_diff) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4160 |     { fix x
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4161 | assume pe: "3/4 * pe < cmod (z - x)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4162 | have "cmod (w - x) < pe/4 + cmod (z - x)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4163 | by (meson add_less_cancel_right norm_diff_triangle_le order_refl order_trans_rules(21) w(1)) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4164 | then have wx: "cmod (w - x) < 4/3 * cmod (z - x)" using pe by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4165 | have "cmod (z - x) \<le> cmod (z - w) + cmod (w - x)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4166 | using norm_diff_triangle_le by blast | 
| 68339 | 4167 | also have "\<dots> < pe/4 + cmod (w - x)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4168 | using w by (simp add: norm_minus_commute) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4169 | finally have "pe/2 < cmod (w - x)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4170 | using pe by auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4171 | then have "(pe/2)^2 < cmod (w - x) ^ 2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4172 | apply (rule power_strict_mono) | 
| 61808 | 4173 | using \<open>pe>0\<close> by auto | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4174 | then have pe2: "pe^2 < 4 * cmod (w - x) ^ 2" | 
| 61694 
6571c78c9667
Removed some legacy theorems; minor adjustments to simplification rules; new material on homotopic paths
 paulson <lp15@cam.ac.uk> parents: 
61609diff
changeset | 4175 | by (simp add: power_divide) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4176 | have "8 * L * cmod (w - z) < e * pe\<^sup>2" | 
| 61808 | 4177 | using w \<open>L>0\<close> by (simp add: field_simps) | 
| 68339 | 4178 | also have "\<dots> < e * 4 * cmod (w - x) * cmod (w - x)" | 
| 61808 | 4179 | using pe2 \<open>e>0\<close> by (simp add: power2_eq_square) | 
| 68339 | 4180 | also have "\<dots> < e * 4 * cmod (w - x) * (4/3 * cmod (z - x))" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4181 | using wx | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4182 | apply (rule mult_strict_left_mono) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4183 | using pe2 e not_less_iff_gr_or_eq by fastforce | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4184 | finally have "L * cmod (w - z) < 2/3 * e * cmod (w - x) * cmod (z - x)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4185 | by simp | 
| 68339 | 4186 | also have "\<dots> \<le> e * cmod (w - x) * cmod (z - x)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4187 | using e by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4188 | finally have Lwz: "L * cmod (w - z) < e * cmod (w - x) * cmod (z - x)" . | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4189 | have "L * cmod (1 / (x - w) - 1 / (x - z)) \<le> e" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4190 | apply (cases "x=z \<or> x=w") | 
| 61808 | 4191 | using pe \<open>pe>0\<close> w \<open>L>0\<close> | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4192 | apply (force simp: norm_minus_commute) | 
| 61808 | 4193 | using wx w(2) \<open>L>0\<close> pe pe2 Lwz | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4194 | apply (auto simp: divide_simps mult_less_0_iff norm_minus_commute norm_divide norm_mult power2_eq_square) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4195 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4196 | } note L_cmod_le = this | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4197 | have *: "cmod (contour_integral p (\<lambda>x. 1 / (x - w) - 1 / (x - z))) \<le> L * (e * pe\<^sup>2 / L / 4 * (inverse (pe / 2))\<^sup>2)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4198 | apply (rule L) | 
| 61808 | 4199 | using \<open>pe>0\<close> w | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4200 | apply (force simp: dist_norm norm_minus_commute intro!: holomorphic_intros) | 
| 61808 | 4201 | using \<open>pe>0\<close> w \<open>L>0\<close> | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4202 | apply (auto simp: cball_def dist_norm field_simps L_cmod_le simp del: less_divide_eq_numeral1 le_divide_eq_numeral1) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4203 | done | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4204 | have "cmod (contour_integral p (\<lambda>x. 1 / (x - w)) - contour_integral p (\<lambda>x. 1 / (x - z))) < 2*e" | 
| 68339 | 4205 | apply simp | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4206 | apply (rule le_less_trans [OF *]) | 
| 61808 | 4207 | using \<open>L>0\<close> e | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4208 | apply (force simp: field_simps) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4209 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4210 | then have "cmod (winding_number p w - winding_number p z) < e" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4211 | using pi_ge_two e | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4212 | by (force simp: winding_number_valid_path p field_simps norm_divide norm_mult intro: less_le_trans) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4213 | } note cmod_wn_diff = this | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4214 | then have "isCont (winding_number p) z" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4215 | apply (simp add: continuous_at_eps_delta, clarify) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4216 | apply (rule_tac x="min (pe/4) (e/2*pe^2/L/4)" in exI) | 
| 61808 | 4217 | using \<open>pe>0\<close> \<open>L>0\<close> | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4218 | apply (simp add: dist_norm cmod_wn_diff) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4219 | done | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4220 | then show ?thesis | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4221 | apply (rule continuous_transform_within [where d = "min d e / 2"]) | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4222 | apply (auto simp: \<open>d>0\<close> \<open>e>0\<close> dist_norm wnwn) | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4223 | done | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4224 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4225 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4226 | corollary continuous_on_winding_number: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4227 | "path \<gamma> \<Longrightarrow> continuous_on (- path_image \<gamma>) (\<lambda>w. winding_number \<gamma> w)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4228 | by (simp add: continuous_at_imp_continuous_on continuous_at_winding_number) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4229 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4230 | subsection%unimportant \<open>The winding number is constant on a connected region\<close> | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4231 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4232 | lemma winding_number_constant: | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 4233 |   assumes \<gamma>: "path \<gamma>" and loop: "pathfinish \<gamma> = pathstart \<gamma>" and cs: "connected S" and sg: "S \<inter> path_image \<gamma> = {}"
 | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 4234 | shows "winding_number \<gamma> constant_on S" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4235 | proof - | 
| 65037 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4236 | have *: "1 \<le> cmod (winding_number \<gamma> y - winding_number \<gamma> z)" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 4237 | if ne: "winding_number \<gamma> y \<noteq> winding_number \<gamma> z" and "y \<in> S" "z \<in> S" for y z | 
| 65037 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4238 | proof - | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4239 | have "winding_number \<gamma> y \<in> \<int>" "winding_number \<gamma> z \<in> \<int>" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 4240 | using that integer_winding_number [OF \<gamma> loop] sg \<open>y \<in> S\<close> by auto | 
| 65037 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4241 | with ne show ?thesis | 
| 68403 | 4242 | by (auto simp: Ints_def simp flip: of_int_diff) | 
| 65037 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4243 | qed | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 4244 | have cont: "continuous_on S (\<lambda>w. winding_number \<gamma> w)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4245 | using continuous_on_winding_number [OF \<gamma>] sg | 
| 65037 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4246 | by (meson continuous_on_subset disjoint_eq_subset_Compl) | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4247 | show ?thesis | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 4248 | using "*" zero_less_one | 
| 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 4249 | by (blast intro: continuous_discrete_range_constant [OF cs cont]) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4250 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4251 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4252 | lemma winding_number_eq: | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 4253 |      "\<lbrakk>path \<gamma>; pathfinish \<gamma> = pathstart \<gamma>; w \<in> S; z \<in> S; connected S; S \<inter> path_image \<gamma> = {}\<rbrakk>
 | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4254 | \<Longrightarrow> winding_number \<gamma> w = winding_number \<gamma> z" | 
| 68493 | 4255 | using winding_number_constant by (metis constant_on_def) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4256 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4257 | lemma open_winding_number_levelsets: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4258 | assumes \<gamma>: "path \<gamma>" and loop: "pathfinish \<gamma> = pathstart \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4259 |     shows "open {z. z \<notin> path_image \<gamma> \<and> winding_number \<gamma> z = k}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4260 | proof - | 
| 67237 | 4261 | have opn: "open (- path_image \<gamma>)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4262 | by (simp add: closed_path_image \<gamma> open_Compl) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4263 |   { fix z assume z: "z \<notin> path_image \<gamma>" and k: "k = winding_number \<gamma> z"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4264 | obtain e where e: "e>0" "ball z e \<subseteq> - path_image \<gamma>" | 
| 67237 | 4265 | using open_contains_ball [of "- path_image \<gamma>"] opn z | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4266 | by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4267 | have "\<exists>e>0. \<forall>y. dist y z < e \<longrightarrow> y \<notin> path_image \<gamma> \<and> winding_number \<gamma> y = winding_number \<gamma> z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4268 | apply (rule_tac x=e in exI) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4269 | using e apply (simp add: dist_norm ball_def norm_minus_commute) | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 4270 | apply (auto simp: dist_norm norm_minus_commute intro!: winding_number_eq [OF assms, where S = "ball z e"]) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4271 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4272 | } then | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4273 | show ?thesis | 
| 62101 | 4274 | by (auto simp: open_dist) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4275 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4276 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4277 | subsection\<open>Winding number is zero "outside" a curve, in various senses\<close> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4278 | |
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66708diff
changeset | 4279 | proposition winding_number_zero_in_outside: | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4280 | assumes \<gamma>: "path \<gamma>" and loop: "pathfinish \<gamma> = pathstart \<gamma>" and z: "z \<in> outside (path_image \<gamma>)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4281 | shows "winding_number \<gamma> z = 0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4282 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4283 | obtain B::real where "0 < B" and B: "path_image \<gamma> \<subseteq> ball 0 B" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4284 | using bounded_subset_ballD [OF bounded_path_image [OF \<gamma>]] by auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4285 | obtain w::complex where w: "w \<notin> ball 0 (B + 1)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4286 | by (metis abs_of_nonneg le_less less_irrefl mem_ball_0 norm_of_real) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4287 | have "- ball 0 (B + 1) \<subseteq> outside (path_image \<gamma>)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4288 | apply (rule outside_subset_convex) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4289 | using B subset_ball by auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4290 | then have wout: "w \<in> outside (path_image \<gamma>)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4291 | using w by blast | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 4292 | moreover have "winding_number \<gamma> constant_on outside (path_image \<gamma>)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4293 | using winding_number_constant [OF \<gamma> loop, of "outside(path_image \<gamma>)"] connected_outside | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4294 | by (metis DIM_complex bounded_path_image dual_order.refl \<gamma> outside_no_overlap) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4295 | ultimately have "winding_number \<gamma> z = winding_number \<gamma> w" | 
| 66884 
c2128ab11f61
Switching to inverse image and constant_on, plus some new material
 paulson <lp15@cam.ac.uk> parents: 
66827diff
changeset | 4296 | by (metis (no_types, hide_lams) constant_on_def z) | 
| 68339 | 4297 | also have "\<dots> = 0" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4298 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4299 | have wnot: "w \<notin> path_image \<gamma>" using wout by (simp add: outside_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4300 |     { fix e::real assume "0<e"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4301 | obtain p where p: "polynomial_function p" "pathstart p = pathstart \<gamma>" "pathfinish p = pathfinish \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4302 | and pg1: "(\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> cmod (p t - \<gamma> t) < 1)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4303 | and pge: "(\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> cmod (p t - \<gamma> t) < e)" | 
| 61808 | 4304 | using path_approx_polynomial_function [OF \<gamma>, of "min 1 e"] \<open>e>0\<close> by force | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4305 | have pip: "path_image p \<subseteq> ball 0 (B + 1)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4306 | using B | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4307 | apply (clarsimp simp add: path_image_def dist_norm ball_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4308 | apply (frule (1) pg1) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4309 | apply (fastforce dest: norm_add_less) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4310 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4311 | then have "w \<notin> path_image p" using w by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4312 | then have "\<exists>p. valid_path p \<and> w \<notin> path_image p \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4313 | pathstart p = pathstart \<gamma> \<and> pathfinish p = pathfinish \<gamma> \<and> | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4314 |                      (\<forall>t\<in>{0..1}. cmod (\<gamma> t - p t) < e) \<and> contour_integral p (\<lambda>wa. 1 / (wa - w)) = 0"
 | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4315 | apply (rule_tac x=p in exI) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4316 | apply (simp add: p valid_path_polynomial_function) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4317 | apply (intro conjI) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4318 | using pge apply (simp add: norm_minus_commute) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4319 | apply (rule contour_integral_unique [OF Cauchy_theorem_convex_simple [OF _ convex_ball [of 0 "B+1"]]]) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4320 | apply (rule holomorphic_intros | simp add: dist_norm)+ | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4321 | using mem_ball_0 w apply blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4322 | using p apply (simp_all add: valid_path_polynomial_function loop pip) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4323 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4324 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4325 | then show ?thesis | 
| 68326 | 4326 | by (auto intro: winding_number_unique [OF \<gamma>] simp add: winding_number_prop_def wnot) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4327 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4328 | finally show ?thesis . | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4329 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4330 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4331 | corollary%unimportant winding_number_zero_const: "a \<noteq> z \<Longrightarrow> winding_number (\<lambda>t. a) z = 0" | 
| 66793 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66708diff
changeset | 4332 | by (rule winding_number_zero_in_outside) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66708diff
changeset | 4333 | (auto simp: pathfinish_def pathstart_def path_polynomial_function) | 
| 
deabce3ccf1f
new material about connectedness, etc.
 paulson <lp15@cam.ac.uk> parents: 
66708diff
changeset | 4334 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4335 | corollary%unimportant winding_number_zero_outside: | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4336 | "\<lbrakk>path \<gamma>; convex s; pathfinish \<gamma> = pathstart \<gamma>; z \<notin> s; path_image \<gamma> \<subseteq> s\<rbrakk> \<Longrightarrow> winding_number \<gamma> z = 0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4337 | by (meson convex_in_outside outside_mono subsetCE winding_number_zero_in_outside) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4338 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4339 | lemma winding_number_zero_at_infinity: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4340 | assumes \<gamma>: "path \<gamma>" and loop: "pathfinish \<gamma> = pathstart \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4341 | shows "\<exists>B. \<forall>z. B \<le> norm z \<longrightarrow> winding_number \<gamma> z = 0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4342 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4343 | obtain B::real where "0 < B" and B: "path_image \<gamma> \<subseteq> ball 0 B" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4344 | using bounded_subset_ballD [OF bounded_path_image [OF \<gamma>]] by auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4345 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4346 | apply (rule_tac x="B+1" in exI, clarify) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4347 | apply (rule winding_number_zero_outside [OF \<gamma> convex_cball [of 0 B] loop]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4348 | apply (meson less_add_one mem_cball_0 not_le order_trans) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4349 | using ball_subset_cball by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4350 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4351 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4352 | lemma winding_number_zero_point: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4353 | "\<lbrakk>path \<gamma>; convex s; pathfinish \<gamma> = pathstart \<gamma>; open s; path_image \<gamma> \<subseteq> s\<rbrakk> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4354 | \<Longrightarrow> \<exists>z. z \<in> s \<and> winding_number \<gamma> z = 0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4355 | using outside_compact_in_open [of "path_image \<gamma>" s] path_image_nonempty winding_number_zero_in_outside | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4356 | by (fastforce simp add: compact_path_image) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4357 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4358 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4359 | text\<open>If a path winds round a set, it winds rounds its inside.\<close> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4360 | lemma winding_number_around_inside: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4361 | assumes \<gamma>: "path \<gamma>" and loop: "pathfinish \<gamma> = pathstart \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4362 |       and cls: "closed s" and cos: "connected s" and s_disj: "s \<inter> path_image \<gamma> = {}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4363 | and z: "z \<in> s" and wn_nz: "winding_number \<gamma> z \<noteq> 0" and w: "w \<in> s \<union> inside s" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4364 | shows "winding_number \<gamma> w = winding_number \<gamma> z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4365 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4366 | have ssb: "s \<subseteq> inside(path_image \<gamma>)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4367 | proof | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4368 | fix x :: complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4369 | assume "x \<in> s" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4370 | hence "x \<notin> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4371 | by (meson disjoint_iff_not_equal s_disj) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4372 | thus "x \<in> inside (path_image \<gamma>)" | 
| 61808 | 4373 | using \<open>x \<in> s\<close> by (metis (no_types) ComplI UnE cos \<gamma> loop s_disj union_with_outside winding_number_eq winding_number_zero_in_outside wn_nz z) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4374 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4375 | show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4376 | apply (rule winding_number_eq [OF \<gamma> loop w]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4377 | using z apply blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4378 | apply (simp add: cls connected_with_inside cos) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4379 | apply (simp add: Int_Un_distrib2 s_disj, safe) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4380 | by (meson ssb inside_inside_compact_connected [OF cls, of "path_image \<gamma>"] compact_path_image connected_path_image contra_subsetD disjoint_iff_not_equal \<gamma> inside_no_overlap) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4381 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4382 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4383 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4384 | text\<open>Bounding a WN by 1/2 for a path and point in opposite halfspaces.\<close> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4385 | lemma winding_number_subpath_continuous: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4386 | assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4387 |     shows "continuous_on {0..1} (\<lambda>x. winding_number(subpath 0 x \<gamma>) z)"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4388 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4389 |   have *: "integral {0..x} (\<lambda>t. vector_derivative \<gamma> (at t) / (\<gamma> t - z)) / (2 * of_real pi * \<i>) =
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4390 | winding_number (subpath 0 x \<gamma>) z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4391 | if x: "0 \<le> x" "x \<le> 1" for x | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4392 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4393 |     have "integral {0..x} (\<lambda>t. vector_derivative \<gamma> (at t) / (\<gamma> t - z)) / (2 * of_real pi * \<i>) =
 | 
| 63589 | 4394 | 1 / (2*pi*\<i>) * contour_integral (subpath 0 x \<gamma>) (\<lambda>w. 1/(w - z))" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4395 | using assms x | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4396 | apply (simp add: contour_integral_subcontour_integral [OF contour_integrable_inversediff]) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4397 | done | 
| 68339 | 4398 | also have "\<dots> = winding_number (subpath 0 x \<gamma>) z" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4399 | apply (subst winding_number_valid_path) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4400 | using assms x | 
| 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: 
61738diff
changeset | 4401 | apply (simp_all add: path_image_subpath valid_path_subpath) | 
| 
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: 
61738diff
changeset | 4402 | by (force simp: path_image_def) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4403 | finally show ?thesis . | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4404 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4405 | show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4406 | apply (rule continuous_on_eq | 
| 63589 | 4407 | [where f = "\<lambda>x. 1 / (2*pi*\<i>) * | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4408 |                                  integral {0..x} (\<lambda>t. 1/(\<gamma> t - z) * vector_derivative \<gamma> (at t))"])
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4409 | apply (rule continuous_intros)+ | 
| 66192 
e5b84854baa4
A few renamings and several tidied-up proofs
 paulson <lp15@cam.ac.uk> parents: 
66164diff
changeset | 4410 | apply (rule indefinite_integral_continuous_1) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4411 | apply (rule contour_integrable_inversediff [OF assms, unfolded contour_integrable_on]) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4412 | using assms | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4413 | apply (simp add: *) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4414 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4415 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4416 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4417 | lemma winding_number_ivt_pos: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4418 | assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" and "0 \<le> w" "w \<le> Re(winding_number \<gamma> z)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4419 |       shows "\<exists>t \<in> {0..1}. Re(winding_number(subpath 0 t \<gamma>) z) = w"
 | 
| 68339 | 4420 | apply (rule ivt_increasing_component_on_1 [of 0 1, where ?k = "1::complex", simplified complex_inner_1_right], simp) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4421 | apply (rule winding_number_subpath_continuous [OF \<gamma> z]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4422 | using assms | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4423 | apply (auto simp: path_image_def image_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4424 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4425 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4426 | lemma winding_number_ivt_neg: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4427 | assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" and "Re(winding_number \<gamma> z) \<le> w" "w \<le> 0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4428 |       shows "\<exists>t \<in> {0..1}. Re(winding_number(subpath 0 t \<gamma>) z) = w"
 | 
| 68339 | 4429 | apply (rule ivt_decreasing_component_on_1 [of 0 1, where ?k = "1::complex", simplified complex_inner_1_right], simp) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4430 | apply (rule winding_number_subpath_continuous [OF \<gamma> z]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4431 | using assms | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4432 | apply (auto simp: path_image_def image_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4433 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4434 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4435 | lemma winding_number_ivt_abs: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4436 | assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" and "0 \<le> w" "w \<le> \<bar>Re(winding_number \<gamma> z)\<bar>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4437 |       shows "\<exists>t \<in> {0..1}. \<bar>Re (winding_number (subpath 0 t \<gamma>) z)\<bar> = w"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4438 | using assms winding_number_ivt_pos [of \<gamma> z w] winding_number_ivt_neg [of \<gamma> z "-w"] | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4439 | by force | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4440 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4441 | lemma winding_number_lt_half_lemma: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4442 |   assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" and az: "a \<bullet> z \<le> b" and pag: "path_image \<gamma> \<subseteq> {w. a \<bullet> w > b}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4443 | shows "Re(winding_number \<gamma> z) < 1/2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4444 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4445 |   { assume "Re(winding_number \<gamma> z) \<ge> 1/2"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4446 | then obtain t::real where t: "0 \<le> t" "t \<le> 1" and sub12: "Re (winding_number (subpath 0 t \<gamma>) z) = 1/2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4447 | using winding_number_ivt_pos [OF \<gamma> z, of "1/2"] by auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4448 | have gt: "\<gamma> t - z = - (of_real (exp (- (2 * pi * Im (winding_number (subpath 0 t \<gamma>) z)))) * (\<gamma> 0 - z))" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4449 | using winding_number_exp_2pi [of "subpath 0 t \<gamma>" z] | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4450 | apply (simp add: t \<gamma> valid_path_imp_path) | 
| 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: 
61738diff
changeset | 4451 | using closed_segment_eq_real_ivl path_image_def t z by (fastforce simp: path_image_subpath Euler sub12) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4452 | have "b < a \<bullet> \<gamma> 0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4453 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4454 |       have "\<gamma> 0 \<in> {c. b < a \<bullet> c}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4455 | by (metis (no_types) pag atLeastAtMost_iff image_subset_iff order_refl path_image_def zero_le_one) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4456 | thus ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4457 | by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4458 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4459 | moreover have "b < a \<bullet> \<gamma> t" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4460 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4461 |       have "\<gamma> t \<in> {c. b < a \<bullet> c}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4462 | by (metis (no_types) pag atLeastAtMost_iff image_subset_iff path_image_def t) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4463 | thus ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4464 | by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4465 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4466 | ultimately have "0 < a \<bullet> (\<gamma> 0 - z)" "0 < a \<bullet> (\<gamma> t - z)" using az | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4467 | by (simp add: inner_diff_right)+ | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4468 | then have False | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4469 | by (simp add: gt inner_mult_right mult_less_0_iff) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4470 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4471 | then show ?thesis by force | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4472 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4473 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4474 | lemma winding_number_lt_half: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4475 |   assumes "valid_path \<gamma>" "a \<bullet> z \<le> b" "path_image \<gamma> \<subseteq> {w. a \<bullet> w > b}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4476 | shows "\<bar>Re (winding_number \<gamma> z)\<bar> < 1/2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4477 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4478 | have "z \<notin> path_image \<gamma>" using assms by auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4479 | with assms show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4480 | apply (simp add: winding_number_lt_half_lemma abs_if del: less_divide_eq_numeral1) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4481 | apply (metis complex_inner_1_right winding_number_lt_half_lemma [OF valid_path_imp_reverse, of \<gamma> z a b] | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4482 | winding_number_reversepath valid_path_imp_path inner_minus_left path_image_reversepath) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4483 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4484 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4485 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4486 | lemma winding_number_le_half: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4487 | assumes \<gamma>: "valid_path \<gamma>" and z: "z \<notin> path_image \<gamma>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4488 |       and anz: "a \<noteq> 0" and azb: "a \<bullet> z \<le> b" and pag: "path_image \<gamma> \<subseteq> {w. a \<bullet> w \<ge> b}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4489 | shows "\<bar>Re (winding_number \<gamma> z)\<bar> \<le> 1/2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4490 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4491 |   { assume wnz_12: "\<bar>Re (winding_number \<gamma> z)\<bar> > 1/2"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4492 | have "isCont (winding_number \<gamma>) z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4493 | by (metis continuous_at_winding_number valid_path_imp_path \<gamma> z) | 
| 61945 | 4494 | then obtain d where "d>0" and d: "\<And>x'. dist x' z < d \<Longrightarrow> dist (winding_number \<gamma> x') (winding_number \<gamma> z) < \<bar>Re(winding_number \<gamma> z)\<bar> - 1/2" | 
| 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: 
61738diff
changeset | 4495 | using continuous_at_eps_delta wnz_12 diff_gt_0_iff_gt by blast | 
| 63040 | 4496 | define z' where "z' = z - (d / (2 * cmod a)) *\<^sub>R a" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4497 | have *: "a \<bullet> z' \<le> b - d / 3 * cmod a" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4498 | unfolding z'_def inner_mult_right' divide_inverse | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4499 | apply (simp add: divide_simps algebra_simps dot_square_norm power2_eq_square anz) | 
| 61808 | 4500 | apply (metis \<open>0 < d\<close> add_increasing azb less_eq_real_def mult_nonneg_nonneg mult_right_mono norm_ge_zero norm_numeral) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4501 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4502 | have "cmod (winding_number \<gamma> z' - winding_number \<gamma> z) < \<bar>Re (winding_number \<gamma> z)\<bar> - 1/2" | 
| 61808 | 4503 | using d [of z'] anz \<open>d>0\<close> by (simp add: dist_norm z'_def) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4504 | then have "1/2 < \<bar>Re (winding_number \<gamma> z)\<bar> - cmod (winding_number \<gamma> z' - winding_number \<gamma> z)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4505 | by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4506 | then have "1/2 < \<bar>Re (winding_number \<gamma> z)\<bar> - \<bar>Re (winding_number \<gamma> z') - Re (winding_number \<gamma> z)\<bar>" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4507 | using abs_Re_le_cmod [of "winding_number \<gamma> z' - winding_number \<gamma> z"] by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4508 | then have wnz_12': "\<bar>Re (winding_number \<gamma> z')\<bar> > 1/2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4509 | by linarith | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4510 | moreover have "\<bar>Re (winding_number \<gamma> z')\<bar> < 1/2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4511 | apply (rule winding_number_lt_half [OF \<gamma> *]) | 
| 61808 | 4512 | using azb \<open>d>0\<close> pag | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4513 | apply (auto simp: add_strict_increasing anz divide_simps algebra_simps dest!: subsetD) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4514 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4515 | ultimately have False | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4516 | by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4517 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4518 | then show ?thesis by force | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4519 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4520 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4521 | lemma winding_number_lt_half_linepath: "z \<notin> closed_segment a b \<Longrightarrow> \<bar>Re (winding_number (linepath a b) z)\<bar> < 1/2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4522 | using separating_hyperplane_closed_point [of "closed_segment a b" z] | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4523 | apply auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4524 | apply (simp add: closed_segment_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4525 | apply (drule less_imp_le) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4526 | apply (frule winding_number_lt_half [OF valid_path_linepath [of a b]]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4527 | apply (auto simp: segment) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4528 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4529 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4530 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4531 | text\<open> Positivity of WN for a linepath.\<close> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4532 | lemma winding_number_linepath_pos_lt: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4533 | assumes "0 < Im ((b - a) * cnj (b - z))" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4534 | shows "0 < Re(winding_number(linepath a b) z)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4535 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4536 | have z: "z \<notin> path_image (linepath a b)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4537 | using assms | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4538 | by (simp add: closed_segment_def) (force simp: algebra_simps) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4539 | show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4540 | apply (rule winding_number_pos_lt [OF valid_path_linepath z assms]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4541 | apply (simp add: linepath_def algebra_simps) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4542 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4543 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4544 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4545 | |
| 67968 | 4546 | subsection\<open>Cauchy's integral formula, again for a convex enclosing set\<close> | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4547 | |
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61520diff
changeset | 4548 | lemma Cauchy_integral_formula_weak: | 
| 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61520diff
changeset | 4549 | assumes s: "convex s" and "finite k" and conf: "continuous_on s f" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 4550 | and fcd: "(\<And>x. x \<in> interior s - k \<Longrightarrow> f field_differentiable at x)" | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61520diff
changeset | 4551 | and z: "z \<in> interior s - k" and vpg: "valid_path \<gamma>" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4552 |         and pasz: "path_image \<gamma> \<subseteq> s - {z}" and loop: "pathfinish \<gamma> = pathstart \<gamma>"
 | 
| 63589 | 4553 | shows "((\<lambda>w. f w / (w - z)) has_contour_integral (2*pi * \<i> * winding_number \<gamma> z * f z)) \<gamma>" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4554 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4555 | obtain f' where f': "(f has_field_derivative f') (at z)" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 4556 | using fcd [OF z] by (auto simp: field_differentiable_def) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4557 | have pas: "path_image \<gamma> \<subseteq> s" and znotin: "z \<notin> path_image \<gamma>" using pasz by blast+ | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4558 | have c: "continuous (at x within s) (\<lambda>w. if w = z then f' else (f w - f z) / (w - z))" if "x \<in> s" for x | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4559 | proof (cases "x = z") | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4560 | case True then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4561 | apply (simp add: continuous_within) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4562 | apply (rule Lim_transform_away_within [of _ "z+1" _ "\<lambda>w::complex. (f w - f z)/(w - z)"]) | 
| 68239 | 4563 | using has_field_derivative_at_within has_field_derivative_iff f' | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4564 | apply (fastforce simp add:)+ | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4565 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4566 | next | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4567 | case False | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4568 | then have dxz: "dist x z > 0" by auto | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4569 | have cf: "continuous (at x within s) f" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4570 | using conf continuous_on_eq_continuous_within that by blast | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4571 | have "continuous (at x within s) (\<lambda>w. (f w - f z) / (w - z))" | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4572 | by (rule cf continuous_intros | simp add: False)+ | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4573 | then show ?thesis | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4574 | apply (rule continuous_transform_within [OF _ dxz that, of "\<lambda>w::complex. (f w - f z)/(w - z)"]) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4575 | apply (force simp: dist_commute) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4576 | done | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4577 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4578 | have fink': "finite (insert z k)" using \<open>finite k\<close> by blast | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4579 | have *: "((\<lambda>w. if w = z then f' else (f w - f z) / (w - z)) has_contour_integral 0) \<gamma>" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4580 | apply (rule Cauchy_theorem_convex [OF _ s fink' _ vpg pas loop]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4581 | using c apply (force simp: continuous_on_eq_continuous_within) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4582 | apply (rename_tac w) | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 4583 | apply (rule_tac d="dist w z" and f = "\<lambda>w. (f w - f z)/(w - z)" in field_differentiable_transform_within) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4584 | apply (simp_all add: dist_pos_lt dist_commute) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4585 | apply (metis less_irrefl) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4586 | apply (rule derivative_intros fcd | simp)+ | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4587 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4588 | show ?thesis | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4589 | apply (rule has_contour_integral_eq) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4590 | using znotin has_contour_integral_add [OF has_contour_integral_lmul [OF has_contour_integral_winding_number [OF vpg znotin], of "f z"] *] | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4591 | apply (auto simp: mult_ac divide_simps) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4592 | done | 
| 61609 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61520diff
changeset | 4593 | qed | 
| 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61520diff
changeset | 4594 | |
| 
77b453bd616f
Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
 paulson <lp15@cam.ac.uk> parents: 
61520diff
changeset | 4595 | theorem Cauchy_integral_formula_convex_simple: | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4596 |     "\<lbrakk>convex s; f holomorphic_on s; z \<in> interior s; valid_path \<gamma>; path_image \<gamma> \<subseteq> s - {z};
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4597 | pathfinish \<gamma> = pathstart \<gamma>\<rbrakk> | 
| 63589 | 4598 | \<Longrightarrow> ((\<lambda>w. f w / (w - z)) has_contour_integral (2*pi * \<i> * winding_number \<gamma> z * f z)) \<gamma>" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4599 |   apply (rule Cauchy_integral_formula_weak [where k = "{}"])
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4600 | using holomorphic_on_imp_continuous_on | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4601 | by auto (metis at_within_interior holomorphic_on_def interiorE subsetCE) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4602 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4603 | subsection\<open>Homotopy forms of Cauchy's theorem\<close> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4604 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4605 | lemma Cauchy_theorem_homotopic: | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4606 | assumes hom: "if atends then homotopic_paths s g h else homotopic_loops s g h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4607 | and "open s" and f: "f holomorphic_on s" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4608 | and vpg: "valid_path g" and vph: "valid_path h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4609 | shows "contour_integral g f = contour_integral h f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4610 | proof - | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4611 | have pathsf: "linked_paths atends g h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4612 | using hom by (auto simp: linked_paths_def homotopic_paths_imp_pathstart homotopic_paths_imp_pathfinish homotopic_loops_imp_loop) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4613 | obtain k :: "real \<times> real \<Rightarrow> complex" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4614 |     where contk: "continuous_on ({0..1} \<times> {0..1}) k"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4615 |       and ks: "k ` ({0..1} \<times> {0..1}) \<subseteq> s"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4616 | and k [simp]: "\<forall>x. k (0, x) = g x" "\<forall>x. k (1, x) = h x" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4617 |       and ksf: "\<forall>t\<in>{0..1}. linked_paths atends g (\<lambda>x. k (t, x))"
 | 
| 62390 | 4618 | using hom pathsf by (auto simp: linked_paths_def homotopic_paths_def homotopic_loops_def homotopic_with_def split: if_split_asm) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4619 |   have ucontk: "uniformly_continuous_on ({0..1} \<times> {0..1}) k"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4620 | by (blast intro: compact_Times compact_uniformly_continuous [OF contk]) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4621 |   { fix t::real assume t: "t \<in> {0..1}"
 | 
| 68339 | 4622 | have pak: "path (k \<circ> (\<lambda>u. (t, u)))" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4623 | unfolding path_def | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4624 | apply (rule continuous_intros continuous_on_subset [OF contk])+ | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4625 | using t by force | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4626 | have pik: "path_image (k \<circ> Pair t) \<subseteq> s" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4627 | using ks t by (auto simp: path_image_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4628 | obtain e where "e>0" and e: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4629 | "\<And>g h. \<lbrakk>valid_path g; valid_path h; | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4630 |                   \<forall>u\<in>{0..1}. cmod (g u - (k \<circ> Pair t) u) < e \<and> cmod (h u - (k \<circ> Pair t) u) < e;
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4631 | linked_paths atends g h\<rbrakk> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4632 | \<Longrightarrow> contour_integral h f = contour_integral g f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4633 | using contour_integral_nearby [OF \<open>open s\<close> pak pik, of atends] f by metis | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4634 | obtain d where "d>0" and d: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4635 |         "\<And>x x'. \<lbrakk>x \<in> {0..1} \<times> {0..1}; x' \<in> {0..1} \<times> {0..1}; norm (x'-x) < d\<rbrakk> \<Longrightarrow> norm (k x' - k x) < e/4"
 | 
| 61808 | 4636 | by (rule uniformly_continuous_onE [OF ucontk, of "e/4"]) (auto simp: dist_norm \<open>e>0\<close>) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4637 |     { fix t1 t2
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4638 | assume t1: "0 \<le> t1" "t1 \<le> 1" and t2: "0 \<le> t2" "t2 \<le> 1" and ltd: "\<bar>t1 - t\<bar> < d" "\<bar>t2 - t\<bar> < d" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4639 | have no2: "\<And>g1 k1 kt. \<lbrakk>norm(g1 - k1) < e/4; norm(k1 - kt) < e/4\<rbrakk> \<Longrightarrow> norm(g1 - kt) < e" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4640 | using \<open>e > 0\<close> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4641 | apply (rule_tac y = k1 in norm_triangle_half_l) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4642 | apply (auto simp: norm_minus_commute intro: order_less_trans) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4643 | done | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4644 | have "\<exists>d>0. \<forall>g1 g2. valid_path g1 \<and> valid_path g2 \<and> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4645 |                           (\<forall>u\<in>{0..1}. cmod (g1 u - k (t1, u)) < d \<and> cmod (g2 u - k (t2, u)) < d) \<and>
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4646 | linked_paths atends g1 g2 \<longrightarrow> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4647 | contour_integral g2 f = contour_integral g1 f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4648 | apply (rule_tac x="e/4" in exI) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4649 | using t t1 t2 ltd \<open>e > 0\<close> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4650 | apply (auto intro!: e simp: d no2 simp del: less_divide_eq_numeral1) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4651 | done | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4652 | } | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4653 | then have "\<exists>e. 0 < e \<and> | 
| 61945 | 4654 |               (\<forall>t1 t2. t1 \<in> {0..1} \<and> t2 \<in> {0..1} \<and> \<bar>t1 - t\<bar> < e \<and> \<bar>t2 - t\<bar> < e
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4655 | \<longrightarrow> (\<exists>d. 0 < d \<and> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4656 | (\<forall>g1 g2. valid_path g1 \<and> valid_path g2 \<and> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4657 |                        (\<forall>u \<in> {0..1}.
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4658 | norm(g1 u - k((t1,u))) < d \<and> norm(g2 u - k((t2,u))) < d) \<and> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4659 | linked_paths atends g1 g2 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4660 | \<longrightarrow> contour_integral g2 f = contour_integral g1 f)))" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4661 | by (rule_tac x=d in exI) (simp add: \<open>d > 0\<close>) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4662 | } | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4663 | then obtain ee where ee: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4664 |        "\<And>t. t \<in> {0..1} \<Longrightarrow> ee t > 0 \<and>
 | 
| 61945 | 4665 |           (\<forall>t1 t2. t1 \<in> {0..1} \<longrightarrow> t2 \<in> {0..1} \<longrightarrow> \<bar>t1 - t\<bar> < ee t \<longrightarrow> \<bar>t2 - t\<bar> < ee t
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4666 | \<longrightarrow> (\<exists>d. 0 < d \<and> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4667 | (\<forall>g1 g2. valid_path g1 \<and> valid_path g2 \<and> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4668 |                    (\<forall>u \<in> {0..1}.
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4669 | norm(g1 u - k((t1,u))) < d \<and> norm(g2 u - k((t2,u))) < d) \<and> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4670 | linked_paths atends g1 g2 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4671 | \<longrightarrow> contour_integral g2 f = contour_integral g1 f)))" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4672 | by metis | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4673 | note ee_rule = ee [THEN conjunct2, rule_format] | 
| 63040 | 4674 |   define C where "C = (\<lambda>t. ball t (ee t / 3)) ` {0..1}"
 | 
| 64758 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 paulson <lp15@cam.ac.uk> parents: 
64394diff
changeset | 4675 |   obtain C' where C': "C' \<subseteq> C" "finite C'" and C'01: "{0..1} \<subseteq> \<Union>C'"
 | 
| 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 paulson <lp15@cam.ac.uk> parents: 
64394diff
changeset | 4676 | proof (rule compactE [OF compact_interval]) | 
| 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 paulson <lp15@cam.ac.uk> parents: 
64394diff
changeset | 4677 |     show "{0..1} \<subseteq> \<Union>C"
 | 
| 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 paulson <lp15@cam.ac.uk> parents: 
64394diff
changeset | 4678 | using ee [THEN conjunct1] by (auto simp: C_def dist_norm) | 
| 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 paulson <lp15@cam.ac.uk> parents: 
64394diff
changeset | 4679 | qed (use C_def in auto) | 
| 63040 | 4680 |   define kk where "kk = {t \<in> {0..1}. ball t (ee t / 3) \<in> C'}"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4681 |   have kk01: "kk \<subseteq> {0..1}" by (auto simp: kk_def)
 | 
| 63040 | 4682 | define e where "e = Min (ee ` kk)" | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4683 | have C'_eq: "C' = (\<lambda>t. ball t (ee t / 3)) ` kk" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4684 | using C' by (auto simp: kk_def C_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4685 |   have ee_pos[simp]: "\<And>t. t \<in> {0..1} \<Longrightarrow> ee t > 0"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4686 | by (simp add: kk_def ee) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4687 | moreover have "finite kk" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4688 | using \<open>finite C'\<close> kk01 by (force simp: C'_eq inj_on_def ball_eq_ball_iff dest: ee_pos finite_imageD) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4689 |   moreover have "kk \<noteq> {}" using \<open>{0..1} \<subseteq> \<Union>C'\<close> C'_eq by force
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4690 | ultimately have "e > 0" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4691 | using finite_less_Inf_iff [of "ee ` kk" 0] kk01 by (force simp: e_def) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4692 | then obtain N::nat where "N > 0" and N: "1/N < e/3" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4693 | by (meson divide_pos_pos nat_approx_posE zero_less_Suc zero_less_numeral) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4694 | have e_le_ee: "\<And>i. i \<in> kk \<Longrightarrow> e \<le> ee i" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4695 | using \<open>finite kk\<close> by (simp add: e_def Min_le_iff [of "ee ` kk"]) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4696 |   have plus: "\<exists>t \<in> kk. x \<in> ball t (ee t / 3)" if "x \<in> {0..1}" for x
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4697 | using C' subsetD [OF C'01 that] unfolding C'_eq by blast | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4698 | have [OF order_refl]: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4699 |       "\<exists>d. 0 < d \<and> (\<forall>j. valid_path j \<and> (\<forall>u \<in> {0..1}. norm(j u - k (n/N, u)) < d) \<and> linked_paths atends g j
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4700 | \<longrightarrow> contour_integral j f = contour_integral g f)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4701 | if "n \<le> N" for n | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4702 | using that | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4703 | proof (induct n) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4704 | case 0 show ?case using ee_rule [of 0 0 0] | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4705 | apply clarsimp | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4706 | apply (rule_tac x=d in exI, safe) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4707 | by (metis diff_self vpg norm_zero) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4708 | next | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4709 | case (Suc n) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4710 |     then have N01: "n/N \<in> {0..1}" "(Suc n)/N \<in> {0..1}"  by auto
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4711 | then obtain t where t: "t \<in> kk" "n/N \<in> ball t (ee t / 3)" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4712 | using plus [of "n/N"] by blast | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4713 | then have nN_less: "\<bar>n/N - t\<bar> < ee t" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4714 | by (simp add: dist_norm del: less_divide_eq_numeral1) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4715 | have n'N_less: "\<bar>real (Suc n) / real N - t\<bar> < ee t" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4716 | using t N \<open>N > 0\<close> e_le_ee [of t] | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4717 | by (simp add: dist_norm add_divide_distrib abs_diff_less_iff del: less_divide_eq_numeral1) (simp add: field_simps) | 
| 61808 | 4718 |     have t01: "t \<in> {0..1}" using \<open>kk \<subseteq> {0..1}\<close> \<open>t \<in> kk\<close> by blast
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4719 | obtain d1 where "d1 > 0" and d1: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4720 | "\<And>g1 g2. \<lbrakk>valid_path g1; valid_path g2; | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4721 |                    \<forall>u\<in>{0..1}. cmod (g1 u - k (n/N, u)) < d1 \<and> cmod (g2 u - k ((Suc n) / N, u)) < d1;
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4722 | linked_paths atends g1 g2\<rbrakk> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4723 | \<Longrightarrow> contour_integral g2 f = contour_integral g1 f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4724 | using ee [THEN conjunct2, rule_format, OF t01 N01 nN_less n'N_less] by fastforce | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4725 | have "n \<le> N" using Suc.prems by auto | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4726 | with Suc.hyps | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4727 | obtain d2 where "d2 > 0" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4728 |       and d2: "\<And>j. \<lbrakk>valid_path j; \<forall>u\<in>{0..1}. cmod (j u - k (n/N, u)) < d2; linked_paths atends g j\<rbrakk>
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4729 | \<Longrightarrow> contour_integral j f = contour_integral g f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4730 | by auto | 
| 68339 | 4731 |     have "continuous_on {0..1} (k \<circ> (\<lambda>u. (n/N, u)))"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4732 | apply (rule continuous_intros continuous_on_subset [OF contk])+ | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4733 | using N01 by auto | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4734 | then have pkn: "path (\<lambda>u. k (n/N, u))" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4735 | by (simp add: path_def) | 
| 61808 | 4736 | have min12: "min d1 d2 > 0" by (simp add: \<open>0 < d1\<close> \<open>0 < d2\<close>) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4737 | obtain p where "polynomial_function p" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4738 | and psf: "pathstart p = pathstart (\<lambda>u. k (n/N, u))" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4739 | "pathfinish p = pathfinish (\<lambda>u. k (n/N, u))" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4740 |         and pk_le:  "\<And>t. t\<in>{0..1} \<Longrightarrow> cmod (p t - k (n/N, t)) < min d1 d2"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4741 | using path_approx_polynomial_function [OF pkn min12] by blast | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4742 | then have vpp: "valid_path p" using valid_path_polynomial_function by blast | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4743 | have lpa: "linked_paths atends g p" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4744 | by (metis (mono_tags, lifting) N01(1) ksf linked_paths_def pathfinish_def pathstart_def psf) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4745 | show ?case | 
| 68359 | 4746 | proof (intro exI; safe) | 
| 4747 | fix j | |
| 4748 | assume "valid_path j" "linked_paths atends g j" | |
| 4749 |         and "\<forall>u\<in>{0..1}. cmod (j u - k (real (Suc n) / real N, u)) < min d1 d2"
 | |
| 4750 | then have "contour_integral j f = contour_integral p f" | |
| 4751 | using pk_le N01(1) ksf by (force intro!: vpp d1 simp add: linked_paths_def psf) | |
| 4752 | also have "... = contour_integral g f" | |
| 4753 | using pk_le by (force intro!: vpp d2 lpa) | |
| 4754 | finally show "contour_integral j f = contour_integral g f" . | |
| 4755 | qed (simp add: \<open>0 < d1\<close> \<open>0 < d2\<close>) | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4756 | qed | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4757 | then obtain d where "0 < d" | 
| 68359 | 4758 |                        "\<And>j. valid_path j \<and> (\<forall>u \<in> {0..1}. norm(j u - k (1,u)) < d) \<and> linked_paths atends g j
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4759 | \<Longrightarrow> contour_integral j f = contour_integral g f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4760 | using \<open>N>0\<close> by auto | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4761 | then have "linked_paths atends g h \<Longrightarrow> contour_integral h f = contour_integral g f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4762 | using \<open>N>0\<close> vph by fastforce | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4763 | then show ?thesis | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4764 | by (simp add: pathsf) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4765 | qed | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4766 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4767 | proposition Cauchy_theorem_homotopic_paths: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4768 | assumes hom: "homotopic_paths s g h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4769 | and "open s" and f: "f holomorphic_on s" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4770 | and vpg: "valid_path g" and vph: "valid_path h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4771 | shows "contour_integral g f = contour_integral h f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4772 | using Cauchy_theorem_homotopic [of True s g h] assms by simp | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4773 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4774 | proposition Cauchy_theorem_homotopic_loops: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4775 | assumes hom: "homotopic_loops s g h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4776 | and "open s" and f: "f holomorphic_on s" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4777 | and vpg: "valid_path g" and vph: "valid_path h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4778 | shows "contour_integral g f = contour_integral h f" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4779 | using Cauchy_theorem_homotopic [of False s g h] assms by simp | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4780 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4781 | lemma has_contour_integral_newpath: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4782 | "\<lbrakk>(f has_contour_integral y) h; f contour_integrable_on g; contour_integral g f = contour_integral h f\<rbrakk> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4783 | \<Longrightarrow> (f has_contour_integral y) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4784 | using has_contour_integral_integral contour_integral_unique by auto | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4785 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4786 | lemma Cauchy_theorem_null_homotopic: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4787 | "\<lbrakk>f holomorphic_on s; open s; valid_path g; homotopic_loops s g (linepath a a)\<rbrakk> \<Longrightarrow> (f has_contour_integral 0) g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4788 | apply (rule has_contour_integral_newpath [where h = "linepath a a"], simp) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4789 | using contour_integrable_holomorphic_simple | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4790 | apply (blast dest: holomorphic_on_imp_continuous_on homotopic_loops_imp_subset) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4791 | by (simp add: Cauchy_theorem_homotopic_loops) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4792 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4793 | subsection%unimportant \<open>More winding number properties\<close> | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4794 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4795 | text\<open>including the fact that it's +-1 inside a simple closed curve.\<close> | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4796 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4797 | lemma winding_number_homotopic_paths: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4798 |     assumes "homotopic_paths (-{z}) g h"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4799 | shows "winding_number g z = winding_number h z" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4800 | proof - | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4801 | have "path g" "path h" using homotopic_paths_imp_path [OF assms] by auto | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4802 | moreover have pag: "z \<notin> path_image g" and pah: "z \<notin> path_image h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4803 | using homotopic_paths_imp_subset [OF assms] by auto | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4804 | ultimately obtain d e where "d > 0" "e > 0" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4805 |       and d: "\<And>p. \<lbrakk>path p; pathstart p = pathstart g; pathfinish p = pathfinish g; \<forall>t\<in>{0..1}. norm (p t - g t) < d\<rbrakk>
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4806 |             \<Longrightarrow> homotopic_paths (-{z}) g p"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4807 |       and e: "\<And>q. \<lbrakk>path q; pathstart q = pathstart h; pathfinish q = pathfinish h; \<forall>t\<in>{0..1}. norm (q t - h t) < e\<rbrakk>
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4808 |             \<Longrightarrow> homotopic_paths (-{z}) h q"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4809 |     using homotopic_nearby_paths [of g "-{z}"] homotopic_nearby_paths [of h "-{z}"] by force
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4810 | obtain p where p: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4811 | "valid_path p" "z \<notin> path_image p" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4812 | "pathstart p = pathstart g" "pathfinish p = pathfinish g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4813 |        and gp_less:"\<forall>t\<in>{0..1}. cmod (g t - p t) < d"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4814 | and pap: "contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * winding_number g z" | 
| 68326 | 4815 | using winding_number [OF \<open>path g\<close> pag \<open>0 < d\<close>] unfolding winding_number_prop_def by blast | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4816 | obtain q where q: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4817 | "valid_path q" "z \<notin> path_image q" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4818 | "pathstart q = pathstart h" "pathfinish q = pathfinish h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4819 |        and hq_less: "\<forall>t\<in>{0..1}. cmod (h t - q t) < e"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4820 | and paq: "contour_integral q (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * winding_number h z" | 
| 68326 | 4821 | using winding_number [OF \<open>path h\<close> pah \<open>0 < e\<close>] unfolding winding_number_prop_def by blast | 
| 68359 | 4822 |   have "homotopic_paths (- {z}) g p"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4823 | by (simp add: d p valid_path_imp_path norm_minus_commute gp_less) | 
| 68359 | 4824 |   moreover have "homotopic_paths (- {z}) h q"
 | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4825 | by (simp add: e q valid_path_imp_path norm_minus_commute hq_less) | 
| 68359 | 4826 |   ultimately have "homotopic_paths (- {z}) p q"
 | 
| 4827 | by (blast intro: homotopic_paths_trans homotopic_paths_sym assms) | |
| 4828 | then have "contour_integral p (\<lambda>w. 1/(w - z)) = contour_integral q (\<lambda>w. 1/(w - z))" | |
| 4829 | by (rule Cauchy_theorem_homotopic_paths) (auto intro!: holomorphic_intros simp: p q) | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4830 | then show ?thesis | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4831 | by (simp add: pap paq) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4832 | qed | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4833 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4834 | lemma winding_number_homotopic_loops: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4835 |     assumes "homotopic_loops (-{z}) g h"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4836 | shows "winding_number g z = winding_number h z" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4837 | proof - | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4838 | have "path g" "path h" using homotopic_loops_imp_path [OF assms] by auto | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4839 | moreover have pag: "z \<notin> path_image g" and pah: "z \<notin> path_image h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4840 | using homotopic_loops_imp_subset [OF assms] by auto | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4841 | moreover have gloop: "pathfinish g = pathstart g" and hloop: "pathfinish h = pathstart h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4842 | using homotopic_loops_imp_loop [OF assms] by auto | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4843 | ultimately obtain d e where "d > 0" "e > 0" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4844 |       and d: "\<And>p. \<lbrakk>path p; pathfinish p = pathstart p; \<forall>t\<in>{0..1}. norm (p t - g t) < d\<rbrakk>
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4845 |             \<Longrightarrow> homotopic_loops (-{z}) g p"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4846 |       and e: "\<And>q. \<lbrakk>path q; pathfinish q = pathstart q; \<forall>t\<in>{0..1}. norm (q t - h t) < e\<rbrakk>
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4847 |             \<Longrightarrow> homotopic_loops (-{z}) h q"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4848 |     using homotopic_nearby_loops [of g "-{z}"] homotopic_nearby_loops [of h "-{z}"] by force
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4849 | obtain p where p: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4850 | "valid_path p" "z \<notin> path_image p" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4851 | "pathstart p = pathstart g" "pathfinish p = pathfinish g" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4852 |        and gp_less:"\<forall>t\<in>{0..1}. cmod (g t - p t) < d"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4853 | and pap: "contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * winding_number g z" | 
| 68326 | 4854 | using winding_number [OF \<open>path g\<close> pag \<open>0 < d\<close>] unfolding winding_number_prop_def by blast | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4855 | obtain q where q: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4856 | "valid_path q" "z \<notin> path_image q" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4857 | "pathstart q = pathstart h" "pathfinish q = pathfinish h" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4858 |        and hq_less: "\<forall>t\<in>{0..1}. cmod (h t - q t) < e"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4859 | and paq: "contour_integral q (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * winding_number h z" | 
| 68326 | 4860 | using winding_number [OF \<open>path h\<close> pah \<open>0 < e\<close>] unfolding winding_number_prop_def by blast | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4861 |   have gp: "homotopic_loops (- {z}) g p"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4862 | by (simp add: gloop d gp_less norm_minus_commute p valid_path_imp_path) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4863 |   have hq: "homotopic_loops (- {z}) h q"
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4864 | by (simp add: e hloop hq_less norm_minus_commute q valid_path_imp_path) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4865 | have "contour_integral p (\<lambda>w. 1/(w - z)) = contour_integral q (\<lambda>w. 1/(w - z))" | 
| 68310 | 4866 | proof (rule Cauchy_theorem_homotopic_loops) | 
| 4867 |     show "homotopic_loops (- {z}) p q"
 | |
| 4868 | by (blast intro: homotopic_loops_trans homotopic_loops_sym gp hq assms) | |
| 4869 | qed (auto intro!: holomorphic_intros simp: p q) | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4870 | then show ?thesis | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4871 | by (simp add: pap paq) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4872 | qed | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4873 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4874 | lemma winding_number_paths_linear_eq: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4875 | "\<lbrakk>path g; path h; pathstart h = pathstart g; pathfinish h = pathfinish g; | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4876 |     \<And>t. t \<in> {0..1} \<Longrightarrow> z \<notin> closed_segment (g t) (h t)\<rbrakk>
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4877 | \<Longrightarrow> winding_number h z = winding_number g z" | 
| 68339 | 4878 | by (blast intro: sym homotopic_paths_linear winding_number_homotopic_paths) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4879 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4880 | lemma winding_number_loops_linear_eq: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4881 | "\<lbrakk>path g; path h; pathfinish g = pathstart g; pathfinish h = pathstart h; | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4882 |     \<And>t. t \<in> {0..1} \<Longrightarrow> z \<notin> closed_segment (g t) (h t)\<rbrakk>
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4883 | \<Longrightarrow> winding_number h z = winding_number g z" | 
| 68339 | 4884 | by (blast intro: sym homotopic_loops_linear winding_number_homotopic_loops) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4885 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4886 | lemma winding_number_nearby_paths_eq: | 
| 68359 | 4887 | "\<lbrakk>path g; path h; pathstart h = pathstart g; pathfinish h = pathfinish g; | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4888 |       \<And>t. t \<in> {0..1} \<Longrightarrow> norm(h t - g t) < norm(g t - z)\<rbrakk>
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4889 | \<Longrightarrow> winding_number h z = winding_number g z" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4890 | by (metis segment_bound(2) norm_minus_commute not_le winding_number_paths_linear_eq) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4891 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4892 | lemma winding_number_nearby_loops_eq: | 
| 68359 | 4893 | "\<lbrakk>path g; path h; pathfinish g = pathstart g; pathfinish h = pathstart h; | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4894 |       \<And>t. t \<in> {0..1} \<Longrightarrow> norm(h t - g t) < norm(g t - z)\<rbrakk>
 | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4895 | \<Longrightarrow> winding_number h z = winding_number g z" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4896 | by (metis segment_bound(2) norm_minus_commute not_le winding_number_loops_linear_eq) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4897 | |
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4898 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4899 | lemma winding_number_subpath_combine: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4900 | "\<lbrakk>path g; z \<notin> path_image g; | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4901 |       u \<in> {0..1}; v \<in> {0..1}; w \<in> {0..1}\<rbrakk>
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4902 | \<Longrightarrow> winding_number (subpath u v g) z + winding_number (subpath v w g) z = | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4903 | winding_number (subpath u w g) z" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4904 | apply (rule trans [OF winding_number_join [THEN sym] | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4905 | winding_number_homotopic_paths [OF homotopic_join_subpaths]]) | 
| 68532 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 4906 | using path_image_subpath_subset by auto | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4907 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4908 | subsection\<open>Partial circle path\<close> | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4909 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4910 | definition%important part_circlepath :: "[complex, real, real, real, real] \<Rightarrow> complex" | 
| 63589 | 4911 | where "part_circlepath z r s t \<equiv> \<lambda>x. z + of_real r * exp (\<i> * of_real (linepath s t x))" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4912 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4913 | lemma pathstart_part_circlepath [simp]: | 
| 63589 | 4914 | "pathstart(part_circlepath z r s t) = z + r*exp(\<i> * s)" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4915 | by (metis part_circlepath_def pathstart_def pathstart_linepath) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4916 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4917 | lemma pathfinish_part_circlepath [simp]: | 
| 63589 | 4918 | "pathfinish(part_circlepath z r s t) = z + r*exp(\<i>*t)" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4919 | by (metis part_circlepath_def pathfinish_def pathfinish_linepath) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4920 | |
| 68532 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 4921 | lemma reversepath_part_circlepath[simp]: | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 4922 | "reversepath (part_circlepath z r s t) = part_circlepath z r t s" | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 4923 | unfolding part_circlepath_def reversepath_def linepath_def | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 4924 | by (auto simp:algebra_simps) | 
| 
f8b98d31ad45
Incorporating new/strengthened proofs from Library and AFP entries
 paulson <lp15@cam.ac.uk> parents: 
68527diff
changeset | 4925 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4926 | lemma has_vector_derivative_part_circlepath [derivative_intros]: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4927 | "((part_circlepath z r s t) has_vector_derivative | 
| 63589 | 4928 | (\<i> * r * (of_real t - of_real s) * exp(\<i> * linepath s t x))) | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4929 | (at x within X)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4930 | apply (simp add: part_circlepath_def linepath_def scaleR_conv_of_real) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4931 | apply (rule has_vector_derivative_real_complex) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4932 | apply (rule derivative_eq_intros | simp)+ | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4933 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4934 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4935 | lemma differentiable_part_circlepath: | 
| 68721 | 4936 | "part_circlepath c r a b differentiable at x within A" | 
| 4937 | using has_vector_derivative_part_circlepath[of c r a b x A] differentiableI_vector by blast | |
| 4938 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4939 | lemma vector_derivative_part_circlepath: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4940 | "vector_derivative (part_circlepath z r s t) (at x) = | 
| 63589 | 4941 | \<i> * r * (of_real t - of_real s) * exp(\<i> * linepath s t x)" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4942 | using has_vector_derivative_part_circlepath vector_derivative_at by blast | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4943 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4944 | lemma vector_derivative_part_circlepath01: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4945 | "\<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4946 |      \<Longrightarrow> vector_derivative (part_circlepath z r s t) (at x within {0..1}) =
 | 
| 63589 | 4947 | \<i> * r * (of_real t - of_real s) * exp(\<i> * linepath s t x)" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4948 | using has_vector_derivative_part_circlepath | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4949 | by (auto simp: vector_derivative_at_within_ivl) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4950 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4951 | lemma valid_path_part_circlepath [simp]: "valid_path (part_circlepath z r s t)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4952 | apply (simp add: valid_path_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4953 | apply (rule C1_differentiable_imp_piecewise) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4954 | apply (auto simp: C1_differentiable_on_eq vector_derivative_works vector_derivative_part_circlepath has_vector_derivative_part_circlepath | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4955 | intro!: continuous_intros) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4956 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4957 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4958 | lemma path_part_circlepath [simp]: "path (part_circlepath z r s t)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4959 | by (simp add: valid_path_imp_path) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4960 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4961 | proposition path_image_part_circlepath: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4962 | assumes "s \<le> t" | 
| 63589 | 4963 |     shows "path_image (part_circlepath z r s t) = {z + r * exp(\<i> * of_real x) | x. s \<le> x \<and> x \<le> t}"
 | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4964 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4965 |   { fix z::real
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4966 | assume "0 \<le> z" "z \<le> 1" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4967 | with \<open>s \<le> t\<close> have "\<exists>x. (exp (\<i> * linepath s t z) = exp (\<i> * of_real x)) \<and> s \<le> x \<and> x \<le> t" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4968 | apply (rule_tac x="(1 - z) * s + z * t" in exI) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4969 | apply (simp add: linepath_def scaleR_conv_of_real algebra_simps) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4970 | apply (rule conjI) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4971 | using mult_right_mono apply blast | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4972 | using affine_ineq by (metis "mult.commute") | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4973 | } | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4974 | moreover | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4975 |   { fix z
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4976 | assume "s \<le> z" "z \<le> t" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4977 |     then have "z + of_real r * exp (\<i> * of_real z) \<in> (\<lambda>x. z + of_real r * exp (\<i> * linepath s t x)) ` {0..1}"
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4978 | apply (rule_tac x="(z - s)/(t - s)" in image_eqI) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4979 | apply (simp add: linepath_def scaleR_conv_of_real divide_simps exp_eq) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4980 | apply (auto simp: algebra_simps divide_simps) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4981 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4982 | } | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4983 | ultimately show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4984 | by (fastforce simp add: path_image_def part_circlepath_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4985 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4986 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4987 | lemma path_image_part_circlepath': | 
| 68721 | 4988 | "path_image (part_circlepath z r s t) = (\<lambda>x. z + r * cis x) ` closed_segment s t" | 
| 4989 | proof - | |
| 4990 | have "path_image (part_circlepath z r s t) = | |
| 4991 |           (\<lambda>x. z + r * exp(\<i> * of_real x)) ` linepath s t ` {0..1}"
 | |
| 4992 | by (simp add: image_image path_image_def part_circlepath_def) | |
| 4993 |   also have "linepath s t ` {0..1} = closed_segment s t"
 | |
| 4994 | by (rule linepath_image_01) | |
| 4995 | finally show ?thesis by (simp add: cis_conv_exp) | |
| 4996 | qed | |
| 4997 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 4998 | lemma path_image_part_circlepath_subset: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4999 | "\<lbrakk>s \<le> t; 0 \<le> r\<rbrakk> \<Longrightarrow> path_image(part_circlepath z r s t) \<subseteq> sphere z r" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5000 | by (auto simp: path_image_part_circlepath sphere_def dist_norm algebra_simps norm_mult) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5001 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5002 | lemma in_path_image_part_circlepath: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5003 | assumes "w \<in> path_image(part_circlepath z r s t)" "s \<le> t" "0 \<le> r" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5004 | shows "norm(w - z) = r" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5005 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5006 |   have "w \<in> {c. dist z c = r}"
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5007 | by (metis (no_types) path_image_part_circlepath_subset sphere_def subset_eq assms) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5008 | thus ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5009 | by (simp add: dist_norm norm_minus_commute) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5010 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5011 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5012 | lemma path_image_part_circlepath_subset': | 
| 68721 | 5013 | assumes "r \<ge> 0" | 
| 5014 | shows "path_image (part_circlepath z r s t) \<subseteq> sphere z r" | |
| 5015 | proof (cases "s \<le> t") | |
| 5016 | case True | |
| 5017 | thus ?thesis using path_image_part_circlepath_subset[of s t r z] assms by simp | |
| 5018 | next | |
| 5019 | case False | |
| 5020 | thus ?thesis using path_image_part_circlepath_subset[of t s r z] assms | |
| 5021 | by (subst reversepath_part_circlepath [symmetric], subst path_image_reversepath) simp_all | |
| 5022 | qed | |
| 5023 | ||
| 5024 | lemma part_circlepath_cnj: "cnj (part_circlepath c r a b x) = part_circlepath (cnj c) r (-a) (-b) x" | |
| 5025 | by (simp add: part_circlepath_def exp_cnj linepath_def algebra_simps) | |
| 5026 | ||
| 5027 | lemma contour_integral_bound_part_circlepath: | |
| 5028 | assumes "f contour_integrable_on part_circlepath c r a b" | |
| 5029 | assumes "B \<ge> 0" "r \<ge> 0" "\<And>x. x \<in> path_image (part_circlepath c r a b) \<Longrightarrow> norm (f x) \<le> B" | |
| 5030 | shows "norm (contour_integral (part_circlepath c r a b) f) \<le> B * r * \<bar>b - a\<bar>" | |
| 5031 | proof - | |
| 5032 |   let ?I = "integral {0..1} (\<lambda>x. f (part_circlepath c r a b x) * \<i> * of_real (r * (b - a)) *
 | |
| 5033 | exp (\<i> * linepath a b x))" | |
| 5034 |   have "norm ?I \<le> integral {0..1} (\<lambda>x::real. B * 1 * (r * \<bar>b - a\<bar>) * 1)"
 | |
| 5035 | proof (rule integral_norm_bound_integral, goal_cases) | |
| 5036 | case 1 | |
| 5037 | with assms(1) show ?case | |
| 5038 | by (simp add: contour_integrable_on vector_derivative_part_circlepath mult_ac) | |
| 5039 | next | |
| 5040 | case (3 x) | |
| 5041 | with assms(2-) show ?case unfolding norm_mult norm_of_real abs_mult | |
| 5042 | by (intro mult_mono) (auto simp: path_image_def) | |
| 5043 | qed auto | |
| 5044 | also have "?I = contour_integral (part_circlepath c r a b) f" | |
| 5045 | by (simp add: contour_integral_integral vector_derivative_part_circlepath mult_ac) | |
| 5046 | finally show ?thesis by simp | |
| 5047 | qed | |
| 5048 | ||
| 5049 | lemma has_contour_integral_part_circlepath_iff: | |
| 5050 | assumes "a < b" | |
| 5051 | shows "(f has_contour_integral I) (part_circlepath c r a b) \<longleftrightarrow> | |
| 5052 |            ((\<lambda>t. f (c + r * cis t) * r * \<i> * cis t) has_integral I) {a..b}"
 | |
| 5053 | proof - | |
| 5054 | have "(f has_contour_integral I) (part_circlepath c r a b) \<longleftrightarrow> | |
| 5055 | ((\<lambda>x. f (part_circlepath c r a b x) * vector_derivative (part_circlepath c r a b) | |
| 5056 |            (at x within {0..1})) has_integral I) {0..1}"
 | |
| 5057 | unfolding has_contour_integral_def .. | |
| 5058 | also have "\<dots> \<longleftrightarrow> ((\<lambda>x. f (part_circlepath c r a b x) * r * (b - a) * \<i> * | |
| 5059 |                             cis (linepath a b x)) has_integral I) {0..1}"
 | |
| 5060 | by (intro has_integral_cong, subst vector_derivative_part_circlepath01) | |
| 5061 | (simp_all add: cis_conv_exp) | |
| 5062 | also have "\<dots> \<longleftrightarrow> ((\<lambda>x. f (c + r * exp (\<i> * linepath (of_real a) (of_real b) x)) * | |
| 5063 | r * \<i> * exp (\<i> * linepath (of_real a) (of_real b) x) * | |
| 5064 | vector_derivative (linepath (of_real a) (of_real b)) | |
| 5065 |                          (at x within {0..1})) has_integral I) {0..1}"
 | |
| 5066 | by (intro has_integral_cong, subst vector_derivative_linepath_within) | |
| 5067 | (auto simp: part_circlepath_def cis_conv_exp of_real_linepath [symmetric]) | |
| 5068 | also have "\<dots> \<longleftrightarrow> ((\<lambda>z. f (c + r * exp (\<i> * z)) * r * \<i> * exp (\<i> * z)) has_contour_integral I) | |
| 5069 | (linepath (of_real a) (of_real b))" | |
| 5070 | by (simp add: has_contour_integral_def) | |
| 5071 |   also have "\<dots> \<longleftrightarrow> ((\<lambda>t. f (c + r * cis t) * r * \<i> * cis t) has_integral I) {a..b}" using assms
 | |
| 5072 | by (subst has_contour_integral_linepath_Reals_iff) (simp_all add: cis_conv_exp) | |
| 5073 | finally show ?thesis . | |
| 5074 | qed | |
| 5075 | ||
| 5076 | lemma contour_integrable_part_circlepath_iff: | |
| 5077 | assumes "a < b" | |
| 5078 | shows "f contour_integrable_on (part_circlepath c r a b) \<longleftrightarrow> | |
| 5079 |            (\<lambda>t. f (c + r * cis t) * r * \<i> * cis t) integrable_on {a..b}"
 | |
| 5080 | using assms by (auto simp: contour_integrable_on_def integrable_on_def | |
| 5081 | has_contour_integral_part_circlepath_iff) | |
| 5082 | ||
| 5083 | lemma contour_integral_part_circlepath_eq: | |
| 5084 | assumes "a < b" | |
| 5085 | shows "contour_integral (part_circlepath c r a b) f = | |
| 5086 |            integral {a..b} (\<lambda>t. f (c + r * cis t) * r * \<i> * cis t)"
 | |
| 5087 | proof (cases "f contour_integrable_on part_circlepath c r a b") | |
| 5088 | case True | |
| 5089 |   hence "(\<lambda>t. f (c + r * cis t) * r * \<i> * cis t) integrable_on {a..b}" 
 | |
| 5090 | using assms by (simp add: contour_integrable_part_circlepath_iff) | |
| 5091 | with True show ?thesis | |
| 5092 | using has_contour_integral_part_circlepath_iff[OF assms] | |
| 5093 | contour_integral_unique has_integral_integrable_integral by blast | |
| 5094 | next | |
| 5095 | case False | |
| 5096 |   hence "\<not>(\<lambda>t. f (c + r * cis t) * r * \<i> * cis t) integrable_on {a..b}" 
 | |
| 5097 | using assms by (simp add: contour_integrable_part_circlepath_iff) | |
| 5098 | with False show ?thesis | |
| 5099 | by (simp add: not_integrable_contour_integral not_integrable_integral) | |
| 5100 | qed | |
| 5101 | ||
| 5102 | lemma contour_integral_part_circlepath_reverse: | |
| 5103 | "contour_integral (part_circlepath c r a b) f = -contour_integral (part_circlepath c r b a) f" | |
| 5104 | by (subst reversepath_part_circlepath [symmetric], subst contour_integral_reversepath) simp_all | |
| 5105 | ||
| 5106 | lemma contour_integral_part_circlepath_reverse': | |
| 5107 | "b < a \<Longrightarrow> contour_integral (part_circlepath c r a b) f = | |
| 5108 | -contour_integral (part_circlepath c r b a) f" | |
| 5109 | by (rule contour_integral_part_circlepath_reverse) | |
| 5110 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5111 | lemma finite_bounded_log: "finite {z::complex. norm z \<le> b \<and> exp z = w}"
 | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5112 | proof (cases "w = 0") | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5113 | case True then show ?thesis by auto | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5114 | next | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5115 | case False | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5116 |   have *: "finite {x. cmod (complex_of_real (2 * real_of_int x * pi) * \<i>) \<le> b + cmod (Ln w)}"
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5117 | apply (simp add: norm_mult finite_int_iff_bounded_le) | 
| 61942 | 5118 | apply (rule_tac x="\<lfloor>(b + cmod (Ln w)) / (2*pi)\<rfloor>" in exI) | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5119 | apply (auto simp: divide_simps le_floor_iff) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5120 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5121 |   have [simp]: "\<And>P f. {z. P z \<and> (\<exists>n. z = f n)} = f ` {n. P (f n)}"
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5122 | by blast | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5123 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5124 | apply (subst exp_Ln [OF False, symmetric]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5125 | apply (simp add: exp_eq) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5126 | using norm_add_leD apply (fastforce intro: finite_subset [OF _ *]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5127 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5128 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5129 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5130 | lemma finite_bounded_log2: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5131 | fixes a::complex | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5132 | assumes "a \<noteq> 0" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5133 |     shows "finite {z. norm z \<le> b \<and> exp(a*z) = w}"
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5134 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5135 |   have *: "finite ((\<lambda>z. z / a) ` {z. cmod z \<le> b * cmod a \<and> exp z = w})"
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5136 | by (rule finite_imageI [OF finite_bounded_log]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5137 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5138 | by (rule finite_subset [OF _ *]) (force simp: assms norm_mult) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5139 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5140 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5141 | lemma has_contour_integral_bound_part_circlepath_strong: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5142 | assumes fi: "(f has_contour_integral i) (part_circlepath z r s t)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5143 | and "finite k" and le: "0 \<le> B" "0 < r" "s \<le> t" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5144 | and B: "\<And>x. x \<in> path_image(part_circlepath z r s t) - k \<Longrightarrow> norm(f x) \<le> B" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5145 | shows "cmod i \<le> B * r * (t - s)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5146 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5147 | consider "s = t" | "s < t" using \<open>s \<le> t\<close> by linarith | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5148 | then show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5149 | proof cases | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5150 | case 1 with fi [unfolded has_contour_integral] | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5151 | have "i = 0" by (simp add: vector_derivative_part_circlepath) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5152 | with assms show ?thesis by simp | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5153 | next | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5154 | case 2 | 
| 61945 | 5155 | have [simp]: "\<bar>r\<bar> = r" using \<open>r > 0\<close> by linarith | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5156 | have [simp]: "cmod (complex_of_real t - complex_of_real s) = t-s" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5157 | by (metis "2" abs_of_pos diff_gt_0_iff_gt norm_of_real of_real_diff) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5158 |     have "finite (part_circlepath z r s t -` {y} \<inter> {0..1})" if "y \<in> k" for y
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5159 | proof - | 
| 63589 | 5160 | define w where "w = (y - z)/of_real r / exp(\<i> * of_real s)" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5161 |       have fin: "finite (of_real -` {z. cmod z \<le> 1 \<and> exp (\<i> * complex_of_real (t - s) * z) = w})"
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5162 | apply (rule finite_vimageI [OF finite_bounded_log2]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5163 | using \<open>s < t\<close> apply (auto simp: inj_of_real) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5164 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5165 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5166 | apply (simp add: part_circlepath_def linepath_def vimage_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5167 | apply (rule finite_subset [OF _ fin]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5168 | using le | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5169 | apply (auto simp: w_def algebra_simps scaleR_conv_of_real exp_add exp_diff) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5170 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5171 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5172 |     then have fin01: "finite ((part_circlepath z r s t) -` k \<inter> {0..1})"
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5173 | by (rule finite_finite_vimage_IntI [OF \<open>finite k\<close>]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5174 | have **: "((\<lambda>x. if (part_circlepath z r s t x) \<in> k then 0 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5175 | else f(part_circlepath z r s t x) * | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5176 |                        vector_derivative (part_circlepath z r s t) (at x)) has_integral i)  {0..1}"
 | 
| 68359 | 5177 | by (rule has_integral_spike [OF negligible_finite [OF fin01]]) (use fi has_contour_integral in auto) | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5178 | have *: "\<And>x. \<lbrakk>0 \<le> x; x \<le> 1; part_circlepath z r s t x \<notin> k\<rbrakk> \<Longrightarrow> cmod (f (part_circlepath z r s t x)) \<le> B" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5179 | by (auto intro!: B [unfolded path_image_def image_def, simplified]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5180 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5181 | apply (rule has_integral_bound [where 'a=real, simplified, OF _ **, simplified]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5182 | using assms apply force | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5183 | apply (simp add: norm_mult vector_derivative_part_circlepath) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5184 | using le * "2" \<open>r > 0\<close> by auto | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5185 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5186 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5187 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5188 | lemma has_contour_integral_bound_part_circlepath: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5189 | "\<lbrakk>(f has_contour_integral i) (part_circlepath z r s t); | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5190 | 0 \<le> B; 0 < r; s \<le> t; | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5191 | \<And>x. x \<in> path_image(part_circlepath z r s t) \<Longrightarrow> norm(f x) \<le> B\<rbrakk> | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5192 | \<Longrightarrow> norm i \<le> B*r*(t - s)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5193 | by (auto intro: has_contour_integral_bound_part_circlepath_strong) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5194 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5195 | lemma contour_integrable_continuous_part_circlepath: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5196 | "continuous_on (path_image (part_circlepath z r s t)) f | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5197 | \<Longrightarrow> f contour_integrable_on (part_circlepath z r s t)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5198 | apply (simp add: contour_integrable_on has_contour_integral_def vector_derivative_part_circlepath path_image_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5199 | apply (rule integrable_continuous_real) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5200 | apply (fast intro: path_part_circlepath [unfolded path_def] continuous_intros continuous_on_compose2 [where g=f, OF _ _ order_refl]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5201 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5202 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5203 | proposition winding_number_part_circlepath_pos_less: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5204 | assumes "s < t" and no: "norm(w - z) < r" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5205 | shows "0 < Re (winding_number(part_circlepath z r s t) w)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5206 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5207 | have "0 < r" by (meson no norm_not_less_zero not_le order.strict_trans2) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5208 | note valid_path_part_circlepath | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5209 | moreover have " w \<notin> path_image (part_circlepath z r s t)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5210 | using assms by (auto simp: path_image_def image_def part_circlepath_def norm_mult linepath_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5211 | moreover have "0 < r * (t - s) * (r - cmod (w - z))" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5212 | using assms by (metis \<open>0 < r\<close> diff_gt_0_iff_gt mult_pos_pos) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5213 | ultimately show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5214 | apply (rule winding_number_pos_lt [where e = "r*(t - s)*(r - norm(w - z))"]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5215 | apply (simp add: vector_derivative_part_circlepath right_diff_distrib [symmetric] mult_ac) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5216 | apply (rule mult_left_mono)+ | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5217 | using Re_Im_le_cmod [of "w-z" "linepath s t x" for x] | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5218 | apply (simp add: exp_Euler cos_of_real sin_of_real part_circlepath_def algebra_simps cos_squared_eq [unfolded power2_eq_square]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5219 | using assms \<open>0 < r\<close> by auto | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5220 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5221 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5222 | lemma simple_path_part_circlepath: | 
| 61945 | 5223 | "simple_path(part_circlepath z r s t) \<longleftrightarrow> (r \<noteq> 0 \<and> s \<noteq> t \<and> \<bar>s - t\<bar> \<le> 2*pi)" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5224 | proof (cases "r = 0 \<or> s = t") | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5225 | case True | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5226 | then show ?thesis | 
| 68359 | 5227 | unfolding part_circlepath_def simple_path_def | 
| 5228 | by (rule disjE) (force intro: bexI [where x = "1/4"] bexI [where x = "1/3"])+ | |
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5229 | next | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5230 | case False then have "r \<noteq> 0" "s \<noteq> t" by auto | 
| 63589 | 5231 | have *: "\<And>x y z s t. \<i>*((1 - x) * s + x * t) = \<i>*(((1 - y) * s + y * t)) + z \<longleftrightarrow> \<i>*(x - y) * (t - s) = z" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5232 | by (simp add: algebra_simps) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5233 | have abs01: "\<And>x y::real. 0 \<le> x \<and> x \<le> 1 \<and> 0 \<le> y \<and> y \<le> 1 | 
| 61945 | 5234 |                       \<Longrightarrow> (x = y \<or> x = 0 \<and> y = 1 \<or> x = 1 \<and> y = 0 \<longleftrightarrow> \<bar>x - y\<bar> \<in> {0,1})"
 | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5235 | by auto | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5236 | have **: "\<And>x y. (\<exists>n. (complex_of_real x - of_real y) * (of_real t - of_real s) = 2 * (of_int n * of_real pi)) \<longleftrightarrow> | 
| 61945 | 5237 | (\<exists>n. \<bar>x - y\<bar> * (t - s) = 2 * (of_int n * pi))" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5238 | by (force simp: algebra_simps abs_if dest: arg_cong [where f=Re] arg_cong [where f=complex_of_real] | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5239 | intro: exI [where x = "-n" for n]) | 
| 68359 | 5240 | have 1: "\<bar>s - t\<bar> \<le> 2 * pi" | 
| 5241 | if "\<And>x. 0 \<le> x \<and> x \<le> 1 \<Longrightarrow> (\<exists>n. x * (t - s) = 2 * (real_of_int n * pi)) \<longrightarrow> x = 0 \<or> x = 1" | |
| 5242 | proof (rule ccontr) | |
| 5243 | assume "\<not> \<bar>s - t\<bar> \<le> 2 * pi" | |
| 5244 | then have *: "\<And>n. t - s \<noteq> of_int n * \<bar>s - t\<bar>" | |
| 5245 | using False that [of "2*pi / \<bar>t - s\<bar>"] by (simp add: abs_minus_commute divide_simps) | |
| 5246 | show False | |
| 5247 | using * [of 1] * [of "-1"] by auto | |
| 5248 | qed | |
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5249 | have 2: "\<bar>s - t\<bar> = \<bar>2 * (real_of_int n * pi) / x\<bar>" if "x \<noteq> 0" "x * (t - s) = 2 * (real_of_int n * pi)" for x n | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5250 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5251 | have "t-s = 2 * (real_of_int n * pi)/x" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5252 | using that by (simp add: field_simps) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5253 | then show ?thesis by (metis abs_minus_commute) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5254 | qed | 
| 68359 | 5255 |   have abs_away: "\<And>P. (\<forall>x\<in>{0..1}. \<forall>y\<in>{0..1}. P \<bar>x - y\<bar>) \<longleftrightarrow> (\<forall>x::real. 0 \<le> x \<and> x \<le> 1 \<longrightarrow> P x)"
 | 
| 5256 | by force | |
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5257 | show ?thesis using False | 
| 68359 | 5258 | apply (simp add: simple_path_def) | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5259 | apply (simp add: part_circlepath_def linepath_def exp_eq * ** abs01 del: Set.insert_iff) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5260 | apply (subst abs_away) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5261 | apply (auto simp: 1) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5262 | apply (rule ccontr) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5263 | apply (auto simp: 2 divide_simps abs_mult dest: of_int_leD) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5264 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5265 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5266 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5267 | lemma arc_part_circlepath: | 
| 61945 | 5268 | assumes "r \<noteq> 0" "s \<noteq> t" "\<bar>s - t\<bar> < 2*pi" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5269 | shows "arc (part_circlepath z r s t)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5270 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5271 | have *: "x = y" if eq: "\<i> * (linepath s t x) = \<i> * (linepath s t y) + 2 * of_int n * complex_of_real pi * \<i>" | 
| 68359 | 5272 |     and x: "x \<in> {0..1}" and y: "y \<in> {0..1}" for x y n
 | 
| 5273 | proof (rule ccontr) | |
| 5274 | assume "x \<noteq> y" | |
| 5275 | have "(linepath s t x) = (linepath s t y) + 2 * of_int n * complex_of_real pi" | |
| 5276 | by (metis add_divide_eq_iff complex_i_not_zero mult.commute nonzero_mult_div_cancel_left eq) | |
| 5277 | then have "s*y + t*x = s*x + (t*y + of_int n * (pi * 2))" | |
| 5278 | by (force simp: algebra_simps linepath_def dest: arg_cong [where f=Re]) | |
| 5279 | with \<open>x \<noteq> y\<close> have st: "s-t = (of_int n * (pi * 2) / (y-x))" | |
| 5280 | by (force simp: field_simps) | |
| 5281 | have "\<bar>real_of_int n\<bar> < \<bar>y - x\<bar>" | |
| 5282 | using assms \<open>x \<noteq> y\<close> by (simp add: st abs_mult field_simps) | |
| 5283 | then show False | |
| 5284 | using assms x y st by (auto dest: of_int_lessD) | |
| 5285 | qed | |
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5286 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5287 | using assms | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5288 | apply (simp add: arc_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5289 | apply (simp add: part_circlepath_def inj_on_def exp_eq) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5290 | apply (blast intro: *) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5291 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5292 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5293 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5294 | subsection\<open>Special case of one complete circle\<close> | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5295 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5296 | definition%important circlepath :: "[complex, real, real] \<Rightarrow> complex" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5297 | where "circlepath z r \<equiv> part_circlepath z r 0 (2*pi)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5298 | |
| 63589 | 5299 | lemma circlepath: "circlepath z r = (\<lambda>x. z + r * exp(2 * of_real pi * \<i> * of_real x))" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5300 | by (simp add: circlepath_def part_circlepath_def linepath_def algebra_simps) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5301 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5302 | lemma pathstart_circlepath [simp]: "pathstart (circlepath z r) = z + r" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5303 | by (simp add: circlepath_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5304 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5305 | lemma pathfinish_circlepath [simp]: "pathfinish (circlepath z r) = z + r" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5306 | by (simp add: circlepath_def) (metis exp_two_pi_i mult.commute) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5307 | |
| 61848 | 5308 | lemma circlepath_minus: "circlepath z (-r) x = circlepath z r (x + 1/2)" | 
| 5309 | proof - | |
| 68296 
69d680e94961
tidying and reorganisation around Cauchy Integral Theorem
 paulson <lp15@cam.ac.uk> parents: 
68284diff
changeset | 5310 | have "z + of_real r * exp (2 * pi * \<i> * (x + 1/2)) = | 
| 61848 | 5311 | z + of_real r * exp (2 * pi * \<i> * x + pi * \<i>)" | 
| 5312 | by (simp add: divide_simps) (simp add: algebra_simps) | |
| 68339 | 5313 | also have "\<dots> = z - r * exp (2 * pi * \<i> * x)" | 
| 61848 | 5314 | by (simp add: exp_add) | 
| 5315 | finally show ?thesis | |
| 5316 | by (simp add: circlepath path_image_def sphere_def dist_norm) | |
| 5317 | qed | |
| 5318 | ||
| 5319 | lemma circlepath_add1: "circlepath z r (x+1) = circlepath z r x" | |
| 5320 | using circlepath_minus [of z r "x+1/2"] circlepath_minus [of z "-r" x] | |
| 5321 | by (simp add: add.commute) | |
| 5322 | ||
| 5323 | lemma circlepath_add_half: "circlepath z r (x + 1/2) = circlepath z r (x - 1/2)" | |
| 5324 | using circlepath_add1 [of z r "x-1/2"] | |
| 5325 | by (simp add: add.commute) | |
| 5326 | ||
| 5327 | lemma path_image_circlepath_minus_subset: | |
| 5328 | "path_image (circlepath z (-r)) \<subseteq> path_image (circlepath z r)" | |
| 5329 | apply (simp add: path_image_def image_def circlepath_minus, clarify) | |
| 5330 | apply (case_tac "xa \<le> 1/2", force) | |
| 68339 | 5331 | apply (force simp: circlepath_add_half)+ | 
| 61848 | 5332 | done | 
| 5333 | ||
| 5334 | lemma path_image_circlepath_minus: "path_image (circlepath z (-r)) = path_image (circlepath z r)" | |
| 5335 | using path_image_circlepath_minus_subset by fastforce | |
| 5336 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5337 | lemma has_vector_derivative_circlepath [derivative_intros]: | 
| 63589 | 5338 | "((circlepath z r) has_vector_derivative (2 * pi * \<i> * r * exp (2 * of_real pi * \<i> * of_real x))) | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5339 | (at x within X)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5340 | apply (simp add: circlepath_def scaleR_conv_of_real) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5341 | apply (rule derivative_eq_intros) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5342 | apply (simp add: algebra_simps) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5343 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5344 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5345 | lemma vector_derivative_circlepath: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5346 | "vector_derivative (circlepath z r) (at x) = | 
| 63589 | 5347 | 2 * pi * \<i> * r * exp(2 * of_real pi * \<i> * x)" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5348 | using has_vector_derivative_circlepath vector_derivative_at by blast | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5349 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5350 | lemma vector_derivative_circlepath01: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5351 | "\<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5352 |      \<Longrightarrow> vector_derivative (circlepath z r) (at x within {0..1}) =
 | 
| 63589 | 5353 | 2 * pi * \<i> * r * exp(2 * of_real pi * \<i> * x)" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5354 | using has_vector_derivative_circlepath | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5355 | by (auto simp: vector_derivative_at_within_ivl) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5356 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5357 | lemma valid_path_circlepath [simp]: "valid_path (circlepath z r)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5358 | by (simp add: circlepath_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5359 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5360 | lemma path_circlepath [simp]: "path (circlepath z r)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5361 | by (simp add: valid_path_imp_path) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5362 | |
| 61848 | 5363 | lemma path_image_circlepath_nonneg: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5364 | assumes "0 \<le> r" shows "path_image (circlepath z r) = sphere z r" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5365 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5366 |   have *: "x \<in> (\<lambda>u. z + (cmod (x - z)) * exp (\<i> * (of_real u * (of_real pi * 2)))) ` {0..1}" for x
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5367 | proof (cases "x = z") | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5368 | case True then show ?thesis by force | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5369 | next | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5370 | case False | 
| 63040 | 5371 | define w where "w = x - z" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5372 | then have "w \<noteq> 0" by (simp add: False) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5373 | have **: "\<And>t. \<lbrakk>Re w = cos t * cmod w; Im w = sin t * cmod w\<rbrakk> \<Longrightarrow> w = of_real (cmod w) * exp (\<i> * t)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5374 | using cis_conv_exp complex_eq_iff by auto | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5375 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5376 | apply (rule sincos_total_2pi [of "Re(w/of_real(norm w))" "Im(w/of_real(norm w))"]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5377 | apply (simp add: divide_simps \<open>w \<noteq> 0\<close> cmod_power2 [symmetric]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5378 | apply (rule_tac x="t / (2*pi)" in image_eqI) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5379 | apply (simp add: divide_simps \<open>w \<noteq> 0\<close>) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5380 | using False ** | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5381 | apply (auto simp: w_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5382 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5383 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5384 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5385 | unfolding circlepath path_image_def sphere_def dist_norm | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5386 | by (force simp: assms algebra_simps norm_mult norm_minus_commute intro: *) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5387 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5388 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5389 | lemma path_image_circlepath [simp]: | 
| 61945 | 5390 | "path_image (circlepath z r) = sphere z \<bar>r\<bar>" | 
| 61848 | 5391 | using path_image_circlepath_minus | 
| 68339 | 5392 | by (force simp: path_image_circlepath_nonneg abs_if) | 
| 61848 | 5393 | |
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5394 | lemma has_contour_integral_bound_circlepath_strong: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5395 | "\<lbrakk>(f has_contour_integral i) (circlepath z r); | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5396 | finite k; 0 \<le> B; 0 < r; | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5397 | \<And>x. \<lbrakk>norm(x - z) = r; x \<notin> k\<rbrakk> \<Longrightarrow> norm(f x) \<le> B\<rbrakk> | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5398 | \<Longrightarrow> norm i \<le> B*(2*pi*r)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5399 | unfolding circlepath_def | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5400 | by (auto simp: algebra_simps in_path_image_part_circlepath dest!: has_contour_integral_bound_part_circlepath_strong) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5401 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5402 | lemma has_contour_integral_bound_circlepath: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5403 | "\<lbrakk>(f has_contour_integral i) (circlepath z r); | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5404 | 0 \<le> B; 0 < r; \<And>x. norm(x - z) = r \<Longrightarrow> norm(f x) \<le> B\<rbrakk> | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5405 | \<Longrightarrow> norm i \<le> B*(2*pi*r)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5406 | by (auto intro: has_contour_integral_bound_circlepath_strong) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5407 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5408 | lemma contour_integrable_continuous_circlepath: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5409 | "continuous_on (path_image (circlepath z r)) f | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5410 | \<Longrightarrow> f contour_integrable_on (circlepath z r)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5411 | by (simp add: circlepath_def contour_integrable_continuous_part_circlepath) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5412 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5413 | lemma simple_path_circlepath: "simple_path(circlepath z r) \<longleftrightarrow> (r \<noteq> 0)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5414 | by (simp add: circlepath_def simple_path_part_circlepath) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5415 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5416 | lemma notin_path_image_circlepath [simp]: "cmod (w - z) < r \<Longrightarrow> w \<notin> path_image (circlepath z r)" | 
| 61848 | 5417 | by (simp add: sphere_def dist_norm norm_minus_commute) | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5418 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5419 | lemma contour_integral_circlepath: | 
| 68359 | 5420 | assumes "r > 0" | 
| 5421 | shows "contour_integral (circlepath z r) (\<lambda>w. 1 / (w - z)) = 2 * complex_of_real pi * \<i>" | |
| 5422 | proof (rule contour_integral_unique) | |
| 5423 | show "((\<lambda>w. 1 / (w - z)) has_contour_integral 2 * complex_of_real pi * \<i>) (circlepath z r)" | |
| 5424 | unfolding has_contour_integral_def using assms | |
| 5425 | apply (subst has_integral_cong) | |
| 5426 | apply (simp add: vector_derivative_circlepath01) | |
| 5427 | using has_integral_const_real [of _ 0 1] apply (force simp: circlepath) | |
| 5428 | done | |
| 5429 | qed | |
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5430 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5431 | lemma winding_number_circlepath_centre: "0 < r \<Longrightarrow> winding_number (circlepath z r) z = 1" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5432 | apply (rule winding_number_unique_loop) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5433 | apply (simp_all add: sphere_def valid_path_imp_path) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5434 | apply (rule_tac x="circlepath z r" in exI) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5435 | apply (simp add: sphere_def contour_integral_circlepath) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5436 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5437 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5438 | proposition winding_number_circlepath: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5439 | assumes "norm(w - z) < r" shows "winding_number(circlepath z r) w = 1" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5440 | proof (cases "w = z") | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5441 | case True then show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5442 | using assms winding_number_circlepath_centre by auto | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5443 | next | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5444 | case False | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5445 | have [simp]: "r > 0" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5446 | using assms le_less_trans norm_ge_zero by blast | 
| 63040 | 5447 | define r' where "r' = norm(w - z)" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5448 | have "r' < r" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5449 | by (simp add: assms r'_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5450 |   have disjo: "cball z r' \<inter> sphere z r = {}"
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5451 | using \<open>r' < r\<close> by (force simp: cball_def sphere_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5452 | have "winding_number(circlepath z r) w = winding_number(circlepath z r) z" | 
| 68359 | 5453 | proof (rule winding_number_around_inside [where s = "cball z r'"]) | 
| 5454 | show "winding_number (circlepath z r) z \<noteq> 0" | |
| 5455 | by (simp add: winding_number_circlepath_centre) | |
| 5456 |     show "cball z r' \<inter> path_image (circlepath z r) = {}"
 | |
| 5457 | by (simp add: disjo less_eq_real_def) | |
| 5458 | qed (auto simp: r'_def dist_norm norm_minus_commute) | |
| 68339 | 5459 | also have "\<dots> = 1" | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5460 | by (simp add: winding_number_circlepath_centre) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5461 | finally show ?thesis . | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5462 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5463 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5464 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5465 | text\<open> Hence the Cauchy formula for points inside a circle.\<close> | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5466 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5467 | theorem Cauchy_integral_circlepath: | 
| 68359 | 5468 | assumes contf: "continuous_on (cball z r) f" and holf: "f holomorphic_on (ball z r)" and wz: "norm(w - z) < r" | 
| 63589 | 5469 | shows "((\<lambda>u. f u/(u - w)) has_contour_integral (2 * of_real pi * \<i> * f w)) | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5470 | (circlepath z r)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5471 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5472 | have "r > 0" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5473 | using assms le_less_trans norm_ge_zero by blast | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5474 | have "((\<lambda>u. f u / (u - w)) has_contour_integral (2 * pi) * \<i> * winding_number (circlepath z r) w * f w) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5475 | (circlepath z r)" | 
| 68359 | 5476 |   proof (rule Cauchy_integral_formula_weak [where s = "cball z r" and k = "{}"])
 | 
| 5477 |     show "\<And>x. x \<in> interior (cball z r) - {} \<Longrightarrow>
 | |
| 5478 | f field_differentiable at x" | |
| 5479 | using holf holomorphic_on_imp_differentiable_at by auto | |
| 5480 | have "w \<notin> sphere z r" | |
| 5481 | by simp (metis dist_commute dist_norm not_le order_refl wz) | |
| 5482 |     then show "path_image (circlepath z r) \<subseteq> cball z r - {w}"
 | |
| 5483 | using \<open>r > 0\<close> by (auto simp add: cball_def sphere_def) | |
| 5484 | qed (use wz in \<open>simp_all add: dist_norm norm_minus_commute contf\<close>) | |
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5485 | then show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5486 | by (simp add: winding_number_circlepath assms) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5487 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5488 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5489 | corollary%unimportant Cauchy_integral_circlepath_simple: | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5490 | assumes "f holomorphic_on cball z r" "norm(w - z) < r" | 
| 63589 | 5491 | shows "((\<lambda>u. f u/(u - w)) has_contour_integral (2 * of_real pi * \<i> * f w)) | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5492 | (circlepath z r)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5493 | using assms by (force simp: holomorphic_on_imp_continuous_on holomorphic_on_subset Cauchy_integral_circlepath) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5494 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5495 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5496 | lemma no_bounded_connected_component_imp_winding_number_zero: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5497 | assumes g: "path g" "path_image g \<subseteq> s" "pathfinish g = pathstart g" "z \<notin> s" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5498 | and nb: "\<And>z. bounded (connected_component_set (- s) z) \<longrightarrow> z \<in> s" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5499 | shows "winding_number g z = 0" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5500 | apply (rule winding_number_zero_in_outside) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5501 | apply (simp_all add: assms) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5502 | by (metis nb [of z] \<open>path_image g \<subseteq> s\<close> \<open>z \<notin> s\<close> contra_subsetD mem_Collect_eq outside outside_mono) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5503 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5504 | lemma no_bounded_path_component_imp_winding_number_zero: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5505 | assumes g: "path g" "path_image g \<subseteq> s" "pathfinish g = pathstart g" "z \<notin> s" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5506 | and nb: "\<And>z. bounded (path_component_set (- s) z) \<longrightarrow> z \<in> s" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5507 | shows "winding_number g z = 0" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5508 | apply (rule no_bounded_connected_component_imp_winding_number_zero [OF g]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5509 | by (simp add: bounded_subset nb path_component_subset_connected_component) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5510 | |
| 61848 | 5511 | |
| 5512 | subsection\<open> Uniform convergence of path integral\<close> | |
| 5513 | ||
| 5514 | text\<open>Uniform convergence when the derivative of the path is bounded, and in particular for the special case of a circle.\<close> | |
| 5515 | ||
| 5516 | proposition contour_integral_uniform_limit: | |
| 5517 | assumes ev_fint: "eventually (\<lambda>n::'a. (f n) contour_integrable_on \<gamma>) F" | |
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5518 | and ul_f: "uniform_limit (path_image \<gamma>) f l F" | 
| 61848 | 5519 |       and noleB: "\<And>t. t \<in> {0..1} \<Longrightarrow> norm (vector_derivative \<gamma> (at t)) \<le> B"
 | 
| 5520 | and \<gamma>: "valid_path \<gamma>" | |
| 5521 | and [simp]: "~ (trivial_limit F)" | |
| 61973 | 5522 | shows "l contour_integrable_on \<gamma>" "((\<lambda>n. contour_integral \<gamma> (f n)) \<longlongrightarrow> contour_integral \<gamma> l) F" | 
| 61848 | 5523 | proof - | 
| 5524 | have "0 \<le> B" by (meson noleB [of 0] atLeastAtMost_iff norm_ge_zero order_refl order_trans zero_le_one) | |
| 5525 |   { fix e::real
 | |
| 5526 | assume "0 < e" | |
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5527 | then have "0 < e / (\<bar>B\<bar> + 1)" by simp | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5528 | then have "\<forall>\<^sub>F n in F. \<forall>x\<in>path_image \<gamma>. cmod (f n x - l x) < e / (\<bar>B\<bar> + 1)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5529 | using ul_f [unfolded uniform_limit_iff dist_norm] by auto | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5530 | with ev_fint | 
| 61848 | 5531 |     obtain a where fga: "\<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f a (\<gamma> x) - l (\<gamma> x)) < e / (\<bar>B\<bar> + 1)"
 | 
| 5532 |                and inta: "(\<lambda>t. f a (\<gamma> t) * vector_derivative \<gamma> (at t)) integrable_on {0..1}"
 | |
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5533 | using eventually_happens [OF eventually_conj] | 
| 61848 | 5534 | by (fastforce simp: contour_integrable_on path_image_def) | 
| 5535 | have Ble: "B * e / (\<bar>B\<bar> + 1) \<le> e" | |
| 5536 | using \<open>0 \<le> B\<close> \<open>0 < e\<close> by (simp add: divide_simps) | |
| 5537 |     have "\<exists>h. (\<forall>x\<in>{0..1}. cmod (l (\<gamma> x) * vector_derivative \<gamma> (at x) - h x) \<le> e) \<and> h integrable_on {0..1}"
 | |
| 68359 | 5538 | proof (intro exI conjI ballI) | 
| 68493 | 5539 | show "cmod (l (\<gamma> x) * vector_derivative \<gamma> (at x) - f a (\<gamma> x) * vector_derivative \<gamma> (at x)) \<le> e" | 
| 68359 | 5540 |         if "x \<in> {0..1}" for x
 | 
| 5541 | apply (rule order_trans [OF _ Ble]) | |
| 5542 | using noleB [OF that] fga [OF that] \<open>0 \<le> B\<close> \<open>0 < e\<close> | |
| 5543 | apply (simp add: norm_mult left_diff_distrib [symmetric] norm_minus_commute divide_simps) | |
| 5544 | apply (fastforce simp: mult_ac dest: mult_mono [OF less_imp_le]) | |
| 5545 | done | |
| 5546 | qed (rule inta) | |
| 61848 | 5547 | } | 
| 5548 | then show lintg: "l contour_integrable_on \<gamma>" | |
| 68493 | 5549 | unfolding contour_integrable_on by (metis (mono_tags, lifting)integrable_uniform_limit_real) | 
| 61848 | 5550 |   { fix e::real
 | 
| 63040 | 5551 | define B' where "B' = B + 1" | 
| 61848 | 5552 | have B': "B' > 0" "B' > B" using \<open>0 \<le> B\<close> by (auto simp: B'_def) | 
| 5553 | assume "0 < e" | |
| 5554 | then have ev_no': "\<forall>\<^sub>F n in F. \<forall>x\<in>path_image \<gamma>. 2 * cmod (f n x - l x) < e / B'" | |
| 68493 | 5555 | using ul_f [unfolded uniform_limit_iff dist_norm, rule_format, of "e / B' / 2"] B' | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5556 | by (simp add: field_simps) | 
| 61848 | 5557 |     have ie: "integral {0..1::real} (\<lambda>x. e / 2) < e" using \<open>0 < e\<close> by simp
 | 
| 5558 | have *: "cmod (f x (\<gamma> t) * vector_derivative \<gamma> (at t) - l (\<gamma> t) * vector_derivative \<gamma> (at t)) \<le> e / 2" | |
| 5559 |              if t: "t\<in>{0..1}" and leB': "2 * cmod (f x (\<gamma> t) - l (\<gamma> t)) < e / B'" for x t
 | |
| 5560 | proof - | |
| 5561 | have "2 * cmod (f x (\<gamma> t) - l (\<gamma> t)) * cmod (vector_derivative \<gamma> (at t)) \<le> e * (B/ B')" | |
| 5562 | using mult_mono [OF less_imp_le [OF leB'] noleB] B' \<open>0 < e\<close> t by auto | |
| 68339 | 5563 | also have "\<dots> < e" | 
| 61848 | 5564 | by (simp add: B' \<open>0 < e\<close> mult_imp_div_pos_less) | 
| 5565 | finally have "2 * cmod (f x (\<gamma> t) - l (\<gamma> t)) * cmod (vector_derivative \<gamma> (at t)) < e" . | |
| 5566 | then show ?thesis | |
| 5567 | by (simp add: left_diff_distrib [symmetric] norm_mult) | |
| 5568 | qed | |
| 68359 | 5569 |     have le_e: "\<And>x. \<lbrakk>\<forall>xa\<in>{0..1}. 2 * cmod (f x (\<gamma> xa) - l (\<gamma> xa)) < e / B'; f x contour_integrable_on \<gamma>\<rbrakk>
 | 
| 5570 |          \<Longrightarrow> cmod (integral {0..1}
 | |
| 5571 | (\<lambda>u. f x (\<gamma> u) * vector_derivative \<gamma> (at u) - l (\<gamma> u) * vector_derivative \<gamma> (at u))) < e" | |
| 5572 | apply (rule le_less_trans [OF integral_norm_bound_integral ie]) | |
| 5573 | apply (simp add: lintg integrable_diff contour_integrable_on [symmetric]) | |
| 5574 | apply (blast intro: *)+ | |
| 5575 | done | |
| 61848 | 5576 | have "\<forall>\<^sub>F x in F. dist (contour_integral \<gamma> (f x)) (contour_integral \<gamma> l) < e" | 
| 5577 | apply (rule eventually_mono [OF eventually_conj [OF ev_no' ev_fint]]) | |
| 5578 | apply (simp add: dist_norm contour_integrable_on path_image_def contour_integral_integral) | |
| 68359 | 5579 | apply (simp add: lintg integral_diff [symmetric] contour_integrable_on [symmetric] le_e) | 
| 61848 | 5580 | done | 
| 5581 | } | |
| 61973 | 5582 | then show "((\<lambda>n. contour_integral \<gamma> (f n)) \<longlongrightarrow> contour_integral \<gamma> l) F" | 
| 61848 | 5583 | by (rule tendstoI) | 
| 5584 | qed | |
| 5585 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5586 | corollary%unimportant contour_integral_uniform_limit_circlepath: | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5587 | assumes "\<forall>\<^sub>F n::'a in F. (f n) contour_integrable_on (circlepath z r)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5588 | and "uniform_limit (sphere z r) f l F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5589 | and "~ (trivial_limit F)" "0 < r" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5590 | shows "l contour_integrable_on (circlepath z r)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5591 | "((\<lambda>n. contour_integral (circlepath z r) (f n)) \<longlongrightarrow> contour_integral (circlepath z r) l) F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5592 | using assms by (auto simp: vector_derivative_circlepath norm_mult intro!: contour_integral_uniform_limit) | 
| 61848 | 5593 | |
| 5594 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5595 | subsection%unimportant \<open>General stepping result for derivative formulas\<close> | 
| 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5596 | |
| 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5597 | lemma Cauchy_next_derivative: | 
| 61848 | 5598 | assumes "continuous_on (path_image \<gamma>) f'" | 
| 5599 |       and leB: "\<And>t. t \<in> {0..1} \<Longrightarrow> norm (vector_derivative \<gamma> (at t)) \<le> B"
 | |
| 5600 | and int: "\<And>w. w \<in> s - path_image \<gamma> \<Longrightarrow> ((\<lambda>u. f' u / (u - w)^k) has_contour_integral f w) \<gamma>" | |
| 5601 | and k: "k \<noteq> 0" | |
| 5602 | and "open s" | |
| 5603 | and \<gamma>: "valid_path \<gamma>" | |
| 5604 | and w: "w \<in> s - path_image \<gamma>" | |
| 5605 | shows "(\<lambda>u. f' u / (u - w)^(Suc k)) contour_integrable_on \<gamma>" | |
| 5606 | and "(f has_field_derivative (k * contour_integral \<gamma> (\<lambda>u. f' u/(u - w)^(Suc k)))) | |
| 5607 | (at w)" (is "?thes2") | |
| 5608 | proof - | |
| 5609 | have "open (s - path_image \<gamma>)" using \<open>open s\<close> closed_valid_path_image \<gamma> by blast | |
| 5610 | then obtain d where "d>0" and d: "ball w d \<subseteq> s - path_image \<gamma>" using w | |
| 5611 | using open_contains_ball by blast | |
| 5612 | have [simp]: "\<And>n. cmod (1 + of_nat n) = 1 + of_nat n" | |
| 5613 | by (metis norm_of_nat of_nat_Suc) | |
| 68359 | 5614 | have cint: "\<And>x. \<lbrakk>x \<noteq> w; cmod (x - w) < d\<rbrakk> | 
| 5615 | \<Longrightarrow> (\<lambda>z. (f' z / (z - x) ^ k - f' z / (z - w) ^ k) / (x * k - w * k)) contour_integrable_on \<gamma>" | |
| 5616 | apply (rule contour_integrable_div [OF contour_integrable_diff]) | |
| 5617 | using int w d | |
| 5618 | by (force simp: dist_norm norm_minus_commute intro!: has_contour_integral_integrable)+ | |
| 61848 | 5619 | have 1: "\<forall>\<^sub>F n in at w. (\<lambda>x. f' x * (inverse (x - n) ^ k - inverse (x - w) ^ k) / (n - w) / of_nat k) | 
| 5620 | contour_integrable_on \<gamma>" | |
| 68359 | 5621 | unfolding eventually_at | 
| 61848 | 5622 | apply (rule_tac x=d in exI) | 
| 68359 | 5623 | apply (simp add: \<open>d > 0\<close> dist_norm field_simps cint) | 
| 61848 | 5624 | done | 
| 5625 | have bim_g: "bounded (image f' (path_image \<gamma>))" | |
| 5626 | by (simp add: compact_imp_bounded compact_continuous_image compact_valid_path_image assms) | |
| 5627 | then obtain C where "C > 0" and C: "\<And>x. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> cmod (f' (\<gamma> x)) \<le> C" | |
| 5628 | by (force simp: bounded_pos path_image_def) | |
| 5629 | have twom: "\<forall>\<^sub>F n in at w. | |
| 5630 | \<forall>x\<in>path_image \<gamma>. | |
| 5631 | cmod ((inverse (x - n) ^ k - inverse (x - w) ^ k) / (n - w) / k - inverse (x - w) ^ Suc k) < e" | |
| 5632 | if "0 < e" for e | |
| 5633 | proof - | |
| 5634 | have *: "cmod ((inverse (x - u) ^ k - inverse (x - w) ^ k) / ((u - w) * k) - inverse (x - w) ^ Suc k) < e" | |
| 5635 | if x: "x \<in> path_image \<gamma>" and "u \<noteq> w" and uwd: "cmod (u - w) < d/2" | |
| 68359 | 5636 | and uw_less: "cmod (u - w) < e * (d/2) ^ (k+2) / (1 + real k)" | 
| 61848 | 5637 | for u x | 
| 5638 | proof - | |
| 63040 | 5639 | define ff where [abs_def]: | 
| 5640 | "ff n w = | |
| 5641 | (if n = 0 then inverse(x - w)^k | |
| 5642 | else if n = 1 then k / (x - w)^(Suc k) | |
| 5643 | else (k * of_real(Suc k)) / (x - w)^(k + 2))" for n :: nat and w | |
| 61848 | 5644 | have km1: "\<And>z::complex. z \<noteq> 0 \<Longrightarrow> z ^ (k - Suc 0) = z ^ k / z" | 
| 5645 | by (simp add: field_simps) (metis Suc_pred \<open>k \<noteq> 0\<close> neq0_conv power_Suc) | |
| 68359 | 5646 | have ff1: "(ff i has_field_derivative ff (Suc i) z) (at z within ball w (d/2))" | 
| 5647 | if "z \<in> ball w (d/2)" "i \<le> 1" for i z | |
| 61848 | 5648 | proof - | 
| 5649 | have "z \<notin> path_image \<gamma>" | |
| 5650 | using \<open>x \<in> path_image \<gamma>\<close> d that ball_divide_subset_numeral by blast | |
| 5651 | then have xz[simp]: "x \<noteq> z" using \<open>x \<in> path_image \<gamma>\<close> by blast | |
| 5652 | then have neq: "x * x + z * z \<noteq> x * (z * 2)" | |
| 5653 | by (blast intro: dest!: sum_sqs_eq) | |
| 5654 | with xz have "\<And>v. v \<noteq> 0 \<Longrightarrow> (x * x + z * z) * v \<noteq> (x * (z * 2) * v)" by auto | |
| 5655 | then have neqq: "\<And>v. v \<noteq> 0 \<Longrightarrow> x * (x * v) + z * (z * v) \<noteq> x * (z * (2 * v))" | |
| 5656 | by (simp add: algebra_simps) | |
| 5657 | show ?thesis using \<open>i \<le> 1\<close> | |
| 5658 | apply (simp add: ff_def dist_norm Nat.le_Suc_eq km1, safe) | |
| 5659 | apply (rule derivative_eq_intros | simp add: km1 | simp add: field_simps neq neqq)+ | |
| 5660 | done | |
| 5661 | qed | |
| 5662 |       { fix a::real and b::real assume ab: "a > 0" "b > 0"
 | |
| 5663 | then have "k * (1 + real k) * (1 / a) \<le> k * (1 + real k) * (4 / b) \<longleftrightarrow> b \<le> 4 * a" | |
| 68359 | 5664 | by (subst mult_le_cancel_left_pos) (use \<open>k \<noteq> 0\<close> in \<open>auto simp: divide_simps\<close>) | 
| 61848 | 5665 | with ab have "real k * (1 + real k) / a \<le> (real k * 4 + real k * real k * 4) / b \<longleftrightarrow> b \<le> 4 * a" | 
| 5666 | by (simp add: field_simps) | |
| 5667 | } note canc = this | |
| 68359 | 5668 | have ff2: "cmod (ff (Suc 1) v) \<le> real (k * (k + 1)) / (d/2) ^ (k + 2)" | 
| 5669 | if "v \<in> ball w (d/2)" for v | |
| 61848 | 5670 | proof - | 
| 68359 | 5671 | have lessd: "\<And>z. cmod (\<gamma> z - v) < d/2 \<Longrightarrow> cmod (w - \<gamma> z) < d" | 
| 5672 | by (metis that norm_minus_commute norm_triangle_half_r dist_norm mem_ball) | |
| 61848 | 5673 | have "d/2 \<le> cmod (x - v)" using d x that | 
| 68359 | 5674 | using lessd d x | 
| 5675 | by (auto simp add: dist_norm path_image_def ball_def not_less [symmetric] del: divide_const_simps) | |
| 61848 | 5676 | then have "d \<le> cmod (x - v) * 2" | 
| 5677 | by (simp add: divide_simps) | |
| 5678 | then have dpow_le: "d ^ (k+2) \<le> (cmod (x - v) * 2) ^ (k+2)" | |
| 5679 | using \<open>0 < d\<close> order_less_imp_le power_mono by blast | |
| 5680 | have "x \<noteq> v" using that | |
| 5681 | using \<open>x \<in> path_image \<gamma>\<close> ball_divide_subset_numeral d by fastforce | |
| 5682 | then show ?thesis | |
| 68359 | 5683 | using \<open>d > 0\<close> apply (simp add: ff_def norm_mult norm_divide norm_power dist_norm canc) | 
| 5684 | using dpow_le apply (simp add: algebra_simps divide_simps mult_less_0_iff) | |
| 61848 | 5685 | done | 
| 5686 | qed | |
| 68359 | 5687 | have ub: "u \<in> ball w (d/2)" | 
| 61848 | 5688 | using uwd by (simp add: dist_commute dist_norm) | 
| 5689 | have "cmod (inverse (x - u) ^ k - (inverse (x - w) ^ k + of_nat k * (u - w) / ((x - w) * (x - w) ^ k))) | |
| 68359 | 5690 | \<le> (real k * 4 + real k * real k * 4) * (cmod (u - w) * cmod (u - w)) / (d * (d * (d/2) ^ k))" | 
| 61848 | 5691 | using complex_taylor [OF _ ff1 ff2 _ ub, of w, simplified] | 
| 5692 | by (simp add: ff_def \<open>0 < d\<close>) | |
| 5693 | then have "cmod (inverse (x - u) ^ k - (inverse (x - w) ^ k + of_nat k * (u - w) / ((x - w) * (x - w) ^ k))) | |
| 68359 | 5694 | \<le> (cmod (u - w) * real k) * (1 + real k) * cmod (u - w) / (d/2) ^ (k+2)" | 
| 61848 | 5695 | by (simp add: field_simps) | 
| 5696 | then have "cmod (inverse (x - u) ^ k - (inverse (x - w) ^ k + of_nat k * (u - w) / ((x - w) * (x - w) ^ k))) | |
| 5697 | / (cmod (u - w) * real k) | |
| 68359 | 5698 | \<le> (1 + real k) * cmod (u - w) / (d/2) ^ (k+2)" | 
| 61848 | 5699 | using \<open>k \<noteq> 0\<close> \<open>u \<noteq> w\<close> by (simp add: mult_ac zero_less_mult_iff pos_divide_le_eq) | 
| 68339 | 5700 | also have "\<dots> < e" | 
| 61848 | 5701 | using uw_less \<open>0 < d\<close> by (simp add: mult_ac divide_simps) | 
| 5702 | finally have e: "cmod (inverse (x-u)^k - (inverse (x-w)^k + of_nat k * (u-w) / ((x-w) * (x-w)^k))) | |
| 5703 | / cmod ((u - w) * real k) < e" | |
| 5704 | by (simp add: norm_mult) | |
| 5705 | have "x \<noteq> u" | |
| 5706 | using uwd \<open>0 < d\<close> x d by (force simp: dist_norm ball_def norm_minus_commute) | |
| 5707 | show ?thesis | |
| 5708 | apply (rule le_less_trans [OF _ e]) | |
| 68359 | 5709 | using \<open>k \<noteq> 0\<close> \<open>x \<noteq> u\<close> \<open>u \<noteq> w\<close> | 
| 61848 | 5710 | apply (simp add: field_simps norm_divide [symmetric]) | 
| 5711 | done | |
| 5712 | qed | |
| 5713 | show ?thesis | |
| 5714 | unfolding eventually_at | |
| 5715 | apply (rule_tac x = "min (d/2) ((e*(d/2)^(k + 2))/(Suc k))" in exI) | |
| 5716 | apply (force simp: \<open>d > 0\<close> dist_norm that simp del: power_Suc intro: *) | |
| 5717 | done | |
| 5718 | qed | |
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5719 | have 2: "uniform_limit (path_image \<gamma>) (\<lambda>n x. f' x * (inverse (x - n) ^ k - inverse (x - w) ^ k) / (n - w) / of_nat k) (\<lambda>x. f' x / (x - w) ^ Suc k) (at w)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5720 | unfolding uniform_limit_iff dist_norm | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5721 | proof clarify | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5722 | fix e::real | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5723 | assume "0 < e" | 
| 61848 | 5724 | have *: "cmod (f' (\<gamma> x) * (inverse (\<gamma> x - u) ^ k - inverse (\<gamma> x - w) ^ k) / ((u - w) * k) - | 
| 5725 | f' (\<gamma> x) / ((\<gamma> x - w) * (\<gamma> x - w) ^ k)) < e" | |
| 5726 | if ec: "cmod ((inverse (\<gamma> x - u) ^ k - inverse (\<gamma> x - w) ^ k) / ((u - w) * k) - | |
| 5727 | inverse (\<gamma> x - w) * inverse (\<gamma> x - w) ^ k) < e / C" | |
| 5728 | and x: "0 \<le> x" "x \<le> 1" | |
| 5729 | for u x | |
| 5730 | proof (cases "(f' (\<gamma> x)) = 0") | |
| 5731 | case True then show ?thesis by (simp add: \<open>0 < e\<close>) | |
| 5732 | next | |
| 5733 | case False | |
| 5734 | have "cmod (f' (\<gamma> x) * (inverse (\<gamma> x - u) ^ k - inverse (\<gamma> x - w) ^ k) / ((u - w) * k) - | |
| 5735 | f' (\<gamma> x) / ((\<gamma> x - w) * (\<gamma> x - w) ^ k)) = | |
| 5736 | cmod (f' (\<gamma> x) * ((inverse (\<gamma> x - u) ^ k - inverse (\<gamma> x - w) ^ k) / ((u - w) * k) - | |
| 5737 | inverse (\<gamma> x - w) * inverse (\<gamma> x - w) ^ k))" | |
| 5738 | by (simp add: field_simps) | |
| 68339 | 5739 | also have "\<dots> = cmod (f' (\<gamma> x)) * | 
| 61848 | 5740 | cmod ((inverse (\<gamma> x - u) ^ k - inverse (\<gamma> x - w) ^ k) / ((u - w) * k) - | 
| 5741 | inverse (\<gamma> x - w) * inverse (\<gamma> x - w) ^ k)" | |
| 5742 | by (simp add: norm_mult) | |
| 68339 | 5743 | also have "\<dots> < cmod (f' (\<gamma> x)) * (e/C)" | 
| 68359 | 5744 | using False mult_strict_left_mono [OF ec] by force | 
| 68339 | 5745 | also have "\<dots> \<le> e" using C | 
| 61848 | 5746 | by (metis False \<open>0 < e\<close> frac_le less_eq_real_def mult.commute pos_le_divide_eq x zero_less_norm_iff) | 
| 5747 | finally show ?thesis . | |
| 5748 | qed | |
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5749 | show "\<forall>\<^sub>F n in at w. | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5750 | \<forall>x\<in>path_image \<gamma>. | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5751 | cmod (f' x * (inverse (x - n) ^ k - inverse (x - w) ^ k) / (n - w) / of_nat k - f' x / (x - w) ^ Suc k) < e" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5752 | using twom [OF divide_pos_pos [OF \<open>0 < e\<close> \<open>C > 0\<close>]] unfolding path_image_def | 
| 61848 | 5753 | by (force intro: * elim: eventually_mono) | 
| 5754 | qed | |
| 5755 | show "(\<lambda>u. f' u / (u - w) ^ (Suc k)) contour_integrable_on \<gamma>" | |
| 5756 | by (rule contour_integral_uniform_limit [OF 1 2 leB \<gamma>]) auto | |
| 5757 | have *: "(\<lambda>n. contour_integral \<gamma> (\<lambda>x. f' x * (inverse (x - n) ^ k - inverse (x - w) ^ k) / (n - w) / k)) | |
| 61976 | 5758 | \<midarrow>w\<rightarrow> contour_integral \<gamma> (\<lambda>u. f' u / (u - w) ^ (Suc k))" | 
| 61848 | 5759 | by (rule contour_integral_uniform_limit [OF 1 2 leB \<gamma>]) auto | 
| 5760 | have **: "contour_integral \<gamma> (\<lambda>x. f' x * (inverse (x - u) ^ k - inverse (x - w) ^ k) / ((u - w) * k)) = | |
| 5761 | (f u - f w) / (u - w) / k" | |
| 68359 | 5762 | if "dist u w < d" for u | 
| 5763 | proof - | |
| 5764 | have u: "u \<in> s - path_image \<gamma>" | |
| 5765 | by (metis subsetD d dist_commute mem_ball that) | |
| 5766 | show ?thesis | |
| 5767 | apply (rule contour_integral_unique) | |
| 5768 | apply (simp add: diff_divide_distrib algebra_simps) | |
| 5769 | apply (intro has_contour_integral_diff has_contour_integral_div) | |
| 5770 | using u w apply (simp_all add: field_simps int) | |
| 5771 | done | |
| 5772 | qed | |
| 61848 | 5773 | show ?thes2 | 
| 68239 | 5774 | apply (simp add: has_field_derivative_iff del: power_Suc) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5775 | apply (rule Lim_transform_within [OF tendsto_mult_left [OF *] \<open>0 < d\<close> ]) | 
| 61848 | 5776 | apply (simp add: \<open>k \<noteq> 0\<close> **) | 
| 5777 | done | |
| 5778 | qed | |
| 5779 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5780 | lemma Cauchy_next_derivative_circlepath: | 
| 61848 | 5781 | assumes contf: "continuous_on (path_image (circlepath z r)) f" | 
| 5782 | and int: "\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w)^k) has_contour_integral g w) (circlepath z r)" | |
| 5783 | and k: "k \<noteq> 0" | |
| 5784 | and w: "w \<in> ball z r" | |
| 5785 | shows "(\<lambda>u. f u / (u - w)^(Suc k)) contour_integrable_on (circlepath z r)" | |
| 5786 | (is "?thes1") | |
| 5787 | and "(g has_field_derivative (k * contour_integral (circlepath z r) (\<lambda>u. f u/(u - w)^(Suc k)))) (at w)" | |
| 5788 | (is "?thes2") | |
| 5789 | proof - | |
| 5790 | have "r > 0" using w | |
| 5791 | using ball_eq_empty by fastforce | |
| 5792 | have wim: "w \<in> ball z r - path_image (circlepath z r)" | |
| 5793 | using w by (auto simp: dist_norm) | |
| 5794 | show ?thes1 ?thes2 | |
| 5795 | by (rule Cauchy_next_derivative [OF contf _ int k open_ball valid_path_circlepath wim, where B = "2 * pi * \<bar>r\<bar>"]; | |
| 5796 | auto simp: vector_derivative_circlepath norm_mult)+ | |
| 5797 | qed | |
| 5798 | ||
| 5799 | ||
| 5800 | text\<open> In particular, the first derivative formula.\<close> | |
| 5801 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 5802 | lemma Cauchy_derivative_integral_circlepath: | 
| 61848 | 5803 | assumes contf: "continuous_on (cball z r) f" | 
| 5804 | and holf: "f holomorphic_on ball z r" | |
| 5805 | and w: "w \<in> ball z r" | |
| 5806 | shows "(\<lambda>u. f u/(u - w)^2) contour_integrable_on (circlepath z r)" | |
| 5807 | (is "?thes1") | |
| 63589 | 5808 | and "(f has_field_derivative (1 / (2 * of_real pi * \<i>) * contour_integral(circlepath z r) (\<lambda>u. f u / (u - w)^2))) (at w)" | 
| 61848 | 5809 | (is "?thes2") | 
| 5810 | proof - | |
| 5811 | have [simp]: "r \<ge> 0" using w | |
| 5812 | using ball_eq_empty by fastforce | |
| 5813 | have f: "continuous_on (path_image (circlepath z r)) f" | |
| 68339 | 5814 | by (rule continuous_on_subset [OF contf]) (force simp: cball_def sphere_def) | 
| 61848 | 5815 | have int: "\<And>w. dist z w < r \<Longrightarrow> | 
| 63589 | 5816 | ((\<lambda>u. f u / (u - w)) has_contour_integral (\<lambda>x. 2 * of_real pi * \<i> * f x) w) (circlepath z r)" | 
| 61848 | 5817 | by (rule Cauchy_integral_circlepath [OF contf holf]) (simp add: dist_norm norm_minus_commute) | 
| 5818 | show ?thes1 | |
| 5819 | apply (simp add: power2_eq_square) | |
| 5820 | apply (rule Cauchy_next_derivative_circlepath [OF f _ _ w, where k=1, simplified]) | |
| 5821 | apply (blast intro: int) | |
| 5822 | done | |
| 5823 | have "((\<lambda>x. 2 * of_real pi * \<i> * f x) has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)^2)) (at w)" | |
| 5824 | apply (simp add: power2_eq_square) | |
| 63589 | 5825 | apply (rule Cauchy_next_derivative_circlepath [OF f _ _ w, where k=1 and g = "\<lambda>x. 2 * of_real pi * \<i> * f x", simplified]) | 
| 61848 | 5826 | apply (blast intro: int) | 
| 5827 | done | |
| 5828 | then have fder: "(f has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)^2) / (2 * of_real pi * \<i>)) (at w)" | |
| 5829 | by (rule DERIV_cdivide [where f = "\<lambda>x. 2 * of_real pi * \<i> * f x" and c = "2 * of_real pi * \<i>", simplified]) | |
| 5830 | show ?thes2 | |
| 5831 | by simp (rule fder) | |
| 5832 | qed | |
| 5833 | ||
| 67968 | 5834 | subsection\<open>Existence of all higher derivatives\<close> | 
| 61848 | 5835 | |
| 5836 | proposition derivative_is_holomorphic: | |
| 68359 | 5837 | assumes "open S" | 
| 5838 | and fder: "\<And>z. z \<in> S \<Longrightarrow> (f has_field_derivative f' z) (at z)" | |
| 5839 | shows "f' holomorphic_on S" | |
| 61848 | 5840 | proof - | 
| 68359 | 5841 | have *: "\<exists>h. (f' has_field_derivative h) (at z)" if "z \<in> S" for z | 
| 61848 | 5842 | proof - | 
| 68359 | 5843 | obtain r where "r > 0" and r: "cball z r \<subseteq> S" | 
| 5844 | using open_contains_cball \<open>z \<in> S\<close> \<open>open S\<close> by blast | |
| 61848 | 5845 | then have holf_cball: "f holomorphic_on cball z r" | 
| 5846 | apply (simp add: holomorphic_on_def) | |
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 5847 | using field_differentiable_at_within field_differentiable_def fder by blast | 
| 61848 | 5848 | then have "continuous_on (path_image (circlepath z r)) f" | 
| 5849 | using \<open>r > 0\<close> by (force elim: holomorphic_on_subset [THEN holomorphic_on_imp_continuous_on]) | |
| 63589 | 5850 | then have contfpi: "continuous_on (path_image (circlepath z r)) (\<lambda>x. 1/(2 * of_real pi*\<i>) * f x)" | 
| 61848 | 5851 | by (auto intro: continuous_intros)+ | 
| 5852 | have contf_cball: "continuous_on (cball z r) f" using holf_cball | |
| 5853 | by (simp add: holomorphic_on_imp_continuous_on holomorphic_on_subset) | |
| 5854 | have holf_ball: "f holomorphic_on ball z r" using holf_cball | |
| 5855 | using ball_subset_cball holomorphic_on_subset by blast | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5856 |     { fix w  assume w: "w \<in> ball z r"
 | 
| 61848 | 5857 | have intf: "(\<lambda>u. f u / (u - w)\<^sup>2) contour_integrable_on circlepath z r" | 
| 5858 | by (blast intro: w Cauchy_derivative_integral_circlepath [OF contf_cball holf_ball]) | |
| 5859 | have fder': "(f has_field_derivative 1 / (2 * of_real pi * \<i>) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2)) | |
| 5860 | (at w)" | |
| 5861 | by (blast intro: w Cauchy_derivative_integral_circlepath [OF contf_cball holf_ball]) | |
| 5862 | have f'_eq: "f' w = contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2) / (2 * of_real pi * \<i>)" | |
| 5863 | using fder' ball_subset_cball r w by (force intro: DERIV_unique [OF fder]) | |
| 5864 | have "((\<lambda>u. f u / (u - w)\<^sup>2 / (2 * of_real pi * \<i>)) has_contour_integral | |
| 5865 | contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2) / (2 * of_real pi * \<i>)) | |
| 5866 | (circlepath z r)" | |
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 5867 | by (rule has_contour_integral_div [OF has_contour_integral_integral [OF intf]]) | 
| 61848 | 5868 | then have "((\<lambda>u. f u / (2 * of_real pi * \<i> * (u - w)\<^sup>2)) has_contour_integral | 
| 5869 | contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2) / (2 * of_real pi * \<i>)) | |
| 5870 | (circlepath z r)" | |
| 5871 | by (simp add: algebra_simps) | |
| 5872 | then have "((\<lambda>u. f u / (2 * of_real pi * \<i> * (u - w)\<^sup>2)) has_contour_integral f' w) (circlepath z r)" | |
| 5873 | by (simp add: f'_eq) | |
| 5874 | } note * = this | |
| 5875 | show ?thesis | |
| 5876 | apply (rule exI) | |
| 5877 | apply (rule Cauchy_next_derivative_circlepath [OF contfpi, of 2 f', simplified]) | |
| 5878 | apply (simp_all add: \<open>0 < r\<close> * dist_norm) | |
| 5879 | done | |
| 5880 | qed | |
| 5881 | show ?thesis | |
| 68359 | 5882 | by (simp add: holomorphic_on_open [OF \<open>open S\<close>] *) | 
| 61848 | 5883 | qed | 
| 5884 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5885 | lemma holomorphic_deriv [holomorphic_intros]: | 
| 68359 | 5886 | "\<lbrakk>f holomorphic_on S; open S\<rbrakk> \<Longrightarrow> (deriv f) holomorphic_on S" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 5887 | by (metis DERIV_deriv_iff_field_differentiable at_within_open derivative_is_holomorphic holomorphic_on_def) | 
| 61848 | 5888 | |
| 68359 | 5889 | lemma analytic_deriv [analytic_intros]: "f analytic_on S \<Longrightarrow> (deriv f) analytic_on S" | 
| 61848 | 5890 | using analytic_on_holomorphic holomorphic_deriv by auto | 
| 5891 | ||
| 68359 | 5892 | lemma holomorphic_higher_deriv [holomorphic_intros]: "\<lbrakk>f holomorphic_on S; open S\<rbrakk> \<Longrightarrow> (deriv ^^ n) f holomorphic_on S" | 
| 61848 | 5893 | by (induction n) (auto simp: holomorphic_deriv) | 
| 5894 | ||
| 68359 | 5895 | lemma analytic_higher_deriv [analytic_intros]: "f analytic_on S \<Longrightarrow> (deriv ^^ n) f analytic_on S" | 
| 61848 | 5896 | unfolding analytic_on_def using holomorphic_higher_deriv by blast | 
| 5897 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5898 | lemma has_field_derivative_higher_deriv: | 
| 68359 | 5899 | "\<lbrakk>f holomorphic_on S; open S; x \<in> S\<rbrakk> | 
| 61848 | 5900 | \<Longrightarrow> ((deriv ^^ n) f has_field_derivative (deriv ^^ (Suc n)) f x) (at x)" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 5901 | by (metis (no_types, hide_lams) DERIV_deriv_iff_field_differentiable at_within_open comp_apply | 
| 61848 | 5902 | funpow.simps(2) holomorphic_higher_deriv holomorphic_on_def) | 
| 5903 | ||
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 5904 | lemma valid_path_compose_holomorphic: | 
| 68359 | 5905 | assumes "valid_path g" and holo:"f holomorphic_on S" and "open S" "path_image g \<subseteq> S" | 
| 68339 | 5906 | shows "valid_path (f \<circ> g)" | 
| 62837 | 5907 | proof (rule valid_path_compose[OF \<open>valid_path g\<close>]) | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 5908 | fix x assume "x \<in> path_image g" | 
| 64394 | 5909 | then show "f field_differentiable at x" | 
| 5910 | using analytic_on_imp_differentiable_at analytic_on_open assms holo by blast | |
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 5911 | next | 
| 68359 | 5912 | have "deriv f holomorphic_on S" | 
| 5913 | using holomorphic_deriv holo \<open>open S\<close> by auto | |
| 62623 
dbc62f86a1a9
rationalisation of theorem names esp about "real Archimedian" etc.
 paulson <lp15@cam.ac.uk> parents: 
62620diff
changeset | 5914 | then show "continuous_on (path_image g) (deriv f)" | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 5915 | using assms(4) holomorphic_on_imp_continuous_on holomorphic_on_subset by auto | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 5916 | qed | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 5917 | |
| 61848 | 5918 | |
| 67968 | 5919 | subsection\<open>Morera's theorem\<close> | 
| 61848 | 5920 | |
| 5921 | lemma Morera_local_triangle_ball: | |
| 68359 | 5922 | assumes "\<And>z. z \<in> S | 
| 61848 | 5923 | \<Longrightarrow> \<exists>e a. 0 < e \<and> z \<in> ball a e \<and> continuous_on (ball a e) f \<and> | 
| 5924 | (\<forall>b c. closed_segment b c \<subseteq> ball a e | |
| 5925 | \<longrightarrow> contour_integral (linepath a b) f + | |
| 5926 | contour_integral (linepath b c) f + | |
| 5927 | contour_integral (linepath c a) f = 0)" | |
| 68359 | 5928 | shows "f analytic_on S" | 
| 61848 | 5929 | proof - | 
| 68359 | 5930 |   { fix z  assume "z \<in> S"
 | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5931 | with assms obtain e a where | 
| 61848 | 5932 | "0 < e" and z: "z \<in> ball a e" and contf: "continuous_on (ball a e) f" | 
| 5933 | and 0: "\<And>b c. closed_segment b c \<subseteq> ball a e | |
| 5934 | \<Longrightarrow> contour_integral (linepath a b) f + | |
| 5935 | contour_integral (linepath b c) f + | |
| 5936 | contour_integral (linepath c a) f = 0" | |
| 5937 | by fastforce | |
| 5938 | have az: "dist a z < e" using mem_ball z by blast | |
| 5939 | have sb_ball: "ball z (e - dist a z) \<subseteq> ball a e" | |
| 5940 | by (simp add: dist_commute ball_subset_ball_iff) | |
| 5941 | have "\<exists>e>0. f holomorphic_on ball z e" | |
| 68359 | 5942 | proof (intro exI conjI) | 
| 5943 | have sub_ball: "\<And>y. dist a y < e \<Longrightarrow> closed_segment a y \<subseteq> ball a e" | |
| 5944 | by (meson \<open>0 < e\<close> centre_in_ball convex_ball convex_contains_segment mem_ball) | |
| 5945 | show "f holomorphic_on ball z (e - dist a z)" | |
| 5946 | apply (rule holomorphic_on_subset [OF _ sb_ball]) | |
| 5947 | apply (rule derivative_is_holomorphic[OF open_ball]) | |
| 5948 | apply (rule triangle_contour_integrals_starlike_primitive [OF contf _ open_ball, of a]) | |
| 5949 | apply (simp_all add: 0 \<open>0 < e\<close> sub_ball) | |
| 5950 | done | |
| 5951 | qed (simp add: az) | |
| 61848 | 5952 | } | 
| 5953 | then show ?thesis | |
| 5954 | by (simp add: analytic_on_def) | |
| 5955 | qed | |
| 5956 | ||
| 5957 | lemma Morera_local_triangle: | |
| 68359 | 5958 | assumes "\<And>z. z \<in> S | 
| 61848 | 5959 | \<Longrightarrow> \<exists>t. open t \<and> z \<in> t \<and> continuous_on t f \<and> | 
| 5960 |                   (\<forall>a b c. convex hull {a,b,c} \<subseteq> t
 | |
| 5961 | \<longrightarrow> contour_integral (linepath a b) f + | |
| 5962 | contour_integral (linepath b c) f + | |
| 5963 | contour_integral (linepath c a) f = 0)" | |
| 68359 | 5964 | shows "f analytic_on S" | 
| 61848 | 5965 | proof - | 
| 68359 | 5966 |   { fix z  assume "z \<in> S"
 | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5967 | with assms obtain t where | 
| 61848 | 5968 | "open t" and z: "z \<in> t" and contf: "continuous_on t f" | 
| 5969 |         and 0: "\<And>a b c. convex hull {a,b,c} \<subseteq> t
 | |
| 5970 | \<Longrightarrow> contour_integral (linepath a b) f + | |
| 5971 | contour_integral (linepath b c) f + | |
| 5972 | contour_integral (linepath c a) f = 0" | |
| 5973 | by force | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5974 | then obtain e where "e>0" and e: "ball z e \<subseteq> t" | 
| 61848 | 5975 | using open_contains_ball by blast | 
| 5976 | have [simp]: "continuous_on (ball z e) f" using contf | |
| 5977 | using continuous_on_subset e by blast | |
| 68359 | 5978 | have eq0: "\<And>b c. closed_segment b c \<subseteq> ball z e \<Longrightarrow> | 
| 5979 | contour_integral (linepath z b) f + | |
| 5980 | contour_integral (linepath b c) f + | |
| 5981 | contour_integral (linepath c z) f = 0" | |
| 5982 | by (meson 0 z \<open>0 < e\<close> centre_in_ball closed_segment_subset convex_ball dual_order.trans e starlike_convex_subset) | |
| 5983 | have "\<exists>e a. 0 < e \<and> z \<in> ball a e \<and> continuous_on (ball a e) f \<and> | |
| 5984 | (\<forall>b c. closed_segment b c \<subseteq> ball a e \<longrightarrow> | |
| 5985 | contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0)" | |
| 5986 | using \<open>e > 0\<close> eq0 by force | |
| 61848 | 5987 | } | 
| 5988 | then show ?thesis | |
| 5989 | by (simp add: Morera_local_triangle_ball) | |
| 5990 | qed | |
| 5991 | ||
| 5992 | proposition Morera_triangle: | |
| 68359 | 5993 | "\<lbrakk>continuous_on S f; open S; | 
| 5994 |       \<And>a b c. convex hull {a,b,c} \<subseteq> S
 | |
| 61848 | 5995 | \<longrightarrow> contour_integral (linepath a b) f + | 
| 5996 | contour_integral (linepath b c) f + | |
| 5997 | contour_integral (linepath c a) f = 0\<rbrakk> | |
| 68359 | 5998 | \<Longrightarrow> f analytic_on S" | 
| 61848 | 5999 | using Morera_local_triangle by blast | 
| 6000 | ||
| 67968 | 6001 | subsection\<open>Combining theorems for higher derivatives including Leibniz rule\<close> | 
| 61848 | 6002 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6003 | lemma higher_deriv_linear [simp]: | 
| 61848 | 6004 | "(deriv ^^ n) (\<lambda>w. c*w) = (\<lambda>z. if n = 0 then c*z else if n = 1 then c else 0)" | 
| 68359 | 6005 | by (induction n) auto | 
| 61848 | 6006 | |
| 6007 | lemma higher_deriv_const [simp]: "(deriv ^^ n) (\<lambda>w. c) = (\<lambda>w. if n=0 then c else 0)" | |
| 68359 | 6008 | by (induction n) auto | 
| 61848 | 6009 | |
| 6010 | lemma higher_deriv_ident [simp]: | |
| 6011 | "(deriv ^^ n) (\<lambda>w. w) z = (if n = 0 then z else if n = 1 then 1 else 0)" | |
| 62217 | 6012 | apply (induction n, simp) | 
| 6013 | apply (metis higher_deriv_linear lambda_one) | |
| 61848 | 6014 | done | 
| 6015 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6016 | lemma higher_deriv_id [simp]: | 
| 61848 | 6017 | "(deriv ^^ n) id z = (if n = 0 then z else if n = 1 then 1 else 0)" | 
| 6018 | by (simp add: id_def) | |
| 6019 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6020 | lemma has_complex_derivative_funpow_1: | 
| 61848 | 6021 | "\<lbrakk>(f has_field_derivative 1) (at z); f z = z\<rbrakk> \<Longrightarrow> (f^^n has_field_derivative 1) (at z)" | 
| 68339 | 6022 | apply (induction n, auto) | 
| 61848 | 6023 | apply (metis DERIV_ident DERIV_transform_at id_apply zero_less_one) | 
| 6024 | by (metis DERIV_chain comp_funpow comp_id funpow_swap1 mult.right_neutral) | |
| 6025 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6026 | lemma higher_deriv_uminus: | 
| 68359 | 6027 | assumes "f holomorphic_on S" "open S" and z: "z \<in> S" | 
| 61848 | 6028 | shows "(deriv ^^ n) (\<lambda>w. -(f w)) z = - ((deriv ^^ n) f z)" | 
| 6029 | using z | |
| 6030 | proof (induction n arbitrary: z) | |
| 6031 | case 0 then show ?case by simp | |
| 6032 | next | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6033 | case (Suc n z) | 
| 61848 | 6034 | have *: "((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) z) (at z)" | 
| 6035 | using Suc.prems assms has_field_derivative_higher_deriv by auto | |
| 68359 | 6036 | have "((deriv ^^ n) (\<lambda>w. - f w) has_field_derivative - deriv ((deriv ^^ n) f) z) (at z)" | 
| 61848 | 6037 | apply (rule DERIV_transform_within_open [of "\<lambda>w. -((deriv ^^ n) f w)"]) | 
| 68359 | 6038 | apply (rule derivative_eq_intros | rule * refl assms)+ | 
| 6039 | apply (auto simp add: Suc) | |
| 61848 | 6040 | done | 
| 68359 | 6041 | then show ?case | 
| 6042 | by (simp add: DERIV_imp_deriv) | |
| 61848 | 6043 | qed | 
| 6044 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6045 | lemma higher_deriv_add: | 
| 61848 | 6046 | fixes z::complex | 
| 68359 | 6047 | assumes "f holomorphic_on S" "g holomorphic_on S" "open S" and z: "z \<in> S" | 
| 61848 | 6048 | shows "(deriv ^^ n) (\<lambda>w. f w + g w) z = (deriv ^^ n) f z + (deriv ^^ n) g z" | 
| 6049 | using z | |
| 6050 | proof (induction n arbitrary: z) | |
| 6051 | case 0 then show ?case by simp | |
| 6052 | next | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6053 | case (Suc n z) | 
| 61848 | 6054 | have *: "((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) z) (at z)" | 
| 6055 | "((deriv ^^ n) g has_field_derivative deriv ((deriv ^^ n) g) z) (at z)" | |
| 6056 | using Suc.prems assms has_field_derivative_higher_deriv by auto | |
| 68359 | 6057 | have "((deriv ^^ n) (\<lambda>w. f w + g w) has_field_derivative | 
| 6058 | deriv ((deriv ^^ n) f) z + deriv ((deriv ^^ n) g) z) (at z)" | |
| 61848 | 6059 | apply (rule DERIV_transform_within_open [of "\<lambda>w. (deriv ^^ n) f w + (deriv ^^ n) g w"]) | 
| 68359 | 6060 | apply (rule derivative_eq_intros | rule * refl assms)+ | 
| 6061 | apply (auto simp add: Suc) | |
| 61848 | 6062 | done | 
| 68359 | 6063 | then show ?case | 
| 6064 | by (simp add: DERIV_imp_deriv) | |
| 61848 | 6065 | qed | 
| 6066 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6067 | lemma higher_deriv_diff: | 
| 61848 | 6068 | fixes z::complex | 
| 68359 | 6069 | assumes "f holomorphic_on S" "g holomorphic_on S" "open S" and z: "z \<in> S" | 
| 61848 | 6070 | shows "(deriv ^^ n) (\<lambda>w. f w - g w) z = (deriv ^^ n) f z - (deriv ^^ n) g z" | 
| 6071 | apply (simp only: Groups.group_add_class.diff_conv_add_uminus higher_deriv_add) | |
| 6072 | apply (subst higher_deriv_add) | |
| 6073 | using assms holomorphic_on_minus apply (auto simp: higher_deriv_uminus) | |
| 6074 | done | |
| 6075 | ||
| 6076 | lemma bb: "Suc n choose k = (n choose k) + (if k = 0 then 0 else (n choose (k - 1)))" | |
| 63367 
6c731c8b7f03
simplified definitions of combinatorial functions
 haftmann parents: 
63262diff
changeset | 6077 | by (cases k) simp_all | 
| 61848 | 6078 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6079 | lemma higher_deriv_mult: | 
| 61848 | 6080 | fixes z::complex | 
| 68359 | 6081 | assumes "f holomorphic_on S" "g holomorphic_on S" "open S" and z: "z \<in> S" | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6082 | shows "(deriv ^^ n) (\<lambda>w. f w * g w) z = | 
| 61848 | 6083 | (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f z * (deriv ^^ (n - i)) g z)" | 
| 6084 | using z | |
| 6085 | proof (induction n arbitrary: z) | |
| 6086 | case 0 then show ?case by simp | |
| 6087 | next | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6088 | case (Suc n z) | 
| 61848 | 6089 | have *: "\<And>n. ((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) z) (at z)" | 
| 6090 | "\<And>n. ((deriv ^^ n) g has_field_derivative deriv ((deriv ^^ n) g) z) (at z)" | |
| 6091 | using Suc.prems assms has_field_derivative_higher_deriv by auto | |
| 6092 | have sumeq: "(\<Sum>i = 0..n. | |
| 6093 | of_nat (n choose i) * (deriv ((deriv ^^ i) f) z * (deriv ^^ (n - i)) g z + deriv ((deriv ^^ (n - i)) g) z * (deriv ^^ i) f z)) = | |
| 6094 | g z * deriv ((deriv ^^ n) f) z + (\<Sum>i = 0..n. (deriv ^^ i) f z * (of_nat (Suc n choose i) * (deriv ^^ (Suc n - i)) g z))" | |
| 64267 | 6095 | apply (simp add: bb algebra_simps sum.distrib) | 
| 6096 | apply (subst (4) sum_Suc_reindex) | |
| 6097 | apply (auto simp: algebra_simps Suc_diff_le intro: sum.cong) | |
| 61848 | 6098 | done | 
| 68359 | 6099 | have "((deriv ^^ n) (\<lambda>w. f w * g w) has_field_derivative | 
| 6100 | (\<Sum>i = 0..Suc n. (Suc n choose i) * (deriv ^^ i) f z * (deriv ^^ (Suc n - i)) g z)) | |
| 6101 | (at z)" | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6102 | apply (rule DERIV_transform_within_open | 
| 68359 | 6103 | [of "\<lambda>w. (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f w * (deriv ^^ (n - i)) g w)"]) | 
| 6104 | apply (simp add: algebra_simps) | |
| 6105 | apply (rule DERIV_cong [OF DERIV_sum]) | |
| 6106 | apply (rule DERIV_cmult) | |
| 6107 | apply (auto intro: DERIV_mult * sumeq \<open>open S\<close> Suc.prems Suc.IH [symmetric]) | |
| 61848 | 6108 | done | 
| 68359 | 6109 | then show ?case | 
| 6110 | unfolding funpow.simps o_apply | |
| 6111 | by (simp add: DERIV_imp_deriv) | |
| 61848 | 6112 | qed | 
| 6113 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6114 | lemma higher_deriv_transform_within_open: | 
| 61848 | 6115 | fixes z::complex | 
| 68359 | 6116 | assumes "f holomorphic_on S" "g holomorphic_on S" "open S" and z: "z \<in> S" | 
| 6117 | and fg: "\<And>w. w \<in> S \<Longrightarrow> f w = g w" | |
| 61848 | 6118 | shows "(deriv ^^ i) f z = (deriv ^^ i) g z" | 
| 6119 | using z | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6120 | by (induction i arbitrary: z) | 
| 61848 | 6121 | (auto simp: fg intro: complex_derivative_transform_within_open holomorphic_higher_deriv assms) | 
| 6122 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6123 | lemma higher_deriv_compose_linear: | 
| 61848 | 6124 | fixes z::complex | 
| 68359 | 6125 | assumes f: "f holomorphic_on T" and S: "open S" and T: "open T" and z: "z \<in> S" | 
| 6126 | and fg: "\<And>w. w \<in> S \<Longrightarrow> u * w \<in> T" | |
| 61848 | 6127 | shows "(deriv ^^ n) (\<lambda>w. f (u * w)) z = u^n * (deriv ^^ n) f (u * z)" | 
| 6128 | using z | |
| 6129 | proof (induction n arbitrary: z) | |
| 6130 | case 0 then show ?case by simp | |
| 6131 | next | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6132 | case (Suc n z) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 6133 | have holo0: "f holomorphic_on (*) u ` S" | 
| 61848 | 6134 | by (meson fg f holomorphic_on_subset image_subset_iff) | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 6135 | have holo2: "(deriv ^^ n) f holomorphic_on (*) u ` S" | 
| 68359 | 6136 | by (meson f fg holomorphic_higher_deriv holomorphic_on_subset image_subset_iff T) | 
| 6137 | have holo3: "(\<lambda>z. u ^ n * (deriv ^^ n) f (u * z)) holomorphic_on S" | |
| 6138 | by (intro holo2 holomorphic_on_compose [where g="(deriv ^^ n) f", unfolded o_def] holomorphic_intros) | |
| 6139 | have holo1: "(\<lambda>w. f (u * w)) holomorphic_on S" | |
| 61848 | 6140 | apply (rule holomorphic_on_compose [where g=f, unfolded o_def]) | 
| 6141 | apply (rule holo0 holomorphic_intros)+ | |
| 6142 | done | |
| 6143 | have "deriv ((deriv ^^ n) (\<lambda>w. f (u * w))) z = deriv (\<lambda>z. u^n * (deriv ^^ n) f (u*z)) z" | |
| 68359 | 6144 | apply (rule complex_derivative_transform_within_open [OF _ holo3 S Suc.prems]) | 
| 6145 | apply (rule holomorphic_higher_deriv [OF holo1 S]) | |
| 61848 | 6146 | apply (simp add: Suc.IH) | 
| 6147 | done | |
| 68339 | 6148 | also have "\<dots> = u^n * deriv (\<lambda>z. (deriv ^^ n) f (u * z)) z" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6149 | apply (rule deriv_cmult) | 
| 61848 | 6150 | apply (rule analytic_on_imp_differentiable_at [OF _ Suc.prems]) | 
| 68359 | 6151 | apply (rule analytic_on_compose_gen [where g="(deriv ^^ n) f" and T=T, unfolded o_def]) | 
| 68255 
009f783d1bac
small clean-up of Complex_Analysis_Basics
 paulson <lp15@cam.ac.uk> parents: 
68239diff
changeset | 6152 | apply (simp add: analytic_on_linear) | 
| 68359 | 6153 | apply (simp add: analytic_on_open f holomorphic_higher_deriv T) | 
| 61848 | 6154 | apply (blast intro: fg) | 
| 6155 | done | |
| 68339 | 6156 | also have "\<dots> = u * u ^ n * deriv ((deriv ^^ n) f) (u * z)" | 
| 69064 
5840724b1d71
Prefix form of infix with * on either side no longer needs special treatment
 nipkow parents: 
68721diff
changeset | 6157 | apply (subst complex_derivative_chain [where g = "(deriv ^^ n) f" and f = "(*) u", unfolded o_def]) | 
| 61848 | 6158 | apply (rule derivative_intros) | 
| 68359 | 6159 | using Suc.prems field_differentiable_def f fg has_field_derivative_higher_deriv T apply blast | 
| 61848 | 6160 | apply (simp add: deriv_linear) | 
| 6161 | done | |
| 6162 | finally show ?case | |
| 6163 | by simp | |
| 6164 | qed | |
| 6165 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6166 | lemma higher_deriv_add_at: | 
| 61848 | 6167 |   assumes "f analytic_on {z}" "g analytic_on {z}"
 | 
| 6168 | shows "(deriv ^^ n) (\<lambda>w. f w + g w) z = (deriv ^^ n) f z + (deriv ^^ n) g z" | |
| 6169 | proof - | |
| 6170 |   have "f analytic_on {z} \<and> g analytic_on {z}"
 | |
| 6171 | using assms by blast | |
| 6172 | with higher_deriv_add show ?thesis | |
| 6173 | by (auto simp: analytic_at_two) | |
| 6174 | qed | |
| 6175 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6176 | lemma higher_deriv_diff_at: | 
| 61848 | 6177 |   assumes "f analytic_on {z}" "g analytic_on {z}"
 | 
| 6178 | shows "(deriv ^^ n) (\<lambda>w. f w - g w) z = (deriv ^^ n) f z - (deriv ^^ n) g z" | |
| 6179 | proof - | |
| 6180 |   have "f analytic_on {z} \<and> g analytic_on {z}"
 | |
| 6181 | using assms by blast | |
| 6182 | with higher_deriv_diff show ?thesis | |
| 6183 | by (auto simp: analytic_at_two) | |
| 6184 | qed | |
| 6185 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6186 | lemma higher_deriv_uminus_at: | 
| 61848 | 6187 |    "f analytic_on {z}  \<Longrightarrow> (deriv ^^ n) (\<lambda>w. -(f w)) z = - ((deriv ^^ n) f z)"
 | 
| 6188 | using higher_deriv_uminus | |
| 6189 | by (auto simp: analytic_at) | |
| 6190 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6191 | lemma higher_deriv_mult_at: | 
| 61848 | 6192 |   assumes "f analytic_on {z}" "g analytic_on {z}"
 | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6193 | shows "(deriv ^^ n) (\<lambda>w. f w * g w) z = | 
| 61848 | 6194 | (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f z * (deriv ^^ (n - i)) g z)" | 
| 6195 | proof - | |
| 6196 |   have "f analytic_on {z} \<and> g analytic_on {z}"
 | |
| 6197 | using assms by blast | |
| 6198 | with higher_deriv_mult show ?thesis | |
| 6199 | by (auto simp: analytic_at_two) | |
| 6200 | qed | |
| 6201 | ||
| 6202 | ||
| 6203 | text\<open> Nonexistence of isolated singularities and a stronger integral formula.\<close> | |
| 6204 | ||
| 6205 | proposition no_isolated_singularity: | |
| 6206 | fixes z::complex | |
| 68359 | 6207 | assumes f: "continuous_on S f" and holf: "f holomorphic_on (S - K)" and S: "open S" and K: "finite K" | 
| 6208 | shows "f holomorphic_on S" | |
| 61848 | 6209 | proof - | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6210 |   { fix z
 | 
| 68371 | 6211 | assume "z \<in> S" and cdf: "\<And>x. x \<in> S - K \<Longrightarrow> f field_differentiable at x" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6212 | have "f field_differentiable at z" | 
| 68359 | 6213 | proof (cases "z \<in> K") | 
| 6214 | case False then show ?thesis by (blast intro: cdf \<open>z \<in> S\<close>) | |
| 61848 | 6215 | next | 
| 6216 | case True | |
| 68359 | 6217 | with finite_set_avoid [OF K, of z] | 
| 6218 | obtain d where "d>0" and d: "\<And>x. \<lbrakk>x\<in>K; x \<noteq> z\<rbrakk> \<Longrightarrow> d \<le> dist z x" | |
| 61848 | 6219 | by blast | 
| 68359 | 6220 | obtain e where "e>0" and e: "ball z e \<subseteq> S" | 
| 6221 | using S \<open>z \<in> S\<close> by (force simp: open_contains_ball) | |
| 61848 | 6222 | have fde: "continuous_on (ball z (min d e)) f" | 
| 6223 | by (metis Int_iff ball_min_Int continuous_on_subset e f subsetI) | |
| 68371 | 6224 |       have cont: "{a,b,c} \<subseteq> ball z (min d e) \<Longrightarrow> continuous_on (convex hull {a, b, c}) f" for a b c
 | 
| 6225 | by (simp add: hull_minimal continuous_on_subset [OF fde]) | |
| 6226 |       have fd: "\<lbrakk>{a,b,c} \<subseteq> ball z (min d e); x \<in> interior (convex hull {a, b, c}) - K\<rbrakk>
 | |
| 6227 | \<Longrightarrow> f field_differentiable at x" for a b c x | |
| 6228 | by (metis cdf Diff_iff Int_iff ball_min_Int subsetD convex_ball e interior_mono interior_subset subset_hull) | |
| 68310 | 6229 | obtain g where "\<And>w. w \<in> ball z (min d e) \<Longrightarrow> (g has_field_derivative f w) (at w within ball z (min d e))" | 
| 68493 | 6230 | apply (rule contour_integral_convex_primitive | 
| 68371 | 6231 | [OF convex_ball fde Cauchy_theorem_triangle_cofinite [OF _ K]]) | 
| 6232 | using cont fd by auto | |
| 61848 | 6233 | then have "f holomorphic_on ball z (min d e)" | 
| 6234 | by (metis open_ball at_within_open derivative_is_holomorphic) | |
| 6235 | then show ?thesis | |
| 6236 | unfolding holomorphic_on_def | |
| 6237 | by (metis open_ball \<open>0 < d\<close> \<open>0 < e\<close> at_within_open centre_in_ball min_less_iff_conj) | |
| 6238 | qed | |
| 6239 | } | |
| 68359 | 6240 | with holf S K show ?thesis | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6241 | by (simp add: holomorphic_on_open open_Diff finite_imp_closed field_differentiable_def [symmetric]) | 
| 61848 | 6242 | qed | 
| 6243 | ||
| 66286 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6244 | lemma no_isolated_singularity': | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6245 | fixes z::complex | 
| 68493 | 6246 | assumes f: "\<And>z. z \<in> K \<Longrightarrow> (f \<longlongrightarrow> f z) (at z within S)" | 
| 68359 | 6247 | and holf: "f holomorphic_on (S - K)" and S: "open S" and K: "finite K" | 
| 6248 | shows "f holomorphic_on S" | |
| 66286 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6249 | proof (rule no_isolated_singularity[OF _ assms(2-)]) | 
| 68359 | 6250 | show "continuous_on S f" unfolding continuous_on_def | 
| 66286 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6251 | proof | 
| 68359 | 6252 | fix z assume z: "z \<in> S" | 
| 6253 | show "(f \<longlongrightarrow> f z) (at z within S)" | |
| 6254 | proof (cases "z \<in> K") | |
| 66286 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6255 | case False | 
| 68493 | 6256 | from holf have "continuous_on (S - K) f" | 
| 66286 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6257 | by (rule holomorphic_on_imp_continuous_on) | 
| 68493 | 6258 | with z False have "(f \<longlongrightarrow> f z) (at z within (S - K))" | 
| 66286 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6259 | by (simp add: continuous_on_def) | 
| 68359 | 6260 | also from z K S False have "at z within (S - K) = at z within S" | 
| 66286 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6261 | by (subst (1 2) at_within_open) (auto intro: finite_imp_closed) | 
| 68359 | 6262 | finally show "(f \<longlongrightarrow> f z) (at z within S)" . | 
| 66286 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6263 | qed (insert assms z, simp_all) | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6264 | qed | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6265 | qed | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6266 | |
| 61848 | 6267 | proposition Cauchy_integral_formula_convex: | 
| 68371 | 6268 | assumes S: "convex S" and K: "finite K" and contf: "continuous_on S f" | 
| 6269 | and fcd: "(\<And>x. x \<in> interior S - K \<Longrightarrow> f field_differentiable at x)" | |
| 6270 | and z: "z \<in> interior S" and vpg: "valid_path \<gamma>" | |
| 6271 |     and pasz: "path_image \<gamma> \<subseteq> S - {z}" and loop: "pathfinish \<gamma> = pathstart \<gamma>"
 | |
| 6272 | shows "((\<lambda>w. f w / (w - z)) has_contour_integral (2*pi * \<i> * winding_number \<gamma> z * f z)) \<gamma>" | |
| 6273 | proof - | |
| 6274 | have *: "\<And>x. x \<in> interior S \<Longrightarrow> f field_differentiable at x" | |
| 6275 | unfolding holomorphic_on_open [symmetric] field_differentiable_def | |
| 6276 | using no_isolated_singularity [where S = "interior S"] | |
| 68493 | 6277 | by (meson K contf continuous_at_imp_continuous_on continuous_on_interior fcd | 
| 68371 | 6278 | field_differentiable_at_within field_differentiable_def holomorphic_onI | 
| 6279 | holomorphic_on_imp_differentiable_at open_interior) | |
| 6280 | show ?thesis | |
| 6281 | by (rule Cauchy_integral_formula_weak [OF S finite.emptyI contf]) (use * assms in auto) | |
| 6282 | qed | |
| 61848 | 6283 | |
| 6284 | text\<open> Formula for higher derivatives.\<close> | |
| 6285 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6286 | lemma Cauchy_has_contour_integral_higher_derivative_circlepath: | 
| 61848 | 6287 | assumes contf: "continuous_on (cball z r) f" | 
| 6288 | and holf: "f holomorphic_on ball z r" | |
| 6289 | and w: "w \<in> ball z r" | |
| 63589 | 6290 | shows "((\<lambda>u. f u / (u - w) ^ (Suc k)) has_contour_integral ((2 * pi * \<i>) / (fact k) * (deriv ^^ k) f w)) | 
| 61848 | 6291 | (circlepath z r)" | 
| 6292 | using w | |
| 6293 | proof (induction k arbitrary: w) | |
| 6294 | case 0 then show ?case | |
| 6295 | using assms by (auto simp: Cauchy_integral_circlepath dist_commute dist_norm) | |
| 6296 | next | |
| 6297 | case (Suc k) | |
| 6298 | have [simp]: "r > 0" using w | |
| 6299 | using ball_eq_empty by fastforce | |
| 6300 | have f: "continuous_on (path_image (circlepath z r)) f" | |
| 68339 | 6301 | by (rule continuous_on_subset [OF contf]) (force simp: cball_def sphere_def less_imp_le) | 
| 61848 | 6302 | obtain X where X: "((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral X) (circlepath z r)" | 
| 6303 | using Cauchy_next_derivative_circlepath(1) [OF f Suc.IH _ Suc.prems] | |
| 6304 | by (auto simp: contour_integrable_on_def) | |
| 6305 | then have con: "contour_integral (circlepath z r) ((\<lambda>u. f u / (u - w) ^ Suc (Suc k))) = X" | |
| 6306 | by (rule contour_integral_unique) | |
| 6307 | have "\<And>n. ((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) w) (at w)" | |
| 6308 | using Suc.prems assms has_field_derivative_higher_deriv by auto | |
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6309 | then have dnf_diff: "\<And>n. (deriv ^^ n) f field_differentiable (at w)" | 
| 68339 | 6310 | by (force simp: field_differentiable_def) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6311 | have "deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / (fact k) * (deriv ^^ k) f w) w = | 
| 61848 | 6312 | of_nat (Suc k) * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc (Suc k))" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6313 | by (force intro!: DERIV_imp_deriv Cauchy_next_derivative_circlepath [OF f Suc.IH _ Suc.prems]) | 
| 68339 | 6314 | also have "\<dots> = of_nat (Suc k) * X" | 
| 61848 | 6315 | by (simp only: con) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6316 | finally have "deriv (\<lambda>w. ((2 * pi) * \<i> / (fact k)) * (deriv ^^ k) f w) w = of_nat (Suc k) * X" . | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6317 | then have "((2 * pi) * \<i> / (fact k)) * deriv (\<lambda>w. (deriv ^^ k) f w) w = of_nat (Suc k) * X" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6318 | by (metis deriv_cmult dnf_diff) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6319 | then have "deriv (\<lambda>w. (deriv ^^ k) f w) w = of_nat (Suc k) * X / ((2 * pi) * \<i> / (fact k))" | 
| 61848 | 6320 | by (simp add: field_simps) | 
| 6321 | then show ?case | |
| 6322 | using of_nat_eq_0_iff X by fastforce | |
| 6323 | qed | |
| 6324 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6325 | lemma Cauchy_higher_derivative_integral_circlepath: | 
| 61848 | 6326 | assumes contf: "continuous_on (cball z r) f" | 
| 6327 | and holf: "f holomorphic_on ball z r" | |
| 6328 | and w: "w \<in> ball z r" | |
| 6329 | shows "(\<lambda>u. f u / (u - w)^(Suc k)) contour_integrable_on (circlepath z r)" | |
| 6330 | (is "?thes1") | |
| 63589 | 6331 | and "(deriv ^^ k) f w = (fact k) / (2 * pi * \<i>) * contour_integral(circlepath z r) (\<lambda>u. f u/(u - w)^(Suc k))" | 
| 61848 | 6332 | (is "?thes2") | 
| 6333 | proof - | |
| 6334 | have *: "((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral (2 * pi) * \<i> / (fact k) * (deriv ^^ k) f w) | |
| 6335 | (circlepath z r)" | |
| 6336 | using Cauchy_has_contour_integral_higher_derivative_circlepath [OF assms] | |
| 6337 | by simp | |
| 6338 | show ?thes1 using * | |
| 6339 | using contour_integrable_on_def by blast | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6340 | show ?thes2 | 
| 61848 | 6341 | unfolding contour_integral_unique [OF *] by (simp add: divide_simps) | 
| 6342 | qed | |
| 6343 | ||
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6344 | corollary Cauchy_contour_integral_circlepath: | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6345 | assumes "continuous_on (cball z r) f" "f holomorphic_on ball z r" "w \<in> ball z r" | 
| 63589 | 6346 | shows "contour_integral(circlepath z r) (\<lambda>u. f u/(u - w)^(Suc k)) = (2 * pi * \<i>) * (deriv ^^ k) f w / (fact k)" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6347 | by (simp add: Cauchy_higher_derivative_integral_circlepath [OF assms]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6348 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6349 | lemma Cauchy_contour_integral_circlepath_2: | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6350 | assumes "continuous_on (cball z r) f" "f holomorphic_on ball z r" "w \<in> ball z r" | 
| 63589 | 6351 | shows "contour_integral(circlepath z r) (\<lambda>u. f u/(u - w)^2) = (2 * pi * \<i>) * deriv f w" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6352 | using Cauchy_contour_integral_circlepath [OF assms, of 1] | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6353 | by (simp add: power2_eq_square) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6354 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6355 | |
| 67968 | 6356 | subsection\<open>A holomorphic function is analytic, i.e. has local power series\<close> | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6357 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6358 | theorem holomorphic_power_series: | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6359 | assumes holf: "f holomorphic_on ball z r" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6360 | and w: "w \<in> ball z r" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6361 | shows "((\<lambda>n. (deriv ^^ n) f z / (fact n) * (w - z)^n) sums f w)" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6362 | proof - | 
| 68371 | 6363 |   \<comment> \<open>Replacing @{term r} and the original (weak) premises with stronger ones\<close>
 | 
| 6364 | obtain r where "r > 0" and holfc: "f holomorphic_on cball z r" and w: "w \<in> ball z r" | |
| 68493 | 6365 | proof | 
| 68371 | 6366 | have "cball z ((r + dist w z) / 2) \<subseteq> ball z r" | 
| 68527 
2f4e2aab190a
Generalising and renaming some basic results
 paulson <lp15@cam.ac.uk> parents: 
68493diff
changeset | 6367 | using w by (simp add: dist_commute field_sum_of_halves subset_eq) | 
| 68371 | 6368 | then show "f holomorphic_on cball z ((r + dist w z) / 2)" | 
| 6369 | by (rule holomorphic_on_subset [OF holf]) | |
| 6370 | have "r > 0" | |
| 6371 | using w by clarsimp (metis dist_norm le_less_trans norm_ge_zero) | |
| 6372 | then show "0 < (r + dist w z) / 2" | |
| 6373 | by simp (use zero_le_dist [of w z] in linarith) | |
| 6374 | qed (use w in \<open>auto simp: dist_commute\<close>) | |
| 68493 | 6375 | then have holf: "f holomorphic_on ball z r" | 
| 68371 | 6376 | using ball_subset_cball holomorphic_on_subset by blast | 
| 6377 | have contf: "continuous_on (cball z r) f" | |
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6378 | by (simp add: holfc holomorphic_on_imp_continuous_on) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6379 | have cint: "\<And>k. (\<lambda>u. f u / (u - z) ^ Suc k) contour_integrable_on circlepath z r" | 
| 68371 | 6380 | by (rule Cauchy_higher_derivative_integral_circlepath [OF contf holf]) (simp add: \<open>0 < r\<close>) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6381 | obtain B where "0 < B" and B: "\<And>u. u \<in> cball z r \<Longrightarrow> norm(f u) \<le> B" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6382 | by (metis (no_types) bounded_pos compact_cball compact_continuous_image compact_imp_bounded contf image_eqI) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6383 | obtain k where k: "0 < k" "k \<le> r" and wz_eq: "norm(w - z) = r - k" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6384 | and kle: "\<And>u. norm(u - z) = r \<Longrightarrow> k \<le> norm(u - w)" | 
| 68493 | 6385 | proof | 
| 68371 | 6386 | show "\<And>u. cmod (u - z) = r \<Longrightarrow> r - dist z w \<le> cmod (u - w)" | 
| 6387 | by (metis add_diff_eq diff_add_cancel dist_norm norm_diff_ineq) | |
| 6388 | qed (use w in \<open>auto simp: dist_norm norm_minus_commute\<close>) | |
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6389 | have ul: "uniform_limit (sphere z r) (\<lambda>n x. (\<Sum>k<n. (w - z) ^ k * (f x / (x - z) ^ Suc k))) (\<lambda>x. f x / (x - w)) sequentially" | 
| 68493 | 6390 | unfolding uniform_limit_iff dist_norm | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6391 | proof clarify | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6392 | fix e::real | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6393 | assume "0 < e" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6394 | have rr: "0 \<le> (r - k) / r" "(r - k) / r < 1" using k by auto | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6395 | obtain n where n: "((r - k) / r) ^ n < e / B * k" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6396 | using real_arch_pow_inv [of "e/B*k" "(r - k)/r"] \<open>0 < e\<close> \<open>0 < B\<close> k by force | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6397 | have "norm ((\<Sum>k<N. (w - z) ^ k * f u / (u - z) ^ Suc k) - f u / (u - w)) < e" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6398 | if "n \<le> N" and r: "r = dist z u" for N u | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6399 | proof - | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6400 | have N: "((r - k) / r) ^ N < e / B * k" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6401 | apply (rule le_less_trans [OF power_decreasing n]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6402 | using \<open>n \<le> N\<close> k by auto | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6403 | have u [simp]: "(u \<noteq> z) \<and> (u \<noteq> w)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6404 | using \<open>0 < r\<close> r w by auto | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6405 | have wzu_not1: "(w - z) / (u - z) \<noteq> 1" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6406 | by (metis (no_types) dist_norm divide_eq_1_iff less_irrefl mem_ball norm_minus_commute r w) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6407 | have "norm ((\<Sum>k<N. (w - z) ^ k * f u / (u - z) ^ Suc k) * (u - w) - f u) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6408 | = norm ((\<Sum>k<N. (((w - z) / (u - z)) ^ k)) * f u * (u - w) / (u - z) - f u)" | 
| 64267 | 6409 | unfolding sum_distrib_right sum_divide_distrib power_divide by (simp add: algebra_simps) | 
| 68339 | 6410 | also have "\<dots> = norm ((((w - z) / (u - z)) ^ N - 1) * (u - w) / (((w - z) / (u - z) - 1) * (u - z)) - 1) * norm (f u)" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6411 | using \<open>0 < B\<close> | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6412 | apply (auto simp: geometric_sum [OF wzu_not1]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6413 | apply (simp add: field_simps norm_mult [symmetric]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6414 | done | 
| 68339 | 6415 | also have "\<dots> = norm ((u-z) ^ N * (w - u) - ((w - z) ^ N - (u-z) ^ N) * (u-w)) / (r ^ N * norm (u-w)) * norm (f u)" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6416 | using \<open>0 < r\<close> r by (simp add: divide_simps norm_mult norm_divide norm_power dist_norm norm_minus_commute) | 
| 68339 | 6417 | also have "\<dots> = norm ((w - z) ^ N * (w - u)) / (r ^ N * norm (u - w)) * norm (f u)" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6418 | by (simp add: algebra_simps) | 
| 68339 | 6419 | also have "\<dots> = norm (w - z) ^ N * norm (f u) / r ^ N" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6420 | by (simp add: norm_mult norm_power norm_minus_commute) | 
| 68339 | 6421 | also have "\<dots> \<le> (((r - k)/r)^N) * B" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6422 | using \<open>0 < r\<close> w k | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6423 | apply (simp add: divide_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6424 | apply (rule mult_mono [OF power_mono]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6425 | apply (auto simp: norm_divide wz_eq norm_power dist_norm norm_minus_commute B r) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6426 | done | 
| 68339 | 6427 | also have "\<dots> < e * k" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6428 | using \<open>0 < B\<close> N by (simp add: divide_simps) | 
| 68339 | 6429 | also have "\<dots> \<le> e * norm (u - w)" | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6430 | using r kle \<open>0 < e\<close> by (simp add: dist_commute dist_norm) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6431 | finally show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6432 | by (simp add: divide_simps norm_divide del: power_Suc) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6433 | qed | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6434 | with \<open>0 < r\<close> show "\<forall>\<^sub>F n in sequentially. \<forall>x\<in>sphere z r. | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6435 | norm ((\<Sum>k<n. (w - z) ^ k * (f x / (x - z) ^ Suc k)) - f x / (x - w)) < e" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6436 | by (auto simp: mult_ac less_imp_le eventually_sequentially Ball_def) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6437 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6438 | have eq: "\<forall>\<^sub>F x in sequentially. | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6439 | contour_integral (circlepath z r) (\<lambda>u. \<Sum>k<x. (w - z) ^ k * (f u / (u - z) ^ Suc k)) = | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6440 | (\<Sum>k<x. contour_integral (circlepath z r) (\<lambda>u. f u / (u - z) ^ Suc k) * (w - z) ^ k)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6441 | apply (rule eventuallyI) | 
| 64267 | 6442 | apply (subst contour_integral_sum, simp) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6443 | using contour_integrable_lmul [OF cint, of "(w - z) ^ a" for a] apply (simp add: field_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6444 | apply (simp only: contour_integral_lmul cint algebra_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6445 | done | 
| 68371 | 6446 | have cic: "\<And>u. (\<lambda>y. \<Sum>k<u. (w - z) ^ k * (f y / (y - z) ^ Suc k)) contour_integrable_on circlepath z r" | 
| 6447 | apply (intro contour_integrable_sum contour_integrable_lmul, simp) | |
| 6448 | using \<open>0 < r\<close> by (force intro!: Cauchy_higher_derivative_integral_circlepath [OF contf holf]) | |
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6449 | have "(\<lambda>k. contour_integral (circlepath z r) (\<lambda>u. f u/(u - z)^(Suc k)) * (w - z)^k) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6450 | sums contour_integral (circlepath z r) (\<lambda>u. f u/(u - w))" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6451 | unfolding sums_def | 
| 68371 | 6452 | apply (intro Lim_transform_eventually [OF eq] contour_integral_uniform_limit_circlepath [OF eventuallyI ul] cic) | 
| 6453 | using \<open>0 < r\<close> apply auto | |
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6454 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6455 | then have "(\<lambda>k. contour_integral (circlepath z r) (\<lambda>u. f u/(u - z)^(Suc k)) * (w - z)^k) | 
| 63589 | 6456 | sums (2 * of_real pi * \<i> * f w)" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6457 | using w by (auto simp: dist_commute dist_norm contour_integral_unique [OF Cauchy_integral_circlepath_simple [OF holfc]]) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6458 | then have "(\<lambda>k. contour_integral (circlepath z r) (\<lambda>u. f u / (u - z) ^ Suc k) * (w - z)^k / (\<i> * (of_real pi * 2))) | 
| 63589 | 6459 | sums ((2 * of_real pi * \<i> * f w) / (\<i> * (complex_of_real pi * 2)))" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6460 | by (rule sums_divide) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6461 | then have "(\<lambda>n. (w - z) ^ n * contour_integral (circlepath z r) (\<lambda>u. f u / (u - z) ^ Suc n) / (\<i> * (of_real pi * 2))) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6462 | sums f w" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6463 | by (simp add: field_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6464 | then show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6465 | by (simp add: field_simps \<open>0 < r\<close> Cauchy_higher_derivative_integral_circlepath [OF contf holf]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6466 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6467 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6468 | |
| 67968 | 6469 | subsection\<open>The Liouville theorem and the Fundamental Theorem of Algebra\<close> | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6470 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6471 | text\<open> These weak Liouville versions don't even need the derivative formula.\<close> | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6472 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6473 | lemma Liouville_weak_0: | 
| 61973 | 6474 | assumes holf: "f holomorphic_on UNIV" and inf: "(f \<longlongrightarrow> 0) at_infinity" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6475 | shows "f z = 0" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6476 | proof (rule ccontr) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6477 | assume fz: "f z \<noteq> 0" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6478 | with inf [unfolded Lim_at_infinity, rule_format, of "norm(f z)/2"] | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6479 | obtain B where B: "\<And>x. B \<le> cmod x \<Longrightarrow> norm (f x) * 2 < cmod (f z)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6480 | by (auto simp: dist_norm) | 
| 63040 | 6481 | define R where "R = 1 + \<bar>B\<bar> + norm z" | 
| 63262 | 6482 | have "R > 0" unfolding R_def | 
| 62626 
de25474ce728
Contractible sets. Also removal of obsolete theorems and refactoring
 paulson <lp15@cam.ac.uk> parents: 
62623diff
changeset | 6483 | proof - | 
| 
de25474ce728
Contractible sets. Also removal of obsolete theorems and refactoring
 paulson <lp15@cam.ac.uk> parents: 
62623diff
changeset | 6484 | have "0 \<le> cmod z + \<bar>B\<bar>" | 
| 
de25474ce728
Contractible sets. Also removal of obsolete theorems and refactoring
 paulson <lp15@cam.ac.uk> parents: 
62623diff
changeset | 6485 | by (metis (full_types) add_nonneg_nonneg norm_ge_zero real_norm_def) | 
| 
de25474ce728
Contractible sets. Also removal of obsolete theorems and refactoring
 paulson <lp15@cam.ac.uk> parents: 
62623diff
changeset | 6486 | then show "0 < 1 + \<bar>B\<bar> + cmod z" | 
| 
de25474ce728
Contractible sets. Also removal of obsolete theorems and refactoring
 paulson <lp15@cam.ac.uk> parents: 
62623diff
changeset | 6487 | by linarith | 
| 63262 | 6488 | qed | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6489 | have *: "((\<lambda>u. f u / (u - z)) has_contour_integral 2 * complex_of_real pi * \<i> * f z) (circlepath z R)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6490 | apply (rule Cauchy_integral_circlepath) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6491 | using \<open>R > 0\<close> apply (auto intro: holomorphic_on_subset [OF holf] holomorphic_on_imp_continuous_on)+ | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6492 | done | 
| 68371 | 6493 | have "cmod (x - z) = R \<Longrightarrow> cmod (f x) * 2 < cmod (f z)" for x | 
| 6494 | unfolding R_def | |
| 6495 | by (rule B) (use norm_triangle_ineq4 [of x z] in auto) | |
| 6496 | with \<open>R > 0\<close> fz show False | |
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6497 | using has_contour_integral_bound_circlepath [OF *, of "norm(f z)/2/R"] | 
| 68371 | 6498 | by (auto simp: less_imp_le norm_mult norm_divide divide_simps) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6499 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6500 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6501 | proposition Liouville_weak: | 
| 61973 | 6502 | assumes "f holomorphic_on UNIV" and "(f \<longlongrightarrow> l) at_infinity" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6503 | shows "f z = l" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6504 | using Liouville_weak_0 [of "\<lambda>z. f z - l"] | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6505 | by (simp add: assms holomorphic_on_const holomorphic_on_diff LIM_zero) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6506 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6507 | proposition Liouville_weak_inverse: | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6508 | assumes "f holomorphic_on UNIV" and unbounded: "\<And>B. eventually (\<lambda>x. norm (f x) \<ge> B) at_infinity" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6509 | obtains z where "f z = 0" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6510 | proof - | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6511 |   { assume f: "\<And>z. f z \<noteq> 0"
 | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6512 | have 1: "(\<lambda>x. 1 / f x) holomorphic_on UNIV" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6513 | by (simp add: holomorphic_on_divide holomorphic_on_const assms f) | 
| 61973 | 6514 | have 2: "((\<lambda>x. 1 / f x) \<longlongrightarrow> 0) at_infinity" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6515 | apply (rule tendstoI [OF eventually_mono]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6516 | apply (rule_tac B="2/e" in unbounded) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6517 | apply (simp add: dist_norm norm_divide divide_simps mult_ac) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6518 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6519 | have False | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6520 | using Liouville_weak_0 [OF 1 2] f by simp | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6521 | } | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6522 | then show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6523 | using that by blast | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6524 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6525 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6526 | text\<open> In particular we get the Fundamental Theorem of Algebra.\<close> | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6527 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6528 | theorem fundamental_theorem_of_algebra: | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6529 | fixes a :: "nat \<Rightarrow> complex" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6530 |   assumes "a 0 = 0 \<or> (\<exists>i \<in> {1..n}. a i \<noteq> 0)"
 | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6531 | obtains z where "(\<Sum>i\<le>n. a i * z^i) = 0" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6532 | using assms | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6533 | proof (elim disjE bexE) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6534 | assume "a 0 = 0" then show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6535 | by (auto simp: that [of 0]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6536 | next | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6537 | fix i | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6538 |   assume i: "i \<in> {1..n}" and nz: "a i \<noteq> 0"
 | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6539 | have 1: "(\<lambda>z. \<Sum>i\<le>n. a i * z^i) holomorphic_on UNIV" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6540 | by (rule holomorphic_intros)+ | 
| 68371 | 6541 | show thesis | 
| 68420 | 6542 | proof (rule Liouville_weak_inverse [OF 1]) | 
| 6543 | show "\<forall>\<^sub>F x in at_infinity. B \<le> cmod (\<Sum>i\<le>n. a i * x ^ i)" for B | |
| 6544 | using i polyfun_extremal nz by force | |
| 6545 | qed (use that in auto) | |
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6546 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6547 | |
| 67968 | 6548 | subsection\<open>Weierstrass convergence theorem\<close> | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6549 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6550 | lemma holomorphic_uniform_limit: | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6551 | assumes cont: "eventually (\<lambda>n. continuous_on (cball z r) (f n) \<and> (f n) holomorphic_on ball z r) F" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6552 | and ulim: "uniform_limit (cball z r) f g F" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6553 | and F: "~ trivial_limit F" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6554 | obtains "continuous_on (cball z r) g" "g holomorphic_on ball z r" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6555 | proof (cases r "0::real" rule: linorder_cases) | 
| 68339 | 6556 | case less then show ?thesis by (force simp: ball_empty less_imp_le continuous_on_def holomorphic_on_def intro: that) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6557 | next | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6558 | case equal then show ?thesis | 
| 68420 | 6559 | by (force simp: holomorphic_on_def intro: that) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6560 | next | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6561 | case greater | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6562 | have contg: "continuous_on (cball z r) g" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6563 | using cont uniform_limit_theorem [OF eventually_mono ulim F] by blast | 
| 68420 | 6564 | have "path_image (circlepath z r) \<subseteq> cball z r" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6565 | using \<open>0 < r\<close> by auto | 
| 68420 | 6566 | then have 1: "continuous_on (path_image (circlepath z r)) (\<lambda>x. 1 / (2 * complex_of_real pi * \<i>) * g x)" | 
| 6567 | by (intro continuous_intros continuous_on_subset [OF contg]) | |
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6568 | have 2: "((\<lambda>u. 1 / (2 * of_real pi * \<i>) * g u / (u - w) ^ 1) has_contour_integral g w) (circlepath z r)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6569 | if w: "w \<in> ball z r" for w | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6570 | proof - | 
| 63040 | 6571 | define d where "d = (r - norm(w - z))" | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6572 | have "0 < d" "d \<le> r" using w by (auto simp: norm_minus_commute d_def dist_norm) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6573 | have dle: "\<And>u. cmod (z - u) = r \<Longrightarrow> d \<le> cmod (u - w)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6574 | unfolding d_def by (metis add_diff_eq diff_add_cancel norm_diff_ineq norm_minus_commute) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6575 | have ev_int: "\<forall>\<^sub>F n in F. (\<lambda>u. f n u / (u - w)) contour_integrable_on circlepath z r" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6576 | apply (rule eventually_mono [OF cont]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6577 | using w | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6578 | apply (auto intro: Cauchy_higher_derivative_integral_circlepath [where k=0, simplified]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6579 | done | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6580 | have ul_less: "uniform_limit (sphere z r) (\<lambda>n x. f n x / (x - w)) (\<lambda>x. g x / (x - w)) F" | 
| 68493 | 6581 | using greater \<open>0 < d\<close> | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6582 | apply (clarsimp simp add: uniform_limit_iff dist_norm norm_divide diff_divide_distrib [symmetric] divide_simps) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6583 | apply (rule_tac e1="e * d" in eventually_mono [OF uniform_limitD [OF ulim]]) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6584 | apply (force simp: dist_norm intro: dle mult_left_mono less_le_trans)+ | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6585 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6586 | have g_cint: "(\<lambda>u. g u/(u - w)) contour_integrable_on circlepath z r" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6587 | by (rule contour_integral_uniform_limit_circlepath [OF ev_int ul_less F \<open>0 < r\<close>]) | 
| 61973 | 6588 | have cif_tends_cig: "((\<lambda>n. contour_integral(circlepath z r) (\<lambda>u. f n u / (u - w))) \<longlongrightarrow> contour_integral(circlepath z r) (\<lambda>u. g u/(u - w))) F" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6589 | by (rule contour_integral_uniform_limit_circlepath [OF ev_int ul_less F \<open>0 < r\<close>]) | 
| 63589 | 6590 | have f_tends_cig: "((\<lambda>n. 2 * of_real pi * \<i> * f n w) \<longlongrightarrow> contour_integral (circlepath z r) (\<lambda>u. g u / (u - w))) F" | 
| 68420 | 6591 | proof (rule Lim_transform_eventually) | 
| 68493 | 6592 | show "\<forall>\<^sub>F x in F. contour_integral (circlepath z r) (\<lambda>u. f x u / (u - w)) | 
| 68420 | 6593 | = 2 * of_real pi * \<i> * f x w" | 
| 6594 | apply (rule eventually_mono [OF cont contour_integral_unique [OF Cauchy_integral_circlepath]]) | |
| 6595 | using w\<open>0 < d\<close> d_def by auto | |
| 6596 | qed (auto simp: cif_tends_cig) | |
| 6597 | have "\<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in F. dist (f n w) (g w) < e" | |
| 6598 | by (rule eventually_mono [OF uniform_limitD [OF ulim]]) (use w in auto) | |
| 6599 | then have "((\<lambda>n. 2 * of_real pi * \<i> * f n w) \<longlongrightarrow> 2 * of_real pi * \<i> * g w) F" | |
| 6600 | by (rule tendsto_mult_left [OF tendstoI]) | |
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6601 | then have "((\<lambda>u. g u / (u - w)) has_contour_integral 2 * of_real pi * \<i> * g w) (circlepath z r)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6602 | using has_contour_integral_integral [OF g_cint] tendsto_unique [OF F f_tends_cig] w | 
| 68339 | 6603 | by (force simp: dist_norm) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6604 | then have "((\<lambda>u. g u / (2 * of_real pi * \<i> * (u - w))) has_contour_integral g w) (circlepath z r)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6605 | using has_contour_integral_div [where c = "2 * of_real pi * \<i>"] | 
| 68339 | 6606 | by (force simp: field_simps) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6607 | then show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6608 | by (simp add: dist_norm) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6609 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6610 | show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6611 | using Cauchy_next_derivative_circlepath(2) [OF 1 2, simplified] | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6612 | by (fastforce simp add: holomorphic_on_open contg intro: that) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6613 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6614 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6615 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6616 | text\<open> Version showing that the limit is the limit of the derivatives.\<close> | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6617 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6618 | proposition has_complex_derivative_uniform_limit: | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6619 | fixes z::complex | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6620 | assumes cont: "eventually (\<lambda>n. continuous_on (cball z r) (f n) \<and> | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6621 | (\<forall>w \<in> ball z r. ((f n) has_field_derivative (f' n w)) (at w))) F" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6622 | and ulim: "uniform_limit (cball z r) f g F" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6623 | and F: "~ trivial_limit F" and "0 < r" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6624 | obtains g' where | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6625 | "continuous_on (cball z r) g" | 
| 61973 | 6626 | "\<And>w. w \<in> ball z r \<Longrightarrow> (g has_field_derivative (g' w)) (at w) \<and> ((\<lambda>n. f' n w) \<longlongrightarrow> g' w) F" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6627 | proof - | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6628 | let ?conint = "contour_integral (circlepath z r)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6629 | have g: "continuous_on (cball z r) g" "g holomorphic_on ball z r" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6630 | by (rule holomorphic_uniform_limit [OF eventually_mono [OF cont] ulim F]; | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6631 | auto simp: holomorphic_on_open field_differentiable_def)+ | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6632 | then obtain g' where g': "\<And>x. x \<in> ball z r \<Longrightarrow> (g has_field_derivative g' x) (at x)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6633 | using DERIV_deriv_iff_has_field_derivative | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6634 | by (fastforce simp add: holomorphic_on_open) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6635 | then have derg: "\<And>x. x \<in> ball z r \<Longrightarrow> deriv g x = g' x" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6636 | by (simp add: DERIV_imp_deriv) | 
| 61973 | 6637 | have tends_f'n_g': "((\<lambda>n. f' n w) \<longlongrightarrow> g' w) F" if w: "w \<in> ball z r" for w | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6638 | proof - | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6639 | have eq_f': "?conint (\<lambda>x. f n x / (x - w)\<^sup>2) - ?conint (\<lambda>x. g x / (x - w)\<^sup>2) = (f' n w - g' w) * (2 * of_real pi * \<i>)" | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6640 | if cont_fn: "continuous_on (cball z r) (f n)" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6641 | and fnd: "\<And>w. w \<in> ball z r \<Longrightarrow> (f n has_field_derivative f' n w) (at w)" for n | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6642 | proof - | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6643 | have hol_fn: "f n holomorphic_on ball z r" | 
| 68339 | 6644 | using fnd by (force simp: holomorphic_on_open) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6645 | have "(f n has_field_derivative 1 / (2 * of_real pi * \<i>) * ?conint (\<lambda>u. f n u / (u - w)\<^sup>2)) (at w)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6646 | by (rule Cauchy_derivative_integral_circlepath [OF cont_fn hol_fn w]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6647 | then have f': "f' n w = 1 / (2 * of_real pi * \<i>) * ?conint (\<lambda>u. f n u / (u - w)\<^sup>2)" | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6648 | using DERIV_unique [OF fnd] w by blast | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6649 | show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6650 | by (simp add: f' Cauchy_contour_integral_circlepath_2 [OF g w] derg [OF w] divide_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6651 | qed | 
| 63040 | 6652 | define d where "d = (r - norm(w - z))^2" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6653 | have "d > 0" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6654 | using w by (simp add: dist_commute dist_norm d_def) | 
| 68420 | 6655 | have dle: "d \<le> cmod ((y - w)\<^sup>2)" if "r = cmod (z - y)" for y | 
| 6656 | proof - | |
| 6657 | have "w \<in> ball z (cmod (z - y))" | |
| 6658 | using that w by fastforce | |
| 6659 | then have "cmod (w - z) \<le> cmod (z - y)" | |
| 6660 | by (simp add: dist_complex_def norm_minus_commute) | |
| 6661 | moreover have "cmod (z - y) - cmod (w - z) \<le> cmod (y - w)" | |
| 6662 | by (metis diff_add_cancel diff_add_eq_diff_diff_swap norm_minus_commute norm_triangle_ineq2) | |
| 6663 | ultimately show ?thesis | |
| 6664 | using that by (simp add: d_def norm_power power_mono) | |
| 6665 | qed | |
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6666 | have 1: "\<forall>\<^sub>F n in F. (\<lambda>x. f n x / (x - w)\<^sup>2) contour_integrable_on circlepath z r" | 
| 68339 | 6667 | by (force simp: holomorphic_on_open intro: w Cauchy_derivative_integral_circlepath eventually_mono [OF cont]) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6668 | have 2: "uniform_limit (sphere z r) (\<lambda>n x. f n x / (x - w)\<^sup>2) (\<lambda>x. g x / (x - w)\<^sup>2) F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6669 | unfolding uniform_limit_iff | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6670 | proof clarify | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6671 | fix e::real | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6672 | assume "0 < e" | 
| 68420 | 6673 | with \<open>r > 0\<close> show "\<forall>\<^sub>F n in F. \<forall>x\<in>sphere z r. dist (f n x / (x - w)\<^sup>2) (g x / (x - w)\<^sup>2) < e" | 
| 6674 | apply (simp add: norm_divide divide_simps sphere_def dist_norm) | |
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6675 | apply (rule eventually_mono [OF uniform_limitD [OF ulim], of "e*d"]) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6676 | apply (simp add: \<open>0 < d\<close>) | 
| 68339 | 6677 | apply (force simp: dist_norm dle intro: less_le_trans) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6678 | done | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6679 | qed | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6680 | have "((\<lambda>n. contour_integral (circlepath z r) (\<lambda>x. f n x / (x - w)\<^sup>2)) | 
| 61973 | 6681 | \<longlongrightarrow> contour_integral (circlepath z r) ((\<lambda>x. g x / (x - w)\<^sup>2))) F" | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 6682 | by (rule contour_integral_uniform_limit_circlepath [OF 1 2 F \<open>0 < r\<close>]) | 
| 61973 | 6683 | then have tendsto_0: "((\<lambda>n. 1 / (2 * of_real pi * \<i>) * (?conint (\<lambda>x. f n x / (x - w)\<^sup>2) - ?conint (\<lambda>x. g x / (x - w)\<^sup>2))) \<longlongrightarrow> 0) F" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6684 | using Lim_null by (force intro!: tendsto_mult_right_zero) | 
| 61973 | 6685 | have "((\<lambda>n. f' n w - g' w) \<longlongrightarrow> 0) F" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6686 | apply (rule Lim_transform_eventually [OF _ tendsto_0]) | 
| 68339 | 6687 | apply (force simp: divide_simps intro: eq_f' eventually_mono [OF cont]) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6688 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6689 | then show ?thesis using Lim_null by blast | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6690 | qed | 
| 61973 | 6691 | obtain g' where "\<And>w. w \<in> ball z r \<Longrightarrow> (g has_field_derivative (g' w)) (at w) \<and> ((\<lambda>n. f' n w) \<longlongrightarrow> g' w) F" | 
| 68339 | 6692 | by (blast intro: tends_f'n_g' g') | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6693 | then show ?thesis using g | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6694 | using that by blast | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6695 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6696 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6697 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6698 | subsection%unimportant \<open>Some more simple/convenient versions for applications\<close> | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6699 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6700 | lemma holomorphic_uniform_sequence: | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6701 | assumes S: "open S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6702 | and hol_fn: "\<And>n. (f n) holomorphic_on S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6703 | and ulim_g: "\<And>x. x \<in> S \<Longrightarrow> \<exists>d. 0 < d \<and> cball x d \<subseteq> S \<and> uniform_limit (cball x d) f g sequentially" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6704 | shows "g holomorphic_on S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6705 | proof - | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6706 | have "\<exists>f'. (g has_field_derivative f') (at z)" if "z \<in> S" for z | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6707 | proof - | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6708 | obtain r where "0 < r" and r: "cball z r \<subseteq> S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6709 | and ul: "uniform_limit (cball z r) f g sequentially" | 
| 68493 | 6710 | using ulim_g [OF \<open>z \<in> S\<close>] by blast | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6711 | have *: "\<forall>\<^sub>F n in sequentially. continuous_on (cball z r) (f n) \<and> f n holomorphic_on ball z r" | 
| 68420 | 6712 | proof (intro eventuallyI conjI) | 
| 6713 | show "continuous_on (cball z r) (f x)" for x | |
| 6714 | using hol_fn holomorphic_on_imp_continuous_on holomorphic_on_subset r by blast | |
| 6715 | show "f x holomorphic_on ball z r" for x | |
| 6716 | by (metis hol_fn holomorphic_on_subset interior_cball interior_subset r) | |
| 6717 | qed | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6718 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6719 | apply (rule holomorphic_uniform_limit [OF *]) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6720 | using \<open>0 < r\<close> centre_in_ball ul | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6721 | apply (auto simp: holomorphic_on_open) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6722 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6723 | qed | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6724 | with S show ?thesis | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6725 | by (simp add: holomorphic_on_open) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6726 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6727 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6728 | lemma has_complex_derivative_uniform_sequence: | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6729 | fixes S :: "complex set" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6730 | assumes S: "open S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6731 | and hfd: "\<And>n x. x \<in> S \<Longrightarrow> ((f n) has_field_derivative f' n x) (at x)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6732 | and ulim_g: "\<And>x. x \<in> S | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6733 | \<Longrightarrow> \<exists>d. 0 < d \<and> cball x d \<subseteq> S \<and> uniform_limit (cball x d) f g sequentially" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6734 | shows "\<exists>g'. \<forall>x \<in> S. (g has_field_derivative g' x) (at x) \<and> ((\<lambda>n. f' n x) \<longlongrightarrow> g' x) sequentially" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6735 | proof - | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6736 | have y: "\<exists>y. (g has_field_derivative y) (at z) \<and> (\<lambda>n. f' n z) \<longlonglongrightarrow> y" if "z \<in> S" for z | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6737 | proof - | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6738 | obtain r where "0 < r" and r: "cball z r \<subseteq> S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6739 | and ul: "uniform_limit (cball z r) f g sequentially" | 
| 68493 | 6740 | using ulim_g [OF \<open>z \<in> S\<close>] by blast | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6741 | have *: "\<forall>\<^sub>F n in sequentially. continuous_on (cball z r) (f n) \<and> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6742 | (\<forall>w \<in> ball z r. ((f n) has_field_derivative (f' n w)) (at w))" | 
| 68420 | 6743 | proof (intro eventuallyI conjI ballI) | 
| 6744 | show "continuous_on (cball z r) (f x)" for x | |
| 6745 | by (meson S continuous_on_subset hfd holomorphic_on_imp_continuous_on holomorphic_on_open r) | |
| 6746 | show "w \<in> ball z r \<Longrightarrow> (f x has_field_derivative f' x w) (at w)" for w x | |
| 6747 | using ball_subset_cball hfd r by blast | |
| 6748 | qed | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6749 | show ?thesis | 
| 68420 | 6750 | by (rule has_complex_derivative_uniform_limit [OF *, of g]) (use \<open>0 < r\<close> ul in \<open>force+\<close>) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6751 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6752 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6753 | by (rule bchoice) (blast intro: y) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6754 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6755 | |
| 67968 | 6756 | subsection\<open>On analytic functions defined by a series\<close> | 
| 68493 | 6757 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6758 | lemma series_and_derivative_comparison: | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6759 | fixes S :: "complex set" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6760 | assumes S: "open S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6761 | and h: "summable h" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6762 | and hfd: "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6763 | and to_g: "\<forall>\<^sub>F n in sequentially. \<forall>x\<in>S. norm (f n x) \<le> h n" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6764 | obtains g g' where "\<forall>x \<in> S. ((\<lambda>n. f n x) sums g x) \<and> ((\<lambda>n. f' n x) sums g' x) \<and> (g has_field_derivative g' x) (at x)" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6765 | proof - | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6766 | obtain g where g: "uniform_limit S (\<lambda>n x. \<Sum>i<n. f i x) g sequentially" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6767 | using weierstrass_m_test_ev [OF to_g h] by force | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6768 | have *: "\<exists>d>0. cball x d \<subseteq> S \<and> uniform_limit (cball x d) (\<lambda>n x. \<Sum>i<n. f i x) g sequentially" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6769 | if "x \<in> S" for x | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6770 | proof - | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6771 | obtain d where "d>0" and d: "cball x d \<subseteq> S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6772 | using open_contains_cball [of "S"] \<open>x \<in> S\<close> S by blast | 
| 68420 | 6773 | show ?thesis | 
| 6774 | proof (intro conjI exI) | |
| 6775 | show "uniform_limit (cball x d) (\<lambda>n x. \<Sum>i<n. f i x) g sequentially" | |
| 6776 | using d g uniform_limit_on_subset by (force simp: dist_norm eventually_sequentially) | |
| 6777 | qed (use \<open>d > 0\<close> d in auto) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6778 | qed | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6779 | have "\<And>x. x \<in> S \<Longrightarrow> (\<lambda>n. \<Sum>i<n. f i x) \<longlonglongrightarrow> g x" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6780 | by (metis tendsto_uniform_limitI [OF g]) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6781 | moreover have "\<exists>g'. \<forall>x\<in>S. (g has_field_derivative g' x) (at x) \<and> (\<lambda>n. \<Sum>i<n. f' i x) \<longlonglongrightarrow> g' x" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6782 | by (rule has_complex_derivative_uniform_sequence [OF S]) (auto intro: * hfd DERIV_sum)+ | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6783 | ultimately show ?thesis | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6784 | by (metis sums_def that) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6785 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6786 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6787 | text\<open>A version where we only have local uniform/comparative convergence.\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6788 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6789 | lemma series_and_derivative_comparison_local: | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6790 | fixes S :: "complex set" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6791 | assumes S: "open S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6792 | and hfd: "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6793 | and to_g: "\<And>x. x \<in> S \<Longrightarrow> \<exists>d h. 0 < d \<and> summable h \<and> (\<forall>\<^sub>F n in sequentially. \<forall>y\<in>ball x d \<inter> S. norm (f n y) \<le> h n)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6794 | shows "\<exists>g g'. \<forall>x \<in> S. ((\<lambda>n. f n x) sums g x) \<and> ((\<lambda>n. f' n x) sums g' x) \<and> (g has_field_derivative g' x) (at x)" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6795 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6796 | have "\<exists>y. (\<lambda>n. f n z) sums (\<Sum>n. f n z) \<and> (\<lambda>n. f' n z) sums y \<and> ((\<lambda>x. \<Sum>n. f n x) has_field_derivative y) (at z)" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6797 | if "z \<in> S" for z | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6798 | proof - | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6799 | obtain d h where "0 < d" "summable h" and le_h: "\<forall>\<^sub>F n in sequentially. \<forall>y\<in>ball z d \<inter> S. norm (f n y) \<le> h n" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6800 | using to_g \<open>z \<in> S\<close> by meson | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6801 | then obtain r where "r>0" and r: "ball z r \<subseteq> ball z d \<inter> S" using \<open>z \<in> S\<close> S | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6802 | by (metis Int_iff open_ball centre_in_ball open_Int open_contains_ball_eq) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6803 | have 1: "open (ball z d \<inter> S)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6804 | by (simp add: open_Int S) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6805 | have 2: "\<And>n x. x \<in> ball z d \<inter> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x)" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6806 | by (auto simp: hfd) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6807 | obtain g g' where gg': "\<forall>x \<in> ball z d \<inter> S. ((\<lambda>n. f n x) sums g x) \<and> | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6808 | ((\<lambda>n. f' n x) sums g' x) \<and> (g has_field_derivative g' x) (at x)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6809 | by (auto intro: le_h series_and_derivative_comparison [OF 1 \<open>summable h\<close> hfd]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6810 | then have "(\<lambda>n. f' n z) sums g' z" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6811 | by (meson \<open>0 < r\<close> centre_in_ball contra_subsetD r) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6812 | moreover have "(\<lambda>n. f n z) sums (\<Sum>n. f n z)" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6813 | using summable_sums centre_in_ball \<open>0 < d\<close> \<open>summable h\<close> le_h | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6814 | by (metis (full_types) Int_iff gg' summable_def that) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6815 | moreover have "((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' z) (at z)" | 
| 68420 | 6816 | proof (rule DERIV_transform_at) | 
| 6817 | show "\<And>x. dist x z < r \<Longrightarrow> g x = (\<Sum>n. f n x)" | |
| 6818 | by (metis subsetD dist_commute gg' mem_ball r sums_unique) | |
| 6819 | qed (use \<open>0 < r\<close> gg' \<open>z \<in> S\<close> \<open>0 < d\<close> in auto) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6820 | ultimately show ?thesis by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6821 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6822 | then show ?thesis | 
| 68420 | 6823 | by (rule_tac x="\<lambda>x. suminf (\<lambda>n. f n x)" in exI) meson | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6824 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6825 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6826 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6827 | text\<open>Sometimes convenient to compare with a complex series of positive reals. (?)\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6828 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6829 | lemma series_and_derivative_comparison_complex: | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6830 | fixes S :: "complex set" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6831 | assumes S: "open S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6832 | and hfd: "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6833 | and to_g: "\<And>x. x \<in> S \<Longrightarrow> \<exists>d h. 0 < d \<and> summable h \<and> range h \<subseteq> \<real>\<^sub>\<ge>\<^sub>0 \<and> (\<forall>\<^sub>F n in sequentially. \<forall>y\<in>ball x d \<inter> S. cmod(f n y) \<le> cmod (h n))" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6834 | shows "\<exists>g g'. \<forall>x \<in> S. ((\<lambda>n. f n x) sums g x) \<and> ((\<lambda>n. f' n x) sums g' x) \<and> (g has_field_derivative g' x) (at x)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6835 | apply (rule series_and_derivative_comparison_local [OF S hfd], assumption) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6836 | apply (rule ex_forward [OF to_g], assumption) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6837 | apply (erule exE) | 
| 68339 | 6838 | apply (rule_tac x="Re \<circ> h" in exI) | 
| 6839 | apply (force simp: summable_Re o_def nonneg_Reals_cmod_eq_Re image_subset_iff) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6840 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6841 | |
| 65578 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6842 | text\<open>Sometimes convenient to compare with a complex series of positive reals. (?)\<close> | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6843 | lemma series_differentiable_comparison_complex: | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6844 | fixes S :: "complex set" | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6845 | assumes S: "open S" | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6846 | and hfd: "\<And>n x. x \<in> S \<Longrightarrow> f n field_differentiable (at x)" | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6847 | and to_g: "\<And>x. x \<in> S \<Longrightarrow> \<exists>d h. 0 < d \<and> summable h \<and> range h \<subseteq> \<real>\<^sub>\<ge>\<^sub>0 \<and> (\<forall>\<^sub>F n in sequentially. \<forall>y\<in>ball x d \<inter> S. cmod(f n y) \<le> cmod (h n))" | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6848 | obtains g where "\<forall>x \<in> S. ((\<lambda>n. f n x) sums g x) \<and> g field_differentiable (at x)" | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6849 | proof - | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6850 | have hfd': "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative deriv (f n) x) (at x)" | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6851 | using hfd field_differentiable_derivI by blast | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6852 | have "\<exists>g g'. \<forall>x \<in> S. ((\<lambda>n. f n x) sums g x) \<and> ((\<lambda>n. deriv (f n) x) sums g' x) \<and> (g has_field_derivative g' x) (at x)" | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6853 | by (metis series_and_derivative_comparison_complex [OF S hfd' to_g]) | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6854 | then show ?thesis | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6855 | using field_differentiable_def that by blast | 
| 
e4997c181cce
New material from PNT proof, as well as more default [simp] declarations. Also removed duplicate theorems about geometric series
 paulson <lp15@cam.ac.uk> parents: 
65037diff
changeset | 6856 | qed | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6857 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6858 | text\<open>In particular, a power series is analytic inside circle of convergence.\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6859 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6860 | lemma power_series_and_derivative_0: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6861 | fixes a :: "nat \<Rightarrow> complex" and r::real | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6862 | assumes "summable (\<lambda>n. a n * r^n)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6863 | shows "\<exists>g g'. \<forall>z. cmod z < r \<longrightarrow> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6864 | ((\<lambda>n. a n * z^n) sums g z) \<and> ((\<lambda>n. of_nat n * a n * z^(n - 1)) sums g' z) \<and> (g has_field_derivative g' z) (at z)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6865 | proof (cases "0 < r") | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6866 | case True | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6867 | have der: "\<And>n z. ((\<lambda>x. a n * x ^ n) has_field_derivative of_nat n * a n * z ^ (n - 1)) (at z)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6868 | by (rule derivative_eq_intros | simp)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6869 | have y_le: "\<lbrakk>cmod (z - y) * 2 < r - cmod z\<rbrakk> \<Longrightarrow> cmod y \<le> cmod (of_real r + of_real (cmod z)) / 2" for z y | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6870 | using \<open>r > 0\<close> | 
| 68403 | 6871 | apply (auto simp: algebra_simps norm_mult norm_divide norm_power simp flip: of_real_add) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6872 | using norm_triangle_ineq2 [of y z] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6873 | apply (simp only: diff_le_eq norm_minus_commute mult_2) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6874 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6875 | have "summable (\<lambda>n. a n * complex_of_real r ^ n)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6876 | using assms \<open>r > 0\<close> by simp | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6877 | moreover have "\<And>z. cmod z < r \<Longrightarrow> cmod ((of_real r + of_real (cmod z)) / 2) < cmod (of_real r)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6878 | using \<open>r > 0\<close> | 
| 68403 | 6879 | by (simp flip: of_real_add) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6880 | ultimately have sum: "\<And>z. cmod z < r \<Longrightarrow> summable (\<lambda>n. of_real (cmod (a n)) * ((of_real r + complex_of_real (cmod z)) / 2) ^ n)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6881 | by (rule power_series_conv_imp_absconv_weak) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6882 | have "\<exists>g g'. \<forall>z \<in> ball 0 r. (\<lambda>n. (a n) * z ^ n) sums g z \<and> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6883 | (\<lambda>n. of_nat n * (a n) * z ^ (n - 1)) sums g' z \<and> (g has_field_derivative g' z) (at z)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6884 | apply (rule series_and_derivative_comparison_complex [OF open_ball der]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6885 | apply (rule_tac x="(r - norm z)/2" in exI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6886 | apply (rule_tac x="\<lambda>n. of_real(norm(a n)*((r + norm z)/2)^n)" in exI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6887 | using \<open>r > 0\<close> | 
| 68420 | 6888 | apply (auto simp: sum eventually_sequentially norm_mult norm_power dist_norm intro!: mult_left_mono power_mono y_le) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6889 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6890 | then show ?thesis | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6891 | by (simp add: ball_def) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6892 | next | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6893 | case False then show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6894 | apply (simp add: not_less) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6895 | using less_le_trans norm_not_less_zero by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6896 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6897 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6898 | proposition%unimportant power_series_and_derivative: | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6899 | fixes a :: "nat \<Rightarrow> complex" and r::real | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6900 | assumes "summable (\<lambda>n. a n * r^n)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6901 | obtains g g' where "\<forall>z \<in> ball w r. | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6902 | ((\<lambda>n. a n * (z - w) ^ n) sums g z) \<and> ((\<lambda>n. of_nat n * a n * (z - w) ^ (n - 1)) sums g' z) \<and> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6903 | (g has_field_derivative g' z) (at z)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6904 | using power_series_and_derivative_0 [OF assms] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6905 | apply clarify | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6906 | apply (rule_tac g="(\<lambda>z. g(z - w))" in that) | 
| 62397 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 6907 | using DERIV_shift [where z="-w"] | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6908 | apply (auto simp: norm_minus_commute Ball_def dist_norm) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6909 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6910 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6911 | proposition%unimportant power_series_holomorphic: | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6912 | assumes "\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>n. a n*(w - z)^n) sums f w)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6913 | shows "f holomorphic_on ball z r" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6914 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6915 | have "\<exists>f'. (f has_field_derivative f') (at w)" if w: "dist z w < r" for w | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6916 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6917 | have inb: "z + complex_of_real ((dist z w + r) / 2) \<in> ball z r" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6918 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6919 | have wz: "cmod (w - z) < r" using w | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6920 | by (auto simp: divide_simps dist_norm norm_minus_commute) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6921 | then have "0 \<le> r" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6922 | by (meson less_eq_real_def norm_ge_zero order_trans) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6923 | show ?thesis | 
| 68403 | 6924 | using w by (simp add: dist_norm \<open>0\<le>r\<close> flip: of_real_add) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6925 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6926 | have sum: "summable (\<lambda>n. a n * of_real (((cmod (z - w) + r) / 2) ^ n))" | 
| 68339 | 6927 | using assms [OF inb] by (force simp: summable_def dist_norm) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6928 | obtain g g' where gg': "\<And>u. u \<in> ball z ((cmod (z - w) + r) / 2) \<Longrightarrow> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6929 | (\<lambda>n. a n * (u - z) ^ n) sums g u \<and> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6930 | (\<lambda>n. of_nat n * a n * (u - z) ^ (n - 1)) sums g' u \<and> (g has_field_derivative g' u) (at u)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6931 | by (rule power_series_and_derivative [OF sum, of z]) fastforce | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6932 | have [simp]: "g u = f u" if "cmod (u - w) < (r - cmod (z - w)) / 2" for u | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6933 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6934 | have less: "cmod (z - u) * 2 < cmod (z - w) + r" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6935 | using that dist_triangle2 [of z u w] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6936 | by (simp add: dist_norm [symmetric] algebra_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6937 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6938 | apply (rule sums_unique2 [of "\<lambda>n. a n*(u - z)^n"]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6939 | using gg' [of u] less w | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6940 | apply (auto simp: assms dist_norm) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6941 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6942 | qed | 
| 68420 | 6943 | have "(f has_field_derivative g' w) (at w)" | 
| 6944 | by (rule DERIV_transform_at [where d="(r - norm(z - w))/2"]) | |
| 6945 | (use w gg' [of w] in \<open>(force simp: dist_norm)+\<close>) | |
| 6946 | then show ?thesis .. | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6947 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6948 | then show ?thesis by (simp add: holomorphic_on_open) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6949 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6950 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6951 | corollary holomorphic_iff_power_series: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6952 | "f holomorphic_on ball z r \<longleftrightarrow> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6953 | (\<forall>w \<in> ball z r. (\<lambda>n. (deriv ^^ n) f z / (fact n) * (w - z)^n) sums f w)" | 
| 68420 | 6954 | apply (intro iffI ballI holomorphic_power_series, assumption+) | 
| 6955 | apply (force intro: power_series_holomorphic [where a = "\<lambda>n. (deriv ^^ n) f z / (fact n)"]) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6956 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6957 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6958 | lemma power_series_analytic: | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6959 | "(\<And>w. w \<in> ball z r \<Longrightarrow> (\<lambda>n. a n*(w - z)^n) sums f w) \<Longrightarrow> f analytic_on ball z r" | 
| 68339 | 6960 | by (force simp: analytic_on_open intro!: power_series_holomorphic) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6961 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6962 | lemma analytic_iff_power_series: | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6963 | "f analytic_on ball z r \<longleftrightarrow> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6964 | (\<forall>w \<in> ball z r. (\<lambda>n. (deriv ^^ n) f z / (fact n) * (w - z)^n) sums f w)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6965 | by (simp add: analytic_on_open holomorphic_iff_power_series) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6966 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 6967 | subsection%unimportant \<open>Equality between holomorphic functions, on open ball then connected set\<close> | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6968 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6969 | lemma holomorphic_fun_eq_on_ball: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6970 | "\<lbrakk>f holomorphic_on ball z r; g holomorphic_on ball z r; | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6971 | w \<in> ball z r; | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6972 | \<And>n. (deriv ^^ n) f z = (deriv ^^ n) g z\<rbrakk> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6973 | \<Longrightarrow> f w = g w" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6974 | apply (rule sums_unique2 [of "\<lambda>n. (deriv ^^ n) f z / (fact n) * (w - z)^n"]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6975 | apply (auto simp: holomorphic_iff_power_series) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6976 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6977 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6978 | lemma holomorphic_fun_eq_0_on_ball: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6979 | "\<lbrakk>f holomorphic_on ball z r; w \<in> ball z r; | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6980 | \<And>n. (deriv ^^ n) f z = 0\<rbrakk> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6981 | \<Longrightarrow> f w = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6982 | apply (rule sums_unique2 [of "\<lambda>n. (deriv ^^ n) f z / (fact n) * (w - z)^n"]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6983 | apply (auto simp: holomorphic_iff_power_series) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6984 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6985 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6986 | lemma holomorphic_fun_eq_0_on_connected: | 
| 68420 | 6987 | assumes holf: "f holomorphic_on S" and "open S" | 
| 6988 | and cons: "connected S" | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6989 | and der: "\<And>n. (deriv ^^ n) f z = 0" | 
| 68420 | 6990 | and "z \<in> S" "w \<in> S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6991 | shows "f w = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6992 | proof - | 
| 68420 | 6993 |   have *: "ball x e \<subseteq> (\<Inter>n. {w \<in> S. (deriv ^^ n) f w = 0})"
 | 
| 6994 | if "\<forall>u. (deriv ^^ u) f x = 0" "ball x e \<subseteq> S" for x e | |
| 6995 | proof - | |
| 6996 | have "\<And>x' n. dist x x' < e \<Longrightarrow> (deriv ^^ n) f x' = 0" | |
| 6997 | apply (rule holomorphic_fun_eq_0_on_ball [OF holomorphic_higher_deriv]) | |
| 6998 | apply (rule holomorphic_on_subset [OF holf]) | |
| 6999 | using that apply simp_all | |
| 7000 | by (metis funpow_add o_apply) | |
| 7001 | with that show ?thesis by auto | |
| 7002 | qed | |
| 7003 |   have 1: "openin (subtopology euclidean S) (\<Inter>n. {w \<in> S. (deriv ^^ n) f w = 0})"
 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7004 | apply (rule open_subset, force) | 
| 68420 | 7005 | using \<open>open S\<close> | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7006 | apply (simp add: open_contains_ball Ball_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7007 | apply (erule all_forward) | 
| 62343 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 haftmann parents: 
62217diff
changeset | 7008 | using "*" by auto blast+ | 
| 68420 | 7009 |   have 2: "closedin (subtopology euclidean S) (\<Inter>n. {w \<in> S. (deriv ^^ n) f w = 0})"
 | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7010 | using assms | 
| 62843 
313d3b697c9a
Mostly renaming (from HOL Light to Isabelle conventions), with a couple of new results
 paulson <lp15@cam.ac.uk> parents: 
62837diff
changeset | 7011 | by (auto intro: continuous_closedin_preimage_constant holomorphic_on_imp_continuous_on holomorphic_higher_deriv) | 
| 68420 | 7012 | obtain e where "e>0" and e: "ball w e \<subseteq> S" using openE [OF \<open>open S\<close> \<open>w \<in> S\<close>] . | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7013 | then have holfb: "f holomorphic_on ball w e" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7014 | using holf holomorphic_on_subset by blast | 
| 68420 | 7015 |   have 3: "(\<Inter>n. {w \<in> S. (deriv ^^ n) f w = 0}) = S \<Longrightarrow> f w = 0"
 | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7016 | using \<open>e>0\<close> e by (force intro: holomorphic_fun_eq_0_on_ball [OF holfb]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7017 | show ?thesis | 
| 68420 | 7018 | using cons der \<open>z \<in> S\<close> | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7019 | apply (simp add: connected_clopen) | 
| 68420 | 7020 |     apply (drule_tac x="\<Inter>n. {w \<in> S. (deriv ^^ n) f w = 0}" in spec)
 | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7021 | apply (auto simp: 1 2 3) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7022 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7023 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7024 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7025 | lemma holomorphic_fun_eq_on_connected: | 
| 68420 | 7026 | assumes "f holomorphic_on S" "g holomorphic_on S" and "open S" "connected S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7027 | and "\<And>n. (deriv ^^ n) f z = (deriv ^^ n) g z" | 
| 68420 | 7028 | and "z \<in> S" "w \<in> S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7029 | shows "f w = g w" | 
| 68420 | 7030 | proof (rule holomorphic_fun_eq_0_on_connected [of "\<lambda>x. f x - g x" S z, simplified]) | 
| 7031 | show "(\<lambda>x. f x - g x) holomorphic_on S" | |
| 7032 | by (intro assms holomorphic_intros) | |
| 7033 | show "\<And>n. (deriv ^^ n) (\<lambda>x. f x - g x) z = 0" | |
| 7034 | using assms higher_deriv_diff by auto | |
| 7035 | qed (use assms in auto) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7036 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7037 | lemma holomorphic_fun_eq_const_on_connected: | 
| 68420 | 7038 | assumes holf: "f holomorphic_on S" and "open S" | 
| 7039 | and cons: "connected S" | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7040 | and der: "\<And>n. 0 < n \<Longrightarrow> (deriv ^^ n) f z = 0" | 
| 68420 | 7041 | and "z \<in> S" "w \<in> S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7042 | shows "f w = f z" | 
| 68420 | 7043 | proof (rule holomorphic_fun_eq_0_on_connected [of "\<lambda>w. f w - f z" S z, simplified]) | 
| 7044 | show "(\<lambda>w. f w - f z) holomorphic_on S" | |
| 7045 | by (intro assms holomorphic_intros) | |
| 7046 | show "\<And>n. (deriv ^^ n) (\<lambda>w. f w - f z) z = 0" | |
| 7047 | by (subst higher_deriv_diff) (use assms in \<open>auto intro: holomorphic_intros\<close>) | |
| 7048 | qed (use assms in auto) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7049 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 7050 | subsection%unimportant \<open>Some basic lemmas about poles/singularities\<close> | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7051 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7052 | lemma pole_lemma: | 
| 68420 | 7053 | assumes holf: "f holomorphic_on S" and a: "a \<in> interior S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7054 | shows "(\<lambda>z. if z = a then deriv f a | 
| 68420 | 7055 | else (f z - f a) / (z - a)) holomorphic_on S" (is "?F holomorphic_on S") | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7056 | proof - | 
| 68420 | 7057 | have F1: "?F field_differentiable (at u within S)" if "u \<in> S" "u \<noteq> a" for u | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7058 | proof - | 
| 68420 | 7059 | have fcd: "f field_differentiable at u within S" | 
| 7060 | using holf holomorphic_on_def by (simp add: \<open>u \<in> S\<close>) | |
| 7061 | have cd: "(\<lambda>z. (f z - f a) / (z - a)) field_differentiable at u within S" | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7062 | by (rule fcd derivative_intros | simp add: that)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7063 | have "0 < dist a u" using that dist_nz by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7064 | then show ?thesis | 
| 68420 | 7065 | by (rule field_differentiable_transform_within [OF _ _ _ cd]) (auto simp: \<open>u \<in> S\<close>) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7066 | qed | 
| 68420 | 7067 | have F2: "?F field_differentiable at a" if "0 < e" "ball a e \<subseteq> S" for e | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7068 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7069 | have holfb: "f holomorphic_on ball a e" | 
| 68420 | 7070 | by (rule holomorphic_on_subset [OF holf \<open>ball a e \<subseteq> S\<close>]) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7071 |     have 2: "?F holomorphic_on ball a e - {a}"
 | 
| 68420 | 7072 | apply (simp add: holomorphic_on_def flip: field_differentiable_def) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7073 | using mem_ball that | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7074 | apply (auto intro: F1 field_differentiable_within_subset) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7075 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7076 | have "isCont (\<lambda>z. if z = a then deriv f a else (f z - f a) / (z - a)) x" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7077 | if "dist a x < e" for x | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7078 | proof (cases "x=a") | 
| 68493 | 7079 | case True | 
| 68420 | 7080 | then have "f field_differentiable at a" | 
| 7081 | using holfb \<open>0 < e\<close> holomorphic_on_imp_differentiable_at by auto | |
| 7082 | with True show ?thesis | |
| 68634 | 7083 | by (auto simp: continuous_at has_field_derivative_iff simp flip: DERIV_deriv_iff_field_differentiable | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7084 | elim: rev_iffD1 [OF _ LIM_equal]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7085 | next | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7086 | case False with 2 that show ?thesis | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7087 | by (force simp: holomorphic_on_open open_Diff field_differentiable_def [symmetric] field_differentiable_imp_continuous_at) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7088 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7089 | then have 1: "continuous_on (ball a e) ?F" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7090 | by (clarsimp simp: continuous_on_eq_continuous_at) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7091 | have "?F holomorphic_on ball a e" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7092 | by (auto intro: no_isolated_singularity [OF 1 2]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7093 | with that show ?thesis | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7094 | by (simp add: holomorphic_on_open field_differentiable_def [symmetric] | 
| 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7095 | field_differentiable_at_within) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7096 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7097 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7098 | proof | 
| 68420 | 7099 | fix x assume "x \<in> S" show "?F field_differentiable at x within S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7100 | proof (cases "x=a") | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7101 | case True then show ?thesis | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7102 | using a by (auto simp: mem_interior intro: field_differentiable_at_within F2) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7103 | next | 
| 68420 | 7104 | case False with F1 \<open>x \<in> S\<close> | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7105 | show ?thesis by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7106 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7107 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7108 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7109 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 7110 | lemma pole_theorem: | 
| 68420 | 7111 | assumes holg: "g holomorphic_on S" and a: "a \<in> interior S" | 
| 7112 |       and eq: "\<And>z. z \<in> S - {a} \<Longrightarrow> g z = (z - a) * f z"
 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7113 | shows "(\<lambda>z. if z = a then deriv g a | 
| 68420 | 7114 | else f z - g a/(z - a)) holomorphic_on S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7115 | using pole_lemma [OF holg a] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7116 | by (rule holomorphic_transform) (simp add: eq divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7117 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7118 | lemma pole_lemma_open: | 
| 68420 | 7119 | assumes "f holomorphic_on S" "open S" | 
| 7120 | shows "(\<lambda>z. if z = a then deriv f a else (f z - f a)/(z - a)) holomorphic_on S" | |
| 7121 | proof (cases "a \<in> S") | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7122 | case True with assms interior_eq pole_lemma | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7123 | show ?thesis by fastforce | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7124 | next | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7125 | case False with assms show ?thesis | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7126 | apply (simp add: holomorphic_on_def field_differentiable_def [symmetric], clarify) | 
| 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7127 | apply (rule field_differentiable_transform_within [where f = "\<lambda>z. (f z - f a)/(z - a)" and d = 1]) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7128 | apply (rule derivative_intros | force)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7129 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7130 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7131 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 7132 | lemma pole_theorem_open: | 
| 68420 | 7133 | assumes holg: "g holomorphic_on S" and S: "open S" | 
| 7134 |       and eq: "\<And>z. z \<in> S - {a} \<Longrightarrow> g z = (z - a) * f z"
 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7135 | shows "(\<lambda>z. if z = a then deriv g a | 
| 68420 | 7136 | else f z - g a/(z - a)) holomorphic_on S" | 
| 7137 | using pole_lemma_open [OF holg S] | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7138 | by (rule holomorphic_transform) (auto simp: eq divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7139 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 7140 | lemma pole_theorem_0: | 
| 68420 | 7141 | assumes holg: "g holomorphic_on S" and a: "a \<in> interior S" | 
| 7142 |       and eq: "\<And>z. z \<in> S - {a} \<Longrightarrow> g z = (z - a) * f z"
 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7143 | and [simp]: "f a = deriv g a" "g a = 0" | 
| 68420 | 7144 | shows "f holomorphic_on S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7145 | using pole_theorem [OF holg a eq] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7146 | by (rule holomorphic_transform) (auto simp: eq divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7147 | |
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 7148 | lemma pole_theorem_open_0: | 
| 68420 | 7149 | assumes holg: "g holomorphic_on S" and S: "open S" | 
| 7150 |       and eq: "\<And>z. z \<in> S - {a} \<Longrightarrow> g z = (z - a) * f z"
 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7151 | and [simp]: "f a = deriv g a" "g a = 0" | 
| 68420 | 7152 | shows "f holomorphic_on S" | 
| 7153 | using pole_theorem_open [OF holg S eq] | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7154 | by (rule holomorphic_transform) (auto simp: eq divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7155 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7156 | lemma pole_theorem_analytic: | 
| 68420 | 7157 | assumes g: "g analytic_on S" | 
| 7158 | and eq: "\<And>z. z \<in> S | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7159 |              \<Longrightarrow> \<exists>d. 0 < d \<and> (\<forall>w \<in> ball z d - {a}. g w = (w - a) * f w)"
 | 
| 68420 | 7160 | shows "(\<lambda>z. if z = a then deriv g a else f z - g a/(z - a)) analytic_on S" (is "?F analytic_on S") | 
| 7161 | unfolding analytic_on_def | |
| 68493 | 7162 | proof | 
| 68420 | 7163 | fix x | 
| 7164 | assume "x \<in> S" | |
| 68493 | 7165 | with g obtain e where "0 < e" and e: "g holomorphic_on ball x e" | 
| 68420 | 7166 | by (auto simp add: analytic_on_def) | 
| 7167 |   obtain d where "0 < d" and d: "\<And>w. w \<in> ball x d - {a} \<Longrightarrow> g w = (w - a) * f w"
 | |
| 7168 | using \<open>x \<in> S\<close> eq by blast | |
| 7169 | have "?F holomorphic_on ball x (min d e)" | |
| 7170 | using d e \<open>x \<in> S\<close> by (fastforce simp: holomorphic_on_subset subset_ball intro!: pole_theorem_open) | |
| 7171 | then show "\<exists>e>0. ?F holomorphic_on ball x e" | |
| 7172 | using \<open>0 < d\<close> \<open>0 < e\<close> not_le by fastforce | |
| 7173 | qed | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7174 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7175 | lemma pole_theorem_analytic_0: | 
| 68420 | 7176 | assumes g: "g analytic_on S" | 
| 7177 |       and eq: "\<And>z. z \<in> S \<Longrightarrow> \<exists>d. 0 < d \<and> (\<forall>w \<in> ball z d - {a}. g w = (w - a) * f w)"
 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7178 | and [simp]: "f a = deriv g a" "g a = 0" | 
| 68420 | 7179 | shows "f analytic_on S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7180 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7181 | have [simp]: "(\<lambda>z. if z = a then deriv g a else f z - g a / (z - a)) = f" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7182 | by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7183 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7184 | using pole_theorem_analytic [OF g eq] by simp | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7185 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7186 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7187 | lemma pole_theorem_analytic_open_superset: | 
| 68420 | 7188 | assumes g: "g analytic_on S" and "S \<subseteq> T" "open T" | 
| 7189 |       and eq: "\<And>z. z \<in> T - {a} \<Longrightarrow> g z = (z - a) * f z"
 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7190 | shows "(\<lambda>z. if z = a then deriv g a | 
| 68420 | 7191 | else f z - g a/(z - a)) analytic_on S" | 
| 7192 | proof (rule pole_theorem_analytic [OF g]) | |
| 7193 | fix z | |
| 7194 | assume "z \<in> S" | |
| 7195 | then obtain e where "0 < e" and e: "ball z e \<subseteq> T" | |
| 7196 | using assms openE by blast | |
| 7197 |   then show "\<exists>d>0. \<forall>w\<in>ball z d - {a}. g w = (w - a) * f w"
 | |
| 7198 | using eq by auto | |
| 7199 | qed | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7200 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7201 | lemma pole_theorem_analytic_open_superset_0: | 
| 68420 | 7202 |   assumes g: "g analytic_on S" "S \<subseteq> T" "open T" "\<And>z. z \<in> T - {a} \<Longrightarrow> g z = (z - a) * f z"
 | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7203 | and [simp]: "f a = deriv g a" "g a = 0" | 
| 68420 | 7204 | shows "f analytic_on S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7205 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7206 | have [simp]: "(\<lambda>z. if z = a then deriv g a else f z - g a / (z - a)) = f" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7207 | by auto | 
| 68420 | 7208 | have "(\<lambda>z. if z = a then deriv g a else f z - g a/(z - a)) analytic_on S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7209 | by (rule pole_theorem_analytic_open_superset [OF g]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7210 | then show ?thesis by simp | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7211 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7212 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7213 | |
| 67968 | 7214 | subsection\<open>General, homology form of Cauchy's theorem\<close> | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7215 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7216 | text\<open>Proof is based on Dixon's, as presented in Lang's "Complex Analysis" book (page 147).\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7217 | |
| 62217 | 7218 | lemma contour_integral_continuous_on_linepath_2D: | 
| 68420 | 7219 | assumes "open U" and cont_dw: "\<And>w. w \<in> U \<Longrightarrow> F w contour_integrable_on (linepath a b)" | 
| 7220 | and cond_uu: "continuous_on (U \<times> U) (\<lambda>(x,y). F x y)" | |
| 7221 | and abu: "closed_segment a b \<subseteq> U" | |
| 7222 | shows "continuous_on U (\<lambda>w. contour_integral (linepath a b) (F w))" | |
| 62217 | 7223 | proof - | 
| 68420 | 7224 | have *: "\<exists>d>0. \<forall>x'\<in>U. dist x' w < d \<longrightarrow> | 
| 62217 | 7225 | dist (contour_integral (linepath a b) (F x')) | 
| 7226 | (contour_integral (linepath a b) (F w)) \<le> \<epsilon>" | |
| 68420 | 7227 | if "w \<in> U" "0 < \<epsilon>" "a \<noteq> b" for w \<epsilon> | 
| 62217 | 7228 | proof - | 
| 68420 | 7229 | obtain \<delta> where "\<delta>>0" and \<delta>: "cball w \<delta> \<subseteq> U" using open_contains_cball \<open>open U\<close> \<open>w \<in> U\<close> by force | 
| 7230 | let ?TZ = "cball w \<delta> \<times> closed_segment a b" | |
| 62217 | 7231 | have "uniformly_continuous_on ?TZ (\<lambda>(x,y). F x y)" | 
| 68420 | 7232 | proof (rule compact_uniformly_continuous) | 
| 7233 | show "continuous_on ?TZ (\<lambda>(x,y). F x y)" | |
| 7234 | by (rule continuous_on_subset[OF cond_uu]) (use SigmaE \<delta> abu in blast) | |
| 7235 | show "compact ?TZ" | |
| 7236 | by (simp add: compact_Times) | |
| 7237 | qed | |
| 62217 | 7238 | then obtain \<eta> where "\<eta>>0" | 
| 7239 | and \<eta>: "\<And>x x'. \<lbrakk>x\<in>?TZ; x'\<in>?TZ; dist x' x < \<eta>\<rbrakk> \<Longrightarrow> | |
| 7240 | dist ((\<lambda>(x,y). F x y) x') ((\<lambda>(x,y). F x y) x) < \<epsilon>/norm(b - a)" | |
| 7241 | apply (rule uniformly_continuous_onE [where e = "\<epsilon>/norm(b - a)"]) | |
| 7242 | using \<open>0 < \<epsilon>\<close> \<open>a \<noteq> b\<close> by auto | |
| 62397 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 7243 | have \<eta>: "\<lbrakk>norm (w - x1) \<le> \<delta>; x2 \<in> closed_segment a b; | 
| 62217 | 7244 | norm (w - x1') \<le> \<delta>; x2' \<in> closed_segment a b; norm ((x1', x2') - (x1, x2)) < \<eta>\<rbrakk> | 
| 7245 | \<Longrightarrow> norm (F x1' x2' - F x1 x2) \<le> \<epsilon> / cmod (b - a)" | |
| 7246 | for x1 x2 x1' x2' | |
| 68339 | 7247 | using \<eta> [of "(x1,x2)" "(x1',x2')"] by (force simp: dist_norm) | 
| 62217 | 7248 | have le_ee: "cmod (contour_integral (linepath a b) (\<lambda>x. F x' x - F w x)) \<le> \<epsilon>" | 
| 68420 | 7249 | if "x' \<in> U" "cmod (x' - w) < \<delta>" "cmod (x' - w) < \<eta>" for x' | 
| 62217 | 7250 | proof - | 
| 68420 | 7251 | have "(\<lambda>x. F x' x - F w x) contour_integrable_on linepath a b" | 
| 7252 | by (simp add: \<open>w \<in> U\<close> cont_dw contour_integrable_diff that) | |
| 7253 | then have "cmod (contour_integral (linepath a b) (\<lambda>x. F x' x - F w x)) \<le> \<epsilon>/norm(b - a) * norm(b - a)" | |
| 62217 | 7254 | apply (rule has_contour_integral_bound_linepath [OF has_contour_integral_integral _ \<eta>]) | 
| 68420 | 7255 | using \<open>0 < \<epsilon>\<close> \<open>0 < \<delta>\<close> that apply (auto simp: norm_minus_commute) | 
| 62217 | 7256 | done | 
| 68339 | 7257 | also have "\<dots> = \<epsilon>" using \<open>a \<noteq> b\<close> by simp | 
| 62217 | 7258 | finally show ?thesis . | 
| 7259 | qed | |
| 7260 | show ?thesis | |
| 7261 | apply (rule_tac x="min \<delta> \<eta>" in exI) | |
| 7262 | using \<open>0 < \<delta>\<close> \<open>0 < \<eta>\<close> | |
| 68420 | 7263 | apply (auto simp: dist_norm contour_integral_diff [OF cont_dw cont_dw, symmetric] \<open>w \<in> U\<close> intro: le_ee) | 
| 62217 | 7264 | done | 
| 7265 | qed | |
| 62397 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 7266 | show ?thesis | 
| 68420 | 7267 | proof (cases "a=b") | 
| 7268 | case True | |
| 7269 | then show ?thesis by simp | |
| 7270 | next | |
| 7271 | case False | |
| 7272 | show ?thesis | |
| 7273 | by (rule continuous_onI) (use False in \<open>auto intro: *\<close>) | |
| 7274 | qed | |
| 62397 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 7275 | qed | 
| 62217 | 7276 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7277 | text\<open>This version has @{term"polynomial_function \<gamma>"} as an additional assumption.\<close>
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7278 | lemma Cauchy_integral_formula_global_weak: | 
| 68420 | 7279 | assumes "open U" and holf: "f holomorphic_on U" | 
| 7280 | and z: "z \<in> U" and \<gamma>: "polynomial_function \<gamma>" | |
| 7281 |         and pasz: "path_image \<gamma> \<subseteq> U - {z}" and loop: "pathfinish \<gamma> = pathstart \<gamma>"
 | |
| 7282 | and zero: "\<And>w. w \<notin> U \<Longrightarrow> winding_number \<gamma> w = 0" | |
| 63589 | 7283 | shows "((\<lambda>w. f w / (w - z)) has_contour_integral (2*pi * \<i> * winding_number \<gamma> z * f z)) \<gamma>" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7284 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7285 | obtain \<gamma>' where pf\<gamma>': "polynomial_function \<gamma>'" and \<gamma>': "\<And>x. (\<gamma> has_vector_derivative (\<gamma>' x)) (at x)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7286 | using has_vector_derivative_polynomial_function [OF \<gamma>] by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7287 | then have "bounded(path_image \<gamma>')" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7288 | by (simp add: path_image_def compact_imp_bounded compact_continuous_image continuous_on_polymonial_function) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7289 | then obtain B where "B>0" and B: "\<And>x. x \<in> path_image \<gamma>' \<Longrightarrow> norm x \<le> B" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7290 | using bounded_pos by force | 
| 63040 | 7291 | define d where [abs_def]: "d z w = (if w = z then deriv f z else (f w - f z)/(w - z))" for z w | 
| 7292 |   define v where "v = {w. w \<notin> path_image \<gamma> \<and> winding_number \<gamma> w = 0}"
 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7293 | have "path \<gamma>" "valid_path \<gamma>" using \<gamma> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7294 | by (auto simp: path_polynomial_function valid_path_polynomial_function) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7295 | then have ov: "open v" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7296 | by (simp add: v_def open_winding_number_levelsets loop) | 
| 68420 | 7297 | have uv_Un: "U \<union> v = UNIV" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7298 | using pasz zero by (auto simp: v_def) | 
| 68420 | 7299 | have conf: "continuous_on U f" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7300 | by (metis holf holomorphic_on_imp_continuous_on) | 
| 68420 | 7301 | have hol_d: "(d y) holomorphic_on U" if "y \<in> U" for y | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7302 | proof - | 
| 68420 | 7303 | have *: "(\<lambda>c. if c = y then deriv f y else (f c - f y) / (c - y)) holomorphic_on U" | 
| 7304 | by (simp add: holf pole_lemma_open \<open>open U\<close>) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7305 | then have "isCont (\<lambda>x. if x = y then deriv f y else (f x - f y) / (x - y)) y" | 
| 68420 | 7306 | using at_within_open field_differentiable_imp_continuous_at holomorphic_on_def that \<open>open U\<close> by fastforce | 
| 7307 | then have "continuous_on U (d y)" | |
| 7308 | apply (simp add: d_def continuous_on_eq_continuous_at \<open>open U\<close>, clarify) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7309 | using * holomorphic_on_def | 
| 68420 | 7310 | by (meson field_differentiable_within_open field_differentiable_imp_continuous_at \<open>open U\<close>) | 
| 7311 |     moreover have "d y holomorphic_on U - {y}"
 | |
| 7312 | proof - | |
| 7313 |       have "\<And>w. w \<in> U - {y} \<Longrightarrow>
 | |
| 7314 | (\<lambda>w. if w = y then deriv f y else (f w - f y) / (w - y)) field_differentiable at w" | |
| 7315 | apply (rule_tac d="dist w y" and f = "\<lambda>w. (f w - f y)/(w - y)" in field_differentiable_transform_within) | |
| 7316 | apply (auto simp: dist_pos_lt dist_commute intro!: derivative_intros) | |
| 7317 | using \<open>open U\<close> holf holomorphic_on_imp_differentiable_at by blast | |
| 7318 | then show ?thesis | |
| 7319 | unfolding field_differentiable_def by (simp add: d_def holomorphic_on_open \<open>open U\<close> open_delete) | |
| 7320 | qed | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7321 | ultimately show ?thesis | 
| 68420 | 7322 | by (rule no_isolated_singularity) (auto simp: \<open>open U\<close>) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7323 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7324 | have cint_fxy: "(\<lambda>x. (f x - f y) / (x - y)) contour_integrable_on \<gamma>" if "y \<notin> path_image \<gamma>" for y | 
| 68420 | 7325 |   proof (rule contour_integrable_holomorphic_simple [where S = "U-{y}"])
 | 
| 7326 |     show "(\<lambda>x. (f x - f y) / (x - y)) holomorphic_on U - {y}"
 | |
| 7327 | by (force intro: holomorphic_intros holomorphic_on_subset [OF holf]) | |
| 7328 |     show "path_image \<gamma> \<subseteq> U - {y}"
 | |
| 7329 | using pasz that by blast | |
| 7330 | qed (auto simp: \<open>open U\<close> open_delete \<open>valid_path \<gamma>\<close>) | |
| 63040 | 7331 | define h where | 
| 68420 | 7332 | "h z = (if z \<in> U then contour_integral \<gamma> (d z) else contour_integral \<gamma> (\<lambda>w. f w/(w - z)))" for z | 
| 7333 | have U: "((d z) has_contour_integral h z) \<gamma>" if "z \<in> U" for z | |
| 7334 | proof - | |
| 7335 | have "d z holomorphic_on U" | |
| 7336 | by (simp add: hol_d that) | |
| 7337 | with that show ?thesis | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7338 | apply (simp add: h_def) | 
| 68420 | 7339 | by (meson Diff_subset \<open>open U\<close> \<open>valid_path \<gamma>\<close> contour_integrable_holomorphic_simple has_contour_integral_integral pasz subset_trans) | 
| 7340 | qed | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7341 | have V: "((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>" if z: "z \<in> v" for z | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7342 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7343 | have 0: "0 = (f z) * 2 * of_real (2 * pi) * \<i> * winding_number \<gamma> z" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7344 | using v_def z by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7345 | then have "((\<lambda>x. 1 / (x - z)) has_contour_integral 0) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7346 | using z v_def has_contour_integral_winding_number [OF \<open>valid_path \<gamma>\<close>] by fastforce | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7347 | then have "((\<lambda>x. f z * (1 / (x - z))) has_contour_integral 0) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7348 | using has_contour_integral_lmul by fastforce | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7349 | then have "((\<lambda>x. f z / (x - z)) has_contour_integral 0) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7350 | by (simp add: divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7351 | moreover have "((\<lambda>x. (f x - f z) / (x - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7352 | using z | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7353 | apply (auto simp: v_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7354 | apply (metis (no_types, lifting) contour_integrable_eq d_def has_contour_integral_eq has_contour_integral_integral cint_fxy) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7355 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7356 | ultimately have *: "((\<lambda>x. f z / (x - z) + (f x - f z) / (x - z)) has_contour_integral (0 + contour_integral \<gamma> (d z))) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7357 | by (rule has_contour_integral_add) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7358 | have "((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>" | 
| 68420 | 7359 | if "z \<in> U" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7360 | using * by (auto simp: divide_simps has_contour_integral_eq) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7361 | moreover have "((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (\<lambda>w. f w / (w - z))) \<gamma>" | 
| 68420 | 7362 | if "z \<notin> U" | 
| 7363 | apply (rule has_contour_integral_integral [OF contour_integrable_holomorphic_simple [where S=U]]) | |
| 7364 | using U pasz \<open>valid_path \<gamma>\<close> that | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7365 | apply (auto intro: holomorphic_on_imp_continuous_on hol_d) | 
| 68420 | 7366 | apply (rule continuous_intros conf holomorphic_intros holf assms | force)+ | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7367 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7368 | ultimately show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7369 | using z by (simp add: h_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7370 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7371 | have znot: "z \<notin> path_image \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7372 | using pasz by blast | 
| 68420 | 7373 | obtain d0 where "d0>0" and d0: "\<And>x y. x \<in> path_image \<gamma> \<Longrightarrow> y \<in> - U \<Longrightarrow> d0 \<le> dist x y" | 
| 7374 | using separate_compact_closed [of "path_image \<gamma>" "-U"] pasz \<open>open U\<close> | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7375 | by (fastforce simp add: \<open>path \<gamma>\<close> compact_path_image) | 
| 68420 | 7376 |   obtain dd where "0 < dd" and dd: "{y + k | y k. y \<in> path_image \<gamma> \<and> k \<in> ball 0 dd} \<subseteq> U"
 | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7377 | apply (rule that [of "d0/2"]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7378 | using \<open>0 < d0\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7379 | apply (auto simp: dist_norm dest: d0) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7380 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7381 | have "\<And>x x'. \<lbrakk>x \<in> path_image \<gamma>; dist x x' * 2 < dd\<rbrakk> \<Longrightarrow> \<exists>y k. x' = y + k \<and> y \<in> path_image \<gamma> \<and> dist 0 k * 2 \<le> dd" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7382 | apply (rule_tac x=x in exI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7383 | apply (rule_tac x="x'-x" in exI) | 
| 68339 | 7384 | apply (force simp: dist_norm) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7385 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7386 |   then have 1: "path_image \<gamma> \<subseteq> interior {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> cball 0 (dd / 2)}"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7387 | apply (clarsimp simp add: mem_interior) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7388 | using \<open>0 < dd\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7389 | apply (rule_tac x="dd/2" in exI, auto) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7390 | done | 
| 68420 | 7391 | obtain T where "compact T" and subt: "path_image \<gamma> \<subseteq> interior T" and T: "T \<subseteq> U" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7392 | apply (rule that [OF _ 1]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7393 | apply (fastforce simp add: \<open>valid_path \<gamma>\<close> compact_valid_path_image intro!: compact_sums) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7394 | apply (rule order_trans [OF _ dd]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7395 | using \<open>0 < dd\<close> by fastforce | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7396 | obtain L where "L>0" | 
| 68420 | 7397 | and L: "\<And>f B. \<lbrakk>f holomorphic_on interior T; \<And>z. z\<in>interior T \<Longrightarrow> cmod (f z) \<le> B\<rbrakk> \<Longrightarrow> | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7398 | cmod (contour_integral \<gamma> f) \<le> L * B" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7399 | using contour_integral_bound_exists [OF open_interior \<open>valid_path \<gamma>\<close> subt] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7400 | by blast | 
| 68420 | 7401 | have "bounded(f ` T)" | 
| 7402 | by (meson \<open>compact T\<close> compact_continuous_image compact_imp_bounded conf continuous_on_subset T) | |
| 7403 | then obtain D where "D>0" and D: "\<And>x. x \<in> T \<Longrightarrow> norm (f x) \<le> D" | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7404 | by (auto simp: bounded_pos) | 
| 68420 | 7405 | obtain C where "C>0" and C: "\<And>x. x \<in> T \<Longrightarrow> norm x \<le> C" | 
| 7406 | using \<open>compact T\<close> bounded_pos compact_imp_bounded by force | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7407 | have "dist (h y) 0 \<le> e" if "0 < e" and le: "D * L / e + C \<le> cmod y" for e y | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7408 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7409 | have "D * L / e > 0" using \<open>D>0\<close> \<open>L>0\<close> \<open>e>0\<close> by simp | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7410 | with le have ybig: "norm y > C" by force | 
| 68420 | 7411 | with C have "y \<notin> T" by force | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7412 | then have ynot: "y \<notin> path_image \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7413 | using subt interior_subset by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7414 | have [simp]: "winding_number \<gamma> y = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7415 | apply (rule winding_number_zero_outside [of _ "cball 0 C"]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7416 | using ybig interior_subset subt | 
| 68339 | 7417 | apply (force simp: loop \<open>path \<gamma>\<close> dist_norm intro!: C)+ | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7418 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7419 | have [simp]: "h y = contour_integral \<gamma> (\<lambda>w. f w/(w - y))" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7420 | by (rule contour_integral_unique [symmetric]) (simp add: v_def ynot V) | 
| 68420 | 7421 | have holint: "(\<lambda>w. f w / (w - y)) holomorphic_on interior T" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7422 | apply (rule holomorphic_on_divide) | 
| 68420 | 7423 | using holf holomorphic_on_subset interior_subset T apply blast | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7424 | apply (rule holomorphic_intros)+ | 
| 68420 | 7425 | using \<open>y \<notin> T\<close> interior_subset by auto | 
| 7426 | have leD: "cmod (f z / (z - y)) \<le> D * (e / L / D)" if z: "z \<in> interior T" for z | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7427 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7428 | have "D * L / e + cmod z \<le> cmod y" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7429 | using le C [of z] z using interior_subset by force | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7430 | then have DL2: "D * L / e \<le> cmod (z - y)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7431 | using norm_triangle_ineq2 [of y z] by (simp add: norm_minus_commute) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7432 | have "cmod (f z / (z - y)) = cmod (f z) * inverse (cmod (z - y))" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7433 | by (simp add: norm_mult norm_inverse Fields.field_class.field_divide_inverse) | 
| 68339 | 7434 | also have "\<dots> \<le> D * (e / L / D)" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7435 | apply (rule mult_mono) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7436 | using that D interior_subset apply blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7437 | using \<open>L>0\<close> \<open>e>0\<close> \<open>D>0\<close> DL2 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7438 | apply (auto simp: norm_divide divide_simps algebra_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7439 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7440 | finally show ?thesis . | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7441 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7442 | have "dist (h y) 0 = cmod (contour_integral \<gamma> (\<lambda>w. f w / (w - y)))" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7443 | by (simp add: dist_norm) | 
| 68339 | 7444 | also have "\<dots> \<le> L * (D * (e / L / D))" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7445 | by (rule L [OF holint leD]) | 
| 68339 | 7446 | also have "\<dots> = e" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7447 | using \<open>L>0\<close> \<open>0 < D\<close> by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7448 | finally show ?thesis . | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7449 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7450 | then have "(h \<longlongrightarrow> 0) at_infinity" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7451 | by (meson Lim_at_infinityI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7452 | moreover have "h holomorphic_on UNIV" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7453 | proof - | 
| 62217 | 7454 | have con_ff: "continuous (at (x,z)) (\<lambda>(x,y). (f y - f x) / (y - x))" | 
| 68420 | 7455 | if "x \<in> U" "z \<in> U" "x \<noteq> z" for x z | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7456 | using that conf | 
| 68420 | 7457 | apply (simp add: split_def continuous_on_eq_continuous_at \<open>open U\<close>) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7458 | apply (simp | rule continuous_intros continuous_within_compose2 [where g=f])+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7459 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7460 | have con_fstsnd: "continuous_on UNIV (\<lambda>x. (fst x - snd x) ::complex)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7461 | by (rule continuous_intros)+ | 
| 68420 | 7462 | have open_uu_Id: "open (U \<times> U - Id)" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7463 | apply (rule open_Diff) | 
| 68420 | 7464 | apply (simp add: open_Times \<open>open U\<close>) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7465 | using continuous_closed_preimage_constant [OF con_fstsnd closed_UNIV, of 0] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7466 | apply (auto simp: Id_fstsnd_eq algebra_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7467 | done | 
| 68420 | 7468 | have con_derf: "continuous (at z) (deriv f)" if "z \<in> U" for z | 
| 7469 | apply (rule continuous_on_interior [of U]) | |
| 7470 | apply (simp add: holf holomorphic_deriv holomorphic_on_imp_continuous_on \<open>open U\<close>) | |
| 7471 | by (simp add: interior_open that \<open>open U\<close>) | |
| 62217 | 7472 | have tendsto_f': "((\<lambda>(x,y). if y = x then deriv f (x) | 
| 7473 | else (f (y) - f (x)) / (y - x)) \<longlongrightarrow> deriv f x) | |
| 68420 | 7474 | (at (x, x) within U \<times> U)" if "x \<in> U" for x | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7475 | proof (rule Lim_withinI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7476 | fix e::real assume "0 < e" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7477 | obtain k1 where "k1>0" and k1: "\<And>x'. norm (x' - x) \<le> k1 \<Longrightarrow> norm (deriv f x' - deriv f x) < e" | 
| 68420 | 7478 | using \<open>0 < e\<close> continuous_within_E [OF con_derf [OF \<open>x \<in> U\<close>]] | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7479 | by (metis UNIV_I dist_norm) | 
| 68493 | 7480 | obtain k2 where "k2>0" and k2: "ball x k2 \<subseteq> U" | 
| 68420 | 7481 | by (blast intro: openE [OF \<open>open U\<close>] \<open>x \<in> U\<close>) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7482 | have neq: "norm ((f z' - f x') / (z' - x') - deriv f x) \<le> e" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7483 | if "z' \<noteq> x'" and less_k1: "norm (x'-x, z'-x) < k1" and less_k2: "norm (x'-x, z'-x) < k2" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7484 | for x' z' | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7485 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7486 | have cs_less: "w \<in> closed_segment x' z' \<Longrightarrow> cmod (w - x) \<le> norm (x'-x, z'-x)" for w | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7487 | apply (drule segment_furthest_le [where y=x]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7488 | by (metis (no_types) dist_commute dist_norm norm_fst_le norm_snd_le order_trans) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7489 | have derf_le: "w \<in> closed_segment x' z' \<Longrightarrow> z' \<noteq> x' \<Longrightarrow> cmod (deriv f w - deriv f x) \<le> e" for w | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7490 | by (blast intro: cs_less less_k1 k1 [unfolded divide_const_simps dist_norm] less_imp_le le_less_trans) | 
| 68420 | 7491 | have f_has_der: "\<And>x. x \<in> U \<Longrightarrow> (f has_field_derivative deriv f x) (at x within U)" | 
| 7492 | by (metis DERIV_deriv_iff_field_differentiable at_within_open holf holomorphic_on_def \<open>open U\<close>) | |
| 7493 | have "closed_segment x' z' \<subseteq> U" | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7494 | by (rule order_trans [OF _ k2]) (simp add: cs_less le_less_trans [OF _ less_k2] dist_complex_def norm_minus_commute subset_iff) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7495 | then have cint_derf: "(deriv f has_contour_integral f z' - f x') (linepath x' z')" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7496 | using contour_integral_primitive [OF f_has_der valid_path_linepath] pasz by simp | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7497 | then have *: "((\<lambda>x. deriv f x / (z' - x')) has_contour_integral (f z' - f x') / (z' - x')) (linepath x' z')" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7498 | by (rule has_contour_integral_div) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7499 | have "norm ((f z' - f x') / (z' - x') - deriv f x) \<le> e/norm(z' - x') * norm(z' - x')" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7500 | apply (rule has_contour_integral_bound_linepath [OF has_contour_integral_diff [OF *]]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7501 | using has_contour_integral_div [where c = "z' - x'", OF has_contour_integral_const_linepath [of "deriv f x" z' x']] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7502 | \<open>e > 0\<close> \<open>z' \<noteq> x'\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7503 | apply (auto simp: norm_divide divide_simps derf_le) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7504 | done | 
| 68339 | 7505 | also have "\<dots> \<le> e" using \<open>0 < e\<close> by simp | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7506 | finally show ?thesis . | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7507 | qed | 
| 68420 | 7508 | show "\<exists>d>0. \<forall>xa\<in>U \<times> U. | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7509 | 0 < dist xa (x, x) \<and> dist xa (x, x) < d \<longrightarrow> | 
| 62217 | 7510 | dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7511 | apply (rule_tac x="min k1 k2" in exI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7512 | using \<open>k1>0\<close> \<open>k2>0\<close> \<open>e>0\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7513 | apply (force simp: dist_norm neq intro: dual_order.strict_trans2 k1 less_imp_le norm_fst_le) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7514 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7515 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7516 | have con_pa_f: "continuous_on (path_image \<gamma>) f" | 
| 68420 | 7517 | by (meson holf holomorphic_on_imp_continuous_on holomorphic_on_subset interior_subset subt T) | 
| 7518 |     have le_B: "\<And>T. T \<in> {0..1} \<Longrightarrow> cmod (vector_derivative \<gamma> (at T)) \<le> B"
 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7519 | apply (rule B) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7520 | using \<gamma>' using path_image_def vector_derivative_at by fastforce | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7521 | have f_has_cint: "\<And>w. w \<in> v - path_image \<gamma> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ 1) has_contour_integral h w) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7522 | by (simp add: V) | 
| 68420 | 7523 | have cond_uu: "continuous_on (U \<times> U) (\<lambda>(x,y). d x y)" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7524 | apply (simp add: continuous_on_eq_continuous_within d_def continuous_within tendsto_f') | 
| 68420 | 7525 | apply (simp add: tendsto_within_open_NO_MATCH open_Times \<open>open U\<close>, clarify) | 
| 62217 | 7526 | apply (rule Lim_transform_within_open [OF _ open_uu_Id, where f = "(\<lambda>(x,y). (f y - f x) / (y - x))"]) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7527 | using con_ff | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7528 | apply (auto simp: continuous_within) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7529 | done | 
| 68420 | 7530 | have hol_dw: "(\<lambda>z. d z w) holomorphic_on U" if "w \<in> U" for w | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7531 | proof - | 
| 68420 | 7532 | have "continuous_on U ((\<lambda>(x,y). d x y) \<circ> (\<lambda>z. (w,z)))" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7533 | by (rule continuous_on_compose continuous_intros continuous_on_subset [OF cond_uu] | force intro: that)+ | 
| 68420 | 7534 | then have *: "continuous_on U (\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z))" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7535 | by (rule rev_iffD1 [OF _ continuous_on_cong [OF refl]]) (simp add: d_def field_simps) | 
| 68420 | 7536 | have **: "\<And>x. \<lbrakk>x \<in> U; x \<noteq> w\<rbrakk> \<Longrightarrow> (\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z)) field_differentiable at x" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7537 | apply (rule_tac f = "\<lambda>x. (f w - f x)/(w - x)" and d = "dist x w" in field_differentiable_transform_within) | 
| 68420 | 7538 | apply (rule \<open>open U\<close> derivative_intros holomorphic_on_imp_differentiable_at [OF holf] | force simp: dist_commute)+ | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7539 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7540 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7541 | unfolding d_def | 
| 68420 | 7542 |         apply (rule no_isolated_singularity [OF * _ \<open>open U\<close>, where K = "{w}"])
 | 
| 7543 | apply (auto simp: field_differentiable_def [symmetric] holomorphic_on_open open_Diff \<open>open U\<close> **) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7544 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7545 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7546 |     { fix a b
 | 
| 68420 | 7547 | assume abu: "closed_segment a b \<subseteq> U" | 
| 7548 | then have "\<And>w. w \<in> U \<Longrightarrow> (\<lambda>z. d z w) contour_integrable_on (linepath a b)" | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7549 | by (metis hol_dw continuous_on_subset contour_integrable_continuous_linepath holomorphic_on_imp_continuous_on) | 
| 68420 | 7550 | then have cont_cint_d: "continuous_on U (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))" | 
| 7551 | apply (rule contour_integral_continuous_on_linepath_2D [OF \<open>open U\<close> _ _ abu]) | |
| 68339 | 7552 | apply (auto intro: continuous_on_swap_args cond_uu) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7553 | done | 
| 68339 | 7554 |       have cont_cint_d\<gamma>: "continuous_on {0..1} ((\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) \<circ> \<gamma>)"
 | 
| 68420 | 7555 | proof (rule continuous_on_compose) | 
| 7556 |         show "continuous_on {0..1} \<gamma>"
 | |
| 7557 | using \<open>path \<gamma>\<close> path_def by blast | |
| 7558 |         show "continuous_on (\<gamma> ` {0..1}) (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))"
 | |
| 7559 | using pasz unfolding path_image_def | |
| 7560 | by (auto intro!: continuous_on_subset [OF cont_cint_d]) | |
| 7561 | qed | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7562 | have cint_cint: "(\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) contour_integrable_on \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7563 | apply (simp add: contour_integrable_on) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7564 | apply (rule integrable_continuous_real) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7565 | apply (rule continuous_on_mult [OF cont_cint_d\<gamma> [unfolded o_def]]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7566 | using pf\<gamma>' | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7567 | by (simp add: continuous_on_polymonial_function vector_derivative_at [OF \<gamma>']) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7568 | have "contour_integral (linepath a b) h = contour_integral (linepath a b) (\<lambda>z. contour_integral \<gamma> (d z))" | 
| 68339 | 7569 | using abu by (force simp: h_def intro: contour_integral_eq) | 
| 7570 | also have "\<dots> = contour_integral \<gamma> (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))" | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7571 | apply (rule contour_integral_swap) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7572 | apply (rule continuous_on_subset [OF cond_uu]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7573 | using abu pasz \<open>valid_path \<gamma>\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7574 | apply (auto intro!: continuous_intros) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7575 | by (metis \<gamma>' continuous_on_eq path_def path_polynomial_function pf\<gamma>' vector_derivative_at) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7576 | finally have cint_h_eq: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7577 | "contour_integral (linepath a b) h = | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7578 | contour_integral \<gamma> (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))" . | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7579 | note cint_cint cint_h_eq | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7580 | } note cint_h = this | 
| 68420 | 7581 | have conthu: "continuous_on U h" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7582 | proof (simp add: continuous_on_sequentially, clarify) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7583 | fix a x | 
| 68420 | 7584 | assume x: "x \<in> U" and au: "\<forall>n. a n \<in> U" and ax: "a \<longlonglongrightarrow> x" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7585 | then have A1: "\<forall>\<^sub>F n in sequentially. d (a n) contour_integrable_on \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7586 | by (meson U contour_integrable_on_def eventuallyI) | 
| 68420 | 7587 | obtain dd where "dd>0" and dd: "cball x dd \<subseteq> U" using open_contains_cball \<open>open U\<close> x by force | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7588 | have A2: "uniform_limit (path_image \<gamma>) (\<lambda>n. d (a n)) (d x) sequentially" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7589 | unfolding uniform_limit_iff dist_norm | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7590 | proof clarify | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7591 | fix ee::real | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7592 | assume "0 < ee" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7593 | show "\<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7594 | proof - | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7595 |           let ?ddpa = "{(w,z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}"
 | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7596 | have "uniformly_continuous_on ?ddpa (\<lambda>(x,y). d x y)" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7597 | apply (rule compact_uniformly_continuous [OF continuous_on_subset[OF cond_uu]]) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7598 | using dd pasz \<open>valid_path \<gamma>\<close> | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7599 | apply (auto simp: compact_Times compact_valid_path_image simp del: mem_cball) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7600 | done | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7601 | then obtain kk where "kk>0" | 
| 68420 | 7602 | and kk: "\<And>x x'. \<lbrakk>x \<in> ?ddpa; x' \<in> ?ddpa; dist x' x < kk\<rbrakk> \<Longrightarrow> | 
| 62217 | 7603 | dist ((\<lambda>(x,y). d x y) x') ((\<lambda>(x,y). d x y) x) < ee" | 
| 68420 | 7604 | by (rule uniformly_continuous_onE [where e = ee]) (use \<open>0 < ee\<close> in auto) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7605 | have kk: "\<lbrakk>norm (w - x) \<le> dd; z \<in> path_image \<gamma>; norm ((w, z) - (x, z)) < kk\<rbrakk> \<Longrightarrow> norm (d w z - d x z) < ee" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7606 | for w z | 
| 68339 | 7607 | using \<open>dd>0\<close> kk [of "(x,z)" "(w,z)"] by (force simp: norm_minus_commute dist_norm) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7608 | show ?thesis | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7609 | using ax unfolding lim_sequentially eventually_sequentially | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7610 | apply (drule_tac x="min dd kk" in spec) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7611 | using \<open>dd > 0\<close> \<open>kk > 0\<close> | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7612 | apply (fastforce simp: kk dist_norm) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7613 | done | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7614 | qed | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7615 | qed | 
| 68420 | 7616 | have "(\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> contour_integral \<gamma> (d x)" | 
| 7617 | by (rule contour_integral_uniform_limit [OF A1 A2 le_B]) (auto simp: \<open>valid_path \<gamma>\<close>) | |
| 7618 | then have tendsto_hx: "(\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> h x" | |
| 7619 | by (simp add: h_def x) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7620 | then show "(h \<circ> a) \<longlonglongrightarrow> h x" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7621 | by (simp add: h_def x au o_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7622 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7623 | show ?thesis | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7624 | proof (simp add: holomorphic_on_open field_differentiable_def [symmetric], clarify) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7625 | fix z0 | 
| 68420 | 7626 | consider "z0 \<in> v" | "z0 \<in> U" using uv_Un by blast | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7627 | then show "h field_differentiable at z0" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7628 | proof cases | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7629 | assume "z0 \<in> v" then show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7630 | using Cauchy_next_derivative [OF con_pa_f le_B f_has_cint _ ov] V f_has_cint \<open>valid_path \<gamma>\<close> | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7631 | by (auto simp: field_differentiable_def v_def) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7632 | next | 
| 68420 | 7633 | assume "z0 \<in> U" then | 
| 7634 | obtain e where "e>0" and e: "ball z0 e \<subseteq> U" by (blast intro: openE [OF \<open>open U\<close>]) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7635 | have *: "contour_integral (linepath a b) h + contour_integral (linepath b c) h + contour_integral (linepath c a) h = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7636 |                 if abc_subset: "convex hull {a, b, c} \<subseteq> ball z0 e"  for a b c
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7637 | proof - | 
| 68420 | 7638 | have *: "\<And>x1 x2 z. z \<in> U \<Longrightarrow> closed_segment x1 x2 \<subseteq> U \<Longrightarrow> (\<lambda>w. d w z) contour_integrable_on linepath x1 x2" | 
| 7639 | using hol_dw holomorphic_on_imp_continuous_on \<open>open U\<close> | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7640 | by (auto intro!: contour_integrable_holomorphic_simple) | 
| 68420 | 7641 | have abc: "closed_segment a b \<subseteq> U" "closed_segment b c \<subseteq> U" "closed_segment c a \<subseteq> U" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7642 | using that e segments_subset_convex_hull by fastforce+ | 
| 68420 | 7643 | have eq0: "\<And>w. w \<in> U \<Longrightarrow> contour_integral (linepath a b +++ linepath b c +++ linepath c a) (\<lambda>z. d z w) = 0" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7644 | apply (rule contour_integral_unique [OF Cauchy_theorem_triangle]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7645 | apply (rule holomorphic_on_subset [OF hol_dw]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7646 | using e abc_subset by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7647 | have "contour_integral \<gamma> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7648 | (\<lambda>x. contour_integral (linepath a b) (\<lambda>z. d z x) + | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7649 | (contour_integral (linepath b c) (\<lambda>z. d z x) + | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7650 | contour_integral (linepath c a) (\<lambda>z. d z x))) = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7651 | apply (rule contour_integral_eq_0) | 
| 68420 | 7652 | using abc pasz U | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7653 | apply (subst contour_integral_join [symmetric], auto intro: eq0 *)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7654 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7655 | then show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7656 | by (simp add: cint_h abc contour_integrable_add contour_integral_add [symmetric] add_ac) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7657 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7658 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7659 | using e \<open>e > 0\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7660 | by (auto intro!: holomorphic_on_imp_differentiable_at [OF _ open_ball] analytic_imp_holomorphic | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7661 | Morera_triangle continuous_on_subset [OF conthu] *) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7662 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7663 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7664 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7665 | ultimately have [simp]: "h z = 0" for z | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7666 | by (meson Liouville_weak) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7667 | have "((\<lambda>w. 1 / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7668 | by (rule has_contour_integral_winding_number [OF \<open>valid_path \<gamma>\<close> znot]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7669 | then have "((\<lambda>w. f z * (1 / (w - z))) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7670 | by (metis mult.commute has_contour_integral_lmul) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7671 | then have 1: "((\<lambda>w. f z / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7672 | by (simp add: divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7673 | moreover have 2: "((\<lambda>w. (f w - f z) / (w - z)) has_contour_integral 0) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7674 | using U [OF z] pasz d_def by (force elim: has_contour_integral_eq [where g = "\<lambda>w. (f w - f z)/(w - z)"]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7675 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7676 | using has_contour_integral_add [OF 1 2] by (simp add: diff_divide_distrib) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7677 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7678 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7679 | theorem Cauchy_integral_formula_global: | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7680 | assumes S: "open S" and holf: "f holomorphic_on S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7681 | and z: "z \<in> S" and vpg: "valid_path \<gamma>" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7682 |         and pasz: "path_image \<gamma> \<subseteq> S - {z}" and loop: "pathfinish \<gamma> = pathstart \<gamma>"
 | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7683 | and zero: "\<And>w. w \<notin> S \<Longrightarrow> winding_number \<gamma> w = 0" | 
| 63589 | 7684 | shows "((\<lambda>w. f w / (w - z)) has_contour_integral (2*pi * \<i> * winding_number \<gamma> z * f z)) \<gamma>" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7685 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7686 | have "path \<gamma>" using vpg by (blast intro: valid_path_imp_path) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7687 |   have hols: "(\<lambda>w. f w / (w - z)) holomorphic_on S - {z}" "(\<lambda>w. 1 / (w - z)) holomorphic_on S - {z}"
 | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7688 | by (rule holomorphic_intros holomorphic_on_subset [OF holf] | force)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7689 | then have cint_fw: "(\<lambda>w. f w / (w - z)) contour_integrable_on \<gamma>" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7690 | by (meson contour_integrable_holomorphic_simple holomorphic_on_imp_continuous_on open_delete S vpg pasz) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7691 | obtain d where "d>0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7692 |       and d: "\<And>g h. \<lbrakk>valid_path g; valid_path h; \<forall>t\<in>{0..1}. cmod (g t - \<gamma> t) < d \<and> cmod (h t - \<gamma> t) < d;
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7693 | pathstart h = pathstart g \<and> pathfinish h = pathfinish g\<rbrakk> | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7694 |                      \<Longrightarrow> path_image h \<subseteq> S - {z} \<and> (\<forall>f. f holomorphic_on S - {z} \<longrightarrow> contour_integral h f = contour_integral g f)"
 | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7695 | using contour_integral_nearby_ends [OF _ \<open>path \<gamma>\<close> pasz] S by (simp add: open_Diff) metis | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7696 | obtain p where polyp: "polynomial_function p" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7697 |              and ps: "pathstart p = pathstart \<gamma>" and pf: "pathfinish p = pathfinish \<gamma>" and led: "\<forall>t\<in>{0..1}. cmod (p t - \<gamma> t) < d"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7698 | using path_approx_polynomial_function [OF \<open>path \<gamma>\<close> \<open>d > 0\<close>] by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7699 | then have ploop: "pathfinish p = pathstart p" using loop by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7700 | have vpp: "valid_path p" using polyp valid_path_polynomial_function by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7701 | have [simp]: "z \<notin> path_image \<gamma>" using pasz by blast | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7702 |   have paps: "path_image p \<subseteq> S - {z}" and cint_eq: "(\<And>f. f holomorphic_on S - {z} \<Longrightarrow> contour_integral p f = contour_integral \<gamma> f)"
 | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7703 | using pf ps led d [OF vpg vpp] \<open>d > 0\<close> by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7704 | have wn_eq: "winding_number p z = winding_number \<gamma> z" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7705 | using vpp paps | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7706 | by (simp add: subset_Diff_insert vpg valid_path_polynomial_function winding_number_valid_path cint_eq hols) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7707 | have "winding_number p w = winding_number \<gamma> w" if "w \<notin> S" for w | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7708 | proof - | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7709 |     have hol: "(\<lambda>v. 1 / (v - w)) holomorphic_on S - {z}"
 | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7710 | using that by (force intro: holomorphic_intros holomorphic_on_subset [OF holf]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7711 | have "w \<notin> path_image p" "w \<notin> path_image \<gamma>" using paps pasz that by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7712 | then show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7713 | using vpp vpg by (simp add: subset_Diff_insert valid_path_polynomial_function winding_number_valid_path cint_eq [OF hol]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7714 | qed | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7715 | then have wn0: "\<And>w. w \<notin> S \<Longrightarrow> winding_number p w = 0" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7716 | by (simp add: zero) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7717 | show ?thesis | 
| 68493 | 7718 | using Cauchy_integral_formula_global_weak [OF S holf z polyp paps ploop wn0] hols | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7719 | by (metis wn_eq cint_eq has_contour_integral_eqpath cint_fw cint_eq) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7720 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7721 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7722 | theorem Cauchy_theorem_global: | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7723 | assumes S: "open S" and holf: "f holomorphic_on S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7724 | and vpg: "valid_path \<gamma>" and loop: "pathfinish \<gamma> = pathstart \<gamma>" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7725 | and pas: "path_image \<gamma> \<subseteq> S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7726 | and zero: "\<And>w. w \<notin> S \<Longrightarrow> winding_number \<gamma> w = 0" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7727 | shows "(f has_contour_integral 0) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7728 | proof - | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7729 | obtain z where "z \<in> S" and znot: "z \<notin> path_image \<gamma>" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7730 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7731 | have "compact (path_image \<gamma>)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7732 | using compact_valid_path_image vpg by blast | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7733 | then have "path_image \<gamma> \<noteq> S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7734 | by (metis (no_types) compact_open path_image_nonempty S) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7735 | with pas show ?thesis by (blast intro: that) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7736 | qed | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7737 |   then have pasz: "path_image \<gamma> \<subseteq> S - {z}" using pas by blast
 | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7738 | have hol: "(\<lambda>w. (w - z) * f w) holomorphic_on S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7739 | by (rule holomorphic_intros holf)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7740 | show ?thesis | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7741 | using Cauchy_integral_formula_global [OF S hol \<open>z \<in> S\<close> vpg pasz loop zero] | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7742 | by (auto simp: znot elim!: has_contour_integral_eq) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7743 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7744 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7745 | corollary Cauchy_theorem_global_outside: | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7746 | assumes "open S" "f holomorphic_on S" "valid_path \<gamma>" "pathfinish \<gamma> = pathstart \<gamma>" "path_image \<gamma> \<subseteq> S" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7747 | "\<And>w. w \<notin> S \<Longrightarrow> w \<in> outside(path_image \<gamma>)" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7748 | shows "(f has_contour_integral 0) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7749 | by (metis Cauchy_theorem_global assms winding_number_zero_in_outside valid_path_imp_path) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7750 | |
| 63955 | 7751 | lemma simply_connected_imp_winding_number_zero: | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7752 | assumes "simply_connected S" "path g" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7753 | "path_image g \<subseteq> S" "pathfinish g = pathstart g" "z \<notin> S" | 
| 63955 | 7754 | shows "winding_number g z = 0" | 
| 7755 | proof - | |
| 68420 | 7756 | have hom: "homotopic_loops S g (linepath (pathstart g) (pathstart g))" | 
| 7757 | by (meson assms homotopic_paths_imp_homotopic_loops pathfinish_linepath simply_connected_eq_contractible_path) | |
| 7758 |   then have "homotopic_paths (- {z}) g (linepath (pathstart g) (pathstart g))"
 | |
| 7759 | by (meson \<open>z \<notin> S\<close> homotopic_loops_imp_homotopic_paths_null homotopic_paths_subset subset_Compl_singleton) | |
| 7760 | then have "winding_number g z = winding_number(linepath (pathstart g) (pathstart g)) z" | |
| 7761 | by (rule winding_number_homotopic_paths) | |
| 68339 | 7762 | also have "\<dots> = 0" | 
| 63955 | 7763 | using assms by (force intro: winding_number_trivial) | 
| 7764 | finally show ?thesis . | |
| 7765 | qed | |
| 7766 | ||
| 7767 | lemma Cauchy_theorem_simply_connected: | |
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7768 | assumes "open S" "simply_connected S" "f holomorphic_on S" "valid_path g" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7769 | "path_image g \<subseteq> S" "pathfinish g = pathstart g" | 
| 63955 | 7770 | shows "(f has_contour_integral 0) g" | 
| 7771 | using assms | |
| 7772 | apply (simp add: simply_connected_eq_contractible_path) | |
| 7773 | apply (auto intro!: Cauchy_theorem_null_homotopic [where a = "pathstart g"] | |
| 7774 | homotopic_paths_imp_homotopic_loops) | |
| 7775 | using valid_path_imp_path by blast | |
| 7776 | ||
| 69423 
3922aa1df44e
Tagged some theories in HOL-Analysis: Cauchy_Integral_Theorem, Riemann_Mapping and Winding_Numbers.
 Wenda Li <wl302@cam.ac.uk> parents: 
69064diff
changeset | 7777 | proposition%unimportant holomorphic_logarithm_exists: | 
| 68493 | 7778 | assumes A: "convex A" "open A" | 
| 67107 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7779 | and f: "f holomorphic_on A" "\<And>x. x \<in> A \<Longrightarrow> f x \<noteq> 0" | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7780 | and z0: "z0 \<in> A" | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7781 | obtains g where "g holomorphic_on A" and "\<And>x. x \<in> A \<Longrightarrow> exp (g x) = f x" | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7782 | proof - | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7783 | note f' = holomorphic_derivI [OF f(1) A(2)] | 
| 68310 | 7784 | obtain g where g: "\<And>x. x \<in> A \<Longrightarrow> (g has_field_derivative deriv f x / f x) (at x)" | 
| 7785 | proof (rule holomorphic_convex_primitive' [OF A]) | |
| 7786 | show "(\<lambda>x. deriv f x / f x) holomorphic_on A" | |
| 7787 | by (intro holomorphic_intros f A) | |
| 7788 | qed (auto simp: A at_within_open[of _ A]) | |
| 67107 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7789 | define h where "h = (\<lambda>x. -g z0 + ln (f z0) + g x)" | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7790 | from g and A have g_holo: "g holomorphic_on A" | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7791 | by (auto simp: holomorphic_on_def at_within_open[of _ A] field_differentiable_def) | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7792 | hence h_holo: "h holomorphic_on A" | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7793 | by (auto simp: h_def intro!: holomorphic_intros) | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7794 | have "\<exists>c. \<forall>x\<in>A. f x / exp (h x) - 1 = c" | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7795 | proof (rule DERIV_zero_constant, goal_cases) | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7796 | case (2 x) | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7797 | note [simp] = at_within_open[OF _ \<open>open A\<close>] | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7798 | from 2 and z0 and f show ?case | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7799 | by (auto simp: h_def exp_diff field_simps intro!: derivative_eq_intros g f') | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7800 | qed fact+ | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7801 | then obtain c where c: "\<And>x. x \<in> A \<Longrightarrow> f x / exp (h x) - 1 = c" | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7802 | by blast | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7803 | from c[OF z0] and z0 and f have "c = 0" | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7804 | by (simp add: h_def) | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7805 | with c have "\<And>x. x \<in> A \<Longrightarrow> exp (h x) = f x" by simp | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7806 | from that[OF h_holo this] show ?thesis . | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7807 | qed | 
| 
cef76a19125e
Existence of a holomorphic logarithm
 eberlm <eberlm@in.tum.de> parents: 
66884diff
changeset | 7808 | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 7809 | end |