src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy
author huffman
Wed, 19 Mar 2014 20:50:24 -0700
changeset 56223 7696903b9e61
parent 56217 dc429a5b13c4
child 56238 5d147e1e18d1
permissions -rw-r--r--
generalize theory of operator norms to work with class real_normed_vector
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     1
(*  Author: John Harrison, Marco Maggesi, Graziano Gentili, Gianni Ciolli, Valentina Bruno
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     2
    Ported from "hol_light/Multivariate/canal.ml" by L C Paulson (2014)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     3
*)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     4
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     5
header {* Complex Analysis Basics *}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     6
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     7
theory Complex_Analysis_Basics
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     8
imports  "~~/src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     9
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    10
begin
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    11
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    12
subsection {*Complex number lemmas *}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    13
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    14
lemma abs_sqrt_wlog:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    15
  fixes x::"'a::linordered_idom"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    16
  assumes "!!x::'a. x\<ge>0 \<Longrightarrow> P x (x\<^sup>2)" shows "P \<bar>x\<bar> (x\<^sup>2)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    17
by (metis abs_ge_zero assms power2_abs)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    18
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    19
lemma complex_abs_le_norm: "abs(Re z) + abs(Im z) \<le> sqrt(2) * norm z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    20
proof (cases z)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    21
  case (Complex x y)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    22
  show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    23
    apply (rule power2_le_imp_le)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    24
    apply (auto simp: real_sqrt_mult [symmetric] Complex)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    25
    apply (rule abs_sqrt_wlog [where x=x])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    26
    apply (rule abs_sqrt_wlog [where x=y])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    27
    apply (simp add: power2_sum add_commute sum_squares_bound)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    28
    done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    29
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    30
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    31
lemma continuous_Re: "continuous_on UNIV Re"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    32
  by (metis (poly_guards_query) bounded_linear.continuous_on bounded_linear_Re 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    33
            continuous_on_cong continuous_on_id)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    34
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    35
lemma continuous_Im: "continuous_on UNIV Im"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    36
  by (metis (poly_guards_query) bounded_linear.continuous_on bounded_linear_Im 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    37
            continuous_on_cong continuous_on_id)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    38
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    39
lemma open_halfspace_Re_lt: "open {z. Re(z) < b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    40
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    41
  have "{z. Re(z) < b} = Re -`{..<b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    42
    by blast
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    43
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    44
    by (auto simp: continuous_Re continuous_imp_open_vimage [of UNIV])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    45
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    46
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    47
lemma open_halfspace_Re_gt: "open {z. Re(z) > b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    48
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    49
  have "{z. Re(z) > b} = Re -`{b<..}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    50
    by blast
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    51
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    52
    by (auto simp: continuous_Re continuous_imp_open_vimage [of UNIV])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    53
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    54
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    55
lemma closed_halfspace_Re_ge: "closed {z. Re(z) \<ge> b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    56
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    57
  have "{z. Re(z) \<ge> b} = - {z. Re(z) < b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    58
    by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    59
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    60
    by (simp add: closed_def open_halfspace_Re_lt)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    61
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    62
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    63
lemma closed_halfspace_Re_le: "closed {z. Re(z) \<le> b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    64
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    65
  have "{z. Re(z) \<le> b} = - {z. Re(z) > b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    66
    by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    67
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    68
    by (simp add: closed_def open_halfspace_Re_gt)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    69
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    70
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    71
lemma closed_halfspace_Re_eq: "closed {z. Re(z) = b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    72
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    73
  have "{z. Re(z) = b} = {z. Re(z) \<le> b} \<inter> {z. Re(z) \<ge> b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    74
    by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    75
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    76
    by (auto simp: closed_Int closed_halfspace_Re_le closed_halfspace_Re_ge)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    77
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    78
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    79
lemma open_halfspace_Im_lt: "open {z. Im(z) < b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    80
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    81
  have "{z. Im(z) < b} = Im -`{..<b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    82
    by blast
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    83
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    84
    by (auto simp: continuous_Im continuous_imp_open_vimage [of UNIV])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    85
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    86
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    87
lemma open_halfspace_Im_gt: "open {z. Im(z) > b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    88
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    89
  have "{z. Im(z) > b} = Im -`{b<..}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    90
    by blast
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    91
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    92
    by (auto simp: continuous_Im continuous_imp_open_vimage [of UNIV])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    93
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    94
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    95
lemma closed_halfspace_Im_ge: "closed {z. Im(z) \<ge> b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    96
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    97
  have "{z. Im(z) \<ge> b} = - {z. Im(z) < b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    98
    by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    99
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   100
    by (simp add: closed_def open_halfspace_Im_lt)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   101
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   102
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   103
lemma closed_halfspace_Im_le: "closed {z. Im(z) \<le> b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   104
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   105
  have "{z. Im(z) \<le> b} = - {z. Im(z) > b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   106
    by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   107
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   108
    by (simp add: closed_def open_halfspace_Im_gt)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   109
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   110
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   111
lemma closed_halfspace_Im_eq: "closed {z. Im(z) = b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   112
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   113
  have "{z. Im(z) = b} = {z. Im(z) \<le> b} \<inter> {z. Im(z) \<ge> b}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   114
    by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   115
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   116
    by (auto simp: closed_Int closed_halfspace_Im_le closed_halfspace_Im_ge)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   117
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   118
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   119
lemma complex_is_Real_iff: "z \<in> \<real> \<longleftrightarrow> Im z = 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   120
  by (metis Complex_in_Reals Im_complex_of_real Reals_cases complex_surj)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   121
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   122
lemma closed_complex_Reals: "closed (Reals :: complex set)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   123
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   124
  have "-(Reals :: complex set) = {z. Im(z) < 0} \<union> {z. 0 < Im(z)}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   125
    by (auto simp: complex_is_Real_iff)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   126
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   127
    by (metis closed_def open_Un open_halfspace_Im_gt open_halfspace_Im_lt)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   128
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   129
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   130
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   131
lemma linear_times:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   132
  fixes c::"'a::{real_algebra,real_vector}" shows "linear (\<lambda>x. c * x)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   133
  by (auto simp: linearI distrib_left)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   134
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   135
lemma bilinear_times:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   136
  fixes c::"'a::{real_algebra,real_vector}" shows "bilinear (\<lambda>x y::'a. x*y)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   137
  unfolding bilinear_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   138
  by (auto simp: distrib_left distrib_right intro!: linearI)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   139
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   140
lemma linear_cnj: "linear cnj"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   141
  by (auto simp: linearI cnj_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   142
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   143
lemma tendsto_mult_left:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   144
  fixes c::"'a::real_normed_algebra" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   145
  shows "(f ---> l) F \<Longrightarrow> ((\<lambda>x. c * (f x)) ---> c * l) F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   146
by (rule tendsto_mult [OF tendsto_const])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   147
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   148
lemma tendsto_mult_right:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   149
  fixes c::"'a::real_normed_algebra" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   150
  shows "(f ---> l) F \<Longrightarrow> ((\<lambda>x. (f x) * c) ---> l * c) F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   151
by (rule tendsto_mult [OF _ tendsto_const])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   152
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   153
lemma tendsto_Re_upper:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   154
  assumes "~ (trivial_limit F)" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   155
          "(f ---> l) F" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   156
          "eventually (\<lambda>x. Re(f x) \<le> b) F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   157
    shows  "Re(l) \<le> b"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   158
  by (metis assms tendsto_le [OF _ tendsto_const]  tendsto_Re)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   159
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   160
lemma tendsto_Re_lower:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   161
  assumes "~ (trivial_limit F)" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   162
          "(f ---> l) F" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   163
          "eventually (\<lambda>x. b \<le> Re(f x)) F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   164
    shows  "b \<le> Re(l)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   165
  by (metis assms tendsto_le [OF _ _ tendsto_const]  tendsto_Re)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   166
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   167
lemma tendsto_Im_upper:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   168
  assumes "~ (trivial_limit F)" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   169
          "(f ---> l) F" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   170
          "eventually (\<lambda>x. Im(f x) \<le> b) F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   171
    shows  "Im(l) \<le> b"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   172
  by (metis assms tendsto_le [OF _ tendsto_const]  tendsto_Im)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   173
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   174
lemma tendsto_Im_lower:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   175
  assumes "~ (trivial_limit F)" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   176
          "(f ---> l) F" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   177
          "eventually (\<lambda>x. b \<le> Im(f x)) F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   178
    shows  "b \<le> Im(l)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   179
  by (metis assms tendsto_le [OF _ _ tendsto_const]  tendsto_Im)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   180
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   181
subsection{*General lemmas*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   182
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   183
lemma continuous_mult_left:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   184
  fixes c::"'a::real_normed_algebra" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   185
  shows "continuous F f \<Longrightarrow> continuous F (\<lambda>x. c * f x)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   186
by (rule continuous_mult [OF continuous_const])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   187
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   188
lemma continuous_mult_right:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   189
  fixes c::"'a::real_normed_algebra" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   190
  shows "continuous F f \<Longrightarrow> continuous F (\<lambda>x. f x * c)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   191
by (rule continuous_mult [OF _ continuous_const])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   192
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   193
lemma continuous_on_mult_left:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   194
  fixes c::"'a::real_normed_algebra" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   195
  shows "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. c * f x)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   196
by (rule continuous_on_mult [OF continuous_on_const])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   197
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   198
lemma continuous_on_mult_right:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   199
  fixes c::"'a::real_normed_algebra" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   200
  shows "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. f x * c)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   201
by (rule continuous_on_mult [OF _ continuous_on_const])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   202
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   203
lemma uniformly_continuous_on_cmul_right [continuous_on_intros]:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   204
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_algebra"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   205
  assumes "uniformly_continuous_on s f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   206
  shows "uniformly_continuous_on s (\<lambda>x. f x * c)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   207
proof (cases "c=0")
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   208
  case True then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   209
    by (simp add: uniformly_continuous_on_const)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   210
next
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   211
  case False show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   212
    apply (rule bounded_linear.uniformly_continuous_on)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   213
    apply (metis bounded_linear_ident)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   214
    using assms
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   215
    apply (auto simp: uniformly_continuous_on_def dist_norm)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   216
    apply (drule_tac x = "e / norm c" in spec, auto)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   217
    apply (metis divide_pos_pos zero_less_norm_iff False)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   218
    apply (rule_tac x=d in exI, auto)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   219
    apply (drule_tac x = x in bspec, assumption)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   220
    apply (drule_tac x = "x'" in bspec)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   221
    apply (auto simp: False less_divide_eq)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   222
    by (metis dual_order.strict_trans2 left_diff_distrib norm_mult_ineq)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   223
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   224
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   225
lemma uniformly_continuous_on_cmul_left[continuous_on_intros]:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   226
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_algebra"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   227
  assumes "uniformly_continuous_on s f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   228
    shows "uniformly_continuous_on s (\<lambda>x. c * f x)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   229
by (metis assms bounded_linear.uniformly_continuous_on bounded_linear_mult_right)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   230
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   231
lemma continuous_within_norm_id [continuous_intros]: "continuous (at x within S) norm"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   232
  by (rule continuous_norm [OF continuous_ident])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   233
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   234
lemma continuous_on_norm_id [continuous_intros]: "continuous_on S norm"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   235
  by (metis continuous_on_eq continuous_on_id continuous_on_norm)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   236
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   237
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   238
subsection{*DERIV stuff*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   239
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   240
(*move some premises to a sensible order. Use more \<And> symbols.*)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   241
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   242
lemma DERIV_continuous_on: "\<lbrakk>\<And>x. x \<in> s \<Longrightarrow> DERIV f x :> D\<rbrakk> \<Longrightarrow> continuous_on s f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   243
  by (metis DERIV_continuous continuous_at_imp_continuous_on)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   244
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   245
lemma DERIV_subset: 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   246
  "(f has_field_derivative f') (at x within s) \<Longrightarrow> t \<subseteq> s 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   247
   \<Longrightarrow> (f has_field_derivative f') (at x within t)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   248
  by (simp add: has_field_derivative_def has_derivative_within_subset)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   249
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   250
lemma lambda_zero: "(\<lambda>h::'a::mult_zero. 0) = op * 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   251
  by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   252
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   253
lemma lambda_one: "(\<lambda>x::'a::monoid_mult. x) = op * 1"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   254
  by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   255
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   256
lemma has_derivative_zero_constant:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   257
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   258
  assumes "convex s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   259
      and d0: "\<And>x. x\<in>s \<Longrightarrow> (f has_derivative (\<lambda>h. 0)) (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   260
    shows "\<exists>c. \<forall>x\<in>s. f x = c"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   261
proof (cases "s={}")
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   262
  case False
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   263
  then obtain x where "x \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   264
    by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   265
  have d0': "\<forall>x\<in>s. (f has_derivative (\<lambda>h. 0)) (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   266
    by (metis d0)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   267
  have "\<And>y. y \<in> s \<Longrightarrow> f x = f y"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   268
  proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   269
    case goal1
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   270
    then show ?case
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   271
      using differentiable_bound[OF assms(1) d0', of 0 x y] and `x \<in> s`
56223
7696903b9e61 generalize theory of operator norms to work with class real_normed_vector
huffman
parents: 56217
diff changeset
   272
      unfolding onorm_zero
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   273
      by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   274
  qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   275
  then show ?thesis 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   276
    by metis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   277
next
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   278
  case True
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   279
  then show ?thesis by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   280
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   281
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   282
lemma has_derivative_zero_unique:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   283
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   284
  assumes "convex s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   285
      and "\<And>x. x\<in>s \<Longrightarrow> (f has_derivative (\<lambda>h. 0)) (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   286
      and "a \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   287
      and "x \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   288
    shows "f x = f a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   289
  using assms
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   290
  by (metis has_derivative_zero_constant)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   291
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   292
lemma has_derivative_zero_connected_constant:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   293
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::banach"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   294
  assumes "connected s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   295
      and "open s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   296
      and "finite k"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   297
      and "continuous_on s f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   298
      and "\<forall>x\<in>(s - k). (f has_derivative (\<lambda>h. 0)) (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   299
    obtains c where "\<And>x. x \<in> s \<Longrightarrow> f(x) = c"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   300
proof (cases "s = {}")
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   301
  case True
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   302
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   303
by (metis empty_iff that)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   304
next
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   305
  case False
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   306
  then obtain c where "c \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   307
    by (metis equals0I)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   308
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   309
    by (metis has_derivative_zero_unique_strong_connected assms that)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   310
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   311
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   312
lemma DERIV_zero_connected_constant:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   313
  fixes f :: "'a::{real_normed_field,euclidean_space} \<Rightarrow> 'a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   314
  assumes "connected s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   315
      and "open s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   316
      and "finite k"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   317
      and "continuous_on s f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   318
      and "\<forall>x\<in>(s - k). DERIV f x :> 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   319
    obtains c where "\<And>x. x \<in> s \<Longrightarrow> f(x) = c"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   320
using has_derivative_zero_connected_constant [OF assms(1-4)] assms
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   321
by (metis DERIV_const Derivative.has_derivative_const Diff_iff at_within_open 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   322
          frechet_derivative_at has_field_derivative_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   323
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   324
lemma DERIV_zero_constant:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   325
  fixes f :: "'a::{real_normed_field,euclidean_space} \<Rightarrow> 'a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   326
  shows    "\<lbrakk>convex s;
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   327
             \<And>x. x\<in>s \<Longrightarrow> (f has_field_derivative 0) (at x within s)\<rbrakk> 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   328
             \<Longrightarrow> \<exists>c. \<forall>x \<in> s. f(x) = c"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   329
  unfolding has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   330
  by (auto simp: lambda_zero intro: has_derivative_zero_constant)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   331
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   332
lemma DERIV_zero_unique:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   333
  fixes f :: "'a::{real_normed_field,euclidean_space} \<Rightarrow> 'a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   334
  assumes "convex s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   335
      and d0: "\<And>x. x\<in>s \<Longrightarrow> (f has_field_derivative 0) (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   336
      and "a \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   337
      and "x \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   338
    shows "f x = f a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   339
apply (rule has_derivative_zero_unique [where f=f, OF assms(1) _ assms(3,4)])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   340
by (metis d0 has_field_derivative_imp_has_derivative lambda_zero)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   341
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   342
lemma DERIV_zero_connected_unique:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   343
  fixes f :: "'a::{real_normed_field,euclidean_space} \<Rightarrow> 'a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   344
  assumes "connected s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   345
      and "open s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   346
      and d0: "\<And>x. x\<in>s \<Longrightarrow> DERIV f x :> 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   347
      and "a \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   348
      and "x \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   349
    shows "f x = f a" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   350
    apply (rule Integration.has_derivative_zero_unique_strong_connected [of s "{}" f])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   351
    using assms
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   352
    apply auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   353
    apply (metis DERIV_continuous_on)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   354
  by (metis at_within_open has_field_derivative_def lambda_zero)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   355
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   356
lemma DERIV_transform_within:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   357
  assumes "(f has_field_derivative f') (at a within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   358
      and "0 < d" "a \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   359
      and "\<And>x. x\<in>s \<Longrightarrow> dist x a < d \<Longrightarrow> f x = g x"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   360
    shows "(g has_field_derivative f') (at a within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   361
  using assms unfolding has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   362
  by (blast intro: Derivative.has_derivative_transform_within)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   363
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   364
lemma DERIV_transform_within_open:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   365
  assumes "DERIV f a :> f'"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   366
      and "open s" "a \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   367
      and "\<And>x. x\<in>s \<Longrightarrow> f x = g x"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   368
    shows "DERIV g a :> f'"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   369
  using assms unfolding has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   370
by (metis has_derivative_transform_within_open)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   371
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   372
lemma DERIV_transform_at:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   373
  assumes "DERIV f a :> f'"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   374
      and "0 < d"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   375
      and "\<And>x. dist x a < d \<Longrightarrow> f x = g x"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   376
    shows "DERIV g a :> f'"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   377
  by (blast intro: assms DERIV_transform_within)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   378
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   379
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   380
subsection{*Holomorphic functions*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   381
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   382
lemma has_derivative_ident[has_derivative_intros, simp]: 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   383
     "FDERIV complex_of_real x :> complex_of_real"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   384
  by (simp add: has_derivative_def tendsto_const bounded_linear_of_real)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   385
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   386
lemma has_real_derivative:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   387
  fixes f :: "real\<Rightarrow>real" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   388
  assumes "(f has_derivative f') F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   389
    obtains c where "(f has_derivative (\<lambda>x. x * c)) F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   390
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   391
  obtain c where "f' = (\<lambda>x. x * c)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   392
    by (metis assms derivative_linear real_bounded_linear)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   393
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   394
    by (metis assms that)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   395
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   396
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   397
lemma has_real_derivative_iff:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   398
  fixes f :: "real\<Rightarrow>real" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   399
  shows "(\<exists>f'. (f has_derivative (\<lambda>x. x * f')) F) = (\<exists>D. (f has_derivative D) F)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   400
by (auto elim: has_real_derivative)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   401
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   402
definition complex_differentiable :: "[complex \<Rightarrow> complex, complex filter] \<Rightarrow> bool"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   403
           (infixr "(complex'_differentiable)" 50)  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   404
  where "f complex_differentiable F \<equiv> \<exists>f'. (f has_field_derivative f') F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   405
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   406
definition DD :: "['a \<Rightarrow> 'a::real_normed_field, 'a] \<Rightarrow> 'a" --{*for real, complex?*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   407
  where "DD f x \<equiv> THE f'. (f has_derivative (\<lambda>x. x * f')) (at x)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   408
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   409
definition holomorphic_on :: "[complex \<Rightarrow> complex, complex set] \<Rightarrow> bool"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   410
           (infixl "(holomorphic'_on)" 50)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   411
  where "f holomorphic_on s \<equiv> \<forall>x \<in> s. \<exists>f'. (f has_field_derivative f') (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   412
  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   413
lemma holomorphic_on_empty: "f holomorphic_on {}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   414
  by (simp add: holomorphic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   415
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   416
lemma holomorphic_on_differentiable:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   417
     "f holomorphic_on s \<longleftrightarrow> (\<forall>x \<in> s. f complex_differentiable (at x within s))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   418
unfolding holomorphic_on_def complex_differentiable_def has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   419
by (metis mult_commute_abs)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   420
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   421
lemma holomorphic_on_open:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   422
    "open s \<Longrightarrow> f holomorphic_on s \<longleftrightarrow> (\<forall>x \<in> s. \<exists>f'. DERIV f x :> f')"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   423
  by (auto simp: holomorphic_on_def has_field_derivative_def at_within_open [of _ s])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   424
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   425
lemma complex_differentiable_imp_continuous_at: 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   426
    "f complex_differentiable (at x) \<Longrightarrow> continuous (at x) f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   427
  by (metis DERIV_continuous complex_differentiable_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   428
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   429
lemma holomorphic_on_imp_continuous_on: 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   430
    "f holomorphic_on s \<Longrightarrow> continuous_on s f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   431
  by (metis DERIV_continuous continuous_on_eq_continuous_within holomorphic_on_def) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   432
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   433
lemma has_derivative_within_open:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   434
  "a \<in> s \<Longrightarrow> open s \<Longrightarrow> (f has_field_derivative f') (at a within s) \<longleftrightarrow> DERIV f a :> f'"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   435
  by (simp add: has_field_derivative_def) (metis has_derivative_within_open)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   436
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   437
lemma holomorphic_on_subset:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   438
    "f holomorphic_on s \<Longrightarrow> t \<subseteq> s \<Longrightarrow> f holomorphic_on t"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   439
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   440
  by (metis DERIV_subset subsetD)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   441
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   442
lemma complex_differentiable_within_subset:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   443
    "\<lbrakk>f complex_differentiable (at x within s); t \<subseteq> s\<rbrakk>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   444
     \<Longrightarrow> f complex_differentiable (at x within t)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   445
  unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   446
  by (metis DERIV_subset)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   447
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   448
lemma complex_differentiable_at_within:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   449
    "\<lbrakk>f complex_differentiable (at x)\<rbrakk>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   450
     \<Longrightarrow> f complex_differentiable (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   451
  unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   452
  by (metis DERIV_subset top_greatest)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   453
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   454
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   455
lemma has_derivative_mult_right:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   456
  fixes c:: "'a :: real_normed_algebra"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   457
  shows "((op * c) has_derivative (op * c)) F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   458
by (rule has_derivative_mult_right [OF has_derivative_id])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   459
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   460
lemma complex_differentiable_linear:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   461
     "(op * c) complex_differentiable F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   462
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   463
  have "\<And>u::complex. (\<lambda>x. x * u) = op * u"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   464
    by (rule ext) (simp add: mult_ac)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   465
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   466
    unfolding complex_differentiable_def has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   467
    by (force intro: has_derivative_mult_right)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   468
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   469
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   470
lemma complex_differentiable_const:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   471
  "(\<lambda>z. c) complex_differentiable F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   472
  unfolding complex_differentiable_def has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   473
  apply (rule exI [where x=0])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   474
  by (metis Derivative.has_derivative_const lambda_zero) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   475
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   476
lemma complex_differentiable_id:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   477
  "(\<lambda>z. z) complex_differentiable F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   478
  unfolding complex_differentiable_def has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   479
  apply (rule exI [where x=1])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   480
  apply (simp add: lambda_one [symmetric])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   481
  done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   482
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   483
(*DERIV_minus*)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   484
lemma field_differentiable_minus:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   485
  assumes "(f has_field_derivative f') F" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   486
    shows "((\<lambda>z. - (f z)) has_field_derivative -f') F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   487
  apply (rule has_derivative_imp_has_field_derivative[OF has_derivative_minus])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   488
  using assms 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   489
  by (auto simp: has_field_derivative_def field_simps mult_commute_abs)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   490
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   491
(*DERIV_add*)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   492
lemma field_differentiable_add:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   493
  assumes "(f has_field_derivative f') F" "(g has_field_derivative g') F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   494
    shows "((\<lambda>z. f z + g z) has_field_derivative f' + g') F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   495
  apply (rule has_derivative_imp_has_field_derivative[OF has_derivative_add])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   496
  using assms 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   497
  by (auto simp: has_field_derivative_def field_simps mult_commute_abs)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   498
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   499
(*DERIV_diff*)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   500
lemma field_differentiable_diff:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   501
  assumes "(f has_field_derivative f') F" "(g has_field_derivative g') F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   502
    shows "((\<lambda>z. f z - g z) has_field_derivative f' - g') F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   503
by (simp only: assms diff_conv_add_uminus field_differentiable_add field_differentiable_minus)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   504
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   505
lemma complex_differentiable_minus:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   506
    "f complex_differentiable F \<Longrightarrow> (\<lambda>z. -(f z)) complex_differentiable F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   507
  using assms unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   508
  by (metis field_differentiable_minus)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   509
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   510
lemma complex_differentiable_add:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   511
  assumes "f complex_differentiable F" "g complex_differentiable F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   512
    shows "(\<lambda>z. f z + g z) complex_differentiable F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   513
  using assms unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   514
  by (metis field_differentiable_add)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   515
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   516
lemma complex_differentiable_diff:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   517
  assumes "f complex_differentiable F" "g complex_differentiable F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   518
    shows "(\<lambda>z. f z - g z) complex_differentiable F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   519
  using assms unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   520
  by (metis field_differentiable_diff)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   521
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   522
lemma complex_differentiable_inverse:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   523
  assumes "f complex_differentiable (at a within s)" "f a \<noteq> 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   524
  shows "(\<lambda>z. inverse (f z)) complex_differentiable (at a within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   525
  using assms unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   526
  by (metis DERIV_inverse_fun)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   527
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   528
lemma complex_differentiable_mult:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   529
  assumes "f complex_differentiable (at a within s)" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   530
          "g complex_differentiable (at a within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   531
    shows "(\<lambda>z. f z * g z) complex_differentiable (at a within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   532
  using assms unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   533
  by (metis DERIV_mult [of f _ a s g])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   534
  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   535
lemma complex_differentiable_divide:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   536
  assumes "f complex_differentiable (at a within s)" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   537
          "g complex_differentiable (at a within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   538
          "g a \<noteq> 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   539
    shows "(\<lambda>z. f z / g z) complex_differentiable (at a within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   540
  using assms unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   541
  by (metis DERIV_divide [of f _ a s g])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   542
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   543
lemma complex_differentiable_power:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   544
  assumes "f complex_differentiable (at a within s)" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   545
    shows "(\<lambda>z. f z ^ n) complex_differentiable (at a within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   546
  using assms unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   547
  by (metis DERIV_power)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   548
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   549
lemma complex_differentiable_transform_within:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   550
  "0 < d \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   551
        x \<in> s \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   552
        (\<And>x'. x' \<in> s \<Longrightarrow> dist x' x < d \<Longrightarrow> f x' = g x') \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   553
        f complex_differentiable (at x within s)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   554
        \<Longrightarrow> g complex_differentiable (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   555
  unfolding complex_differentiable_def has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   556
  by (blast intro: has_derivative_transform_within)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   557
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   558
lemma complex_differentiable_compose_within:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   559
  assumes "f complex_differentiable (at a within s)" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   560
          "g complex_differentiable (at (f a) within f`s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   561
    shows "(g o f) complex_differentiable (at a within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   562
  using assms unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   563
  by (metis DERIV_image_chain)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   564
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   565
lemma complex_differentiable_within_open:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   566
     "\<lbrakk>a \<in> s; open s\<rbrakk> \<Longrightarrow> f complex_differentiable at a within s \<longleftrightarrow> 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   567
                          f complex_differentiable at a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   568
  unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   569
  by (metis at_within_open)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   570
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   571
lemma holomorphic_transform:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   572
     "\<lbrakk>f holomorphic_on s; \<And>x. x \<in> s \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> g holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   573
  apply (auto simp: holomorphic_on_def has_field_derivative_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   574
  by (metis complex_differentiable_def complex_differentiable_transform_within has_field_derivative_def linordered_field_no_ub)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   575
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   576
lemma holomorphic_eq:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   577
     "(\<And>x. x \<in> s \<Longrightarrow> f x = g x) \<Longrightarrow> f holomorphic_on s \<longleftrightarrow> g holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   578
  by (metis holomorphic_transform)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   579
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   580
subsection{*Holomorphic*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   581
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   582
lemma holomorphic_on_linear:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   583
     "(op * c) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   584
  unfolding holomorphic_on_def  by (metis DERIV_cmult_Id)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   585
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   586
lemma holomorphic_on_const:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   587
     "(\<lambda>z. c) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   588
  unfolding holomorphic_on_def  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   589
  by (metis DERIV_const)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   590
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   591
lemma holomorphic_on_id:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   592
     "id holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   593
  unfolding holomorphic_on_def id_def  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   594
  by (metis DERIV_ident)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   595
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   596
lemma holomorphic_on_compose:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   597
  "f holomorphic_on s \<Longrightarrow> g holomorphic_on (f ` s)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   598
           \<Longrightarrow> (g o f) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   599
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   600
  by (metis DERIV_image_chain imageI)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   601
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   602
lemma holomorphic_on_compose_gen:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   603
  "\<lbrakk>f holomorphic_on s; g holomorphic_on t; f ` s \<subseteq> t\<rbrakk> \<Longrightarrow> (g o f) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   604
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   605
  by (metis DERIV_image_chain DERIV_subset image_subset_iff)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   606
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   607
lemma holomorphic_on_minus:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   608
  "f holomorphic_on s \<Longrightarrow> (\<lambda>z. -(f z)) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   609
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   610
by (metis DERIV_minus)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   611
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   612
lemma holomorphic_on_add:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   613
  "\<lbrakk>f holomorphic_on s; g holomorphic_on s\<rbrakk> \<Longrightarrow> (\<lambda>z. f z + g z) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   614
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   615
  by (metis DERIV_add)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   616
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   617
lemma holomorphic_on_diff:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   618
  "\<lbrakk>f holomorphic_on s; g holomorphic_on s\<rbrakk> \<Longrightarrow> (\<lambda>z. f z - g z) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   619
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   620
  by (metis DERIV_diff)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   621
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   622
lemma holomorphic_on_mult:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   623
  "\<lbrakk>f holomorphic_on s; g holomorphic_on s\<rbrakk> \<Longrightarrow> (\<lambda>z. f z * g z) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   624
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   625
  by auto (metis DERIV_mult)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   626
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   627
lemma holomorphic_on_inverse:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   628
  "\<lbrakk>f holomorphic_on s; \<And>z. z \<in> s \<Longrightarrow> f z \<noteq> 0\<rbrakk> \<Longrightarrow> (\<lambda>z. inverse (f z)) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   629
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   630
  by (metis DERIV_inverse')
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   631
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   632
lemma holomorphic_on_divide:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   633
  "\<lbrakk>f holomorphic_on s; g holomorphic_on s; \<And>z. z \<in> s \<Longrightarrow> g z \<noteq> 0\<rbrakk> \<Longrightarrow> (\<lambda>z. f z / g z) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   634
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   635
  by (metis (full_types) DERIV_divide)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   636
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   637
lemma holomorphic_on_power:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   638
  "f holomorphic_on s \<Longrightarrow> (\<lambda>z. (f z)^n) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   639
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   640
  by (metis DERIV_power)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   641
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   642
lemma holomorphic_on_setsum:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   643
  "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> (f i) holomorphic_on s)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   644
           \<Longrightarrow> (\<lambda>x. setsum (\<lambda>i. f i x) I) holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   645
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   646
  apply (induct I rule: finite_induct) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   647
  apply (force intro: DERIV_const DERIV_add)+
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   648
  done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   649
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   650
lemma DERIV_imp_DD: "DERIV f x :> f' \<Longrightarrow> DD f x = f'"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   651
    apply (simp add: DD_def has_field_derivative_def mult_commute_abs)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   652
    apply (rule the_equality, assumption)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   653
    apply (metis DERIV_unique has_field_derivative_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   654
    done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   655
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   656
lemma DD_iff_derivative_differentiable:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   657
  fixes f :: "real\<Rightarrow>real" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   658
  shows   "DERIV f x :> DD f x \<longleftrightarrow> f differentiable at x"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   659
unfolding DD_def differentiable_def 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   660
by (metis (full_types) DD_def DERIV_imp_DD has_field_derivative_def has_real_derivative_iff 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   661
          mult_commute_abs)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   662
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   663
lemma DD_iff_derivative_complex_differentiable:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   664
  fixes f :: "complex\<Rightarrow>complex" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   665
  shows "DERIV f x :> DD f x \<longleftrightarrow> f complex_differentiable at x"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   666
unfolding DD_def complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   667
by (metis DD_def DERIV_imp_DD)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   668
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   669
lemma complex_differentiable_compose:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   670
  "f complex_differentiable at z \<Longrightarrow> g complex_differentiable at (f z)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   671
          \<Longrightarrow> (g o f) complex_differentiable at z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   672
by (metis complex_differentiable_at_within complex_differentiable_compose_within)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   673
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   674
lemma complex_derivative_chain:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   675
  fixes z::complex
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   676
  shows
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   677
  "f complex_differentiable at z \<Longrightarrow> g complex_differentiable at (f z)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   678
          \<Longrightarrow> DD (g o f) z = DD g (f z) * DD f z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   679
by (metis DD_iff_derivative_complex_differentiable DERIV_chain DERIV_imp_DD)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   680
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   681
lemma comp_derivative_chain:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   682
  fixes z::real
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   683
  shows "\<lbrakk>f differentiable at z; g differentiable at (f z)\<rbrakk> 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   684
         \<Longrightarrow> DD (g o f) z = DD g (f z) * DD f z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   685
by (metis DD_iff_derivative_differentiable DERIV_chain DERIV_imp_DD)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   686
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   687
lemma complex_derivative_linear: "DD (\<lambda>w. c * w) = (\<lambda>z. c)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   688
by (metis DERIV_imp_DD DERIV_cmult_Id)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   689
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   690
lemma complex_derivative_ident: "DD (\<lambda>w. w) = (\<lambda>z. 1)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   691
by (metis DERIV_imp_DD DERIV_ident)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   692
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   693
lemma complex_derivative_const: "DD (\<lambda>w. c) = (\<lambda>z. 0)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   694
by (metis DERIV_imp_DD DERIV_const)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   695
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   696
lemma complex_derivative_add:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   697
  "\<lbrakk>f complex_differentiable at z; g complex_differentiable at z\<rbrakk>  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   698
   \<Longrightarrow> DD (\<lambda>w. f w + g w) z = DD f z + DD g z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   699
  unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   700
  by (rule DERIV_imp_DD) (metis (poly_guards_query) DERIV_add DERIV_imp_DD)  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   701
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   702
lemma complex_derivative_diff:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   703
  "\<lbrakk>f complex_differentiable at z; g complex_differentiable at z\<rbrakk>  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   704
   \<Longrightarrow> DD (\<lambda>w. f w - g w) z = DD f z - DD g z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   705
  unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   706
  by (rule DERIV_imp_DD) (metis (poly_guards_query) DERIV_diff DERIV_imp_DD)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   707
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   708
lemma complex_derivative_mult:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   709
  "\<lbrakk>f complex_differentiable at z; g complex_differentiable at z\<rbrakk>  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   710
   \<Longrightarrow> DD (\<lambda>w. f w * g w) z = f z * DD g z + DD f z * g z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   711
  unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   712
  by (rule DERIV_imp_DD) (metis DERIV_imp_DD DERIV_mult')
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   713
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   714
lemma complex_derivative_cmult:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   715
  "f complex_differentiable at z \<Longrightarrow> DD (\<lambda>w. c * f w) z = c * DD f z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   716
  unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   717
  by (metis DERIV_cmult DERIV_imp_DD)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   718
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   719
lemma complex_derivative_cmult_right:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   720
  "f complex_differentiable at z \<Longrightarrow> DD (\<lambda>w. f w * c) z = DD f z * c"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   721
  unfolding complex_differentiable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   722
  by (metis DERIV_cmult_right DERIV_imp_DD)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   723
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   724
lemma complex_derivative_transform_within_open:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   725
  "\<lbrakk>f holomorphic_on s; g holomorphic_on s; open s; z \<in> s; \<And>w. w \<in> s \<Longrightarrow> f w = g w\<rbrakk> 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   726
   \<Longrightarrow> DD f z = DD g z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   727
  unfolding holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   728
  by (rule DERIV_imp_DD) (metis has_derivative_within_open DERIV_imp_DD DERIV_transform_within_open)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   729
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   730
lemma complex_derivative_compose_linear:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   731
    "f complex_differentiable at (c * z) \<Longrightarrow> DD (\<lambda>w. f (c * w)) z = c * DD f (c * z)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   732
apply (rule DERIV_imp_DD)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   733
apply (simp add: DD_iff_derivative_complex_differentiable [symmetric])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   734
apply (metis DERIV_chain' DERIV_cmult_Id comm_semiring_1_class.normalizing_semiring_rules(7))  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   735
done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   736
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   737
subsection{*Caratheodory characterization.*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   738
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   739
(*REPLACE the original version. BUT IN WHICH FILE??*)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   740
thm Deriv.CARAT_DERIV
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   741
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   742
lemma complex_differentiable_caratheodory_at:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   743
  "f complex_differentiable (at z) \<longleftrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   744
         (\<exists>g. (\<forall>w. f(w) - f(z) = g(w) * (w - z)) \<and> continuous (at z) g)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   745
  using CARAT_DERIV [of f]
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   746
  by (simp add: complex_differentiable_def has_field_derivative_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   747
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   748
lemma complex_differentiable_caratheodory_within:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   749
  "f complex_differentiable (at z within s) \<longleftrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   750
         (\<exists>g. (\<forall>w. f(w) - f(z) = g(w) * (w - z)) \<and> continuous (at z within s) g)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   751
  using DERIV_caratheodory_within [of f]
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   752
  by (simp add: complex_differentiable_def has_field_derivative_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   753
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   754
subsection{*analyticity on a set*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   755
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   756
definition analytic_on (infixl "(analytic'_on)" 50)  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   757
  where
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   758
   "f analytic_on s \<equiv> \<forall>x \<in> s. \<exists>e. 0 < e \<and> f holomorphic_on (ball x e)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   759
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   760
lemma analytic_imp_holomorphic:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   761
     "f analytic_on s \<Longrightarrow> f holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   762
  unfolding analytic_on_def holomorphic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   763
  apply (simp add: has_derivative_within_open [OF _ open_ball])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   764
  apply (metis DERIV_subset dist_self mem_ball top_greatest)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   765
  done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   766
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   767
lemma analytic_on_open:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   768
     "open s \<Longrightarrow> f analytic_on s \<longleftrightarrow> f holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   769
apply (auto simp: analytic_imp_holomorphic)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   770
apply (auto simp: analytic_on_def holomorphic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   771
by (metis holomorphic_on_def holomorphic_on_subset open_contains_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   772
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   773
lemma analytic_on_imp_differentiable_at:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   774
  "f analytic_on s \<Longrightarrow> x \<in> s \<Longrightarrow> f complex_differentiable (at x)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   775
 apply (auto simp: analytic_on_def holomorphic_on_differentiable)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   776
by (metis Topology_Euclidean_Space.open_ball centre_in_ball complex_differentiable_within_open)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   777
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   778
lemma analytic_on_subset:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   779
     "f analytic_on s \<Longrightarrow> t \<subseteq> s \<Longrightarrow> f analytic_on t"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   780
  by (auto simp: analytic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   781
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   782
lemma analytic_on_Un:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   783
    "f analytic_on (s \<union> t) \<longleftrightarrow> f analytic_on s \<and> f analytic_on t"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   784
  by (auto simp: analytic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   785
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   786
lemma analytic_on_Union:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   787
  "f analytic_on (\<Union> s) \<longleftrightarrow> (\<forall>t \<in> s. f analytic_on t)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   788
  by (auto simp: analytic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   789
  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   790
lemma analytic_on_holomorphic:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   791
  "f analytic_on s \<longleftrightarrow> (\<exists>t. open t \<and> s \<subseteq> t \<and> f holomorphic_on t)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   792
  (is "?lhs = ?rhs")
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   793
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   794
  have "?lhs \<longleftrightarrow> (\<exists>t. open t \<and> s \<subseteq> t \<and> f analytic_on t)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   795
  proof safe
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   796
    assume "f analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   797
    then show "\<exists>t. open t \<and> s \<subseteq> t \<and> f analytic_on t"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   798
      apply (simp add: analytic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   799
      apply (rule exI [where x="\<Union>{u. open u \<and> f analytic_on u}"], auto)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   800
      apply (metis Topology_Euclidean_Space.open_ball analytic_on_open centre_in_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   801
      by (metis analytic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   802
  next
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   803
    fix t
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   804
    assume "open t" "s \<subseteq> t" "f analytic_on t" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   805
    then show "f analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   806
        by (metis analytic_on_subset)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   807
  qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   808
  also have "... \<longleftrightarrow> ?rhs"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   809
    by (auto simp: analytic_on_open)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   810
  finally show ?thesis .
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   811
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   812
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   813
lemma analytic_on_linear: "(op * c) analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   814
  apply (simp add: analytic_on_holomorphic holomorphic_on_linear)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   815
  by (metis open_UNIV top_greatest)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   816
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   817
lemma analytic_on_const: "(\<lambda>z. c) analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   818
  unfolding analytic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   819
  by (metis holomorphic_on_const zero_less_one)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   820
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   821
lemma analytic_on_id: "id analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   822
  unfolding analytic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   823
  apply (simp add: holomorphic_on_id)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   824
  by (metis gt_ex)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   825
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   826
lemma analytic_on_compose:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   827
  assumes f: "f analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   828
      and g: "g analytic_on (f ` s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   829
    shows "(g o f) analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   830
unfolding analytic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   831
proof (intro ballI)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   832
  fix x
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   833
  assume x: "x \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   834
  then obtain e where e: "0 < e" and fh: "f holomorphic_on ball x e" using f
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   835
    by (metis analytic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   836
  obtain e' where e': "0 < e'" and gh: "g holomorphic_on ball (f x) e'" using g
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   837
    by (metis analytic_on_def g image_eqI x) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   838
  have "isCont f x"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   839
    by (metis analytic_on_imp_differentiable_at complex_differentiable_imp_continuous_at f x)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   840
  with e' obtain d where d: "0 < d" and fd: "f ` ball x d \<subseteq> ball (f x) e'"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   841
     by (auto simp: continuous_at_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   842
  have "g \<circ> f holomorphic_on ball x (min d e)" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   843
    apply (rule holomorphic_on_compose)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   844
    apply (metis fh holomorphic_on_subset min.bounded_iff order_refl subset_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   845
    by (metis fd gh holomorphic_on_subset image_mono min.cobounded1 subset_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   846
  then show "\<exists>e>0. g \<circ> f holomorphic_on ball x e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   847
    by (metis d e min_less_iff_conj) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   848
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   849
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   850
lemma analytic_on_compose_gen:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   851
  "f analytic_on s \<Longrightarrow> g analytic_on t \<Longrightarrow> (\<And>z. z \<in> s \<Longrightarrow> f z \<in> t)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   852
             \<Longrightarrow> g o f analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   853
by (metis analytic_on_compose analytic_on_subset image_subset_iff)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   854
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   855
lemma analytic_on_neg:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   856
  "f analytic_on s \<Longrightarrow> (\<lambda>z. -(f z)) analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   857
by (metis analytic_on_holomorphic holomorphic_on_minus)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   858
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   859
lemma analytic_on_add:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   860
  assumes f: "f analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   861
      and g: "g analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   862
    shows "(\<lambda>z. f z + g z) analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   863
unfolding analytic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   864
proof (intro ballI)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   865
  fix z
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   866
  assume z: "z \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   867
  then obtain e where e: "0 < e" and fh: "f holomorphic_on ball z e" using f
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   868
    by (metis analytic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   869
  obtain e' where e': "0 < e'" and gh: "g holomorphic_on ball z e'" using g
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   870
    by (metis analytic_on_def g z) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   871
  have "(\<lambda>z. f z + g z) holomorphic_on ball z (min e e')" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   872
    apply (rule holomorphic_on_add) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   873
    apply (metis fh holomorphic_on_subset min.bounded_iff order_refl subset_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   874
    by (metis gh holomorphic_on_subset min.bounded_iff order_refl subset_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   875
  then show "\<exists>e>0. (\<lambda>z. f z + g z) holomorphic_on ball z e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   876
    by (metis e e' min_less_iff_conj)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   877
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   878
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   879
lemma analytic_on_diff:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   880
  assumes f: "f analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   881
      and g: "g analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   882
    shows "(\<lambda>z. f z - g z) analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   883
unfolding analytic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   884
proof (intro ballI)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   885
  fix z
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   886
  assume z: "z \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   887
  then obtain e where e: "0 < e" and fh: "f holomorphic_on ball z e" using f
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   888
    by (metis analytic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   889
  obtain e' where e': "0 < e'" and gh: "g holomorphic_on ball z e'" using g
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   890
    by (metis analytic_on_def g z) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   891
  have "(\<lambda>z. f z - g z) holomorphic_on ball z (min e e')" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   892
    apply (rule holomorphic_on_diff) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   893
    apply (metis fh holomorphic_on_subset min.bounded_iff order_refl subset_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   894
    by (metis gh holomorphic_on_subset min.bounded_iff order_refl subset_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   895
  then show "\<exists>e>0. (\<lambda>z. f z - g z) holomorphic_on ball z e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   896
    by (metis e e' min_less_iff_conj)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   897
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   898
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   899
lemma analytic_on_mult:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   900
  assumes f: "f analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   901
      and g: "g analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   902
    shows "(\<lambda>z. f z * g z) analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   903
unfolding analytic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   904
proof (intro ballI)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   905
  fix z
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   906
  assume z: "z \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   907
  then obtain e where e: "0 < e" and fh: "f holomorphic_on ball z e" using f
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   908
    by (metis analytic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   909
  obtain e' where e': "0 < e'" and gh: "g holomorphic_on ball z e'" using g
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   910
    by (metis analytic_on_def g z) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   911
  have "(\<lambda>z. f z * g z) holomorphic_on ball z (min e e')" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   912
    apply (rule holomorphic_on_mult) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   913
    apply (metis fh holomorphic_on_subset min.bounded_iff order_refl subset_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   914
    by (metis gh holomorphic_on_subset min.bounded_iff order_refl subset_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   915
  then show "\<exists>e>0. (\<lambda>z. f z * g z) holomorphic_on ball z e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   916
    by (metis e e' min_less_iff_conj)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   917
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   918
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   919
lemma analytic_on_inverse:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   920
  assumes f: "f analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   921
      and nz: "(\<And>z. z \<in> s \<Longrightarrow> f z \<noteq> 0)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   922
    shows "(\<lambda>z. inverse (f z)) analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   923
unfolding analytic_on_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   924
proof (intro ballI)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   925
  fix z
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   926
  assume z: "z \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   927
  then obtain e where e: "0 < e" and fh: "f holomorphic_on ball z e" using f
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   928
    by (metis analytic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   929
  have "continuous_on (ball z e) f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   930
    by (metis fh holomorphic_on_imp_continuous_on)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   931
  then obtain e' where e': "0 < e'" and nz': "\<And>y. dist z y < e' \<Longrightarrow> f y \<noteq> 0" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   932
    by (metis Topology_Euclidean_Space.open_ball centre_in_ball continuous_on_open_avoid e z nz)  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   933
  have "(\<lambda>z. inverse (f z)) holomorphic_on ball z (min e e')" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   934
    apply (rule holomorphic_on_inverse)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   935
    apply (metis fh holomorphic_on_subset min.cobounded2 min.commute subset_ball)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   936
    by (metis nz' mem_ball min_less_iff_conj) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   937
  then show "\<exists>e>0. (\<lambda>z. inverse (f z)) holomorphic_on ball z e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   938
    by (metis e e' min_less_iff_conj)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   939
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   940
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   941
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   942
lemma analytic_on_divide:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   943
  assumes f: "f analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   944
      and g: "g analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   945
      and nz: "(\<And>z. z \<in> s \<Longrightarrow> g z \<noteq> 0)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   946
    shows "(\<lambda>z. f z / g z) analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   947
unfolding divide_inverse
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   948
by (metis analytic_on_inverse analytic_on_mult f g nz)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   949
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   950
lemma analytic_on_power:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   951
  "f analytic_on s \<Longrightarrow> (\<lambda>z. (f z) ^ n) analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   952
by (induct n) (auto simp: analytic_on_const analytic_on_mult)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   953
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   954
lemma analytic_on_setsum:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   955
  "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> (f i) analytic_on s)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   956
           \<Longrightarrow> (\<lambda>x. setsum (\<lambda>i. f i x) I) analytic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   957
  by (induct I rule: finite_induct) (auto simp: analytic_on_const analytic_on_add)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   958
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   959
subsection{*analyticity at a point.*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   960
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   961
lemma analytic_at_ball:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   962
  "f analytic_on {z} \<longleftrightarrow> (\<exists>e. 0<e \<and> f holomorphic_on ball z e)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   963
by (metis analytic_on_def singleton_iff)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   964
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   965
lemma analytic_at:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   966
    "f analytic_on {z} \<longleftrightarrow> (\<exists>s. open s \<and> z \<in> s \<and> f holomorphic_on s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   967
by (metis analytic_on_holomorphic empty_subsetI insert_subset)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   968
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   969
lemma analytic_on_analytic_at:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   970
    "f analytic_on s \<longleftrightarrow> (\<forall>z \<in> s. f analytic_on {z})"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   971
by (metis analytic_at_ball analytic_on_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   972
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   973
lemma analytic_at_two:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   974
  "f analytic_on {z} \<and> g analytic_on {z} \<longleftrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   975
   (\<exists>s. open s \<and> z \<in> s \<and> f holomorphic_on s \<and> g holomorphic_on s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   976
  (is "?lhs = ?rhs")
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   977
proof 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   978
  assume ?lhs
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   979
  then obtain s t 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   980
    where st: "open s" "z \<in> s" "f holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   981
              "open t" "z \<in> t" "g holomorphic_on t"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   982
    by (auto simp: analytic_at)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   983
  show ?rhs
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   984
    apply (rule_tac x="s \<inter> t" in exI)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   985
    using st
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   986
    apply (auto simp: Diff_subset holomorphic_on_subset)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   987
    done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   988
next
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   989
  assume ?rhs 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   990
  then show ?lhs
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   991
    by (force simp add: analytic_at)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   992
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   993
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   994
subsection{*Combining theorems for derivative with ``analytic at'' hypotheses*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   995
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   996
lemma 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   997
  assumes "f analytic_on {z}" "g analytic_on {z}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   998
  shows complex_derivative_add_at: "DD (\<lambda>w. f w + g w) z = DD f z + DD g z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   999
    and complex_derivative_diff_at: "DD (\<lambda>w. f w - g w) z = DD f z - DD g z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1000
    and complex_derivative_mult_at: "DD (\<lambda>w. f w * g w) z =
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1001
           f z * DD g z + DD f z * g z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1002
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1003
  obtain s where s: "open s" "z \<in> s" "f holomorphic_on s" "g holomorphic_on s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1004
    using assms by (metis analytic_at_two)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1005
  show "DD (\<lambda>w. f w + g w) z = DD f z + DD g z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1006
    apply (rule DERIV_imp_DD [OF DERIV_add])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1007
    using s
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1008
    apply (auto simp: holomorphic_on_open complex_differentiable_def DD_iff_derivative_complex_differentiable)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1009
    done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1010
  show "DD (\<lambda>w. f w - g w) z = DD f z - DD g z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1011
    apply (rule DERIV_imp_DD [OF DERIV_diff])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1012
    using s
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1013
    apply (auto simp: holomorphic_on_open complex_differentiable_def DD_iff_derivative_complex_differentiable)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1014
    done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1015
  show "DD (\<lambda>w. f w * g w) z = f z * DD g z + DD f z * g z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1016
    apply (rule DERIV_imp_DD [OF DERIV_mult'])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1017
    using s
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1018
    apply (auto simp: holomorphic_on_open complex_differentiable_def DD_iff_derivative_complex_differentiable)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1019
    done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1020
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1021
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1022
lemma complex_derivative_cmult_at:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1023
  "f analytic_on {z} \<Longrightarrow>  DD (\<lambda>w. c * f w) z = c * DD f z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1024
by (auto simp: complex_derivative_mult_at complex_derivative_const analytic_on_const)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1025
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1026
lemma complex_derivative_cmult_right_at:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1027
  "f analytic_on {z} \<Longrightarrow>  DD (\<lambda>w. f w * c) z = DD f z * c"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1028
by (auto simp: complex_derivative_mult_at complex_derivative_const analytic_on_const)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1029
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1030
text{*A composition lemma for functions of mixed type*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1031
lemma has_vector_derivative_real_complex:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1032
  fixes f :: "complex \<Rightarrow> complex"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1033
  assumes "DERIV f (of_real a) :> f'"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1034
  shows "((\<lambda>x. f (of_real x)) has_vector_derivative f') (at a)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1035
  using diff_chain_at [OF has_derivative_ident, of f "op * f'" a] assms
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1036
  unfolding has_field_derivative_def has_vector_derivative_def o_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1037
  by (auto simp: mult_ac scaleR_conv_of_real)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1038
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1039
subsection{*Complex differentiation of sequences and series*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1040
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1041
lemma has_complex_derivative_sequence:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1042
  fixes s :: "complex set"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1043
  assumes cvs: "convex s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1044
      and df:  "\<And>n x. x \<in> s \<Longrightarrow> (f n has_field_derivative f' n x) (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1045
      and conv: "\<And>e. 0 < e \<Longrightarrow> \<exists>N. \<forall>n x. n \<ge> N \<longrightarrow> x \<in> s \<longrightarrow> norm (f' n x - g' x) \<le> e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1046
      and "\<exists>x l. x \<in> s \<and> ((\<lambda>n. f n x) ---> l) sequentially"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1047
    shows "\<exists>g. \<forall>x \<in> s. ((\<lambda>n. f n x) ---> g x) sequentially \<and> 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1048
                       (g has_field_derivative (g' x)) (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1049
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1050
  from assms obtain x l where x: "x \<in> s" and tf: "((\<lambda>n. f n x) ---> l) sequentially"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1051
    by blast
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1052
  { fix e::real assume e: "e > 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1053
    then obtain N where N: "\<forall>n\<ge>N. \<forall>x. x \<in> s \<longrightarrow> cmod (f' n x - g' x) \<le> e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1054
      by (metis conv)    
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1055
    have "\<exists>N. \<forall>n\<ge>N. \<forall>x\<in>s. \<forall>h. cmod (f' n x * h - g' x * h) \<le> e * cmod h"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1056
    proof (rule exI [of _ N], clarify)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1057
      fix n y h
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1058
      assume "N \<le> n" "y \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1059
      then have "cmod (f' n y - g' y) \<le> e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1060
        by (metis N)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1061
      then have "cmod h * cmod (f' n y - g' y) \<le> cmod h * e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1062
        by (auto simp: antisym_conv2 mult_le_cancel_left norm_triangle_ineq2)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1063
      then show "cmod (f' n y * h - g' y * h) \<le> e * cmod h"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1064
        by (simp add: norm_mult [symmetric] field_simps)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1065
    qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1066
  } note ** = this
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1067
  show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1068
  unfolding has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1069
  proof (rule has_derivative_sequence [OF cvs _ _ x])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1070
    show "\<forall>n. \<forall>x\<in>s. (f n has_derivative (op * (f' n x))) (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1071
      by (metis has_field_derivative_def df)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1072
  next show "(\<lambda>n. f n x) ----> l"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1073
    by (rule tf)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1074
  next show "\<forall>e>0. \<exists>N. \<forall>n\<ge>N. \<forall>x\<in>s. \<forall>h. cmod (f' n x * h - g' x * h) \<le> e * cmod h"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1075
    by (blast intro: **)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1076
  qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1077
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1078
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1079
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1080
lemma has_complex_derivative_series:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1081
  fixes s :: "complex set"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1082
  assumes cvs: "convex s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1083
      and df:  "\<And>n x. x \<in> s \<Longrightarrow> (f n has_field_derivative f' n x) (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1084
      and conv: "\<And>e. 0 < e \<Longrightarrow> \<exists>N. \<forall>n x. n \<ge> N \<longrightarrow> x \<in> s 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1085
                \<longrightarrow> cmod ((\<Sum>i<n. f' i x) - g' x) \<le> e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1086
      and "\<exists>x l. x \<in> s \<and> ((\<lambda>n. f n x) sums l)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1087
    shows "\<exists>g. \<forall>x \<in> s. ((\<lambda>n. f n x) sums g x) \<and> ((g has_field_derivative g' x) (at x within s))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1088
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1089
  from assms obtain x l where x: "x \<in> s" and sf: "((\<lambda>n. f n x) sums l)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1090
    by blast
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1091
  { fix e::real assume e: "e > 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1092
    then obtain N where N: "\<forall>n x. n \<ge> N \<longrightarrow> x \<in> s 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1093
            \<longrightarrow> cmod ((\<Sum>i<n. f' i x) - g' x) \<le> e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1094
      by (metis conv)    
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1095
    have "\<exists>N. \<forall>n\<ge>N. \<forall>x\<in>s. \<forall>h. cmod ((\<Sum>i<n. h * f' i x) - g' x * h) \<le> e * cmod h"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1096
    proof (rule exI [of _ N], clarify)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1097
      fix n y h
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1098
      assume "N \<le> n" "y \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1099
      then have "cmod ((\<Sum>i<n. f' i y) - g' y) \<le> e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1100
        by (metis N)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1101
      then have "cmod h * cmod ((\<Sum>i<n. f' i y) - g' y) \<le> cmod h * e"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1102
        by (auto simp: antisym_conv2 mult_le_cancel_left norm_triangle_ineq2)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1103
      then show "cmod ((\<Sum>i<n. h * f' i y) - g' y * h) \<le> e * cmod h"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1104
        by (simp add: norm_mult [symmetric] field_simps setsum_right_distrib)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1105
    qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1106
  } note ** = this
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1107
  show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1108
  unfolding has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1109
  proof (rule has_derivative_series [OF cvs _ _ x])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1110
    fix n x
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1111
    assume "x \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1112
    then show "((f n) has_derivative (\<lambda>z. z * f' n x)) (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1113
      by (metis df has_field_derivative_def mult_commute_abs)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1114
  next show " ((\<lambda>n. f n x) sums l)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1115
    by (rule sf)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1116
  next show "\<forall>e>0. \<exists>N. \<forall>n\<ge>N. \<forall>x\<in>s. \<forall>h. cmod ((\<Sum>i<n. h * f' i x) - g' x * h) \<le> e * cmod h"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1117
    by (blast intro: **)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1118
  qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1119
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1120
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1121
subsection{*Bound theorem*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1122
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1123
lemma complex_differentiable_bound:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1124
  fixes s :: "complex set"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1125
  assumes cvs: "convex s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1126
      and df:  "\<And>z. z \<in> s \<Longrightarrow> (f has_field_derivative f' z) (at z within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1127
      and dn:  "\<And>z. z \<in> s \<Longrightarrow> norm (f' z) \<le> B"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1128
      and "x \<in> s"  "y \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1129
    shows "norm(f x - f y) \<le> B * norm(x - y)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1130
  apply (rule differentiable_bound [OF cvs])
56223
7696903b9e61 generalize theory of operator norms to work with class real_normed_vector
huffman
parents: 56217
diff changeset
  1131
  apply (rule ballI, erule df [unfolded has_field_derivative_def])
7696903b9e61 generalize theory of operator norms to work with class real_normed_vector
huffman
parents: 56217
diff changeset
  1132
  apply (rule ballI, rule onorm_le, simp add: norm_mult mult_right_mono dn)
7696903b9e61 generalize theory of operator norms to work with class real_normed_vector
huffman
parents: 56217
diff changeset
  1133
  apply fact
7696903b9e61 generalize theory of operator norms to work with class real_normed_vector
huffman
parents: 56217
diff changeset
  1134
  apply fact
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1135
  done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1136
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1137
subsection{*Inverse function theorem for complex derivatives.*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1138
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1139
lemma has_complex_derivative_inverse_basic:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1140
  fixes f :: "complex \<Rightarrow> complex"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1141
  shows "DERIV f (g y) :> f' \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1142
        f' \<noteq> 0 \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1143
        continuous (at y) g \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1144
        open t \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1145
        y \<in> t \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1146
        (\<And>z. z \<in> t \<Longrightarrow> f (g z) = z)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1147
        \<Longrightarrow> DERIV g y :> inverse (f')"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1148
  unfolding has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1149
  apply (rule has_derivative_inverse_basic)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1150
  apply (auto simp:  bounded_linear_mult_right)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1151
  done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1152
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1153
(*Used only once, in Multivariate/cauchy.ml. *)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1154
lemma has_complex_derivative_inverse_strong:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1155
  fixes f :: "complex \<Rightarrow> complex"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1156
  shows "DERIV f x :> f' \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1157
         f' \<noteq> 0 \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1158
         open s \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1159
         x \<in> s \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1160
         continuous_on s f \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1161
         (\<And>z. z \<in> s \<Longrightarrow> g (f z) = z)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1162
         \<Longrightarrow> DERIV g (f x) :> inverse (f')"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1163
  unfolding has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1164
  apply (rule has_derivative_inverse_strong [of s x f g ])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1165
  using assms 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1166
  by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1167
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1168
lemma has_complex_derivative_inverse_strong_x:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1169
  fixes f :: "complex \<Rightarrow> complex"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1170
  shows  "DERIV f (g y) :> f' \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1171
          f' \<noteq> 0 \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1172
          open s \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1173
          continuous_on s f \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1174
          g y \<in> s \<Longrightarrow> f(g y) = y \<Longrightarrow>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1175
          (\<And>z. z \<in> s \<Longrightarrow> g (f z) = z)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1176
          \<Longrightarrow> DERIV g y :> inverse (f')"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1177
  unfolding has_field_derivative_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1178
  apply (rule has_derivative_inverse_strong_x [of s g y f])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1179
  using assms 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1180
  by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1181
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1182
subsection{*Further useful properties of complex conjugation*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1183
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1184
lemma lim_cnj: "((\<lambda>x. cnj(f x)) ---> cnj l) F \<longleftrightarrow> (f ---> l) F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1185
  by (simp add: tendsto_iff dist_complex_def Complex.complex_cnj_diff [symmetric])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1186
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1187
lemma sums_cnj: "((\<lambda>x. cnj(f x)) sums cnj l) \<longleftrightarrow> (f sums l)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1188
  by (simp add: sums_def lim_cnj cnj_setsum [symmetric])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1189
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1190
lemma continuous_within_cnj: "continuous (at z within s) cnj"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1191
by (metis bounded_linear_cnj linear_continuous_within)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1192
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1193
lemma continuous_on_cnj: "continuous_on s cnj"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1194
by (metis bounded_linear_cnj linear_continuous_on)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1195
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1196
subsection{*Some limit theorems about real part of real series etc.*}
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1197
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1198
lemma real_lim:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1199
  fixes l::complex
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1200
  assumes "(f ---> l) F" and " ~(trivial_limit F)" and "eventually P F" and "\<And>a. P a \<Longrightarrow> f a \<in> \<real>"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1201
  shows  "l \<in> \<real>"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1202
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1203
  have 1: "((\<lambda>i. Im (f i)) ---> Im l) F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1204
    by (metis assms(1) tendsto_Im) 
56217
dc429a5b13c4 Some rationalisation of basic lemmas
paulson <lp15@cam.ac.uk>
parents: 56215
diff changeset
  1205
  then have  "((\<lambda>i. Im (f i)) ---> 0) F" using assms
dc429a5b13c4 Some rationalisation of basic lemmas
paulson <lp15@cam.ac.uk>
parents: 56215
diff changeset
  1206
    by (metis (mono_tags, lifting) Lim_eventually complex_is_Real_iff eventually_mono)
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1207
  then show ?thesis using 1
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1208
    by (metis 1 assms(2) complex_is_Real_iff tendsto_unique) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1209
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1210
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1211
lemma real_lim_sequentially:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1212
  fixes l::complex
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1213
  shows "(f ---> l) sequentially \<Longrightarrow> (\<exists>N. \<forall>n\<ge>N. f n \<in> \<real>) \<Longrightarrow> l \<in> \<real>"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1214
by (rule real_lim [where F=sequentially]) (auto simp: eventually_sequentially)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1216
lemma real_series: 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1217
  fixes l::complex
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1218
  shows "f sums l \<Longrightarrow> (\<And>n. f n \<in> \<real>) \<Longrightarrow> l \<in> \<real>"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1219
unfolding sums_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1220
by (metis real_lim_sequentially setsum_in_Reals)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1221
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1222
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1223
lemma Lim_null_comparison_Re:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1224
   "eventually (\<lambda>x. norm(f x) \<le> Re(g x)) F \<Longrightarrow>  (g ---> 0) F \<Longrightarrow> (f ---> 0) F"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1225
  by (metis Lim_null_comparison complex_Re_zero tendsto_Re)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1226
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1227
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1228
lemma norm_setsum_bound:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1229
  fixes n::nat
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1230
  shows" \<lbrakk>\<And>n. N \<le> n \<Longrightarrow> norm (f n) \<le> g n; N \<le> m\<rbrakk>
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1231
       \<Longrightarrow> norm (setsum f {m..<n}) \<le> setsum g {m..<n}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1232
apply (induct n, auto)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1233
by (metis dual_order.trans le_cases le_neq_implies_less norm_triangle_mono)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1234
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1235
56217
dc429a5b13c4 Some rationalisation of basic lemmas
paulson <lp15@cam.ac.uk>
parents: 56215
diff changeset
  1236
(*MOVE? But not to Finite_Cartesian_Product*)
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1237
lemma sums_vec_nth :
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1238
  assumes "f sums a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1239
  shows "(\<lambda>x. f x $ i) sums a $ i"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1240
using assms unfolding sums_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1241
by (auto dest: tendsto_vec_nth [where i=i])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1242
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1243
lemma summable_vec_nth :
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1244
  assumes "summable f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1245
  shows "summable (\<lambda>x. f x $ i)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1246
using assms unfolding summable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1247
by (blast intro: sums_vec_nth)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1248
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1249
lemma sums_Re:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1250
  assumes "f sums a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1251
  shows "(\<lambda>x. Re (f x)) sums Re a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1252
using assms 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1253
by (auto simp: sums_def Re_setsum [symmetric] isCont_tendsto_compose [of a Re])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1254
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1255
lemma sums_Im:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1256
  assumes "f sums a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1257
  shows "(\<lambda>x. Im (f x)) sums Im a"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1258
using assms 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1259
by (auto simp: sums_def Im_setsum [symmetric] isCont_tendsto_compose [of a Im])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1260
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1261
lemma summable_Re:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1262
  assumes "summable f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1263
  shows "summable (\<lambda>x. Re (f x))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1264
using assms unfolding summable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1265
by (blast intro: sums_Re)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1266
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1267
lemma summable_Im:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1268
  assumes "summable f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1269
  shows "summable (\<lambda>x. Im (f x))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1270
using assms unfolding summable_def
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1271
by (blast intro: sums_Im)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1272
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1273
lemma series_comparison_complex:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1274
  fixes f:: "nat \<Rightarrow> 'a::banach"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1275
  assumes sg: "summable g"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1276
     and "\<And>n. g n \<in> \<real>" "\<And>n. Re (g n) \<ge> 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1277
     and fg: "\<And>n. n \<ge> N \<Longrightarrow> norm(f n) \<le> norm(g n)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1278
  shows "summable f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1279
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1280
  have g: "\<And>n. cmod (g n) = Re (g n)" using assms
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1281
    by (metis abs_of_nonneg in_Reals_norm)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1282
  show ?thesis
56217
dc429a5b13c4 Some rationalisation of basic lemmas
paulson <lp15@cam.ac.uk>
parents: 56215
diff changeset
  1283
    apply (rule summable_comparison_test' [where g = "\<lambda>n. norm (g n)" and N=N])
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1284
    using sg
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1285
    apply (auto simp: summable_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1286
    apply (rule_tac x="Re s" in exI)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1287
    apply (auto simp: g sums_Re)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1288
    apply (metis fg g)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1289
    done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1290
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1291
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1292
lemma summable_complex_of_real [simp]:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1293
  "summable (\<lambda>n. complex_of_real (f n)) = summable f"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1294
apply (auto simp: Series.summable_Cauchy)  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1295
apply (drule_tac x = e in spec, auto)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1296
apply (rule_tac x=N in exI)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1297
apply (auto simp: of_real_setsum [symmetric])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1298
done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1299
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1300
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1301
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1302
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1303
lemma setsum_Suc_reindex:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1304
  fixes f :: "nat \<Rightarrow> 'a::ab_group_add"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1305
    shows  "setsum f {0..n} = f 0 - f (Suc n) + setsum (\<lambda>i. f (Suc i)) {0..n}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1306
by (induct n) auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1307
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1308
56217
dc429a5b13c4 Some rationalisation of basic lemmas
paulson <lp15@cam.ac.uk>
parents: 56215
diff changeset
  1309
text{*A kind of complex Taylor theorem.*}
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1310
lemma complex_taylor:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1311
  assumes s: "convex s" 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1312
      and f: "\<And>i x. x \<in> s \<Longrightarrow> i \<le> n \<Longrightarrow> (f i has_field_derivative f (Suc i) x) (at x within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1313
      and B: "\<And>x. x \<in> s \<Longrightarrow> cmod (f (Suc n) x) \<le> B"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1314
      and w: "w \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1315
      and z: "z \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1316
    shows "cmod(f 0 z - (\<Sum>i\<le>n. f i w * (z-w) ^ i / of_nat (fact i)))
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1317
          \<le> B * cmod(z - w)^(Suc n) / fact n"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1318
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1319
  have wzs: "closed_segment w z \<subseteq> s" using assms
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1320
    by (metis convex_contains_segment)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1321
  { fix u
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1322
    assume "u \<in> closed_segment w z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1323
    then have "u \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1324
      by (metis wzs subsetD)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1325
    have "(\<Sum>i\<le>n. f i u * (- of_nat i * (z-u)^(i - 1)) / of_nat (fact i) +
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1326
                      f (Suc i) u * (z-u)^i / of_nat (fact i)) = 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1327
              f (Suc n) u * (z-u) ^ n / of_nat (fact n)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1328
    proof (induction n)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1329
      case 0 show ?case by simp
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1330
    next
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1331
      case (Suc n)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1332
      have "(\<Sum>i\<le>Suc n. f i u * (- of_nat i * (z-u) ^ (i - 1)) / of_nat (fact i) +
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1333
                             f (Suc i) u * (z-u) ^ i / of_nat (fact i)) =  
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1334
           f (Suc n) u * (z-u) ^ n / of_nat (fact n) +
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1335
           f (Suc (Suc n)) u * ((z-u) * (z-u) ^ n) / of_nat (fact (Suc n)) -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1336
           f (Suc n) u * ((1 + of_nat n) * (z-u) ^ n) / of_nat (fact (Suc n))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1337
        using Suc by simp
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1338
      also have "... = f (Suc (Suc n)) u * (z-u) ^ Suc n / of_nat (fact (Suc n))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1339
      proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1340
        have "of_nat(fact(Suc n)) *
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1341
             (f(Suc n) u *(z-u) ^ n / of_nat(fact n) +
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1342
               f(Suc(Suc n)) u *((z-u) *(z-u) ^ n) / of_nat(fact(Suc n)) -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1343
               f(Suc n) u *((1 + of_nat n) *(z-u) ^ n) / of_nat(fact(Suc n))) =
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1344
            (of_nat(fact(Suc n)) *(f(Suc n) u *(z-u) ^ n)) / of_nat(fact n) +
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1345
            (of_nat(fact(Suc n)) *(f(Suc(Suc n)) u *((z-u) *(z-u) ^ n)) / of_nat(fact(Suc n))) -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1346
            (of_nat(fact(Suc n)) *(f(Suc n) u *(of_nat(Suc n) *(z-u) ^ n))) / of_nat(fact(Suc n))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1347
          by (simp add: algebra_simps del: fact_Suc)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1348
        also have "... =
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1349
                   (of_nat (fact (Suc n)) * (f (Suc n) u * (z-u) ^ n)) / of_nat (fact n) +
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1350
                   (f (Suc (Suc n)) u * ((z-u) * (z-u) ^ n)) -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1351
                   (f (Suc n) u * ((1 + of_nat n) * (z-u) ^ n))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1352
          by (simp del: fact_Suc)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1353
        also have "... = 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1354
                   (of_nat (Suc n) * (f (Suc n) u * (z-u) ^ n)) +
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1355
                   (f (Suc (Suc n)) u * ((z-u) * (z-u) ^ n)) -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1356
                   (f (Suc n) u * ((1 + of_nat n) * (z-u) ^ n))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1357
          by (simp only: fact_Suc of_nat_mult mult_ac) simp
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1358
        also have "... = f (Suc (Suc n)) u * ((z-u) * (z-u) ^ n)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1359
          by (simp add: algebra_simps)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1360
        finally show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1361
        by (simp add: mult_left_cancel [where c = "of_nat (fact (Suc n))", THEN iffD1] del: fact_Suc)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1362
      qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1363
      finally show ?case .
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1364
    qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1365
    then have "((\<lambda>v. (\<Sum>i\<le>n. f i v * (z - v)^i / of_nat (fact i))) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1366
                has_field_derivative f (Suc n) u * (z-u) ^ n / of_nat (fact n))
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1367
               (at u within s)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1368
      apply (intro DERIV_intros DERIV_power[THEN DERIV_cong])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1369
      apply (blast intro: assms `u \<in> s`)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1370
      apply (rule refl)+
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1371
      apply (auto simp: field_simps)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1372
      done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1373
  } note sum_deriv = this
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1374
  { fix u
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1375
    assume u: "u \<in> closed_segment w z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1376
    then have us: "u \<in> s"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1377
      by (metis wzs subsetD)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1378
    have "cmod (f (Suc n) u) * cmod (z - u) ^ n \<le> cmod (f (Suc n) u) * cmod (u - z) ^ n"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1379
      by (metis norm_minus_commute order_refl)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1380
    also have "... \<le> cmod (f (Suc n) u) * cmod (z - w) ^ n"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1381
      by (metis mult_left_mono norm_ge_zero power_mono segment_bound [OF u])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1382
    also have "... \<le> B * cmod (z - w) ^ n"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1383
      by (metis norm_ge_zero zero_le_power mult_right_mono  B [OF us])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1384
    finally have "cmod (f (Suc n) u) * cmod (z - u) ^ n \<le> B * cmod (z - w) ^ n" .
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1385
  } note cmod_bound = this
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1386
  have "(\<Sum>i\<le>n. f i z * (z - z) ^ i / of_nat (fact i)) = (\<Sum>i\<le>n. (f i z / of_nat (fact i)) * 0 ^ i)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1387
    by simp
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1388
  also have "\<dots> = f 0 z / of_nat (fact 0)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1389
    by (subst setsum_zero_power) simp
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1390
  finally have "cmod (f 0 z - (\<Sum>i\<le>n. f i w * (z - w) ^ i / of_nat (fact i))) 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1391
            \<le> cmod ((\<Sum>i\<le>n. f i w * (z - w) ^ i / of_nat (fact i)) -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1392
                    (\<Sum>i\<le>n. f i z * (z - z) ^ i / of_nat (fact i)))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1393
    by (simp add: norm_minus_commute)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1394
  also have "... \<le> B * cmod (z - w) ^ n / real_of_nat (fact n) * cmod (w - z)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1395
    apply (rule complex_differentiable_bound 
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1396
      [where f' = "\<lambda>w. f (Suc n) w * (z - w)^n / of_nat(fact n)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1397
         and s = "closed_segment w z", OF convex_segment])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1398
    apply (auto simp: ends_in_segment real_of_nat_def DERIV_subset [OF sum_deriv wzs]
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1399
                  norm_divide norm_mult norm_power divide_le_cancel cmod_bound)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1400
    done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1401
  also have "...  \<le> B * cmod (z - w) ^ Suc n / real (fact n)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1402
    by (simp add: algebra_simps norm_minus_commute real_of_nat_def)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1403
  finally show ?thesis .
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1404
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1405
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
  1406
end