src/HOL/Analysis/Lipschitz.thy
changeset 71174 7fac205dd737
parent 70817 dd675800469d
child 71633 07bec530f02e
equal deleted inserted replaced
71173:caede3159e23 71174:7fac205dd737
   542   obtain d where d: "d>0" "\<And>x'. x'\<in>T \<Longrightarrow> dist x' t < d \<Longrightarrow> dist (g x') (g t) < u"
   542   obtain d where d: "d>0" "\<And>x'. x'\<in>T \<Longrightarrow> dist x' t < d \<Longrightarrow> dist (g x') (g t) < u"
   543     by (auto)
   543     by (auto)
   544   show "\<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. L-lipschitz_on  (cball x u \<inter> X) (f (g t))"
   544   show "\<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. L-lipschitz_on  (cball x u \<inter> X) (f (g t))"
   545     using d \<open>0 < u\<close>
   545     using d \<open>0 < u\<close>
   546     by (fastforce intro: exI[where x="(min d u)/2"] exI[where x=L]
   546     by (fastforce intro: exI[where x="(min d u)/2"] exI[where x=L]
   547       intro!: less_imp_le[OF d(2)] lipschitz_on_subset[OF l] simp: dist_commute mem_ball mem_cball)
   547       intro!: less_imp_le[OF d(2)] lipschitz_on_subset[OF l] simp: dist_commute)
   548 qed
   548 qed
   549 
   549 
   550 context
   550 context
   551   fixes T::"'a::metric_space set" and X f
   551   fixes T::"'a::metric_space set" and X f
   552   assumes local_lipschitz: "local_lipschitz T X f"
   552   assumes local_lipschitz: "local_lipschitz T X f"
   608     note \<open>dist x a < ?d\<close>
   608     note \<open>dist x a < ?d\<close>
   609     also have "?d \<le> u" by simp
   609     also have "?d \<le> u" by simp
   610     finally have "dist x a < u" .
   610     finally have "dist x a < u" .
   611     then have "x \<in> cball a u \<inter> T"
   611     then have "x \<in> cball a u \<inter> T"
   612       using \<open>x \<in> T\<close>
   612       using \<open>x \<in> T\<close>
   613       by (auto simp: dist_commute mem_cball)
   613       by (auto simp: dist_commute)
   614     have "dist (f x y) (f a b) \<le> dist (f x y) (f x b) + dist (f x b) (f a b)"
   614     have "dist (f x y) (f a b) \<le> dist (f x y) (f x b) + dist (f x b) (f a b)"
   615       by (rule dist_triangle)
   615       by (rule dist_triangle)
   616     also have "(L + 1)-lipschitz_on (cball b u \<inter> X) (f x)"
   616     also have "(L + 1)-lipschitz_on (cball b u \<inter> X) (f x)"
   617       using L[OF \<open>x \<in> cball a u \<inter> T\<close>]
   617       using L[OF \<open>x \<in> cball a u \<inter> T\<close>]
   618       by (rule lipschitz_on_le) simp
   618       by (rule lipschitz_on_le) simp
   709     from L lt ly lx \<open>lx = ly\<close>
   709     from L lt ly lx \<open>lx = ly\<close>
   710     have
   710     have
   711       "eventually (\<lambda>n. ?t n \<in> ball lt u) sequentially"
   711       "eventually (\<lambda>n. ?t n \<in> ball lt u) sequentially"
   712       "eventually (\<lambda>n. ?y n \<in> ball lx u) sequentially"
   712       "eventually (\<lambda>n. ?y n \<in> ball lx u) sequentially"
   713       "eventually (\<lambda>n. ?x n \<in> ball lx u) sequentially"
   713       "eventually (\<lambda>n. ?x n \<in> ball lx u) sequentially"
   714       by (auto simp: dist_commute Lim mem_ball)
   714       by (auto simp: dist_commute Lim)
   715     moreover have "eventually (\<lambda>n. n > L) sequentially"
   715     moreover have "eventually (\<lambda>n. n > L) sequentially"
   716       by (metis filterlim_at_top_dense filterlim_real_sequentially)
   716       by (metis filterlim_at_top_dense filterlim_real_sequentially)
   717     ultimately
   717     ultimately
   718     have "eventually (\<lambda>_. False) sequentially"
   718     have "eventually (\<lambda>_. False) sequentially"
   719     proof eventually_elim
   719     proof eventually_elim
   720       case (elim n)
   720       case (elim n)
   721       hence "dist (f (?t n) (?y n)) (f (?t n) (?x n)) \<le> L * dist (?y n) (?x n)"
   721       hence "dist (f (?t n) (?y n)) (f (?t n) (?x n)) \<le> L * dist (?y n) (?x n)"
   722         using assms xy t
   722         using assms xy t
   723         unfolding dist_norm[symmetric]
   723         unfolding dist_norm[symmetric]
   724         by (intro lipschitz_onD[OF L(2)]) (auto simp: mem_ball mem_cball)
   724         by (intro lipschitz_onD[OF L(2)]) (auto)
   725       also have "\<dots> \<le> n * dist (?y n) (?x n)"
   725       also have "\<dots> \<le> n * dist (?y n) (?x n)"
   726         using elim by (intro mult_right_mono) auto
   726         using elim by (intro mult_right_mono) auto
   727       also have "\<dots> \<le> rx (ry (rt n)) * dist (?y n) (?x n)"
   727       also have "\<dots> \<le> rx (ry (rt n)) * dist (?y n) (?x n)"
   728         by (intro mult_right_mono[OF _ zero_le_dist])
   728         by (intro mult_right_mono[OF _ zero_le_dist])
   729            (meson lt'(2) lx'(2) ly'(2) of_nat_le_iff order_trans seq_suble)
   729            (meson lt'(2) lx'(2) ly'(2) of_nat_le_iff order_trans seq_suble)
   770   obtain u L v M where "0 < u" "(\<And>s. s \<in> cball t u \<inter> A \<Longrightarrow> L-lipschitz_on (cball x u \<inter> B) (f s))"
   770   obtain u L v M where "0 < u" "(\<And>s. s \<in> cball t u \<inter> A \<Longrightarrow> L-lipschitz_on (cball x u \<inter> B) (f s))"
   771     "0 < v" "(\<And>s. s \<in> cball t v \<inter> A \<Longrightarrow> M-lipschitz_on (cball x v \<inter> B) (g s))"
   771     "0 < v" "(\<And>s. s \<in> cball t v \<inter> A \<Longrightarrow> M-lipschitz_on (cball x v \<inter> B) (g s))"
   772     by metis
   772     by metis
   773   then show "\<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> A. L-lipschitz_on (cball x u \<inter> B) (\<lambda>b. (f t b, g t b))"
   773   then show "\<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> A. L-lipschitz_on (cball x u \<inter> B) (\<lambda>b. (f t b, g t b))"
   774     by (intro exI[where x="min u v"])
   774     by (intro exI[where x="min u v"])
   775       (force intro: lipschitz_on_subset intro!: lipschitz_on_Pair simp: mem_cball)
   775       (force intro: lipschitz_on_subset intro!: lipschitz_on_Pair)
   776 qed
   776 qed
   777 
   777 
   778 lemma local_lipschitz_constI: "local_lipschitz S T (\<lambda>t x. f t)"
   778 lemma local_lipschitz_constI: "local_lipschitz S T (\<lambda>t x. f t)"
   779   by (auto simp: intro!: local_lipschitzI lipschitz_on_constant intro: exI[where x=1])
   779   by (auto simp: intro!: local_lipschitzI lipschitz_on_constant intro: exI[where x=1])
   780 
   780 
   807   have "compact (cball t v \<times> cball x u)" "cball t v \<times> cball x u \<subseteq> T \<times> X"
   807   have "compact (cball t v \<times> cball x u)" "cball t v \<times> cball x u \<subseteq> T \<times> X"
   808     by (auto intro!: compact_Times)
   808     by (auto intro!: compact_Times)
   809   then have "compact (f' ` (cball t v \<times> cball x u))"
   809   then have "compact (f' ` (cball t v \<times> cball x u))"
   810     by (auto intro!: compact_continuous_image continuous_on_subset[OF cont_f'])
   810     by (auto intro!: compact_continuous_image continuous_on_subset[OF cont_f'])
   811   then obtain B where B: "B > 0" "\<And>s y. s \<in> cball t v \<Longrightarrow> y \<in> cball x u \<Longrightarrow> norm (f' (s, y)) \<le> B"
   811   then obtain B where B: "B > 0" "\<And>s y. s \<in> cball t v \<Longrightarrow> y \<in> cball x u \<Longrightarrow> norm (f' (s, y)) \<le> B"
   812     by (auto dest!: compact_imp_bounded simp: bounded_pos simp: mem_ball)
   812     by (auto dest!: compact_imp_bounded simp: bounded_pos)
   813 
   813 
   814   have lipschitz: "B-lipschitz_on (cball x (min u v) \<inter> X) (f s)" if s: "s \<in> cball t v" for s
   814   have lipschitz: "B-lipschitz_on (cball x (min u v) \<inter> X) (f s)" if s: "s \<in> cball t v" for s
   815   proof -
   815   proof -
   816     note s
   816     note s
   817     also note \<open>cball t v \<subseteq> T\<close>
   817     also note \<open>cball t v \<subseteq> T\<close>
   822     have "norm (f s y - f s z) \<le> B * norm (y - z)"
   822     have "norm (f s y - f s z) \<le> B * norm (y - z)"
   823       if "y \<in> cball x u" "z \<in> cball x u"
   823       if "y \<in> cball x u" "z \<in> cball x u"
   824       for y z
   824       for y z
   825       using s that
   825       using s that
   826       by (intro differentiable_bound[OF convex_cball deriv])
   826       by (intro differentiable_bound[OF convex_cball deriv])
   827         (auto intro!: B  simp: norm_blinfun.rep_eq[symmetric] mem_cball)
   827         (auto intro!: B  simp: norm_blinfun.rep_eq[symmetric])
   828     then show ?thesis
   828     then show ?thesis
   829       using \<open>0 < B\<close>
   829       using \<open>0 < B\<close>
   830       by (auto intro!: lipschitz_onI simp: dist_norm mem_cball)
   830       by (auto intro!: lipschitz_onI simp: dist_norm)
   831   qed
   831   qed
   832   show "\<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. L-lipschitz_on (cball x u \<inter> X) (f t)"
   832   show "\<exists>u>0. \<exists>L. \<forall>t\<in>cball t u \<inter> T. L-lipschitz_on (cball x u \<inter> X) (f t)"
   833     by (force intro: exI[where x="min u v"] exI[where x=B] intro!: lipschitz simp: u v mem_cball)
   833     by (force intro: exI[where x="min u v"] exI[where x=B] intro!: lipschitz simp: u v)
   834 qed
   834 qed
   835 
   835 
   836 end
   836 end