src/HOL/Multivariate_Analysis/Extended_Real_Limits.thy
changeset 51641 cd05e9fcc63d
parent 51530 609914f0934a
child 53374 a14d2a854c02
equal deleted inserted replaced
51640:d022e8bd2375 51641:cd05e9fcc63d
   888 qed simp
   888 qed simp
   889 
   889 
   890 lemma Liminf_within:
   890 lemma Liminf_within:
   891   fixes f :: "'a::metric_space \<Rightarrow> 'b::complete_lattice"
   891   fixes f :: "'a::metric_space \<Rightarrow> 'b::complete_lattice"
   892   shows "Liminf (at x within S) f = (SUP e:{0<..}. INF y:(S \<inter> ball x e - {x}). f y)"
   892   shows "Liminf (at x within S) f = (SUP e:{0<..}. INF y:(S \<inter> ball x e - {x}). f y)"
   893   unfolding Liminf_def eventually_within_less
   893   unfolding Liminf_def eventually_at
   894 proof (rule SUPR_eq, simp_all add: Ball_def Bex_def, safe)
   894 proof (rule SUPR_eq, simp_all add: Ball_def Bex_def, safe)
   895   fix P d assume "0 < d" "\<forall>y. y \<in> S \<longrightarrow> 0 < dist y x \<and> dist y x < d \<longrightarrow> P y"
   895   fix P d assume "0 < d" "\<forall>y. y \<in> S \<longrightarrow> y \<noteq> x \<and> dist y x < d \<longrightarrow> P y"
   896   then have "S \<inter> ball x d - {x} \<subseteq> {x. P x}"
   896   then have "S \<inter> ball x d - {x} \<subseteq> {x. P x}"
   897     by (auto simp: zero_less_dist_iff dist_commute)
   897     by (auto simp: zero_less_dist_iff dist_commute)
   898   then show "\<exists>r>0. INFI (Collect P) f \<le> INFI (S \<inter> ball x r - {x}) f"
   898   then show "\<exists>r>0. INFI (Collect P) f \<le> INFI (S \<inter> ball x r - {x}) f"
   899     by (intro exI[of _ d] INF_mono conjI `0 < d`) auto
   899     by (intro exI[of _ d] INF_mono conjI `0 < d`) auto
   900 next
   900 next
   901   fix d :: real assume "0 < d"
   901   fix d :: real assume "0 < d"
   902   then show "\<exists>P. (\<exists>d>0. \<forall>xa. xa \<in> S \<longrightarrow> 0 < dist xa x \<and> dist xa x < d \<longrightarrow> P xa) \<and>
   902   then show "\<exists>P. (\<exists>d>0. \<forall>xa. xa \<in> S \<longrightarrow> xa \<noteq> x \<and> dist xa x < d \<longrightarrow> P xa) \<and>
   903     INFI (S \<inter> ball x d - {x}) f \<le> INFI (Collect P) f"
   903     INFI (S \<inter> ball x d - {x}) f \<le> INFI (Collect P) f"
   904     by (intro exI[of _ "\<lambda>y. y \<in> S \<inter> ball x d - {x}"])
   904     by (intro exI[of _ "\<lambda>y. y \<in> S \<inter> ball x d - {x}"])
   905        (auto intro!: INF_mono exI[of _ d] simp: dist_commute)
   905        (auto intro!: INF_mono exI[of _ d] simp: dist_commute)
   906 qed
   906 qed
   907 
   907 
   908 lemma Limsup_within:
   908 lemma Limsup_within:
   909   fixes f :: "'a::metric_space => 'b::complete_lattice"
   909   fixes f :: "'a::metric_space => 'b::complete_lattice"
   910   shows "Limsup (at x within S) f = (INF e:{0<..}. SUP y:(S \<inter> ball x e - {x}). f y)"
   910   shows "Limsup (at x within S) f = (INF e:{0<..}. SUP y:(S \<inter> ball x e - {x}). f y)"
   911   unfolding Limsup_def eventually_within_less
   911   unfolding Limsup_def eventually_at
   912 proof (rule INFI_eq, simp_all add: Ball_def Bex_def, safe)
   912 proof (rule INFI_eq, simp_all add: Ball_def Bex_def, safe)
   913   fix P d assume "0 < d" "\<forall>y. y \<in> S \<longrightarrow> 0 < dist y x \<and> dist y x < d \<longrightarrow> P y"
   913   fix P d assume "0 < d" "\<forall>y. y \<in> S \<longrightarrow> y \<noteq> x \<and> dist y x < d \<longrightarrow> P y"
   914   then have "S \<inter> ball x d - {x} \<subseteq> {x. P x}"
   914   then have "S \<inter> ball x d - {x} \<subseteq> {x. P x}"
   915     by (auto simp: zero_less_dist_iff dist_commute)
   915     by (auto simp: zero_less_dist_iff dist_commute)
   916   then show "\<exists>r>0. SUPR (S \<inter> ball x r - {x}) f \<le> SUPR (Collect P) f"
   916   then show "\<exists>r>0. SUPR (S \<inter> ball x r - {x}) f \<le> SUPR (Collect P) f"
   917     by (intro exI[of _ d] SUP_mono conjI `0 < d`) auto
   917     by (intro exI[of _ d] SUP_mono conjI `0 < d`) auto
   918 next
   918 next
   919   fix d :: real assume "0 < d"
   919   fix d :: real assume "0 < d"
   920   then show "\<exists>P. (\<exists>d>0. \<forall>xa. xa \<in> S \<longrightarrow> 0 < dist xa x \<and> dist xa x < d \<longrightarrow> P xa) \<and>
   920   then show "\<exists>P. (\<exists>d>0. \<forall>xa. xa \<in> S \<longrightarrow> xa \<noteq> x \<and> dist xa x < d \<longrightarrow> P xa) \<and>
   921     SUPR (Collect P) f \<le> SUPR (S \<inter> ball x d - {x}) f"
   921     SUPR (Collect P) f \<le> SUPR (S \<inter> ball x d - {x}) f"
   922     by (intro exI[of _ "\<lambda>y. y \<in> S \<inter> ball x d - {x}"])
   922     by (intro exI[of _ "\<lambda>y. y \<in> S \<inter> ball x d - {x}"])
   923        (auto intro!: SUP_mono exI[of _ d] simp: dist_commute)
   923        (auto intro!: SUP_mono exI[of _ d] simp: dist_commute)
   924 qed
   924 qed
   925 
   925