| author | wenzelm | 
| Mon, 02 Oct 2017 13:45:36 +0200 | |
| changeset 66748 | 3efac90a11a7 | 
| parent 66708 | 015a95f15040 | 
| child 66793 | deabce3ccf1f | 
| 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 | |
| 62620 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 9 | subsection\<open>Homeomorphisms of arc images\<close> | 
| 
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"
 | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 15 | using assms by (force simp add: arc_def homeomorphism_compact path_def path_image_def) | 
| 
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) | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 24 |   also have "... homeomorphic {a..b}"
 | 
| 
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) | 
| 
d21dab28b3f9
New results about paths, segments, etc. The notion of simply_connected.
 paulson <lp15@cam.ac.uk> parents: 
62618diff
changeset | 36 | also have "... homeomorphic (path_image h)" | 
| 
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 | |
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 87 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 88 | subsection \<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> | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 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: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 97 | "f piecewise_differentiable_on s \<Longrightarrow> continuous_on s f" | 
| 
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: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 101 | "f piecewise_differentiable_on s \<Longrightarrow> t \<le> s \<Longrightarrow> f piecewise_differentiable_on t" | 
| 
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 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 105 | apply (blast intro: 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 | 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: | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 116 | "(\<And>x. x \<in> s \<Longrightarrow> f differentiable (at x within s)) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 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 | |
| 61204 | 121 | lemma piecewise_differentiable_const [iff]: "(\<lambda>x. z) piecewise_differentiable_on s" | 
| 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: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 125 | "\<lbrakk>f piecewise_differentiable_on s; g piecewise_differentiable_on (f ` s); | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 126 |       \<And>x. finite (s \<inter> f-`{x})\<rbrakk>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 127 | \<Longrightarrow> (g o f) piecewise_differentiable_on s" | 
| 
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) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 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 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 137 | assumes "f piecewise_differentiable_on ((\<lambda>x. m *\<^sub>R x + c) ` s)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 138 | shows "(f o (\<lambda>x. m *\<^sub>R x + c)) piecewise_differentiable_on s" | 
| 
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 - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 159 | obtain s t where st: "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 | 160 |                        "\<forall>x\<in>{a..c} - s. f differentiable at x within {a..c}"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 161 |                        "\<forall>x\<in>{c..b} - t. 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) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 164 |   have finabc: "finite ({a,b,c} \<union> (s \<union> t))"
 | 
| 61222 | 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
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 175 |     assume x: "x \<in> {a..b} - ({a,b,c} \<union> (s \<union> t))"
 | 
| 
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 | 
| 63955 | 179 | proof (rule differentiable_transform_within [where d = "dist x c" and f = f]) | 
| 180 |         have "f differentiable at x within ({a<..<c} - s)"
 | |
| 181 | apply (rule differentiable_at_withinI) | |
| 182 | using x le st | |
| 183 | by (metis (no_types, lifting) DiffD1 DiffD2 DiffI UnCI atLeastAtMost_diff_ends atLeastAtMost_iff at_within_interior insert_iff interior_atLeastAtMost le st(3) x) | |
| 184 |         moreover have "open ({a<..<c} - s)"
 | |
| 185 | by (blast intro: open_greaterThanLessThan \<open>finite s\<close> finite_imp_closed) | |
| 186 |         ultimately show "f differentiable at x within {a..b}"
 | |
| 63969 
f4b4fba60b1d
HOL-Analysis: move Library/Convex to Convex_Euclidean_Space
 hoelzl parents: 
63955diff
changeset | 187 | using x le by (auto simp add: at_within_open_NO_MATCH differentiable_at_withinI) | 
| 63955 | 188 | 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 | 189 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 190 | case ge show ?diff_fg | 
| 63955 | 191 | proof (rule differentiable_transform_within [where d = "dist x c" and f = g]) | 
| 192 |         have "g differentiable at x within ({c<..<b} - t)"
 | |
| 193 | apply (rule differentiable_at_withinI) | |
| 194 | using x ge st | |
| 195 | by (metis DiffD1 DiffD2 DiffI UnCI atLeastAtMost_diff_ends atLeastAtMost_iff at_within_interior insert_iff interior_atLeastAtMost) | |
| 196 |         moreover have "open ({c<..<b} - t)"
 | |
| 197 | by (blast intro: open_greaterThanLessThan \<open>finite t\<close> finite_imp_closed) | |
| 198 |         ultimately show "g differentiable at x within {a..b}"
 | |
| 63969 
f4b4fba60b1d
HOL-Analysis: move Library/Convex to Convex_Euclidean_Space
 hoelzl parents: 
63955diff
changeset | 199 | using x ge by (auto simp add: at_within_open_NO_MATCH differentiable_at_withinI) | 
| 63955 | 200 | 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 | 201 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 202 | } | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 203 | then have "\<exists>s. finite s \<and> | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 204 |                  (\<forall>x\<in>{a..b} - s. (\<lambda>x. if x \<le> c then f x else g x) differentiable at x within {a..b})"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 205 | by (meson finabc) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 206 | ultimately show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 207 | by (simp add: piecewise_differentiable_on_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 208 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 209 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 210 | lemma piecewise_differentiable_neg: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 211 | "f piecewise_differentiable_on s \<Longrightarrow> (\<lambda>x. -(f x)) piecewise_differentiable_on s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 212 | 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 | 213 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 214 | lemma piecewise_differentiable_add: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 215 | assumes "f piecewise_differentiable_on i" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 216 | "g piecewise_differentiable_on i" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 217 | 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 | 218 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 219 | obtain s t where st: "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 | 220 | "\<forall>x\<in>i - s. f differentiable at x within i" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 221 | "\<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 | 222 | using assms by (auto simp: piecewise_differentiable_on_def) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 223 | 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 | 224 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 225 | 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 | 226 | using assms piecewise_differentiable_on_def by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 227 | ultimately show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 228 | 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 | 229 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 230 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 231 | lemma piecewise_differentiable_diff: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 232 | "\<lbrakk>f piecewise_differentiable_on s; g piecewise_differentiable_on s\<rbrakk> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 233 | \<Longrightarrow> (\<lambda>x. f x - g x) piecewise_differentiable_on s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 234 | unfolding diff_conv_add_uminus | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 235 | by (metis piecewise_differentiable_add piecewise_differentiable_neg) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 236 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 237 | 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 | 238 |     "continuous_on {0..1} (g1 +++ g2) \<Longrightarrow> 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 | 239 | apply (rule continuous_on_eq [of _ "(g1 +++ g2) o (op*(inverse 2))"]) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 240 | 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 | 241 | 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 | 242 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 243 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 244 | 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 | 245 |     "\<lbrakk>continuous_on {0..1} (g1 +++ g2); pathfinish g1 = pathstart g2\<rbrakk> \<Longrightarrow> 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 | 246 | apply (rule continuous_on_eq [of _ "(g1 +++ g2) o (\<lambda>x. inverse 2*x + 1/2)"]) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 247 | 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 | 248 | 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 | 249 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 250 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 251 | lemma piecewise_differentiable_D1: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 252 |     "(g1 +++ g2) piecewise_differentiable_on {0..1} \<Longrightarrow> g1 piecewise_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 | 253 | apply (clarsimp simp add: piecewise_differentiable_on_def dest!: 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 | 254 | apply (rule_tac x="insert 1 ((op*2)`s)" in exI) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 255 | apply simp | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 256 | apply (intro ballI) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 257 | apply (rule_tac d="dist (x/2) (1/2)" and f = "(g1 +++ g2) o (op*(inverse 2))" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 258 | in differentiable_transform_within) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 259 | apply (auto simp: dist_real_def joinpaths_def) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 260 | apply (rule differentiable_chain_within derivative_intros | simp)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 261 | apply (rule differentiable_subset) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 262 | apply (force simp:)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 263 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 264 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 265 | lemma piecewise_differentiable_D2: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 266 |     "\<lbrakk>(g1 +++ g2) piecewise_differentiable_on {0..1}; pathfinish g1 = pathstart g2\<rbrakk>
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 267 |     \<Longrightarrow> g2 piecewise_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 | 268 | apply (clarsimp simp add: piecewise_differentiable_on_def dest!: 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 | 269 | apply (rule_tac x="insert 0 ((\<lambda>x. 2*x-1)`s)" in exI) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 270 | apply simp | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 271 | apply (intro ballI) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 272 | apply (rule_tac d="dist ((x+1)/2) (1/2)" and f = "(g1 +++ g2) o (\<lambda>x. (x+1)/2)" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 273 | in differentiable_transform_within) | 
| 62390 | 274 | apply (auto simp: dist_real_def joinpaths_def abs_if field_simps split: if_split_asm) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 275 | apply (rule differentiable_chain_within derivative_intros | simp)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 276 | apply (rule differentiable_subset) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 277 | apply (force simp: divide_simps)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 278 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 279 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 280 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 281 | subsubsection\<open>The concept of continuously differentiable\<close> | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 282 | |
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 283 | text \<open> | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 284 | John Harrison writes as follows: | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 285 | |
| 62456 | 286 | ``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 | 287 | 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 | 288 | f, since all piecewise continuous functions are integrable. However, our notion of validity is | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 289 | weaker, just piecewise differentiability... [namely] continuity plus differentiability except on a | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 290 | finite set ... [Our] underlying theory of integration is the Kurzweil-Henstock theory. In contrast to | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 291 | 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 | 292 | can integrate all derivatives.'' | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 293 | |
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 294 | "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 | 295 | 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 | 296 | |
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 297 | 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 | 298 | 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 | 299 | 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 | 300 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 301 | definition C1_differentiable_on :: "(real \<Rightarrow> 'a::real_normed_vector) \<Rightarrow> real set \<Rightarrow> bool" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 302 | (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 | 303 | where | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 304 | "f C1_differentiable_on s \<longleftrightarrow> | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 305 | (\<exists>D. (\<forall>x \<in> s. (f has_vector_derivative (D x)) (at x)) \<and> continuous_on s D)" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 306 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 307 | lemma 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 | 308 | "f C1_differentiable_on s \<longleftrightarrow> | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 309 | (\<forall>x \<in> s. f differentiable at x) \<and> continuous_on s (\<lambda>x. vector_derivative f (at x))" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 310 | 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 | 311 | apply safe | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 312 | using differentiable_def has_vector_derivative_def apply blast | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 313 | apply (erule continuous_on_eq) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 314 | using vector_derivative_at apply fastforce | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 315 | using vector_derivative_works apply fastforce | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 316 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 317 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 318 | lemma 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 | 319 | "f C1_differentiable_on t \<Longrightarrow> s \<subseteq> t \<Longrightarrow> f C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 320 | 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 | 321 | 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 | 322 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 323 | lemma C1_differentiable_compose: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 324 | "\<lbrakk>f C1_differentiable_on s; g C1_differentiable_on (f ` s); | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 325 |       \<And>x. finite (s \<inter> f-`{x})\<rbrakk>
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 326 | \<Longrightarrow> (g o f) C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 327 | apply (simp add: C1_differentiable_on_eq, safe) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 328 | using differentiable_chain_at apply blast | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 329 | apply (rule continuous_on_eq [of _ "\<lambda>x. vector_derivative f (at x) *\<^sub>R vector_derivative g (at (f x))"]) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 330 | apply (rule Limits.continuous_on_scaleR, assumption) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 331 | apply (metis (mono_tags, lifting) continuous_on_eq continuous_at_imp_continuous_on continuous_on_compose differentiable_imp_continuous_within o_def) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 332 | by (simp add: 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 | 333 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 334 | lemma C1_diff_imp_diff: "f C1_differentiable_on s \<Longrightarrow> f differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 335 | 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 | 336 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 337 | lemma C1_differentiable_on_ident [simp, derivative_intros]: "(\<lambda>x. x) C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 338 | 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 | 339 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 340 | lemma C1_differentiable_on_const [simp, derivative_intros]: "(\<lambda>z. a) C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 341 | 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 | 342 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 343 | lemma C1_differentiable_on_add [simp, derivative_intros]: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 344 | "f C1_differentiable_on s \<Longrightarrow> g C1_differentiable_on s \<Longrightarrow> (\<lambda>x. f x + g x) C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 345 | 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 | 346 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 347 | lemma C1_differentiable_on_minus [simp, derivative_intros]: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 348 | "f C1_differentiable_on s \<Longrightarrow> (\<lambda>x. - f x) C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 349 | 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 | 350 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 351 | lemma C1_differentiable_on_diff [simp, derivative_intros]: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 352 | "f C1_differentiable_on s \<Longrightarrow> g C1_differentiable_on s \<Longrightarrow> (\<lambda>x. f x - g x) C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 353 | 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 | 354 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 355 | 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 | 356 | fixes f g :: "real \<Rightarrow> 'a :: real_normed_algebra" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 357 | shows "f C1_differentiable_on s \<Longrightarrow> g C1_differentiable_on s \<Longrightarrow> (\<lambda>x. f x * g x) C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 358 | 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 | 359 | 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 | 360 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 361 | lemma C1_differentiable_on_scaleR [simp, derivative_intros]: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 362 | "f C1_differentiable_on s \<Longrightarrow> g C1_differentiable_on s \<Longrightarrow> (\<lambda>x. f x *\<^sub>R g x) C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 363 | 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 | 364 | 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 | 365 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 366 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 367 | definition piecewise_C1_differentiable_on | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 368 | (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 | 369 | 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 | 370 | continuous_on i f \<and> | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 371 | (\<exists>s. finite s \<and> (f C1_differentiable_on (i - s)))" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 372 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 373 | lemma C1_differentiable_imp_piecewise: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 374 | "f C1_differentiable_on s \<Longrightarrow> f piecewise_C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 375 | 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 | 376 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 377 | 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 | 378 | "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 | 379 | 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 | 380 | C1_differentiable_on_def differentiable_def has_vector_derivative_def | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 381 | intro: has_derivative_at_within) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 382 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 383 | lemma 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 | 384 | "\<lbrakk>f piecewise_C1_differentiable_on s; g piecewise_C1_differentiable_on (f ` s); | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 385 |       \<And>x. finite (s \<inter> f-`{x})\<rbrakk>
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 386 | \<Longrightarrow> (g o f) piecewise_C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 387 | apply (simp add: piecewise_C1_differentiable_on_def, safe) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 388 | apply (blast intro: continuous_on_compose2) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 389 | apply (rename_tac A B) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 390 |   apply (rule_tac x="A \<union> (\<Union>x\<in>B. s \<inter> f-`{x})" in exI)
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 391 | apply (rule conjI, blast) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 392 | apply (rule C1_differentiable_compose) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 393 | apply (blast intro: 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 | 394 | apply (blast intro: 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 | 395 | by (simp add: Diff_Int_distrib2) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 396 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 397 | lemma 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 | 398 | "f piecewise_C1_differentiable_on s \<Longrightarrow> t \<le> s \<Longrightarrow> f piecewise_C1_differentiable_on t" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 399 | 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 | 400 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 401 | lemma C1_differentiable_imp_continuous_on: | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 402 | "f C1_differentiable_on s \<Longrightarrow> continuous_on s f" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 403 | 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 | 404 | 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 | 405 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 406 | 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 | 407 | 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 | 408 | by auto | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 409 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 410 | 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 | 411 | fixes m::real | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 412 | assumes "f piecewise_C1_differentiable_on ((\<lambda>x. m * x + c) ` s)" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 413 | shows "(f o (\<lambda>x. m *\<^sub>R x + c)) piecewise_C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 414 | 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 | 415 | case True | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 416 | then show ?thesis | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 417 | 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 | 418 | next | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 419 | case False | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 420 | show ?thesis | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 421 | apply (rule piecewise_C1_differentiable_compose [OF C1_differentiable_imp_piecewise]) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 422 | apply (rule assms derivative_intros | simp add: False vimage_def)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 423 | using real_vector_affinity_eq [OF False, where c=c, unfolded 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 | 424 | apply simp | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 425 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 426 | qed | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 427 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 428 | 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 | 429 | fixes c::real | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 430 |   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 | 431 |           "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 | 432 | "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 | 433 |   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 | 434 | proof - | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 435 |   obtain s t where st: "f C1_differentiable_on ({a..c} - s)"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 436 |                        "g C1_differentiable_on ({c..b} - t)"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 437 | "finite s" "finite t" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 438 | using assms | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 439 | by (force simp: 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 | 440 |   then have f_diff: "f differentiable_on {a..<c} - s"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 441 |         and g_diff: "g differentiable_on {c<..b} - t"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 442 | 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 | 443 |   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 | 444 | 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 | 445 |   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 | 446 | 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 | 447 | 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 | 448 | 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 | 449 | 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 | 450 |   { fix x
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 451 |     assume x: "x \<in> {a..b} - insert c (s \<union> t)"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 452 | 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 | 453 | 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 | 454 | case le show ?diff_fg | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 455 | 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 | 456 | 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 | 457 | next | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 458 | case ge show ?diff_fg | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 459 | 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 | 460 | 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 | 461 | qed | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 462 | } | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 463 |   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)"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 464 | by auto | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 465 | moreover | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 466 |   { assume fcon: "continuous_on ({a<..<c} - s) (\<lambda>x. vector_derivative f (at x))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 467 |        and gcon: "continuous_on ({c<..<b} - t) (\<lambda>x. vector_derivative g (at x))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 468 |     have "open ({a<..<c} - s)"  "open ({c<..<b} - t)"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 469 | using st by (simp_all add: open_Diff finite_imp_closed) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 470 |     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))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 471 | apply (rule continuous_on_eq [OF fcon]) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 472 | apply (simp add:) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 473 | apply (rule vector_derivative_at [symmetric]) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 474 | apply (rule_tac f=f and d="dist x c" in has_vector_derivative_transform_within) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 475 | apply (simp_all add: dist_norm vector_derivative_works [symmetric]) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 476 | apply (metis (full_types) C1_differentiable_on_eq Diff_iff Groups.add_ac(2) add_mono_thms_linordered_field(5) atLeastAtMost_iff linorder_not_le order_less_irrefl st(1)) | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 477 | apply auto | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 478 | done | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 479 |     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))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 480 | apply (rule continuous_on_eq [OF gcon]) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 481 | apply (simp add:) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 482 | apply (rule vector_derivative_at [symmetric]) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 483 | apply (rule_tac f=g and d="dist x c" in has_vector_derivative_transform_within) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 484 | apply (simp_all add: dist_norm vector_derivative_works [symmetric]) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 485 | apply (metis (full_types) C1_differentiable_on_eq Diff_iff Groups.add_ac(2) add_mono_thms_linordered_field(5) atLeastAtMost_iff less_irrefl not_le st(2)) | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 486 | apply auto | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 487 | done | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 488 |     ultimately have "continuous_on ({a<..<b} - insert c (s \<union> t))
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 489 | (\<lambda>x. vector_derivative (\<lambda>x. if x \<le> c then f x else g x) (at x))" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 490 | apply (rule continuous_on_subset [OF continuous_on_open_Un], auto) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 491 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 492 | } note * = this | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 493 |   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))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 494 | using st | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 495 | by (auto simp: C1_differentiable_on_eq elim!: continuous_on_subset intro: *) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 496 |   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)"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 497 |     apply (rule_tac x="{a,b,c} \<union> s \<union> t" in exI)
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 498 | 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 | 499 | 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 | 500 | 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 | 501 | qed | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 502 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 503 | lemma 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 | 504 | "f piecewise_C1_differentiable_on s \<Longrightarrow> (\<lambda>x. -(f x)) piecewise_C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 505 | 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 | 506 | 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 | 507 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 508 | 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 | 509 | 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 | 510 | "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 | 511 | 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 | 512 | proof - | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 513 | obtain s t where st: "finite s" "finite t" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 514 | "f C1_differentiable_on (i-s)" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 515 | "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 | 516 | using assms by (auto simp: 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 | 517 | then have "finite (s \<union> t) \<and> (\<lambda>x. f x + g x) C1_differentiable_on i - (s \<union> t)" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 518 | 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 | 519 | 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 | 520 | 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 | 521 | ultimately show ?thesis | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 522 | 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 | 523 | qed | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 524 | |
| 61204 | 525 | lemma piecewise_C1_differentiable_diff: | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 526 | "\<lbrakk>f piecewise_C1_differentiable_on s; g piecewise_C1_differentiable_on s\<rbrakk> | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 527 | \<Longrightarrow> (\<lambda>x. f x - g x) piecewise_C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 528 | 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 | 529 | 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 | 530 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 531 | 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 | 532 | 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 | 533 |   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 | 534 |     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 | 535 | proof - | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 536 | obtain s where "finite s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 537 |              and co12: "continuous_on ({0..1} - s) (\<lambda>x. vector_derivative (g1 +++ g2) (at x))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 538 |              and g12D: "\<forall>x\<in>{0..1} - s. g1 +++ g2 differentiable at x"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 539 | using assms by (auto simp: piecewise_C1_differentiable_on_def 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 | 540 |   then have g1D: "g1 differentiable at x" if "x \<in> {0..1} - insert 1 (op * 2 ` s)" for x
 | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 541 | apply (rule_tac d="dist (x/2) (1/2)" and f = "(g1 +++ g2) o (op*(inverse 2))" in differentiable_transform_within) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 542 | using that | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 543 | apply (simp_all add: dist_real_def joinpaths_def) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 544 | apply (rule differentiable_chain_at derivative_intros | force)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 545 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 546 | have [simp]: "vector_derivative (g1 \<circ> op * 2) (at (x/2)) = 2 *\<^sub>R vector_derivative g1 (at x)" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 547 |                if "x \<in> {0..1} - insert 1 (op * 2 ` s)" for x
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 548 | 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 | 549 | using that | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 550 | 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 | 551 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 552 |   have "continuous_on ({0..1/2} - insert (1/2) s) (\<lambda>x. vector_derivative (g1 +++ g2) (at x))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 553 | using co12 by (rule continuous_on_subset) force | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 554 |   then have coDhalf: "continuous_on ({0..1/2} - insert (1/2) s) (\<lambda>x. vector_derivative (g1 o op*2) (at x))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 555 | apply (rule continuous_on_eq [OF _ vector_derivative_at]) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 556 | apply (rule_tac f="g1 o op*2" and d="dist x (1/2)" in has_vector_derivative_transform_within) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 557 | apply (simp_all add: dist_norm joinpaths_def vector_derivative_works [symmetric]) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 558 | apply (force intro: g1D differentiable_chain_at) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 559 | apply auto | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 560 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 561 |   have "continuous_on ({0..1} - insert 1 (op * 2 ` s))
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 562 | ((\<lambda>x. 1/2 * vector_derivative (g1 o op*2) (at x)) o op*(1/2))" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 563 | 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 | 564 | using coDhalf | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 565 | 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 | 566 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 567 |   then have con_g1: "continuous_on ({0..1} - insert 1 (op * 2 ` s)) (\<lambda>x. vector_derivative g1 (at x))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 568 | 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 | 569 |   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 | 570 | using continuous_on_joinpaths_D1 assms piecewise_C1_differentiable_on_def by blast | 
| 61222 | 571 | 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 | 572 | apply (clarsimp simp add: piecewise_C1_differentiable_on_def 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 | 573 | apply (rule_tac x="insert 1 ((op*2)`s)" in exI) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 574 | 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 | 575 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 576 | qed | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 577 | |
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 578 | 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 | 579 | 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 | 580 |   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 | 581 |     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 | 582 | proof - | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 583 | obtain s where "finite s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 584 |              and co12: "continuous_on ({0..1} - s) (\<lambda>x. vector_derivative (g1 +++ g2) (at x))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 585 |              and g12D: "\<forall>x\<in>{0..1} - s. g1 +++ g2 differentiable at x"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 586 | using assms by (auto simp: piecewise_C1_differentiable_on_def 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 | 587 |   then have g2D: "g2 differentiable at x" if "x \<in> {0..1} - insert 0 ((\<lambda>x. 2*x-1) ` s)" for x
 | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 588 | apply (rule_tac d="dist ((x+1)/2) (1/2)" and f = "(g1 +++ g2) o (\<lambda>x. (x+1)/2)" in differentiable_transform_within) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 589 | using that | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 590 | apply (simp_all add: dist_real_def joinpaths_def) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 591 | apply (auto simp: dist_real_def joinpaths_def field_simps) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 592 | apply (rule differentiable_chain_at derivative_intros | force)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 593 | apply (drule_tac x= "(x + 1) / 2" in bspec, force simp: divide_simps) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 594 | apply assumption | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 595 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 596 | have [simp]: "vector_derivative (g2 \<circ> (\<lambda>x. 2*x-1)) (at ((x+1)/2)) = 2 *\<^sub>R vector_derivative g2 (at x)" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 597 |                if "x \<in> {0..1} - insert 0 ((\<lambda>x. 2*x-1) ` s)" for x
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 598 | using that by (auto simp: vector_derivative_chain_at divide_simps g2D) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 599 |   have "continuous_on ({1/2..1} - insert (1/2) s) (\<lambda>x. vector_derivative (g1 +++ g2) (at x))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 600 | using co12 by (rule continuous_on_subset) force | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 601 |   then have coDhalf: "continuous_on ({1/2..1} - insert (1/2) s) (\<lambda>x. vector_derivative (g2 o (\<lambda>x. 2*x-1)) (at x))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 602 | apply (rule continuous_on_eq [OF _ vector_derivative_at]) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 603 | apply (rule_tac f="g2 o (\<lambda>x. 2*x-1)" and d="dist (3/4) ((x+1)/2)" in has_vector_derivative_transform_within) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 604 | apply (auto simp: dist_real_def field_simps joinpaths_def vector_derivative_works [symmetric] | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 605 | intro!: g2D differentiable_chain_at) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 606 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 607 |   have [simp]: "((\<lambda>x. (x + 1) / 2) ` ({0..1} - insert 0 ((\<lambda>x. 2 * x - 1) ` s))) = ({1/2..1} - insert (1/2) s)"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 608 | 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 | 609 | 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 | 610 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 611 |   have "continuous_on ({0..1} - insert 0 ((\<lambda>x. 2*x-1) ` s))
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 612 | ((\<lambda>x. 1/2 * vector_derivative (g2 \<circ> (\<lambda>x. 2*x-1)) (at x)) o (\<lambda>x. (x+1)/2))" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 613 | by (rule continuous_intros | simp add: coDhalf)+ | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 614 |   then have con_g2: "continuous_on ({0..1} - insert 0 ((\<lambda>x. 2*x-1) ` s)) (\<lambda>x. vector_derivative g2 (at x))"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 615 | 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 | 616 |   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 | 617 | using continuous_on_joinpaths_D2 assms piecewise_C1_differentiable_on_def by blast | 
| 61222 | 618 | 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 | 619 | apply (clarsimp simp add: piecewise_C1_differentiable_on_def 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 | 620 | apply (rule_tac x="insert 0 ((\<lambda>x. 2 * x - 1) ` s)" in exI) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 621 | 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 | 622 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 623 | qed | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 624 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 625 | 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 | 626 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 627 | definition 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 | 628 |   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 | 629 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 630 | 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 | 631 | 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 | 632 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 633 | subsubsection\<open>In particular, all results for paths apply\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 634 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 635 | lemma valid_path_imp_path: "valid_path g \<Longrightarrow> path g" | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 636 | 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 | 637 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 638 | 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 | 639 | 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 | 640 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 641 | 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 | 642 | 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 | 643 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 644 | 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 | 645 | 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 | 646 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 647 | 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 | 648 | 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 | 649 | |
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 650 | proposition valid_path_compose: | 
| 62623 
dbc62f86a1a9
rationalisation of theorem names esp about "real Archimedian" etc.
 paulson <lp15@cam.ac.uk> parents: 
62620diff
changeset | 651 | assumes "valid_path g" | 
| 64394 | 652 | 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 | 653 | and con: "continuous_on (path_image g) (deriv f)" | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 654 | shows "valid_path (f o g)" | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 655 | proof - | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 656 |   obtain s where "finite s" and g_diff: "g C1_differentiable_on {0..1} - s"
 | 
| 62837 | 657 | using \<open>valid_path g\<close> unfolding valid_path_def piecewise_C1_differentiable_on_def by auto | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 658 |   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 | 659 | proof (rule differentiable_chain_at) | 
| 62837 | 660 | show "g differentiable at t" using \<open>valid_path g\<close> | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 661 |         by (meson C1_differentiable_on_eq \<open>g C1_differentiable_on {0..1} - s\<close> that)
 | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 662 | next | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 663 | have "g t\<in>path_image g" using that DiffD1 image_eqI path_image_def by metis | 
| 64394 | 664 | then show "f differentiable at (g t)" | 
| 665 | 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 | 666 | qed | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 667 |   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 | 668 | 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 | 669 | rule continuous_intros) | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 670 |       show "continuous_on ({0..1} - s) (\<lambda>x. vector_derivative g (at x))"
 | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 671 | 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 | 672 | next | 
| 62623 
dbc62f86a1a9
rationalisation of theorem names esp about "real Archimedian" etc.
 paulson <lp15@cam.ac.uk> parents: 
62620diff
changeset | 673 |       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 | 674 | using continuous_on_compose[OF _ con[unfolded path_image_def],unfolded comp_def] | 
| 62837 | 675 | \<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 | 676 | by blast | 
| 62623 
dbc62f86a1a9
rationalisation of theorem names esp about "real Archimedian" etc.
 paulson <lp15@cam.ac.uk> parents: 
62620diff
changeset | 677 |       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 | 678 | 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 | 679 | next | 
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 680 | show "vector_derivative g (at t) * deriv f (g t) = vector_derivative (f \<circ> g) (at t)" | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 681 |           when "t \<in> {0..1} - s" for t
 | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 682 | 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 | 683 | 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 | 684 | next | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 685 | have "g t\<in>path_image g" using that DiffD1 image_eqI path_image_def by metis | 
| 64394 | 686 | 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 | 687 | qed | 
| 62408 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 688 | qed | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 689 |   ultimately have "f o g C1_differentiable_on {0..1} - s"
 | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 690 | using C1_differentiable_on_eq by blast | 
| 64394 | 691 | moreover have "path (f \<circ> g)" | 
| 692 | apply (rule path_continuous_image[OF valid_path_imp_path[OF \<open>valid_path g\<close>]]) | |
| 693 | using der | |
| 694 | 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 | 695 | ultimately show ?thesis unfolding valid_path_def piecewise_C1_differentiable_on_def path_def | 
| 62837 | 696 | 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 | 697 | qed | 
| 
86f27b264d3d
Conformal_mappings: a big development in complex analysis (+ some lemmas)
 paulson <lp15@cam.ac.uk> parents: 
62398diff
changeset | 698 | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 699 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 700 | subsection\<open>Contour Integrals along a path\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 701 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 702 | 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 | 703 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 704 | 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 | 705 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 706 | definition has_contour_integral :: "(complex \<Rightarrow> complex) \<Rightarrow> complex \<Rightarrow> (real \<Rightarrow> complex) \<Rightarrow> bool" | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 707 | (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 | 708 | 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 | 709 |            ((\<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 | 710 |             has_integral i) {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 711 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 712 | definition 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 | 713 | (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 | 714 | 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 | 715 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 716 | definition contour_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 | 717 | where "contour_integral g f \<equiv> @i. (f has_contour_integral i) g \<or> ~ f contour_integrable_on g \<and> i=0" | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 718 | |
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 719 | lemma not_integrable_contour_integral: "~ 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 | 720 | 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 | 721 | |
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 722 | 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 | 723 | 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 | 724 | 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 | 725 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 726 | corollary 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 | 727 | "\<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 | 728 | contour_integral p f = contour_integral \<gamma> f\<rbrakk> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 729 | \<Longrightarrow> (f has_contour_integral y) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 730 | using contour_integrable_on_def contour_integral_unique by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 731 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 732 | 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 | 733 | "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 | 734 | 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 | 735 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 736 | 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 | 737 | "(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 | 738 | 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 | 739 | 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 | 740 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 741 | 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 | 742 | using contour_integrable_on_def by blast | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 743 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 744 | (* Show that we can forget about the localized derivative.*) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 745 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 746 | lemma vector_derivative_within_interior: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 747 | "\<lbrakk>x \<in> interior s; NO_MATCH UNIV s\<rbrakk> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 748 | \<Longrightarrow> vector_derivative f (at x within s) = vector_derivative f (at x)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 749 | apply (simp add: vector_derivative_def has_vector_derivative_def has_derivative_def netlimit_within_interior) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 750 | apply (subst lim_within_interior, auto) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 751 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 752 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 753 | lemma has_integral_localized_vector_derivative: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 754 |     "((\<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 | 755 |      ((\<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 | 756 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 757 |   have "{a..b} - {a,b} = interior {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 758 | by (simp add: atLeastAtMost_diff_ends) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 759 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 760 |     apply (rule has_integral_spike_eq [of "{a,b}"])
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 761 | apply (auto simp: vector_derivative_within_interior) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 762 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 763 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 764 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 765 | lemma integrable_on_localized_vector_derivative: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 766 |     "(\<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 | 767 |      (\<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 | 768 | 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 | 769 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 770 | 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 | 771 | "(f has_contour_integral i) g \<longleftrightarrow> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 772 |       ((\<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 | 773 | 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 | 774 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 775 | 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 | 776 | "f contour_integrable_on g \<longleftrightarrow> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 777 |       (\<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 | 778 | 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 | 779 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 780 | subsection\<open>Reversing a path\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 781 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 782 | lemma valid_path_imp_reverse: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 783 | assumes "valid_path g" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 784 | shows "valid_path(reversepath g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 785 | proof - | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 786 |   obtain s where "finite s" "g C1_differentiable_on ({0..1} - s)"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 787 | using assms by (auto simp: 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 | 788 |   then have "finite (op - 1 ` s)" "(reversepath g C1_differentiable_on ({0..1} - op - 1 ` s))"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 789 | apply (auto simp: reversepath_def) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 790 | apply (rule C1_differentiable_compose [of "\<lambda>x::real. 1-x" _ g, unfolded o_def]) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 791 | apply (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 | 792 | apply (rule continuous_intros, force) | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 793 | apply (force 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 | 794 | apply (simp add: finite_vimageI inj_on_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 795 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 796 | then 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 | 797 | 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 | 798 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 799 | |
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 800 | 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 | 801 | using valid_path_imp_reverse by force | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 802 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 803 | lemma has_contour_integral_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 | 804 | assumes "valid_path g" "(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 | 805 | 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 | 806 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 807 |   { fix s x
 | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 808 |     assume xs: "g C1_differentiable_on ({0..1} - s)" "x \<notin> op - 1 ` s" "0 \<le> x" "x \<le> 1"
 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 809 |       have "vector_derivative (\<lambda>x. g (1 - x)) (at x within {0..1}) =
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 810 |             - vector_derivative g (at (1 - x) within {0..1})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 811 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 812 | obtain f' where f': "(g has_vector_derivative f') (at (1 - x))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 813 | using xs | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 814 | by (force simp: has_vector_derivative_def C1_differentiable_on_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 815 | have "(g o (\<lambda>x. 1 - x) has_vector_derivative -1 *\<^sub>R f') (at x)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 816 | apply (rule vector_diff_chain_within) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 817 | apply (intro vector_diff_chain_within derivative_eq_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 818 | apply (rule has_vector_derivative_at_within [OF f']) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 819 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 820 | then have mf': "((\<lambda>x. g (1 - x)) has_vector_derivative -f') (at x)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 821 | by (simp add: o_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 822 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 823 | using xs | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 824 | by (auto simp: vector_derivative_at_within_ivl [OF mf'] vector_derivative_at_within_ivl [OF f']) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 825 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 826 | } note * = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 827 |   have 01: "{0..1::real} = cbox 0 1"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 828 | by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 829 | show ?thesis 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 | 830 | apply (auto simp: has_contour_integral_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 831 | apply (drule has_integral_affinity01 [where m= "-1" and c=1]) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 832 | apply (auto simp: reversepath_def valid_path_def piecewise_C1_differentiable_on_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 833 | apply (drule has_integral_neg) | 
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 834 | apply (rule_tac S = "(\<lambda>x. 1 - x) ` s" in has_integral_spike_finite) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 835 | apply (auto simp: *) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 836 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 837 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 838 | |
| 61738 
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 | 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 | 840 | "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 | 841 | 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 | 842 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 843 | 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 | 844 | "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 | 845 | 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 | 846 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 847 | 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 | 848 | 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 | 849 | 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 | 850 | 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 | 851 | 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 | 852 | 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 | 853 | next | 
| 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 854 | 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 | 855 | 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 | 856 | 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 | 857 | qed | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 858 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 859 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 860 | subsection\<open>Joining two paths together\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 861 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 862 | lemma valid_path_join: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 863 | 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 | 864 | shows "valid_path(g1 +++ g2)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 865 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 866 | have "g1 1 = g2 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 867 | using assms by (auto simp: pathfinish_def pathstart_def) | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 868 |   moreover have "(g1 o (\<lambda>x. 2*x)) piecewise_C1_differentiable_on {0..1/2}"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 869 | apply (rule piecewise_C1_differentiable_compose) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 870 | using assms | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 871 | apply (auto simp: valid_path_def piecewise_C1_differentiable_on_def continuous_on_joinpaths) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 872 | apply (rule continuous_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 873 | apply (force intro: finite_vimageI [where h = "op*2"] inj_onI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 874 | done | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 875 |   moreover have "(g2 o (\<lambda>x. 2*x-1)) piecewise_C1_differentiable_on {1/2..1}"
 | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 876 | 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 | 877 | 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 | 878 | 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 | 879 | 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 | 880 | ultimately show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 881 | 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 | 882 | apply (rule piecewise_C1_differentiable_cases) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 883 | apply (auto simp: o_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 884 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 885 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 886 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 887 | 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 | 888 | 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 | 889 | 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 | 890 | 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 | 891 | by (rule piecewise_C1_differentiable_D1) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 892 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 893 | 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 | 894 | 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 | 895 | 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 | 896 | 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 | 897 | by (rule piecewise_C1_differentiable_D2) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 898 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 899 | 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 | 900 | 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 | 901 | 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 | 902 | 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 | 903 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 904 | 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 | 905 | 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 | 906 | "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 | 907 | 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 | 908 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 909 | obtain s1 s2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 910 |     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 | 911 |       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 | 912 | using assms | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 913 | 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 | 914 |   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 | 915 |    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 | 916 | 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 | 917 | by (auto simp: has_contour_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 918 |   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 | 919 |    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 | 920 | 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 | 921 | 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 | 922 | 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 | 923 | 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 | 924 | 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 | 925 | 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 | 926 | 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 | 927 | 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 | 928 | 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 | 929 | 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 | 930 | using s1 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 931 | apply (auto simp: algebra_simps vector_derivative_works) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 932 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 933 | 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 | 934 | 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 | 935 | 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 | 936 | 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 | 937 | 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 | 938 | 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 | 939 | 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 | 940 | using s2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 941 | apply (auto simp: algebra_simps vector_derivative_works) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 942 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 943 |   have "((\<lambda>x. f ((g1 +++ g2) x) * vector_derivative (g1 +++ g2) (at x)) has_integral i1) {0..1/2}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 944 | apply (rule has_integral_spike_finite [OF _ _ i1, of "insert (1/2) (op*2 -` s1)"]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 945 | using s1 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 946 | apply (force intro: finite_vimageI [where h = "op*2"] inj_onI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 947 | 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 | 948 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 949 |   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 | 950 | 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 | 951 | using s2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 952 | 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 | 953 | 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 | 954 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 955 | ultimately | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 956 | 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 | 957 | apply (simp add: has_contour_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 958 | 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 | 959 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 960 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 961 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 962 | 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 | 963 | 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 | 964 | "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 | 965 | shows "f contour_integrable_on (g1 +++ g2)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 966 | 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 | 967 | 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 | 968 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 969 | 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 | 970 | 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 | 971 | shows "f contour_integrable_on g1" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 972 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 973 | obtain s1 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 974 |     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 | 975 | 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 | 976 |   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 | 977 | 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 | 978 | apply (auto simp: contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 979 | 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 | 980 | 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 | 981 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 982 |   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 | 983 | 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 | 984 | 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 | 985 | 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 | 986 | 2 *\<^sub>R vector_derivative g1 (at z)" for z | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 987 | 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 | 988 | 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 | 989 | 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 | 990 | using s1 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 991 | 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 | 992 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 993 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 994 | 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 | 995 | apply (auto simp: contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 996 |     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 | 997 | 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 | 998 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 999 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1000 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1001 | 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 | 1002 | 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 | 1003 | shows "f contour_integrable_on g2" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1004 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1005 | obtain s2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1006 |     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 | 1007 | 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 | 1008 |   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 | 1009 | 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 | 1010 | apply (auto simp: contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1011 | 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 | 1012 | 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 | 1013 | apply (simp add: image_affinity_atLeastAtMost_diff) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1014 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1015 | 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 | 1016 |                 integrable_on {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1017 | 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 | 1018 | 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 | 1019 | 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 | 1020 | 2 *\<^sub>R vector_derivative g2 (at z)" for z | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1021 | 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 | 1022 | 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 | 1023 | 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 | 1024 | using s2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1025 | 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 | 1026 | vector_derivative_works add_divide_distrib) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1027 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1028 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1029 | 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 | 1030 | apply (auto simp: contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1031 |     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 | 1032 | 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 | 1033 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1034 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1035 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1036 | lemma contour_integrable_join [simp]: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1037 | shows | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1038 | "\<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 | 1039 | \<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 | 1040 | 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 | 1041 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1042 | lemma contour_integral_join [simp]: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1043 | 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 | 1044 | "\<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 | 1045 | \<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 | 1046 | 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 | 1047 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1048 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1049 | subsection\<open>Shifting the starting point of a (closed) path\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1050 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1051 | 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 | 1052 | by (auto simp: shiftpath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1053 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1054 | lemma valid_path_shiftpath [intro]: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1055 |   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 | 1056 | shows "valid_path(shiftpath a g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1057 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1058 | 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 | 1059 | apply (rule piecewise_C1_differentiable_cases) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1060 | 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 | 1061 | 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 | 1062 | 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 | 1063 | 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 | 1064 | 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 | 1065 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1066 | |
| 61738 
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 | 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 | 1068 | 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 | 1069 |       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 | 1070 | 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 | 1071 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1072 | obtain s | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1073 |     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 | 1074 | 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 | 1075 |   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 | 1076 | 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 | 1077 |   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 | 1078 |                     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 | 1079 | apply (rule has_integral_unique) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1080 | apply (subst add.commute) | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 1081 | apply (subst integral_combine) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1082 | using assms * integral_unique by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1083 |   { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1084 | 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 | 1085 | 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 | 1086 | unfolding shiftpath_def | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1087 | 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 | 1088 | 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 | 1089 | 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 | 1090 | apply (intro derivative_eq_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1091 | using g | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1092 | apply (drule_tac x="x+a" in bspec) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1093 | 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 | 1094 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1095 | } note vd1 = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1096 |   { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1097 | 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 | 1098 | 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 | 1099 | unfolding shiftpath_def | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1100 | 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 | 1101 | 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 | 1102 | 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 | 1103 | apply (intro derivative_eq_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1104 | using g | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1105 | 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 | 1106 | 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 | 1107 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1108 | } note vd2 = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1109 |   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 | 1110 | using * a by (fastforce intro: integrable_subinterval_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1111 |   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 | 1112 | apply (rule integrable_subinterval_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1113 | using * a by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1114 | 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 | 1115 |         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 | 1116 | 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 | 1117 |              [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 | 1118 | using s apply blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1119 | using a apply (auto simp: algebra_simps vd1) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1120 | apply (force simp: shiftpath_def add.commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1121 | 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 | 1122 | 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 | 1123 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1124 | moreover | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1125 | 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 | 1126 |         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 | 1127 | 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 | 1128 |              [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 | 1129 | using s apply blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1130 | using a apply (auto simp: algebra_simps vd2) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1131 | apply (force simp: shiftpath_def add.commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1132 | 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 | 1133 | 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 | 1134 | apply (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1135 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1136 | ultimately show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1137 | 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 | 1138 | 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 | 1139 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1140 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1141 | 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 | 1142 | 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 | 1143 |           "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 | 1144 | shows "(f has_contour_integral i) g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1145 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1146 | obtain s | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1147 |     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 | 1148 | 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 | 1149 |   { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1150 | 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 | 1151 | then have gx: "g differentiable at x" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1152 | using g by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1153 |     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 | 1154 |           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 | 1155 | apply (rule vector_derivative_at_within_ivl | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1156 | [OF has_vector_derivative_transform_within_open | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1157 |                       [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 | 1158 | using s g assms x | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1159 | apply (auto simp: finite_imp_closed open_Diff shiftpath_shiftpath | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1160 | vector_derivative_within_interior vector_derivative_works [symmetric]) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 1161 | apply (rule differentiable_transform_within [OF gx, of "min x (1-x)"]) | 
| 62390 | 1162 | 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 | 1163 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1164 | } 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 | 1165 | 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 | 1166 | 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 | 1167 | 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 | 1168 | 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 | 1169 |     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 | 1170 | using s assms vd | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1171 | apply (auto simp: Path_Connected.shiftpath_shiftpath) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1172 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1173 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1174 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1175 | lemma has_contour_integral_shiftpath_eq: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1176 |   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 | 1177 | 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 | 1178 | 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 | 1179 | |
| 62463 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1180 | 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 | 1181 |   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 | 1182 | 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 | 1183 | 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 | 1184 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1185 | lemma contour_integral_shiftpath: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1186 |   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 | 1187 | 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 | 1188 | 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 | 1189 | 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 | 1190 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1191 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1192 | subsection\<open>More about straight-line paths\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1193 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1194 | lemma has_vector_derivative_linepath_within: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1195 | "(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 | 1196 | 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 | 1197 | apply (rule derivative_eq_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1198 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1199 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1200 | lemma vector_derivative_linepath_within: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1201 |     "x \<in> {0..1} \<Longrightarrow> vector_derivative (linepath a b) (at x within {0..1}) = b - a"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1202 | apply (rule vector_derivative_within_closed_interval [of 0 "1::real", simplified]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1203 | apply (auto simp: has_vector_derivative_linepath_within) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1204 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1205 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1206 | 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 | 1207 | 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 | 1208 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1209 | 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 | 1210 | 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 | 1211 |   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 | 1212 | 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 | 1213 | 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 | 1214 | 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 | 1215 | done | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1216 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1217 | 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 | 1218 | 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 | 1219 |          ((\<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 | 1220 | 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 | 1221 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1222 | lemma linepath_in_path: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1223 |   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 | 1224 | by (auto simp: segment linepath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1225 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1226 | 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 | 1227 | by (auto simp: segment linepath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1228 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1229 | lemma linepath_in_convex_hull: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1230 | fixes x::real | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1231 | assumes a: "a \<in> convex hull s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1232 | and b: "b \<in> convex hull s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1233 | and x: "0\<le>x" "x\<le>1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1234 | 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 | 1235 | 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 | 1236 | using x | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1237 | apply (auto simp: linepath_image_01 [symmetric]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1238 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1239 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1240 | 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 | 1241 | by (simp add: linepath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1242 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1243 | 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 | 1244 | by (simp add: linepath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1245 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1246 | 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 | 1247 | 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 | 1248 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1249 | 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 | 1250 | 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 | 1251 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1252 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1253 | subsection\<open>Relation to subpath construction\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1254 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1255 | lemma valid_path_subpath: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1256 | fixes g :: "real \<Rightarrow> 'a :: real_normed_vector" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1257 |   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 | 1258 | shows "valid_path(subpath u v g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1259 | proof (cases "v=u") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1260 | case True | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1261 | 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 | 1262 | 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 | 1263 | 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 | 1264 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1265 | case False | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1266 |   have "(g o (\<lambda>x. ((v-u) * x + u))) 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 | 1267 | 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 | 1268 | apply (simp add: C1_differentiable_imp_piecewise) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1269 | apply (simp add: image_affinity_atLeastAtMost) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1270 | 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 | 1271 | 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 | 1272 | apply (subst Int_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1273 | 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 | 1274 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1275 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1276 | 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 | 1277 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1278 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1279 | 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 | 1280 | 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 | 1281 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1282 | 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 | 1283 | 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 | 1284 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1285 | 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 | 1286 | 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 | 1287 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1288 | 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 | 1289 | 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 | 1290 |       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 | 1291 |     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 | 1292 | (subpath u v g)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1293 | proof (cases "v=u") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1294 | case True | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1295 | 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 | 1296 | 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 | 1297 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1298 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1299 |   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 | 1300 | 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 | 1301 | 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 | 1302 |             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 | 1303 |            {0..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1304 | 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 | 1305 | 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 | 1306 | 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 | 1307 | apply (simp_all add: has_integral_integral) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1308 | 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 | 1309 | 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 | 1310 | apply (simp add: divide_simps False) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1311 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1312 |   { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1313 |     have "x \<in> {0..1} \<Longrightarrow>
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1314 | 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 | 1315 | 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 | 1316 | 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 | 1317 | apply (intro derivative_eq_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1318 | 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 | 1319 | 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 | 1320 | apply (auto simp: vector_derivative_works) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1321 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1322 | } note vd = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1323 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1324 | 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 | 1325 | 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 | 1326 | 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 | 1327 | 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 | 1328 | 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 | 1329 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1330 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1331 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1332 | 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 | 1333 |   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 | 1334 | 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 | 1335 | 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 | 1336 | 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 | 1337 | 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 | 1338 | apply (rule contour_integrable_reversepath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1339 | 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 | 1340 | 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 | 1341 | 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 | 1342 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1343 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1344 | 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 | 1345 |   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 | 1346 | 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 | 1347 |             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 | 1348 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1349 | 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 | 1350 |   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 | 1351 | 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 | 1352 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1353 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1354 | 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 | 1355 |   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 | 1356 | 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 | 1357 |            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 | 1358 | 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 | 1359 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1360 | 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 | 1361 |   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 | 1362 | "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 | 1363 | 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 | 1364 | 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 | 1365 | 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 | 1366 | apply (rule integral_combine, auto) | 
| 66507 
678774070c9b
renamed s to S to work with previous change
 paulson <lp15@cam.ac.uk> parents: 
66294diff
changeset | 1367 |   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 | 1368 | apply (auto simp: contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1369 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1370 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1371 | 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 | 1372 |   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 | 1373 | 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 | 1374 | contour_integral (subpath u w g) f" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1375 | 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 | 1376 | case True | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1377 | 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 | 1378 | 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 | 1379 | 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 | 1380 | by (auto simp: reversepath_subpath) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1381 | have "u < v \<and> v < w \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1382 | u < w \<and> w < v \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1383 | v < u \<and> u < w \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1384 | v < w \<and> w < u \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1385 | w < u \<and> u < v \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1386 | w < v \<and> v < u" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1387 | using True assms by linarith | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1388 | 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 | 1389 | 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 | 1390 | 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 | 1391 | 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 | 1392 | 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 | 1393 | 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 | 1394 | 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 | 1395 | apply simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1396 | 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 | 1397 | 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 | 1398 | valid_path_reversepath valid_path_subpath algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1399 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1400 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1401 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1402 | 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 | 1403 | apply (auto simp: contour_integral_subpath_refl) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1404 | 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 | 1405 | 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 | 1406 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1407 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1408 | 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 | 1409 |      "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 | 1410 | 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 | 1411 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1412 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1413 | 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 | 1414 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1415 | lemma contour_integral_primitive_lemma: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1416 | 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 | 1417 | assumes "a \<le> b" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1418 | 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 | 1419 |       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 | 1420 |     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 | 1421 |              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 | 1422 | proof - | 
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 1423 |   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 | 1424 | 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 | 1425 |   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 | 1426 | 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 | 1427 | 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 | 1428 | 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 | 1429 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1430 |   { fix x::real
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1431 | 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 | 1432 |     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 | 1433 | using k by (simp add: differentiable_at_withinI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1434 |     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 | 1435 | 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 | 1436 |     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 | 1437 | 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 | 1438 |     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 | 1439 | using assms by (metis a atLeastAtMost_iff b DERIV_subset image_subset_iff less_eq_real_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1440 |     then have fdiff: "(f has_derivative op * (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 | 1441 | by (simp add: has_field_derivative_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1442 |     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 | 1443 | using diff_chain_within [OF gdiff fdiff] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1444 | 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 | 1445 | } note * = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1446 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1447 | apply (rule fundamental_theorem_of_calculus_interior_strong) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1448 | using k assms cfg * | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1449 | apply (auto simp: at_within_closed_interval) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1450 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1451 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1452 | |
| 61738 
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 | lemma contour_integral_primitive: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1454 | 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 | 1455 | 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 | 1456 | 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 | 1457 | 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 | 1458 | 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 | 1459 | 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 | 1460 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1461 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1462 | corollary Cauchy_theorem_primitive: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1463 | 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 | 1464 | 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 | 1465 | shows "(f' has_contour_integral 0) g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1466 | 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 | 1467 | by (metis diff_self contour_integral_primitive) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1468 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1469 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1470 | 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 | 1471 | lemma contour_integrable_continuous_linepath: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1472 | 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 | 1473 | 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 | 1474 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1475 |   have "continuous_on {0..1} ((\<lambda>x. f x * (b - a)) o linepath a b)"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1476 | 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 | 1477 | apply (rule continuous_intros | simp add: assms)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1478 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1479 | 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 | 1480 | 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 | 1481 | 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 | 1482 | 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 | 1483 | apply (auto simp: vector_derivative_linepath_within) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1484 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1485 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1486 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1487 | 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 | 1488 | by (rule has_derivative_imp_has_field_derivative) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1489 | (rule derivative_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1490 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1491 | 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 | 1492 | 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 | 1493 | 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 | 1494 | 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 | 1495 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1496 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1497 | 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 | 1498 | 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 | 1499 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1500 | 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 | 1501 | 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 | 1502 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1503 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1504 | subsection\<open>Arithmetical combining theorems\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1505 | |
| 61738 
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 | 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 | 1507 | "(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 | 1508 | 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 | 1509 | |
| 
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 | 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 | 1511 | "\<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 | 1512 | \<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 | 1513 | 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 | 1514 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1515 | 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 | 1516 | "\<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 | 1517 | \<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 | 1518 | 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 | 1519 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1520 | 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 | 1521 | "(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 | 1522 | apply (simp add: has_contour_integral_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1523 | apply (drule has_integral_mult_right) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1524 | apply (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1525 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1526 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1527 | 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 | 1528 | "(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 | 1529 | apply (drule has_contour_integral_lmul) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1530 | apply (simp add: mult.commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1531 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1532 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1533 | 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 | 1534 | "(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 | 1535 | 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 | 1536 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1537 | 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 | 1538 | "\<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 | 1539 | 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 | 1540 | 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 | 1541 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1542 | 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 | 1543 | 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 | 1544 | "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 | 1545 | shows "norm i \<le> B * norm(b - a)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1546 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1547 |   { fix x::real
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1548 | assume x: "0 \<le> x" "x \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1549 | have "norm (f (linepath a b x)) * | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1550 |         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 | 1551 | 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 | 1552 | } note * = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1553 | 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 | 1554 | apply (rule has_integral_bound | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1555 |        [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 | 1556 | using assms * unfolding has_contour_integral_def | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1557 | apply (auto simp: norm_mult) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1558 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1559 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1560 | by (auto simp: content_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1561 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1562 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1563 | (*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 | 1564 | lemma has_contour_integral_bound_linepath_strong: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1565 | 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 | 1566 | 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 | 1567 | "finite k" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1568 | "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 | 1569 | shows "norm i \<le> B*norm(b - a)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1570 | *) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1571 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1572 | 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 | 1573 | unfolding has_contour_integral_linepath | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1574 | 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 | 1575 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1576 | 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 | 1577 | 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 | 1578 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1579 | 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 | 1580 | "(\<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 | 1581 | 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 | 1582 | |
| 64267 | 1583 | 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 | 1584 | "\<lbrakk>finite s; \<And>a. a \<in> s \<Longrightarrow> (f a has_contour_integral i a) p\<rbrakk> | 
| 64267 | 1585 | \<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 | 1586 | 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 | 1587 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1588 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1589 | subsection \<open>Operations on path integrals\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1590 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1591 | 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 | 1592 | 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 | 1593 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1594 | 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 | 1595 | "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 | 1596 | 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 | 1597 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1598 | 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 | 1599 | "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 | 1600 | 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 | 1601 | 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 | 1602 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1603 | 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 | 1604 | "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 | 1605 | 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 | 1606 | 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 | 1607 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1608 | 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 | 1609 | 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 | 1610 | \<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 | 1611 | 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 | 1612 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1613 | 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 | 1614 | 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 | 1615 | \<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 | 1616 | 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 | 1617 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1618 | 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 | 1619 | 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 | 1620 | \<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 | 1621 | 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 | 1622 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1623 | 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 | 1624 | "(\<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 | 1625 | 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 | 1626 | 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 | 1627 | 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 | 1628 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1629 | 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 | 1630 | "(\<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 | 1631 | 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 | 1632 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1633 | lemma contour_integral_bound_linepath: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1634 | 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 | 1635 | "\<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 | 1636 | 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 | 1637 | \<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 | 1638 | 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 | 1639 | apply (auto simp: has_contour_integral_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1640 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1641 | |
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 1642 | 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 | 1643 | 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 | 1644 | |
| 64267 | 1645 | 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 | 1646 | "\<lbrakk>finite s; \<And>a. a \<in> s \<Longrightarrow> (f a) contour_integrable_on p\<rbrakk> | 
| 64267 | 1647 | \<Longrightarrow> contour_integral p (\<lambda>x. sum (\<lambda>a. f a x) s) = sum (\<lambda>a. contour_integral p (f a)) s" | 
| 1648 | 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 | 1649 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1650 | 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 | 1651 | "\<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 | 1652 | 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 | 1653 | by (metis has_contour_integral_eq) | 
| 60809 
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 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1656 | subsection \<open>Arithmetic theorems for path integrability\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1657 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1658 | 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 | 1659 | "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 | 1660 | 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 | 1661 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1662 | 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 | 1663 | "\<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 | 1664 | 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 | 1665 | by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1666 | |
| 61738 
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 | 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 | 1668 | "\<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 | 1669 | 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 | 1670 | by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1671 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1672 | 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 | 1673 | "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 | 1674 | 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 | 1675 | by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1676 | |
| 61738 
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 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 | 1678 | "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 | 1679 | 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 | 1680 | by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1681 | |
| 61738 
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 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 | 1683 | "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 | 1684 | 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 | 1685 | by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1686 | |
| 64267 | 1687 | 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 | 1688 | "\<lbrakk>finite s; \<And>a. a \<in> s \<Longrightarrow> (f a) contour_integrable_on p\<rbrakk> | 
| 64267 | 1689 | \<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 | 1690 | unfolding contour_integrable_on_def | 
| 64267 | 1691 | by (metis has_contour_integral_sum) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1692 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1693 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1694 | subsection\<open>Reversing a path integral\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1695 | |
| 61738 
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 | 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 | 1697 | "(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 | 1698 | \<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 | 1699 | 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 | 1700 | |
| 
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 | lemma contour_integral_reverse_linepath: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1702 | "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 | 1703 | \<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 | 1704 | 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 | 1705 | 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 | 1706 | 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 | 1707 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1708 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1709 | (* Splitting a path integral in a flat way.*) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1710 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1711 | 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 | 1712 | 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 | 1713 | and k: "0 \<le> k" "k \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1714 | 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 | 1715 | 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 | 1716 | proof (cases "k = 0 \<or> k = 1") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1717 | case True | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1718 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1719 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1720 | apply 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 | 1721 | apply (metis add.left_neutral has_contour_integral_trivial 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 | 1722 | apply (metis add.right_neutral has_contour_integral_trivial has_contour_integral_unique) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1723 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1724 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1725 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1726 | 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 | 1727 | using assms by auto | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1728 | 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 | 1729 | by (metis diff_add_cancel c) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1730 | 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 | 1731 | by (simp add: algebra_simps c') | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1732 |   { 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 | 1733 | have **: "\<And>x. ((k - x) / k) *\<^sub>R a + (x / k) *\<^sub>R c = (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 | 1734 | using False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1735 | apply (simp add: c' algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1736 | 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 | 1737 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1738 |     have "((\<lambda>x. f ((1 - x) *\<^sub>R a + x *\<^sub>R b) * (b - a)) has_integral i) {0..k}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1739 | using * k | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1740 | apply - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1741 | apply (drule has_integral_affinity [of _ _ 0 "1::real" "inverse k" "0", simplified]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1742 | apply (simp_all add: divide_simps mult.commute [of _ "k"] image_affinity_atLeastAtMost ** c) | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 1743 | apply (drule has_integral_cmul [where c = "inverse k"]) | 
| 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 1744 | apply (simp add: has_integral_cmul) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1745 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1746 | } note fi = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1747 |   { 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 | 1748 | 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 | 1749 | using k | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1750 | apply (simp add: c' field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1751 | 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 | 1752 | apply (simp add: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1753 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1754 |     have "((\<lambda>x. f ((1 - x) *\<^sub>R a + x *\<^sub>R b) * (b - a)) has_integral j) {k..1}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1755 | using * k | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1756 | apply - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1757 | apply (drule has_integral_affinity [of _ _ 0 "1::real" "inverse(1 - k)" "-(k/(1 - k))", simplified]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1758 | apply (simp_all add: divide_simps mult.commute [of _ "1-k"] image_affinity_atLeastAtMost ** bc) | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 1759 | apply (drule has_integral_cmul [where k = "(1 - k) *\<^sub>R j" and c = "inverse (1 - k)"]) | 
| 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 1760 | apply (simp add: has_integral_cmul) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1761 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1762 | } note fj = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1763 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1764 | 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 | 1765 | apply (simp add: has_contour_integral_linepath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1766 | apply (simp add: linepath_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1767 | 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 | 1768 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1769 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1770 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1771 | lemma continuous_on_closed_segment_transform: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1772 | 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 | 1773 | and k: "0 \<le> k" "k \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1774 | 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 | 1775 | shows "continuous_on (closed_segment a c) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1776 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1777 | 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 | 1778 | using c by (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1779 | show "continuous_on (closed_segment a c) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1780 | apply (rule continuous_on_subset [OF f]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1781 | apply (simp add: segment_convex_hull) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1782 | apply (rule convex_hull_subset) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1783 | using assms | 
| 63969 
f4b4fba60b1d
HOL-Analysis: move Library/Convex to Convex_Euclidean_Space
 hoelzl parents: 
63955diff
changeset | 1784 | apply (auto simp: hull_inc c' convexD_alt) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1785 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1786 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1787 | |
| 61738 
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 | lemma contour_integral_split: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1789 | 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 | 1790 | and k: "0 \<le> k" "k \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1791 | 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 | 1792 | 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 | 1793 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1794 | 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 | 1795 | using c by (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1796 | have *: "continuous_on (closed_segment a c) f" "continuous_on (closed_segment c b) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1797 | apply (rule_tac [!] continuous_on_subset [OF f]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1798 | apply (simp_all add: segment_convex_hull) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1799 | apply (rule_tac [!] convex_hull_subset) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1800 | using assms | 
| 63969 
f4b4fba60b1d
HOL-Analysis: move Library/Convex to Convex_Euclidean_Space
 hoelzl parents: 
63955diff
changeset | 1801 | apply (auto simp: hull_inc c' convexD_alt) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1802 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1803 | 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 | 1804 | 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 | 1805 | apply (rule has_contour_integral_split [OF has_contour_integral_integral has_contour_integral_integral k 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 | 1806 | apply (rule contour_integrable_continuous_linepath *)+ | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1807 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1808 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1809 | |
| 61738 
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 | lemma contour_integral_split_linepath: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1811 | 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 | 1812 | 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 | 1813 | 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 | 1814 | using 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 | 1815 | 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 | 1816 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1817 | (* The special case of midpoints used in the main quadrisection.*) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1818 | |
| 61738 
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 | 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 | 1820 | 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 | 1821 | "(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 | 1822 | 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 | 1823 | 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 | 1824 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1825 | 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 | 1826 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1827 | |
| 61738 
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_integral_midpoint: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1829 | "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 | 1830 | \<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 | 1831 | 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 | 1832 | 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 | 1833 | 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 | 1834 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1835 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1836 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1837 | 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 | 1838 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1839 | 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 | 1840 | "((\<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 | 1841 | 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 | 1842 | apply (auto intro!: derivative_eq_intros) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1843 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1844 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1845 | 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 | 1846 | "(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 | 1847 | \<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 | 1848 | 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 | 1849 | apply (drule has_contour_integral_integrable) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1850 | apply (simp add: valid_path_join) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1851 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1852 | |
| 62397 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 1853 | 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 | 1854 | "(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 | 1855 | \<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 | 1856 | 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 | 1857 | 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 | 1858 | 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 | 1859 | done | 
| 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 1860 | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1861 | 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 | 1862 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1863 | 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 | 1864 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1865 | 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 | 1866 | by (auto simp: cbox_Pair_eq) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1867 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1868 | 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 | 1869 | by (auto simp: cbox_Pair_eq) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1870 | |
| 61738 
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 | lemma contour_integral_swap: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1872 | 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 | 1873 | and vp: "valid_path g" "valid_path h" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1874 |       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 | 1875 |       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 | 1876 | 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 | 1877 | 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 | 1878 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1879 |   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 | 1880 | using assms by (auto simp: valid_path_def piecewise_C1_differentiable_on_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1881 | have fgh1: "\<And>x. (\<lambda>t. f (g x) (h t)) = (\<lambda>(y1,y2). f y1 y2) o (\<lambda>t. (g x, h t))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1882 | by (rule ext) simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1883 | have fgh2: "\<And>x. (\<lambda>t. f (g t) (h x)) = (\<lambda>(y1,y2). f y1 y2) o (\<lambda>t. (g t, h x))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1884 | by (rule ext) simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1885 |   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 | 1886 | 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 | 1887 |   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 | 1888 | 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 | 1889 |   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}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1890 | apply (rule integrable_continuous_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1891 | apply (rule continuous_on_mult [OF _ gvcon]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1892 | apply (subst fgh2) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1893 | apply (rule fcon_im2 gcon continuous_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1894 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1895 | have "(\<lambda>z. vector_derivative g (at (fst z))) = (\<lambda>x. vector_derivative g (at x)) o fst" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1896 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1897 | 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 | 1898 | apply (rule ssubst) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1899 | apply (rule continuous_intros | simp add: gvcon)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1900 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1901 | have "(\<lambda>z. vector_derivative h (at (snd z))) = (\<lambda>x. vector_derivative h (at x)) o snd" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1902 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1903 | 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 | 1904 | apply (rule ssubst) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1905 | apply (rule continuous_intros | simp add: hvcon)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1906 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1907 | have "(\<lambda>x. f (g (fst x)) (h (snd x))) = (\<lambda>(y1,y2). f y1 y2) o (\<lambda>w. ((g o fst) w, (h o snd) w))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1908 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1909 | 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 | 1910 | apply (rule ssubst) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1911 | apply (rule gcon hcon continuous_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1912 | 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 | 1913 | 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 | 1914 |   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 | 1915 |         integral {0..1} (\<lambda>x. contour_integral h (\<lambda>y. f (g x) y * 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 | 1916 | apply (rule integral_cong [OF contour_integral_rmul [symmetric]]) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 1917 | apply (clarsimp simp: contour_integrable_on) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1918 | apply (rule integrable_continuous_real) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1919 | apply (rule continuous_on_mult [OF _ hvcon]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1920 | apply (subst fgh1) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1921 | apply (rule fcon_im1 hcon continuous_intros | simp)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1922 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1923 |   also have "... = 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 | 1924 | (\<lambda>y. contour_integral g (\<lambda>x. f x (h y) * vector_derivative h (at y)))" | 
| 62463 
547c5c6e66d4
the integral is 0 when otherwise it would be undefined (also for contour integrals)
 paulson <lp15@cam.ac.uk> parents: 
62408diff
changeset | 1925 | apply (simp only: contour_integral_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1926 | 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 | 1927 | 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 | 1928 | 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 | 1929 | apply (simp only: mult_ac) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1930 | 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 | 1931 | also have "... = contour_integral h (\<lambda>z. contour_integral g (\<lambda>w. f w 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 | 1932 | apply (simp add: contour_integral_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1933 | 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 | 1934 | unfolding integral_mult_left [symmetric] | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1935 | apply (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1936 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1937 | 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 | 1938 | by (simp add: contour_integral_integral) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1939 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1940 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1941 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1942 | subsection\<open>The key quadrisection step\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1943 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1944 | lemma norm_sum_half: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1945 | assumes "norm(a + b) >= e" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1946 | shows "norm a >= e/2 \<or> norm b >= e/2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1947 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1948 | have "e \<le> norm (- a - b)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1949 | 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 | 1950 | thus ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1951 | using norm_triangle_ineq4 order_trans by fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1952 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1953 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1954 | lemma norm_sum_lemma: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1955 | assumes "e \<le> norm (a + b + c + d)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1956 | 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 | 1957 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1958 | 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 | 1959 | by (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1960 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1961 | by (auto dest!: norm_sum_half) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1962 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1963 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1964 | lemma Cauchy_theorem_quadrisection: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1965 |   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 | 1966 | 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 | 1967 | 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 | 1968 | 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 | 1969 | shows "\<exists>a' b' c'. | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1970 |            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 | 1971 | 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 | 1972 | e * (K/2)^2 \<le> 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 | 1973 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1974 | note divide_le_eq_numeral1 [simp del] | 
| 63040 | 1975 | define a' where "a' = midpoint b c" | 
| 1976 | define b' where "b' = midpoint c a" | |
| 1977 | define c' where "c' = midpoint a b" | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1978 | 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 | 1979 | 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 | 1980 | 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 | 1981 | "continuous_on (closed_segment a' c') f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1982 | "continuous_on (closed_segment b' a') f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1983 | unfolding a'_def b'_def c'_def | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1984 | apply (rule continuous_on_subset [OF f], | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1985 | metis midpoints_in_convex_hull convex_hull_subset hull_subset insert_subset segment_convex_hull)+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1986 | 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 | 1987 | 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 | 1988 | 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 | 1989 | (?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 | 1990 | (?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 | 1991 | (?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 | 1992 | (?pathint a' b' + ?pathint b' c' + ?pathint c' 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 | 1993 | apply (simp add: fcont' 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 | 1994 | apply (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 | 1995 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 1996 | 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 | 1997 | 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 | 1998 | 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 | 1999 | by (simp add: norm_minus_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2000 | 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 | 2001 | "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 | 2002 | "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 | 2003 | "e * K\<^sup>2 / 4 \<le> cmod (?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 | 2004 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2005 | apply (simp only: *) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2006 | apply (blast intro: that dest!: norm_sum_lemma) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2007 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2008 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2009 | proof cases | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2010 | case 1 then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2011 | apply (rule_tac x=a in exI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2012 | apply (rule exI [where x=c']) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2013 | apply (rule exI [where x=b']) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2014 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2015 | apply (auto simp: a'_def c'_def b'_def midpoints_in_convex_hull hull_subset [THEN subsetD]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2016 | 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 | 2017 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2018 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2019 | case 2 then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2020 | apply (rule_tac x=a' in exI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2021 | apply (rule exI [where x=c']) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2022 | apply (rule exI [where x=b]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2023 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2024 | apply (auto simp: a'_def c'_def b'_def midpoints_in_convex_hull hull_subset [THEN subsetD]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2025 | 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 | 2026 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2027 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2028 | case 3 then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2029 | apply (rule_tac x=a' in exI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2030 | apply (rule exI [where x=c]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2031 | apply (rule exI [where x=b']) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2032 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2033 | apply (auto simp: a'_def c'_def b'_def midpoints_in_convex_hull hull_subset [THEN subsetD]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2034 | 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 | 2035 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2036 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2037 | case 4 then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2038 | apply (rule_tac x=a' in exI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2039 | apply (rule exI [where x=b']) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2040 | apply (rule exI [where x=c']) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2041 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2042 | apply (auto simp: a'_def c'_def b'_def midpoints_in_convex_hull hull_subset [THEN subsetD]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2043 | 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 | 2044 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2045 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2046 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2047 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2048 | subsection\<open>Cauchy's theorem for triangles\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2049 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2050 | lemma triangle_points_closer: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2051 | fixes a::complex | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2052 |   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 | 2053 | \<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 | 2054 | norm(x - y) \<le> norm(b - c) \<or> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2055 | norm(x - y) \<le> norm(c - a)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2056 |   using simplex_extremal_le [of "{a,b,c}"]
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2057 | by (auto simp: norm_minus_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2058 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2059 | lemma holomorphic_point_small_triangle: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2060 | assumes x: "x \<in> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2061 | and f: "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 | 2062 | 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 | 2063 | and e: "0 < e" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2064 | 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> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2065 |               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 | 2066 | \<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 | 2067 | contour_integral(linepath c a) f) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2068 | \<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 | 2069 | (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 | 2070 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2071 | 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 | 2072 | \<Longrightarrow> a \<le> e*(x + y + z)^2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2073 | by (simp add: algebra_simps power2_eq_square) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2074 | 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 | 2075 | for x::real and a b c | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2076 | 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 | 2077 | have fabc: "f contour_integrable_on linepath a b" "f contour_integrable_on linepath b c" "f contour_integrable_on linepath c a" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2078 |               if "convex hull {a, b, c} \<subseteq> s" for a b c
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2079 | 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 | 2080 | 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 | 2081 | 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 | 2082 |   { fix f' a b c d
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2083 | assume d: "0 < d" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2084 | 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)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2085 | 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 | 2086 |        and xc: "x \<in> convex hull {a, b, c}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2087 |        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 | 2088 | 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 | 2089 | 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 | 2090 | 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 | 2091 | contour_integral (linepath c a) (\<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 | 2092 | 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 | 2093 | apply (simp add: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2094 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2095 |     { fix y
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2096 |       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 | 2097 | have "cmod (f y - f x - f' * (y - x)) \<le> e*norm(y - x)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2098 | apply (rule f') | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2099 | apply (metis triangle_points_closer [OF xc yc] le norm_minus_commute order_trans) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2100 | using s yc by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2101 | also have "... \<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 | 2102 | 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 | 2103 | 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 | 2104 | } note cm_le = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2105 | have "?normle a b c" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2106 | apply (simp add: dist_norm pa) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2107 | apply (rule le_of_3) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2108 | using f' xc s e | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2109 | apply simp_all | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2110 | 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 | 2111 | 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 | 2112 | 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 | 2113 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2114 | } note * = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2115 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2116 | 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 | 2117 | 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 | 2118 | apply (clarify dest!: spec mp) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2119 | using * | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2120 | apply (simp add: dist_norm, blast) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2121 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2122 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2123 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2124 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2125 | (* Hence the most basic theorem for a triangle.*) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2126 | locale Chain = | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2127 | fixes x0 At Follows | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2128 | assumes At0: "At x0 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2129 | 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 | 2130 | begin | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2131 | primrec f where | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2132 | "f 0 = x0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2133 | | "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 | 2134 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2135 | lemma At: "At (f n) n" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2136 | proof (induct n) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2137 | case 0 show ?case | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2138 | by (simp add: At0) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2139 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2140 | case (Suc n) show ?case | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2141 | 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 | 2142 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2143 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2144 | lemma Follows: "Follows (f(Suc n)) (f n)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2145 | 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 | 2146 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2147 | declare f.simps(2) [simp del] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2148 | end | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2149 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2150 | lemma Chain3: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2151 | assumes At0: "At x0 y0 z0 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2152 | 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 | 2153 | obtains f g h where | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2154 | "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 | 2155 | "\<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 | 2156 | "\<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 | 2157 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2158 | 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 | 2159 | apply unfold_locales | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2160 | using At0 AtSuc by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2161 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2162 | apply (rule that [of "\<lambda>n. fst (three.f n)" "\<lambda>n. fst (snd (three.f n))" "\<lambda>n. snd (snd (three.f n))"]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2163 | apply simp_all | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2164 | using three.At three.Follows | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2165 | apply (simp_all add: split_beta') | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2166 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2167 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2168 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2169 | lemma Cauchy_theorem_triangle: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2170 |   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 | 2171 | 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 | 2172 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2173 |   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 | 2174 | 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 | 2175 | 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 | 2176 |   { 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 | 2177 | 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 | 2178 | and ynz: "y \<noteq> 0" | 
| 63040 | 2179 | define K where "K = 1 + max (dist a b) (max (dist b c) (dist c a))" | 
| 2180 | 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 | 2181 | 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 | 2182 | then have K: "K > 0" by linarith | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2183 | 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 | 2184 | by (simp_all add: K_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2185 | have e: "e > 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2186 | unfolding e_def using ynz K1 by simp | 
| 63040 | 2187 | define At where "At x y z n \<longleftrightarrow> | 
| 2188 |         convex hull {x,y,z} \<subseteq> convex hull {a,b,c} \<and>
 | |
| 2189 | dist x y \<le> K/2^n \<and> dist y z \<le> K/2^n \<and> dist z x \<le> K/2^n \<and> | |
| 2190 | norm(?pathint x y + ?pathint y z + ?pathint z x) \<ge> e*(K/2^n)^2" | |
| 2191 | for x y z n | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2192 | have At0: "At a b c 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2193 | using fy | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2194 | 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 | 2195 |     { fix x y z n
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2196 | assume At: "At x y z n" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2197 |       then have contf': "continuous_on (convex hull {x,y,z}) f"
 | 
| 63938 | 2198 | 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 | 2199 |       have "\<exists>x' y' z'. At x' y' z' (Suc n) \<and> convex hull {x',y',z'} \<subseteq> convex hull {x,y,z}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2200 | using At | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2201 | apply (simp add: At_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2202 | using Cauchy_theorem_quadrisection [OF contf', of "K/2^n" e] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2203 | apply clarsimp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2204 | apply (rule_tac x="a'" in exI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2205 | apply (rule_tac x="b'" in exI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2206 | apply (rule_tac x="c'" in exI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2207 | apply (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2208 | 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 | 2209 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2210 | } note AtSuc = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2211 | obtain fa fb fc | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2212 | 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 | 2213 |         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 | 2214 | 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 | 2215 | "\<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 | 2216 | "\<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 | 2217 | 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 | 2218 | ?pathint (fb n) (fc n) + | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2219 | ?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 | 2220 |         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 | 2221 | apply (rule Chain3 [of At, OF At0 AtSuc]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2222 | apply (auto simp: At_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2223 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2224 |     have "\<exists>x. \<forall>n. x \<in> convex hull {fa n, fb n, fc n}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2225 | apply (rule bounded_closed_nest) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2226 | apply (simp_all add: compact_imp_closed finite_imp_compact_convex_hull finite_imp_bounded_convex_hull) | 
| 66193 | 2227 | apply (intro allI impI) | 
| 2228 | apply (erule transitive_stepwise_le) | |
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2229 | apply (auto simp: conv_le) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2230 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2231 |     then obtain x where x: "\<And>n. x \<in> convex hull {fa n, fb n, fc n}" by auto
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2232 |     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 | 2233 | 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 | 2234 |     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 | 2235 | using assms holomorphic_on_def by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2236 |     { fix k n
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2237 | assume k: "0 < k" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2238 | and le: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2239 | "\<And>x' y' z'. | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2240 | \<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 | 2241 |                 x \<in> convex hull {x',y',z'};
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2242 |                 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 | 2243 | \<Longrightarrow> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2244 | 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 | 2245 | \<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 | 2246 | and Kk: "K / k < 2 ^ n" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2247 | have "K / 2 ^ n < k" using Kk k | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2248 | by (auto simp: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2249 | 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 | 2250 | using dist [of n] k | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2251 | by linarith+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2252 | 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 | 2253 | \<le> (3 * K / 2 ^ n)\<^sup>2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2254 | using dist [of n] e K | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2255 | by (simp add: abs_le_square_iff [symmetric]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2256 | 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 | 2257 | by linarith | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2258 | 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 | 2259 | using ynz dle e mult_le_cancel_left_pos by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2260 | also have "... < | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2261 | 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 | 2262 | using no [of n] e K | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2263 | apply (simp add: e_def field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2264 | apply (simp only: zero_less_norm_iff [symmetric]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2265 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2266 | finally have False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2267 | using le [OF DD x cosb] by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2268 | } then | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2269 | have ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2270 | 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 | 2271 | apply clarsimp | 
| 62623 
dbc62f86a1a9
rationalisation of theorem names esp about "real Archimedian" etc.
 paulson <lp15@cam.ac.uk> parents: 
62620diff
changeset | 2272 | apply (rule_tac y1="K/k" in exE [OF real_arch_pow[of 2]]) | 
| 
dbc62f86a1a9
rationalisation of theorem names esp about "real Archimedian" etc.
 paulson <lp15@cam.ac.uk> parents: 
62620diff
changeset | 2273 | apply force+ | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2274 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2275 | } | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2276 | 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 | 2277 | 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 | 2278 | 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 | 2279 | 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 | 2280 | using has_contour_integral_integral by fastforce | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2281 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2282 | |
| 
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 | subsection\<open>Version needing function holomorphic in interior only\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2285 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2286 | lemma Cauchy_theorem_flat_lemma: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2287 |   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 | 2288 | 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 | 2289 | 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 | 2290 | 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 | 2291 | contour_integral (linepath c a) f = 0" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2292 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2293 | 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 | 2294 | 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 | 2295 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2296 | proof (cases "k \<le> 1") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2297 | 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 | 2298 | 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 | 2299 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2300 | case False then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2301 | 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 | 2302 | 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 | 2303 | 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 | 2304 | 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 | 2305 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2306 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2307 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2308 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2309 | lemma Cauchy_theorem_flat: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2310 |   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 | 2311 | 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 | 2312 | 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 | 2313 | 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 | 2314 | contour_integral (linepath c a) f = 0" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2315 | proof (cases "0 \<le> k") | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2316 | case True with assms show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2317 | by (blast intro: Cauchy_theorem_flat_lemma) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2318 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2319 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2320 | 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 | 2321 | 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 | 2322 | 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 | 2323 | contour_integral (linepath c b) f = 0" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2324 | 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 | 2325 | using False c | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2326 | 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 | 2327 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2328 | 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 | 2329 | apply (auto simp: contour_integral_reverse_linepath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2330 | using add_eq_0_iff by force | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2331 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2332 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2333 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2334 | lemma Cauchy_theorem_triangle_interior: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2335 |   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 | 2336 |       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 | 2337 | 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 | 2338 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2339 | 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 | 2340 | 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 | 2341 |   have "bounded (f ` (convex hull {a,b,c}))"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2342 | 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 | 2343 |   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 | 2344 | by (auto simp: dest!: bounded_pos [THEN iffD1]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2345 |   have "bounded (convex hull {a,b,c})"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2346 | by (simp add: bounded_convex_hull) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2347 |   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 | 2348 | using bounded_pos_less by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2349 | 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 | 2350 |            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 | 2351 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2352 | have "cmod x \<le> C" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2353 | 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 | 2354 | hence "cmod (x - y) \<le> C + C" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2355 | 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 | 2356 | thus "cmod (x - y) \<le> 2 * C" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2357 | by (metis mult_2) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2358 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2359 |   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 | 2360 | using contf by (simp add: insert_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2361 |   { 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 | 2362 | 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 | 2363 | 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 | 2364 | 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 | 2365 | 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 | 2366 | have ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2367 | 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 | 2368 | case True then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2369 | using Cauchy_theorem_flat [OF contf, of 0] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2370 | 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 | 2371 | 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 | 2372 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2373 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2374 |       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 | 2375 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2376 |       { assume "interior(convex hull {a,b,c}) = {}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2377 |         then have "collinear{a,b,c}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2378 | using interior_convex_hull_eq_empty [OF car3] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2379 | by (simp add: collinear_3_eq_affine_dependent) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2380 | then have "False" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2381 | using False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2382 | apply (clarsimp simp add: collinear_3 collinear_lemma) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2383 | apply (drule Cauchy_theorem_flat [OF contf']) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2384 | using pi_eq_y 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 | 2385 | apply (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 | 2386 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2387 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2388 |       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 | 2389 | by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2390 |       { fix d1
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2391 | assume d1_pos: "0 < d1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2392 |            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 | 2393 | \<Longrightarrow> cmod (f x' - f x) < cmod y / (24 * C)" | 
| 63040 | 2394 | define e where "e = min 1 (min (d1/(4*C)) ((norm y / 24 / C) / B))" | 
| 2395 | 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 | 2396 | 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 | 2397 | have e: "0 < e" "e \<le> 1" "e \<le> d1 / (4 * C)" "e \<le> cmod y / 24 / C / B" | 
| 61222 | 2398 | 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 | 2399 | then have eCB: "24 * e * C * B \<le> cmod y" | 
| 61222 | 2400 | 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 | 2401 | have e_le_d1: "e * (4 * C) \<le> d1" | 
| 61222 | 2402 | 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 | 2403 |         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 | 2404 |              "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 | 2405 |              "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 | 2406 | 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 | 2407 | 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 | 2408 | (linepath (shrink a) (shrink b) +++ linepath (shrink b) (shrink c) +++ linepath (shrink c) (shrink a))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2409 | by (simp add: Cauchy_theorem_triangle holomorphic_on_subset [OF holf] hull_minimal convex_interior) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2410 | 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 | 2411 | 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 | 2412 | 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 | 2413 | "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 | 2414 | "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 | 2415 | 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 | 2416 | 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 | 2417 | 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 | 2418 | 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 | 2419 | by (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2420 | have "cmod y / (24 * C) \<le> cmod y / cmod (b - a) / 12" | 
| 61222 | 2421 | 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 | 2422 | by (auto simp: divide_simps hull_inc) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2423 |         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 | 2424 | 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 | 2425 | 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 | 2426 |         { fix u v
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2427 |           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 | 2428 | 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 | 2429 |           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 | 2430 |                        "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 | 2431 | using d e uv | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2432 | 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 | 2433 | 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 | 2434 | 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 | 2435 | 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 | 2436 | apply (rule order_trans [OF _ eCB]) | 
| 61222 | 2437 | 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 | 2438 | by (auto simp: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2439 |           { 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 | 2440 | 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 | 2441 | 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 | 2442 | using uv x d interior_subset | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2443 | apply (auto simp: hull_inc intro!: less_C) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2444 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2445 | 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 | 2446 | 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 | 2447 | have cmod_less_dt: "cmod (linepath (shrink u) (shrink v) x - linepath u v x) < d1" | 
| 61222 | 2448 | using \<open>e>0\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2449 | apply (simp add: ll norm_mult scaleR_diff_right) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2450 | apply (rule less_le_trans [OF _ e_le_d1]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2451 | using cmod_less_4C | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2452 | apply (force intro: norm_triangle_lt) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2453 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2454 | 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 | 2455 | using x uv shr_uv cmod_less_dt | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2456 | by (auto simp: hull_inc intro: d1 interior_subset [THEN subsetD] linepath_in_convex_hull) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2457 | also have "... \<le> cmod y / cmod (v - u) / 12" | 
| 61222 | 2458 | 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 | 2459 | by (auto simp: divide_simps hull_inc) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2460 | 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 | 2461 | by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2462 | 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 | 2463 | using uv False by (auto simp: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2464 | have "cmod (f (linepath (shrink u) (shrink v) x)) * cmod (shrink v - shrink u - (v - u)) + | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2465 | cmod (v - u) * cmod (f (linepath (shrink u) (shrink v) x) - f (linepath u v x)) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2466 | \<le> cmod y / 6" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2467 | apply (rule order_trans [of _ "B*((norm y / 24 / C / B)*2*C) + (2*C)*(norm y /24 / C)"]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2468 | apply (rule add_mono [OF mult_mono]) | 
| 61222 | 2469 | using By_uv e \<open>0 < B\<close> \<open>0 < C\<close> x ynz | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2470 | apply (simp_all add: cmod_fuv cmod_shr cmod_12_le hull_inc) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2471 | apply (simp add: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2472 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2473 | } note cmod_diff_le = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2474 | 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 | 2475 | 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 | 2476 | 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 | 2477 | by (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2478 | have "norm (?pathint (shrink u) (shrink v) - ?pathint u v) \<le> norm y / 6" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2479 | apply (rule order_trans) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2480 | apply (rule has_integral_bound | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2481 | [of "B*(norm y /24/C/B)*2*C + (2*C)*(norm y/24/C)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2482 | "\<lambda>x. f(linepath (shrink u) (shrink v) x) * (shrink v - shrink u) - f(linepath u v x)*(v - u)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2483 | _ 0 1 ]) | 
| 61222 | 2484 | using ynz \<open>0 < B\<close> \<open>0 < C\<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2485 | 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 | 2486 | apply (simp add: has_integral_diff has_contour_integral_linepath [symmetric] 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 | 2487 | fpi_uv f_uv contour_integrable_continuous_linepath, clarify) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2488 | apply (simp only: **) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2489 | apply (simp add: norm_triangle_le norm_mult cmod_diff_le del: le_divide_eq_numeral1) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2490 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2491 | } note * = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2492 | 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 | 2493 | 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 | 2494 | moreover | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2495 | 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 | 2496 | 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 | 2497 | moreover | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2498 | 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 | 2499 | 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 | 2500 | ultimately | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2501 | 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 | 2502 | (?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 | 2503 | \<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 | 2504 | by (metis norm_triangle_le add_mono) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2505 | also have "... = norm y / 2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2506 | by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2507 | 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 | 2508 | (?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 | 2509 | \<le> norm y / 2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2510 | by (simp add: algebra_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2511 | then | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2512 | 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 | 2513 | 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 | 2514 | then have "False" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2515 | using pi_eq_y ynz by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2516 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2517 |         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 | 2518 | 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 | 2519 | ultimately have "False" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2520 | unfolding uniformly_continuous_on_def | 
| 61222 | 2521 | 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 | 2522 | then show ?thesis .. | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2523 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2524 | } | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2525 | 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 | 2526 | 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 | 2527 | 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 | 2528 | using has_contour_integral_integral by fastforce | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2529 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2530 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2531 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2532 | subsection\<open>Version allowing finite number of exceptional points\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2533 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2534 | lemma Cauchy_theorem_triangle_cofinite: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2535 |   assumes "continuous_on (convex hull {a,b,c}) f"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2536 | and "finite s" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 2537 |       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 | 2538 | 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 | 2539 | using assms | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2540 | proof (induction "card s" arbitrary: a b c s rule: less_induct) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2541 | case (less s a b c) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2542 | show ?case | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2543 |   proof (cases "s={}")
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2544 | case True with less 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 | 2545 | by (fastforce simp: holomorphic_on_def field_differentiable_at_within | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2546 | Cauchy_theorem_triangle_interior) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2547 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2548 | case False | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2549 | then obtain d s' where d: "s = insert d s'" "d \<notin> s'" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2550 | 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 | 2551 | then show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2552 |     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 | 2553 | 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 | 2554 | show "(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 | 2555 | apply (rule less.hyps [of "s'"]) | 
| 61222 | 2556 | using False d \<open>finite s\<close> interior_subset | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2557 | apply (auto intro!: less.prems) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2558 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2559 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2560 | case True | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2561 |       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 | 2562 | 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 | 2563 | have abd: "(f has_contour_integral 0) (linepath a b +++ linepath b d +++ linepath d a)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2564 | apply (rule less.hyps [of "s'"]) | 
| 61222 | 2565 | using True d \<open>finite s\<close> not_in_interior_convex_hull_3 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2566 | apply (auto intro!: less.prems continuous_on_subset [OF _ *]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2567 | apply (metis * insert_absorb insert_subset interior_mono) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2568 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2569 |       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 | 2570 | 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 | 2571 | have bcd: "(f has_contour_integral 0) (linepath b c +++ linepath c d +++ linepath d b)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2572 | apply (rule less.hyps [of "s'"]) | 
| 61222 | 2573 | using True d \<open>finite s\<close> not_in_interior_convex_hull_3 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2574 | apply (auto intro!: less.prems continuous_on_subset [OF _ *]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2575 | apply (metis * insert_absorb insert_subset interior_mono) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2576 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2577 |       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 | 2578 | 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 | 2579 | have cad: "(f has_contour_integral 0) (linepath c a +++ linepath a d +++ linepath d c)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2580 | apply (rule less.hyps [of "s'"]) | 
| 61222 | 2581 | using True d \<open>finite s\<close> not_in_interior_convex_hull_3 | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2582 | apply (auto intro!: less.prems continuous_on_subset [OF _ *]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2583 | apply (metis * insert_absorb insert_subset interior_mono) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2584 | 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 | 2585 | have "f contour_integrable_on linepath a b" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2586 | using less.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 | 2587 | by (metis continuous_on_subset insert_commute contour_integrable_continuous_linepath segments_subset_convex_hull(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 | 2588 | moreover have "f contour_integrable_on linepath b c" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2589 | using less.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 | 2590 | by (metis continuous_on_subset contour_integrable_continuous_linepath segments_subset_convex_hull(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 | 2591 | moreover have "f contour_integrable_on linepath c a" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2592 | using less.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 | 2593 | by (metis continuous_on_subset insert_commute contour_integrable_continuous_linepath segments_subset_convex_hull(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 | 2594 | 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 | 2595 | by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2596 |       { 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 | 2597 | 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 | 2598 | and ynz: "y \<noteq> 0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2599 | 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 | 2600 | 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 | 2601 | 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 | 2602 | 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 | 2603 | 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 | 2604 | 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 | 2605 | have "contour_integral (linepath a b) f = - (contour_integral (linepath b d) f + (contour_integral (linepath d 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 | 2606 | "contour_integral (linepath b c) f = - (contour_integral (linepath c d) f + (contour_integral (linepath d 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 | 2607 | "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 | 2608 | using has_chain_integral_chain_integral3 [OF abd] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2609 | has_chain_integral_chain_integral3 [OF bcd] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2610 | has_chain_integral_chain_integral3 [OF cad] | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2611 | 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 | 2612 | 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 | 2613 | 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 | 2614 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2615 | 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 | 2616 | 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 | 2617 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2618 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2619 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2620 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2621 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2622 | subsection\<open>Cauchy's theorem for an open starlike set\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2623 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2624 | lemma starlike_convex_subset: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2625 | 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" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2626 |     shows "convex hull {a,b,c} \<subseteq> s"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2627 | using s | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2628 |       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 | 2629 | 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 | 2630 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2631 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2632 | lemma triangle_contour_integrals_starlike_primitive: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2633 | assumes contf: "continuous_on s f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2634 | and s: "a \<in> s" "open s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2635 | and x: "x \<in> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2636 | and subs: "\<And>y. y \<in> s \<Longrightarrow> closed_segment a y \<subseteq> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2637 | 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 | 2638 | \<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 | 2639 | 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 | 2640 | 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 | 2641 | 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 | 2642 | 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 | 2643 |   { fix e y
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2644 | assume e: "0 < e" and bxe: "ball x e \<subseteq> s" and close: "cmod (y - x) < e" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2645 | have y: "y \<in> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2646 | 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 | 2647 | 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 | 2648 | using contf continuous_on_subset subs y by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2649 | have xys: "closed_segment x y \<subseteq> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2650 | apply (rule order_trans [OF _ bxe]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2651 | using close | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2652 | 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 | 2653 | 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 | 2654 | 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 | 2655 | } note [simp] = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2656 |   { fix e::real
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2657 | assume e: "0 < e" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2658 | have cont_atx: "continuous (at x) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2659 | using x s contf continuous_on_eq_continuous_at by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2660 | 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 | 2661 | 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 | 2662 | by (drule_tac x="e/2" in spec) force | 
| 61222 | 2663 | 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 | 2664 | by (auto simp: open_contains_ball) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2665 | 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 | 2666 |     { fix y
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2667 | assume yx: "y \<noteq> x" and close: "cmod (y - x) < min d1 d2" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2668 | have y: "y \<in> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2669 | using d2 close by (force simp: dist_norm 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 | 2670 | have fxy: "f contour_integrable_on 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 | 2671 | apply (rule contour_integrable_continuous_linepath) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2672 | apply (rule continuous_on_subset [OF contf]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2673 | using close d2 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2674 | apply (auto simp: dist_norm norm_minus_commute dest!: segment_bound(1)) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2675 | 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 | 2676 | 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 | 2677 | 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 | 2678 | 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 | 2679 | 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 | 2680 | then have "cmod (i - f x * (y - x)) \<le> e / 2 * cmod (y - 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 | 2681 | apply (rule has_contour_integral_bound_linepath [where B = "e/2"]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2682 | using e apply simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2683 | apply (rule d1_less [THEN less_imp_le]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2684 | using close segment_bound | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2685 | apply force | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2686 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2687 | also have "... < e * cmod (y - x)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2688 | by (simp add: e yx) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2689 | 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 | 2690 | 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 | 2691 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2692 | 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 | 2693 | using dpos by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2694 | } | 
| 61976 | 2695 | 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 | 2696 | 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 | 2697 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2698 | apply (simp add: has_field_derivative_def has_derivative_at bounded_linear_mult_right) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2699 | apply (rule Lim_transform [OF * Lim_eventually]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2700 | apply (simp add: inverse_eq_divide [symmetric] eventually_at) | 
| 61222 | 2701 | using \<open>open s\<close> x | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2702 | apply (force simp: dist_norm open_contains_ball) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2703 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2704 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2705 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2706 | (** Existence of a primitive.*) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2707 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2708 | 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 | 2709 | fixes f :: "complex \<Rightarrow> complex" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2710 | assumes contf: "continuous_on s f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2711 | and s: "starlike s" and os: "open s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2712 | and k: "finite k" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 2713 | and fcd: "\<And>x. x \<in> s - k \<Longrightarrow> f field_differentiable at x" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2714 | shows "\<exists>g. \<forall>x \<in> s. (g has_field_derivative f x) (at x)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2715 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2716 | obtain a where a: "a\<in>s" and a_cs: "\<And>x. x\<in>s \<Longrightarrow> closed_segment a x \<subseteq> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2717 | using s by (auto simp: starlike_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2718 |   { fix x b c
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2719 | assume "x \<in> s" "closed_segment b c \<subseteq> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2720 |     then have abcs: "convex hull {a, b, c} \<subseteq> s"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2721 | by (simp add: a a_cs starlike_convex_subset) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2722 |     then have *: "continuous_on (convex hull {a, b, c}) f"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2723 | by (simp add: 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 | 2724 | have "(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 | 2725 | apply (rule Cauchy_theorem_triangle_cofinite [OF _ k]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2726 | using abcs apply (simp add: continuous_on_subset [OF contf]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2727 | using * abcs interior_subset apply (auto intro: fcd) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2728 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2729 | } note 0 = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2730 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2731 | 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 | 2732 | 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 | 2733 | apply (metis a_cs) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2734 | apply (metis has_chain_integral_chain_integral3 0) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2735 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2736 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2737 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2738 | lemma Cauchy_theorem_starlike: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2739 | "\<lbrakk>open s; starlike s; finite k; 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 | 2740 | \<And>x. x \<in> s - k \<Longrightarrow> f field_differentiable at x; | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2741 | 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 | 2742 | \<Longrightarrow> (f has_contour_integral 0) g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2743 | 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 | 2744 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2745 | lemma Cauchy_theorem_starlike_simple: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2746 | "\<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 | 2747 | \<Longrightarrow> (f has_contour_integral 0) g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2748 | apply (rule Cauchy_theorem_starlike [OF _ _ finite.emptyI]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2749 | 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 | 2750 | apply (metis at_within_open holomorphic_on_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2751 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2752 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2753 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2754 | 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 | 2755 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2756 | 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 | 2757 | |
| 61738 
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 | lemma triangle_contour_integrals_convex_primitive: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2759 | assumes contf: "continuous_on s f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2760 | and s: "a \<in> s" "convex s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2761 | and x: "x \<in> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2762 | 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 | 2763 | \<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 | 2764 | 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 | 2765 | 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 | 2766 | 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 | 2767 | 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 | 2768 |   { fix y
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2769 | assume y: "y \<in> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2770 | 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 | 2771 | using s y by (meson contf continuous_on_subset convex_contains_segment) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2772 | have xys: "closed_segment x y \<subseteq> s" (*?*) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2773 | using convex_contains_segment s x y by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2774 | 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 | 2775 | 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 | 2776 | } note [simp] = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2777 |   { fix e::real
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2778 | assume e: "0 < e" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2779 | have cont_atx: "continuous (at x within s) f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2780 | using x s contf by (simp add: continuous_on_eq_continuous_within) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2781 | 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" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2782 | 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 | 2783 | 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 | 2784 |     { fix y
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2785 | 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 | 2786 | have fxy: "f contour_integrable_on linepath x y" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2787 | 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 | 2788 | 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 | 2789 | 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 | 2790 | 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 | 2791 | 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 | 2792 | 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 | 2793 | then have "cmod (i - f x * (y - x)) \<le> e / 2 * cmod (y - 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 | 2794 | apply (rule has_contour_integral_bound_linepath [where B = "e/2"]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2795 | using e apply simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2796 | apply (rule d1_less [THEN less_imp_le]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2797 | using convex_contains_segment s(2) x y apply blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2798 | using close segment_bound(1) apply fastforce | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2799 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2800 | also have "... < e * cmod (y - x)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2801 | by (simp add: e yx) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2802 | 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 | 2803 | 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 | 2804 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2805 | 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" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2806 | using d1 by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2807 | } | 
| 61973 | 2808 | 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 | 2809 | 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 | 2810 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2811 | 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 | 2812 | apply (rule Lim_transform [OF * Lim_eventually]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2813 | using linordered_field_no_ub | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2814 | 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 | 2815 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2816 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2817 | |
| 61848 | 2818 | lemma contour_integral_convex_primitive: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2819 | "\<lbrakk>convex s; continuous_on s 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 | 2820 | \<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)\<rbrakk> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2821 | \<Longrightarrow> \<exists>g. \<forall>x \<in> s. (g 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 | 2822 |   apply (cases "s={}")
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2823 | apply (simp_all add: ex_in_conv [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 | 2824 | apply (blast intro: triangle_contour_integrals_convex_primitive has_chain_integral_chain_integral3) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2825 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2826 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2827 | 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 | 2828 | fixes f :: "complex \<Rightarrow> complex" | 
| 
bc25f3916a99
new material to Blochj's theorem, as well as supporting lemmas
 paulson <lp15@cam.ac.uk> parents: 
62464diff
changeset | 2829 | shows | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2830 | "\<lbrakk>convex s; finite k; 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 | 2831 | \<And>x. x \<in> interior s - k \<Longrightarrow> f field_differentiable at x\<rbrakk> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2832 | \<Longrightarrow> \<exists>g. \<forall>x \<in> s. (g has_field_derivative f x) (at x within s)" | 
| 61848 | 2833 | apply (rule contour_integral_convex_primitive [OF _ _ Cauchy_theorem_triangle_cofinite]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2834 | prefer 3 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2835 | apply (erule continuous_on_subset) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2836 | apply (simp add: subset_hull continuous_on_subset, assumption+) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2837 | by (metis Diff_iff convex_contains_segment insert_absorb insert_subset interior_mono segment_convex_hull subset_hull) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2838 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2839 | lemma Cauchy_theorem_convex: | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2840 | "\<lbrakk>continuous_on s f; convex s; finite k; | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 2841 | \<And>x. x \<in> interior s - k \<Longrightarrow> f field_differentiable at x; | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2842 | 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 | 2843 | 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 | 2844 | by (metis holomorphic_convex_primitive Cauchy_theorem_primitive) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2845 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2846 | lemma Cauchy_theorem_convex_simple: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2847 | "\<lbrakk>f holomorphic_on s; convex s; | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2848 | 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 | 2849 | 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 | 2850 | apply (rule Cauchy_theorem_convex) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2851 | 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 | 2852 | apply (rule finite.emptyI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2853 | 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 | 2854 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2855 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2856 | text\<open>In particular for a disc\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2857 | lemma Cauchy_theorem_disc: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2858 | "\<lbrakk>finite k; continuous_on (cball a e) f; | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 2859 | \<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 | 2860 | 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 | 2861 | 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 | 2862 | apply (rule Cauchy_theorem_convex) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2863 | apply (auto simp: convex_cball interior_cball) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2864 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2865 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2866 | lemma Cauchy_theorem_disc_simple: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2867 | "\<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 | 2868 | 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 | 2869 | by (simp add: Cauchy_theorem_convex_simple) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2870 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2871 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2872 | subsection\<open>Generalize integrability to local primitives\<close> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2873 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2874 | lemma contour_integral_local_primitive_lemma: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2875 | fixes f :: "complex\<Rightarrow>complex" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2876 | shows | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2877 |     "\<lbrakk>g piecewise_differentiable_on {a..b};
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2878 | \<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 | 2879 |       \<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 | 2880 |      \<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 | 2881 |             integrable_on {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2882 |   apply (cases "cbox a b = {}", force)
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2883 | apply (simp add: integrable_on_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2884 | 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 | 2885 | apply (rule contour_integral_primitive_lemma, assumption+) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2886 | using atLeastAtMost_iff by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2887 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2888 | lemma contour_integral_local_primitive_any: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2889 | fixes f :: "complex \<Rightarrow> complex" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2890 |   assumes gpd: "g piecewise_differentiable_on {a..b}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2891 | and dh: "\<And>x. x \<in> s | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2892 | \<Longrightarrow> \<exists>d h. 0 < d \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2893 | (\<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 | 2894 |       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 | 2895 |   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 | 2896 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2897 |   { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2898 | assume x: "a \<le> x" "x \<le> b" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2899 | obtain d h where d: "0 < d" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2900 | 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 | 2901 | using x gs dh by (metis atLeastAtMost_iff) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2902 |     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 | 2903 |     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 | 2904 | using x d | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2905 | apply (auto simp: dist_norm continuous_on_iff) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2906 | apply (drule_tac x=x in bspec) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2907 | using x apply simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2908 | apply (drule_tac x=d in spec, auto) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2909 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2910 |     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 | 2911 |                           (\<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 | 2912 | apply (rule_tac x=e in exI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2913 | using e | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2914 | 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 | 2915 |       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 | 2916 | 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 | 2917 | 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 | 2918 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2919 | } then | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2920 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2921 | 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 | 2922 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2923 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2924 | lemma contour_integral_local_primitive: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2925 | fixes f :: "complex \<Rightarrow> complex" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2926 | 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 | 2927 | and dh: "\<And>x. x \<in> s | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2928 | \<Longrightarrow> \<exists>d h. 0 < d \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2929 | (\<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 | 2930 | shows "f contour_integrable_on g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2931 | 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 | 2932 | 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 | 2933 | 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 | 2934 | 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 | 2935 | 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 | 2936 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2937 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2938 | 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 | 2939 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2940 | lemma contour_integrable_holomorphic: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2941 | assumes contf: "continuous_on s f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2942 | and os: "open s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2943 | and k: "finite k" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2944 | 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 | 2945 | 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 | 2946 | shows "f contour_integrable_on g" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2947 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2948 |   { fix z
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2949 | assume z: "z \<in> s" | 
| 61222 | 2950 | obtain d where d: "d>0" "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 | 2951 | by (auto simp: open_contains_ball) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2952 | 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 | 2953 | using contf continuous_on_subset by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2954 | obtain h where "\<forall>y\<in>ball z d. (h has_field_derivative f y) (at y within ball z d)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2955 | using holomorphic_convex_primitive [OF convex_ball k contfb fcd] d | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2956 | interior_subset by force | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2957 | then have "\<forall>y\<in>ball z d. (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 | 2958 | by (metis Topology_Euclidean_Space.open_ball at_within_open d(2) os subsetCE) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2959 | 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 | 2960 | by (force simp: dist_norm norm_minus_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2961 | 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))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2962 | using d by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2963 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2964 | 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 | 2965 | 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 | 2966 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2967 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2968 | lemma contour_integrable_holomorphic_simple: | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 2969 | assumes fh: "f holomorphic_on s" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2970 | and os: "open s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2971 | 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 | 2972 | shows "f contour_integrable_on g" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 2973 | 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 | 2974 | 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 | 2975 | 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 | 2976 | |
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 2977 | lemma continuous_on_inversediff: | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 2978 | fixes z:: "'a::real_normed_field" shows "z \<notin> s \<Longrightarrow> continuous_on s (\<lambda>w. 1 / (w - z))" | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 2979 | by (rule continuous_intros | force)+ | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 2980 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2981 | corollary contour_integrable_inversediff: | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 2982 | "\<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 | 2983 | apply (rule contour_integrable_holomorphic_simple [of _ "UNIV-{z}"])
 | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 2984 | 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 | 2985 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2986 | |
| 61222 | 2987 | 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 | 2988 | 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 | 2989 | 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 | 2990 | 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 | 2991 | 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 | 2992 | winding numbers now. | 
| 61222 | 2993 | \<close> | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 2994 | |
| 61711 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 2995 | 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 | 2996 | 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 | 2997 | 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 | 2998 | 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 | 2999 | (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 | 3000 | 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 | 3001 | |
| 61222 | 3002 | text\<open>This formulation covers two cases: @{term g} and @{term h} share their
 | 
| 3003 |       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 | 3004 | lemma contour_integral_nearby: | 
| 61711 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3005 | assumes os: "open s" and p: "path p" "path_image p \<subseteq> s" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3006 | shows | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3007 | "\<exists>d. 0 < d \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3008 | (\<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 | 3009 |                   (\<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 | 3010 | linked_paths atends g h | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3011 | \<longrightarrow> path_image g \<subseteq> s \<and> path_image h \<subseteq> s \<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 | 3012 | (\<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 | 3013 | proof - | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3014 | have "\<forall>z. \<exists>e. z \<in> path_image p \<longrightarrow> 0 < e \<and> ball z e \<subseteq> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3015 | using open_contains_ball os p(2) by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3016 | then obtain ee where ee: "\<And>z. z \<in> path_image p \<Longrightarrow> 0 < ee z \<and> ball z (ee z) \<subseteq> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3017 | by metis | 
| 63040 | 3018 | 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 | 3019 | have "compact (path_image p)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3020 | by (metis p(1) compact_path_image) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3021 | 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 | 3022 | using ee by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3023 | 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 | 3024 | 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 | 3025 | 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 | 3026 | by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3027 |   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 | 3028 | apply (simp add: cover_def path_image_def image_comp) | 
| 61222 | 3029 | 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 | 3030 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3031 |   then have kne: "k \<noteq> {}"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3032 | using D by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3033 | 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 | 3034 | using k by (auto simp: path_image_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3035 | 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 | 3036 | by (metis ee) | 
| 63040 | 3037 | define e where "e = Min((ee o p) ` k)" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3038 | have fin_eep: "finite ((ee o p) ` k)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3039 | using k by blast | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3040 | have enz: "0 < e" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3041 | 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 | 3042 |   have "uniformly_continuous_on {0..1} p"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3043 | 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 | 3044 | then obtain d::real where d: "d>0" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3045 |           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 | 3046 | unfolding uniformly_continuous_on_def dist_norm real_norm_def | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3047 | by (metis divide_pos_pos enz zero_less_numeral) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3048 | 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 | 3049 | using real_arch_inverse [of d] by auto | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3050 |   { fix g h
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3051 |     assume g: "valid_path g" and gp: "\<forall>t\<in>{0..1}. cmod (g t - p t) < e / 3"
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3052 |        and h: "valid_path h" and hp: "\<forall>t\<in>{0..1}. cmod (h t - p t) < e / 3"
 | 
| 61711 
21d7910d6816
Theory of homotopic paths (from HOL Light), plus comments and minor refinements
 paulson <lp15@cam.ac.uk> parents: 
61694diff
changeset | 3053 | and joins: "linked_paths atends g h" | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3054 |     { fix t::real
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3055 | assume t: "0 \<le> t" "t \<le> 1" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3056 | then obtain u where u: "u \<in> k" and ptu: "p t \<in> ball(p u) (ee(p u) / 3)" | 
| 61222 | 3057 | 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 | 3058 | 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 | 3059 | by (simp add: e_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3060 | have "cmod (g t - p t) < e / 3" "cmod (h t - p t) < e / 3" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3061 | using gp hp t by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3062 | 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 | 3063 | "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 | 3064 | by linarith+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3065 | 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 | 3066 | 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 | 3067 | 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 | 3068 | by (force simp: dist_norm ball_def norm_minus_commute)+ | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3069 | then have "g t \<in> s" "h t \<in> s" using ee u k | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3070 | by (auto simp: path_image_def ball_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3071 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3072 | then have ghs: "path_image g \<subseteq> s" "path_image h \<subseteq> s" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3073 | by (auto simp: path_image_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3074 | moreover | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3075 |     { fix f
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3076 | 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 | 3077 | 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 | 3078 | 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 | 3079 | by blast+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3080 | have contf: "continuous_on s f" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3081 | 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 | 3082 |       { fix z
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3083 | assume z: "z \<in> path_image p" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3084 | have "f holomorphic_on ball z (ee z)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3085 | 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 | 3086 | 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 | 3087 |           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 | 3088 | 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 | 3089 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3090 | then obtain ff where ff: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3091 | "\<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 | 3092 | by metis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3093 |       { fix n
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3094 | 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 | 3095 | 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 | 3096 | 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 | 3097 | proof (induct n) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3098 | case 0 show ?case by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3099 | next | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3100 | case (Suc n) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3101 | obtain t where t: "t \<in> k" and "p (n/N) \<in> ball(p t) (ee(p t) / 3)" | 
| 61222 | 3102 | 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 | 3103 | by (force simp: path_image_def) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3104 | 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 | 3105 | by (simp add: dist_norm) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3106 | 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 | 3107 | by (simp add: e_def) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3108 |           { fix x
 | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3109 | 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 | 3110 | 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 | 3111 | using Suc.prems by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3112 | 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 | 3113 | using x by linarith+ | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3114 | have "cmod (p t - p x) < ee (p t) / 3 + e/3" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3115 | apply (rule norm_diff_triangle_less [OF ptu de]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3116 | using x N x01 Suc.prems | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3117 | apply (auto simp: field_simps) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3118 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3119 | 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 | 3120 | using e3le eepi [OF t] by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3121 | 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 | 3122 | apply (rule norm_diff_triangle_less [OF ptx]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3123 | using gp x01 by (simp add: norm_minus_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3124 | also have "... \<le> ee (p t)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3125 | using e3le eepi [OF t] by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3126 | 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 | 3127 | 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 | 3128 | apply (rule norm_diff_triangle_less [OF ptx]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3129 | using hp x01 by (simp add: norm_minus_commute) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3130 | also have "... \<le> ee (p t)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3131 | using e3le eepi [OF t] by simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3132 | 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 | 3133 | "cmod (p t - h x) < ee (p t)" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3134 | using gg by auto | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3135 | } note ptgh_ee = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3136 | have pi_hgn: "path_image (linepath (h (n/N)) (g (n/N))) \<subseteq> ball (p t) (ee (p t))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3137 | 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 | 3138 | by (auto simp: field_simps dist_norm dest: segment_furthest_le [where y="p t"]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3139 | then have gh_ns: "closed_segment (g (n/N)) (h (n/N)) \<subseteq> s" | 
| 61222 | 3140 | using \<open>N>0\<close> 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 | 3141 | apply (simp add: path_image_join field_simps closed_segment_commute) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3142 | apply (erule order_trans) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3143 | apply (simp add: ee pi t) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3144 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3145 | have pi_ghn': "path_image (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 | 3146 | \<subseteq> ball (p t) (ee (p t))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3147 | 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 | 3148 | by (auto simp: field_simps dist_norm dest: segment_furthest_le [where y="p t"]) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3149 | then have gh_n's: "closed_segment (g ((1 + n) / N)) (h ((1 + n) / N)) \<subseteq> s" | 
| 61222 | 3150 | 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 | 3151 | 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 | 3152 | have pi_subset_ball: | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3153 | "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 | 3154 | 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 | 3155 | \<subseteq> ball (p t) (ee (p t))" | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3156 | apply (intro subset_path_image_join pi_hgn pi_ghn') | 
| 61222 | 3157 | 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 | 3158 | 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 | 3159 | 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 | 3160 | have pi0: "(f has_contour_integral 0) | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3161 | (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 | 3162 | 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 | 3163 | 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 | 3164 | apply (metis ff open_ball at_within_open pi t) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3165 | apply (intro valid_path_join) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3166 | using Suc.prems pi_subset_ball apply (simp_all add: valid_path_subpath g h) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3167 | 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 | 3168 | 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 | 3169 | 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 | 3170 | 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 | 3171 | 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 | 3172 | 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 | 3173 | 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 | 3174 | 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 | 3175 | 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 | 3176 | 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 | 3177 | 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 | 3178 | 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 | 3179 | 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 | 3180 | 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 | 3181 | 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 | 3182 | 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 | 3183 | 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 | 3184 | \<lbrakk>hn - gn = ghn - gh0; | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3185 | gd + ghn' + he + hgn = (0::complex); | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3186 | 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 | 3187 | 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 | 3188 | 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 | 3189 | 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 | 3190 | 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 | 3191 | using Suc.prems by (simp add: h fpa contour_integral_reversepath valid_path_subpath 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 | 3192 | also have "... = contour_integral (subpath 0 ((Suc 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 | 3193 | 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 | 3194 | 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 | 3195 | "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 | 3196 | 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 | 3197 | show ?case | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3198 | apply (rule * [OF Suc.hyps eq0 pi0_eq]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3199 | 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 | 3200 | 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 | 3201 | 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 | 3202 | continuous_on_subset [OF contf gh_ns]) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3203 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3204 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3205 | } 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 | 3206 | 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 | 3207 | using ind [OF order_refl] N joins | 
| 62390 | 3208 | 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 | 3209 | } | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3210 | ultimately | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3211 | have "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 | 3212 | by metis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3213 | } note * = this | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3214 | show ?thesis | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3215 | apply (rule_tac x="e/3" in exI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3216 | apply (rule conjI) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3217 | using enz apply simp | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3218 | apply (clarsimp simp only: ball_conj_distrib) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3219 | apply (rule *; assumption) | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3220 | done | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3221 | qed | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3222 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3223 | |
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3224 | lemma | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3225 | 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 | 3226 | shows contour_integral_nearby_ends: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3227 | "\<exists>d. 0 < d \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3228 | (\<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 | 3229 |                     (\<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 | 3230 | pathstart h = pathstart g \<and> pathfinish h = pathfinish g | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3231 | \<longrightarrow> path_image g \<subseteq> s \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3232 | path_image h \<subseteq> s \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3233 | (\<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 | 3234 | \<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 | 3235 | and contour_integral_nearby_loops: | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3236 | "\<exists>d. 0 < d \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3237 | (\<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 | 3238 |                     (\<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 | 3239 | pathfinish g = pathstart g \<and> pathfinish h = pathstart h | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3240 | \<longrightarrow> path_image g \<subseteq> s \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3241 | path_image h \<subseteq> s \<and> | 
| 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3242 | (\<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 | 3243 | \<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 | 3244 | 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 | 3245 | 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 | 3246 | unfolding linked_paths_def by simp_all | 
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 3247 | |
| 61190 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3248 | 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 | 3249 | fixes p :: "real \<Rightarrow> 'a::euclidean_space" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3250 | shows "polynomial_function p \<Longrightarrow> p C1_differentiable_on s" | 
| 
2bd401e364f9
Massive revisions, as a valid path must now be continously differentiable (C!)
 paulson <lp15@cam.ac.uk> parents: 
61104diff
changeset | 3251 | 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 | 3252 | |
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3253 | 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 | 3254 | fixes p :: "real \<Rightarrow> 'a::euclidean_space" | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3255 | 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 | 3256 | 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 | 3257 | |
| 61518 
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
 paulson parents: 
61426diff
changeset | 3258 | lemma valid_path_subpath_trivial [simp]: | 
| 
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
 paulson parents: 
61426diff
changeset | 3259 | fixes g :: "real \<Rightarrow> 'a::euclidean_space" | 
| 
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
 paulson parents: 
61426diff
changeset | 3260 | 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 | 3261 | by (simp add: subpath_def valid_path_polynomial_function) | 
| 
ff12606337e9
new lemmas about topology, etc., for Cauchy integral formula
 paulson parents: 
61426diff
changeset | 3262 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3263 | lemma contour_integral_bound_exists: | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3264 | assumes s: "open s" | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3265 | and g: "valid_path g" | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3266 | and pag: "path_image g \<subseteq> s" | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3267 | shows "\<exists>L. 0 < L \<and> | 
| 61200 | 3268 | (\<forall>f B. f holomorphic_on s \<and> (\<forall>z \<in> s. norm(f z) \<le> 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 | 3269 | \<longrightarrow> norm(contour_integral g f) \<le> L*B)" | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3270 | proof - | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3271 | have "path g" using g | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3272 | by (simp add: valid_path_imp_path) | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3273 | then obtain d::real and p | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3274 | where d: "0 < d" | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3275 | and p: "polynomial_function 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 | 3276 | and pi: "\<And>f. f holomorphic_on s \<Longrightarrow> contour_integral g f = contour_integral p 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 | 3277 | using contour_integral_nearby_ends [OF s \<open>path g\<close> pag] | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3278 | apply clarify | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3279 | apply (drule_tac x=g in spec) | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3280 | apply (simp only: assms) | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3281 | apply (force simp: valid_path_polynomial_function dest: path_approx_polynomial_function) | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3282 | done | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3283 | then obtain p' where p': "polynomial_function p'" | 
| 61200 | 3284 | "\<And>x. (p has_vector_derivative (p' x)) (at x)" | 
| 63938 | 3285 | by (blast intro: has_vector_derivative_polynomial_function that elim: ) | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3286 | then have "bounded(p' ` {0..1})"
 | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3287 | using continuous_on_polymonial_function | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3288 | by (force simp: intro!: compact_imp_bounded compact_continuous_image) | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3289 | then obtain L where L: "L>0" and nop': "\<And>x. x \<in> {0..1} \<Longrightarrow> norm (p' x) \<le> L"
 | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3290 | by (force simp: bounded_pos) | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3291 | { fix f B
 | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3292 | assume f: "f holomorphic_on s" | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3293 | and B: "\<And>z. z\<in>s \<Longrightarrow> cmod (f z) \<le> 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 | 3294 | then have "f contour_integrable_on p \<and> valid_path p" | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3295 | using p 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 | 3296 | by (blast intro: valid_path_polynomial_function contour_integrable_holomorphic_simple holomorphic_on_imp_continuous_on) | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3297 |   moreover have "\<And>x. x \<in> {0..1} \<Longrightarrow> cmod (vector_derivative p (at x)) * cmod (f (p x)) \<le> L * B"
 | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3298 | apply (rule mult_mono) | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3299 | apply (subst Derivative.vector_derivative_at; force intro: p' nop') | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3300 | using L B p | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3301 | apply (auto simp: path_image_def image_subset_iff) | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3302 | 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 | 3303 | ultimately have "cmod (contour_integral g f) \<le> L * B" | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3304 | apply (simp add: pi [OF 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 | 3305 | apply (simp add: contour_integral_integral) | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3306 | apply (rule order_trans [OF integral_norm_bound_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 | 3307 | apply (auto simp: mult.commute integral_norm_bound_integral contour_integrable_on [symmetric] norm_mult) | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3308 | done | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3309 | } then | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3310 | 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 | 3311 | by (force simp: L contour_integral_integral) | 
| 61104 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3312 | qed | 
| 
3c2d4636cebc
new lemmas about vector_derivative, complex numbers, paths, etc.
 paulson parents: 
60809diff
changeset | 3313 | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3314 | 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 | 3315 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3316 | subsection\<open>Winding Numbers\<close> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3317 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3318 | definition winding_number:: "[real \<Rightarrow> complex, complex] \<Rightarrow> complex" where | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3319 | "winding_number \<gamma> z \<equiv> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3320 | @n. \<forall>e > 0. \<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 | 3321 | pathstart p = pathstart \<gamma> \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3322 | pathfinish p = pathfinish \<gamma> \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3323 |                     (\<forall>t \<in> {0..1}. norm(\<gamma> t - p t) < e) \<and>
 | 
| 63589 | 3324 | 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 | 3325 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3326 | lemma winding_number: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3327 | assumes "path \<gamma>" "z \<notin> path_image \<gamma>" "0 < e" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3328 | shows "\<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 | 3329 | pathstart p = pathstart \<gamma> \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3330 | pathfinish p = pathfinish \<gamma> \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3331 |                (\<forall>t \<in> {0..1}. norm (\<gamma> t - p t) < e) \<and>
 | 
| 63589 | 3332 | contour_integral p (\<lambda>w. 1/(w - z)) = 2 * pi * \<i> * 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 | 3333 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3334 |   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 | 3335 | using assms by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3336 | then obtain d | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3337 | where d: "d>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3338 | 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 | 3339 |                     (\<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 | 3340 | 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 | 3341 |                       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 | 3342 |                       (\<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 | 3343 |     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 | 3344 | 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 | 3345 |                           (\<forall>t \<in> {0..1}. norm(h t - \<gamma> t) < d/2)"
 | 
| 61808 | 3346 | using path_approx_polynomial_function [OF \<open>path \<gamma>\<close>, of "d/2"] d by auto | 
| 63589 | 3347 | define nn where "nn = 1/(2* pi*\<i>) * contour_integral h (\<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 | 3348 | have "\<exists>n. \<forall>e > 0. \<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 | 3349 | pathstart p = pathstart \<gamma> \<and> pathfinish p = pathfinish \<gamma> \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3350 |                         (\<forall>t \<in> {0..1}. norm(\<gamma> t - p t) < e) \<and>
 | 
| 63589 | 3351 | 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 | 3352 | (is "\<exists>n. \<forall>e > 0. ?PP e n") | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3353 | 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 | 3354 | fix e::real | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3355 | assume e: "e>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3356 | obtain p where p: "polynomial_function p \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3357 |             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 | 3358 | 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 | 3359 |       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 | 3360 | by (auto simp: intro!: holomorphic_intros) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3361 | then show "?PP e nn" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3362 | 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 | 3363 | using pi_eq [of h p] h p d | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3364 | apply (auto simp: valid_path_polynomial_function norm_minus_commute nn_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3365 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3366 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3367 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3368 | unfolding winding_number_def | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3369 | apply (rule someI2_ex) | 
| 61808 | 3370 | apply (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 | 3371 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3372 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3373 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3374 | lemma winding_number_unique: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3375 | 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 | 3376 | and pi: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3377 | "\<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 | 3378 | pathstart p = pathstart \<gamma> \<and> pathfinish p = pathfinish \<gamma> \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3379 |                           (\<forall>t \<in> {0..1}. norm (\<gamma> t - p t) < e) \<and>
 | 
| 63589 | 3380 | 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 | 3381 | 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 | 3382 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3383 |   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 | 3384 | using assms by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3385 | then obtain e | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3386 | where e: "e>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3387 | 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 | 3388 |                     (\<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 | 3389 |                     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 | 3390 | 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 | 3391 |     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 | 3392 | obtain p where p: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3393 | "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 | 3394 | pathstart p = pathstart \<gamma> \<and> pathfinish p = pathfinish \<gamma> \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3395 |       (\<forall>t \<in> {0..1}. norm (\<gamma> t - p t) < e) \<and>
 | 
| 63589 | 3396 | 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 | 3397 | using pi [OF e] by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3398 | obtain q where q: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3399 | "valid_path q \<and> z \<notin> path_image q \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3400 | pathstart q = pathstart \<gamma> \<and> pathfinish q = 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 | 3401 |       (\<forall>t\<in>{0..1}. cmod (\<gamma> t - q t) < e) \<and> contour_integral q (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * 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 | 3402 | 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 | 3403 | 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 | 3404 | using p by 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 | 3405 | also have "... = contour_integral q (\<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 | 3406 | apply (rule pi_eq) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3407 | using p q | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3408 | by (auto simp: valid_path_polynomial_function 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 | 3409 | also have "... = 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 | 3410 | using q by auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3411 | 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 | 3412 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3413 | by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3414 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3415 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3416 | 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 | 3417 | 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 | 3418 | 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 | 3419 | and pi: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3420 | "\<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 | 3421 | 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 | 3422 |                            (\<forall>t \<in> {0..1}. norm (\<gamma> t - p t) < e) \<and>
 | 
| 63589 | 3423 | 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 | 3424 | 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 | 3425 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3426 |   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 | 3427 | using assms by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3428 | then obtain e | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3429 | where e: "e>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3430 | 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 | 3431 |                     (\<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 | 3432 |                     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 | 3433 | 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 | 3434 |     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 | 3435 | obtain p where p: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3436 | "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 | 3437 | 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 | 3438 |       (\<forall>t \<in> {0..1}. norm (\<gamma> t - p t) < e) \<and>
 | 
| 63589 | 3439 | 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 | 3440 | using pi [OF e] by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3441 | obtain q where q: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3442 | "valid_path q \<and> z \<notin> path_image q \<and> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3443 | pathstart q = pathstart \<gamma> \<and> pathfinish q = 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 | 3444 |       (\<forall>t\<in>{0..1}. cmod (\<gamma> t - q t) < e) \<and> contour_integral q (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * 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 | 3445 | 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 | 3446 | 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 | 3447 | using p by 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 | 3448 | also have "... = contour_integral q (\<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 | 3449 | apply (rule pi_eq) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3450 | using p q loop | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3451 | by (auto simp: valid_path_polynomial_function 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 | 3452 | also have "... = 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 | 3453 | using q by auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3454 | 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 | 3455 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3456 | by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3457 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3458 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3459 | lemma winding_number_valid_path: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3460 | assumes "valid_path \<gamma>" "z \<notin> path_image \<gamma>" | 
| 63589 | 3461 | shows "winding_number \<gamma> z = 1/(2*pi*\<i>) * contour_integral \<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 | 3462 | using assms by (auto simp: valid_path_imp_path intro!: winding_number_unique) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3463 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3464 | lemma 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 | 3465 | assumes \<gamma>: "valid_path \<gamma>" "z \<notin> path_image \<gamma>" | 
| 63589 | 3466 | 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 | 3467 | 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 | 3468 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3469 | 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 | 3470 | 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 | 3471 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3472 | 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 | 3473 | 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 | 3474 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3475 | lemma winding_number_join: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3476 | assumes g1: "path g1" "z \<notin> path_image g1" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3477 | and g2: "path g2" "z \<notin> path_image g2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3478 | and "pathfinish g1 = pathstart g2" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3479 | shows "winding_number(g1 +++ g2) z = winding_number g1 z + winding_number g2 z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3480 | apply (rule winding_number_unique) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3481 | using assms apply (simp_all add: not_in_path_image_join) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3482 | apply (frule winding_number [OF g2]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3483 | apply (frule winding_number [OF g1], clarify) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3484 | apply (rename_tac p2 p1) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3485 | apply (rule_tac x="p1+++p2" in 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 | 3486 | apply (simp add: not_in_path_image_join contour_integrable_inversediff algebra_simps) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3487 | apply (auto simp: joinpaths_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3488 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3489 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3490 | lemma winding_number_reversepath: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3491 | 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 | 3492 | shows "winding_number(reversepath \<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 | 3493 | apply (rule winding_number_unique) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3494 | using assms | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3495 | apply simp_all | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3496 | apply (frule winding_number [OF assms], clarify) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3497 | apply (rule_tac x="reversepath p" in 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 | 3498 | apply (simp add: contour_integral_reversepath contour_integrable_inversediff valid_path_imp_reverse) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3499 | apply (auto simp: reversepath_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3500 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3501 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3502 | lemma winding_number_shiftpath: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3503 | 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 | 3504 |       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 | 3505 | shows "winding_number(shiftpath a \<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 | 3506 | apply (rule 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 | using assms | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3508 | apply (simp_all add: path_shiftpath path_image_shiftpath pathfinish_shiftpath pathstart_shiftpath) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3509 | apply (frule winding_number [OF \<gamma>], clarify) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3510 | apply (rule_tac x="shiftpath a p" in 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 | 3511 | apply (simp add: contour_integral_shiftpath path_image_shiftpath pathfinish_shiftpath pathstart_shiftpath valid_path_shiftpath) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3512 | apply (auto simp: shiftpath_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3513 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3514 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3515 | 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 | 3516 | 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 | 3517 | 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 | 3518 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3519 | have "z \<notin> closed_segment a c" "z \<notin> closed_segment c b" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3520 | using assms apply (meson convex_contains_segment convex_segment ends_in_segment(1) subsetCE) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3521 | using assms by (meson convex_contains_segment convex_segment ends_in_segment(2) subsetCE) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3522 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3523 | 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 | 3524 | 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 | 3525 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3526 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3527 | lemma winding_number_cong: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3528 | "(\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> p t = q t) \<Longrightarrow> winding_number p z = winding_number q z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3529 | by (simp add: winding_number_def pathstart_def pathfinish_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3530 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3531 | lemma winding_number_offset: "winding_number p z = winding_number (\<lambda>w. p w - z) 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 | 3532 | apply (simp add: winding_number_def contour_integral_integral path_image_def valid_path_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 | 3533 | apply (intro ext arg_cong [where f = Eps] arg_cong [where f = All] imp_cong refl, safe) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3534 | apply (rename_tac g) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3535 | apply (rule_tac x="\<lambda>t. g t - z" in exI) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3536 | apply (force simp: vector_derivative_def has_vector_derivative_diff_const piecewise_C1_differentiable_diff C1_differentiable_imp_piecewise) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3537 | apply (rename_tac g) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3538 | apply (rule_tac x="\<lambda>t. g t + z" in exI) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3539 | apply (simp add: piecewise_C1_differentiable_add vector_derivative_def has_vector_derivative_add_const C1_differentiable_imp_piecewise) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3540 | apply (force simp: algebra_simps) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3541 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3542 | |
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3543 | subsubsection\<open>Some lemmas about negating a path.\<close> | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3544 | |
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3545 | 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 | 3546 | 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 | 3547 | |
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3548 | lemma has_contour_integral_negatepath: | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3549 | 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 | 3550 | 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 | 3551 | proof - | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3552 |   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 | 3553 | 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 | 3554 |   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 | 3555 | 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 | 3556 | then | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3557 |   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 | 3558 | 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 | 3559 | show "negligible S" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3560 | 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 | 3561 |     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 | 3562 |          - (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 | 3563 |       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 | 3564 | proof - | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3565 | have "vector_derivative (uminus \<circ> \<gamma>) (at x within cbox 0 1) = - vector_derivative \<gamma> (at x within cbox 0 1)" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3566 | apply (rule vector_derivative_within_closed_interval) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3567 | using that | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3568 | apply (auto simp: o_def) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3569 | apply (rule has_vector_derivative_minus) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3570 | by (metis C1_differentiable_on_def diff has_vector_derivative_at_within that vector_derivative_at_within_ivl zero_less_one) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3571 | then show ?thesis | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3572 | by simp | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3573 | qed | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3574 | qed | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3575 | 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 | 3576 | qed | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3577 | |
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3578 | lemma winding_number_negatepath: | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3579 | 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 | 3580 | 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 | 3581 | proof - | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3582 | have "op / 1 contour_integrable_on \<gamma>" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3583 | using "0" \<gamma> contour_integrable_inversediff by fastforce | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3584 | then have "((\<lambda>z. 1/z) has_contour_integral contour_integral \<gamma> (op / 1)) \<gamma>" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3585 | by (rule has_contour_integral_integral) | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3586 | then have "((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> (op / 1)) \<gamma>" | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3587 | 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 | 3588 | then show ?thesis | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3589 | using assms | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3590 | 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 | 3591 | 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 | 3592 | done | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3593 | qed | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3594 | |
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3595 | lemma contour_integrable_negatepath: | 
| 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3596 | 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 | 3597 | 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 | 3598 | 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 | 3599 | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3600 | (* 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 | 3601 | 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 | 3602 | "\<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 | 3603 | 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 | 3604 | \<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 | 3605 | 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 | 3606 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3607 | |
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 3608 | subsubsection\<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 | 3609 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3610 | lemma Re_winding_number: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3611 | "\<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 | 3612 | \<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 | 3613 | 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 | 3614 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3615 | 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 | 3616 | 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 | 3617 | 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 | 3618 | 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 | 3619 | proof - | 
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3620 | 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 | 3621 | using ge by (simp add: Complex.Im_divide algebra_simps x) | 
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3622 | have hi: "((\<lambda>x. 1 / (\<gamma> x - z) * vector_derivative \<gamma> (at x)) has_integral contour_integral \<gamma> (\<lambda>w. 1 / (w - z))) | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3623 | (cbox 0 1)" | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3624 | unfolding box_real | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3625 | apply (subst has_contour_integral [symmetric]) | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3626 | using \<gamma> by (simp add: contour_integrable_inversediff has_contour_integral_integral) | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3627 | have "0 \<le> Im (contour_integral \<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 | 3628 | apply (rule has_integral_component_nonneg | 
| 63589 | 3629 |              [of \<i> "\<lambda>x. if x \<in> {0<..<1}
 | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3630 | then 1/(\<gamma> x - z) * vector_derivative \<gamma> (at x) else 0", simplified]) | 
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3631 | prefer 3 apply (force simp: ge0) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3632 | apply (simp add: Basis_complex_def) | 
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3633 | apply (rule has_integral_spike_interior [OF hi]) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3634 | apply simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3635 | done | 
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3636 | then show ?thesis | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3637 | 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 | 3638 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3639 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3640 | 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 | 3641 | 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 | 3642 | and e: "0 < e" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3643 | 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 | 3644 | 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 | 3645 | proof - | 
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3646 | have hi: "((\<lambda>x. 1 / (\<gamma> x - z) * vector_derivative \<gamma> (at x)) has_integral contour_integral \<gamma> (\<lambda>w. 1 / (w - z))) | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3647 | (cbox 0 1)" | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3648 | unfolding box_real | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3649 | apply (subst has_contour_integral [symmetric]) | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3650 | 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 | 3651 | have "e \<le> Im (contour_integral \<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 | 3652 | apply (rule has_integral_component_le | 
| 63589 | 3653 |              [of \<i> "\<lambda>x. \<i>*e" "\<i>*e" "{0..1}"
 | 
| 3654 |                     "\<lambda>x. if x \<in> {0<..<1} then 1/(\<gamma> x - z) * vector_derivative \<gamma> (at x) else \<i>*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 | 3655 | "contour_integral \<gamma> (\<lambda>w. 1/(w - z))", simplified]) | 
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3656 | using e apply (simp_all add: Basis_complex_def) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3657 | using has_integral_const_real [of _ 0 1] apply force | 
| 66539 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3658 | apply (rule has_integral_spike_interior [OF hi, simplified box_real]) | 
| 
0ad3fc48c9ec
final cleanup of negligible_standard_hyperplane and other things
 paulson <lp15@cam.ac.uk> parents: 
66507diff
changeset | 3659 | apply (simp_all add: ge) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3660 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3661 | with e show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3662 | 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 | 3663 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3664 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3665 | 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 | 3666 | 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 | 3667 | and e: "0 < e" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3668 | 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 | 3669 | 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 | 3670 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3671 | 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 | 3672 | 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 | 3673 | 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 | 3674 | 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 | 3675 |   { 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 | 3676 | 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 | 3677 | 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 | 3678 | 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 | 3679 | 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 | 3680 | 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 | 3681 | 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 | 3682 | 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 | 3683 | 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 | 3684 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3685 | then have "e / B\<^sup>2 \<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 | 3686 | by (simp add: Im_divide_Reals complex_div_cnj [of _ "\<gamma> x - z" for x] del: complex_cnj_diff times_complex.sel) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3687 | } note * = this | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3688 | show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3689 | 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 | 3690 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3691 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3692 | 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 | 3693 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3694 | 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 | 3695 | 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 | 3696 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3697 | lemma exp_fg: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3698 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3699 | 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 | 3700 | 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 | 3701 | 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 | 3702 | 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 | 3703 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3704 | have *: "(exp o (\<lambda>x. (- f x)) has_vector_derivative - (g' / (g x - z)) * exp (- f x)) (at x within s)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3705 | 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 | 3706 | 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 | 3707 | show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3708 | 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 | 3709 | apply (rule bounded_bilinear.has_vector_derivative [OF bounded_bilinear_mult]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3710 | using z | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3711 | apply (auto simp: intro!: derivative_eq_intros * [unfolded o_def] g) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3712 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3713 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3714 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3715 | 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 | 3716 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3717 |   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 | 3718 | 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 | 3719 |       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 | 3720 |     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 | 3721 | (is "?thesis1") | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3722 |           "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 | 3723 | (is "?thesis2") | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3724 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3725 | 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 | 3726 | 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 | 3727 | using z by force | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3728 |   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 | 3729 | 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 | 3730 |   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 | 3731 | using \<gamma> by (force simp: 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 | 3732 |   have o: "open ({a<..<b} - k)"
 | 
| 61808 | 3733 | 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 | 3734 |   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 | 3735 | by force | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3736 |   ultimately have g_diff_at: "\<And>x. \<lbrakk>x \<notin> k; x \<in> {a<..<b}\<rbrakk> \<Longrightarrow> \<gamma> differentiable at x"
 | 
| 63955 | 3737 | 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 | 3738 |   { fix w
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3739 | assume "w \<noteq> z" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3740 | 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 | 3741 | 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 | 3742 | 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 | 3743 | 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 | 3744 | 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 | 3745 |       using holomorphic_convex_primitive [of "ball w (norm(w - z))" "{}" "\<lambda>w. 1/(w - z)"]
 | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 3746 | by (simp add: 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 | 3747 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3748 | 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 | 3749 | by meson | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3750 |   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 | 3751 | unfolding integrable_on_def [symmetric] | 
| 66708 | 3752 | proof (rule contour_integral_local_primitive_any [OF piecewise_C1_imp_differentiable [OF \<gamma>]]) | 
| 3753 | show "\<exists>d h. 0 < d \<and> | |
| 3754 |                (\<forall>y. cmod (y - w) < d \<longrightarrow> (h has_field_derivative inverse (y - z))(at y within - {z}))" 
 | |
| 3755 |           if "w \<in> - {z}" for w
 | |
| 3756 | apply (rule_tac x="norm(w - z)" in exI) | |
| 3757 | using that inverse_eq_divide has_field_derivative_at_within h | |
| 3758 | by (metis Compl_insert DiffD2 insertCI right_minus_eq zero_less_norm_iff) | |
| 3759 | qed simp | |
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3760 |   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 | 3761 | 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 | 3762 | 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 | 3763 | with ab show ?thesis1 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3764 | 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 | 3765 |   { fix t
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3766 |     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 | 3767 | 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 | 3768 | 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 | 3769 | 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 | 3770 | 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 | 3771 | 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 | 3772 |                        (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 | 3773 | 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 | 3774 | 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 | 3775 |     { fix x D
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3776 | 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 | 3777 |       then have "x \<in> interior ({a..b} - k)"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3778 | using open_subset_interior [OF o] by fastforce | 
| 66708 | 3779 | 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 | 3780 | 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 | 3781 |       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 | 3782 | 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 | 3783 | 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 | 3784 | using x by (simp add: g_diff_at) | 
| 66708 | 3785 | have "\<And>d. \<lbrakk>x \<notin> k; a < x; x < b; | 
| 3786 | (\<gamma> has_vector_derivative d) (at x); a \<le> t; t \<le> b\<rbrakk> | |
| 3787 |          \<Longrightarrow> ((\<lambda>x. integral {a..x}
 | |
| 3788 | (\<lambda>x. ?D\<gamma> x / | |
| 3789 | (\<gamma> x - z))) has_vector_derivative | |
| 3790 | d / (\<gamma> x - z)) | |
| 3791 |               (at x within {a..b})"
 | |
| 3792 | apply (rule has_vector_derivative_eq_rhs) | |
| 3793 |          apply (rule integral_has_vector_derivative_continuous_at [where S = "{}", simplified])
 | |
| 3794 | apply (rule con_vd continuous_intros cong vg_int | simp add: continuous_at_imp_continuous_within has_vector_derivative_continuous vector_derivative_at)+ | |
| 3795 | done | |
| 3796 |       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 | 3797 |           (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 | 3798 | using x gdx t | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3799 | apply (clarsimp simp add: differentiable_iff_scaleR) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3800 | apply (rule exp_fg [unfolded has_vector_derivative_def, simplified], blast intro: has_derivative_at_within) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3801 | 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 | 3802 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3803 | } note * = this | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3804 |     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 | 3805 |       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 | 3806 | using t | 
| 66192 
e5b84854baa4
A few renamings and several tidied-up proofs
 paulson <lp15@cam.ac.uk> parents: 
66164diff
changeset | 3807 | 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 | 3808 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3809 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3810 | with ab show ?thesis2 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3811 | 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 | 3812 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3813 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3814 | corollary winding_number_exp_2pi: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3815 | "\<lbrakk>path p; z \<notin> path_image p\<rbrakk> | 
| 63589 | 3816 | \<Longrightarrow> pathfinish p - z = exp (2 * pi * \<i> * winding_number p z) * (pathstart p - z)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3817 | using winding_number [of p z 1] unfolding valid_path_def path_image_def pathstart_def pathfinish_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 | 3818 | 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 | 3819 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3820 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3821 | subsection\<open>The version with complex integers and equality\<close> | 
| 
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 | 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 | 3824 | 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 | 3825 | 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 | 3826 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3827 | have *: "\<And>i::complex. \<And>g0 g1. \<lbrakk>i \<noteq> 0; g0 \<noteq> z; (g1 - z) / i = g0 - z\<rbrakk> \<Longrightarrow> (i = 1 \<longleftrightarrow> g1 = g0)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3828 | by (simp add: field_simps) algebra | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3829 | 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 | 3830 | "pathstart p = pathstart \<gamma>" "pathfinish p = pathfinish \<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 | 3831 | "contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * 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 | 3832 | using winding_number [OF assms, of 1] by auto | 
| 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 | 3833 | have [simp]: "(winding_number \<gamma> z \<in> \<int>) = (exp (contour_integral p (\<lambda>w. 1 / (w - z))) = 1)" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3834 | using p by (simp add: exp_eq_1 complex_is_Int_iff) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3835 | have "winding_number p z \<in> \<int> \<longleftrightarrow> pathfinish p = pathstart p" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3836 | using p z | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3837 | apply (simp add: winding_number_valid_path valid_path_def path_image_def pathstart_def pathfinish_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3838 | using winding_number_exp_integral(2) [of p 0 1 z] | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 3839 | apply (simp add: 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 | 3840 | apply (rule *) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3841 | apply (auto simp: path_image_def field_simps) | 
| 
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 | then show ?thesis using p | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3844 | 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 | 3845 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3846 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3847 | theorem integer_winding_number: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3848 | "\<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 | 3849 | 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 | 3850 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3851 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3852 | 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 | 3853 | 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 | 3854 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3855 | 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 | 3856 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3857 | 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 | 3858 | 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 | 3859 | 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 | 3860 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3861 | 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 | 3862 | 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 | 3863 |   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 | 3864 | 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 | 3865 |   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 | 3866 | using \<gamma> valid_path_def by blast | 
| 63040 | 3867 | 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 | 3868 | 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 | 3869 | using w z by (auto simp: r_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3870 | have "Arg r \<le> 2*pi" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3871 | by (simp add: Arg less_eq_real_def) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3872 |   also have "... \<le> Im (integral {0..1} (\<lambda>x. 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 | 3873 | using 1 | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 3874 | 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 | 3875 | 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 | 3876 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3877 |   finally have "Arg r \<le> Im (integral {0..1} (\<lambda>x. 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 | 3878 |   then have "\<exists>t. t \<in> {0..1} \<and> Im(integral {0..t} (\<lambda>x. vector_derivative \<gamma> (at x)/(\<gamma> x - z))) = Arg r"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3879 | apply (simp add:) | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 3880 | apply (rule IVT') | 
| 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 3881 | apply (simp_all add: Arg_ge_0) | 
| 66192 
e5b84854baa4
A few renamings and several tidied-up proofs
 paulson <lp15@cam.ac.uk> parents: 
66164diff
changeset | 3882 | apply (intro continuous_intros indefinite_integral_continuous_1 winding_number_exp_integral [OF gpd]; simp) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3883 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3884 |   then obtain t where t:     "t \<in> {0..1}"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3885 |                   and eqArg: "Im (integral {0..t} (\<lambda>x. vector_derivative \<gamma> (at x)/(\<gamma> x - z))) = Arg r"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3886 | by blast | 
| 63040 | 3887 |   define i where "i = integral {0..t} (\<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 | 3888 | have iArg: "Arg r = Im i" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3889 | 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 | 3890 |   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 | 3891 | 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 | 3892 | 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 | 3893 | unfolding i_def | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3894 | apply (rule winding_number_exp_integral [OF gpdt]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3895 | using t z unfolding path_image_def | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3896 | apply force+ | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3897 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3898 | 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 | 3899 | 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 | 3900 | 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 | 3901 | 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 | 3902 | then have "z + complex_of_real (exp (Re i)) * (w - z) / complex_of_real (cmod r) = \<gamma> t" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3903 | apply (simp add:) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3904 | apply (subst Complex_Transcendental.Arg_eq [of r]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3905 | apply (simp add: iArg) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3906 | using * | 
| 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 | 3907 | 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 | 3908 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3909 | with t show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3910 | 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 | 3911 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3912 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3913 | 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 | 3914 | fixes z::complex | 
| 61945 | 3915 | 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 | 3916 | 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 | 3917 | 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 | 3918 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3919 |   { 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 | 3920 | 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 | 3921 | 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 | 3922 | 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 | 3923 | 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 | 3924 | 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 | 3925 | by (simp add: z) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3926 | 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 | 3927 | 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 | 3928 | then have ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3929 | by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3930 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3931 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3932 | using assms | 
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 3933 | 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 | 3934 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3935 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3936 | 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 | 3937 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3938 | shows | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3939 | "\<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 | 3940 | \<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 | 3941 | \<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 | 3942 | 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 | 3943 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3944 | 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 | 3945 | 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 | 3946 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3947 | 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 | 3948 | 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 | 3949 | 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 | 3950 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3951 | 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 | 3952 | 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 | 3953 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3954 | 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 | 3955 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3956 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3957 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3958 | subsection\<open>Continuity of winding number and invariance on connected sets.\<close> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3959 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3960 | 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 | 3961 | fixes z::complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3962 | 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 | 3963 | 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 | 3964 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3965 | 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 | 3966 | 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 | 3967 | 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 | 3968 | 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 | 3969 | 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 | 3970 | 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 | 3971 | 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 | 3972 | 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 | 3973 | "\<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 | 3974 |               (\<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 | 3975 | 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 | 3976 | \<Longrightarrow> | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3977 | 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 | 3978 | 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 | 3979 | (\<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 | 3980 | 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 | 3981 | 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 | 3982 | "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 | 3983 |               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 | 3984 | and pi: "contour_integral p (\<lambda>x. 1 / (x - z)) = complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z" | 
| 61808 | 3985 | using winding_number [OF \<gamma> z, of "min d e / 2"] \<open>d>0\<close> \<open>e>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 | 3986 |   { fix w
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3987 | 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 | 3988 | then have wnotp: "w \<notin> path_image p" | 
| 61808 | 3989 | 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 | 3990 | 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 | 3991 | apply (frule pg) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3992 | 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 | 3993 | 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 | 3994 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3995 | have wnotg: "w \<notin> path_image \<gamma>" | 
| 61808 | 3996 | 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 | 3997 |     { fix k::real
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3998 | assume k: "k>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 3999 | 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 | 4000 | "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 | 4001 |                     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 | 4002 | and qi: "contour_integral q (\<lambda>u. 1 / (u - w)) = complex_of_real (2 * pi) * \<i> * winding_number \<gamma> w" | 
| 61808 | 4003 | using winding_number [OF \<gamma> wnotg, of "min k (min d e) / 2"] \<open>d>0\<close> \<open>e>0\<close> k | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4004 | by (force simp: min_divide_distrib_right) | 
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4005 | have "contour_integral p (\<lambda>u. 1 / (u - w)) = contour_integral q (\<lambda>u. 1 / (u - w))" | 
| 61808 | 4006 | 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 | 4007 | apply (frule pg) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4008 | apply (frule qg) | 
| 61808 | 4009 | 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 | 4010 | 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 | 4011 | 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 | 4012 | 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 | 4013 | 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 | 4014 | } note pip = this | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4015 | have "path p" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4016 | 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 | 4017 | 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 | 4018 | 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 | 4019 | 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 | 4020 | apply (simp add: p wnotp min_divide_distrib_right pip) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4021 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4022 | } note wnwn = this | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4023 | 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 | 4024 | 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 | 4025 | 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 | 4026 | obtain L | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4027 | where "L>0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4028 | 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 | 4029 | \<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 | 4030 | cmod (contour_integral p f) \<le> L * B" | 
| 61808 | 4031 | 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 | 4032 |   { 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 | 4033 | 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 | 4034 | then have [simp]: "w \<notin> path_image p" | 
| 61808 | 4035 | 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 | 4036 | 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 | 4037 | 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 | 4038 | 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 | 4039 | 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 | 4040 |     { fix x
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4041 | 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 | 4042 | 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 | 4043 | 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 | 4044 | 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 | 4045 | 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 | 4046 | using norm_diff_triangle_le by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4047 | also have "... < pe/4 + cmod (w - x)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4048 | 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 | 4049 | 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 | 4050 | using pe by auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4051 | 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 | 4052 | apply (rule power_strict_mono) | 
| 61808 | 4053 | 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 | 4054 | 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 | 4055 | 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 | 4056 | have "8 * L * cmod (w - z) < e * pe\<^sup>2" | 
| 61808 | 4057 | using w \<open>L>0\<close> by (simp add: field_simps) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4058 | also have "... < e * 4 * cmod (w - x) * cmod (w - x)" | 
| 61808 | 4059 | using pe2 \<open>e>0\<close> by (simp add: power2_eq_square) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4060 | also have "... < e * 4 * cmod (w - x) * (4/3 * cmod (z - x))" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4061 | using wx | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4062 | 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 | 4063 | 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 | 4064 | 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 | 4065 | by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4066 | also have "... \<le> 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 | 4067 | using e by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4068 | 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 | 4069 | 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 | 4070 | apply (cases "x=z \<or> x=w") | 
| 61808 | 4071 | 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 | 4072 | apply (force simp: norm_minus_commute) | 
| 61808 | 4073 | 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 | 4074 | 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 | 4075 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4076 | } 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 | 4077 | 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 | 4078 | apply (rule L) | 
| 61808 | 4079 | 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 | 4080 | apply (force simp: dist_norm norm_minus_commute intro!: holomorphic_intros) | 
| 61808 | 4081 | 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 | 4082 | 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 | 4083 | 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 | 4084 | have "cmod (contour_integral p (\<lambda>x. 1 / (x - w)) - contour_integral p (\<lambda>x. 1 / (x - z))) < 2*e" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4085 | apply (simp add:) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4086 | apply (rule le_less_trans [OF *]) | 
| 61808 | 4087 | 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 | 4088 | 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 | 4089 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4090 | 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 | 4091 | 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 | 4092 | 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 | 4093 | } note cmod_wn_diff = this | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4094 | 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 | 4095 | 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 | 4096 | apply (rule_tac x="min (pe/4) (e/2*pe^2/L/4)" in exI) | 
| 61808 | 4097 | 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 | 4098 | 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 | 4099 | done | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4100 | then show ?thesis | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4101 | apply (rule continuous_transform_within [where d = "min d e / 2"]) | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4102 | 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 | 4103 | done | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4104 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4105 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4106 | 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 | 4107 | "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 | 4108 | 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 | 4109 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4110 | |
| 61808 | 4111 | subsection\<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 | 4112 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4113 | lemma winding_number_constant: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4114 |   assumes \<gamma>: "path \<gamma>" and loop: "pathfinish \<gamma> = pathstart \<gamma>" and cs: "connected s" and sg: "s \<inter> path_image \<gamma> = {}"
 | 
| 65037 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4115 | obtains k where "\<And>z. z \<in> s \<Longrightarrow> winding_number \<gamma> z = k" | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4116 | proof - | 
| 65037 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4117 | have *: "1 \<le> cmod (winding_number \<gamma> y - winding_number \<gamma> z)" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4118 | if ne: "winding_number \<gamma> y \<noteq> winding_number \<gamma> z" and "y \<in> s" "z \<in> s" for y z | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4119 | proof - | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4120 | have "winding_number \<gamma> y \<in> \<int>" "winding_number \<gamma> z \<in> \<int>" | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4121 | using that integer_winding_number [OF \<gamma> loop] sg \<open>y \<in> s\<close> by auto | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4122 | with ne show ?thesis | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4123 | by (auto simp: Ints_def of_int_diff [symmetric] simp del: of_int_diff) | 
| 65037 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4124 | qed | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4125 | 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 | 4126 | 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 | 4127 | 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 | 4128 | show ?thesis | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4129 | apply (rule continuous_discrete_range_constant [OF cs cont]) | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4130 | using "*" zero_less_one apply blast | 
| 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4131 | by (simp add: that) | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4132 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4133 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4134 | lemma winding_number_eq: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4135 |      "\<lbrakk>path \<gamma>; pathfinish \<gamma> = pathstart \<gamma>; w \<in> s; z \<in> s; connected s; s \<inter> path_image \<gamma> = {}\<rbrakk>
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4136 | \<Longrightarrow> winding_number \<gamma> w = winding_number \<gamma> z" | 
| 65037 
2cf841ff23be
some new material, also recasting some theorems using “obtains”
 paulson <lp15@cam.ac.uk> parents: 
65036diff
changeset | 4137 | using winding_number_constant by blast | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4138 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4139 | 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 | 4140 | 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 | 4141 |     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 | 4142 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4143 | have op: "open (- path_image \<gamma>)" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4144 | 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 | 4145 |   { 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 | 4146 | obtain e where e: "e>0" "ball 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 | 4147 | using open_contains_ball [of "- path_image \<gamma>"] op z | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4148 | by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4149 | 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 | 4150 | 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 | 4151 | using e apply (simp add: dist_norm ball_def norm_minus_commute) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4152 | apply (auto simp: dist_norm norm_minus_commute intro!: winding_number_eq [OF assms, where s = "ball z e"]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4153 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4154 | } then | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4155 | show ?thesis | 
| 62101 | 4156 | 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 | 4157 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4158 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4159 | 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 | 4160 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4161 | lemma 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 | 4162 | 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 | 4163 | 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 | 4164 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4165 | 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 | 4166 | 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 | 4167 | 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 | 4168 | 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 | 4169 | 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 | 4170 | 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 | 4171 | 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 | 4172 | 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 | 4173 | using w by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4174 | moreover obtain k where "\<And>z. z \<in> outside (path_image \<gamma>) \<Longrightarrow> 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 | 4175 | 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 | 4176 | 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 | 4177 | ultimately have "winding_number \<gamma> z = winding_number \<gamma> w" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4178 | using z by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4179 | also have "... = 0" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4180 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4181 | 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 | 4182 |     { 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 | 4183 | 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 | 4184 | 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 | 4185 | and pge: "(\<And>t. \<lbrakk>0 \<le> t; t \<le> 1\<rbrakk> \<Longrightarrow> cmod (p t - \<gamma> t) < e)" | 
| 61808 | 4186 | 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 | 4187 | 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 | 4188 | using B | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4189 | 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 | 4190 | apply (frule (1) pg1) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4191 | 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 | 4192 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4193 | 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 | 4194 | 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 | 4195 | 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 | 4196 |                      (\<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 | 4197 | 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 | 4198 | 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 | 4199 | apply (intro conjI) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4200 | 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 | 4201 | 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 | 4202 | 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 | 4203 | 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 | 4204 | 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 | 4205 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4206 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4207 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4208 | by (auto intro: winding_number_unique [OF \<gamma>] simp add: wnot) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4209 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4210 | finally show ?thesis . | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4211 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4212 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4213 | lemma winding_number_zero_outside: | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4214 | "\<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 | 4215 | 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 | 4216 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4217 | 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 | 4218 | 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 | 4219 | 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 | 4220 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4221 | 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 | 4222 | 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 | 4223 | then show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4224 | 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 | 4225 | 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 | 4226 | 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 | 4227 | 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 | 4228 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4229 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4230 | 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 | 4231 | "\<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 | 4232 | \<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 | 4233 | 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 | 4234 | 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 | 4235 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4236 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4237 | 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 | 4238 | 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 | 4239 | 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 | 4240 |       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 | 4241 | 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 | 4242 | 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 | 4243 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4244 | 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 | 4245 | proof | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4246 | fix x :: complex | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4247 | assume "x \<in> s" | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4248 | 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 | 4249 | 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 | 4250 | thus "x \<in> inside (path_image \<gamma>)" | 
| 61808 | 4251 | 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 | 4252 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4253 | show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4254 | 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 | 4255 | using z apply blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4256 | 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 | 4257 | 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 | 4258 | 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 | 4259 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4260 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4261 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4262 | 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 | 4263 | 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 | 4264 | 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 | 4265 |     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 | 4266 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4267 |   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 | 4268 | 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 | 4269 | 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 | 4270 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4271 |     have "integral {0..x} (\<lambda>t. vector_derivative \<gamma> (at t) / (\<gamma> t - z)) / (2 * of_real pi * \<i>) =
 | 
| 63589 | 4272 | 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 | 4273 | 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 | 4274 | 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 | 4275 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4276 | also have "... = 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 | 4277 | 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 | 4278 | 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 | 4279 | 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 | 4280 | 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 | 4281 | finally show ?thesis . | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4282 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4283 | show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4284 | apply (rule continuous_on_eq | 
| 63589 | 4285 | [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 | 4286 |                                  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 | 4287 | apply (rule continuous_intros)+ | 
| 66192 
e5b84854baa4
A few renamings and several tidied-up proofs
 paulson <lp15@cam.ac.uk> parents: 
66164diff
changeset | 4288 | 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 | 4289 | 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 | 4290 | using assms | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4291 | apply (simp add: *) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4292 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4293 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4294 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4295 | 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 | 4296 | 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 | 4297 |       shows "\<exists>t \<in> {0..1}. Re(winding_number(subpath 0 t \<gamma>) z) = w"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4298 | apply (rule ivt_increasing_component_on_1 [of 0 1, where ?k = "1::complex", simplified complex_inner_1_right]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4299 | apply (simp add:) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4300 | 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 | 4301 | using assms | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4302 | 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 | 4303 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4304 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4305 | 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 | 4306 | 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 | 4307 |       shows "\<exists>t \<in> {0..1}. Re(winding_number(subpath 0 t \<gamma>) z) = w"
 | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4308 | apply (rule ivt_decreasing_component_on_1 [of 0 1, where ?k = "1::complex", simplified complex_inner_1_right]) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4309 | apply (simp add:) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4310 | 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 | 4311 | using assms | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4312 | 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 | 4313 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4314 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4315 | 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 | 4316 | 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 | 4317 |       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 | 4318 | 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 | 4319 | by force | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4320 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4321 | 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 | 4322 |   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 | 4323 | 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 | 4324 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4325 |   { 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 | 4326 | 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 | 4327 | 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 | 4328 | 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 | 4329 | 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 | 4330 | 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 | 4331 | 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 | 4332 | 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 | 4333 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4334 |       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 | 4335 | 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 | 4336 | thus ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4337 | by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4338 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4339 | 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 | 4340 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4341 |       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 | 4342 | 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 | 4343 | thus ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4344 | by blast | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4345 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4346 | 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 | 4347 | 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 | 4348 | then have False | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4349 | 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 | 4350 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4351 | 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 | 4352 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4353 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4354 | 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 | 4355 |   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 | 4356 | 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 | 4357 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4358 | 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 | 4359 | with assms show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4360 | 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 | 4361 | 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 | 4362 | 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 | 4363 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4364 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4365 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4366 | 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 | 4367 | 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 | 4368 |       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 | 4369 | 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 | 4370 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4371 |   { 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 | 4372 | 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 | 4373 | by (metis continuous_at_winding_number valid_path_imp_path \<gamma> z) | 
| 61945 | 4374 | 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 | 4375 | using continuous_at_eps_delta wnz_12 diff_gt_0_iff_gt by blast | 
| 63040 | 4376 | 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 | 4377 | 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 | 4378 | 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 | 4379 | apply (simp add: divide_simps algebra_simps dot_square_norm power2_eq_square anz) | 
| 61808 | 4380 | 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 | 4381 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4382 | have "cmod (winding_number \<gamma> z' - winding_number \<gamma> z) < \<bar>Re (winding_number \<gamma> z)\<bar> - 1/2" | 
| 61808 | 4383 | 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 | 4384 | 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 | 4385 | by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4386 | 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 | 4387 | 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 | 4388 | 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 | 4389 | by linarith | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4390 | 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 | 4391 | apply (rule winding_number_lt_half [OF \<gamma> *]) | 
| 61808 | 4392 | 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 | 4393 | 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 | 4394 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4395 | ultimately have False | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4396 | by simp | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4397 | } | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4398 | 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 | 4399 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4400 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4401 | 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 | 4402 | 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 | 4403 | apply auto | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4404 | 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 | 4405 | 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 | 4406 | 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 | 4407 | apply (auto simp: segment) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4408 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4409 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4410 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4411 | 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 | 4412 | 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 | 4413 | 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 | 4414 | 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 | 4415 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4416 | 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 | 4417 | using assms | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4418 | 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 | 4419 | show ?thesis | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4420 | 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 | 4421 | 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 | 4422 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4423 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4424 | |
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4425 | |
| 61808 | 4426 | 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 | 4427 | |
| 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 | 4428 | 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 | 4429 | 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 | 4430 | 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 | 4431 | 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 | 4432 |         and pasz: "path_image \<gamma> \<subseteq> s - {z}" and loop: "pathfinish \<gamma> = pathstart \<gamma>"
 | 
| 63589 | 4433 | 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 | 4434 | proof - | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4435 | 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 | 4436 | 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 | 4437 | 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 | 4438 | 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 | 4439 | proof (cases "x = z") | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4440 | 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 | 4441 | 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 | 4442 | apply (rule Lim_transform_away_within [of _ "z+1" _ "\<lambda>w::complex. (f w - f z)/(w - z)"]) | 
| 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 | 4443 | using has_field_derivative_at_within DERIV_within_iff f' | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4444 | apply (fastforce simp add:)+ | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4445 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4446 | next | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4447 | case False | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4448 | 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 | 4449 | 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 | 4450 | using conf continuous_on_eq_continuous_within that by blast | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4451 | 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 | 4452 | by (rule cf continuous_intros | simp add: False)+ | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4453 | then show ?thesis | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4454 | 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 | 4455 | apply (force simp: dist_commute) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 4456 | done | 
| 61520 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4457 | qed | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4458 | 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 | 4459 | 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 | 4460 | 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 | 4461 | 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 | 4462 | 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 | 4463 | 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 | 4464 | 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 | 4465 | apply (metis less_irrefl) | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4466 | 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 | 4467 | done | 
| 
8f85bb443d33
Cauchy's integral formula, required lemmas, and a bit of reorganisation
 paulson <lp15@cam.ac.uk> parents: 
61518diff
changeset | 4468 | 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 | 4469 | 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 | 4470 | 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 | 4471 | 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 | 4472 | 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 | 4473 | 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 | 4474 | |
| 
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 | 4475 | 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 | 4476 |     "\<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 | 4477 | pathfinish \<gamma> = pathstart \<gamma>\<rbrakk> | 
| 63589 | 4478 | \<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 | 4479 |   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 | 4480 | 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 | 4481 | 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 | 4482 | |
| 61738 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4483 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4484 | 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 | 4485 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4486 | proposition Cauchy_theorem_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 | 4487 | 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 | 4488 | 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 | 4489 | 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 | 4490 | 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 | 4491 | 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 | 4492 | 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 | 4493 | 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 | 4494 | 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 | 4495 |     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 | 4496 |       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 | 4497 | 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 | 4498 |       and ksf: "\<forall>t\<in>{0..1}. linked_paths atends g (\<lambda>x. k (t, x))"
 | 
| 62390 | 4499 | 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 | 4500 |   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 | 4501 | 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 | 4502 |   { fix t::real assume t: "t \<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 | 4503 | have pak: "path (k o (\<lambda>u. (t, 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 | 4504 | 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 | 4505 | 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 | 4506 | 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 | 4507 | 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 | 4508 | 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 | 4509 | 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 | 4510 | "\<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 | 4511 |                   \<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 | 4512 | 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 | 4513 | \<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 | 4514 | 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 | 4515 | 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 | 4516 |         "\<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 | 4517 | 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 | 4518 |     { 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 | 4519 | 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 | 4520 | 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 | 4521 | 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 | 4522 | 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 | 4523 | 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 | 4524 | 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 | 4525 | 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 | 4526 |                           (\<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 | 4527 | 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 | 4528 | 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 | 4529 | 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 | 4530 | 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 | 4531 | 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 | 4532 | 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 | 4533 | } | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4534 | then have "\<exists>e. 0 < e \<and> | 
| 61945 | 4535 |               (\<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 | 4536 | \<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 | 4537 | (\<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 | 4538 |                        (\<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 | 4539 | 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 | 4540 | 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 | 4541 | \<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 | 4542 | 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 | 4543 | } | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4544 | 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 | 4545 |        "\<And>t. t \<in> {0..1} \<Longrightarrow> ee t > 0 \<and>
 | 
| 61945 | 4546 |           (\<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 | 4547 | \<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 | 4548 | (\<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 | 4549 |                    (\<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 | 4550 | 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 | 4551 | 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 | 4552 | \<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 | 4553 | 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 | 4554 | note ee_rule = ee [THEN conjunct2, rule_format] | 
| 63040 | 4555 |   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 | 4556 |   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 | 4557 | proof (rule compactE [OF compact_interval]) | 
| 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 paulson <lp15@cam.ac.uk> parents: 
64394diff
changeset | 4558 |     show "{0..1} \<subseteq> \<Union>C"
 | 
| 
3b33d2fc5fc0
A few new lemmas and needed adaptations
 paulson <lp15@cam.ac.uk> parents: 
64394diff
changeset | 4559 | 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 | 4560 | qed (use C_def in auto) | 
| 63040 | 4561 |   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 | 4562 |   have kk01: "kk \<subseteq> {0..1}" by (auto simp: kk_def)
 | 
| 63040 | 4563 | 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 | 4564 | 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 | 4565 | 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 | 4566 |   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 | 4567 | 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 | 4568 | 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 | 4569 | 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 | 4570 |   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 | 4571 | 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 | 4572 | 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 | 4573 | 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 | 4574 | 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 | 4575 | 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 | 4576 | 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 | 4577 |   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 | 4578 | 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 | 4579 | 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 | 4580 |       "\<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 | 4581 | \<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 | 4582 | 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 | 4583 | 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 | 4584 | 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 | 4585 | 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 | 4586 | 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 | 4587 | 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 | 4588 | 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 | 4589 | 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 | 4590 | 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 | 4591 |     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 | 4592 | 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 | 4593 | 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 | 4594 | 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 | 4595 | 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 | 4596 | 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 | 4597 | 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 | 4598 | by (simp add: dist_norm add_divide_distrib abs_diff_less_iff del: less_divide_eq_numeral1) (simp add: field_simps) | 
| 61808 | 4599 |     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 | 4600 | 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 | 4601 | "\<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 | 4602 |                    \<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 | 4603 | 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 | 4604 | \<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 | 4605 | 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 | 4606 | 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 | 4607 | 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 | 4608 | 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 | 4609 |       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 | 4610 | \<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 | 4611 | 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 | 4612 |     have "continuous_on {0..1} (k o (\<lambda>u. (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 | 4613 | 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 | 4614 | 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 | 4615 | 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 | 4616 | by (simp add: path_def) | 
| 61808 | 4617 | 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 | 4618 | 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 | 4619 | 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 | 4620 | "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 | 4621 |         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 | 4622 | 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 | 4623 | 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 | 4624 | 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 | 4625 | 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 | 4626 | show ?case | 
| 
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 | apply (rule_tac x="min d1 d2" in exI) | 
| 61808 | 4628 | apply (simp add: \<open>0 < d1\<close> \<open>0 < d2\<close>, 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 | 4629 | apply (rule_tac s="contour_integral p f" in 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 | 4630 | using pk_le N01(1) ksf pathfinish_def pathstart_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 | 4631 | apply (force intro!: vpp d1 simp add: linked_paths_def psf ksf) | 
| 
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 | using pk_le N01 apply (force intro!: vpp d2 lpa simp add: linked_paths_def psf ksf) | 
| 
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 | 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 | 4634 | 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 | 4635 | then obtain d where "0 < 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 | 4636 |                        "\<And>j. valid_path j \<and> (\<forall>u \<in> {0..1}. norm(j u - k (1,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 | 4637 | 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 | 4638 | \<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 | 4639 | 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 | 4640 | 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 | 4641 | 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 | 4642 | 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 | 4643 | 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 | 4644 | 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 | 4645 | |
| 
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 | 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 | 4647 | 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 | 4648 | 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 | 4649 | 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 | 4650 | 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 | 4651 | 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 | 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 | 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 | 4654 | 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 | 4655 | 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 | 4656 | 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 | 4657 | 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 | 4658 | 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 | 4659 | |
| 
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 | 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 | 4661 | "\<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 | 4662 | \<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 | 4663 | 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 | 4664 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4665 | 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 | 4666 | "\<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 | 4667 | 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 | 4668 | 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 | 4669 | 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 | 4670 | 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 | 4671 | |
| 
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 | |
| 
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 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4674 | subsection\<open>More winding number properties\<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 | 4675 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4676 | 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 | 4677 | |
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4678 | 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 | 4679 |     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 | 4680 | 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 | 4681 | 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 | 4682 | 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 | 4683 | 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 | 4684 | 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 | 4685 | 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 | 4686 |       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 | 4687 |             \<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 | 4688 |       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 | 4689 |             \<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 | 4690 |     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 | 4691 | 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 | 4692 | "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 | 4693 | "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 | 4694 |        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 | 4695 | and pap: "contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * 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 | 4696 | using winding_number [OF \<open>path g\<close> pag \<open>0 < d\<close>] 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 | 4697 | 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 | 4698 | "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 | 4699 | "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 | 4700 |        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 | 4701 | and paq: "contour_integral q (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * 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 | 4702 | using winding_number [OF \<open>path h\<close> pah \<open>0 < e\<close>] 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 | 4703 |   have gp: "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 | 4704 | by (simp add: d p valid_path_imp_path norm_minus_commute gp_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 | 4705 |   have hq: "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 | 4706 | by (simp add: e q valid_path_imp_path norm_minus_commute hq_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 | 4707 | have "contour_integral p (\<lambda>w. 1/(w - z)) = contour_integral q (\<lambda>w. 1/(w - 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 | 4708 |     apply (rule Cauchy_theorem_homotopic_paths [of "-{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 | 4709 | apply (blast intro: homotopic_paths_trans homotopic_paths_sym gp hq assms) | 
| 
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 | apply (auto intro!: holomorphic_intros simp: p 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 | 4711 | 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 | 4712 | 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 | 4713 | 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 | 4714 | 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 | 4715 | |
| 
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 | 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 | 4717 |     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 | 4718 | 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 | 4719 | 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 | 4720 | 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 | 4721 | 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 | 4722 | 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 | 4723 | 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 | 4724 | 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 | 4725 | 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 | 4726 |       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 | 4727 |             \<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 | 4728 |       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 | 4729 |             \<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 | 4730 |     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 | 4731 | 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 | 4732 | "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 | 4733 | "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 | 4734 |        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 | 4735 | and pap: "contour_integral p (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * 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 | 4736 | using winding_number [OF \<open>path g\<close> pag \<open>0 < d\<close>] 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 | 4737 | 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 | 4738 | "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 | 4739 | "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 | 4740 |        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 | 4741 | and paq: "contour_integral q (\<lambda>w. 1 / (w - z)) = complex_of_real (2 * pi) * \<i> * 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 | 4742 | using winding_number [OF \<open>path h\<close> pah \<open>0 < e\<close>] 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 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 | 4744 | 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 | 4745 |   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 | 4746 | 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 | 4747 | have "contour_integral p (\<lambda>w. 1/(w - z)) = contour_integral q (\<lambda>w. 1/(w - 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 | 4748 |     apply (rule Cauchy_theorem_homotopic_loops [of "-{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 | 4749 | apply (blast intro: homotopic_loops_trans homotopic_loops_sym gp hq assms) | 
| 
c4f6031f1310
New material about paths, winding numbers, etc. Added lemmas to divide_const_simps. Misc tuning.
 paulson <lp15@cam.ac.uk> parents: 
61711diff
changeset | 4750 | apply (auto intro!: holomorphic_intros simp: p 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 | 4751 | 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 | 4752 | 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 | 4753 | 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 | 4754 | 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 | 4755 | |
| 
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 | 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 | 4757 | "\<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 | 4758 |     \<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 | 4759 | \<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 | 4760 | by (blast intro: sym homotopic_paths_linear winding_number_homotopic_paths elim: ) | 
| 
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 | |
| 
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 | 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 | 4763 | "\<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 | 4764 |     \<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 | 4765 | \<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 | 4766 | by (blast intro: sym homotopic_loops_linear winding_number_homotopic_loops elim: ) | 
| 
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 | |
| 
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 | lemma winding_number_nearby_paths_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 | 4769 | "\<lbrakk>path g; 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 | 4770 | 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 | 4771 |       \<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 | 4772 | \<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 | 4773 | 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 | 4774 | |
| 
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 | lemma winding_number_nearby_loops_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 | 4776 | "\<lbrakk>path g; 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 | 4777 | pathfinish g = pathstart 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 | 4778 | 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 | 4779 |       \<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 | 4780 | \<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 | 4781 | 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 | 4782 | |
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4783 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4784 | proposition winding_number_subpath_combine: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4785 | "\<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 | 4786 |       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 | 4787 | \<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 | 4788 | 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 | 4789 | 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 | 4790 | winding_number_homotopic_paths [OF homotopic_join_subpaths]]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4791 | apply (auto dest: path_image_subpath_subset) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4792 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4793 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4794 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4795 | 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 | 4796 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4797 | definition part_circlepath :: "[complex, real, real, real, real] \<Rightarrow> complex" | 
| 63589 | 4798 | 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 | 4799 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4800 | lemma pathstart_part_circlepath [simp]: | 
| 63589 | 4801 | "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 | 4802 | 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 | 4803 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4804 | lemma pathfinish_part_circlepath [simp]: | 
| 63589 | 4805 | "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 | 4806 | 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 | 4807 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4808 | proposition has_vector_derivative_part_circlepath [derivative_intros]: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4809 | "((part_circlepath z r s t) has_vector_derivative | 
| 63589 | 4810 | (\<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 | 4811 | (at x within X)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4812 | 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 | 4813 | 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 | 4814 | 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 | 4815 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4816 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4817 | corollary vector_derivative_part_circlepath: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4818 | "vector_derivative (part_circlepath z r s t) (at x) = | 
| 63589 | 4819 | \<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 | 4820 | 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 | 4821 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4822 | corollary vector_derivative_part_circlepath01: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4823 | "\<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 | 4824 |      \<Longrightarrow> vector_derivative (part_circlepath z r s t) (at x within {0..1}) =
 | 
| 63589 | 4825 | \<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 | 4826 | 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 | 4827 | 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 | 4828 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4829 | 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 | 4830 | 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 | 4831 | 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 | 4832 | 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 | 4833 | intro!: continuous_intros) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4834 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4835 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4836 | 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 | 4837 | 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 | 4838 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4839 | 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 | 4840 | assumes "s \<le> t" | 
| 63589 | 4841 |     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 | 4842 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4843 |   { fix z::real
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4844 | 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 | 4845 | 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 | 4846 | 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 | 4847 | 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 | 4848 | apply (rule conjI) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4849 | 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 | 4850 | 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 | 4851 | } | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4852 | moreover | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4853 |   { fix z
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4854 | 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 | 4855 |     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 | 4856 | 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 | 4857 | 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 | 4858 | 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 | 4859 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4860 | } | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4861 | ultimately show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4862 | 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 | 4863 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4864 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4865 | corollary path_image_part_circlepath_subset: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4866 | "\<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 | 4867 | 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 | 4868 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4869 | proposition in_path_image_part_circlepath: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4870 | 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 | 4871 | 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 | 4872 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4873 |   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 | 4874 | 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 | 4875 | thus ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4876 | 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 | 4877 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4878 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4879 | proposition finite_bounded_log: "finite {z::complex. norm z \<le> b \<and> exp z = w}"
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4880 | proof (cases "w = 0") | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4881 | 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 | 4882 | next | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4883 | case False | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4884 |   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 | 4885 | apply (simp add: norm_mult finite_int_iff_bounded_le) | 
| 61942 | 4886 | 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 | 4887 | 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 | 4888 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4889 |   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 | 4890 | by blast | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4891 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4892 | 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 | 4893 | 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 | 4894 | 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 | 4895 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4896 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4897 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4898 | lemma finite_bounded_log2: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4899 | fixes a::complex | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4900 | assumes "a \<noteq> 0" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4901 |     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 | 4902 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4903 |   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 | 4904 | 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 | 4905 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4906 | 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 | 4907 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4908 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4909 | proposition 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 | 4910 | 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 | 4911 | 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 | 4912 | 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 | 4913 | 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 | 4914 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4915 | 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 | 4916 | then show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4917 | proof cases | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4918 | 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 | 4919 | 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 | 4920 | 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 | 4921 | next | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4922 | case 2 | 
| 61945 | 4923 | 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 | 4924 | 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 | 4925 | 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 | 4926 |     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 | 4927 | proof - | 
| 63589 | 4928 | 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 | 4929 |       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 | 4930 | 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 | 4931 | 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 | 4932 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4933 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4934 | 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 | 4935 | 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 | 4936 | using le | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4937 | 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 | 4938 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4939 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4940 |     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 | 4941 | 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 | 4942 | 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 | 4943 | 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 | 4944 |                        vector_derivative (part_circlepath z r s t) (at x)) has_integral i)  {0..1}"
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4945 | apply (rule has_integral_spike | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4946 | [where f = "\<lambda>x. f(part_circlepath z r s t x) * vector_derivative (part_circlepath z r s t) (at x)"]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4947 | apply (rule negligible_finite [OF fin01]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4948 | using fi has_contour_integral | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4949 | apply auto | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4950 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4951 | 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 | 4952 | 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 | 4953 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4954 | 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 | 4955 | using assms apply force | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4956 | 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 | 4957 | 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 | 4958 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4959 | qed | 
| 
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 | corollary has_contour_integral_bound_part_circlepath: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4962 | "\<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 | 4963 | 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 | 4964 | \<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 | 4965 | \<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 | 4966 | 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 | 4967 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4968 | proposition 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 | 4969 | "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 | 4970 | \<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 | 4971 | 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 | 4972 | 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 | 4973 | 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 | 4974 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4975 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4976 | 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 | 4977 | 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 | 4978 | 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 | 4979 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4980 | 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 | 4981 | 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 | 4982 | 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 | 4983 | 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 | 4984 | 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 | 4985 | 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 | 4986 | ultimately show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4987 | 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 | 4988 | 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 | 4989 | 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 | 4990 | 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 | 4991 | 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 | 4992 | 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 | 4993 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4994 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4995 | proposition simple_path_part_circlepath: | 
| 61945 | 4996 | "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 | 4997 | 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 | 4998 | case True | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 4999 | then show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5000 | apply (rule disjE) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5001 | apply (force simp: part_circlepath_def simple_path_def intro: bexI [where x = "1/4"] bexI [where x = "1/3"])+ | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5002 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5003 | next | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5004 | case False then have "r \<noteq> 0" "s \<noteq> t" by auto | 
| 63589 | 5005 | 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 | 5006 | 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 | 5007 | have abs01: "\<And>x y::real. 0 \<le> x \<and> x \<le> 1 \<and> 0 \<le> y \<and> y \<le> 1 | 
| 61945 | 5008 |                       \<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 | 5009 | by auto | 
| 61945 | 5010 |   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)"
 | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5011 | by force | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5012 | 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 | 5013 | (\<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 | 5014 | 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 | 5015 | intro: exI [where x = "-n" for n]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5016 | have 1: "\<forall>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 \<Longrightarrow> \<bar>s - t\<bar> \<le> 2 * pi" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5017 | apply (rule ccontr) | 
| 61945 | 5018 | apply (drule_tac x="2*pi / \<bar>t - s\<bar>" in spec) | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5019 | using False | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5020 | apply (simp add: abs_minus_commute divide_simps) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5021 | apply (frule_tac x=1 in spec) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5022 | apply (drule_tac x="-1" in spec) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5023 | apply (simp add:) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5024 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5025 | 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 | 5026 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5027 | 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 | 5028 | 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 | 5029 | 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 | 5030 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5031 | show ?thesis using False | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5032 | apply (simp add: simple_path_def path_part_circlepath) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5033 | 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 | 5034 | apply (subst abs_away) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5035 | apply (auto simp: 1) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5036 | apply (rule ccontr) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5037 | 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 | 5038 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5039 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5040 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5041 | proposition arc_part_circlepath: | 
| 61945 | 5042 | 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 | 5043 | 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 | 5044 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5045 | have *: "x = y" if eq: "\<i> * (linepath s t x) = \<i> * (linepath s t y) + 2 * of_int n * complex_of_real pi * \<i>" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5046 |                   and x: "x \<in> {0..1}" and y: "y \<in> {0..1}" for x y n
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5047 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5048 | have "(linepath s t x) = (linepath s t y) + 2 * of_int n * complex_of_real pi" | 
| 64240 | 5049 | by (metis add_divide_eq_iff complex_i_not_zero mult.commute nonzero_mult_div_cancel_left eq) | 
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5050 | then have "s*y + t*x = s*x + (t*y + of_int n * (pi * 2))" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5051 | by (force simp: algebra_simps linepath_def dest: arg_cong [where f=Re]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5052 | then have st: "x \<noteq> y \<Longrightarrow> (s-t) = (of_int n * (pi * 2) / (y-x))" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5053 | by (force simp: field_simps) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5054 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5055 | apply (rule ccontr) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5056 | using assms x y | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5057 | apply (simp add: st abs_mult field_simps) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5058 | using st | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5059 | apply (auto simp: dest: of_int_lessD) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5060 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5061 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5062 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5063 | using assms | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5064 | 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 | 5065 | 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 | 5066 | apply (blast intro: *) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5067 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5068 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5069 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5070 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5071 | 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 | 5072 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5073 | definition circlepath :: "[complex, real, real] \<Rightarrow> complex" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5074 | 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 | 5075 | |
| 63589 | 5076 | 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 | 5077 | 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 | 5078 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5079 | 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 | 5080 | 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 | 5081 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5082 | 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 | 5083 | 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 | 5084 | |
| 61848 | 5085 | lemma circlepath_minus: "circlepath z (-r) x = circlepath z r (x + 1/2)" | 
| 5086 | proof - | |
| 5087 | have "z + of_real r * exp (2 * pi * \<i> * (x + 1 / 2)) = | |
| 5088 | z + of_real r * exp (2 * pi * \<i> * x + pi * \<i>)" | |
| 5089 | by (simp add: divide_simps) (simp add: algebra_simps) | |
| 5090 | also have "... = z - r * exp (2 * pi * \<i> * x)" | |
| 5091 | by (simp add: exp_add) | |
| 5092 | finally show ?thesis | |
| 5093 | by (simp add: circlepath path_image_def sphere_def dist_norm) | |
| 5094 | qed | |
| 5095 | ||
| 5096 | lemma circlepath_add1: "circlepath z r (x+1) = circlepath z r x" | |
| 5097 | using circlepath_minus [of z r "x+1/2"] circlepath_minus [of z "-r" x] | |
| 5098 | by (simp add: add.commute) | |
| 5099 | ||
| 5100 | lemma circlepath_add_half: "circlepath z r (x + 1/2) = circlepath z r (x - 1/2)" | |
| 5101 | using circlepath_add1 [of z r "x-1/2"] | |
| 5102 | by (simp add: add.commute) | |
| 5103 | ||
| 5104 | lemma path_image_circlepath_minus_subset: | |
| 5105 | "path_image (circlepath z (-r)) \<subseteq> path_image (circlepath z r)" | |
| 5106 | apply (simp add: path_image_def image_def circlepath_minus, clarify) | |
| 5107 | apply (case_tac "xa \<le> 1/2", force) | |
| 5108 | apply (force simp add: circlepath_add_half)+ | |
| 5109 | done | |
| 5110 | ||
| 5111 | lemma path_image_circlepath_minus: "path_image (circlepath z (-r)) = path_image (circlepath z r)" | |
| 5112 | using path_image_circlepath_minus_subset by fastforce | |
| 5113 | ||
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5114 | proposition has_vector_derivative_circlepath [derivative_intros]: | 
| 63589 | 5115 | "((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 | 5116 | (at x within X)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5117 | 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 | 5118 | 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 | 5119 | 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 | 5120 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5121 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5122 | corollary vector_derivative_circlepath: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5123 | "vector_derivative (circlepath z r) (at x) = | 
| 63589 | 5124 | 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 | 5125 | 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 | 5126 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5127 | corollary vector_derivative_circlepath01: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5128 | "\<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 | 5129 |      \<Longrightarrow> vector_derivative (circlepath z r) (at x within {0..1}) =
 | 
| 63589 | 5130 | 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 | 5131 | 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 | 5132 | 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 | 5133 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5134 | 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 | 5135 | 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 | 5136 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5137 | 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 | 5138 | 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 | 5139 | |
| 61848 | 5140 | 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 | 5141 | 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 | 5142 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5143 |   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 | 5144 | proof (cases "x = z") | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5145 | 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 | 5146 | next | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5147 | case False | 
| 63040 | 5148 | 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 | 5149 | 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 | 5150 | 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 | 5151 | 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 | 5152 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5153 | 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 | 5154 | 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 | 5155 | 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 | 5156 | 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 | 5157 | using False ** | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5158 | 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 | 5159 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5160 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5161 | show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5162 | 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 | 5163 | 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 | 5164 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5165 | |
| 61848 | 5166 | proposition path_image_circlepath [simp]: | 
| 61945 | 5167 | "path_image (circlepath z r) = sphere z \<bar>r\<bar>" | 
| 61848 | 5168 | using path_image_circlepath_minus | 
| 5169 | by (force simp add: path_image_circlepath_nonneg abs_if) | |
| 5170 | ||
| 61806 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5171 | 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 | 5172 | "\<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 | 5173 | 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 | 5174 | \<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 | 5175 | \<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 | 5176 | unfolding circlepath_def | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5177 | 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 | 5178 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5179 | corollary has_contour_integral_bound_circlepath: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5180 | "\<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 | 5181 | 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 | 5182 | \<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 | 5183 | 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 | 5184 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5185 | proposition contour_integrable_continuous_circlepath: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5186 | "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 | 5187 | \<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 | 5188 | 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 | 5189 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5190 | 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 | 5191 | 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 | 5192 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5193 | lemma notin_path_image_circlepath [simp]: "cmod (w - z) < r \<Longrightarrow> w \<notin> path_image (circlepath z r)" | 
| 61848 | 5194 | 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 | 5195 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5196 | proposition contour_integral_circlepath: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5197 | "0 < r \<Longrightarrow> contour_integral (circlepath z r) (\<lambda>w. 1 / (w - z)) = 2 * complex_of_real pi * \<i>" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5198 | apply (rule contour_integral_unique) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5199 | apply (simp add: has_contour_integral_def) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5200 | apply (subst has_integral_cong) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5201 | apply (simp add: vector_derivative_circlepath01) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5202 | using has_integral_const_real [of _ 0 1] | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5203 | apply (force simp: circlepath) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5204 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5205 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5206 | 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 | 5207 | 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 | 5208 | 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 | 5209 | 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 | 5210 | 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 | 5211 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5212 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5213 | proposition winding_number_circlepath: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5214 | 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 | 5215 | proof (cases "w = z") | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5216 | 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 | 5217 | 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 | 5218 | next | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5219 | case False | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5220 | have [simp]: "r > 0" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5221 | using assms le_less_trans norm_ge_zero by blast | 
| 63040 | 5222 | 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 | 5223 | have "r' < r" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5224 | 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 | 5225 |   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 | 5226 | 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 | 5227 | have "winding_number(circlepath z r) w = winding_number(circlepath z r) z" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5228 | apply (rule winding_number_around_inside [where s = "cball z r'"]) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5229 | apply (simp_all add: disjo order.strict_implies_order winding_number_circlepath_centre) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5230 | apply (simp_all add: False r'_def 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 | 5231 | done | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5232 | also have "... = 1" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5233 | 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 | 5234 | finally show ?thesis . | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5235 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5236 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5237 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5238 | 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 | 5239 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5240 | theorem Cauchy_integral_circlepath: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5241 | assumes "continuous_on (cball z r) f" "f holomorphic_on (ball z r)" "norm(w - z) < r" | 
| 63589 | 5242 | 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 | 5243 | (circlepath z r)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5244 | proof - | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5245 | have "r > 0" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5246 | 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 | 5247 | 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 | 5248 | (circlepath z r)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5249 |     apply (rule Cauchy_integral_formula_weak [where s = "cball z r" and k = "{}"])
 | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5250 | using assms \<open>r > 0\<close> | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5251 | apply (simp_all 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 | 5252 | apply (metis at_within_interior dist_norm holomorphic_on_def interior_ball mem_ball norm_minus_commute) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5253 | apply (simp add: cball_def sphere_def dist_norm, clarify) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5254 | apply (simp add:) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5255 | by (metis dist_commute dist_norm less_irrefl) | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5256 | then show ?thesis | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5257 | 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 | 5258 | qed | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5259 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5260 | corollary Cauchy_integral_circlepath_simple: | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5261 | assumes "f holomorphic_on cball z r" "norm(w - z) < r" | 
| 63589 | 5262 | 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 | 5263 | (circlepath z r)" | 
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5264 | 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 | 5265 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5266 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5267 | 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 | 5268 | 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 | 5269 | 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 | 5270 | 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 | 5271 | 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 | 5272 | 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 | 5273 | 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 | 5274 | |
| 
d2e62ae01cd8
Cauchy's integral formula for circles.  Starting to fix eventually_mono.
 paulson <lp15@cam.ac.uk> parents: 
61762diff
changeset | 5275 | 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 | 5276 | 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 | 5277 | 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 | 5278 | 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 | 5279 | 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 | 5280 | 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 | 5281 | |
| 61848 | 5282 | |
| 5283 | subsection\<open> Uniform convergence of path integral\<close> | |
| 5284 | ||
| 5285 | text\<open>Uniform convergence when the derivative of the path is bounded, and in particular for the special case of a circle.\<close> | |
| 5286 | ||
| 5287 | proposition contour_integral_uniform_limit: | |
| 5288 | 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 | 5289 | and ul_f: "uniform_limit (path_image \<gamma>) f l F" | 
| 61848 | 5290 |       and noleB: "\<And>t. t \<in> {0..1} \<Longrightarrow> norm (vector_derivative \<gamma> (at t)) \<le> B"
 | 
| 5291 | and \<gamma>: "valid_path \<gamma>" | |
| 5292 | and [simp]: "~ (trivial_limit F)" | |
| 61973 | 5293 | shows "l contour_integrable_on \<gamma>" "((\<lambda>n. contour_integral \<gamma> (f n)) \<longlongrightarrow> contour_integral \<gamma> l) F" | 
| 61848 | 5294 | proof - | 
| 5295 | have "0 \<le> B" by (meson noleB [of 0] atLeastAtMost_iff norm_ge_zero order_refl order_trans zero_le_one) | |
| 5296 |   { fix e::real
 | |
| 5297 | 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 | 5298 | 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 | 5299 | 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 | 5300 | 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 | 5301 | with ev_fint | 
| 61848 | 5302 |     obtain a where fga: "\<And>x. x \<in> {0..1} \<Longrightarrow> cmod (f a (\<gamma> x) - l (\<gamma> x)) < e / (\<bar>B\<bar> + 1)"
 | 
| 5303 |                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 | 5304 | using eventually_happens [OF eventually_conj] | 
| 61848 | 5305 | by (fastforce simp: contour_integrable_on path_image_def) | 
| 5306 | have Ble: "B * e / (\<bar>B\<bar> + 1) \<le> e" | |
| 5307 | using \<open>0 \<le> B\<close> \<open>0 < e\<close> by (simp add: divide_simps) | |
| 5308 |     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}"
 | |
| 5309 | apply (rule_tac x="\<lambda>x. f (a::'a) (\<gamma> x) * vector_derivative \<gamma> (at x)" in exI) | |
| 5310 | apply (intro inta conjI ballI) | |
| 5311 | apply (rule order_trans [OF _ Ble]) | |
| 5312 | apply (frule noleB) | |
| 5313 | apply (frule fga) | |
| 5314 | using \<open>0 \<le> B\<close> \<open>0 < e\<close> | |
| 5315 | apply (simp add: norm_mult left_diff_distrib [symmetric] norm_minus_commute divide_simps) | |
| 5316 | apply (drule (1) mult_mono [OF less_imp_le]) | |
| 5317 | apply (simp_all add: mult_ac) | |
| 5318 | done | |
| 5319 | } | |
| 5320 | then show lintg: "l contour_integrable_on \<gamma>" | |
| 5321 | apply (simp add: contour_integrable_on) | |
| 66294 
0442b3f45556
refactored some HORRIBLE integration proofs
 paulson <lp15@cam.ac.uk> parents: 
66286diff
changeset | 5322 | by (metis (mono_tags, lifting)integrable_uniform_limit_real) | 
| 61848 | 5323 |   { fix e::real
 | 
| 63040 | 5324 | define B' where "B' = B + 1" | 
| 61848 | 5325 | have B': "B' > 0" "B' > B" using \<open>0 \<le> B\<close> by (auto simp: B'_def) | 
| 5326 | assume "0 < e" | |
| 5327 | 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'" | |
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5328 | using ul_f [unfolded uniform_limit_iff dist_norm, rule_format, of "e / B' / 2"] B' | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5329 | by (simp add: field_simps) | 
| 61848 | 5330 |     have ie: "integral {0..1::real} (\<lambda>x. e / 2) < e" using \<open>0 < e\<close> by simp
 | 
| 5331 | have *: "cmod (f x (\<gamma> t) * vector_derivative \<gamma> (at t) - l (\<gamma> t) * vector_derivative \<gamma> (at t)) \<le> e / 2" | |
| 5332 |              if t: "t\<in>{0..1}" and leB': "2 * cmod (f x (\<gamma> t) - l (\<gamma> t)) < e / B'" for x t
 | |
| 5333 | proof - | |
| 5334 | have "2 * cmod (f x (\<gamma> t) - l (\<gamma> t)) * cmod (vector_derivative \<gamma> (at t)) \<le> e * (B/ B')" | |
| 5335 | using mult_mono [OF less_imp_le [OF leB'] noleB] B' \<open>0 < e\<close> t by auto | |
| 5336 | also have "... < e" | |
| 5337 | by (simp add: B' \<open>0 < e\<close> mult_imp_div_pos_less) | |
| 5338 | finally have "2 * cmod (f x (\<gamma> t) - l (\<gamma> t)) * cmod (vector_derivative \<gamma> (at t)) < e" . | |
| 5339 | then show ?thesis | |
| 5340 | by (simp add: left_diff_distrib [symmetric] norm_mult) | |
| 5341 | qed | |
| 5342 | have "\<forall>\<^sub>F x in F. dist (contour_integral \<gamma> (f x)) (contour_integral \<gamma> l) < e" | |
| 5343 | apply (rule eventually_mono [OF eventually_conj [OF ev_no' ev_fint]]) | |
| 5344 | apply (simp add: dist_norm contour_integrable_on path_image_def contour_integral_integral) | |
| 5345 | apply (simp add: lintg integral_diff [symmetric] contour_integrable_on [symmetric], clarify) | |
| 5346 | apply (rule le_less_trans [OF integral_norm_bound_integral ie]) | |
| 5347 | apply (simp add: lintg integrable_diff contour_integrable_on [symmetric]) | |
| 5348 | apply (blast intro: *)+ | |
| 5349 | done | |
| 5350 | } | |
| 61973 | 5351 | then show "((\<lambda>n. contour_integral \<gamma> (f n)) \<longlongrightarrow> contour_integral \<gamma> l) F" | 
| 61848 | 5352 | by (rule tendstoI) | 
| 5353 | qed | |
| 5354 | ||
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5355 | corollary contour_integral_uniform_limit_circlepath: | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 5356 | 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 | 5357 | 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 | 5358 | 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 | 5359 | 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 | 5360 | "((\<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 | 5361 | using assms by (auto simp: vector_derivative_circlepath norm_mult intro!: contour_integral_uniform_limit) | 
| 61848 | 5362 | |
| 5363 | ||
| 5364 | subsection\<open> General stepping result for derivative formulas.\<close> | |
| 5365 | ||
| 5366 | proposition Cauchy_next_derivative: | |
| 5367 | assumes "continuous_on (path_image \<gamma>) f'" | |
| 5368 |       and leB: "\<And>t. t \<in> {0..1} \<Longrightarrow> norm (vector_derivative \<gamma> (at t)) \<le> B"
 | |
| 5369 | and int: "\<And>w. w \<in> s - path_image \<gamma> \<Longrightarrow> ((\<lambda>u. f' u / (u - w)^k) has_contour_integral f w) \<gamma>" | |
| 5370 | and k: "k \<noteq> 0" | |
| 5371 | and "open s" | |
| 5372 | and \<gamma>: "valid_path \<gamma>" | |
| 5373 | and w: "w \<in> s - path_image \<gamma>" | |
| 5374 | shows "(\<lambda>u. f' u / (u - w)^(Suc k)) contour_integrable_on \<gamma>" | |
| 5375 | and "(f has_field_derivative (k * contour_integral \<gamma> (\<lambda>u. f' u/(u - w)^(Suc k)))) | |
| 5376 | (at w)" (is "?thes2") | |
| 5377 | proof - | |
| 5378 | have "open (s - path_image \<gamma>)" using \<open>open s\<close> closed_valid_path_image \<gamma> by blast | |
| 5379 | then obtain d where "d>0" and d: "ball w d \<subseteq> s - path_image \<gamma>" using w | |
| 5380 | using open_contains_ball by blast | |
| 5381 | have [simp]: "\<And>n. cmod (1 + of_nat n) = 1 + of_nat n" | |
| 5382 | by (metis norm_of_nat of_nat_Suc) | |
| 5383 | 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) | |
| 5384 | contour_integrable_on \<gamma>" | |
| 5385 | apply (simp add: eventually_at) | |
| 5386 | apply (rule_tac x=d in exI) | |
| 5387 | apply (simp add: \<open>d > 0\<close> dist_norm field_simps, clarify) | |
| 5388 | apply (rule contour_integrable_div [OF contour_integrable_diff]) | |
| 5389 | using int w d | |
| 5390 | apply (force simp: dist_norm norm_minus_commute intro!: has_contour_integral_integrable)+ | |
| 5391 | done | |
| 5392 | have bim_g: "bounded (image f' (path_image \<gamma>))" | |
| 5393 | by (simp add: compact_imp_bounded compact_continuous_image compact_valid_path_image assms) | |
| 5394 | 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" | |
| 5395 | by (force simp: bounded_pos path_image_def) | |
| 5396 | have twom: "\<forall>\<^sub>F n in at w. | |
| 5397 | \<forall>x\<in>path_image \<gamma>. | |
| 5398 | cmod ((inverse (x - n) ^ k - inverse (x - w) ^ k) / (n - w) / k - inverse (x - w) ^ Suc k) < e" | |
| 5399 | if "0 < e" for e | |
| 5400 | proof - | |
| 5401 | have *: "cmod ((inverse (x - u) ^ k - inverse (x - w) ^ k) / ((u - w) * k) - inverse (x - w) ^ Suc k) < e" | |
| 5402 | if x: "x \<in> path_image \<gamma>" and "u \<noteq> w" and uwd: "cmod (u - w) < d/2" | |
| 5403 | and uw_less: "cmod (u - w) < e * (d / 2) ^ (k+2) / (1 + real k)" | |
| 5404 | for u x | |
| 5405 | proof - | |
| 63040 | 5406 | define ff where [abs_def]: | 
| 5407 | "ff n w = | |
| 5408 | (if n = 0 then inverse(x - w)^k | |
| 5409 | else if n = 1 then k / (x - w)^(Suc k) | |
| 5410 | else (k * of_real(Suc k)) / (x - w)^(k + 2))" for n :: nat and w | |
| 61848 | 5411 | have km1: "\<And>z::complex. z \<noteq> 0 \<Longrightarrow> z ^ (k - Suc 0) = z ^ k / z" | 
| 5412 | by (simp add: field_simps) (metis Suc_pred \<open>k \<noteq> 0\<close> neq0_conv power_Suc) | |
| 5413 | have ff1: "(ff i has_field_derivative ff (Suc i) z) (at z within ball w (d / 2))" | |
| 5414 | if "z \<in> ball w (d / 2)" "i \<le> 1" for i z | |
| 5415 | proof - | |
| 5416 | have "z \<notin> path_image \<gamma>" | |
| 5417 | using \<open>x \<in> path_image \<gamma>\<close> d that ball_divide_subset_numeral by blast | |
| 5418 | then have xz[simp]: "x \<noteq> z" using \<open>x \<in> path_image \<gamma>\<close> by blast | |
| 5419 | then have neq: "x * x + z * z \<noteq> x * (z * 2)" | |
| 5420 | by (blast intro: dest!: sum_sqs_eq) | |
| 5421 | with xz have "\<And>v. v \<noteq> 0 \<Longrightarrow> (x * x + z * z) * v \<noteq> (x * (z * 2) * v)" by auto | |
| 5422 | then have neqq: "\<And>v. v \<noteq> 0 \<Longrightarrow> x * (x * v) + z * (z * v) \<noteq> x * (z * (2 * v))" | |
| 5423 | by (simp add: algebra_simps) | |
| 5424 | show ?thesis using \<open>i \<le> 1\<close> | |
| 5425 | apply (simp add: ff_def dist_norm Nat.le_Suc_eq km1, safe) | |
| 5426 | apply (rule derivative_eq_intros | simp add: km1 | simp add: field_simps neq neqq)+ | |
| 5427 | done | |
| 5428 | qed | |
| 5429 |       { fix a::real and b::real assume ab: "a > 0" "b > 0"
 | |
| 5430 | then have "k * (1 + real k) * (1 / a) \<le> k * (1 + real k) * (4 / b) \<longleftrightarrow> b \<le> 4 * a" | |
| 5431 | apply (subst mult_le_cancel_left_pos) | |
| 5432 | using \<open>k \<noteq> 0\<close> | |
| 5433 | apply (auto simp: divide_simps) | |
| 5434 | done | |
| 5435 | with ab have "real k * (1 + real k) / a \<le> (real k * 4 + real k * real k * 4) / b \<longleftrightarrow> b \<le> 4 * a" | |
| 5436 | by (simp add: field_simps) | |
| 5437 | } note canc = this | |
| 5438 | have ff2: "cmod (ff (Suc 1) v) \<le> real (k * (k + 1)) / (d / 2) ^ (k + 2)" | |
| 5439 | if "v \<in> ball w (d / 2)" for v | |
| 5440 | proof - | |
| 5441 | have "d/2 \<le> cmod (x - v)" using d x that | |
| 5442 | apply (simp add: dist_norm path_image_def ball_def not_less [symmetric] del: divide_const_simps, clarify) | |
| 5443 | apply (drule subsetD) | |
| 5444 | prefer 2 apply blast | |
| 5445 | apply (metis norm_minus_commute norm_triangle_half_r CollectI) | |
| 5446 | done | |
| 5447 | then have "d \<le> cmod (x - v) * 2" | |
| 5448 | by (simp add: divide_simps) | |
| 5449 | then have dpow_le: "d ^ (k+2) \<le> (cmod (x - v) * 2) ^ (k+2)" | |
| 5450 | using \<open>0 < d\<close> order_less_imp_le power_mono by blast | |
| 5451 | have "x \<noteq> v" using that | |
| 5452 | using \<open>x \<in> path_image \<gamma>\<close> ball_divide_subset_numeral d by fastforce | |
| 5453 | then show ?thesis | |
| 5454 | using \<open>d > 0\<close> | |
| 5455 | apply (simp add: ff_def norm_mult norm_divide norm_power dist_norm canc) | |
| 5456 | using dpow_le | |
| 5457 | apply (simp add: algebra_simps divide_simps mult_less_0_iff) | |
| 5458 | done | |
| 5459 | qed | |
| 5460 | have ub: "u \<in> ball w (d / 2)" | |
| 5461 | using uwd by (simp add: dist_commute dist_norm) | |
| 5462 | have "cmod (inverse (x - u) ^ k - (inverse (x - w) ^ k + of_nat k * (u - w) / ((x - w) * (x - w) ^ k))) | |
| 5463 | \<le> (real k * 4 + real k * real k * 4) * (cmod (u - w) * cmod (u - w)) / (d * (d * (d / 2) ^ k))" | |
| 5464 | using complex_taylor [OF _ ff1 ff2 _ ub, of w, simplified] | |
| 5465 | by (simp add: ff_def \<open>0 < d\<close>) | |
| 5466 | then have "cmod (inverse (x - u) ^ k - (inverse (x - w) ^ k + of_nat k * (u - w) / ((x - w) * (x - w) ^ k))) | |
| 5467 | \<le> (cmod (u - w) * real k) * (1 + real k) * cmod (u - w) / (d / 2) ^ (k+2)" | |
| 5468 | by (simp add: field_simps) | |
| 5469 | then have "cmod (inverse (x - u) ^ k - (inverse (x - w) ^ k + of_nat k * (u - w) / ((x - w) * (x - w) ^ k))) | |
| 5470 | / (cmod (u - w) * real k) | |
| 5471 | \<le> (1 + real k) * cmod (u - w) / (d / 2) ^ (k+2)" | |
| 5472 | using \<open>k \<noteq> 0\<close> \<open>u \<noteq> w\<close> by (simp add: mult_ac zero_less_mult_iff pos_divide_le_eq) | |
| 5473 | also have "... < e" | |
| 5474 | using uw_less \<open>0 < d\<close> by (simp add: mult_ac divide_simps) | |
| 5475 | finally have e: "cmod (inverse (x-u)^k - (inverse (x-w)^k + of_nat k * (u-w) / ((x-w) * (x-w)^k))) | |
| 5476 | / cmod ((u - w) * real k) < e" | |
| 5477 | by (simp add: norm_mult) | |
| 5478 | have "x \<noteq> u" | |
| 5479 | using uwd \<open>0 < d\<close> x d by (force simp: dist_norm ball_def norm_minus_commute) | |
| 5480 | show ?thesis | |
| 5481 | apply (rule le_less_trans [OF _ e]) | |
| 5482 | using \<open>k \<noteq> 0\<close> \<open>x \<noteq> u\<close> \<open>u \<noteq> w\<close> | |
| 5483 | apply (simp add: field_simps norm_divide [symmetric]) | |
| 5484 | done | |
| 5485 | qed | |
| 5486 | show ?thesis | |
| 5487 | unfolding eventually_at | |
| 5488 | apply (rule_tac x = "min (d/2) ((e*(d/2)^(k + 2))/(Suc k))" in exI) | |
| 5489 | apply (force simp: \<open>d > 0\<close> dist_norm that simp del: power_Suc intro: *) | |
| 5490 | done | |
| 5491 | 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 | 5492 | 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 | 5493 | 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 | 5494 | 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 | 5495 | 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 | 5496 | assume "0 < e" | 
| 61848 | 5497 | have *: "cmod (f' (\<gamma> x) * (inverse (\<gamma> x - u) ^ k - inverse (\<gamma> x - w) ^ k) / ((u - w) * k) - | 
| 5498 | f' (\<gamma> x) / ((\<gamma> x - w) * (\<gamma> x - w) ^ k)) < e" | |
| 5499 | if ec: "cmod ((inverse (\<gamma> x - u) ^ k - inverse (\<gamma> x - w) ^ k) / ((u - w) * k) - | |
| 5500 | inverse (\<gamma> x - w) * inverse (\<gamma> x - w) ^ k) < e / C" | |
| 5501 | and x: "0 \<le> x" "x \<le> 1" | |
| 5502 | for u x | |
| 5503 | proof (cases "(f' (\<gamma> x)) = 0") | |
| 5504 | case True then show ?thesis by (simp add: \<open>0 < e\<close>) | |
| 5505 | next | |
| 5506 | case False | |
| 5507 | have "cmod (f' (\<gamma> x) * (inverse (\<gamma> x - u) ^ k - inverse (\<gamma> x - w) ^ k) / ((u - w) * k) - | |
| 5508 | f' (\<gamma> x) / ((\<gamma> x - w) * (\<gamma> x - w) ^ k)) = | |
| 5509 | cmod (f' (\<gamma> x) * ((inverse (\<gamma> x - u) ^ k - inverse (\<gamma> x - w) ^ k) / ((u - w) * k) - | |
| 5510 | inverse (\<gamma> x - w) * inverse (\<gamma> x - w) ^ k))" | |
| 5511 | by (simp add: field_simps) | |
| 5512 | also have "... = cmod (f' (\<gamma> x)) * | |
| 5513 | cmod ((inverse (\<gamma> x - u) ^ k - inverse (\<gamma> x - w) ^ k) / ((u - w) * k) - | |
| 5514 | inverse (\<gamma> x - w) * inverse (\<gamma> x - w) ^ k)" | |
| 5515 | by (simp add: norm_mult) | |
| 5516 | also have "... < cmod (f' (\<gamma> x)) * (e/C)" | |
| 5517 | apply (rule mult_strict_left_mono [OF ec]) | |
| 5518 | using False by simp | |
| 5519 | also have "... \<le> e" using C | |
| 5520 | by (metis False \<open>0 < e\<close> frac_le less_eq_real_def mult.commute pos_le_divide_eq x zero_less_norm_iff) | |
| 5521 | finally show ?thesis . | |
| 5522 | 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 | 5523 | 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 | 5524 | \<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 | 5525 | 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 | 5526 | using twom [OF divide_pos_pos [OF \<open>0 < e\<close> \<open>C > 0\<close>]] unfolding path_image_def | 
| 61848 | 5527 | by (force intro: * elim: eventually_mono) | 
| 5528 | qed | |
| 5529 | show "(\<lambda>u. f' u / (u - w) ^ (Suc k)) contour_integrable_on \<gamma>" | |
| 5530 | by (rule contour_integral_uniform_limit [OF 1 2 leB \<gamma>]) auto | |
| 5531 | have *: "(\<lambda>n. contour_integral \<gamma> (\<lambda>x. f' x * (inverse (x - n) ^ k - inverse (x - w) ^ k) / (n - w) / k)) | |
| 61976 | 5532 | \<midarrow>w\<rightarrow> contour_integral \<gamma> (\<lambda>u. f' u / (u - w) ^ (Suc k))" | 
| 61848 | 5533 | by (rule contour_integral_uniform_limit [OF 1 2 leB \<gamma>]) auto | 
| 5534 | have **: "contour_integral \<gamma> (\<lambda>x. f' x * (inverse (x - u) ^ k - inverse (x - w) ^ k) / ((u - w) * k)) = | |
| 5535 | (f u - f w) / (u - w) / k" | |
| 5536 | if "dist u w < d" for u | |
| 5537 | apply (rule contour_integral_unique) | |
| 5538 | apply (simp add: diff_divide_distrib algebra_simps) | |
| 5539 | apply (rule has_contour_integral_diff; rule has_contour_integral_div; simp add: field_simps; rule int) | |
| 5540 | apply (metis contra_subsetD d dist_commute mem_ball that) | |
| 5541 | apply (rule w) | |
| 5542 | done | |
| 5543 | show ?thes2 | |
| 5544 | apply (simp add: DERIV_within_iff del: power_Suc) | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5545 | apply (rule Lim_transform_within [OF tendsto_mult_left [OF *] \<open>0 < d\<close> ]) | 
| 61848 | 5546 | apply (simp add: \<open>k \<noteq> 0\<close> **) | 
| 5547 | done | |
| 5548 | qed | |
| 5549 | ||
| 5550 | corollary Cauchy_next_derivative_circlepath: | |
| 5551 | assumes contf: "continuous_on (path_image (circlepath z r)) f" | |
| 5552 | 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)" | |
| 5553 | and k: "k \<noteq> 0" | |
| 5554 | and w: "w \<in> ball z r" | |
| 5555 | shows "(\<lambda>u. f u / (u - w)^(Suc k)) contour_integrable_on (circlepath z r)" | |
| 5556 | (is "?thes1") | |
| 5557 | and "(g has_field_derivative (k * contour_integral (circlepath z r) (\<lambda>u. f u/(u - w)^(Suc k)))) (at w)" | |
| 5558 | (is "?thes2") | |
| 5559 | proof - | |
| 5560 | have "r > 0" using w | |
| 5561 | using ball_eq_empty by fastforce | |
| 5562 | have wim: "w \<in> ball z r - path_image (circlepath z r)" | |
| 5563 | using w by (auto simp: dist_norm) | |
| 5564 | show ?thes1 ?thes2 | |
| 5565 | by (rule Cauchy_next_derivative [OF contf _ int k open_ball valid_path_circlepath wim, where B = "2 * pi * \<bar>r\<bar>"]; | |
| 5566 | auto simp: vector_derivative_circlepath norm_mult)+ | |
| 5567 | qed | |
| 5568 | ||
| 5569 | ||
| 5570 | text\<open> In particular, the first derivative formula.\<close> | |
| 5571 | ||
| 5572 | proposition Cauchy_derivative_integral_circlepath: | |
| 5573 | assumes contf: "continuous_on (cball z r) f" | |
| 5574 | and holf: "f holomorphic_on ball z r" | |
| 5575 | and w: "w \<in> ball z r" | |
| 5576 | shows "(\<lambda>u. f u/(u - w)^2) contour_integrable_on (circlepath z r)" | |
| 5577 | (is "?thes1") | |
| 63589 | 5578 | 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 | 5579 | (is "?thes2") | 
| 5580 | proof - | |
| 5581 | have [simp]: "r \<ge> 0" using w | |
| 5582 | using ball_eq_empty by fastforce | |
| 5583 | have f: "continuous_on (path_image (circlepath z r)) f" | |
| 5584 | by (rule continuous_on_subset [OF contf]) (force simp add: cball_def sphere_def) | |
| 5585 | have int: "\<And>w. dist z w < r \<Longrightarrow> | |
| 63589 | 5586 | ((\<lambda>u. f u / (u - w)) has_contour_integral (\<lambda>x. 2 * of_real pi * \<i> * f x) w) (circlepath z r)" | 
| 61848 | 5587 | by (rule Cauchy_integral_circlepath [OF contf holf]) (simp add: dist_norm norm_minus_commute) | 
| 5588 | show ?thes1 | |
| 5589 | apply (simp add: power2_eq_square) | |
| 5590 | apply (rule Cauchy_next_derivative_circlepath [OF f _ _ w, where k=1, simplified]) | |
| 5591 | apply (blast intro: int) | |
| 5592 | done | |
| 5593 | 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)" | |
| 5594 | apply (simp add: power2_eq_square) | |
| 63589 | 5595 | 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 | 5596 | apply (blast intro: int) | 
| 5597 | done | |
| 5598 | 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)" | |
| 5599 | by (rule DERIV_cdivide [where f = "\<lambda>x. 2 * of_real pi * \<i> * f x" and c = "2 * of_real pi * \<i>", simplified]) | |
| 5600 | show ?thes2 | |
| 5601 | by simp (rule fder) | |
| 5602 | qed | |
| 5603 | ||
| 5604 | subsection\<open> Existence of all higher derivatives.\<close> | |
| 5605 | ||
| 5606 | proposition derivative_is_holomorphic: | |
| 5607 | assumes "open s" | |
| 5608 | and fder: "\<And>z. z \<in> s \<Longrightarrow> (f has_field_derivative f' z) (at z)" | |
| 5609 | shows "f' holomorphic_on s" | |
| 5610 | proof - | |
| 5611 | have *: "\<exists>h. (f' has_field_derivative h) (at z)" if "z \<in> s" for z | |
| 5612 | proof - | |
| 5613 | obtain r where "r > 0" and r: "cball z r \<subseteq> s" | |
| 5614 | using open_contains_cball \<open>z \<in> s\<close> \<open>open s\<close> by blast | |
| 5615 | then have holf_cball: "f holomorphic_on cball z r" | |
| 5616 | 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 | 5617 | using field_differentiable_at_within field_differentiable_def fder by blast | 
| 61848 | 5618 | then have "continuous_on (path_image (circlepath z r)) f" | 
| 5619 | using \<open>r > 0\<close> by (force elim: holomorphic_on_subset [THEN holomorphic_on_imp_continuous_on]) | |
| 63589 | 5620 | then have contfpi: "continuous_on (path_image (circlepath z r)) (\<lambda>x. 1/(2 * of_real pi*\<i>) * f x)" | 
| 61848 | 5621 | by (auto intro: continuous_intros)+ | 
| 5622 | have contf_cball: "continuous_on (cball z r) f" using holf_cball | |
| 5623 | by (simp add: holomorphic_on_imp_continuous_on holomorphic_on_subset) | |
| 5624 | have holf_ball: "f holomorphic_on ball z r" using holf_cball | |
| 5625 | using ball_subset_cball holomorphic_on_subset by blast | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5626 |     { fix w  assume w: "w \<in> ball z r"
 | 
| 61848 | 5627 | have intf: "(\<lambda>u. f u / (u - w)\<^sup>2) contour_integrable_on circlepath z r" | 
| 5628 | by (blast intro: w Cauchy_derivative_integral_circlepath [OF contf_cball holf_ball]) | |
| 5629 | 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)) | |
| 5630 | (at w)" | |
| 5631 | by (blast intro: w Cauchy_derivative_integral_circlepath [OF contf_cball holf_ball]) | |
| 5632 | have f'_eq: "f' w = contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2) / (2 * of_real pi * \<i>)" | |
| 5633 | using fder' ball_subset_cball r w by (force intro: DERIV_unique [OF fder]) | |
| 5634 | have "((\<lambda>u. f u / (u - w)\<^sup>2 / (2 * of_real pi * \<i>)) has_contour_integral | |
| 5635 | contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2) / (2 * of_real pi * \<i>)) | |
| 5636 | (circlepath z r)" | |
| 63594 
bd218a9320b5
HOL-Multivariate_Analysis: rename theories for more descriptive names
 hoelzl parents: 
63589diff
changeset | 5637 | by (rule has_contour_integral_div [OF has_contour_integral_integral [OF intf]]) | 
| 61848 | 5638 | then have "((\<lambda>u. f u / (2 * of_real pi * \<i> * (u - w)\<^sup>2)) has_contour_integral | 
| 5639 | contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)\<^sup>2) / (2 * of_real pi * \<i>)) | |
| 5640 | (circlepath z r)" | |
| 5641 | by (simp add: algebra_simps) | |
| 5642 | then have "((\<lambda>u. f u / (2 * of_real pi * \<i> * (u - w)\<^sup>2)) has_contour_integral f' w) (circlepath z r)" | |
| 5643 | by (simp add: f'_eq) | |
| 5644 | } note * = this | |
| 5645 | show ?thesis | |
| 5646 | apply (rule exI) | |
| 5647 | apply (rule Cauchy_next_derivative_circlepath [OF contfpi, of 2 f', simplified]) | |
| 5648 | apply (simp_all add: \<open>0 < r\<close> * dist_norm) | |
| 5649 | done | |
| 5650 | qed | |
| 5651 | show ?thesis | |
| 5652 | by (simp add: holomorphic_on_open [OF \<open>open s\<close>] *) | |
| 5653 | qed | |
| 5654 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5655 | lemma holomorphic_deriv [holomorphic_intros]: | 
| 61848 | 5656 | "\<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 | 5657 | by (metis DERIV_deriv_iff_field_differentiable at_within_open derivative_is_holomorphic holomorphic_on_def) | 
| 61848 | 5658 | |
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 5659 | lemma analytic_deriv [analytic_intros]: "f analytic_on s \<Longrightarrow> (deriv f) analytic_on s" | 
| 61848 | 5660 | using analytic_on_holomorphic holomorphic_deriv by auto | 
| 5661 | ||
| 5662 | lemma holomorphic_higher_deriv [holomorphic_intros]: "\<lbrakk>f holomorphic_on s; open s\<rbrakk> \<Longrightarrow> (deriv ^^ n) f holomorphic_on s" | |
| 5663 | by (induction n) (auto simp: holomorphic_deriv) | |
| 5664 | ||
| 65587 
16a8991ab398
New material (and some tidying) purely in the Analysis directory
 paulson <lp15@cam.ac.uk> parents: 
65578diff
changeset | 5665 | lemma analytic_higher_deriv [analytic_intros]: "f analytic_on s \<Longrightarrow> (deriv ^^ n) f analytic_on s" | 
| 61848 | 5666 | unfolding analytic_on_def using holomorphic_higher_deriv by blast | 
| 5667 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5668 | lemma has_field_derivative_higher_deriv: | 
| 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5669 | "\<lbrakk>f holomorphic_on s; open s; x \<in> s\<rbrakk> | 
| 61848 | 5670 | \<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 | 5671 | by (metis (no_types, hide_lams) DERIV_deriv_iff_field_differentiable at_within_open comp_apply | 
| 61848 | 5672 | funpow.simps(2) holomorphic_higher_deriv holomorphic_on_def) | 
| 5673 | ||
| 62540 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 5674 | lemma valid_path_compose_holomorphic: | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 5675 | assumes "valid_path g" and holo:"f holomorphic_on s" and "open s" "path_image g \<subseteq> s" | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 5676 | shows "valid_path (f o g)" | 
| 62837 | 5677 | 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 | 5678 | fix x assume "x \<in> path_image g" | 
| 64394 | 5679 | then show "f field_differentiable at x" | 
| 5680 | 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 | 5681 | next | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 5682 | have "deriv f holomorphic_on s" | 
| 62837 | 5683 | 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 | 5684 | 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 | 5685 | 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 | 5686 | qed | 
| 
f2fc5485e3b0
Wenda Li's new material: residue theorem, argument_principle, Rouche_theorem
 paulson <lp15@cam.ac.uk> parents: 
62534diff
changeset | 5687 | |
| 61848 | 5688 | |
| 5689 | subsection\<open> Morera's theorem.\<close> | |
| 5690 | ||
| 5691 | lemma Morera_local_triangle_ball: | |
| 5692 | assumes "\<And>z. z \<in> s | |
| 5693 | \<Longrightarrow> \<exists>e a. 0 < e \<and> z \<in> ball a e \<and> continuous_on (ball a e) f \<and> | |
| 5694 | (\<forall>b c. closed_segment b c \<subseteq> ball a e | |
| 5695 | \<longrightarrow> contour_integral (linepath a b) f + | |
| 5696 | contour_integral (linepath b c) f + | |
| 5697 | contour_integral (linepath c a) f = 0)" | |
| 5698 | shows "f analytic_on s" | |
| 5699 | proof - | |
| 5700 |   { fix z  assume "z \<in> s"
 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5701 | with assms obtain e a where | 
| 61848 | 5702 | "0 < e" and z: "z \<in> ball a e" and contf: "continuous_on (ball a e) f" | 
| 5703 | and 0: "\<And>b c. closed_segment b c \<subseteq> ball a e | |
| 5704 | \<Longrightarrow> contour_integral (linepath a b) f + | |
| 5705 | contour_integral (linepath b c) f + | |
| 5706 | contour_integral (linepath c a) f = 0" | |
| 5707 | by fastforce | |
| 5708 | have az: "dist a z < e" using mem_ball z by blast | |
| 5709 | have sb_ball: "ball z (e - dist a z) \<subseteq> ball a e" | |
| 5710 | by (simp add: dist_commute ball_subset_ball_iff) | |
| 5711 | have "\<exists>e>0. f holomorphic_on ball z e" | |
| 5712 | apply (rule_tac x="e - dist a z" in exI) | |
| 5713 | apply (simp add: az) | |
| 5714 | apply (rule holomorphic_on_subset [OF _ sb_ball]) | |
| 5715 | apply (rule derivative_is_holomorphic[OF open_ball]) | |
| 5716 | apply (rule triangle_contour_integrals_starlike_primitive [OF contf _ open_ball, of a]) | |
| 5717 | apply (simp_all add: 0 \<open>0 < e\<close>) | |
| 5718 | apply (meson \<open>0 < e\<close> centre_in_ball convex_ball convex_contains_segment mem_ball) | |
| 5719 | done | |
| 5720 | } | |
| 5721 | then show ?thesis | |
| 5722 | by (simp add: analytic_on_def) | |
| 5723 | qed | |
| 5724 | ||
| 5725 | lemma Morera_local_triangle: | |
| 5726 | assumes "\<And>z. z \<in> s | |
| 5727 | \<Longrightarrow> \<exists>t. open t \<and> z \<in> t \<and> continuous_on t f \<and> | |
| 5728 |                   (\<forall>a b c. convex hull {a,b,c} \<subseteq> t
 | |
| 5729 | \<longrightarrow> contour_integral (linepath a b) f + | |
| 5730 | contour_integral (linepath b c) f + | |
| 5731 | contour_integral (linepath c a) f = 0)" | |
| 5732 | shows "f analytic_on s" | |
| 5733 | proof - | |
| 5734 |   { fix z  assume "z \<in> s"
 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5735 | with assms obtain t where | 
| 61848 | 5736 | "open t" and z: "z \<in> t" and contf: "continuous_on t f" | 
| 5737 |         and 0: "\<And>a b c. convex hull {a,b,c} \<subseteq> t
 | |
| 5738 | \<Longrightarrow> contour_integral (linepath a b) f + | |
| 5739 | contour_integral (linepath b c) f + | |
| 5740 | contour_integral (linepath c a) f = 0" | |
| 5741 | by force | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5742 | then obtain e where "e>0" and e: "ball z e \<subseteq> t" | 
| 61848 | 5743 | using open_contains_ball by blast | 
| 5744 | have [simp]: "continuous_on (ball z e) f" using contf | |
| 5745 | using continuous_on_subset e by blast | |
| 5746 | have "\<exists>e a. 0 < e \<and> | |
| 5747 | z \<in> ball a e \<and> | |
| 5748 | continuous_on (ball a e) f \<and> | |
| 5749 | (\<forall>b c. closed_segment b c \<subseteq> ball a e \<longrightarrow> | |
| 5750 | contour_integral (linepath a b) f + contour_integral (linepath b c) f + contour_integral (linepath c a) f = 0)" | |
| 5751 | apply (rule_tac x=e in exI) | |
| 5752 | apply (rule_tac x=z in exI) | |
| 5753 | apply (simp add: \<open>e > 0\<close>, clarify) | |
| 5754 | apply (rule 0) | |
| 5755 | apply (meson z \<open>0 < e\<close> centre_in_ball closed_segment_subset convex_ball dual_order.trans e starlike_convex_subset) | |
| 5756 | done | |
| 5757 | } | |
| 5758 | then show ?thesis | |
| 5759 | by (simp add: Morera_local_triangle_ball) | |
| 5760 | qed | |
| 5761 | ||
| 5762 | proposition Morera_triangle: | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5763 | "\<lbrakk>continuous_on s f; open s; | 
| 61848 | 5764 |       \<And>a b c. convex hull {a,b,c} \<subseteq> s
 | 
| 5765 | \<longrightarrow> contour_integral (linepath a b) f + | |
| 5766 | contour_integral (linepath b c) f + | |
| 5767 | contour_integral (linepath c a) f = 0\<rbrakk> | |
| 5768 | \<Longrightarrow> f analytic_on s" | |
| 5769 | using Morera_local_triangle by blast | |
| 5770 | ||
| 5771 | ||
| 5772 | ||
| 5773 | subsection\<open> Combining theorems for higher derivatives including Leibniz rule.\<close> | |
| 5774 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5775 | lemma higher_deriv_linear [simp]: | 
| 61848 | 5776 | "(deriv ^^ n) (\<lambda>w. c*w) = (\<lambda>z. if n = 0 then c*z else if n = 1 then c else 0)" | 
| 5777 | by (induction n) (auto simp: deriv_const deriv_linear) | |
| 5778 | ||
| 5779 | lemma higher_deriv_const [simp]: "(deriv ^^ n) (\<lambda>w. c) = (\<lambda>w. if n=0 then c else 0)" | |
| 5780 | by (induction n) (auto simp: deriv_const) | |
| 5781 | ||
| 5782 | lemma higher_deriv_ident [simp]: | |
| 5783 | "(deriv ^^ n) (\<lambda>w. w) z = (if n = 0 then z else if n = 1 then 1 else 0)" | |
| 62217 | 5784 | apply (induction n, simp) | 
| 5785 | apply (metis higher_deriv_linear lambda_one) | |
| 61848 | 5786 | done | 
| 5787 | ||
| 5788 | corollary higher_deriv_id [simp]: | |
| 5789 | "(deriv ^^ n) id z = (if n = 0 then z else if n = 1 then 1 else 0)" | |
| 5790 | by (simp add: id_def) | |
| 5791 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5792 | lemma has_complex_derivative_funpow_1: | 
| 61848 | 5793 | "\<lbrakk>(f has_field_derivative 1) (at z); f z = z\<rbrakk> \<Longrightarrow> (f^^n has_field_derivative 1) (at z)" | 
| 5794 | apply (induction n) | |
| 5795 | apply auto | |
| 5796 | apply (metis DERIV_ident DERIV_transform_at id_apply zero_less_one) | |
| 5797 | by (metis DERIV_chain comp_funpow comp_id funpow_swap1 mult.right_neutral) | |
| 5798 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5799 | proposition higher_deriv_uminus: | 
| 61848 | 5800 | assumes "f holomorphic_on s" "open s" and z: "z \<in> s" | 
| 5801 | shows "(deriv ^^ n) (\<lambda>w. -(f w)) z = - ((deriv ^^ n) f z)" | |
| 5802 | using z | |
| 5803 | proof (induction n arbitrary: z) | |
| 5804 | case 0 then show ?case by simp | |
| 5805 | next | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5806 | case (Suc n z) | 
| 61848 | 5807 | have *: "((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) z) (at z)" | 
| 5808 | using Suc.prems assms has_field_derivative_higher_deriv by auto | |
| 5809 | show ?case | |
| 5810 | apply simp | |
| 5811 | apply (rule DERIV_imp_deriv) | |
| 5812 | apply (rule DERIV_transform_within_open [of "\<lambda>w. -((deriv ^^ n) f w)"]) | |
| 5813 | apply (rule derivative_eq_intros | rule * refl assms Suc)+ | |
| 5814 | apply (simp add: Suc) | |
| 5815 | done | |
| 5816 | qed | |
| 5817 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5818 | proposition higher_deriv_add: | 
| 61848 | 5819 | fixes z::complex | 
| 5820 | assumes "f holomorphic_on s" "g holomorphic_on s" "open s" and z: "z \<in> s" | |
| 5821 | shows "(deriv ^^ n) (\<lambda>w. f w + g w) z = (deriv ^^ n) f z + (deriv ^^ n) g z" | |
| 5822 | using z | |
| 5823 | proof (induction n arbitrary: z) | |
| 5824 | case 0 then show ?case by simp | |
| 5825 | next | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5826 | case (Suc n z) | 
| 61848 | 5827 | have *: "((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) z) (at z)" | 
| 5828 | "((deriv ^^ n) g has_field_derivative deriv ((deriv ^^ n) g) z) (at z)" | |
| 5829 | using Suc.prems assms has_field_derivative_higher_deriv by auto | |
| 5830 | show ?case | |
| 5831 | apply simp | |
| 5832 | apply (rule DERIV_imp_deriv) | |
| 5833 | apply (rule DERIV_transform_within_open [of "\<lambda>w. (deriv ^^ n) f w + (deriv ^^ n) g w"]) | |
| 5834 | apply (rule derivative_eq_intros | rule * refl assms Suc)+ | |
| 5835 | apply (simp add: Suc) | |
| 5836 | done | |
| 5837 | qed | |
| 5838 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5839 | corollary higher_deriv_diff: | 
| 61848 | 5840 | fixes z::complex | 
| 5841 | assumes "f holomorphic_on s" "g holomorphic_on s" "open s" and z: "z \<in> s" | |
| 5842 | shows "(deriv ^^ n) (\<lambda>w. f w - g w) z = (deriv ^^ n) f z - (deriv ^^ n) g z" | |
| 5843 | apply (simp only: Groups.group_add_class.diff_conv_add_uminus higher_deriv_add) | |
| 5844 | apply (subst higher_deriv_add) | |
| 5845 | using assms holomorphic_on_minus apply (auto simp: higher_deriv_uminus) | |
| 5846 | done | |
| 5847 | ||
| 5848 | ||
| 5849 | 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 | 5850 | by (cases k) simp_all | 
| 61848 | 5851 | |
| 5852 | proposition higher_deriv_mult: | |
| 5853 | fixes z::complex | |
| 5854 | 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 | 5855 | shows "(deriv ^^ n) (\<lambda>w. f w * g w) z = | 
| 61848 | 5856 | (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f z * (deriv ^^ (n - i)) g z)" | 
| 5857 | using z | |
| 5858 | proof (induction n arbitrary: z) | |
| 5859 | case 0 then show ?case by simp | |
| 5860 | next | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5861 | case (Suc n z) | 
| 61848 | 5862 | have *: "\<And>n. ((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) z) (at z)" | 
| 5863 | "\<And>n. ((deriv ^^ n) g has_field_derivative deriv ((deriv ^^ n) g) z) (at z)" | |
| 5864 | using Suc.prems assms has_field_derivative_higher_deriv by auto | |
| 5865 | have sumeq: "(\<Sum>i = 0..n. | |
| 5866 | 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)) = | |
| 5867 | 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 | 5868 | apply (simp add: bb algebra_simps sum.distrib) | 
| 5869 | apply (subst (4) sum_Suc_reindex) | |
| 5870 | apply (auto simp: algebra_simps Suc_diff_le intro: sum.cong) | |
| 61848 | 5871 | done | 
| 5872 | show ?case | |
| 5873 | apply (simp only: funpow.simps o_apply) | |
| 5874 | apply (rule DERIV_imp_deriv) | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5875 | apply (rule DERIV_transform_within_open | 
| 61848 | 5876 | [of "\<lambda>w. (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f w * (deriv ^^ (n - i)) g w)"]) | 
| 5877 | apply (simp add: algebra_simps) | |
| 64267 | 5878 | apply (rule DERIV_cong [OF DERIV_sum]) | 
| 61848 | 5879 | apply (rule DERIV_cmult) | 
| 5880 | apply (auto simp: intro: DERIV_mult * sumeq \<open>open s\<close> Suc.prems Suc.IH [symmetric]) | |
| 5881 | done | |
| 5882 | qed | |
| 5883 | ||
| 5884 | ||
| 5885 | proposition higher_deriv_transform_within_open: | |
| 5886 | fixes z::complex | |
| 5887 | assumes "f holomorphic_on s" "g holomorphic_on s" "open s" and z: "z \<in> s" | |
| 5888 | and fg: "\<And>w. w \<in> s \<Longrightarrow> f w = g w" | |
| 5889 | shows "(deriv ^^ i) f z = (deriv ^^ i) g z" | |
| 5890 | using z | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5891 | by (induction i arbitrary: z) | 
| 61848 | 5892 | (auto simp: fg intro: complex_derivative_transform_within_open holomorphic_higher_deriv assms) | 
| 5893 | ||
| 5894 | proposition higher_deriv_compose_linear: | |
| 5895 | fixes z::complex | |
| 5896 | assumes f: "f holomorphic_on t" and s: "open s" and t: "open t" and z: "z \<in> s" | |
| 5897 | and fg: "\<And>w. w \<in> s \<Longrightarrow> u * w \<in> t" | |
| 5898 | shows "(deriv ^^ n) (\<lambda>w. f (u * w)) z = u^n * (deriv ^^ n) f (u * z)" | |
| 5899 | using z | |
| 5900 | proof (induction n arbitrary: z) | |
| 5901 | case 0 then show ?case by simp | |
| 5902 | next | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5903 | case (Suc n z) | 
| 61848 | 5904 | have holo0: "f holomorphic_on op * u ` s" | 
| 5905 | by (meson fg f holomorphic_on_subset image_subset_iff) | |
| 5906 | have holo1: "(\<lambda>w. f (u * w)) holomorphic_on s" | |
| 5907 | apply (rule holomorphic_on_compose [where g=f, unfolded o_def]) | |
| 5908 | apply (rule holo0 holomorphic_intros)+ | |
| 5909 | done | |
| 5910 | have holo2: "(\<lambda>z. u ^ n * (deriv ^^ n) f (u * z)) holomorphic_on s" | |
| 5911 | apply (rule holomorphic_intros)+ | |
| 5912 | apply (rule holomorphic_on_compose [where g="(deriv ^^ n) f", unfolded o_def]) | |
| 5913 | apply (rule holomorphic_intros) | |
| 5914 | apply (rule holomorphic_on_subset [where s=t]) | |
| 5915 | apply (rule holomorphic_intros assms)+ | |
| 5916 | apply (blast intro: fg) | |
| 5917 | done | |
| 5918 | have "deriv ((deriv ^^ n) (\<lambda>w. f (u * w))) z = deriv (\<lambda>z. u^n * (deriv ^^ n) f (u*z)) z" | |
| 5919 | apply (rule complex_derivative_transform_within_open [OF _ holo2 s Suc.prems]) | |
| 5920 | apply (rule holomorphic_higher_deriv [OF holo1 s]) | |
| 5921 | apply (simp add: Suc.IH) | |
| 5922 | done | |
| 5923 | also have "... = 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 | 5924 | apply (rule deriv_cmult) | 
| 61848 | 5925 | apply (rule analytic_on_imp_differentiable_at [OF _ Suc.prems]) | 
| 5926 | apply (rule analytic_on_compose_gen [where g="(deriv ^^ n) f" and t=t, unfolded o_def]) | |
| 5927 | apply (simp add: analytic_on_linear) | |
| 5928 | apply (simp add: analytic_on_open f holomorphic_higher_deriv t) | |
| 5929 | apply (blast intro: fg) | |
| 5930 | done | |
| 5931 | also have "... = u * u ^ n * deriv ((deriv ^^ n) f) (u * z)" | |
| 5932 | apply (subst complex_derivative_chain [where g = "(deriv ^^ n) f" and f = "op*u", unfolded o_def]) | |
| 5933 | apply (rule derivative_intros) | |
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 5934 | using Suc.prems field_differentiable_def f fg has_field_derivative_higher_deriv t apply blast | 
| 61848 | 5935 | apply (simp add: deriv_linear) | 
| 5936 | done | |
| 5937 | finally show ?case | |
| 5938 | by simp | |
| 5939 | qed | |
| 5940 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5941 | lemma higher_deriv_add_at: | 
| 61848 | 5942 |   assumes "f analytic_on {z}" "g analytic_on {z}"
 | 
| 5943 | shows "(deriv ^^ n) (\<lambda>w. f w + g w) z = (deriv ^^ n) f z + (deriv ^^ n) g z" | |
| 5944 | proof - | |
| 5945 |   have "f analytic_on {z} \<and> g analytic_on {z}"
 | |
| 5946 | using assms by blast | |
| 5947 | with higher_deriv_add show ?thesis | |
| 5948 | by (auto simp: analytic_at_two) | |
| 5949 | qed | |
| 5950 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5951 | lemma higher_deriv_diff_at: | 
| 61848 | 5952 |   assumes "f analytic_on {z}" "g analytic_on {z}"
 | 
| 5953 | shows "(deriv ^^ n) (\<lambda>w. f w - g w) z = (deriv ^^ n) f z - (deriv ^^ n) g z" | |
| 5954 | proof - | |
| 5955 |   have "f analytic_on {z} \<and> g analytic_on {z}"
 | |
| 5956 | using assms by blast | |
| 5957 | with higher_deriv_diff show ?thesis | |
| 5958 | by (auto simp: analytic_at_two) | |
| 5959 | qed | |
| 5960 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5961 | lemma higher_deriv_uminus_at: | 
| 61848 | 5962 |    "f analytic_on {z}  \<Longrightarrow> (deriv ^^ n) (\<lambda>w. -(f w)) z = - ((deriv ^^ n) f z)"
 | 
| 5963 | using higher_deriv_uminus | |
| 5964 | by (auto simp: analytic_at) | |
| 5965 | ||
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5966 | lemma higher_deriv_mult_at: | 
| 61848 | 5967 |   assumes "f analytic_on {z}" "g analytic_on {z}"
 | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5968 | shows "(deriv ^^ n) (\<lambda>w. f w * g w) z = | 
| 61848 | 5969 | (\<Sum>i = 0..n. of_nat (n choose i) * (deriv ^^ i) f z * (deriv ^^ (n - i)) g z)" | 
| 5970 | proof - | |
| 5971 |   have "f analytic_on {z} \<and> g analytic_on {z}"
 | |
| 5972 | using assms by blast | |
| 5973 | with higher_deriv_mult show ?thesis | |
| 5974 | by (auto simp: analytic_at_two) | |
| 5975 | qed | |
| 5976 | ||
| 5977 | ||
| 5978 | text\<open> Nonexistence of isolated singularities and a stronger integral formula.\<close> | |
| 5979 | ||
| 5980 | proposition no_isolated_singularity: | |
| 5981 | fixes z::complex | |
| 5982 | assumes f: "continuous_on s f" and holf: "f holomorphic_on (s - k)" and s: "open s" and k: "finite k" | |
| 5983 | shows "f holomorphic_on s" | |
| 5984 | proof - | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5985 |   { fix z
 | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 5986 | assume "z \<in> s" and cdf: "\<And>x. x\<in>s - k \<Longrightarrow> f 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 | 5987 | have "f field_differentiable at z" | 
| 61848 | 5988 | proof (cases "z \<in> k") | 
| 5989 | case False then show ?thesis by (blast intro: cdf \<open>z \<in> s\<close>) | |
| 5990 | next | |
| 5991 | case True | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5992 | with finite_set_avoid [OF k, of z] | 
| 61848 | 5993 | obtain d where "d>0" and d: "\<And>x. \<lbrakk>x\<in>k; x \<noteq> z\<rbrakk> \<Longrightarrow> d \<le> dist z x" | 
| 5994 | by blast | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 5995 | obtain e where "e>0" and e: "ball z e \<subseteq> s" | 
| 61848 | 5996 | using s \<open>z \<in> s\<close> by (force simp add: open_contains_ball) | 
| 5997 | have fde: "continuous_on (ball z (min d e)) f" | |
| 5998 | by (metis Int_iff ball_min_Int continuous_on_subset e f subsetI) | |
| 5999 | have "\<exists>g. \<forall>w \<in> ball z (min d e). (g has_field_derivative f w) (at w within ball z (min d e))" | |
| 6000 | apply (rule contour_integral_convex_primitive [OF convex_ball fde]) | |
| 6001 | apply (rule Cauchy_theorem_triangle_cofinite [OF _ k]) | |
| 6002 | apply (metis continuous_on_subset [OF fde] closed_segment_subset convex_ball starlike_convex_subset) | |
| 6003 | apply (rule cdf) | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6004 | apply (metis Diff_iff Int_iff ball_min_Int bot_least contra_subsetD convex_ball e insert_subset | 
| 61848 | 6005 | interior_mono interior_subset subset_hull) | 
| 6006 | done | |
| 6007 | then have "f holomorphic_on ball z (min d e)" | |
| 6008 | by (metis open_ball at_within_open derivative_is_holomorphic) | |
| 6009 | then show ?thesis | |
| 6010 | unfolding holomorphic_on_def | |
| 6011 | by (metis open_ball \<open>0 < d\<close> \<open>0 < e\<close> at_within_open centre_in_ball min_less_iff_conj) | |
| 6012 | qed | |
| 6013 | } | |
| 6014 | 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 | 6015 | by (simp add: holomorphic_on_open open_Diff finite_imp_closed field_differentiable_def [symmetric]) | 
| 61848 | 6016 | qed | 
| 6017 | ||
| 66286 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6018 | lemma no_isolated_singularity': | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6019 | fixes z::complex | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6020 | assumes f: "\<And>z. z \<in> k \<Longrightarrow> (f \<longlongrightarrow> f z) (at z within s)" | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6021 | and holf: "f holomorphic_on (s - k)" and s: "open s" and k: "finite k" | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6022 | shows "f holomorphic_on s" | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6023 | proof (rule no_isolated_singularity[OF _ assms(2-)]) | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6024 | show "continuous_on s f" unfolding continuous_on_def | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6025 | proof | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6026 | fix z assume z: "z \<in> s" | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6027 | show "(f \<longlongrightarrow> f z) (at z within s)" | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6028 | proof (cases "z \<in> k") | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6029 | case False | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6030 | from holf have "continuous_on (s - k) f" | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6031 | by (rule holomorphic_on_imp_continuous_on) | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6032 | with z False have "(f \<longlongrightarrow> f z) (at z within (s - k))" | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6033 | by (simp add: continuous_on_def) | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6034 | also from z k s False have "at z within (s - k) = at z within s" | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6035 | by (subst (1 2) at_within_open) (auto intro: finite_imp_closed) | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6036 | finally show "(f \<longlongrightarrow> f z) (at z within s)" . | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6037 | qed (insert assms z, simp_all) | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6038 | qed | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6039 | qed | 
| 
1c977b13414f
poles and residues of the Gamma function
 eberlm <eberlm@in.tum.de> parents: 
66193diff
changeset | 6040 | |
| 61848 | 6041 | proposition Cauchy_integral_formula_convex: | 
| 6042 | assumes s: "convex s" and k: "finite k" and contf: "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 | 6043 | and fcd: "(\<And>x. x \<in> interior s - k \<Longrightarrow> f field_differentiable at x)" | 
| 61848 | 6044 | and z: "z \<in> interior s" and vpg: "valid_path \<gamma>" | 
| 6045 |         and pasz: "path_image \<gamma> \<subseteq> s - {z}" and loop: "pathfinish \<gamma> = pathstart \<gamma>"
 | |
| 63589 | 6046 | shows "((\<lambda>w. f w / (w - z)) has_contour_integral (2*pi * \<i> * winding_number \<gamma> z * f z)) \<gamma>" | 
| 61848 | 6047 | apply (rule Cauchy_integral_formula_weak [OF s finite.emptyI contf]) | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6048 | apply (simp add: holomorphic_on_open [symmetric] field_differentiable_def) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6049 | using no_isolated_singularity [where s = "interior s"] | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6050 | apply (metis k contf fcd holomorphic_on_open field_differentiable_def continuous_on_subset | 
| 61848 | 6051 | has_field_derivative_at_within holomorphic_on_def interior_subset open_interior) | 
| 6052 | using assms | |
| 6053 | apply auto | |
| 6054 | done | |
| 6055 | ||
| 6056 | ||
| 6057 | text\<open> Formula for higher derivatives.\<close> | |
| 6058 | ||
| 6059 | proposition Cauchy_has_contour_integral_higher_derivative_circlepath: | |
| 6060 | assumes contf: "continuous_on (cball z r) f" | |
| 6061 | and holf: "f holomorphic_on ball z r" | |
| 6062 | and w: "w \<in> ball z r" | |
| 63589 | 6063 | shows "((\<lambda>u. f u / (u - w) ^ (Suc k)) has_contour_integral ((2 * pi * \<i>) / (fact k) * (deriv ^^ k) f w)) | 
| 61848 | 6064 | (circlepath z r)" | 
| 6065 | using w | |
| 6066 | proof (induction k arbitrary: w) | |
| 6067 | case 0 then show ?case | |
| 6068 | using assms by (auto simp: Cauchy_integral_circlepath dist_commute dist_norm) | |
| 6069 | next | |
| 6070 | case (Suc k) | |
| 6071 | have [simp]: "r > 0" using w | |
| 6072 | using ball_eq_empty by fastforce | |
| 6073 | have f: "continuous_on (path_image (circlepath z r)) f" | |
| 6074 | by (rule continuous_on_subset [OF contf]) (force simp add: cball_def sphere_def less_imp_le) | |
| 6075 | obtain X where X: "((\<lambda>u. f u / (u - w) ^ Suc (Suc k)) has_contour_integral X) (circlepath z r)" | |
| 6076 | using Cauchy_next_derivative_circlepath(1) [OF f Suc.IH _ Suc.prems] | |
| 6077 | by (auto simp: contour_integrable_on_def) | |
| 6078 | then have con: "contour_integral (circlepath z r) ((\<lambda>u. f u / (u - w) ^ Suc (Suc k))) = X" | |
| 6079 | by (rule contour_integral_unique) | |
| 6080 | have "\<And>n. ((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) w) (at w)" | |
| 6081 | 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 | 6082 | then have dnf_diff: "\<And>n. (deriv ^^ n) f field_differentiable (at w)" | 
| 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6083 | by (force simp add: field_differentiable_def) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6084 | have "deriv (\<lambda>w. complex_of_real (2 * pi) * \<i> / (fact k) * (deriv ^^ k) f w) w = | 
| 61848 | 6085 | 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 | 6086 | by (force intro!: DERIV_imp_deriv Cauchy_next_derivative_circlepath [OF f Suc.IH _ Suc.prems]) | 
| 61848 | 6087 | also have "... = of_nat (Suc k) * X" | 
| 6088 | by (simp only: con) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6089 | 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 | 6090 | 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 | 6091 | by (metis deriv_cmult dnf_diff) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6092 | then have "deriv (\<lambda>w. (deriv ^^ k) f w) w = of_nat (Suc k) * X / ((2 * pi) * \<i> / (fact k))" | 
| 61848 | 6093 | by (simp add: field_simps) | 
| 6094 | then show ?case | |
| 6095 | using of_nat_eq_0_iff X by fastforce | |
| 6096 | qed | |
| 6097 | ||
| 6098 | proposition Cauchy_higher_derivative_integral_circlepath: | |
| 6099 | assumes contf: "continuous_on (cball z r) f" | |
| 6100 | and holf: "f holomorphic_on ball z r" | |
| 6101 | and w: "w \<in> ball z r" | |
| 6102 | shows "(\<lambda>u. f u / (u - w)^(Suc k)) contour_integrable_on (circlepath z r)" | |
| 6103 | (is "?thes1") | |
| 63589 | 6104 | and "(deriv ^^ k) f w = (fact k) / (2 * pi * \<i>) * contour_integral(circlepath z r) (\<lambda>u. f u/(u - w)^(Suc k))" | 
| 61848 | 6105 | (is "?thes2") | 
| 6106 | proof - | |
| 6107 | have *: "((\<lambda>u. f u / (u - w) ^ Suc k) has_contour_integral (2 * pi) * \<i> / (fact k) * (deriv ^^ k) f w) | |
| 6108 | (circlepath z r)" | |
| 6109 | using Cauchy_has_contour_integral_higher_derivative_circlepath [OF assms] | |
| 6110 | by simp | |
| 6111 | show ?thes1 using * | |
| 6112 | using contour_integrable_on_def by blast | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6113 | show ?thes2 | 
| 61848 | 6114 | unfolding contour_integral_unique [OF *] by (simp add: divide_simps) | 
| 6115 | qed | |
| 6116 | ||
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6117 | corollary Cauchy_contour_integral_circlepath: | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6118 | assumes "continuous_on (cball z r) f" "f holomorphic_on ball z r" "w \<in> ball z r" | 
| 63589 | 6119 | 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 | 6120 | 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 | 6121 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6122 | corollary Cauchy_contour_integral_circlepath_2: | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6123 | assumes "continuous_on (cball z r) f" "f holomorphic_on ball z r" "w \<in> ball z r" | 
| 63589 | 6124 | 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 | 6125 | 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 | 6126 | by (simp add: power2_eq_square) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6127 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6128 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6129 | subsection\<open>A holomorphic function is analytic, i.e. has local power series.\<close> | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6130 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6131 | theorem holomorphic_power_series: | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6132 | assumes holf: "f holomorphic_on ball z r" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6133 | and w: "w \<in> ball z r" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6134 | 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 | 6135 | proof - | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6136 | have fh': "f holomorphic_on cball z ((r + dist w z) / 2)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6137 | apply (rule holomorphic_on_subset [OF holf]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6138 | apply (clarsimp simp del: divide_const_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6139 | apply (metis add.commute dist_commute le_less_trans mem_ball real_gt_half_sum w) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6140 | done | 
| 62175 | 6141 |   \<comment>\<open>Replacing @{term r} and the original (weak) premises\<close>
 | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6142 | obtain r where "0 < r" and holfc: "f holomorphic_on cball z r" and w: "w \<in> ball z r" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6143 | apply (rule that [of "(r + dist w z) / 2"]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6144 | apply (simp_all add: fh') | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6145 | apply (metis add_0_iff ball_eq_empty dist_nz dist_self empty_iff not_less pos_add_strict w) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6146 | apply (metis add_less_cancel_right dist_commute mem_ball mult_2_right w) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6147 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6148 | then have holf: "f holomorphic_on ball z r" and contf: "continuous_on (cball z r) f" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6149 | using ball_subset_cball holomorphic_on_subset apply blast | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6150 | 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 | 6151 | have cint: "\<And>k. (\<lambda>u. f u / (u - z) ^ Suc k) contour_integrable_on circlepath z r" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6152 | apply (rule Cauchy_higher_derivative_integral_circlepath [OF contf holf]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6153 | apply (simp add: \<open>0 < r\<close>) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6154 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6155 | 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 | 6156 | 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 | 6157 | 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 | 6158 | and kle: "\<And>u. norm(u - z) = r \<Longrightarrow> k \<le> norm(u - w)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6159 | apply (rule_tac k = "r - dist z w" in that) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6160 | using w | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6161 | apply (auto simp: dist_norm norm_minus_commute) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6162 | by (metis add_diff_eq diff_add_cancel norm_diff_ineq norm_minus_commute) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6163 | 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" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6164 | 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 | 6165 | 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 | 6166 | 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 | 6167 | assume "0 < e" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6168 | 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 | 6169 | 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 | 6170 | 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 | 6171 | 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 | 6172 | 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 | 6173 | proof - | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6174 | 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 | 6175 | 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 | 6176 | 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 | 6177 | 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 | 6178 | 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 | 6179 | 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 | 6180 | 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 | 6181 | 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 | 6182 | = norm ((\<Sum>k<N. (((w - z) / (u - z)) ^ k)) * f u * (u - w) / (u - z) - f u)" | 
| 64267 | 6183 | unfolding sum_distrib_right sum_divide_distrib power_divide by (simp add: algebra_simps) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6184 | also have "... = norm ((((w - z) / (u - z)) ^ N - 1) * (u - w) / (((w - z) / (u - z) - 1) * (u - z)) - 1) * norm (f u)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6185 | using \<open>0 < B\<close> | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6186 | apply (auto simp: geometric_sum [OF wzu_not1]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6187 | apply (simp add: field_simps norm_mult [symmetric]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6188 | done | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6189 | also have "... = 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 | 6190 | using \<open>0 < r\<close> r by (simp add: divide_simps norm_mult norm_divide norm_power dist_norm norm_minus_commute) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6191 | also have "... = norm ((w - z) ^ N * (w - u)) / (r ^ N * norm (u - w)) * norm (f u)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6192 | by (simp add: algebra_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6193 | also have "... = norm (w - z) ^ N * norm (f u) / r ^ N" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6194 | by (simp add: norm_mult norm_power norm_minus_commute) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6195 | also have "... \<le> (((r - k)/r)^N) * B" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6196 | using \<open>0 < r\<close> w k | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6197 | apply (simp add: divide_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6198 | apply (rule mult_mono [OF power_mono]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6199 | 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 | 6200 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6201 | also have "... < e * k" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6202 | using \<open>0 < B\<close> N by (simp add: divide_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6203 | also have "... \<le> e * norm (u - w)" | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6204 | 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 | 6205 | finally show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6206 | 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 | 6207 | 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 | 6208 | 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 | 6209 | 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 | 6210 | 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 | 6211 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6212 | have eq: "\<forall>\<^sub>F x in sequentially. | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6213 | 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 | 6214 | (\<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 | 6215 | apply (rule eventuallyI) | 
| 64267 | 6216 | apply (subst contour_integral_sum, simp) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6217 | 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 | 6218 | 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 | 6219 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6220 | 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 | 6221 | 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 | 6222 | unfolding sums_def | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6223 | apply (rule Lim_transform_eventually [OF 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 | 6224 | apply (rule contour_integral_uniform_limit_circlepath [OF eventuallyI ul]) | 
| 64267 | 6225 | apply (rule contour_integrable_sum, simp) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6226 | apply (rule contour_integrable_lmul) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6227 | apply (rule Cauchy_higher_derivative_integral_circlepath [OF contf holf]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6228 | using \<open>0 < r\<close> | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6229 | apply auto | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6230 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6231 | then have "(\<lambda>k. contour_integral (circlepath z r) (\<lambda>u. f u/(u - z)^(Suc k)) * (w - z)^k) | 
| 63589 | 6232 | 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 | 6233 | 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 | 6234 | 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 | 6235 | 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 | 6236 | by (rule sums_divide) | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6237 | 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 | 6238 | sums f w" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6239 | by (simp add: field_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6240 | then show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6241 | 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 | 6242 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6243 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6244 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6245 | subsection\<open>The Liouville theorem and the Fundamental Theorem of Algebra.\<close> | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6246 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6247 | 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 | 6248 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6249 | lemma Liouville_weak_0: | 
| 61973 | 6250 | 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 | 6251 | shows "f z = 0" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6252 | proof (rule ccontr) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6253 | assume fz: "f z \<noteq> 0" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6254 | 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 | 6255 | 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 | 6256 | by (auto simp: dist_norm) | 
| 63040 | 6257 | define R where "R = 1 + \<bar>B\<bar> + norm z" | 
| 63262 | 6258 | 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 | 6259 | proof - | 
| 
de25474ce728
Contractible sets. Also removal of obsolete theorems and refactoring
 paulson <lp15@cam.ac.uk> parents: 
62623diff
changeset | 6260 | 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 | 6261 | 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 | 6262 | 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 | 6263 | by linarith | 
| 63262 | 6264 | qed | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6265 | 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 | 6266 | apply (rule Cauchy_integral_circlepath) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6267 | 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 | 6268 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6269 | have "cmod (x - z) = R \<Longrightarrow> cmod (f x) * 2 \<le> cmod (f z)" for x | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6270 | apply (simp add: R_def) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6271 | apply (rule less_imp_le) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6272 | apply (rule B) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6273 | using norm_triangle_ineq4 [of x z] | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6274 | apply (auto simp:) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6275 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6276 | with \<open>R > 0\<close> fz show False | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6277 | using has_contour_integral_bound_circlepath [OF *, of "norm(f z)/2/R"] | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6278 | by (auto simp: norm_mult norm_divide divide_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6279 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6280 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6281 | proposition Liouville_weak: | 
| 61973 | 6282 | 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 | 6283 | shows "f z = l" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6284 | 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 | 6285 | 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 | 6286 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6287 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6288 | proposition Liouville_weak_inverse: | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6289 | 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 | 6290 | obtains z where "f z = 0" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6291 | proof - | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6292 |   { assume f: "\<And>z. f z \<noteq> 0"
 | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6293 | 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 | 6294 | by (simp add: holomorphic_on_divide holomorphic_on_const assms f) | 
| 61973 | 6295 | 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 | 6296 | apply (rule tendstoI [OF eventually_mono]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6297 | apply (rule_tac B="2/e" in unbounded) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6298 | 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 | 6299 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6300 | have False | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6301 | 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 | 6302 | } | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6303 | then show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6304 | using that by blast | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6305 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6306 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6307 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6308 | 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 | 6309 | |
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6310 | theorem fundamental_theorem_of_algebra: | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6311 | fixes a :: "nat \<Rightarrow> complex" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6312 |   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 | 6313 | 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 | 6314 | using assms | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6315 | proof (elim disjE bexE) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6316 | assume "a 0 = 0" then show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6317 | by (auto simp: that [of 0]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6318 | next | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6319 | fix i | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6320 |   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 | 6321 | 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 | 6322 | by (rule holomorphic_intros)+ | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6323 | show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6324 | apply (rule Liouville_weak_inverse [OF 1]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6325 | apply (rule polyfun_extremal) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6326 | apply (rule nz) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6327 | using i that | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6328 | apply (auto simp:) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6329 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6330 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6331 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6332 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6333 | subsection\<open> Weierstrass convergence theorem.\<close> | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6334 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6335 | proposition holomorphic_uniform_limit: | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6336 | 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 | 6337 | 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 | 6338 | and F: "~ trivial_limit F" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6339 | 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 | 6340 | proof (cases r "0::real" rule: linorder_cases) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6341 | case less then show ?thesis by (force simp add: ball_empty less_imp_le continuous_on_def holomorphic_on_def intro: that) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6342 | next | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6343 | case equal then show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6344 | by (force simp add: holomorphic_on_def continuous_on_sing intro: that) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6345 | next | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6346 | case greater | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6347 | 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 | 6348 | using cont uniform_limit_theorem [OF eventually_mono ulim F] by blast | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6349 | have 1: "continuous_on (path_image (circlepath z r)) (\<lambda>x. 1 / (2 * complex_of_real pi * \<i>) * g x)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6350 | apply (rule continuous_intros continuous_on_subset [OF contg])+ | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6351 | using \<open>0 < r\<close> by auto | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6352 | 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 | 6353 | 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 | 6354 | proof - | 
| 63040 | 6355 | define d where "d = (r - norm(w - z))" | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6356 | 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 | 6357 | 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 | 6358 | 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 | 6359 | 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 | 6360 | apply (rule eventually_mono [OF cont]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6361 | using w | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6362 | 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 | 6363 | 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 | 6364 | have ul_less: "uniform_limit (sphere z r) (\<lambda>n x. f n x / (x - w)) (\<lambda>x. g x / (x - w)) F" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6365 | using greater \<open>0 < d\<close> | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6366 | 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 | 6367 | 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 | 6368 | 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 | 6369 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6370 | 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 | 6371 | by (rule contour_integral_uniform_limit_circlepath [OF ev_int ul_less F \<open>0 < r\<close>]) | 
| 61973 | 6372 | 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 | 6373 | by (rule contour_integral_uniform_limit_circlepath [OF ev_int ul_less F \<open>0 < r\<close>]) | 
| 63589 | 6374 | 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" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6375 | apply (rule Lim_transform_eventually [where f = "\<lambda>n. contour_integral (circlepath z r) (\<lambda>u. f n u/(u - w))"]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6376 | apply (rule eventually_mono [OF cont]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6377 | apply (rule contour_integral_unique [OF Cauchy_integral_circlepath]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6378 | using w | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6379 | apply (auto simp: norm_minus_commute dist_norm cif_tends_cig) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6380 | done | 
| 61973 | 6381 | have "((\<lambda>n. 2 * of_real pi * \<i> * f n w) \<longlongrightarrow> 2 * of_real pi * \<i> * g w) F" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6382 | apply (rule tendsto_mult_left [OF tendstoI]) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6383 | apply (rule eventually_mono [OF uniform_limitD [OF ulim]], assumption) | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6384 | using w | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6385 | apply (force simp add: dist_norm) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6386 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6387 | 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 | 6388 | using has_contour_integral_integral [OF g_cint] tendsto_unique [OF F f_tends_cig] w | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6389 | by (force simp add: dist_norm) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6390 | 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 | 6391 | using has_contour_integral_div [where c = "2 * of_real pi * \<i>"] | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6392 | by (force simp add: field_simps) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6393 | then show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6394 | by (simp add: dist_norm) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6395 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6396 | show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6397 | 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 | 6398 | 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 | 6399 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6400 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6401 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6402 | 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 | 6403 | |
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6404 | proposition has_complex_derivative_uniform_limit: | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6405 | fixes z::complex | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6406 | 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 | 6407 | (\<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 | 6408 | 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 | 6409 | and F: "~ trivial_limit F" and "0 < r" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6410 | obtains g' where | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6411 | "continuous_on (cball z r) g" | 
| 61973 | 6412 | "\<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 | 6413 | proof - | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6414 | let ?conint = "contour_integral (circlepath z r)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6415 | 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 | 6416 | 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 | 6417 | 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 | 6418 | 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 | 6419 | using DERIV_deriv_iff_has_field_derivative | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6420 | by (fastforce simp add: holomorphic_on_open) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6421 | 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 | 6422 | by (simp add: DERIV_imp_deriv) | 
| 61973 | 6423 | 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 | 6424 | proof - | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6425 | 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 | 6426 | 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 | 6427 | 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 | 6428 | proof - | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6429 | have hol_fn: "f n holomorphic_on ball z r" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6430 | using fnd by (force simp add: holomorphic_on_open) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6431 | 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 | 6432 | 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 | 6433 | 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 | 6434 | 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 | 6435 | show ?thesis | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6436 | 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 | 6437 | qed | 
| 63040 | 6438 | 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 | 6439 | have "d > 0" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6440 | using w by (simp add: dist_commute dist_norm d_def) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6441 | have dle: "\<And>y. r = cmod (z - y) \<Longrightarrow> d \<le> cmod ((y - w)\<^sup>2)" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6442 | apply (simp add: d_def norm_power) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6443 | apply (rule power_mono) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6444 | apply (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 | 6445 | apply (metis diff_ge_0_iff_ge dist_commute dist_norm less_eq_real_def mem_ball w) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6446 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6447 | have 1: "\<forall>\<^sub>F n in F. (\<lambda>x. f n x / (x - w)\<^sup>2) contour_integrable_on circlepath z r" | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6448 | by (force simp add: 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 | 6449 | 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 | 6450 | 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 | 6451 | 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 | 6452 | 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 | 6453 | assume "0 < e" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6454 | with \<open>r > 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 | 6455 | 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" | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6456 | apply (simp add: diff_divide_distrib [symmetric] norm_divide divide_simps sphere_def 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 | 6457 | 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 | 6458 | apply (simp add: \<open>0 < d\<close>) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6459 | apply (force simp add: dist_norm dle intro: less_le_trans) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6460 | done | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6461 | qed | 
| 62087 
44841d07ef1d
revisions to limits and derivatives, plus new lemmas
 paulson parents: 
61976diff
changeset | 6462 | have "((\<lambda>n. contour_integral (circlepath z r) (\<lambda>x. f n x / (x - w)\<^sup>2)) | 
| 61973 | 6463 | \<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 | 6464 | by (rule contour_integral_uniform_limit_circlepath [OF 1 2 F \<open>0 < r\<close>]) | 
| 61973 | 6465 | 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 | 6466 | using Lim_null by (force intro!: tendsto_mult_right_zero) | 
| 61973 | 6467 | 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 | 6468 | apply (rule Lim_transform_eventually [OF _ tendsto_0]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6469 | apply (force simp add: divide_simps intro: eq_f' eventually_mono [OF cont]) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6470 | done | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6471 | then show ?thesis using Lim_null by blast | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6472 | qed | 
| 61973 | 6473 | 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" | 
| 61907 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6474 | by (blast intro: tends_f'n_g' g' ) | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6475 | then show ?thesis using g | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6476 | using that by blast | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6477 | qed | 
| 
f0c894ab18c9
Liouville theorem, Fundamental Theorem of Algebra, etc.
 paulson <lp15@cam.ac.uk> parents: 
61848diff
changeset | 6478 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6479 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6480 | subsection\<open>Some more simple/convenient versions for applications.\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6481 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6482 | 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 | 6483 | 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 | 6484 | 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 | 6485 | 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 | 6486 | shows "g holomorphic_on S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6487 | 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 | 6488 | 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 | 6489 | 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 | 6490 | 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 | 6491 | and ul: "uniform_limit (cball z r) 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 | 6492 | 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 | 6493 | have *: "\<forall>\<^sub>F n in sequentially. continuous_on (cball z r) (f n) \<and> f n holomorphic_on ball z r" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6494 | apply (intro eventuallyI conjI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6495 | using hol_fn holomorphic_on_imp_continuous_on holomorphic_on_subset r apply blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6496 | apply (metis hol_fn holomorphic_on_subset interior_cball interior_subset r) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6497 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6498 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6499 | 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 | 6500 | using \<open>0 < r\<close> centre_in_ball ul | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6501 | apply (auto simp: holomorphic_on_open) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6502 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6503 | 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 | 6504 | with S show ?thesis | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6505 | by (simp add: holomorphic_on_open) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6506 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6507 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6508 | 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 | 6509 | 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 | 6510 | 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 | 6511 | 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 | 6512 | 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 | 6513 | \<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 | 6514 | 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 | 6515 | 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 | 6516 | 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 | 6517 | 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 | 6518 | 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 | 6519 | and ul: "uniform_limit (cball z r) 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 | 6520 | 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 | 6521 | 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 | 6522 | (\<forall>w \<in> ball z r. ((f n) has_field_derivative (f' n w)) (at w))" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6523 | apply (intro eventuallyI conjI) | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6524 | apply (meson hfd holomorphic_on_imp_continuous_on holomorphic_on_open holomorphic_on_subset r S) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6525 | using ball_subset_cball hfd r apply blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6526 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6527 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6528 | apply (rule has_complex_derivative_uniform_limit [OF *, of 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 | 6529 | using \<open>0 < r\<close> centre_in_ball ul | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6530 | apply force+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6531 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6532 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6533 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6534 | by (rule bchoice) (blast intro: y) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6535 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6536 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6537 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6538 | subsection\<open>On analytic functions defined by a series.\<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 | 6539 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6540 | 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 | 6541 | 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 | 6542 | assumes S: "open S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6543 | 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 | 6544 | 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 | 6545 | 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 | 6546 | 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 | 6547 | 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 | 6548 | 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 | 6549 | 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 | 6550 | 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 | 6551 | if "x \<in> S" for x | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6552 | 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 | 6553 | 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 | 6554 | using open_contains_cball [of "S"] \<open>x \<in> S\<close> S by blast | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6555 | then show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6556 | apply (rule_tac x=d 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 | 6557 | using g uniform_limit_on_subset | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 6558 | apply (force simp: dist_norm 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 | 6559 | done | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6560 | 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 | 6561 | 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 | 6562 | 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 | 6563 | 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 | 6564 | 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 | 6565 | 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 | 6566 | by (metis sums_def that) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6567 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6568 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6569 | 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 | 6570 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6571 | 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 | 6572 | 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 | 6573 | 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 | 6574 | 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 | 6575 | 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 | 6576 | 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 | 6577 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6578 | 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 | 6579 | if "z \<in> S" for z | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6580 | 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 | 6581 | 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 | 6582 | 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 | 6583 | 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 | 6584 | 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 | 6585 | 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 | 6586 | 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 | 6587 | 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 | 6588 | 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 | 6589 | 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 | 6590 | ((\<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 | 6591 | 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 | 6592 | then have "(\<lambda>n. f' n z) sums g' z" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6593 | 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 | 6594 | 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 | 6595 | 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 | 6596 | by (metis (full_types) Int_iff gg' summable_def that) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6597 | moreover have "((\<lambda>x. \<Sum>n. f n x) has_field_derivative g' z) (at z)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6598 | apply (rule_tac f=g in DERIV_transform_at [OF _ \<open>0 < r\<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 | 6599 | apply (simp add: gg' \<open>z \<in> S\<close> \<open>0 < d\<close>) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6600 | apply (metis (full_types) contra_subsetD dist_commute gg' mem_ball r sums_unique) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6601 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6602 | ultimately show ?thesis by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6603 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6604 | then show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6605 | by (rule_tac x="\<lambda>x. suminf (\<lambda>n. f n x)" in exI) meson | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6606 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6607 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6608 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6609 | 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 | 6610 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6611 | 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 | 6612 | 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 | 6613 | 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 | 6614 | 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 | 6615 | 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 | 6616 | 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 | 6617 | 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 | 6618 | apply (rule ex_forward [OF to_g], assumption) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6619 | apply (erule exE) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6620 | apply (rule_tac x="Re o h" 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 | 6621 | apply (force simp add: 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 | 6622 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6623 | |
| 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 | 6624 | 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 | 6625 | 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 | 6626 | 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 | 6627 | 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 | 6628 | 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 | 6629 | 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 | 6630 | 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 | 6631 | 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 | 6632 | 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 | 6633 | 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 | 6634 | 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 | 6635 | 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 | 6636 | 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 | 6637 | 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 | 6638 | qed | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6639 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6640 | 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 | 6641 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6642 | lemma power_series_and_derivative_0: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6643 | fixes a :: "nat \<Rightarrow> complex" and r::real | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6644 | assumes "summable (\<lambda>n. a n * r^n)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6645 | shows "\<exists>g g'. \<forall>z. cmod z < r \<longrightarrow> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6646 | ((\<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 | 6647 | proof (cases "0 < r") | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6648 | case True | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6649 | 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 | 6650 | by (rule derivative_eq_intros | simp)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6651 | 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 | 6652 | using \<open>r > 0\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6653 | apply (auto simp: algebra_simps norm_mult norm_divide norm_power of_real_add [symmetric] simp del: of_real_add) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6654 | using norm_triangle_ineq2 [of y z] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6655 | apply (simp only: diff_le_eq norm_minus_commute mult_2) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6656 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6657 | have "summable (\<lambda>n. a n * complex_of_real r ^ n)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6658 | using assms \<open>r > 0\<close> by simp | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6659 | 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 | 6660 | using \<open>r > 0\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6661 | by (simp add: of_real_add [symmetric] del: of_real_add) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6662 | 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 | 6663 | by (rule power_series_conv_imp_absconv_weak) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6664 | 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 | 6665 | (\<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 | 6666 | apply (rule series_and_derivative_comparison_complex [OF open_ball der]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6667 | apply (rule_tac x="(r - norm z)/2" in exI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6668 | apply (simp add: dist_norm) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6669 | 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 | 6670 | using \<open>r > 0\<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 | 6671 | apply (auto simp: sum eventually_sequentially norm_mult norm_divide norm_power) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6672 | apply (rule_tac x=0 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 | 6673 | apply (force simp: dist_norm intro!: mult_left_mono power_mono y_le) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6674 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6675 | 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 | 6676 | by (simp add: ball_def) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6677 | next | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6678 | case False then show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6679 | apply (simp add: not_less) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6680 | using less_le_trans norm_not_less_zero by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6681 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6682 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6683 | proposition power_series_and_derivative: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6684 | fixes a :: "nat \<Rightarrow> complex" and r::real | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6685 | assumes "summable (\<lambda>n. a n * r^n)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6686 | obtains g g' where "\<forall>z \<in> ball w r. | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6687 | ((\<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 | 6688 | (g has_field_derivative g' z) (at z)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6689 | using power_series_and_derivative_0 [OF assms] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6690 | apply clarify | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6691 | 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 | 6692 | using DERIV_shift [where z="-w"] | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6693 | apply (auto simp: norm_minus_commute Ball_def dist_norm) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6694 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6695 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6696 | proposition power_series_holomorphic: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6697 | 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 | 6698 | shows "f holomorphic_on ball z r" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6699 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6700 | 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 | 6701 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6702 | 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 | 6703 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6704 | have wz: "cmod (w - z) < r" using w | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6705 | by (auto simp: divide_simps dist_norm norm_minus_commute) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6706 | then have "0 \<le> r" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6707 | by (meson less_eq_real_def norm_ge_zero order_trans) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6708 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6709 | using w by (simp add: dist_norm \<open>0\<le>r\<close> of_real_add [symmetric] del: of_real_add) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6710 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6711 | have sum: "summable (\<lambda>n. a n * of_real (((cmod (z - w) + r) / 2) ^ n))" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6712 | using assms [OF inb] by (force simp add: summable_def dist_norm) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6713 | 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 | 6714 | (\<lambda>n. a n * (u - z) ^ n) sums g u \<and> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6715 | (\<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 | 6716 | by (rule power_series_and_derivative [OF sum, of z]) fastforce | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6717 | 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 | 6718 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6719 | have less: "cmod (z - u) * 2 < cmod (z - w) + r" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6720 | using that dist_triangle2 [of z u w] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6721 | by (simp add: dist_norm [symmetric] algebra_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6722 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6723 | 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 | 6724 | using gg' [of u] less w | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6725 | apply (auto simp: assms dist_norm) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6726 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6727 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6728 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6729 | apply (rule_tac x="g' w" in exI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6730 | apply (rule DERIV_transform_at [where f=g and d="(r - norm(z - w))/2"]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6731 | using w gg' [of w] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6732 | apply (auto simp: dist_norm) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6733 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6734 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6735 | then show ?thesis by (simp add: holomorphic_on_open) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6736 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6737 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6738 | corollary holomorphic_iff_power_series: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6739 | "f holomorphic_on ball z r \<longleftrightarrow> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6740 | (\<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 | 6741 | apply (intro iffI ballI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6742 | using holomorphic_power_series apply force | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6743 | apply (rule power_series_holomorphic [where a = "\<lambda>n. (deriv ^^ n) f z / (fact n)"]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6744 | apply force | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6745 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6746 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6747 | corollary power_series_analytic: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6748 | "(\<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" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6749 | by (force simp add: analytic_on_open intro!: power_series_holomorphic) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6750 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6751 | corollary analytic_iff_power_series: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6752 | "f analytic_on ball z r \<longleftrightarrow> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6753 | (\<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 | 6754 | by (simp add: analytic_on_open holomorphic_iff_power_series) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6755 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6756 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6757 | subsection\<open>Equality between holomorphic functions, on open ball then connected set.\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6758 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6759 | lemma holomorphic_fun_eq_on_ball: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6760 | "\<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 | 6761 | w \<in> ball z r; | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6762 | \<And>n. (deriv ^^ n) f z = (deriv ^^ n) g z\<rbrakk> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6763 | \<Longrightarrow> f w = g w" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6764 | 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 | 6765 | apply (auto simp: holomorphic_iff_power_series) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6766 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6767 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6768 | lemma holomorphic_fun_eq_0_on_ball: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6769 | "\<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 | 6770 | \<And>n. (deriv ^^ n) f z = 0\<rbrakk> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6771 | \<Longrightarrow> f w = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6772 | 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 | 6773 | apply (auto simp: holomorphic_iff_power_series) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6774 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6775 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6776 | lemma holomorphic_fun_eq_0_on_connected: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6777 | assumes holf: "f holomorphic_on s" and "open s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6778 | and cons: "connected s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6779 | and der: "\<And>n. (deriv ^^ n) f z = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6780 | and "z \<in> s" "w \<in> s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6781 | shows "f w = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6782 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6783 | have *: "\<And>x e. \<lbrakk> \<forall>xa. (deriv ^^ xa) f x = 0; ball x e \<subseteq> s\<rbrakk> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6784 |            \<Longrightarrow> ball x e \<subseteq> (\<Inter>n. {w \<in> s. (deriv ^^ n) f w = 0})"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6785 | apply auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6786 | apply (rule holomorphic_fun_eq_0_on_ball [OF holomorphic_higher_deriv]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6787 | apply (rule holomorphic_on_subset [OF holf], simp_all) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6788 | by (metis funpow_add o_apply) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6789 |   have 1: "openin (subtopology euclidean s) (\<Inter>n. {w \<in> s. (deriv ^^ n) f w = 0})"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6790 | apply (rule open_subset, force) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6791 | using \<open>open s\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6792 | apply (simp add: open_contains_ball Ball_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6793 | apply (erule all_forward) | 
| 62343 
24106dc44def
prefer abbreviations for compound operators INFIMUM and SUPREMUM
 haftmann parents: 
62217diff
changeset | 6794 | using "*" by auto blast+ | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6795 |   have 2: "closedin (subtopology euclidean s) (\<Inter>n. {w \<in> s. (deriv ^^ n) f w = 0})"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6796 | 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 | 6797 | by (auto intro: continuous_closedin_preimage_constant holomorphic_on_imp_continuous_on holomorphic_higher_deriv) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6798 | obtain e where "e>0" and e: "ball w e \<subseteq> s" using openE [OF \<open>open s\<close> \<open>w \<in> s\<close>] . | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6799 | then have holfb: "f holomorphic_on ball w e" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6800 | using holf holomorphic_on_subset by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6801 |   have 3: "(\<Inter>n. {w \<in> s. (deriv ^^ n) f w = 0}) = s \<Longrightarrow> f w = 0"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6802 | 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 | 6803 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6804 | using cons der \<open>z \<in> s\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6805 | apply (simp add: connected_clopen) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6806 |     apply (drule_tac x="\<Inter>n. {w \<in> s. (deriv ^^ n) f w = 0}" in spec)
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6807 | apply (auto simp: 1 2 3) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6808 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6809 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6810 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6811 | lemma holomorphic_fun_eq_on_connected: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6812 | assumes "f holomorphic_on s" "g holomorphic_on s" and "open s" "connected s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6813 | and "\<And>n. (deriv ^^ n) f z = (deriv ^^ n) g z" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6814 | and "z \<in> s" "w \<in> s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6815 | shows "f w = g w" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6816 | apply (rule holomorphic_fun_eq_0_on_connected [of "\<lambda>x. f x - g x" s z, simplified]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6817 | apply (intro assms holomorphic_intros) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6818 | using assms apply simp_all | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6819 | apply (subst higher_deriv_diff, auto) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6820 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6821 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6822 | lemma holomorphic_fun_eq_const_on_connected: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6823 | assumes holf: "f holomorphic_on s" and "open s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6824 | and cons: "connected s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6825 | and der: "\<And>n. 0 < n \<Longrightarrow> (deriv ^^ n) f z = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6826 | and "z \<in> s" "w \<in> s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6827 | shows "f w = f z" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6828 | apply (rule holomorphic_fun_eq_0_on_connected [of "\<lambda>w. f w - f z" s z, simplified]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6829 | apply (intro assms holomorphic_intros) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6830 | using assms apply simp_all | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6831 | apply (subst higher_deriv_diff) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6832 | apply (intro holomorphic_intros | simp)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6833 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6834 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6835 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6836 | subsection\<open>Some basic lemmas about poles/singularities.\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6837 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6838 | lemma pole_lemma: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6839 | assumes holf: "f holomorphic_on s" and a: "a \<in> interior s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6840 | shows "(\<lambda>z. if z = a then deriv f a | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6841 | else (f z - f a) / (z - a)) holomorphic_on s" (is "?F holomorphic_on s") | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6842 | proof - | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6843 | 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 | 6844 | proof - | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6845 | have fcd: "f field_differentiable at u within s" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6846 | using holf holomorphic_on_def by (simp add: \<open>u \<in> s\<close>) | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6847 | 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 | 6848 | by (rule fcd derivative_intros | simp add: that)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6849 | have "0 < dist a u" using that dist_nz by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6850 | 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 | 6851 | 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 | 6852 | qed | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6853 | 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 | 6854 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6855 | have holfb: "f holomorphic_on ball a e" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6856 | by (rule holomorphic_on_subset [OF holf \<open>ball a e \<subseteq> s\<close>]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6857 |     have 2: "?F holomorphic_on ball a e - {a}"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6858 |       apply (rule holomorphic_on_subset [where s = "s - {a}"])
 | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6859 | apply (simp add: holomorphic_on_def field_differentiable_def [symmetric]) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6860 | 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 | 6861 | apply (auto intro: F1 field_differentiable_within_subset) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6862 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6863 | 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 | 6864 | if "dist a x < e" for x | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6865 | proof (cases "x=a") | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6866 | case True then show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6867 | using holfb \<open>0 < e\<close> | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6868 | apply (simp add: holomorphic_on_open field_differentiable_def [symmetric]) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6869 | apply (drule_tac x=a in bspec) | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6870 | apply (auto simp: DERIV_deriv_iff_field_differentiable [symmetric] continuous_at DERIV_iff2 | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6871 | elim: rev_iffD1 [OF _ LIM_equal]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6872 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6873 | next | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6874 | 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 | 6875 | 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 | 6876 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6877 | then have 1: "continuous_on (ball a e) ?F" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6878 | by (clarsimp simp: continuous_on_eq_continuous_at) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6879 | have "?F holomorphic_on ball a e" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6880 | by (auto intro: no_isolated_singularity [OF 1 2]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6881 | 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 | 6882 | 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 | 6883 | field_differentiable_at_within) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6884 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6885 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6886 | proof | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 6887 | 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 | 6888 | proof (cases "x=a") | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6889 | 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 | 6890 | 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 | 6891 | next | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6892 | case False with F1 \<open>x \<in> s\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6893 | show ?thesis by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6894 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6895 | qed | 
| 
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 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6898 | proposition pole_theorem: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6899 | assumes holg: "g holomorphic_on s" and a: "a \<in> interior s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6900 |       and eq: "\<And>z. z \<in> s - {a} \<Longrightarrow> g z = (z - a) * f z"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6901 | shows "(\<lambda>z. if z = a then deriv g a | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6902 | else f z - g a/(z - a)) holomorphic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6903 | using pole_lemma [OF holg a] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6904 | by (rule holomorphic_transform) (simp add: eq divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6905 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6906 | lemma pole_lemma_open: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6907 | assumes "f holomorphic_on s" "open s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6908 | shows "(\<lambda>z. if z = a then deriv f a else (f z - f a)/(z - a)) holomorphic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6909 | proof (cases "a \<in> s") | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6910 | case True with assms interior_eq pole_lemma | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6911 | show ?thesis by fastforce | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6912 | next | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6913 | 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 | 6914 | 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 | 6915 | 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 | 6916 | apply (rule derivative_intros | force)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6917 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6918 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6919 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6920 | proposition pole_theorem_open: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6921 | assumes holg: "g holomorphic_on s" and s: "open s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6922 |       and eq: "\<And>z. z \<in> s - {a} \<Longrightarrow> g z = (z - a) * f z"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6923 | shows "(\<lambda>z. if z = a then deriv g a | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6924 | else f z - g a/(z - a)) holomorphic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6925 | using pole_lemma_open [OF holg s] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6926 | by (rule holomorphic_transform) (auto simp: eq divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6927 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6928 | proposition pole_theorem_0: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6929 | assumes holg: "g holomorphic_on s" and a: "a \<in> interior s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6930 |       and eq: "\<And>z. z \<in> s - {a} \<Longrightarrow> g z = (z - a) * f z"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6931 | and [simp]: "f a = deriv g a" "g a = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6932 | shows "f holomorphic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6933 | using pole_theorem [OF holg a eq] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6934 | by (rule holomorphic_transform) (auto simp: eq divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6935 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6936 | proposition pole_theorem_open_0: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6937 | assumes holg: "g holomorphic_on s" and s: "open s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6938 |       and eq: "\<And>z. z \<in> s - {a} \<Longrightarrow> g z = (z - a) * f z"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6939 | and [simp]: "f a = deriv g a" "g a = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6940 | shows "f holomorphic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6941 | using pole_theorem_open [OF holg s eq] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6942 | by (rule holomorphic_transform) (auto simp: eq divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6943 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6944 | lemma pole_theorem_analytic: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6945 | assumes g: "g analytic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6946 | and eq: "\<And>z. z \<in> s | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6947 |              \<Longrightarrow> \<exists>d. 0 < d \<and> (\<forall>w \<in> ball z d - {a}. g w = (w - a) * f w)"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6948 | shows "(\<lambda>z. if z = a then deriv g a | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6949 | else f z - g a/(z - a)) analytic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6950 | using g | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6951 | apply (simp add: analytic_on_def Ball_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6952 | apply (safe elim!: all_forward dest!: eq) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6953 | apply (rule_tac x="min d e" in exI, simp) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6954 | apply (rule pole_theorem_open) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6955 | apply (auto simp: holomorphic_on_subset subset_ball) | 
| 
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 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6958 | lemma pole_theorem_analytic_0: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6959 | assumes g: "g analytic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6960 |       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)"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6961 | and [simp]: "f a = deriv g a" "g a = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6962 | shows "f analytic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6963 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6964 | 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 | 6965 | by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6966 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6967 | using pole_theorem_analytic [OF g eq] by simp | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6968 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6969 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6970 | lemma pole_theorem_analytic_open_superset: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6971 | assumes g: "g analytic_on s" and "s \<subseteq> t" "open t" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6972 |       and eq: "\<And>z. z \<in> t - {a} \<Longrightarrow> g z = (z - a) * f z"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6973 | shows "(\<lambda>z. if z = a then deriv g a | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6974 | else f z - g a/(z - a)) analytic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6975 | apply (rule pole_theorem_analytic [OF g]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6976 | apply (rule openE [OF \<open>open t\<close>]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6977 | using assms eq by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6978 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6979 | lemma pole_theorem_analytic_open_superset_0: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6980 |   assumes g: "g analytic_on s" "s \<subseteq> t" "open t" "\<And>z. z \<in> t - {a} \<Longrightarrow> g z = (z - a) * f z"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6981 | and [simp]: "f a = deriv g a" "g a = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6982 | shows "f analytic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6983 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6984 | 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 | 6985 | by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6986 | have "(\<lambda>z. if z = a then deriv g a else f z - g a/(z - a)) analytic_on s" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6987 | by (rule pole_theorem_analytic_open_superset [OF g]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6988 | then show ?thesis by simp | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6989 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6990 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6991 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6992 | subsection\<open>General, homology form of Cauchy's theorem.\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6993 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 6994 | 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 | 6995 | |
| 62217 | 6996 | lemma contour_integral_continuous_on_linepath_2D: | 
| 6997 | assumes "open u" and cont_dw: "\<And>w. w \<in> u \<Longrightarrow> F w contour_integrable_on (linepath a b)" | |
| 6998 | and cond_uu: "continuous_on (u \<times> u) (\<lambda>(x,y). F x y)" | |
| 6999 | and abu: "closed_segment a b \<subseteq> u" | |
| 7000 | shows "continuous_on u (\<lambda>w. contour_integral (linepath a b) (F w))" | |
| 7001 | proof - | |
| 7002 | have *: "\<exists>d>0. \<forall>x'\<in>u. dist x' w < d \<longrightarrow> | |
| 7003 | dist (contour_integral (linepath a b) (F x')) | |
| 7004 | (contour_integral (linepath a b) (F w)) \<le> \<epsilon>" | |
| 7005 | if "w \<in> u" "0 < \<epsilon>" "a \<noteq> b" for w \<epsilon> | |
| 7006 | proof - | |
| 7007 | 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 | |
| 7008 |     let ?TZ = "{(t,z) |t z. t \<in> cball w \<delta> \<and> z \<in> closed_segment a b}"
 | |
| 7009 | have "uniformly_continuous_on ?TZ (\<lambda>(x,y). F x y)" | |
| 7010 | apply (rule compact_uniformly_continuous) | |
| 7011 | apply (rule continuous_on_subset[OF cond_uu]) | |
| 7012 | using abu \<delta> | |
| 7013 | apply (auto simp: compact_Times simp del: mem_cball) | |
| 7014 | done | |
| 7015 | then obtain \<eta> where "\<eta>>0" | |
| 7016 | and \<eta>: "\<And>x x'. \<lbrakk>x\<in>?TZ; x'\<in>?TZ; dist x' x < \<eta>\<rbrakk> \<Longrightarrow> | |
| 7017 | dist ((\<lambda>(x,y). F x y) x') ((\<lambda>(x,y). F x y) x) < \<epsilon>/norm(b - a)" | |
| 7018 | apply (rule uniformly_continuous_onE [where e = "\<epsilon>/norm(b - a)"]) | |
| 7019 | 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 | 7020 | have \<eta>: "\<lbrakk>norm (w - x1) \<le> \<delta>; x2 \<in> closed_segment a b; | 
| 62217 | 7021 | norm (w - x1') \<le> \<delta>; x2' \<in> closed_segment a b; norm ((x1', x2') - (x1, x2)) < \<eta>\<rbrakk> | 
| 7022 | \<Longrightarrow> norm (F x1' x2' - F x1 x2) \<le> \<epsilon> / cmod (b - a)" | |
| 7023 | for x1 x2 x1' x2' | |
| 7024 | using \<eta> [of "(x1,x2)" "(x1',x2')"] by (force simp add: dist_norm) | |
| 7025 | have le_ee: "cmod (contour_integral (linepath a b) (\<lambda>x. F x' x - F w x)) \<le> \<epsilon>" | |
| 7026 | if "x' \<in> u" "cmod (x' - w) < \<delta>" "cmod (x' - w) < \<eta>" for x' | |
| 7027 | proof - | |
| 7028 | have "cmod (contour_integral (linepath a b) (\<lambda>x. F x' x - F w x)) \<le> \<epsilon>/norm(b - a) * norm(b - a)" | |
| 7029 | apply (rule has_contour_integral_bound_linepath [OF has_contour_integral_integral _ \<eta>]) | |
| 7030 | apply (rule contour_integrable_diff [OF cont_dw cont_dw]) | |
| 7031 | using \<open>0 < \<epsilon>\<close> \<open>a \<noteq> b\<close> \<open>0 < \<delta>\<close> \<open>w \<in> u\<close> that | |
| 7032 | apply (auto simp: norm_minus_commute) | |
| 7033 | done | |
| 7034 | also have "... = \<epsilon>" using \<open>a \<noteq> b\<close> by simp | |
| 7035 | finally show ?thesis . | |
| 7036 | qed | |
| 7037 | show ?thesis | |
| 7038 | apply (rule_tac x="min \<delta> \<eta>" in exI) | |
| 7039 | using \<open>0 < \<delta>\<close> \<open>0 < \<eta>\<close> | |
| 7040 | apply (auto simp: dist_norm contour_integral_diff [OF cont_dw cont_dw, symmetric] \<open>w \<in> u\<close> intro: le_ee) | |
| 7041 | done | |
| 7042 | qed | |
| 62397 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 7043 | show ?thesis | 
| 62217 | 7044 | apply (rule continuous_onI) | 
| 7045 | apply (cases "a=b") | |
| 7046 | apply (auto intro: *) | |
| 7047 | done | |
| 62397 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 7048 | qed | 
| 62217 | 7049 | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7050 | 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 | 7051 | lemma Cauchy_integral_formula_global_weak: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7052 | assumes u: "open u" and holf: "f holomorphic_on u" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7053 | and z: "z \<in> u" and \<gamma>: "polynomial_function \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7054 |         and pasz: "path_image \<gamma> \<subseteq> u - {z}" and loop: "pathfinish \<gamma> = pathstart \<gamma>"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7055 | and zero: "\<And>w. w \<notin> u \<Longrightarrow> winding_number \<gamma> w = 0" | 
| 63589 | 7056 | 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 | 7057 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7058 | 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 | 7059 | using has_vector_derivative_polynomial_function [OF \<gamma>] by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7060 | then have "bounded(path_image \<gamma>')" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7061 | 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 | 7062 | 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 | 7063 | using bounded_pos by force | 
| 63040 | 7064 | 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 | 
| 7065 |   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 | 7066 | have "path \<gamma>" "valid_path \<gamma>" using \<gamma> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7067 | by (auto simp: path_polynomial_function valid_path_polynomial_function) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7068 | then have ov: "open v" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7069 | by (simp add: v_def open_winding_number_levelsets loop) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7070 | have uv_Un: "u \<union> v = UNIV" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7071 | using pasz zero by (auto simp: v_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7072 | have conf: "continuous_on u f" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7073 | by (metis holf holomorphic_on_imp_continuous_on) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7074 | have hol_d: "(d y) holomorphic_on u" if "y \<in> u" for y | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7075 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7076 | have *: "(\<lambda>c. if c = y then deriv f y else (f c - f y) / (c - y)) holomorphic_on u" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7077 | by (simp add: holf pole_lemma_open u) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7078 | then have "isCont (\<lambda>x. if x = y then deriv f y else (f x - f y) / (x - y)) y" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7079 | using at_within_open field_differentiable_imp_continuous_at holomorphic_on_def that u by fastforce | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7080 | then have "continuous_on u (d y)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7081 | apply (simp add: d_def continuous_on_eq_continuous_at u, clarify) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7082 | using * 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 | 7083 | by (meson field_differentiable_within_open field_differentiable_imp_continuous_at u) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7084 |     moreover have "d y holomorphic_on u - {y}"
 | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7085 | apply (simp add: d_def holomorphic_on_open u open_delete field_differentiable_def [symmetric]) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7086 | apply (intro ballI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7087 | 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 | 7088 | apply (rule_tac d="dist w y" and f = "\<lambda>w. (f w - f y)/(w - y)" in field_differentiable_transform_within) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7089 | apply (auto simp: dist_pos_lt dist_commute intro!: derivative_intros) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7090 | using analytic_on_imp_differentiable_at analytic_on_open holf u apply blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7091 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7092 | ultimately show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7093 | by (rule no_isolated_singularity) (auto simp: u) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7094 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7095 | have cint_fxy: "(\<lambda>x. (f x - f y) / (x - y)) contour_integrable_on \<gamma>" if "y \<notin> path_image \<gamma>" for y | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7096 |     apply (rule contour_integrable_holomorphic_simple [where s = "u-{y}"])
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7097 | using \<open>valid_path \<gamma>\<close> pasz | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7098 | apply (auto simp: u open_delete) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7099 | apply (rule continuous_intros holomorphic_intros continuous_on_subset [OF conf] holomorphic_on_subset [OF holf] | | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7100 | force simp add: that)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7101 | done | 
| 63040 | 7102 | define h where | 
| 7103 | "h z = (if z \<in> u then contour_integral \<gamma> (d z) else contour_integral \<gamma> (\<lambda>w. f w/(w - z)))" for z | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7104 | have U: "\<And>z. z \<in> u \<Longrightarrow> ((d z) has_contour_integral h z) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7105 | apply (simp add: h_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7106 | apply (rule has_contour_integral_integral [OF contour_integrable_holomorphic_simple [where s=u]]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7107 | using u pasz \<open>valid_path \<gamma>\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7108 | apply (auto intro: holomorphic_on_imp_continuous_on hol_d) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7109 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7110 | 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 | 7111 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7112 | 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 | 7113 | using v_def z by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7114 | 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 | 7115 | 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 | 7116 | 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 | 7117 | using has_contour_integral_lmul by fastforce | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7118 | 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 | 7119 | by (simp add: divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7120 | 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 | 7121 | using z | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7122 | apply (auto simp: v_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7123 | 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 | 7124 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7125 | 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 | 7126 | by (rule has_contour_integral_add) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7127 | have "((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7128 | if "z \<in> u" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7129 | using * by (auto simp: divide_simps has_contour_integral_eq) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7130 | moreover have "((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (\<lambda>w. f w / (w - z))) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7131 | if "z \<notin> u" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7132 | apply (rule has_contour_integral_integral [OF contour_integrable_holomorphic_simple [where s=u]]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7133 | using u pasz \<open>valid_path \<gamma>\<close> that | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7134 | apply (auto intro: holomorphic_on_imp_continuous_on hol_d) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7135 | apply (rule continuous_intros conf holomorphic_intros holf | force)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7136 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7137 | ultimately show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7138 | using z by (simp add: h_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7139 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7140 | have znot: "z \<notin> path_image \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7141 | using pasz by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7142 | 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" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7143 | using separate_compact_closed [of "path_image \<gamma>" "-u"] pasz u | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7144 | by (fastforce simp add: \<open>path \<gamma>\<close> compact_path_image) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7145 |   obtain dd where "0 < dd" and dd: "{y + k | y k. y \<in> path_image \<gamma> \<and> k \<in> ball 0 dd} \<subseteq> u"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7146 | apply (rule that [of "d0/2"]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7147 | using \<open>0 < d0\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7148 | apply (auto simp: dist_norm dest: d0) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7149 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7150 | 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 | 7151 | apply (rule_tac x=x in exI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7152 | apply (rule_tac x="x'-x" in exI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7153 | apply (force simp add: dist_norm) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7154 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7155 |   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 | 7156 | apply (clarsimp simp add: mem_interior) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7157 | using \<open>0 < dd\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7158 | apply (rule_tac x="dd/2" in exI, auto) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7159 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7160 | obtain t where "compact t" and subt: "path_image \<gamma> \<subseteq> interior t" and t: "t \<subseteq> u" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7161 | apply (rule that [OF _ 1]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7162 | 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 | 7163 | apply (rule order_trans [OF _ dd]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7164 | using \<open>0 < dd\<close> by fastforce | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7165 | obtain L where "L>0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7166 | 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> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7167 | cmod (contour_integral \<gamma> f) \<le> L * B" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7168 | 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 | 7169 | by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7170 | have "bounded(f ` t)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7171 | by (meson \<open>compact t\<close> compact_continuous_image compact_imp_bounded conf continuous_on_subset t) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7172 | then obtain D where "D>0" and D: "\<And>x. x \<in> t \<Longrightarrow> norm (f x) \<le> D" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7173 | by (auto simp: bounded_pos) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7174 | obtain C where "C>0" and C: "\<And>x. x \<in> t \<Longrightarrow> norm x \<le> C" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7175 | using \<open>compact t\<close> bounded_pos compact_imp_bounded by force | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7176 | 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 | 7177 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7178 | 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 | 7179 | with le have ybig: "norm y > C" by force | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7180 | with C have "y \<notin> t" by force | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7181 | then have ynot: "y \<notin> path_image \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7182 | using subt interior_subset by blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7183 | have [simp]: "winding_number \<gamma> y = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7184 | apply (rule winding_number_zero_outside [of _ "cball 0 C"]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7185 | using ybig interior_subset subt | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7186 | apply (force simp add: loop \<open>path \<gamma>\<close> dist_norm intro!: C)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7187 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7188 | 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 | 7189 | by (rule contour_integral_unique [symmetric]) (simp add: v_def ynot V) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7190 | have holint: "(\<lambda>w. f w / (w - y)) holomorphic_on interior t" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7191 | apply (rule holomorphic_on_divide) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7192 | using holf holomorphic_on_subset interior_subset t apply blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7193 | apply (rule holomorphic_intros)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7194 | using \<open>y \<notin> t\<close> interior_subset by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7195 | have leD: "cmod (f z / (z - y)) \<le> D * (e / L / D)" if z: "z \<in> interior t" for z | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7196 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7197 | have "D * L / e + cmod z \<le> cmod y" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7198 | using le C [of z] z using interior_subset by force | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7199 | then have DL2: "D * L / e \<le> cmod (z - y)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7200 | 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 | 7201 | 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 | 7202 | by (simp add: norm_mult norm_inverse Fields.field_class.field_divide_inverse) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7203 | also have "... \<le> D * (e / L / D)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7204 | apply (rule mult_mono) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7205 | using that D interior_subset apply blast | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7206 | 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 | 7207 | apply (auto simp: norm_divide divide_simps algebra_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7208 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7209 | finally show ?thesis . | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7210 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7211 | 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 | 7212 | by (simp add: dist_norm) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7213 | also have "... \<le> L * (D * (e / L / D))" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7214 | by (rule L [OF holint leD]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7215 | also have "... = e" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7216 | using \<open>L>0\<close> \<open>0 < D\<close> by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7217 | finally show ?thesis . | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7218 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7219 | then have "(h \<longlongrightarrow> 0) at_infinity" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7220 | by (meson Lim_at_infinityI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7221 | moreover have "h holomorphic_on UNIV" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7222 | proof - | 
| 62217 | 7223 | have con_ff: "continuous (at (x,z)) (\<lambda>(x,y). (f y - f x) / (y - x))" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7224 | if "x \<in> u" "z \<in> u" "x \<noteq> z" for x z | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7225 | using that conf | 
| 62217 | 7226 | apply (simp add: split_def continuous_on_eq_continuous_at u) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7227 | apply (simp | rule continuous_intros continuous_within_compose2 [where g=f])+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7228 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7229 | 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 | 7230 | by (rule continuous_intros)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7231 | have open_uu_Id: "open (u \<times> u - Id)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7232 | apply (rule open_Diff) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7233 | apply (simp add: open_Times u) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7234 | 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 | 7235 | apply (auto simp: Id_fstsnd_eq algebra_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7236 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7237 | have con_derf: "continuous (at z) (deriv f)" if "z \<in> u" for z | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7238 | apply (rule continuous_on_interior [of u]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7239 | apply (simp add: holf holomorphic_deriv holomorphic_on_imp_continuous_on u) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7240 | by (simp add: interior_open that u) | 
| 62217 | 7241 | have tendsto_f': "((\<lambda>(x,y). if y = x then deriv f (x) | 
| 7242 | else (f (y) - f (x)) / (y - x)) \<longlongrightarrow> deriv f x) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7243 | (at (x, x) within u \<times> u)" if "x \<in> u" for x | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7244 | proof (rule Lim_withinI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7245 | fix e::real assume "0 < e" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7246 | obtain k1 where "k1>0" and k1: "\<And>x'. norm (x' - x) \<le> k1 \<Longrightarrow> norm (deriv f x' - deriv f x) < e" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7247 | using \<open>0 < e\<close> continuous_within_E [OF con_derf [OF \<open>x \<in> u\<close>]] | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7248 | by (metis UNIV_I dist_norm) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7249 | obtain k2 where "k2>0" and k2: "ball x k2 \<subseteq> u" by (blast intro: openE [OF u] \<open>x \<in> u\<close>) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7250 | 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 | 7251 | 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 | 7252 | for x' z' | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7253 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7254 | 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 | 7255 | apply (drule segment_furthest_le [where y=x]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7256 | 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 | 7257 | 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 | 7258 | by (blast intro: cs_less less_k1 k1 [unfolded divide_const_simps dist_norm] less_imp_le le_less_trans) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7259 | have f_has_der: "\<And>x. x \<in> u \<Longrightarrow> (f has_field_derivative deriv f x) (at x within u)" | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7260 | by (metis DERIV_deriv_iff_field_differentiable at_within_open holf holomorphic_on_def u) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7261 | have "closed_segment x' z' \<subseteq> u" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7262 | 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 | 7263 | 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 | 7264 | 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 | 7265 | 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 | 7266 | by (rule has_contour_integral_div) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7267 | 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 | 7268 | 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 | 7269 | 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 | 7270 | \<open>e > 0\<close> \<open>z' \<noteq> x'\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7271 | apply (auto simp: norm_divide divide_simps derf_le) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7272 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7273 | also have "... \<le> e" using \<open>0 < e\<close> by simp | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7274 | finally show ?thesis . | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7275 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7276 | show "\<exists>d>0. \<forall>xa\<in>u \<times> u. | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7277 | 0 < dist xa (x, x) \<and> dist xa (x, x) < d \<longrightarrow> | 
| 62217 | 7278 | 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 | 7279 | apply (rule_tac x="min k1 k2" in exI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7280 | 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 | 7281 | 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 | 7282 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7283 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7284 | have con_pa_f: "continuous_on (path_image \<gamma>) f" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7285 | by (meson holf holomorphic_on_imp_continuous_on holomorphic_on_subset interior_subset subt t) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7286 |     have le_B: "\<And>t. t \<in> {0..1} \<Longrightarrow> cmod (vector_derivative \<gamma> (at t)) \<le> B"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7287 | apply (rule B) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7288 | using \<gamma>' using path_image_def vector_derivative_at by fastforce | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7289 | 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 | 7290 | by (simp add: V) | 
| 62217 | 7291 | 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 | 7292 | apply (simp add: continuous_on_eq_continuous_within d_def continuous_within tendsto_f') | 
| 62397 
5ae24f33d343
Substantial new material for multivariate analysis. Also removal of some duplicates.
 paulson <lp15@cam.ac.uk> parents: 
62379diff
changeset | 7293 | apply (simp add: tendsto_within_open_NO_MATCH open_Times u, clarify) | 
| 62217 | 7294 | 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 | 7295 | using con_ff | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7296 | apply (auto simp: continuous_within) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7297 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7298 | have hol_dw: "(\<lambda>z. d z w) holomorphic_on u" if "w \<in> u" for w | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7299 | proof - | 
| 62217 | 7300 | have "continuous_on u ((\<lambda>(x,y). d x y) o (\<lambda>z. (w,z)))" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7301 | by (rule continuous_on_compose continuous_intros continuous_on_subset [OF cond_uu] | force intro: that)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7302 | then have *: "continuous_on u (\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z))" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7303 | by (rule rev_iffD1 [OF _ continuous_on_cong [OF refl]]) (simp add: d_def field_simps) | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7304 | 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" | 
| 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7305 | apply (rule_tac f = "\<lambda>x. (f w - f x)/(w - x)" and d = "dist x w" in field_differentiable_transform_within) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7306 | apply (rule u derivative_intros holomorphic_on_imp_differentiable_at [OF holf] | force simp add: dist_commute)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7307 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7308 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7309 | unfolding d_def | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7310 |         apply (rule no_isolated_singularity [OF * _ u, where k = "{w}"])
 | 
| 62534 
6855b348e828
complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real)
 paulson <lp15@cam.ac.uk> parents: 
62533diff
changeset | 7311 | apply (auto simp: field_differentiable_def [symmetric] holomorphic_on_open open_Diff u **) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7312 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7313 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7314 |     { fix a b
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7315 | assume abu: "closed_segment a b \<subseteq> u" | 
| 62217 | 7316 | 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 | 7317 | by (metis hol_dw continuous_on_subset contour_integrable_continuous_linepath holomorphic_on_imp_continuous_on) | 
| 62217 | 7318 | then have cont_cint_d: "continuous_on u (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))" | 
| 7319 | apply (rule contour_integral_continuous_on_linepath_2D [OF \<open>open u\<close> _ _ abu]) | |
| 7320 | apply (auto simp: intro: continuous_on_swap_args cond_uu) | |
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7321 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7322 |       have cont_cint_d\<gamma>: "continuous_on {0..1} ((\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) o \<gamma>)"
 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7323 | apply (rule continuous_on_compose) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7324 | using \<open>path \<gamma>\<close> path_def pasz | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7325 | apply (auto intro!: continuous_on_subset [OF cont_cint_d]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7326 | apply (force simp add: path_image_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7327 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7328 | 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 | 7329 | apply (simp add: contour_integrable_on) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7330 | apply (rule integrable_continuous_real) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7331 | 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 | 7332 | using pf\<gamma>' | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7333 | 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 | 7334 | have "contour_integral (linepath a b) h = contour_integral (linepath a b) (\<lambda>z. contour_integral \<gamma> (d z))" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7335 | using abu by (force simp add: h_def intro: contour_integral_eq) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7336 | also have "... = 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 | 7337 | apply (rule contour_integral_swap) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7338 | apply (rule continuous_on_subset [OF cond_uu]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7339 | using abu pasz \<open>valid_path \<gamma>\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7340 | apply (auto intro!: continuous_intros) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7341 | 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 | 7342 | finally have cint_h_eq: | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7343 | "contour_integral (linepath a b) h = | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7344 | 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 | 7345 | note cint_cint cint_h_eq | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7346 | } note cint_h = this | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7347 | have conthu: "continuous_on u h" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7348 | proof (simp add: continuous_on_sequentially, clarify) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7349 | fix a x | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7350 | assume x: "x \<in> u" and au: "\<forall>n. a n \<in> u" and ax: "a \<longlonglongrightarrow> x" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7351 | 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 | 7352 | by (meson U contour_integrable_on_def eventuallyI) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7353 | obtain dd where "dd>0" and dd: "cball x dd \<subseteq> u" using open_contains_cball u 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 | 7354 | 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 | 7355 | 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 | 7356 | 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 | 7357 | 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 | 7358 | 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 | 7359 | 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 | 7360 | proof - | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7361 |           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 | 7362 | 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 | 7363 | 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 | 7364 | 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 | 7365 | 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 | 7366 | done | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7367 | then obtain kk where "kk>0" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7368 | and kk: "\<And>x x'. \<lbrakk>x\<in>?ddpa; x'\<in>?ddpa; dist x' x < kk\<rbrakk> \<Longrightarrow> | 
| 62217 | 7369 | dist ((\<lambda>(x,y). d x y) x') ((\<lambda>(x,y). d x y) x) < ee" | 
| 65036 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7370 | apply (rule uniformly_continuous_onE [where e = ee]) | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7371 | using \<open>0 < ee\<close> 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 | 7372 | 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 | 7373 | for w z | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7374 | using \<open>dd>0\<close> kk [of "(x,z)" "(w,z)"] by (force simp add: norm_minus_commute 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 | 7375 | 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 | 7376 | 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 | 7377 | 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 | 7378 | 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 | 7379 | 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 | 7380 | done | 
| 
ab7e11730ad8
Some new lemmas. Existing lemmas modified to use uniform_limit rather than its expansion
 paulson <lp15@cam.ac.uk> parents: 
64788diff
changeset | 7381 | qed | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7382 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7383 | have tendsto_hx: "(\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> h x" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7384 | apply (simp add: contour_integral_unique [OF U, symmetric] x) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7385 | apply (rule contour_integral_uniform_limit [OF A1 A2 le_B]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7386 | apply (auto simp: \<open>valid_path \<gamma>\<close>) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7387 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7388 | then show "(h \<circ> a) \<longlonglongrightarrow> h x" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7389 | by (simp add: h_def x au o_def) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7390 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7391 | 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 | 7392 | 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 | 7393 | fix z0 | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7394 | 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 | 7395 | then show "h field_differentiable at z0" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7396 | proof cases | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7397 | assume "z0 \<in> v" then show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7398 | 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 | 7399 | by (auto simp: field_differentiable_def v_def) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7400 | next | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7401 | assume "z0 \<in> u" then | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7402 | obtain e where "e>0" and e: "ball z0 e \<subseteq> u" by (blast intro: openE [OF u]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7403 | 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 | 7404 |                 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 | 7405 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7406 | 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" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7407 | using hol_dw holomorphic_on_imp_continuous_on u | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7408 | by (auto intro!: contour_integrable_holomorphic_simple) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7409 | have abc: "closed_segment a b \<subseteq> u" "closed_segment b c \<subseteq> u" "closed_segment c a \<subseteq> u" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7410 | using that e segments_subset_convex_hull by fastforce+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7411 | 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" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7412 | apply (rule contour_integral_unique [OF Cauchy_theorem_triangle]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7413 | apply (rule holomorphic_on_subset [OF hol_dw]) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7414 | using e abc_subset by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7415 | have "contour_integral \<gamma> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7416 | (\<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 | 7417 | (contour_integral (linepath b c) (\<lambda>z. d z x) + | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7418 | contour_integral (linepath c a) (\<lambda>z. d z x))) = 0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7419 | apply (rule contour_integral_eq_0) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7420 | using abc pasz u | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7421 | apply (subst contour_integral_join [symmetric], auto intro: eq0 *)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7422 | done | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7423 | then show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7424 | 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 | 7425 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7426 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7427 | using e \<open>e > 0\<close> | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7428 | 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 | 7429 | Morera_triangle continuous_on_subset [OF conthu] *) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7430 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7431 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7432 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7433 | ultimately have [simp]: "h z = 0" for z | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7434 | by (meson Liouville_weak) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7435 | 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 | 7436 | 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 | 7437 | 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 | 7438 | by (metis mult.commute has_contour_integral_lmul) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7439 | 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 | 7440 | by (simp add: divide_simps) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7441 | 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 | 7442 | 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 | 7443 | show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7444 | 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 | 7445 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7446 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7447 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7448 | 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 | 7449 | 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 | 7450 | 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 | 7451 |         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 | 7452 | and zero: "\<And>w. w \<notin> S \<Longrightarrow> winding_number \<gamma> w = 0" | 
| 63589 | 7453 | 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 | 7454 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7455 | 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 | 7456 |   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 | 7457 | by (rule holomorphic_intros holomorphic_on_subset [OF holf] | force)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7458 | 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 | 7459 | 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 | 7460 | obtain d where "d>0" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7461 |       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 | 7462 | 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 | 7463 |                      \<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 | 7464 | 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 | 7465 | obtain p where polyp: "polynomial_function p" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7466 |              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 | 7467 | 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 | 7468 | then have ploop: "pathfinish p = pathstart p" using loop by auto | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7469 | 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 | 7470 | 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 | 7471 |   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 | 7472 | 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 | 7473 | have wn_eq: "winding_number p z = winding_number \<gamma> z" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7474 | using vpp paps | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7475 | 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 | 7476 | 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 | 7477 | 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 | 7478 |     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 | 7479 | 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 | 7480 | 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 | 7481 | then show ?thesis | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7482 | 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 | 7483 | 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 | 7484 | 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 | 7485 | by (simp add: zero) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7486 | 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 | 7487 | 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 | 7488 | 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 | 7489 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7490 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7491 | 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 | 7492 | assumes S: "open S" and holf: "f holomorphic_on S" | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7493 | 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 | 7494 | 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 | 7495 | 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 | 7496 | shows "(f has_contour_integral 0) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7497 | 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 | 7498 | 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 | 7499 | proof - | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7500 | have "compact (path_image \<gamma>)" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7501 | 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 | 7502 | 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 | 7503 | by (metis (no_types) compact_open path_image_nonempty S) | 
| 62131 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7504 | with pas show ?thesis by (blast intro: that) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7505 | 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 | 7506 |   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 | 7507 | 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 | 7508 | by (rule holomorphic_intros holf)+ | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7509 | 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 | 7510 | 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 | 7511 | by (auto simp: znot elim!: has_contour_integral_eq) | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7512 | qed | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7513 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7514 | 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 | 7515 | 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 | 7516 | "\<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 | 7517 | shows "(f has_contour_integral 0) \<gamma>" | 
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7518 | 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 | 7519 | |
| 
1baed43f453e
nonneg_Reals, nonpos_Reals, Cauchy integral formula, etc.
 paulson parents: 
62101diff
changeset | 7520 | |
| 63955 | 7521 | 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 | 7522 | 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 | 7523 | "path_image g \<subseteq> S" "pathfinish g = pathstart g" "z \<notin> S" | 
| 63955 | 7524 | shows "winding_number g z = 0" | 
| 7525 | proof - | |
| 7526 | have "winding_number g z = winding_number(linepath (pathstart g) (pathstart g)) z" | |
| 7527 | apply (rule winding_number_homotopic_paths) | |
| 7528 | apply (rule homotopic_loops_imp_homotopic_paths_null [where a = "pathstart 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 | 7529 | apply (rule homotopic_loops_subset [of S]) | 
| 63955 | 7530 | using assms | 
| 7531 | apply (auto simp: homotopic_paths_imp_homotopic_loops path_defs simply_connected_eq_contractible_path) | |
| 7532 | done | |
| 7533 | also have "... = 0" | |
| 7534 | using assms by (force intro: winding_number_trivial) | |
| 7535 | finally show ?thesis . | |
| 7536 | qed | |
| 7537 | ||
| 7538 | 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 | 7539 | 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 | 7540 | "path_image g \<subseteq> S" "pathfinish g = pathstart g" | 
| 63955 | 7541 | shows "(f has_contour_integral 0) g" | 
| 7542 | using assms | |
| 7543 | apply (simp add: simply_connected_eq_contractible_path) | |
| 7544 | apply (auto intro!: Cauchy_theorem_null_homotopic [where a = "pathstart g"] | |
| 7545 | homotopic_paths_imp_homotopic_loops) | |
| 7546 | using valid_path_imp_path by blast | |
| 7547 | ||
| 60809 
457abb82fb9e
the Cauchy integral theorem and related material
 paulson <lp15@cam.ac.uk> parents: diff
changeset | 7548 | end |