186 apply (rule_tac x="insert 0 ((\<lambda>x. 2*x-1)`s)" in exI) |
186 apply (rule_tac x="insert 0 ((\<lambda>x. 2*x-1)`s)" in exI) |
187 apply simp |
187 apply simp |
188 apply (intro ballI) |
188 apply (intro ballI) |
189 apply (rule_tac d="dist ((x+1)/2) (1/2)" and f = "(g1 +++ g2) o (\<lambda>x. (x+1)/2)" |
189 apply (rule_tac d="dist ((x+1)/2) (1/2)" and f = "(g1 +++ g2) o (\<lambda>x. (x+1)/2)" |
190 in differentiable_transform_within) |
190 in differentiable_transform_within) |
191 apply (auto simp: dist_real_def joinpaths_def abs_if field_simps split: split_if_asm) |
191 apply (auto simp: dist_real_def joinpaths_def abs_if field_simps split: if_split_asm) |
192 apply (rule differentiable_chain_within derivative_intros | simp)+ |
192 apply (rule differentiable_chain_within derivative_intros | simp)+ |
193 apply (rule differentiable_subset) |
193 apply (rule differentiable_subset) |
194 apply (force simp: divide_simps)+ |
194 apply (force simp: divide_simps)+ |
195 done |
195 done |
196 |
196 |
763 by (simp_all only: image_affinity_atLeastAtMost_div_diff, simp_all add: scaleR_conv_of_real mult_ac) |
763 by (simp_all only: image_affinity_atLeastAtMost_div_diff, simp_all add: scaleR_conv_of_real mult_ac) |
764 have g1: "\<lbrakk>0 \<le> z; z*2 < 1; z*2 \<notin> s1\<rbrakk> \<Longrightarrow> |
764 have g1: "\<lbrakk>0 \<le> z; z*2 < 1; z*2 \<notin> s1\<rbrakk> \<Longrightarrow> |
765 vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at z) = |
765 vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at z) = |
766 2 *\<^sub>R vector_derivative g1 (at (z*2))" for z |
766 2 *\<^sub>R vector_derivative g1 (at (z*2))" for z |
767 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>"]]) |
767 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>"]]) |
768 apply (simp_all add: dist_real_def abs_if split: split_if_asm) |
768 apply (simp_all add: dist_real_def abs_if split: if_split_asm) |
769 apply (rule vector_diff_chain_at [of "\<lambda>x. 2*x" 2 _ g1, simplified o_def]) |
769 apply (rule vector_diff_chain_at [of "\<lambda>x. 2*x" 2 _ g1, simplified o_def]) |
770 apply (simp add: has_vector_derivative_def has_derivative_def bounded_linear_mult_left) |
770 apply (simp add: has_vector_derivative_def has_derivative_def bounded_linear_mult_left) |
771 using s1 |
771 using s1 |
772 apply (auto simp: algebra_simps vector_derivative_works) |
772 apply (auto simp: algebra_simps vector_derivative_works) |
773 done |
773 done |
774 have g2: "\<lbrakk>1 < z*2; z \<le> 1; z*2 - 1 \<notin> s2\<rbrakk> \<Longrightarrow> |
774 have g2: "\<lbrakk>1 < z*2; z \<le> 1; z*2 - 1 \<notin> s2\<rbrakk> \<Longrightarrow> |
775 vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at z) = |
775 vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at z) = |
776 2 *\<^sub>R vector_derivative g2 (at (z*2 - 1))" for z |
776 2 *\<^sub>R vector_derivative g2 (at (z*2 - 1))" for z |
777 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>"]]) |
777 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>"]]) |
778 apply (simp_all add: dist_real_def abs_if split: split_if_asm) |
778 apply (simp_all add: dist_real_def abs_if split: if_split_asm) |
779 apply (rule vector_diff_chain_at [of "\<lambda>x. 2*x - 1" 2 _ g2, simplified o_def]) |
779 apply (rule vector_diff_chain_at [of "\<lambda>x. 2*x - 1" 2 _ g2, simplified o_def]) |
780 apply (simp add: has_vector_derivative_def has_derivative_def bounded_linear_mult_left) |
780 apply (simp add: has_vector_derivative_def has_derivative_def bounded_linear_mult_left) |
781 using s2 |
781 using s2 |
782 apply (auto simp: algebra_simps vector_derivative_works) |
782 apply (auto simp: algebra_simps vector_derivative_works) |
783 done |
783 done |
824 by (auto dest: integrable_cmul [where c="1/2"] simp: scaleR_conv_of_real) |
824 by (auto dest: integrable_cmul [where c="1/2"] simp: scaleR_conv_of_real) |
825 have g1: "\<lbrakk>0 < z; z < 1; z \<notin> s1\<rbrakk> \<Longrightarrow> |
825 have g1: "\<lbrakk>0 < z; z < 1; z \<notin> s1\<rbrakk> \<Longrightarrow> |
826 vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at (z/2)) = |
826 vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at (z/2)) = |
827 2 *\<^sub>R vector_derivative g1 (at z)" for z |
827 2 *\<^sub>R vector_derivative g1 (at z)" for z |
828 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>"]]) |
828 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>"]]) |
829 apply (simp_all add: field_simps dist_real_def abs_if split: split_if_asm) |
829 apply (simp_all add: field_simps dist_real_def abs_if split: if_split_asm) |
830 apply (rule vector_diff_chain_at [of "\<lambda>x. x*2" 2 _ g1, simplified o_def]) |
830 apply (rule vector_diff_chain_at [of "\<lambda>x. x*2" 2 _ g1, simplified o_def]) |
831 using s1 |
831 using s1 |
832 apply (auto simp: vector_derivative_works has_vector_derivative_def has_derivative_def bounded_linear_mult_left) |
832 apply (auto simp: vector_derivative_works has_vector_derivative_def has_derivative_def bounded_linear_mult_left) |
833 done |
833 done |
834 show ?thesis |
834 show ?thesis |
858 by (auto dest: integrable_cmul [where c="1/2"] simp: scaleR_conv_of_real) |
858 by (auto dest: integrable_cmul [where c="1/2"] simp: scaleR_conv_of_real) |
859 have g2: "\<lbrakk>0 < z; z < 1; z \<notin> s2\<rbrakk> \<Longrightarrow> |
859 have g2: "\<lbrakk>0 < z; z < 1; z \<notin> s2\<rbrakk> \<Longrightarrow> |
860 vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at (z/2+1/2)) = |
860 vector_derivative (\<lambda>x. if x*2 \<le> 1 then g1 (2*x) else g2 (2*x - 1)) (at (z/2+1/2)) = |
861 2 *\<^sub>R vector_derivative g2 (at z)" for z |
861 2 *\<^sub>R vector_derivative g2 (at z)" for z |
862 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>"]]) |
862 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>"]]) |
863 apply (simp_all add: field_simps dist_real_def abs_if split: split_if_asm) |
863 apply (simp_all add: field_simps dist_real_def abs_if split: if_split_asm) |
864 apply (rule vector_diff_chain_at [of "\<lambda>x. x*2-1" 2 _ g2, simplified o_def]) |
864 apply (rule vector_diff_chain_at [of "\<lambda>x. x*2-1" 2 _ g2, simplified o_def]) |
865 using s2 |
865 using s2 |
866 apply (auto simp: has_vector_derivative_def has_derivative_def bounded_linear_mult_left |
866 apply (auto simp: has_vector_derivative_def has_derivative_def bounded_linear_mult_left |
867 vector_derivative_works add_divide_distrib) |
867 vector_derivative_works add_divide_distrib) |
868 done |
868 done |
924 { fix x |
924 { fix x |
925 have "0 \<le> x \<Longrightarrow> x + a < 1 \<Longrightarrow> x \<notin> (\<lambda>x. x - a) ` s \<Longrightarrow> |
925 have "0 \<le> x \<Longrightarrow> x + a < 1 \<Longrightarrow> x \<notin> (\<lambda>x. x - a) ` s \<Longrightarrow> |
926 vector_derivative (shiftpath a g) (at x) = vector_derivative g (at (x + a))" |
926 vector_derivative (shiftpath a g) (at x) = vector_derivative g (at (x + a))" |
927 unfolding shiftpath_def |
927 unfolding shiftpath_def |
928 apply (rule vector_derivative_at [OF has_vector_derivative_transform_within [where f = "(\<lambda>x. g(a+x))" and d = "dist(1-a) x"]]) |
928 apply (rule vector_derivative_at [OF has_vector_derivative_transform_within [where f = "(\<lambda>x. g(a+x))" and d = "dist(1-a) x"]]) |
929 apply (auto simp: field_simps dist_real_def abs_if split: split_if_asm) |
929 apply (auto simp: field_simps dist_real_def abs_if split: if_split_asm) |
930 apply (rule vector_diff_chain_at [of "\<lambda>x. x+a" 1 _ g, simplified o_def scaleR_one]) |
930 apply (rule vector_diff_chain_at [of "\<lambda>x. x+a" 1 _ g, simplified o_def scaleR_one]) |
931 apply (intro derivative_eq_intros | simp)+ |
931 apply (intro derivative_eq_intros | simp)+ |
932 using g |
932 using g |
933 apply (drule_tac x="x+a" in bspec) |
933 apply (drule_tac x="x+a" in bspec) |
934 using a apply (auto simp: has_vector_derivative_def vector_derivative_works image_def add.commute) |
934 using a apply (auto simp: has_vector_derivative_def vector_derivative_works image_def add.commute) |
937 { fix x |
937 { fix x |
938 have "1 < x + a \<Longrightarrow> x \<le> 1 \<Longrightarrow> x \<notin> (\<lambda>x. x - a + 1) ` s \<Longrightarrow> |
938 have "1 < x + a \<Longrightarrow> x \<le> 1 \<Longrightarrow> x \<notin> (\<lambda>x. x - a + 1) ` s \<Longrightarrow> |
939 vector_derivative (shiftpath a g) (at x) = vector_derivative g (at (x + a - 1))" |
939 vector_derivative (shiftpath a g) (at x) = vector_derivative g (at (x + a - 1))" |
940 unfolding shiftpath_def |
940 unfolding shiftpath_def |
941 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"]]) |
941 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"]]) |
942 apply (auto simp: field_simps dist_real_def abs_if split: split_if_asm) |
942 apply (auto simp: field_simps dist_real_def abs_if split: if_split_asm) |
943 apply (rule vector_diff_chain_at [of "\<lambda>x. x+a-1" 1 _ g, simplified o_def scaleR_one]) |
943 apply (rule vector_diff_chain_at [of "\<lambda>x. x+a-1" 1 _ g, simplified o_def scaleR_one]) |
944 apply (intro derivative_eq_intros | simp)+ |
944 apply (intro derivative_eq_intros | simp)+ |
945 using g |
945 using g |
946 apply (drule_tac x="x+a-1" in bspec) |
946 apply (drule_tac x="x+a-1" in bspec) |
947 using a apply (auto simp: has_vector_derivative_def vector_derivative_works image_def add.commute) |
947 using a apply (auto simp: has_vector_derivative_def vector_derivative_works image_def add.commute) |
998 [where f = "(shiftpath (1 - a) (shiftpath a g))" and s = "{0<..<1}-s"]]) |
998 [where f = "(shiftpath (1 - a) (shiftpath a g))" and s = "{0<..<1}-s"]]) |
999 using s g assms x |
999 using s g assms x |
1000 apply (auto simp: finite_imp_closed open_Diff shiftpath_shiftpath |
1000 apply (auto simp: finite_imp_closed open_Diff shiftpath_shiftpath |
1001 vector_derivative_within_interior vector_derivative_works [symmetric]) |
1001 vector_derivative_within_interior vector_derivative_works [symmetric]) |
1002 apply (rule differentiable_transform_within [OF gx, of "min x (1-x)"]) |
1002 apply (rule differentiable_transform_within [OF gx, of "min x (1-x)"]) |
1003 apply (auto simp: dist_real_def shiftpath_shiftpath abs_if split: split_if_asm) |
1003 apply (auto simp: dist_real_def shiftpath_shiftpath abs_if split: if_split_asm) |
1004 done |
1004 done |
1005 } note vd = this |
1005 } note vd = this |
1006 have fi: "(f has_contour_integral i) (shiftpath (1 - a) (shiftpath a g))" |
1006 have fi: "(f has_contour_integral i) (shiftpath (1 - a) (shiftpath a g))" |
1007 using assms by (auto intro!: has_contour_integral_shiftpath) |
1007 using assms by (auto intro!: has_contour_integral_shiftpath) |
1008 show ?thesis |
1008 show ?thesis |
3069 done |
3069 done |
3070 qed |
3070 qed |
3071 } note ind = this |
3071 } note ind = this |
3072 have "contour_integral h f = contour_integral g f" |
3072 have "contour_integral h f = contour_integral g f" |
3073 using ind [OF order_refl] N joins |
3073 using ind [OF order_refl] N joins |
3074 by (simp add: linked_paths_def pathstart_def pathfinish_def split: split_if_asm) |
3074 by (simp add: linked_paths_def pathstart_def pathfinish_def split: if_split_asm) |
3075 } |
3075 } |
3076 ultimately |
3076 ultimately |
3077 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)" |
3077 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)" |
3078 by metis |
3078 by metis |
3079 } note * = this |
3079 } note * = this |
4453 obtain k :: "real \<times> real \<Rightarrow> complex" |
4453 obtain k :: "real \<times> real \<Rightarrow> complex" |
4454 where contk: "continuous_on ({0..1} \<times> {0..1}) k" |
4454 where contk: "continuous_on ({0..1} \<times> {0..1}) k" |
4455 and ks: "k ` ({0..1} \<times> {0..1}) \<subseteq> s" |
4455 and ks: "k ` ({0..1} \<times> {0..1}) \<subseteq> s" |
4456 and k [simp]: "\<forall>x. k (0, x) = g x" "\<forall>x. k (1, x) = h x" |
4456 and k [simp]: "\<forall>x. k (0, x) = g x" "\<forall>x. k (1, x) = h x" |
4457 and ksf: "\<forall>t\<in>{0..1}. linked_paths atends g (\<lambda>x. k (t, x))" |
4457 and ksf: "\<forall>t\<in>{0..1}. linked_paths atends g (\<lambda>x. k (t, x))" |
4458 using hom pathsf by (auto simp: linked_paths_def homotopic_paths_def homotopic_loops_def homotopic_with_def split: split_if_asm) |
4458 using hom pathsf by (auto simp: linked_paths_def homotopic_paths_def homotopic_loops_def homotopic_with_def split: if_split_asm) |
4459 have ucontk: "uniformly_continuous_on ({0..1} \<times> {0..1}) k" |
4459 have ucontk: "uniformly_continuous_on ({0..1} \<times> {0..1}) k" |
4460 by (blast intro: compact_Times compact_uniformly_continuous [OF contk]) |
4460 by (blast intro: compact_Times compact_uniformly_continuous [OF contk]) |
4461 { fix t::real assume t: "t \<in> {0..1}" |
4461 { fix t::real assume t: "t \<in> {0..1}" |
4462 have pak: "path (k o (\<lambda>u. (t, u)))" |
4462 have pak: "path (k o (\<lambda>u. (t, u)))" |
4463 unfolding path_def |
4463 unfolding path_def |